create-docs skill
A Claude Code skill that systematically analyzes a project and writes or refreshes a suite of LLM-optimized documentation files — covering architecture, build, testing, development patterns, deployment, and a file catalog — plus a synthesized README. Every generated file includes a UTC timestamp and concrete file references so both humans and LLMs can navigate the codebase quickly.
Inspired by steipete/agent-rules update-docs.
features
- analyzes the codebase across 7 key areas in parallel
- writes to
docs/ by default; --output <path> redirects all output
- existing files are refreshed by default;
--no-overwrite preserves them
- generates a UTC timestamp header in every file so staleness is visible
- each file contains concrete file references (paths, line numbers, code excerpts)
- enforces no-duplication: each fact lives in exactly one file; cross-references use relative links
- synthesizes a minimal
README.md (≤ 50 lines) after all section files are done
--only <section> refreshes a single file without touching others
--dry-run prints what would be written without touching the filesystem
usage
/create-docs # analyze project and write to docs/
/create-docs --output <path> # write to a custom directory
/create-docs --no-overwrite # skip files that already exist
/create-docs --only <section> # refresh one section (see sections below)
/create-docs --dry-run # preview output without writing files
sections
| Flag value |
Output file |
Contents |
overview |
PROJECT-OVERVIEW.md |
📋 purpose, entry points, tech stack, platform support |
architecture |
ARCHITECTURE.md |
🏗️ system organization, component map, data flow |
build |
BUILD-SYSTEM.md |
🔧 build system, common workflows, platform setup |
testing |
TESTING.md |
✅ test types, how to run, test file locations |
development |
DEVELOPMENT.md |
💻 code style, patterns, workflows, conventions |
deployment |
DEPLOYMENT.md |
🚀 packaging, distribution, platform deployment |
files |
FILES.md |
🗂️ comprehensive file catalog with purpose descriptions |
workflow
parse args:
--output <path>: use <path> as the output directory; default is docs/
--no-overwrite: skip any section file that already exists at the target path; still generate missing files; note skipped files in the final report
--only <section>: run only the named section (see table above); skip all others and skip the README synthesis step
--dry-run: generate content but print it to stdout; do not write any files
- unrecognized flags: print a usage error and stop
resolve the output directory:
- if
--output is not given, use docs/ relative to CWD
- create the directory if it does not exist:
mkdir -p <output>
announce progress with emojis as each section starts and completes:
- starting:
📋 analyzing project overview… / 🏗️ analyzing architecture… / etc.
- done:
✅ wrote docs/PROJECT-OVERVIEW.md
- skipped (no config found):
⏭️ docs/DEPLOYMENT.md — skipped (no deployment config found)
- skipped (--no-overwrite):
🔒 docs/TESTING.md — skipped (already exists, --no-overwrite set)
analyze the codebase — run the following in parallel (or sequentially if --only is set); for each section, check --no-overwrite before writing:
📋 PROJECT-OVERVIEW.md — read: README.md, package.json / pyproject.toml / Cargo.toml / go.mod (whichever exists), main entry-point files; extract: project purpose, core value proposition, tech stack, platform support; write to <output>/PROJECT-OVERVIEW.md
🏗️ ARCHITECTURE.md — read: top-level source directory structure, main module/package files, any existing architecture docs; extract: high-level system organization, major components and their source locations, key data flows; write to <output>/ARCHITECTURE.md
🔧 BUILD-SYSTEM.md — read: Makefile, CMakeLists.txt, build.gradle, pyproject.toml, Cargo.toml, package.json scripts, CI workflow files; extract: build commands, platform-specific setup, configuration options; write to <output>/BUILD-SYSTEM.md
✅ TESTING.md — read: test directories, test runner configuration, CI test steps; extract: test types, how to run each, where test files live, how to add a new test; write to <output>/TESTING.md
💻 DEVELOPMENT.md — read: .editorconfig, linter configs (.eslintrc, ruff.toml, .golangci.yml, etc.), any existing patterns or development docs, recent commits for style signals; extract: code style rules with file examples, common implementation patterns with actual code excerpts; merge any existing PATTERNS.md content; write to <output>/DEVELOPMENT.md
🚀 DEPLOYMENT.md — read: packaging scripts, release workflows, Docker files, CI/CD deployment jobs; extract: package types, deployment targets, output locations, step-by-step commands; write to <output>/DEPLOYMENT.md
🗂️ FILES.md — run find . -type f (excluding .git, node_modules, vendor, __pycache__); group files by category (core source, platform impl, build, tests, config); write a one-line description per significant file; write to <output>/FILES.md
for each file written, prepend the timestamp header:
<!-- Generated: YYYY-MM-DD HH:MM:SS UTC -->
derive the current UTC time via: date -u '+%Y-%m-%d %H:%M:%S'
use the section emoji in the first heading of each generated file:
# 📋 Project Overview, # 🏗️ Architecture, # 🔧 Build System, etc.
enforce no-duplication:
- build information only in
BUILD-SYSTEM.md
- code style and patterns only in
DEVELOPMENT.md
- deployment information only in
DEPLOYMENT.md
- cross-reference with:
See [docs/FILENAME.md](docs/FILENAME.md) (adjust path if --output was used)
synthesize README.md (skip if --only is set):
- read all generated
<output>/*.md files
- write a new
README.md in the project root with:
- project description (2-3 sentences max)
- key entry points and core configuration files
- quick build commands
- documentation links with one-line descriptions
- keep it under 50 lines total
- prepend the timestamp header
duplication check:
- scan all generated files for repeated content
- remove duplicates and add cross-references where needed
- if
PATTERNS.md exists in the output directory, merge it into DEVELOPMENT.md and delete it
if --dry-run: print all generated content to stdout; write nothing to disk
report results with emojis:
📝 docs updated → docs/
✅ docs/PROJECT-OVERVIEW.md
✅ docs/ARCHITECTURE.md
✅ docs/BUILD-SYSTEM.md
✅ docs/TESTING.md
✅ docs/DEVELOPMENT.md
⏭️ docs/DEPLOYMENT.md — skipped (no deployment config found)
✅ docs/FILES.md
✅ README.md
document format requirements
Every generated file must follow this structure:
- timestamp header comment at the very top
- title heading with section emoji (e.g.,
# 🏗️ Architecture)
- brief overview (2-3 paragraphs max)
- key files & examples section with concrete file references
- common workflows section with file locations
- reference section with quick-lookup tables
File reference format (use throughout):
**Core System** — implementation in `src/core.h` (lines 15-45), platform backends in `src/platform/`
Code examples must be actual excerpts from the codebase, not generic placeholders:
# From src/example.py:23-27
class ExampleState:
active: bool
data: Any
count: int
best practices
- always include file paths and line numbers — vague references ("see the main file") are not acceptable
- token-efficient prose — avoid redundant explanations; LLMs are the primary audience
- create the output directory — never fail because
docs/ doesn't exist yet; create it
- merge, don't duplicate — if
DEVELOPMENT.md and PATTERNS.md both exist, merge into one; delete the old file
- skip gracefully — if no deployment config exists, skip
DEPLOYMENT.md and note it in the report rather than writing an empty file
- timestamp every file — staleness is a first-class concern; always regenerate the timestamp even on partial updates (
--only)
--dry-run is safe — no filesystem changes; safe to run in any environment
--no-overwrite is conservative — skip existing files with a 🔒 marker; never prompt per-file
1---2name: create-docs3description: Analyzes a codebase and generates LLM-optimized documentation covering project overview, architecture, build system, testing, development patterns, deployment, and a file catalog. Use when the user wants to document a codebase or refresh existing project documentation.4---56# create-docs skill78A Claude Code skill that systematically analyzes a project and writes or refreshes a suite of LLM-optimized documentation files — covering architecture, build, testing, development patterns, deployment, and a file catalog — plus a synthesized README. Every generated file includes a UTC timestamp and concrete file references so both humans and LLMs can navigate the codebase quickly.910Inspired by [steipete/agent-rules update-docs](https://github.com/steipete/agent-rules/blob/main/project-rules/update-docs.mdc).1112## features1314- analyzes the codebase across 7 key areas in parallel15- writes to `docs/` by default; `--output <path>` redirects all output16- existing files are refreshed by default; `--no-overwrite` preserves them17- generates a UTC timestamp header in every file so staleness is visible18- each file contains concrete file references (paths, line numbers, code excerpts)19- enforces no-duplication: each fact lives in exactly one file; cross-references use relative links20- synthesizes a minimal `README.md` (≤ 50 lines) after all section files are done21- `--only <section>` refreshes a single file without touching others22- `--dry-run` prints what would be written without touching the filesystem2324## usage2526```27/create-docs # analyze project and write to docs/28/create-docs --output <path> # write to a custom directory29/create-docs --no-overwrite # skip files that already exist30/create-docs --only <section> # refresh one section (see sections below)31/create-docs --dry-run # preview output without writing files32```3334## sections3536| Flag value | Output file | Contents |37|---|---|---|38| `overview` | `PROJECT-OVERVIEW.md` | 📋 purpose, entry points, tech stack, platform support |39| `architecture` | `ARCHITECTURE.md` | 🏗️ system organization, component map, data flow |40| `build` | `BUILD-SYSTEM.md` | 🔧 build system, common workflows, platform setup |41| `testing` | `TESTING.md` | ✅ test types, how to run, test file locations |42| `development` | `DEVELOPMENT.md` | 💻 code style, patterns, workflows, conventions |43| `deployment` | `DEPLOYMENT.md` | 🚀 packaging, distribution, platform deployment |44| `files` | `FILES.md` | 🗂️ comprehensive file catalog with purpose descriptions |4546## workflow47481. parse args:49 - `--output <path>`: use `<path>` as the output directory; default is `docs/`50 - `--no-overwrite`: skip any section file that already exists at the target path; still generate missing files; note skipped files in the final report51 - `--only <section>`: run only the named section (see table above); skip all others and skip the README synthesis step52 - `--dry-run`: generate content but print it to stdout; do not write any files53 - unrecognized flags: print a usage error and stop54552. resolve the output directory:56 - if `--output` is not given, use `docs/` relative to CWD57 - create the directory if it does not exist: `mkdir -p <output>`58593. announce progress with emojis as each section starts and completes:60 - starting: `📋 analyzing project overview…` / `🏗️ analyzing architecture…` / etc.61 - done: `✅ wrote docs/PROJECT-OVERVIEW.md`62 - skipped (no config found): `⏭️ docs/DEPLOYMENT.md — skipped (no deployment config found)`63 - skipped (--no-overwrite): `🔒 docs/TESTING.md — skipped (already exists, --no-overwrite set)`64654. analyze the codebase — run the following in parallel (or sequentially if `--only` is set); for each section, check `--no-overwrite` before writing:6667 **📋 PROJECT-OVERVIEW.md** — read: `README.md`, `package.json` / `pyproject.toml` / `Cargo.toml` / `go.mod` (whichever exists), main entry-point files; extract: project purpose, core value proposition, tech stack, platform support; write to `<output>/PROJECT-OVERVIEW.md`6869 **🏗️ ARCHITECTURE.md** — read: top-level source directory structure, main module/package files, any existing architecture docs; extract: high-level system organization, major components and their source locations, key data flows; write to `<output>/ARCHITECTURE.md`7071 **🔧 BUILD-SYSTEM.md** — read: `Makefile`, `CMakeLists.txt`, `build.gradle`, `pyproject.toml`, `Cargo.toml`, `package.json` scripts, CI workflow files; extract: build commands, platform-specific setup, configuration options; write to `<output>/BUILD-SYSTEM.md`7273 **✅ TESTING.md** — read: test directories, test runner configuration, CI test steps; extract: test types, how to run each, where test files live, how to add a new test; write to `<output>/TESTING.md`7475 **💻 DEVELOPMENT.md** — read: `.editorconfig`, linter configs (`.eslintrc`, `ruff.toml`, `.golangci.yml`, etc.), any existing patterns or development docs, recent commits for style signals; extract: code style rules with file examples, common implementation patterns with actual code excerpts; merge any existing `PATTERNS.md` content; write to `<output>/DEVELOPMENT.md`7677 **🚀 DEPLOYMENT.md** — read: packaging scripts, release workflows, Docker files, CI/CD deployment jobs; extract: package types, deployment targets, output locations, step-by-step commands; write to `<output>/DEPLOYMENT.md`7879 **🗂️ FILES.md** — run `find . -type f` (excluding `.git`, `node_modules`, `vendor`, `__pycache__`); group files by category (core source, platform impl, build, tests, config); write a one-line description per significant file; write to `<output>/FILES.md`80815. for each file written, prepend the timestamp header:82 ```83 <!-- Generated: YYYY-MM-DD HH:MM:SS UTC -->84 ```85 derive the current UTC time via: `date -u '+%Y-%m-%d %H:%M:%S'`8687 use the section emoji in the first heading of each generated file:88 `# 📋 Project Overview`, `# 🏗️ Architecture`, `# 🔧 Build System`, etc.89906. enforce no-duplication:91 - build information only in `BUILD-SYSTEM.md`92 - code style and patterns only in `DEVELOPMENT.md`93 - deployment information only in `DEPLOYMENT.md`94 - cross-reference with: `See [docs/FILENAME.md](docs/FILENAME.md)` (adjust path if `--output` was used)95967. synthesize `README.md` (skip if `--only` is set):97 - read all generated `<output>/*.md` files98 - write a new `README.md` in the project root with:99 - project description (2-3 sentences max)100 - key entry points and core configuration files101 - quick build commands102 - documentation links with one-line descriptions103 - keep it under 50 lines total104 - prepend the timestamp header1051068. duplication check:107 - scan all generated files for repeated content108 - remove duplicates and add cross-references where needed109 - if `PATTERNS.md` exists in the output directory, merge it into `DEVELOPMENT.md` and delete it1101119. if `--dry-run`: print all generated content to stdout; write nothing to disk11211310. report results with emojis:114 ```115 📝 docs updated → docs/116117 ✅ docs/PROJECT-OVERVIEW.md118 ✅ docs/ARCHITECTURE.md119 ✅ docs/BUILD-SYSTEM.md120 ✅ docs/TESTING.md121 ✅ docs/DEVELOPMENT.md122 ⏭️ docs/DEPLOYMENT.md — skipped (no deployment config found)123 ✅ docs/FILES.md124 ✅ README.md125 ```126127## document format requirements128129Every generated file must follow this structure:130- timestamp header comment at the very top131- title heading with section emoji (e.g., `# 🏗️ Architecture`)132- brief overview (2-3 paragraphs max)133- key files & examples section with concrete file references134- common workflows section with file locations135- reference section with quick-lookup tables136137File reference format (use throughout):138```139**Core System** — implementation in `src/core.h` (lines 15-45), platform backends in `src/platform/`140```141142Code examples must be actual excerpts from the codebase, not generic placeholders:143```python144# From src/example.py:23-27145class ExampleState:146 active: bool147 data: Any148 count: int149```150151## best practices152153- **always include file paths and line numbers** — vague references ("see the main file") are not acceptable154- **token-efficient prose** — avoid redundant explanations; LLMs are the primary audience155- **create the output directory** — never fail because `docs/` doesn't exist yet; create it156- **merge, don't duplicate** — if `DEVELOPMENT.md` and `PATTERNS.md` both exist, merge into one; delete the old file157- **skip gracefully** — if no deployment config exists, skip `DEPLOYMENT.md` and note it in the report rather than writing an empty file158- **timestamp every file** — staleness is a first-class concern; always regenerate the timestamp even on partial updates (`--only`)159- **`--dry-run` is safe** — no filesystem changes; safe to run in any environment160- **`--no-overwrite` is conservative** — skip existing files with a 🔒 marker; never prompt per-file