Hatch3r docs writing

From hatch3r/hatch3r · View interactive version

Hatch3r docs writing is an AI agent skill from the GitHub repository hatch3r/hatch3r. Authors technical documentation through a repeatable workflow — audience analysis, Diátaxis-mode selection, structure, draft, review, publish. Covers READMEs, ADRs, API docs, and runbooks. Use when writing or restructuring any project documentation.

How to use this skill

Skill file

Technical Documentation Workflow

Companion workflow to the hatch3r-docs-writer agent: that agent is the Phase-4 specialist invoked to update specs after a code change; this skill is the step-by-step procedure a human or agent follows to author a documentation artifact from scratch. Use the agent when documentation must track a src/ diff; use this skill when authoring a new doc and you need the audience-analysis-through-publish sequence.

Quick Start

Task Progress:
- [ ] Step 0: Detect ambiguity (P8 B1)
- [ ] Step 1: Classify the doc by Diátaxis mode + name the audience
- [ ] Step 2: Pick the structure template for the chosen mode
- [ ] Step 3: Draft to the template, one mode per document
- [ ] Step 4: Run the review checklist (audience, accuracy, style, structure)
- [ ] Step 5: Publish — link from an index, set owner + last-updated, verify cross-references

The load-bearing decision is Step 1: a document serves exactly one of four user needs. Mixing learning content into a reference table, or burying a how-to procedure inside an explanation, is the most common defect this workflow prevents (Diátaxis — see References).

Step 0 — Detect Ambiguity (P8 B1)

Before any work, scan the invocation for unresolved questions in scope, intent, acceptance criteria, target audience, or irreversibility. If any are found, ask the user via the platform-native question tool per agents/shared/user-question-protocol.md. Do not proceed under silent assumption. Default path, not an exception. Triggers for THIS skill: which doc type is wanted (README vs ADR vs API reference vs runbook), the reader's existing competence (new user vs maintainer vs on-call), whether an existing doc is being restructured (irreversible section moves), and where the published doc is linked from.

Fan-out Discipline (P8 B2)

Fan-out scales with task size; token cost never justifies serializing independent work (rules/hatch3r-fan-out-discipline.md P8 B2; agents/shared/efficiency-patterns.md). Tier boundaries for THIS skill:

Emit sub_agents_spawned: { count, rationale, task_structure } in your output.

Step 1: Classify by Diátaxis Mode and Name the Audience

Every document answers exactly one of four user needs. Pick one mode before writing a single sentence; if a request spans two, split it into two documents.

| Mode | User need | Reader state | Writing stance |

|------|-----------|--------------|----------------|

| Tutorial | Learning by doing | Newcomer, no prior context | Lesson — guarantee a working result, hide edge cases |

| How-to guide | Achieving a stated goal | Already competent, has a task | Recipe — numbered steps to one outcome, no theory |

| Reference | Looking up a fact | Working, needs accuracy | Description — complete, dry, structured, no narrative |

| Explanation | Understanding why | Studying, off-task | Discussion — context, trade-offs, alternatives, rationale |

Map common artifacts to modes:

| Artifact | Primary mode | Note |

|----------|--------------|------|

| README | How-to (quickstart) + Reference (config) | Lead with the 60-second "get it running" path; link out to deep docs |

| API docs | Reference | Endpoint, params, request/response shapes, error codes, auth — one entry per endpoint |

| Runbook | How-to | Operational procedure: prerequisites, numbered steps, verification, rollback |

| ADR | Explanation | A decision and its rationale — context, decision, consequences |

Name the audience explicitly in one sentence (e.g., "on-call engineer mid-incident, has shell access, has not seen this service before"). Write to a US-English global-audience reader: short unambiguous sentences, active voice, direct address with "you" (Google dev-docs style — see References). The audience sentence drives every later choice — vocabulary, assumed prerequisites, depth.

Step 2: Pick the Structure Template

Use the template for the mode chosen in Step 1.

README (how-to + reference):

  1. One-line description of what the project is.
  2. Quickstart — the shortest verified path from clone to a running result.
  3. Prerequisites (versions, accounts, tools).
  4. Configuration reference (table: option, type, default, description).
  5. Links to deeper docs (tutorial, full reference, contributing).

ADR (Nygard format — see References):

  1. Title (NNNN-short-decision-name).
  2. Status (proposed | accepted | rejected | deprecated | superseded by NNNN).
  3. Context (the forces and problem that motivate the decision).
  4. Decision (the change, stated as "we will…").
  5. Consequences (positive and negative effects, including new obligations).

API reference (one block per endpoint):

Runbook (how-to):

  1. Trigger — what condition this runbook handles.
  2. Prerequisites — access, tools, on-call context.
  3. Numbered steps — each step one action with the exact command.
  4. Verification — the observable signal that confirms success.
  5. Rollback — how to undo if a step fails.
  6. Escalation — who to page if the runbook does not resolve it.

Step 3: Draft to the Template

Step 4: Review Checklist

Run all four lenses before publishing. A failure on any line is a blocker.

Audience:

Accuracy:

Style:

Structure:

Step 5: Publish

Error Handling

Definition of Done

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.