skills/document/SKILL.md
Write, update, or audit documentation. Use when asked to 'document this', 'write docs', 'update the README', 'add JSDoc', 'write a changelog', or 'create an ADR'.
npx skillsauth add arndvs/ctrlshft documentInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Output "Read Document skill." to chat to acknowledge you read this file.
Pipeline position: can be used standalone or after /do-work to document what was just built.
Also use proactively when a conversation contains code, architecture decisions, API design, data models, or system flows that have no corresponding documentation — even if the user hasn't asked explicitly. When in doubt, scan the conversation and propose a documentation plan.
You write accurate, minimal, audience-appropriate documentation. You do not invent behavior — you document what the code actually does. If something is unclear, you read the source before writing. You also generate Mermaid.js diagrams whenever a concept is better understood visually than in prose.
Before asking anything, read the current conversation and extract signals. Look for:
| Signal | Suggested doc type | | ------------------------------------------- | -------------------------------- | | Functions, classes, interfaces | JSDoc / inline comments | | System or service descriptions | README + architecture diagram | | API routes, request/response shapes | API reference + sequence diagram | | A decision being made or justified | ADR | | Data model, schema, entity relationships | ERD (Mermaid) + data dictionary | | Auth, request, or processing flows | Flowchart or sequence diagram | | State transitions (order status, lifecycle) | State diagram | | A shipped or completed feature | Changelog entry + user guide | | Multi-service or distributed system | C4 context/container diagram | | Branching strategy or git workflow | Git graph diagram | | Timeline, milestones, release plan | Gantt chart |
Based on what you find, propose a documentation plan before asking the user anything. Example:
"I can see you've described an auth flow, a user data model, and a deployment decision. I'd suggest: (1) a sequence diagram for the auth flow, (2) an ERD for the data model, (3) an ADR for the deployment choice, and (4) a README section covering setup. Want me to proceed with all of these, or adjust the scope?"
Only ask clarifying questions for genuine gaps that can't be inferred.
If the conversation doesn't provide enough signal, ask:
What type of documentation? (select all that apply)
Where does it live?
Ask both in a single message. Do not proceed until answered.
Read source files, existing docs, and git history before writing. Never document from memory or assumption.
git log or merged PRs since last release@param, @returns, @throws where non-obviousFollow WHY / WHAT / HOW:
Scannable. No walls of text. Prefer code blocks over prose for commands.
# ADR-NNN: [Title]
Date: YYYY-MM-DD
Status: Proposed | Accepted | Deprecated | Superseded by ADR-NNN
## Context
[What situation forced this decision?]
## Decision
[What was decided?]
## Consequences
[What does this make easier? What does it make harder?]
Follow Keep a Changelog format:
## [version] - YYYY-MM-DD
### Added
### Changed
### Fixed
### Removed
Read git log or merged PRs to populate. Never fabricate entries.
Generate Mermaid diagrams whenever a concept is better understood visually. Choose the right type:
flowchart TD
A[User submits form] --> B{Valid?}
B -- Yes --> C[Save to DB]
B -- No --> D[Return errors]
C --> E[Send confirmation email]
sequenceDiagram
participant Client
participant API
participant Auth
participant DB
Client->>API: POST /login
API->>Auth: Validate credentials
Auth-->>API: Token
API->>DB: Log session
API-->>Client: 200 OK + token
erDiagram
USER {
uuid id PK
string email
string name
}
ORDER {
uuid id PK
uuid user_id FK
string status
timestamp created_at
}
USER ||--o{ ORDER : places
stateDiagram-v2
[*] --> Draft
Draft --> Submitted : user submits
Submitted --> Approved : admin approves
Submitted --> Rejected : admin rejects
Approved --> [*]
Rejected --> Draft : user revises
classDiagram
class Animal {
+String name
+speak() void
}
class Dog {
+fetch() void
}
Animal <|-- Dog
C4Context
Person(user, "User", "Uses the web app")
System(app, "Web App", "Core application")
System_Ext(email, "Email Service", "Sends transactional email")
Rel(user, app, "Uses")
Rel(app, email, "Sends via")
gantt
title Release Plan
dateFormat YYYY-MM-DD
section Phase 1
Auth module :done, 2025-01-01, 2025-01-14
API layer :active, 2025-01-15, 2025-01-28
section Phase 2
Dashboard UI :2025-01-29, 2025-02-11
gitGraph
commit
branch feature/auth
checkout feature/auth
commit
commit
checkout main
merge feature/auth
commit
Rules for diagrams:
Do:
Do not:
| Type | When to use | | ----------------------- | --------------------------------- | | JSDoc / inline comments | Functions, classes, modules | | README | New project or missing onboarding | | ADR | Architecture or tech decisions | | User guide | Feature walkthrough for end users | | API reference | Public-facing endpoints or SDK | | Changelog | After a release or sprint | | Flowchart | Decision logic, request lifecycle | | Sequence diagram | Service interactions, auth flows | | ERD | Data models, schema relationships | | State diagram | Lifecycle, status transitions | | Class diagram | OOP structures, inheritance | | C4 diagram | System context, containers | | Gantt chart | Timelines, milestones | | Git graph | Branching and merge strategy |
If context is high before documentation is complete, follow the standard handoff protocol (@~/dotfiles/instructions/handoff.instructions.md) — persist progress to working/ and provide the pickup command.
development
Use when implementing UI, checking dark/light mode, or validating animations — adds a visual feedback loop via browser screenshots so frontend changes are verified, not assumed.
development
Use when Claude Code sessions had many manual approval ("press 1") prompts or when auditing hook permissions; identifies which Bash commands required approval.
tools
Use after merging a PR or during periodic cleanup to archive plan-mode files by linking them to merged PRs.
testing
Use when stress-testing a plan against the project's domain model — grills the design, sharpens terminology, and updates documentation (CONTEXT.md, ADRs) inline as decisions crystallise.