docs-architect — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited docs-architect (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Build and maintain documentation that rides on Claude Code's native loading mechanisms. Cuts AI token consumption by 20–40% versus the v1 custom-summary pattern while preserving all information and giving humans a clean reference.
Docs are a knowledge base. The AI receives only what is strictly necessary per task. v2 uses the official .claude/rules/ mechanism with two loading modes:
.claude/rules/*.md files load at session start alongside CLAUDE.md. Use for universally-needed content (business, stack, conventions, core architecture)..claude/rules/*.md with paths: frontmatter auto-load only when Claude reads matching files. Zero startup token cost. Use for subsystem-specific rules (backend, frontend, api, database, testing).Full human docs live in docs/*.md as the source of truth. .claude/rules/*.md are lean (≤40 lines, ≤12 bullets) distillations mirrored from the full docs.
./CLAUDE.md # <100 lines — hard NOs + pointer to rules
./.claude/rules/ # AI-facing rules (flat, no subfolders)
├── business-context.md # always-loaded
├── coding-rules.md # always-loaded
├── tech-stack.md # always-loaded
├── architecture.md # always-loaded
├── backend.md # path-scoped: backend/**
├── frontend.md # path-scoped: frontend/**
├── api.md # path-scoped: **/Controllers/**, **/routes/**
├── database.md # path-scoped: **/Entities/**, **/migrations/**
└── testing.md # path-scoped: **/*.test.*, **/tests/**
./.claude/agents/doc-explorer.md # research subagent (isolated context)
./.claude/commands/ # /docs-audit, /docs-sync, /docs-migrate
./docs/ # full human-readable reference
├── README.md # governance + index
├── architecture.md # full architecture doc
├── coding-rules.md # full conventions
├── tech-stack.md # full package catalog
├── api-contracts.md # full endpoint catalog
├── database-schema.md # full table catalog
├── deployment.md # full dev/prod reference
├── roadmap.md # product phases, KPIs, decisions
├── backlog.md # story registry
├── bugs.md # bug registry
├── ideas.md # raw ideas inbox
├── stories/ bugs/ plans/ # individual item files
└── research/ # deep reference docs| Mode | Purpose | Primary reference to read |
|---|---|---|
/docs-architect | Interactive — analyze, ask, build | Step 1, then files as needed per step |
/docs-architect init | Full v2 setup on a new or clean project | assets/CLAUDE.md.template + assets/docs-README.md.template + references/governance.md + references/common-specs.md |
/docs-architect audit | Audit structure + auto-fix offers | references/audit-report.md |
/docs-architect sync | Detect docs drift from code | none (uses git diff + doc-explorer subagent) |
/docs-architect migrate | Convert v1 _lite/ pattern to v2 .claude/rules/ | references/migration-v1-to-v2.md |
/docs-architect segment <file> | Segment a large doc | references/common-specs.md §Segmentation patterns |
For everything related to hooks, subagents, settings precedence, built-in commands, claudeMdExcludes, and .claude/rules/ format details, read references/claude-code-native.md on demand.
Before creating or changing anything, understand the current state.
docs/ exists, list files with line counts.docs/_lite/*.summary.md exists, this is a v1 project → recommend /docs-architect migrate.@docs/_lite/* imports.Documentation language in CLAUDE.md Conventions. If not declared, ask the user. All generated docs must use this language.for f in docs/*.md; do lines=$(wc -l < "$f" 2>/dev/null); echo "$lines $f"; done 2>/dev/null | sort -rn
wc -l CLAUDE.md 2>/dev/null
ls .claude/rules/ 2>/dev/null
ls docs/_lite/ 2>/dev/nullHard limit: under 100 lines. Copy from assets/CLAUDE.md.template and adapt. CLAUDE.md holds only:
.claude/rules/*.md for AI, docs/*.md for humans)Everything else belongs in .claude/rules/. No @imports. No tables of summaries. No tech stack details. No business context.
Monorepo note: if the project is a monorepo and ancestor CLAUDE.md files would load unnecessarily, add claudeMdExcludes to .claude/settings.json. See references/claude-code-native.md §Monorepos.
The governance document for the docs/ folder. Copy from assets/docs-README.md.template. Contains: folder structure tree, 2-layer usage guide (humans + AI), AI rules, update table, and index. Keep under 200 lines.
All governance rules come from references/governance.md:
{NNNNN}-{slug}.{type}.md.md outside docs/ (except CLAUDE.md, .claude/rules/, .claude/agents/, .claude/commands/), never mix languages.claude/rules/*.md that mirrors a docs/*.md, update the full doc in the same commit (and vice versa)ideas.md, group via /brainstorming, promote to story + backlog.md entryresearch/ holds deep-reference docs consulted on-demand (no rule mirror)git add ., no --force, no --no-verify, no --amend without request)Each full doc in docs/*.md is the source of truth. If a doc already exists, read it first and restructure — do NOT overwrite with a blank template.
Read the specific spec on-demand from references/:
Individual specs (large docs): architecture-spec.md (10 sections) · coding-rules-spec.md (17) · api-contracts-spec.md (10+5) · database-schema-spec.md (10+5)
Common specs (one file): common-specs.md — backlog, bugs, tech-stack, deployment, roadmap (never remove business content), dev-testing, plus segmentation patterns table.
Research files (docs/research/<topic>.md): free-form deep reference. One file per topic. No rule mirror. Consult before the work type it covers.
See references/governance.md for priority/severity definitions (ASAP/Critical/High/Medium/Low) and status definitions per item type (Pending/Open/Draft → … → Completed/Resolved).
In progress.claude/rules/ — the v2 core.claude/rules/*.md replaces v1's _lite/ entirely. Two loading modes.
| Rule applies… | Loading mode | Frontmatter |
|---|---|---|
| Every session, globally | always-loaded | none |
| Only when Claude touches a specific subtree | path-scoped | paths: with globs |
| On-demand reference only (humans or deep research) | not a rule | put in docs/*.md full file |
Install these four from assets/rules/_always/*.md (copied flat into .claude/rules/, no subfolder):
.claude/rules/business-context.md.claude/rules/coding-rules.md.claude/rules/tech-stack.md.claude/rules/architecture.mdpaths: frontmatter)Install the ones that match the project's subtrees. Ask the user which apply.
.claude/rules/backend.md.claude/rules/frontend.md.claude/rules/api.md.claude/rules/database.md.claude/rules/testing.mdEach .claude/rules/*.md file: ≤40 lines, ≤12 bullets. Focus on constraints, decisions, and hard NOs. No narrative. Full narrative belongs in docs/*.md.
For exact .claude/rules/ format details (globs, precedence, flat-folder rule), read references/claude-code-native.md §.claude/rules/.
.claude/ artifactsAfter rules, install the three Claude Code native artifacts that make the skill turn-key.
Copy assets/agents/doc-explorer.md → .claude/agents/doc-explorer.md. This subagent runs in isolated context (model: haiku) and handles doc audits, sync scans, and research without polluting the main session. Audit and sync modes delegate to it by default.
Copy all three:
.claude/commands/docs-audit.md.claude/commands/docs-sync.md.claude/commands/docs-migrate.mdUsers invoke these as /docs-audit, /docs-sync, /docs-migrate — no need to remember skill mode syntax.
Never auto-merge into .claude/settings.json. Print the contents of assets/hooks/settings.snippet.json to the user and say:
Paste thishooksblock into.claude/settings.json(merge with any existing hooks). The docs-architect skill does not modify settings.json.
The snippet adds:
docs/_lite/ files after Write/EditFor full hook event catalogue and JSON format, see references/claude-code-native.md §Hooks.
Any docs/*.md file over 150 lines should be segmented into subtopic files.
docs/<name>/ folder with one file per topic + README.md index..claude/rules/*.md file only if the segmentation changed the underlying facts.Templates, header format, and common segmentation patterns (which doc splits by what axis) live in references/common-specs.md §Segmentation patterns.
Sync rule: the full doc is the source of truth. Never edit a segment without also editing the full doc.
When invoked with /docs-architect audit, delegate the file scan to doc-explorer subagent when possible, run all checks, then offer to auto-fix.
@docs/_lite/* imports → stale v1 pattern, suggest /docs-migrateDocumentation language declaration → ask and add.claude/rules/*.md files (business-context, coding-rules, tech-stack, architecture) → install from assets.claude/rules/*.md files over 40 lines → flag, ask to trim.claude/rules/*.md with paths: patterns matching zero files → dead scope, suggest removing or fixing the globs**/Controllers/ but no matching path-scoped rule → missed token savings, offer to install from assets.claude/agents/doc-explorer.md when docs/ has ≥10 files → install/docs-audit, /docs-sync, /docs-migrate slash commands → install from assetsdocs/_lite/*.summary.md (not .deprecated) present → suggest /docs-migratedocs/*.md files over 150 lines without segmentation → flagdocs/README.md missing or over 200 linesideas.md ≥5 items → suggest grouping and promotionresearch/ files missingSee references/audit-report.md for the output format.
After the report, offer to fix each issue. Group fixes by type and confirm before applying.
| Issue | Auto-fix action |
|---|---|
| Missing always-loaded rule | Copy from assets/rules/_always/*.md |
| Missing path-scoped rule (subtree detected) | Copy from assets/rules/*.md |
| Dead path pattern | Ask user to correct the glob or remove the rule |
| Rule >40 lines | Show top offenders, ask which bullets to cut |
| CLAUDE.md >100 lines | Identify offloadable content, propose moving it to .claude/rules/ |
Missing docs/README.md | Generate from template |
| Orphaned story/bug file | Add missing entry to registry |
| Registry points to missing file | Remove broken link |
| Status mismatch | Show both, ask which is correct, update the other |
Legacy _lite/ present | Offer to run /docs-architect migrate |
| Missing doc-explorer agent | Copy from assets |
| Missing slash commands | Copy from assets |
Flow: report → "Found X fixable issues. Fix all / fix individually / skip?" → apply selected fixes → re-run checks to confirm.
When invoked with /docs-architect sync, detect which docs and rules are out of date relative to code changes.
git log --oneline --all -- docs/ .claude/rules/ | head -1 git diff --name-only <last-docs-commit>..HEAD| Changed files match | Update rule | Update full doc |
|---|---|---|
*.csproj, Directory.Packages.props, package.json, Cargo.toml, requirements.txt, go.mod | tech-stack.md | tech-stack.md |
docker-compose*, Dockerfile*, .env*, web.config, nginx.conf | (none — no rule mirror) | deployment.md |
Controllers, routes, endpoints (*Controller*, *Endpoint*, *Route*) | api.md | api-contracts.md |
Entity/model files, migrations (*Migration*, *Entity*, *Model*) | database.md | database-schema.md |
| Domain layer, patterns, middleware, interceptors | architecture.md | architecture.md |
| Naming conventions, validators, new patterns | coding-rules.md | coding-rules.md |
| Test files | testing.md | coding-rules.md (coverage section) |
## Docs Sync Report
Last docs update: <commit-hash> (<date>)
Code commits since: <count>
### Rules + docs needing update
- .claude/rules/tech-stack.md + docs/tech-stack.md — 3 package files changed (list)
- .claude/rules/api.md + docs/api-contracts.md — 2 controllers modified (list)
- docs/deployment.md (rule-less) — docker-compose.yml changed
### Current
- .claude/rules/architecture.md + docs/architecture.md ✓
- .claude/rules/coding-rules.md + docs/coding-rules.md ✓
### Action
Update affected files now? [yes / pick individually / skip]When invoked with /docs-architect migrate, convert a v1 project (custom _lite/ pattern) to v2 (.claude/rules/).
Read [references/migration-v1-to-v2.md](references/migration-v1-to-v2.md) first. It has the full mapping table, examples, and safety rules.
docs/_lite/*.summary.md, list files..claude/rules/*.md target (always-loaded vs path-scoped) based on the mapping table in the migration reference..claude/rules/*.md files, adding paths: frontmatter where applicable, stripping Source: lines (replaced with <!-- mirrors: docs/<file>.md -->).docs/_lite/*.summary.md.deprecated. Never delete.CLAUDE.md to remove the old _lite/ pointer table.docs/README.md to describe the 2-layer v2 flow./docs-audit to verify..deprecated. Run rm docs/_lite/*.deprecated after verifying a fresh session loads context correctly.".claude/settings.jsondocs/*.md full files (only creates new .claude/rules/*.md and renames _lite/ files)init so it's always available.Documentation language from CLAUDE.md. If not declared, ask the user..claude/rules/*.md has a corresponding docs/*.md, update both in the same commit./docs-architect init)CLAUDE.md from assets/CLAUDE.md.template.docs/README.md from assets/docs-README.md.template.architecture.md, api-contracts.md, database-schema.md, coding-rules.md, tech-stack.md, deployment.md, roadmap.md, backlog.md, bugs.md, ideas.md). No `_lite/` folder.assets/rules/_always/*.md flat into .claude/rules/ (4 always-loaded files)..claude/rules/..claude/rules/*.md files AND the full docs/*.md files from real codebase content.assets/commands/*.md into .claude/commands/.assets/agents/doc-explorer.md into .claude/agents/..claude/settings.json.#### Code scanning for auto-fill
Scan the codebase to pre-populate both rules and docs with real content:
| Scan target | How to find | Pre-fills |
|---|---|---|
| Stack & packages | Read *.csproj + Directory.Packages.props (or package.json, Cargo.toml, requirements.txt, go.mod) | docs/tech-stack.md + .claude/rules/tech-stack.md |
| Infrastructure | Read docker-compose*.yml, Dockerfile*, .env* | docs/deployment.md |
| Architecture | List project folders + read key files (Program.cs, Startup, middleware, DI registration) | docs/architecture.md + .claude/rules/architecture.md |
| API endpoints | Read controllers/routes, auth filters, middleware registration | docs/api-contracts.md + .claude/rules/api.md |
| Database schema | Read entity/model files, DbContext, migrations | docs/database-schema.md + .claude/rules/database.md |
| Coding patterns | Read existing code for naming, patterns, validation, error handling | docs/coding-rules.md + .claude/rules/coding-rules.md |
| Business context | Read existing README, comments, domain entities | .claude/rules/business-context.md |
Rules for auto-fill:
<!-- auto-generated from codebase scan --> so the user knows what to review.TODO: verify rather than guessing./docs-architect migrate)_lite/ files before making any changes./docs-architect or /docs-architect audit).claude/rules/*.md before making any changes..claude/rules/.~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.