Markdown Documentation
Manage project documentation by verifying against actual codebase state. Emphasize verification over blind generation — analyze structure, files, and patterns before writing.
Portability
AGENTS.md is the universal context file (works with Claude Code, Codex, Kilocode). If the project uses CLAUDE.md, treat it as a symlink to AGENTS.md or migrate content into AGENTS.md and create the symlink:
# If CLAUDE.md exists and AGENTS.md doesn't
mv CLAUDE.md AGENTS.md && ln -sf AGENTS.md CLAUDE.md
When this skill references "context files", it means AGENTS.md (and CLAUDE.md if present as symlink).
Workflows
Update Context Files
Verify and fix AGENTS.md against the actual codebase. See references/update-agents.md for the full verification workflow.
- Read existing AGENTS.md, extract verifiable claims (paths, commands, structure, tooling)
- Verify each claim against codebase (
ls, cat package.json, cat pyproject.toml, etc.)
- Fix discrepancies: outdated paths, wrong commands, missing sections, stale structure
- Discover undocumented patterns (scripts, build tools, test frameworks not yet documented)
- Report changes
Update README
Generate or refresh README.md from project metadata and structure. See references/update-readme.md for section templates and language-specific patterns.
- Detect language/stack from config files (package.json, pyproject.toml, composer.json)
- Extract metadata: name, version, description, license, scripts
- If README exists and
--preserve: keep custom sections (About, Features), regenerate standard sections (Install, Usage)
- Generate sections appropriate to project type (library vs application)
- Report changes
Update CONTRIBUTING
Update existing CONTRIBUTING.md only — never auto-create. See references/update-contributing.md.
Initialize Context
Create AGENTS.md from scratch for projects without documentation. See references/init-agents.md.
- Analyze project: language, framework, structure, build/test tools
- Generate terse, expert-to-expert context sections
- Write AGENTS.md, create CLAUDE.md symlink
Arguments
All workflows support:
--dry-run: preview changes without writing
--preserve: keep existing structure, fix inaccuracies only
--minimal: quick pass, high-level structure only
--thorough: deep analysis of all files
Backup Handling
Before overwriting, back up existing files:
cp AGENTS.md AGENTS.md.backup
cp README.md README.md.backup
Never delete backups automatically.
Writing Style
- Terse: omit needless words, lead with the answer
- Imperative: "Build the project" not "The project is built"
- Expert-to-expert: skip basic explanations, assume competence
- Scannable: headings, lists, code blocks
- Accurate: verify every command and path against codebase
- Sentence case headings, no emoji headers
Report Format
After every operation, display a summary:
✓ Updated AGENTS.md
- Fixed build command
- Added new directory to structure
✓ Updated README.md
- Added installation section
- Updated badges
⊘ CONTRIBUTING.md not found (skipped)
1---2name: md-docs-23description: Manages project documentation: AGENTS.md, README.md, and CONTRIBUTING.md. Use when asked to "update README", "update agents", "init agents", "create AGENTS.md", "update AGENTS.md", "update CONTRIBUTING", "update context files", or "init context". Not for general markdown editing.4---56# Markdown Documentation78Manage project documentation by verifying against actual codebase state. Emphasize verification over blind generation — analyze structure, files, and patterns before writing.910## Portability1112AGENTS.md is the universal context file (works with Claude Code, Codex, Kilocode). If the project uses CLAUDE.md, treat it as a symlink to AGENTS.md or migrate content into AGENTS.md and create the symlink:1314```bash15# If CLAUDE.md exists and AGENTS.md doesn't16mv CLAUDE.md AGENTS.md && ln -sf AGENTS.md CLAUDE.md17```1819When this skill references "context files", it means AGENTS.md (and CLAUDE.md if present as symlink).2021## Workflows2223### Update Context Files2425Verify and fix AGENTS.md against the actual codebase. See `references/update-agents.md` for the full verification workflow.26271. Read existing AGENTS.md, extract verifiable claims (paths, commands, structure, tooling)282. Verify each claim against codebase (`ls`, `cat package.json`, `cat pyproject.toml`, etc.)293. Fix discrepancies: outdated paths, wrong commands, missing sections, stale structure304. Discover undocumented patterns (scripts, build tools, test frameworks not yet documented)315. Report changes3233### Update README3435Generate or refresh README.md from project metadata and structure. See `references/update-readme.md` for section templates and language-specific patterns.36371. Detect language/stack from config files (package.json, pyproject.toml, composer.json)382. Extract metadata: name, version, description, license, scripts393. If README exists and `--preserve`: keep custom sections (About, Features), regenerate standard sections (Install, Usage)404. Generate sections appropriate to project type (library vs application)415. Report changes4243### Update CONTRIBUTING4445Update existing CONTRIBUTING.md only — never auto-create. See `references/update-contributing.md`.4647### Initialize Context4849Create AGENTS.md from scratch for projects without documentation. See `references/init-agents.md`.50511. Analyze project: language, framework, structure, build/test tools522. Generate terse, expert-to-expert context sections533. Write AGENTS.md, create CLAUDE.md symlink5455## Arguments5657All workflows support:5859- `--dry-run`: preview changes without writing60- `--preserve`: keep existing structure, fix inaccuracies only61- `--minimal`: quick pass, high-level structure only62- `--thorough`: deep analysis of all files6364## Backup Handling6566Before overwriting, back up existing files:6768```bash69cp AGENTS.md AGENTS.md.backup70cp README.md README.md.backup71```7273Never delete backups automatically.7475## Writing Style7677- Terse: omit needless words, lead with the answer78- Imperative: "Build the project" not "The project is built"79- Expert-to-expert: skip basic explanations, assume competence80- Scannable: headings, lists, code blocks81- Accurate: verify every command and path against codebase82- Sentence case headings, no emoji headers8384## Report Format8586After every operation, display a summary:8788```89✓ Updated AGENTS.md90 - Fixed build command91 - Added new directory to structure9293✓ Updated README.md94 - Added installation section95 - Updated badges9697⊘ CONTRIBUTING.md not found (skipped)98```