skills/md-docs/SKILL.md
Manages project documentation: CLAUDE.md, AGENTS.md, README.md, CONTRIBUTING.md. Use when asked to update, create, or init these context files. Not for general markdown editing.
npx skillsauth add iliaal/ai-skills md-docsInstall 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.
Manage project documentation by verifying against actual codebase state. Emphasize verification over blind generation -- analyze structure, files, and patterns before writing.
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).
Verify and fix AGENTS.md against the actual codebase. See update-agents.md for the full verification workflow.
ls, cat package.json, cat pyproject.toml, etc.)Generate or refresh README.md from project metadata and structure. See update-readme.md for section templates and language-specific patterns.
--preserve: keep custom sections (About, Features), regenerate standard sections (Install, Usage)Update existing CONTRIBUTING.md only -- never auto-create. See update-contributing.md.
When updating, detect project conventions automatically:
Merge advisory. When CONTRIBUTING.md sits next to an AGENTS.md (repo root or any package root), surface a one-line recommendation: merge the contribution workflow section into the sibling AGENTS.md so the context file owns dev workflow, branch conventions, and review process as a single source of truth. Then suggest the user delete CONTRIBUTING.md after the merge. Never auto-merge and never auto-delete -- the user performs both. Continue the requested workflow regardless; the CONTRIBUTING file is advisory only.
If DOCS.md exists, treat it as API-level documentation (endpoints, function signatures, type definitions). Verify against actual code the same way as AGENTS.md. Never auto-create DOCS.md -- only update existing.
Create AGENTS.md from scratch for projects without documentation. See init-agents.md.
Keep AGENTS.md / CLAUDE.md to durable signal. Do NOT enumerate:
package.json engines, .nvmrc, pyproject.toml Python constraint, composer.json PHP version. List the source-of-truth file path; do not duplicate the version inline..eslintrc, ruff.toml, phpcs.xml already enforce it, the file is the spec. List the command to run; do not paraphrase rules.The test: if a fact will be wrong in two months without anyone touching this file, it does not belong here. The file is for project-specific rules that survive tool churn.
Structure CLAUDE.md (and AGENTS.md) content by priority so the most critical information loads first when context is compacted:
package.json engines, .nvmrc, pyproject.toml, composer.json); do not duplicate the version inline.Rules that prevent mistakes outweigh background information. Place them at the top so they survive aggressive context compaction.
Before invoking any update-* or init-* workflow on a multi-package repo, enumerate every package root that should own an AGENTS.md / README.md. Authoring is recursive by default; pass --root-only to collapse back to the repo root.
Resolve the repository root once:
git rev-parse --show-toplevel
Find existing context files to refresh (update-* discovery):
git ls-files --cached --others --exclude-standard \
-- '**/README.md' 'README.md' '**/AGENTS.md' 'AGENTS.md'
Find package roots that should get a new file (init-* discovery): package roots are directories holding a language/tooling manifest -- the repo root plus the unique directories of these files:
git ls-files --cached --others --exclude-standard \
-- '**/package.json' 'package.json' '**/Cargo.toml' 'Cargo.toml' \
'**/pyproject.toml' 'pyproject.toml' '**/setup.py' 'setup.py' \
'**/go.mod' 'go.mod' '**/composer.json' 'composer.json'
If the repo uses workspace globs (pnpm-workspace.yaml, package.json workspaces:, Cargo.toml [workspace], go.work), prefer those as ground truth over file enumeration — they declare the canonical package set and avoid false positives from nested vendored manifests.
Always exclude during discovery: .git, node_modules, vendor, .venv, target, dist, build, out, .next, coverage, anything ignored by git, and hidden dot-directories that lack a manifest.
Per-file scoping. Treat each target independently:
README.md links to its sibling AGENTS.md, not the root one.AGENTS.md gets a sibling CLAUDE.md symlink in the same directory (ln -sf AGENTS.md CLAUDE.md, run from that directory).CONTRIBUTING.md is checked per directory; apply the merge advisory from the Update CONTRIBUTING section.Process deepest-first or root-first consistently, and report results grouped by path. When a sweep would create or rewrite more than a handful of files, list the planned targets and get confirmation before writing.
Claude Code's context-file loading in monorepos follows three rules -- understanding them determines where content belongs:
packages/api/AGENTS.md, apps/web/AGENTS.md).packages/a/AGENTS.md will NOT auto-load when working in packages/b/. Do not rely on sibling-package context leaking across.Implication for monorepo layouts: duplicate any rule that must apply across sibling packages into each package's AGENTS.md (or hoist it to the repo root). The loader will not discover it laterally. Conversely, avoid putting package-specific rules at the root -- they'll load into every session regardless of relevance and burn context.
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 filesBefore overwriting, back up existing files:
cp AGENTS.md AGENTS.md.backup
cp README.md README.md.backup
Never delete backups automatically.
<details> blocks instead of deleting content (blank line required after <summary> for GitHub rendering).Flag during Update README workflows:
After every operation, display a summary:
[OK] Updated AGENTS.md
- Fixed build command
- Added new directory to structure
[OK] Updated README.md
- Added installation section
- Updated badges
[--] CONTRIBUTING.md not found (skipped)
development
Generic test writing discipline: test quality, real assertions, anti-patterns, and rationalization resistance. Use when writing tests, adding test coverage, or fixing failing tests for any language or framework. Complements language-specific skills.
tools
Tailwind CSS v4 patterns: CSS-first config, utility classes, component variants, v3 migration. Use when styling with Tailwind, configuring @theme tokens, using tailwind-variants/CVA, migrating v3 to v4, or fixing Tailwind styles and dark mode.
development
Simplifies, polishes, and declutters code without changing behavior. Use when asked to simplify, clean up, refactor, declutter, remove dead code or AI slop, or improve readability. For analysis-only reports without code changes, use code-simplicity-reviewer agent.
development
Process code review feedback critically: check correctness before acting, push back on incorrect suggestions, no performative agreement. Use when responding to PR/MR review comments or implementing reviewer suggestions received from others.