dox-doc-tree

GitHub

在Git仓库中建立并维护CLAUDE.md文档树,确保编辑代码前读取层级规则。适用于初始化缺失文档、脚手架搭建或修改未记录目录时,强制先完善文档再编码,防止上下文漂移。

skills/dox-doc-tree/SKILL.md AjayIrkal23/agentic-mercy-10x

Trigger Scenarios

SessionStart报告dox根目录缺失或存根 即将编辑无本地CLAUDE.md的目录代码 PreToolUse拒绝因缺少dox根目录 文件增删改需更新本地文档

Install

npx skills add AjayIrkal23/agentic-mercy-10x --skill dox-doc-tree -g -y
More Options

Use without installing

npx skills use AjayIrkal23/agentic-mercy-10x@dox-doc-tree

指定 Agent (Claude Code)

npx skills add AjayIrkal23/agentic-mercy-10x --skill dox-doc-tree -a claude-code -g -y

安装 repo 全部 skill

npx skills add AjayIrkal23/agentic-mercy-10x --all -g -y

预览 repo 内 skill

npx skills add AjayIrkal23/agentic-mercy-10x --list

SKILL.md

Frontmatter
{
    "name": "dox-doc-tree",
    "schema": 1,
    "category": "docs",
    "surfaces": [
        "docs"
    ],
    "triggers": {
        "paths": [],
        "intents": [
            "docs"
        ],
        "keywords": [
            "claude.md",
            "code",
            "directory",
            "doc",
            "docs",
            "documentation",
            "dox",
            "editing",
            "edits",
            "establishes",
            "exists",
            "follow",
            "git",
            "hard-gated",
            "incomplete",
            "local",
            "maintains",
            "mandatory",
            "missing",
            "missing\/stubbed",
            "project",
            "read",
            "repo",
            "reports",
            "root",
            "rules",
            "scaffolding",
            "sessionstart",
            "target",
            "tree",
            "undocumented",
            "until",
            "update",
            "work",
            "writes"
        ]
    },
    "platforms": [
        "linux",
        "darwin",
        "windows"
    ],
    "token-cost": 2209,
    "description": "MANDATORY before code work in any git repo. Establishes and maintains the dox CLAUDE.md documentation tree — read root→target before editing, follow local rules, update the local CLAUDE.md after edits. Use when a repo's dox tree is missing or incomplete, when scaffolding project docs, when SessionStart reports a missing\/stubbed dox root, or before editing code in an undocumented directory. Code writes are hard-gated until a root CLAUDE.md exists."
}

dox — the CLAUDE.md documentation tree

Adapted from agent0ai/dox. dox ships AGENTS.md; in this setup the real doc is CLAUDE.md (Claude Code natively auto-injects a nested CLAUDE.md when you touch files in that subtree — this powers the walk for free). Each folder also carries a 1-line AGENTS.md pointer for cross-tool portability.

Why this exists

Agents make blind edits without local context → drift, surprise changes, "why did it touch that file?". dox fixes this with a hierarchical doc tree: a root file with project-wide rules + an auto-synced index, and a child CLAUDE.md in every directory (end-to-end coverage — documentAllDirs: true) holding the local rules for that area. The loop is: read root → walk down to the file you're about to touch → follow local rules → edit → update the affected doc.

Coverage is automatic. The SessionStart guard runs a full sweep (dox_engine.py) that creates a CLAUDE.md + AGENTS.md in every non-skipped directory and syncs the root index. A PostToolUse hook (dox-child-scaffold.py) documents any new directory the moment you write a file into it. Your job is to flesh out the stubs, not to create them. Run a manual sweep any time with python3 ~/.claude/hooks/dox_engine.py sweep <repo> (or … plan <repo> for a dry run).

The model

File Holds
<repo>/CLAUDE.md (root) Project overview, stack, non-negotiables, and an index linking to every child doc. Marked <!-- dox:root v1 --> when dox-managed.
<dir>/CLAUDE.md (child) LOCAL rules for that directory only — what lives here, conventions, gotchas, links to deeper children. Never restate root-level rules; link to them.
<dir>/AGENTS.md (pointer) One line: See CLAUDE.md in this directory for agent instructions (dox tree).

Each file ≤250 lines (matches the global file-limit rule). If a child grows past that, split it into deeper children.

When this skill fires

  • SessionStart injected "dox tree stubbed / incomplete — flesh it out" (the auto-init guard).
  • You're about to edit code in a directory that has no local CLAUDE.md.
  • A PreToolUse deny told you "No dox root — scaffold first".
  • You added/removed/renamed files and must update the local doc (Phase 7).

Procedure A — READ (before any edit)

  1. Identify the target file's directory.
  2. Read the chain root CLAUDE.md → … → target dir CLAUDE.md. Claude Code auto-injects nested CLAUDE.md as you enter a subtree — confirm the chain is in context; if a link in the chain is missing, that's a scaffold gap (Procedure B).
  3. Follow the most-specific local rule that applies. Local overrides general.

Procedure B — SCAFFOLD (when missing/incomplete)

  1. Root. If <repo>/CLAUDE.md is absent, create it from references/root-template.md (the SessionStart guard usually leaves a marked stub — flesh that stub out, don't replace its marker). If a hand-written root already exists (no <!-- dox:root v1 --> marker), DO NOT overwrite it — append a ## dox index section linking children instead.
  2. Every directory. By default (documentAllDirs: true) every non-skipped directory gets a CLAUDE.md — the sweep/PostToolUse hooks create the stubs for you. You flesh each one out from references/child-template.md: the local truth — what this folder is for, its conventions, its traps. Link up to root and down to deeper children. (Set documentAllDirs: false to fall back to the legacy "≥significantDirThreshold code files" gate.)
  3. Pointers. Every folder that gets a CLAUDE.md also gets a 1-line AGENTS.md (references/agents-pointer.md). The engine never clobbers an AGENTS.md/CLAUDE.md that already exists.
  4. Index. The root's <!-- dox:index:start -->…<!-- dox:index:end --> block is rebuilt automatically from the tree on disk (nested by depth). Don't hand-edit inside the markers — add/rename directories and the next sweep syncs it. On a hand-written root with no markers, the engine appends the block once, then keeps it synced.
  5. The sweep is whole-repo, but prose is still incremental — flesh out the root + the area you're about to touch first; grow the local docs as you visit new areas.

Procedure C — UPDATE (after editing)

After changing files in directory X:

  1. Update X/CLAUDE.md — new/removed files, changed conventions, new gotchas.
  2. If you added a new significant directory, add its child doc + link it in the root index.
  3. This is part of Phase 7 (Documentation Update) — do it before marking work done.

Which directories get docs

  • Default (documentAllDirs: true): every directory that isn't on the skip list, regardless of how many code files it holds — end-to-end coverage.
  • Skip list (build artifacts / deps / VCS / caches, never documented): node_modules, .git, dist, build, .next, out, coverage, vendor, target, bin, obj, __pycache__, .venv/venv, .turbo, .cache, graphify-out, .planning, .claude, .idea, .vscode, and any dot-directory. Extend via SKIP_DIRS in dox_engine.py.
  • Bounds: sweepMaxDepth (default 12) and maxSweepDirs (default 500) cap a sweep so it can't run away on a huge tree; if truncated, the guard says so — raise the cap.
  • Legacy mode (documentAllDirs: false): only dirs with ≥ significantDirThreshold (default 3) code files get a child; smaller dirs inherit the parent's CLAUDE.md.

What happens when a CLAUDE.md already exists

  • A folder's CLAUDE.md / AGENTS.md already there → left completely untouched (idempotent, never overwritten — your prose and any hand edits are safe). It's still listed in the root index.
  • The root CLAUDE.md already there → its prose is never rewritten; only the auto-managed index block between the dox:index markers is re-synced. A hand-written root (no markers) gets the block appended once.
  • A directory removed/renamed → its line drops out of the root index on the next sweep (the stale CLAUDE.md file itself is not deleted — remove it by hand if you want).

Relationship to existing doc systems (do NOT duplicate)

dox is the per-directory local-rules layer. It is distinct from:

  • update-docs / frontend_docs/ / server_docs/ — repo-level numbered docs. dox child files link to these; they don't restate them.
  • CODEX.md — the working-decision + known-pitfalls log. Stays as-is; dox links to it.
  • codebase-intel-first (jcodemunch/graphify) — owns code discovery; dox owns the human/agent rules for a directory. Use the intel tools to find code; use dox to learn the local conventions before changing it.

Enforcement you're operating under

  • Engine (dox_engine.py): the shared scaffolder — collect (which dirs), sweep (create all docs + sync index), ensure_dir_documented (one dir). Also a CLI: dox_engine.py sweep|plan <repo>.
  • SessionStart (dox-tree-guard.py session): runs a full sweep — stubs a missing root, creates CLAUDE.md + AGENTS.md in every directory, syncs the root index, writes a fingerprint sidecar at <repo>/.claude/dox/data/.doxinit.json. Silent when the structure is unchanged. Never overwrites existing docs or hand-written prose.
  • PostToolUse (dox-child-scaffold.py, chained in post-write-aggregator.py): the moment you write a file into an undocumented directory, it creates that dir's CLAUDE.md + AGENTS.md and re-syncs the root index.
  • PreToolUse (dox-write-gate.py): hard-denies code writes when the root is missing (doc/scaffold writes are always allowed; re-issue the exact edit once to override). The Tier-2 soft-ask is skipped while autoCreateChildren is on (the PostToolUse hook creates the local doc for you).
  • Full doctrine: ~/.claude/rules/dox-doc-tree.md.

Config (dox-tree-guard.config.json)

Key Default Effect
documentAllDirs true document every dir; false → ≥significantDirThreshold code files
autoCreateChildren true sweep + PostToolUse auto-create child stubs
syncRootIndex true keep the root dox:index block synced
sweepMaxDepth 12 max directory depth to descend
maxSweepDirs 500 safety cap on dirs documented per sweep
significantDirThreshold 3 legacy gate (only when documentAllDirs:false)

Templates

  • references/root-template.md — root CLAUDE.md scaffold (paired dox:index markers).
  • references/child-template.md — child CLAUDE.md scaffold.
  • references/agents-pointer.md — the 1-line AGENTS.md pointer.

Version History

  • 581d130 Current 2026-07-19 09:07

Same Skill Collection

attic/2026-07-09/skills-pre-update/taste-skill/SKILL.md
attic/2026-07-09/skills-pre-update/ui-ux-pro-max/SKILL.md
skills/agent-development/SKILL.md
skills/api-and-interface-design/SKILL.md
skills/api-contract-standards/SKILL.md
skills/architect-system-design/SKILL.md
skills/backend-api-standards/SKILL.md
skills/backend-code-review/SKILL.md
skills/backend-error-handling/SKILL.md
skills/backend-performance-standards/SKILL.md
skills/backend-standards-always-follow/SKILL.md
skills/canary-playwright/SKILL.md
skills/caveman/SKILL.md
skills/ci-cd-and-automation/SKILL.md
skills/code-execution-standard/SKILL.md
skills/code-review-and-quality/SKILL.md
skills/code-simplification/SKILL.md
skills/codebase-design/SKILL.md
skills/codebase-start-point-guide/SKILL.md
skills/command-development/SKILL.md
skills/composition-patterns/SKILL.md
skills/context-engineering/SKILL.md
skills/dead-code-and-change-audit/SKILL.md
skills/debug-investigation/SKILL.md
skills/debugging-and-error-recovery/SKILL.md
skills/deprecation-and-migration/SKILL.md
skills/design-extract/SKILL.md
skills/design-review-playwright/SKILL.md
skills/diagnose/SKILL.md
skills/documentation-and-adrs/SKILL.md
skills/domain-modeling/SKILL.md
skills/domain-scaffold-patterns/SKILL.md
skills/doubt-driven-development/SKILL.md
skills/eval-harness/SKILL.md
skills/fix-lint-format/SKILL.md
skills/forensic-change-coupling/SKILL.md
skills/forensic-complexity-trends/SKILL.md
skills/forensic-debt-quantification/SKILL.md
skills/forensic-hotspot-finder/SKILL.md
skills/frontend-api-standards/SKILL.md
skills/frontend-code-review/SKILL.md
skills/frontend-response-handling/SKILL.md
skills/frontend-server-data-patterns/SKILL.md
skills/frontend-standards-always-follow/SKILL.md
skills/frontend-structure-standards/SKILL.md
skills/frontend-ui-engineering/SKILL.md
skills/git-workflow-and-versioning/SKILL.md
skills/golang-patterns/SKILL.md
skills/golang-testing/SKILL.md
skills/graphify/SKILL.md
skills/gsd-add-tests/SKILL.md
skills/gsd-ai-integration-phase/SKILL.md
skills/gsd-audit-fix/SKILL.md
skills/gsd-audit-milestone/SKILL.md
skills/gsd-audit-uat/SKILL.md
skills/gsd-autonomous/SKILL.md
skills/gsd-capture/SKILL.md
skills/gsd-cleanup/SKILL.md
skills/gsd-code-review/SKILL.md
skills/gsd-complete-milestone/SKILL.md
skills/gsd-config/SKILL.md
skills/gsd-debug/SKILL.md
skills/gsd-discuss-phase/SKILL.md
skills/gsd-docs-update/SKILL.md
skills/gsd-eval-review/SKILL.md
skills/gsd-execute-phase/SKILL.md
skills/gsd-explore/SKILL.md
skills/gsd-extract-learnings/SKILL.md
skills/gsd-fast/SKILL.md
skills/gsd-forensics/SKILL.md
skills/gsd-graphify/SKILL.md
skills/gsd-health/SKILL.md
skills/gsd-import/SKILL.md
skills/gsd-inbox/SKILL.md
skills/gsd-ingest-docs/SKILL.md
skills/gsd-manager/SKILL.md
skills/gsd-map-codebase/SKILL.md
skills/gsd-milestone-summary/SKILL.md
skills/gsd-mvp-phase/SKILL.md
skills/gsd-new-milestone/SKILL.md
skills/gsd-new-project/SKILL.md
skills/gsd-ns-context/SKILL.md
skills/gsd-ns-ideate/SKILL.md
skills/gsd-ns-manage/SKILL.md
skills/gsd-ns-review/SKILL.md
skills/gsd-ns-workflow/SKILL.md
skills/gsd-pause-work/SKILL.md
skills/gsd-phase/SKILL.md
skills/gsd-plan-phase/SKILL.md
skills/gsd-plan-review-convergence/SKILL.md
skills/gsd-pr-branch/SKILL.md
skills/gsd-profile-user/SKILL.md
skills/gsd-progress/SKILL.md
skills/gsd-quick/SKILL.md
skills/gsd-resume-work/SKILL.md
skills/gsd-review-backlog/SKILL.md
skills/gsd-review/SKILL.md
skills/gsd-secure-phase/SKILL.md
skills/gsd-ship/SKILL.md
skills/gsd-sketch/SKILL.md
skills/gsd-spec-phase/SKILL.md
skills/gsd-spike/SKILL.md
skills/gsd-stats/SKILL.md
skills/gsd-surface/SKILL.md
skills/gsd-thread/SKILL.md
skills/gsd-ui-phase/SKILL.md
skills/gsd-ui-review/SKILL.md
skills/gsd-ultraplan-phase/SKILL.md
skills/gsd-undo/SKILL.md
skills/gsd-update/SKILL.md
skills/gsd-validate-phase/SKILL.md
skills/gsd-verify-work/SKILL.md
skills/gsd-workspace/SKILL.md
skills/gsd-workstreams/SKILL.md
skills/huashu-design/SKILL.md
skills/improve-codebase-architecture/SKILL.md
skills/incremental-implementation/SKILL.md
skills/iterative-retrieval/SKILL.md
skills/lean-ctx/SKILL.md
skills/mcp-builder/SKILL.md
skills/mcp-usage-standards/SKILL.md
skills/mmx-cli/SKILL.md
skills/owasp-security/SKILL.md
skills/pdf/SKILL.md
skills/performance-optimization/SKILL.md
skills/plan-exec-stack-guide/SKILL.md
skills/plan-mode-gate/SKILL.md
skills/planning-and-task-breakdown/SKILL.md
skills/postgres-patterns/SKILL.md
skills/project-reference-linkage/SKILL.md
skills/project-structure-map/SKILL.md
skills/qa-playwright/SKILL.md
skills/react-hooks-patterns/SKILL.md
skills/resolving-merge-conflicts/SKILL.md
skills/santa-review/SKILL.md
skills/scaffold-standards/SKILL.md
skills/security-and-hardening/SKILL.md
skills/service-layer-standards/SKILL.md
skills/shadcn/SKILL.md
skills/shipping-and-launch/SKILL.md
skills/skill-linkage-story/SKILL.md
skills/source-driven-development/SKILL.md
skills/spec-driven-development/SKILL.md
skills/strategic-compact/SKILL.md
skills/tailwind-design-system/SKILL.md
skills/taste-skill/SKILL.md
skills/tdd/SKILL.md
skills/tech-debt-audit/SKILL.md
skills/test-driven-development/SKILL.md
skills/tool-and-doc-selection/SKILL.md
skills/using-agent-skills/SKILL.md
skills/verification-loop/SKILL.md
skills/vite-react-best-practices/SKILL.md
skills/web-design-guidelines/SKILL.md
skills/webapp-testing/SKILL.md
skills/workflow-orchestrator/SKILL.md
skills/zoom-out/SKILL.md
attic/2026-07-09/skills-pre-update/huashu-design/SKILL.md
attic/2026-07-09/skills-pre-update/impeccable/SKILL.md
skills/browser-testing-with-devtools/SKILL.md
skills/codebase-intel-first/SKILL.md
skills/docx/SKILL.md
skills/find-skills/SKILL.md
skills/gsd-help/SKILL.md
skills/gsd-ns-project/SKILL.md
skills/gsd-settings/SKILL.md
skills/higgsfield-generate/SKILL.md
skills/higgsfield-marketplace-cards/SKILL.md
skills/higgsfield-product-photoshoot/SKILL.md
skills/higgsfield-soul-id/SKILL.md
skills/higgsfield-websites/SKILL.md
skills/impeccable/SKILL.md
skills/jcodemunch-token-saver/SKILL.md
skills/pptx/SKILL.md
skills/tdd-auto-init/SKILL.md
skills/ui-ux-pro-max/SKILL.md
skills/update-docs/SKILL.md
skills/xlsx/SKILL.md
skills/autoplan/SKILL.md
skills/benchmark/SKILL.md
skills/browse/SKILL.md
skills/careful/SKILL.md
skills/connect-chrome/SKILL.md
skills/context-restore/SKILL.md
skills/design-consultation/SKILL.md
skills/design-html/SKILL.md
skills/design-review/SKILL.md
skills/design-shotgun/SKILL.md
skills/diagram/SKILL.md
skills/document-generate/SKILL.md
skills/freeze/SKILL.md
skills/guard/SKILL.md
skills/investigate/SKILL.md
skills/ios-clean/SKILL.md
skills/ios-design-review/SKILL.md
skills/ios-sync/SKILL.md
skills/landing-report/SKILL.md
skills/make-pdf/SKILL.md
skills/open-gstack-browser/SKILL.md
skills/pair-agent/SKILL.md
skills/plan-design-review/SKILL.md
skills/plan-devex-review/SKILL.md
skills/plan-tune/SKILL.md
skills/qa/SKILL.md
skills/setup-browser-cookies/SKILL.md
skills/setup-deploy/SKILL.md
skills/setup-gbrain/SKILL.md
skills/ship/SKILL.md
skills/skillify/SKILL.md
skills/spec/SKILL.md
skills/sync-gbrain/SKILL.md
skills/unfreeze/SKILL.md
skills/benchmark-models/SKILL.md
skills/canary/SKILL.md
skills/codex/SKILL.md
skills/context-save/SKILL.md
skills/cso/SKILL.md
skills/devex-review/SKILL.md
skills/document-release/SKILL.md
skills/gstack-upgrade/SKILL.md
skills/health/SKILL.md
skills/ios-fix/SKILL.md
skills/ios-qa/SKILL.md
skills/land-and-deploy/SKILL.md
skills/learn/SKILL.md
skills/office-hours/SKILL.md
skills/plan-ceo-review/SKILL.md
skills/plan-eng-review/SKILL.md
skills/qa-only/SKILL.md
skills/retro/SKILL.md
skills/review/SKILL.md
skills/scrape/SKILL.md

Metadata

Files
0
Version
581d130
Hash
769c3031
Indexed
2026-07-19 09:07

inicio - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-07-22 05:03
浙ICP备14020137号-1 $mapa de visitantes$