engineering/skills/code-documentation/SKILL.md
This skill should be used when the user asks to write, update, review, scaffold, move, remove, or continuously improve documentation for code, folders, services, repos, workflows, architectural decisions, or operational processes. Trigger for inline docs, `README.md`, `ARCHITECTURE.md`, `TESTS.md`, `SETUP.md`, `RUNBOOK.md`, `CHANGELOG.md`, `SECURITY.md`, `OVERVIEW.md`, `FAQ.md`, `DECISIONS.md`, `DEPENDENCIES.md`, `AGENTS.md`, `PLAN.md`, `SPEC.md`, `SOUL.md`, `PRINCIPLES.md`, `DESIGN.md`, `logs/`, `lessons/`, `items/`, `fixes/`, `audits/`, `raw/`, `plans/`, `specs/`, `sources/`, `lib/`, `references/`, `cookbook/`, `knowledge/`, `runbooks/`, `research/`, `official-documentation/`, `context/`, MDX docs, JSDoc/TSDoc, docstrings, ADRs, post-mortems, migration guides, documentation cleanups, and documentation-impact reviews.
npx skillsauth add alvarovillalbaa/agent-suite code-documentationInstall 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.
Last updated: 2026-05-13
Write documentation that stays close to the code, stays coherent over time, and gives humans and agents one clear place to look.
This skill owns the documentation contract, not only doc generation. Use it to:
Documentation in this repo falls into seven surfaces:
README.md, ARCHITECTURE.md, TESTS.md, and related files that explain one folderAGENTS.md, PLAN.md, SPEC.md, SOUL.md, PRINCIPLES.md, DESIGN.md<domain>/<folder>/ only when the repo genuinely needs domain-specific surfaces such as health/ or investing//docs-site command after a full project research phaseDefault rule: put the doc in the narrowest place that future readers will naturally check first. Use surface 7 only when the project has external users or when in-repo Markdown is insufficient.
| Need | Default location |
|---|---|
| Explain a public function, component, hook, API surface, or class | Inline docs |
| Explain what one folder is for and how to navigate it | README.md in that folder |
| Explain internal design or data flow for one folder | ARCHITECTURE.md in that folder |
| Explain how to test one folder or service | TESTS.md in that folder |
| Explain setup for one area | SETUP.md in that folder |
| Explain a folder-local workflow | RUNBOOK.md in that folder |
| Record repo-wide customization to the user's needs, codebase, and ways of working | AGENTS.md |
| Record how plans should be made and reviewed | PLAN.md |
| Record how specs should be written and maintained | SPEC.md |
| Record the agents' personality and collaboration stance | SOUL.md |
| Record invariants, constraints, and max/min rules | PRINCIPLES.md |
| Record the design system or frontend interaction language | DESIGN.md |
| Append a terse change note | logs/YYYY/YYYY-MM-DD/*.md |
| Record a verified reusable lesson | lessons/YYYY/YYYY-MM-DD/*.md |
| Record a durable fact about the user, company, or project | items/YYYY/YYYY-MM-DD/*.md |
| Record a reusable non-obvious fix | fixes/YYYY/YYYY-MM-DD/*.md |
| Record an analytical report, ADR, post-mortem, or audit | audits/YYYY/YYYY-MM-DD/ |
| Store raw material pending ingest | raw/YYYY/YYYY-MM-DD/ unless the repo already has a different ingest convention |
| Record an implementation plan or plan-driven-development artifact | plans/YYYY/YYYY-MM-DD/ |
| Record a living desired-state behavior contract | specs/ |
| Keep monitored URLs and source registries | sources/ |
| Keep generated drafts, registries, or reusable library artifacts | lib/ |
| Keep stable code, API, or URL references | references/ |
| Keep "how we actually do this here" technical recipes | cookbook/ |
| Keep timeless canonical knowledge | knowledge/ |
| Keep operational procedures | runbooks/ |
| Keep ongoing research | research/ |
| Keep copied or vendor official documentation | official-documentation/ |
| Keep contextual docs such as goals, roadmap, budget, or preferences | context/ |
The final Agentic File System is:
logs/ — brief logs, 2 lines max, append to the latest date file, about every meaningful code or doc changelessons/ — lessons learned from experience, related to codeitems/ — facts about the user, company, customers, environments, or other durable contextfixes/ — reusable error solutions and debugging resolutionsaudits/ — comprehensive reports and analytical auditsraw/ — raw source material waiting to be ingested and then promoted into knowledge/ or another canonical destination<domain>/<folder>/ — additional domain-specific paths only when the domain genuinely needs themplans/ — implementation plans and plan-driven-development artifactsspecs/ — living specs describing how something should behavesources/ — URL-based source registries worth monitoring over timelib/ — generated drafts, registries, support artifacts, or other reusable generated contentreferences/ — code, URL, API, schema, and factual referencescookbook/ — technical guides for how something is actually done in this codebaseknowledge/ — timeless maintained knowledge about the codebase and how to do thingsrunbooks/ — operational procedures and exact workflowsresearch/ — continuous research on engineering topicsofficial-documentation/ — copied external official documentation; not continuously iteratedcontext/ — contextual docs such as VALUES.md, USER.md, PREFERENCES.md, context/goals/, context/budget/, context/roadmap/Use one rule only for timestamped material:
*/YYYY/YYYY-MM-DD/*.mdDefault timestamped families:
logs/lessons/items/fixes/audits/raw/plans/Default living documentation families:
specs/sources/lib/references/cookbook/knowledge/runbooks/research/official-documentation/context/Important distinction:
Do not keep the same operational guidance as both a live doc and a timestamped doc unless the timestamped doc is clearly historical context and the living doc clearly owns the current rule.
Every living documentation file must include:
Last updated: YYYY-MM-DD
Place it directly under the H1 or immediately after frontmatter. Refresh it whenever the file is touched.
This applies to:
AGENTS.md, PLAN.md, SPEC.md, SOUL.md, PRINCIPLES.md, DESIGN.mdREADME.md, ARCHITECTURE.md, TESTS.md, SETUP.md, RUNBOOK.md, SECURITY.md, OVERVIEW.md, FAQ.md, DECISIONS.md, DEPENDENCIES.mdspecs/, sources/, lib/, references/, cookbook/, knowledge/, runbooks/, research/, official-documentation/, and context/Outside the AFS folders, every meaningful code folder can carry its own documentation.
Always consider these first:
README.mdARCHITECTURE.mdTESTS.mdAdd only when the folder actually needs them:
SETUP.mdRUNBOOK.mdCHANGELOG.mdSECURITY.mdUse when the domain justifies them:
OVERVIEW.mdFAQ.mdDECISIONS.mdDEPENDENCIES.mdREADME.md — entry point, purpose, usage, links to neighboring docsARCHITECTURE.md — internals, boundaries, flows, and design decisionsTESTS.md — how to run tests, patterns, fixtures, expectationsSETUP.md — non-obvious environment and initialization stepsRUNBOOK.md — local operational workflow for this folderCHANGELOG.md — user-facing or package-facing release historySECURITY.md — security boundaries, secrets handling, abuse cases, review expectationsOVERVIEW.md — concept-first orientation when README would become too denseFAQ.md — repeated questions and troubleshootingDECISIONS.md — folder-local decisions that do not justify standalone ADRsDEPENDENCIES.md — dependency map, contracts, and upgrade notesUse the smallest set that makes the folder legible.
Treat these as first-class documentation, not miscellaneous meta files:
AGENTS.md — general customization to the user's needs, codebase, and ways of workingPLAN.md — customize how planning should be done and what plans should look likeSPEC.md — customize how specs should look and what they must defineSOUL.md — provide personality to AI agentsPRINCIPLES.md — customize principles, constraints, and max/min rules that should always holdDESIGN.md — define the design system and frontend interaction languageWhen the repo's operating model changes, update these the same way you would update a README or runbook.
Before creating or expanding docs:
mv and normalize missing structure with plain mkdir.Examples:
plans/YYYY/YYYY-MM-DD/ and promote the lasting rule into PLAN.md, SPEC.md, runbooks/, cookbook/, or knowledge/.docs/memories/ or docs/guides/ tree conflicts with the final AFS, move or remove it instead of preserving two competing systems.auto-improve should use this taxonomy as its documentation contract and treat root instruction docs as first-class mutation targets.agentic-development should consult this skill before writing plans, specs, runbooks, or promoted learning artifacts.second-brain owns the broader AFS and the raw/ -> knowledge/ compilation model; this skill owns how documentation is routed inside that filesystem.memory-management can shape how memory systems persist and retrieve information, but durable human-readable documentation should still route through this skill's contract.AGENTS.md, CLAUDE.md, project READMEs, BRAIN.md, or existing doc conventions.*/YYYY/YYYY-MM-DD/*.md and normalize directories with mkdir if needed.Last updated: YYYY-MM-DD.Good documentation lets the next engineer or agent answer all of these quickly:
Prefer short, high-signal docs over exhaustive prose. If a doc becomes dense, split the durable parts into the right living doc and keep only the historical context in timestamped artifacts.
Use the /docs-site command to trigger this workflow. Work through all five phases in sequence.
Before writing anything, build a complete mental model of the project.
Use references/project-research.md for the full protocol. Summary:
Do not write documentation until the feature inventory is complete.
Group by user intent, not by code structure:
Every item in the feature inventory must appear in at least one page.
Quality bar:
Use references/docs-site.md for the full setup. Key files:
docs/package.jsondocs/next.config.jsdocs/theme.config.tsxdocs/pages/_meta.json per directorydocs/pages/index.mdx (landing page)Verify npm run build passes before deploying.
Use vercel --prod from within docs/. Configure root directory in Vercel dashboard if needed.
For Next.js or MDX-heavy repos, keep using the existing references and templates in this skill:
references/nextjs-doc-conventions.mdreferences/nextjs-code-to-docs-mapping.mdtemplates/nextjs-api-reference.mdxtemplates/nextjs-guide.mdxUse them only when the repo actually follows that style.
Load only what the task needs:
references/documentation-types.md — AFS taxonomy, root docs, in-folder docs, timestamp/live rulesreferences/continuous-docs.md — logs, lessons, items, fixes, living-doc maintenancereferences/frontend-documentation.md — component, hook, route, and UX-contract docsreferences/one-off-docs.md — audits, ADRs, post-mortems, migration notesreferences/writing-standards.md — tone, structure, anti-patternsreferences/nextjs-doc-conventions.md — MDX conventionsreferences/nextjs-code-to-docs-mapping.md — Next.js source-to-doc mappingreferences/project-research.md — systematic codebase research before writing project-level docsreferences/docs-site.md — Nextra scaffolding, page templates, Vercel deploymenttemplates/service-readme.mdtemplates/runbook.mdtemplates/daily-log.mdtemplates/lesson.mdtemplates/item.mdtemplates/fix.mdtemplates/technical-report.mdtemplates/adr.mdtemplates/post-mortem.mdtemplates/nextjs-api-reference.mdxtemplates/nextjs-guide.mdxscripts/find-docs.sh — locate AFS paths, root instruction docs, in-folder docs, and legacy conflicts before creating or moving filesdevelopment
Use for frontend engineering work such as components, routes, state management, accessibility, performance, design-system integration, and browser-facing debugging or refactors.
tools
Cross-cloud CLI-first cloud operations for AWS, Azure, and GCP. Use when the assistant needs to identify which cloud provider or multi-cloud estate a repo uses, deploy new resources or services, wire automatic deployments, inventory and optimize infrastructure, or diagnose and repair cloud failures entirely from the terminal, with explicit approval gates for high-cost, destructive, identity-sensitive, or hard-to-reverse changes. Covers AWS Amplify full-stack projects, serverless workloads (Lambda, API Gateway, Step Functions, SAM, CDK), and the full AWS database portfolio (RDS, Aurora, Aurora DSQL, DynamoDB, ElastiCache), as well as deep Azure references for diagnostics, storage, compute, compliance, identity, Foundry, and cross-cloud migrations.
development
Use for backend engineering work such as APIs, services, data models, persistence, queues, caching, auth, background jobs, and server-side debugging or refactors.
tools
Use for AI and agent engineering work: system prompt design, tool call architecture, context engineering, memory and learning systems, multi-agent coordination, evals and regression gates, fine-tuning pipelines, RAG, vector stores (TurboPuffer/Pinecone/Azure), agent governance and safety, run steering, skill packages, prompt engineering patterns, constrained generation, ML pipelines, data engineering, and production AI infrastructure.