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
In this repository76 other files it gives its agents.
- AGENTS.mdAGENTS.md
- ad-copy-writerSkill
- ae-inspect-describeSkill
- algorithmic-artSkill
- animation-directorSkill
- assembly-guideSkill
- brainstorming-and-ideatingSkill
- brainstorming-research-ideasSkill
- brainstormingSkill
- brief-to-tasksSkill
- canvas-designSkill
- cli-designSkill
- cli-output-hierarchySkill
- commit-messageSkill
- craft-uiSkill
- creative-directorSkill
- design-briefSkill
- design-flowSkill
- design-mock-auditSkill
- design-reviewSkill
- design-system-patternsSkill
- design-tokensSkill
- deslopifySkill
- diagnoseSkill
- diagramming-app-routesSkill
- doc-restructureSkill
- eval-criticSkill
- formatting-open-markdownsSkill
- frontend-designSkill
- frontend-slidesSkill
- gdocs-tab-writerSkill
- gemini-apiSkill
- gif-creationSkill
- github_repo_researchSkill
- grill-meSkill
- grill-with-docsSkill
- hallmarkSkill
- handoffSkill
- html-presentationSkill
- humanizerSkill
- i-have-adhdSkill
- improve-codebase-architectureSkill
- information-architectureSkill
- install-skill-from-githubSkill
- marketing-psychologySkill
- merge-latestSkill
- modern-web-performanceSkill
- motion-designSkill
- pdf-readerSkill
- pm-brainstormingSkill
- pm-discovery-brainstormSkill
- product-marketingSkill
- prototypeSkill
- pull-requestSkill
- ralph_loopSkill
- react-best-practicesSkill
- review-loopSkill
- sandbox-explainerSkill
- skill-creatorSkill
- skill-optSkill
- The first 60 shown.
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
- Distinctive: line 41
When two roles could apply, the higher-priority role wins.
- Distinctive: line 55
When you're unsure which role applies, walk this tree:
- Very specific: line 111
When writing key-value documentation (Label: value), classify the value:
- Distinctive: line 130
Use vertical spacing to create visual clusters in documentation.
- Distinctive: line 160
Use markdown heading levels consistently:
- Very specific: line 171
Never skip levels (e.g., # → ### with no ##).
- Very specific: line 172
Use --- horizontal rules to separate thematically distinct sections at the same heading level.
- Distinctive: line 174
Don't use headers for emphasis — if you need emphasis within a paragraph, use bold.
≈ “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.
Files
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
.mdfile (README, g3doc, changelog, guide)
The System
Six roles, no overlap. Every piece of documentation text gets exactly one:
| Role | Markdown | When to use |
| Structure | **bold**, ## headers, --- rules | Section headings, key term introductions, label text (**Mode:**), table headers |
| Secondary | italic, plain text, parentheticals | Explanatory context, descriptions, caveats the reader can skip, parenthetical asides |
| Actionable | `inline code`, [links](url), fenced code blocks | Data values (identifiers, versions, branches, commits, modes), commands to run, API names, file paths, URLs — the "answer" to any label |
| Safe | ✅ emoji, bold positive terms | Success states, "enabled", "complete", "included", "supported", positive confirmations |
| Caution | ⚠️ emoji, bold caution terms | Non-destructive warnings, deprecation notices, "experimental", "not yet supported", "use with care" |
| Danger | 🚨 emoji, bold danger terms, blockquote callouts | Breaking 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):
- Danger
- Caution
- Safe
- Actionable
- Structure
- 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 formattingCommon Ambiguous Cases
| Scenario | Tempting choice | Correct choice | Why |
Mode name prod in key-value text | bold | `code` | It's a data value — the answer to "Mode:" |
Branch name main | plain text | `code` | It's a data value the reader may cross-reference |
Commit hash 3b620488 | plain text | `code` | It's a data value the reader may search for |
| Function name in a sentence | bold | `code` | It's an actionable API reference, not emphasis |
| "Deprecated" label | `code` | ⚠️ bold | It's a caution state, not something to copy |
| File path in an explanation | italic | `code` | The reader might need to copy/navigate to it |
| "Required" next to a field | ⚠️ caution | bold | It's structural metadata, not a warning |
Config value true | bold | `code` | It's a literal value the reader would type |
| "Successfully deployed" | `code` | ✅ bold | It's a positive state, not a copyable string |
Config filename app.yaml | `code` | italic | Supporting detail — not the point of the row |
| Parenthetical (tree-shake) | plain text | italic | Always secondary context |
Flag --verbose in prose | bold | `code` | It's a literal CLI flag |
--no-promote in prose emphasis | `code` | bold | Emphasis within a sentence, not actionable here |
| "This will delete all data" | ⚠️ caution | 🚨 danger | Data loss = danger, not caution |
| Environment name "staging" | bold | `code` | It's an actionable identifier |
| "Note:" at start of a line | bold | italic | It's secondary context, not a structural label |
Value Types in Key-Value Text
When writing key-value documentation (**Label:** value), classify the value:
| Value type | Role | Examples |
| 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/path | italic | app.prod.yaml, requirements.txt |
| Parenthetical | italic | (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
| Context | Spacing |
Before a ## heading | 1 blank line |
After a --- horizontal rule | 1 blank line |
| Between groups of related key-value rows | 1 blank line |
| Between rows within the same group | 0 blank lines |
| After a code block | 1 blank line |
| Between a callout and its explanation | 0 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:
| Level | Markdown | Usage |
| 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
- Bold everything — If everything is bold, nothing is. Reserve
**bold**for structural labels and role-specific emphasis only. - 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." - Admonitions for routine info — Callout blocks (blockquotes with emoji) are for genuinely exceptional situations. Don't use 🚨 or ⚠️ for things the reader expects.
- Naked links —
https://example.comis hard to scan. Always use descriptive link text:[Example docs](https://example.com). - Formatting salad — Using bold + italic + code in one phrase:
don't. Pick one role per span. - 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. - Emoji overload — ✅ and ⚠️ carry meaning in this system. Don't mix in decorative emoji (🎉 🚀 💡) — they dilute the signal.
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
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.

