npx skills add ...
npx skills add posit-dev/skills --skill describe-design
Research a codebase and create architectural documentation describing how features or systems work. Use when the user asks to: (1) Document how a feature works, (2) Create an architecture overview, (3) Explain code structure for onboarding or knowledge transfer, (4) Research and describe a system's design. Produces markdown documents with Mermaid diagrams and stable code references suitable for humans and AI agents.
npx skills add posit-dev/skills --skill describe-design
Research a codebase and produce an architectural document describing how features or systems work. The output is a markdown file organized for both human readers and future AI agents.
Understand what to document before exploring:
Explore the codebase broadly to build a mental model. Use lightweight, fast exploration methods when available (for example, use a fast Explore subagent if your harness supports subagents):
Present a high-level outline to the user:
When the user confirms the scope, move on to deep research.
For each component in the approved outline:
Try to rely on the initial code exploration for much of this information. Read additional files as needed. If the scope changed considerably in Stage 2, you can engage a second code exploration subagent.
You're ready to draft when you can:
Signs you're not done:
Signs you've gone too far:
Generate the document following the template below. Present the draft to the user for review and iterate based on feedback. If available, use the AskUserQuestion tool to request user input on key decisions.
docs/architecture/, ARCHITECTURE.md), but NEVER write the file
without explicit user confirmation of the location. If the user provided a path upfront,
that counts as confirmation.The following template provides a starting point. Adapt it to fit the feature being documented — omit sections that don't apply, add sections for unique aspects, and adjust the structure to best serve the target audience.
Use stable references that survive refactoring:
src/auth/login.ts)path/to/file.ext with key symbols listed separatelyhandleAuth function in auth/)Avoid:
Use Mermaid for architecture visualizations:
Flowcharts for component relationships:
Sequence diagrams for request flows:
Keep diagrams focused on the specific feature being documented. Avoid overcrowding with unrelated components.
flowchart TD
A[Client] --> B[API Gateway]
B --> C[Service]
C --> D[(Database)]sequenceDiagram
Client->>API: Request
API->>Service: Process
Service-->>API: Response
API-->>Client: Result