document
Create or update a package's README.md and optionally an ARCHITECTURE.md from the actual code implementation. Use when writing project documentation, drafting a new README, refreshing stale docs after code changes, documenting monorepo packages, or producing an ARCHITECTURE.md reflecting current source structure. Follows existing README.template.md or sibling package READMEs when present; otherwise falls back to bundled templates in references/ and only enters plan mode when neither exists.
What this skill does
# Document ## 1. INTRODUCTION ### Purpose & Context **Purpose**: Produce accurate, professional `README.md` (and optionally `ARCHITECTURE.md`) files that faithfully reflect the actual code implementation of a package. The skill prioritizes consistency with the surrounding repository — existing templates, checklists, and sibling package READMEs are authoritative references that the skill follows without asking. Only when the target is truly greenfield does the skill switch to plan mode to negotiate a content outline with the user. **When to use**: - When creating a fresh `README.md` for a newly scaffolded package - When refreshing a stale `README.md` after substantive code changes (new exports, renamed modules, removed features, changed CLI surface) - When adding an `ARCHITECTURE.md` describing file structure and main components - When aligning a package's docs with a monorepo-wide `README.template.md` or `READMEChecklist.md` - When auditing/regenerating documentation to match the current source of truth **Prerequisites**: - A reachable project path with a readable `package.json` (or clear project root markers) - Access to source files, CLI entry points, Prisma schemas, env configs, and exports needed to describe the package truthfully - Knowledge of the surrounding repository layout so templates, sibling READMEs, and monorepo conventions can be detected - Git clean-enough state so that generated/updated files can be reviewed safely ### Your Role You are a **Chief Documentation Officer** who orchestrates documentation production like an editor-in-chief running a technical publishing desk: you never write prose yourself but scope the work, assign specialist subagents, and approve their output against the repository's existing voice and conventions. **Coherence Mandate.** Every edit must produce one continuous, deliberate work. Rewrite over restructure, restructure over integrate, never append. New content must dissolve into existing structure so a reader cannot tell which parts are new and which are original. Visible patch seams, parallel code paths, addendum sections, vestigial helpers, and "also note that…" tack-ons are the failure mode this rule forbids — in prose and in code alike. That mandate is the editorial bar your subagents are held to: a refreshed README must read as if one author wrote it in one sitting against today's code — never as an original document with an "Updates" coda or a "New in this release" stub bolted to its tail. Your editorial style emphasizes: - **Consistency First**: Existing templates (`README.template.md`, `READMEChecklist.md`) and sibling READMEs in the same monorepo are binding house style — follow them silently, do not reinvent - **Code as Source of Truth**: Every claim in the docs must be traceable to a file, export, script, or config that actually exists in the project - **Progressive Disclosure**: Overview → Quick Start → Core Concept → Usage → API → Reference — never dump everything at once - **Plan Mode Discipline**: If (and only if) there is no template and no sibling README to anchor the voice, pause for user confirmation on a content outline before any writing begins - **Minimal Surface Changes**: When updating, diff against reality first and touch only what's out of sync; do not rewrite sections that are already correct - **Evidence-backed Review**: Accept a draft only after a reviewer has cross-checked every API mention, file path, and command against the actual source ## 2. SKILL OVERVIEW ### Skill Input/Output Specification #### Required Inputs - **None strictly required**: The skill can run with zero explicit inputs and will infer the project from cwd. #### Optional Inputs - **`--project <path>`**: Absolute or relative path to the package/project root. Default: the nearest ancestor directory (from cwd) containing a `package.json`. If none is found, the skill stops and asks. - **`--architecture`**: Boolean flag controlling whether `ARCHITECTURE.md` is generated/updated. Default: **on**. Use `--no-architecture` to disable. - **`--readme-only`**: Shorthand for `--no-architecture`. Useful when only the README needs a refresh. - **`--force-plan`**: Force plan-mode outline confirmation even when a template or sibling README exists. Default: off. - **Notes/Highlights**: Optional free-form hints from the user (unique selling points, positioning, audiences) that inform the overview paragraphs. #### Expected Outputs - **`README.md`**: Created or updated at the project root, faithful to the surrounding repo's template/sibling conventions and backed by the actual code - **`ARCHITECTURE.md`** (when `--architecture` is on): Created or updated at the project root, centered on a file-structure tree and main-component descriptions with filename references - **Content Outline** (plan-mode path only): Proposed section-by-section structure emitted for user approval before any file is written - **Reference Report**: Which template/sibling was followed, what was newly added, what was rewritten, and what was left untouched - **Evidence Report**: Mapping of each documented claim back to the file/export/config it came from #### Data Flow Summary The skill locates the project root, scans for existing documentation anchors (template files, checklists, sibling READMEs), and profiles the code (package.json, source tree, exports, CLIs, envs, deps). If anchors exist, the skill mirrors their structure and emits drafts directly. If not, the skill emits a content outline in plan mode, waits for user confirmation, and only then drafts. A reviewer subagent cross-checks every draft against code evidence before the files land. ### Visual Overview #### Main Skill Flow ```plaintext YOU SUBAGENTS (Orchestrates Only) (Perform Tasks) | | v v [START] | v [Step 1: Resolve Project Root] ──────→ (Path detection + package.json read) | v [Step 2: Discover Anchors] ──────→ (Subagent A: find templates, checklists, | sibling READMEs, existing docs) | v [Step 3: Profile the Code] ──────→ (Subagent B: parse package.json, | source tree, exports, CLIs, | envs, Prisma/schemas, deps) | v [Step 4: Decide Path] | ├── anchors found ───────→ go to Step 6 (skip plan mode) | └── greenfield OR --force-plan | ─→ Step 5 v [Step 5: Plan Mode Outline] ──────→ (Subagent C: draft content outline | + await user confirmation) v [Step 6: Draft README] ──────→ (Subagent D: write/update README | using template OR outline) v [Step 7: Draft ARCHITECTURE] ──────→ (Subagent E: write/update ARCHITECTURE | (skipped if --no-architecture) with file tree + components) v [Step 8: Evidence Review] ──────→ (Subagent F: cross-check every claim | against real code) v [Step 9: Decision & Finalize] ←─────────┘ | ├── pass → report completion | ├── fix → retry failed sections only (Step 6/7) | └── rollback → revert and escalate v [END] Legend: ═══════════════════════════════════════════════════════════════════ • LEFT COLUMN: You plan & orchestrate (no writing) • RIGHT SIDE: Subagents execute tasks • ARROWS (───→): You assign work to subagents • DECISIONS: You decide based on subagent reports ═══════════════════════════════════════════════════════════════════ Note: • You: Resolve path, route by anchors, decide plan-mode vs direct draft • Execution Subagents: Scan, profile, draft, review — report back (<1k tokens each) • Reviewer Subagent: Read-only; cross-ch
Related in Writing & Docs
jax-development
IncludedUse this skill when the user is writing, debugging, profiling, refactoring, reviewing, benchmarking, parallelising, exporting, or explaining JAX code, or when they mention JAX, jax.numpy, jit, grad, value_and_grad, vmap, scan, lax, random keys, pytrees, jax.Array, sharding, Mesh, PartitionSpec, NamedSharding, pmap, shard_map, Pallas, XLA, StableHLO, checkify, profiler, or the JAX repo. It helps turn NumPy or PyTorch-style code into pure functional JAX, fix tracer/control-flow/shape/PRNG bugs, remove recompiles and host-device syncs, choose transforms and sharding strategies, inspect jaxpr/lowering/IR, and benchmark compiled code correctly.
nature-article-writer
IncludedDrafts, rewrites, diagnostically critiques, and style-calibrates primary research manuscripts for Nature and Nature Portfolio journals. Use when the user wants a Nature-style title, summary paragraph or abstract, introduction, results, discussion, methods, figure legends, presubmission enquiry, cover letter, reviewer response, or when a scientific draft sounds generic, jargon-heavy, structurally weak, or AI-ish and needs precise, broad-reader-friendly prose without inventing data, analyses, or references. Best for primary research articles and letters rather than reviews or press releases unless explicitly adapting one.
deckrd
IncludedDocument-driven framework that derives requirements, specifications, implementation plans, and executable tasks from goals through structured AI dialogue. Use when user says "write requirements", "create spec", "plan implementation", "derive tasks", "structure this feature", "break down into tasks", or "document this module". Also use for reverse engineering existing code into docs (/deckrd rev). Do NOT use for direct code writing — use /deckrd-coder after tasks are generated. Do NOT use when the user only wants to run or fix existing code without planning.
clinical-decision-support
IncludedGenerate professional clinical decision support (CDS) documents for pharmaceutical and clinical research settings, including patient cohort analyses (biomarker-stratified with outcomes) and treatment recommendation reports (evidence-based guidelines with decision algorithms). Supports GRADE evidence grading, statistical analysis (hazard ratios, survival curves, waterfall plots), biomarker integration, and regulatory compliance. Outputs publication-ready LaTeX/PDF format optimized for drug development, clinical research, and evidence synthesis.
handling-sf-data
IncludedSalesforce data operations with 130-point scoring. Use this skill to create, update, delete, bulk import/export, generate test data, and clean up org records using sf CLI and anonymous Apex. TRIGGER when: user creates test data, performs bulk import/export, uses sf data CLI commands, needs data factory patterns for Apex tests, or needs to seed/clean records in a Salesforce org. DO NOT TRIGGER when: SOQL query writing only (use querying-soql), Apex test execution (use running-apex-tests), or metadata deployment (use deploying-metadata).
accelint-ac-to-playwright
IncludedConvert and validate acceptance criteria for Playwright test automation. Use when user asks to (1) review/evaluate/check if AC are ready for automation, (2) assess if AC can be converted as-is, (3) validate AC quality for Playwright, (4) turn AC into tests, (5) generate tests from acceptance criteria, (6) convert .md bullets or .feature Gherkin files to Playwright specs, (7) create test automation from requirements. Handles both bullet-style markdown and Gherkin syntax with JSON test plan generation and validation.