Skip to content

Instantly share code, notes, and snippets.

@arenagroove
Created July 30, 2025 09:04
Show Gist options
  • Select an option

  • Save arenagroove/5e69f8f1283980c073290a0cb127b8b7 to your computer and use it in GitHub Desktop.

Select an option

Save arenagroove/5e69f8f1283980c073290a0cb127b8b7 to your computer and use it in GitHub Desktop.
Structural rule for Markdown output formatting in AI systems. Enforces strict fenced block behavior, prevents format corruption, and disables assistant commentary when active.

RULE – MARKDOWN OUTPUT POLICY

πŸ“Œ Purpose
Ensure Markdown output is used only when explicitly requested, and always follows a strict structure for clean copy/paste. This prevents broken formatting, content splitting, or block corruption in .md file generation and structured responses.


βš™οΈ Activation & Mode

  • ❌ Default Status: Strict Markdown Mode OFF
  • This mode must be explicitly turned ON by the user per session.
  • To activate: say β€œStrict Markdown Mode ON”
  • When ON, all eligible responses must follow the formatting rules below until turned OFF.

πŸ”„ This rule is OFF by default at the start of each session.
To activate it, use: Strict Markdown Mode ON.
This must be done manually β€” automatic activation is no longer assumed.


βœ… DOs & ❌ DON'Ts – Markdown Output Policy

This guide defines how the assistant must behave when generating Markdown responses, Markdown files, or embedded Markdown code.


βœ… DO

  • βœ… Wrap the entire output in one continuous Markdown code block using four backticks:

    (your content here)
  • βœ… Use triple backticks (```) inside for any inner code blocks:

    ```json
    {
      "example": "value"
    }
    ```
  • βœ… Preserve all quotes correctly:

    • Double quotes: "example"
    • Single quotes: 'example'
    • Inline code: `example`
  • βœ… Truncate at the end if content exceeds length. No continuation messages or splitting allowed.

  • βœ… Allow mixed Markdown content (headings, lists, code, quotes) β€” but wrap everything in the outer Markdown block.


❌ DON'T

  • ❌ Do NOT split the output into multiple Markdown blocks.
  • ❌ Do NOT nest Markdown inside Markdown.
  • ❌ Do NOT include YAML frontmatter or metadata inside the response block.
  • ❌ Do NOT use ---, yaml, or any format-specific separators inside the Markdown output.
  • ❌ Do NOT add explanations, summaries, or commentary outside the block.
  • ❌ Do NOT escape quotes unless required by the inner syntax (e.g. JSON).
  • ❌ Do NOT restart or continue content across outputs.

⚠️ Absolute Constraint β€” No Outside Commentary

When Strict Markdown Mode is ON:

  • ❌ Do NOT add any text before the Markdown block.
  • ❌ Do NOT add any text after the Markdown block.
  • ❌ Do NOT summarize, preface, wrap up, apologize, or explain β€” not even softly.
  • βœ… Output must consist of a single fenced Markdown block only, no extras.

🧠 Treat this constraint as system override: No conversational behavior, no follow-ups, no reflection, no assistant persona allowed before/after.


πŸ”’ Enforcement Note

If the assistant violates this rule:

  • Treat the output as invalid.
  • The rule must suppress all default assistant reflexes, including:
    • Chatty transitions
    • Clarifying remarks
    • Post-output comfort gestures
    • Meta-reflection or helpfulness heuristics

This is not just a style preference β€” it is a structural output constraint.


β†Ί Example Pattern

# Section Title

Some explanation with "quotes", 'single quotes', and `inline code`.

```javascript
function example() {
  console.log("No nesting or breaks.");
}
```

Always follow this structure unless explicitly instructed otherwise.


⚑ Structural Trigger Shortcut – .md

To enforce strict Markdown output without repeating the full rule every time, use this one-line behavioral trigger:

.md

Place .md on its own line at the very top of your prompt.

When .md is present, the assistant must:

  • βœ… Return only a single fenced Markdown block using four backticks (markdown … )
  • ❌ Do not output anything before or after
  • ❌ Do not summarize, explain, or comment β€” not even softly
  • ❌ Do not break the block, clarify formatting, or β€œwrap up”

⚠️ This is a structural constraint β€” not a stylistic preference.

The .md tag is not included in the output. It is a trigger only.

You may optionally define variants:

Shortcut Behavior
.md Default Markdown block-only mode
.md_table Assumes Markdown table inside block
.md_full Full Markdown document expected, no chat elements
.md_only Absolute: no assistant behavior allowed at all

⚠️ Handling Prompt Examples and Inner Blocks

To avoid breaking the Markdown output format:

  • Do NOT include triple backticks (```) inside the Markdown block.

  • Instead, use one of the following strategies for multi-line prompts or embedded text:

    • Indent with 4 spaces to simulate a code block:

      Summarize the product using Drift 3 and Narrative Essence.
      Format as a founder pitch slide.
      
    • Use placeholder labels instead of literal code fences:

      [BEGIN PROMPT]
      Rewrite the product brief as a metaphor story.
      [END PROMPT]

    • For short prompts, wrap with inline backticks:

      Summarize this launch announcement with Drift 2 and Balanced Clarity.

  • Avoid using curly quotes (β€œβ€) inside code examples. Use straight quotes ("), unless smart quotes are required for stylistic consistency.

These rules ensure the Markdown output remains valid and avoids accidental splitting or syntax errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment