agentleFS
drinkspillerdrinkspiller/skills/markdown_output_hierarchy/SKILL.md

markdown-output-hierarchy

Skill1 starsChanged 6 days agoUnlicenseView on GitHub

Enforces a systematic formatting hierarchy in markdown documentation files. Use when creating or editing .md files — covers headers, emphasis, code spans, links, admonitions, tables, and lists. Maps six semantic roles to markdown primitives with a decision tree for ambiguous cases.

  • Installs packages

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 5 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When two roles could apply, the higher-priority role wins.

    line 41
  2. Distinctive:

    When you're unsure which role applies, walk this tree:

    line 55
  3. Very specific:

    When writing key-value documentation (Label: value), classify the value:

    line 111
  4. Distinctive:

    Use vertical spacing to create visual clusters in documentation.

    line 130
  5. Distinctive:

    Use markdown heading levels consistently:

    line 160
  6. Very specific:

    Never skip levels (e.g., # → ### with no ##).

    line 171
  7. Very specific:

    Use --- horizontal rules to separate thematically distinct sections at the same heading level.

    line 172
  8. Distinctive:

    Don't use headers for emphasis — if you need emphasis within a paragraph, use bold.

    line 174

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Markdown Output Hierarchy

When to Use

Apply this system whenever you create or edit a markdown documentation file. Triggers:

  • "write a README"
  • "create documentation"
  • "format this doc"
  • "clean up the markdown"
  • "make this doc more readable"
  • editing any .md file (README, g3doc, changelog, guide)

The System

Six roles, no overlap. Every piece of documentation text gets exactly one:

RoleMarkdownWhen to use
Structure**bold**, ## headers, --- rulesSection headings, key term introductions, label text (**Mode:**), table headers
Secondaryitalic, plain text, parentheticalsExplanatory context, descriptions, caveats the reader can skip, parenthetical asides
Actionable`inline code`, [links](url), fenced code blocksData values (identifiers, versions, branches, commits, modes), commands to run, API names, file paths, URLs — the "answer" to any label
Safe✅ emoji, bold positive termsSuccess states, "enabled", "complete", "included", "supported", positive confirmations
Caution⚠️ emoji, bold caution termsNon-destructive warnings, deprecation notices, "experimental", "not yet supported", "use with care"
Danger🚨 emoji, bold danger terms, blockquote calloutsBreaking changes, data loss risk, security warnings, removal notices. Never for informational content.

The Hierarchy Rule

When two roles could apply, the higher-priority role wins. Priority order (highest first):

  1. Danger
  2. Caution
  3. Safe
  4. Actionable
  5. Structure
  6. Secondary

Decision Tree for Ambiguous Cases

When you're unsure which role applies, walk this tree:

Is this a STATUS WORD (enabled, deprecated, supported, removed, complete)?
  └─ Yes → Is it positive? → ✅ **bold** (safe)
           Is it cautionary? → ⚠️ **bold** (caution)

Is this a DATA VALUE — the "answer" to a label in key-value text?
  └─ Yes → `inline code` (actionable)

Is this a COMMAND, PATH, API NAME, or URL the reader will copy/click?
  └─ Yes → `inline code` or [link](url) (actionable)

Could this cause DATA LOSS, BREAKAGE, or a SECURITY issue?
  └─ Yes → 🚨 **bold** + blockquote callout (danger)

Does the reader need to NOTICE this but it's not dangerous?
  └─ Yes → Is it positive/confirming?
       └─ Yes → ✅ **bold** (safe)
       └─ No  → ⚠️ **bold** (caution)

Is this a KEY TERM, LABEL, or SECTION HEADING?
  └─ Yes → **bold** or ## header (structure)

Is this EXPLANATORY text, a parenthetical, or a caveat?
  └─ Yes → *italic* or plain text (secondary)

None of the above?
  └─ Plain text, no formatting

Common Ambiguous Cases

ScenarioTempting choiceCorrect choiceWhy
Mode name prod in key-value textbold`code`It's a data value — the answer to "Mode:"
Branch name mainplain text`code`It's a data value the reader may cross-reference
Commit hash 3b620488plain text`code`It's a data value the reader may search for
Function name in a sentencebold`code`It's an actionable API reference, not emphasis
"Deprecated" label`code`⚠️ boldIt's a caution state, not something to copy
File path in an explanationitalic`code`The reader might need to copy/navigate to it
"Required" next to a field⚠️ cautionboldIt's structural metadata, not a warning
Config value truebold`code`It's a literal value the reader would type
"Successfully deployed"`code`✅ boldIt's a positive state, not a copyable string
Config filename app.yaml`code`italicSupporting detail — not the point of the row
Parenthetical (tree-shake)plain textitalicAlways secondary context
Flag --verbose in prosebold`code`It's a literal CLI flag
--no-promote in prose emphasis`code`boldEmphasis within a sentence, not actionable here
"This will delete all data"⚠️ caution🚨 dangerData loss = danger, not caution
Environment name "staging"bold`code`It's an actionable identifier
"Note:" at start of a linebolditalicIt's secondary context, not a structural label

Value Types in Key-Value Text

When writing key-value documentation (**Label:** value), classify the value:

Value typeRoleExamples
Identifier`code`version strings, commit hashes, branch names
State/choice`code`mode names (prod, staging), environment names
Copyable reference`code` or [link](url)URLs, shell commands, API endpoints
Status word✅ or ⚠️ bold"supported", "deprecated", "enabled", "removed"
Config/pathitalicapp.prod.yaml, requirements.txt
Parentheticalitalic(production tree-shake), (default)

The rule is simple: if the value is the answer the reader is scanning for, it's `code`. If it's supporting detail, it's italic. If it's a status signal, it keeps its semantic role (✅/⚠️).


Spacing & Grouping

Use vertical spacing to create visual clusters in documentation.

Rules

ContextSpacing
Before a ## heading1 blank line
After a --- horizontal rule1 blank line
Between groups of related key-value rows1 blank line
Between rows within the same group0 blank lines
After a code block1 blank line
Between a callout and its explanation0 blank lines

Grouping Principle

Cluster content by what it describes, not by its role or formatting. Common groups:

  • Identity: branch, commit, version (what code)
  • Configuration: config file, flags, options (how it's built)
  • Result: URL, status, output (what happened)
  • Standalone: mode, project — values that shape everything below

A standalone value gets a blank line after it. Groups of 2–4 related items stay tight. One blank line separates groups.


Heading Hierarchy

Use markdown heading levels consistently:

LevelMarkdownUsage
H1#Document title only — one per file
H2##Major sections: "Getting Started", "Configuration", "API Reference"
H3###Sub-sections: individual steps, specific endpoints, sub-topics
H4####Rare — nested sub-details within an H3

Rules

  • Never skip levels (e.g., # → ### with no ##).
  • Use --- horizontal rules to separate thematically distinct sections at the same heading level.
  • Don't use headers for emphasis — if you need emphasis within a paragraph, use bold.

Patterns

API / CLI Reference Entry

Structure for the command name, Actionable for flags and values, Secondary for descriptions:

### `gcloud app deploy`

Deploy an application to Google App Engine.

**Flags:**

| Flag | Default | Description |
| :--- | :------ | :---------- |
| `--project` | — | *The target GCP project ID.* |
| `--promote` | `true` | *Route all traffic to the new version.* |
| `--no-promote` | — | *Deploy without routing traffic. ⚠️ Requires manual promotion.* |

**Returns:** The deployed version URL.

Step-by-Step Tutorial

Structure for step headers, Actionable for commands, Secondary for explanations, Safe for completion:

## Getting Started

### Step 1: Install dependencies

*This installs the core SDK and its peer dependencies.*

`​`​`bash
npm install @example/sdk
`​`​`

### Step 2: Configure your project

Create a config file at `~/.example/config.yaml`:

`​`​`yaml
project: my-app
region: us-central1
`​`​`

### Step 3: Verify

Run the health check:

`​`​`bash
example doctor
`​`​`

✅ **You should see "All checks passed."** You're ready to build.

Configuration Table

Structure for headers, Actionable for keys and defaults, Secondary for descriptions, Caution for constraints. Group related rows and separate groups with a blank line in the description:

## Configuration Options

| Key | Type | Default | Description |
| :--- | :--- | :------ | :---------- |
| `port` | `number` | `8080` | *The port the server listens on.* |
| `timeout_ms` | `number` | `30000` | *Request timeout.* ⚠️ **Values below 1000 may cause dropped connections.** |
| `log_level` | `string` | `"info"` | *One of:* `"debug"`, `"info"`, `"warn"`, `"error"`. |
| `enable_cache` | `boolean` | `true` | *In-memory response cache.* |

Concept Introduction

Structure for the term, Secondary for the definition and rationale, Actionable for related code/API:

## Circuit Breaker

**Circuit Breaker** is a resilience pattern that prevents cascading failures
by stopping requests to an unhealthy dependency.

*When a downstream service fails repeatedly, the circuit "opens" — all
subsequent calls return immediately with an error instead of waiting for
a timeout. After a cooldown period, the circuit "half-opens" to test
recovery.*

In code, wrap outbound calls with `CircuitBreaker.execute()`:

`​`​`python
breaker = CircuitBreaker(failure_threshold=5, recovery_timeout=30)
result = breaker.execute(lambda: client.get("/health"))
`​`​`

Troubleshooting Entry

Danger or Caution for the symptom, Secondary for the cause, Actionable for the fix:

## Troubleshooting

### ⚠️ "Connection refused" on startup

*The server cannot bind to the configured port because another process
is already using it.*

Check what's using the port and kill it:

`​`​`bash
lsof -i :8080
kill -9 <PID>
`​`​`

Then restart:

`​`​`bash
example serve
`​`​`

---

### 🚨 "Data integrity check failed"

*The local cache is corrupted. This typically happens after an unclean
shutdown.*

**This will delete your local cache.** Back up first if needed:

`​`​`bash
cp -r ~/.example/cache ~/.example/cache.bak
example cache --reset
`​`​`

Warning / Breaking Change Callout

Danger for breaking changes, Caution for deprecations, Actionable for migration commands:

> 🚨 **Breaking Change in v3.0:** The `legacy_mode` config key has been
> removed. If your `config.yaml` contains this key, delete it before
> upgrading or the server will fail to start.

> ⚠️ **Deprecated:** `client.fetch()` is deprecated and will be removed
> in v4.0. Use `client.request()` instead. See the
> [migration guide](./migration-v4.md).

Code Example with Explanation

Actionable for the code block, Secondary for line-by-line explanations, Structure for the section label:

### Example: Retry with exponential backoff

`​`​`python
import time

def retry(fn, max_attempts=3, base_delay=1.0):
    for attempt in range(max_attempts):
        try:
            return fn()
        except Exception as e:
            if attempt == max_attempts - 1:
                raise
            delay = base_delay * (2 ** attempt)
            time.sleep(delay)
`​`​`

*The `base_delay` doubles after each failure (`1s → 2s → 4s`), giving
the downstream service time to recover without overwhelming it with
retries.*

Before / After Migration Guide

Structure for labels, Actionable for code, Caution for what changed, Safe for the result:

## Migrating from v2 to v3

⚠️ **The `init()` function signature has changed.** The `options` parameter
is now required.

**Before (v2):**

`​`​`python
client = Client.init()
`​`​`

**After (v3):**

`​`​`python
client = Client.init(options=ClientOptions(region="us-central1"))
`​`​`

✅ **After updating all call sites**, run the migration validator:

`​`​`bash
example migrate --check
`​`​`

Anti-Patterns

  1. Bold everything — If everything is bold, nothing is. Reserve **bold** for structural labels and role-specific emphasis only.
  2. Code spans for emphasis — `don't do this` for words that aren't code. Use bold or italic instead. Code formatting implies "this is a literal, copyable value."
  3. Admonitions for routine info — Callout blocks (blockquotes with emoji) are for genuinely exceptional situations. Don't use 🚨 or ⚠️ for things the reader expects.
  4. Naked links — https://example.com is hard to scan. Always use descriptive link text: [Example docs](https://example.com).
  5. Formatting salad — Using bold + italic + code in one phrase: don't. Pick one role per span.
  6. Headers as emphasis — ### Don't use headers just to make text big. Headers create navigable structure. If you need emphasis within a paragraph, use bold.
  7. Emoji overload — ✅ and ⚠️ carry meaning in this system. Don't mix in decorative emoji (🎉 🚀 💡) — they dilute the signal.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.