claude-dev-env 1.67.2 → 1.69.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/_shared/CLAUDE.md +13 -0
  2. package/_shared/pr-loop/CLAUDE.md +24 -0
  3. package/_shared/pr-loop/scripts/CLAUDE.md +30 -0
  4. package/_shared/pr-loop/scripts/pr_loop_shared_constants/CLAUDE.md +21 -0
  5. package/_shared/pr-loop/scripts/tests/CLAUDE.md +32 -0
  6. package/agents/CLAUDE.md +29 -0
  7. package/audit-rubrics/CLAUDE.md +41 -0
  8. package/audit-rubrics/category_rubrics/CLAUDE.md +36 -0
  9. package/audit-rubrics/category_rubrics/category-o-docstring-vs-impl-drift.md +1 -1
  10. package/audit-rubrics/prompts/CLAUDE.md +36 -0
  11. package/bin/CLAUDE.md +28 -0
  12. package/commands/CLAUDE.md +25 -0
  13. package/docs/CLAUDE.md +28 -0
  14. package/docs/references/CLAUDE.md +13 -0
  15. package/hooks/CLAUDE.md +31 -0
  16. package/hooks/advisory/CLAUDE.md +16 -0
  17. package/hooks/blocking/CLAUDE.md +107 -0
  18. package/hooks/blocking/code_rules_constants_config.py +7 -4
  19. package/hooks/blocking/code_rules_docstrings.py +253 -0
  20. package/hooks/blocking/code_rules_enforcer.py +6 -0
  21. package/hooks/blocking/config/CLAUDE.md +22 -0
  22. package/hooks/blocking/test_code_rules_enforcer_class_docstring_methods.py +262 -0
  23. package/hooks/blocking/test_code_rules_enforcer_dead_module_constant.py +36 -0
  24. package/hooks/blocking/test_code_rules_enforcer_docstring_fallback_branch.py +398 -0
  25. package/hooks/blocking/test_code_rules_enforcer_file_global_constants.py +9 -0
  26. package/hooks/diagnostic/CLAUDE.md +43 -0
  27. package/hooks/diagnostic/migrations/CLAUDE.md +16 -0
  28. package/hooks/diagnostic/queries/CLAUDE.md +19 -0
  29. package/hooks/git-hooks/CLAUDE.md +28 -0
  30. package/hooks/git-hooks/git_hooks_constants/CLAUDE.md +21 -0
  31. package/hooks/hooks_constants/CLAUDE.md +60 -0
  32. package/hooks/hooks_constants/blocking_check_limits.py +18 -0
  33. package/hooks/lifecycle/CLAUDE.md +18 -0
  34. package/hooks/observability/CLAUDE.md +16 -0
  35. package/hooks/session/CLAUDE.md +21 -0
  36. package/hooks/validation/CLAUDE.md +19 -0
  37. package/hooks/validators/CLAUDE.md +49 -0
  38. package/hooks/workflow/CLAUDE.md +22 -0
  39. package/package.json +1 -1
  40. package/rules/CLAUDE.md +46 -0
  41. package/rules/docstring-prose-matches-implementation.md +3 -2
  42. package/scripts/CLAUDE.md +34 -0
  43. package/scripts/dev_env_scripts_constants/CLAUDE.md +14 -0
  44. package/scripts/sync_to_cursor/CLAUDE.md +23 -0
  45. package/scripts/tests/CLAUDE.md +18 -0
  46. package/skills/CLAUDE.md +66 -0
  47. package/skills/_shared/CLAUDE.md +11 -0
  48. package/skills/_shared/pr-loop/CLAUDE.md +27 -0
  49. package/skills/_shared/pr-loop/prompts/CLAUDE.md +9 -0
  50. package/skills/_shared/pr-loop/scripts/CLAUDE.md +23 -0
  51. package/skills/_shared/pr-loop/scripts/skills_pr_loop_constants/CLAUDE.md +19 -0
  52. package/skills/anthropic-plan/CLAUDE.md +34 -0
  53. package/skills/anthropic-plan/SKILL.md +1 -1
  54. package/skills/anthropic-plan/scripts/CLAUDE.md +11 -0
  55. package/skills/anthropic-plan/scripts/anthropic_plan_scripts_constants/CLAUDE.md +16 -0
  56. package/skills/anthropic-plan/templates/CLAUDE.md +13 -0
  57. package/skills/anthropic-plan/workflow/CLAUDE.md +14 -0
  58. package/skills/auditing-claude-config/CLAUDE.md +20 -0
  59. package/skills/autoconverge/CLAUDE.md +30 -0
  60. package/skills/autoconverge/reference/CLAUDE.md +12 -0
  61. package/skills/autoconverge/workflow/CLAUDE.md +23 -0
  62. package/skills/autoconverge/workflow/autoconverge_report_constants/CLAUDE.md +16 -0
  63. package/skills/autoconverge/workflow/converge.fix-recovery.test.mjs +135 -0
  64. package/skills/autoconverge/workflow/converge.mjs +119 -2
  65. package/skills/bdd-protocol/CLAUDE.md +26 -0
  66. package/skills/bdd-protocol/references/CLAUDE.md +10 -0
  67. package/skills/bg-agent/CLAUDE.md +17 -0
  68. package/skills/bugteam/CLAUDE.md +30 -0
  69. package/skills/bugteam/reference/CLAUDE.md +22 -0
  70. package/skills/bugteam/reference/obstacles/CLAUDE.md +24 -0
  71. package/skills/bugteam/scripts/CLAUDE.md +36 -0
  72. package/skills/bugteam/scripts/bugteam_scripts_constants/CLAUDE.md +20 -0
  73. package/skills/caveman/CLAUDE.md +15 -0
  74. package/skills/code/CLAUDE.md +17 -0
  75. package/skills/copilot-review/CLAUDE.md +17 -0
  76. package/skills/deep-research/CLAUDE.md +17 -0
  77. package/skills/doc-gist/CLAUDE.md +25 -0
  78. package/skills/doc-gist/references/CLAUDE.md +9 -0
  79. package/skills/doc-gist/references/examples/CLAUDE.md +25 -0
  80. package/skills/doc-gist/scripts/CLAUDE.md +27 -0
  81. package/skills/doc-gist/scripts/doc_gist_scripts_constants/CLAUDE.md +10 -0
  82. package/skills/everything-search/CLAUDE.md +17 -0
  83. package/skills/findbugs/CLAUDE.md +20 -0
  84. package/skills/fixbugs/CLAUDE.md +19 -0
  85. package/skills/fresh-branch/CLAUDE.md +15 -0
  86. package/skills/gh-paginate/CLAUDE.md +18 -0
  87. package/skills/gotcha/CLAUDE.md +33 -0
  88. package/skills/implement/CLAUDE.md +27 -0
  89. package/skills/implement/scripts/CLAUDE.md +22 -0
  90. package/skills/implement/scripts/implement_scripts_constants/CLAUDE.md +22 -0
  91. package/skills/logifix/CLAUDE.md +36 -0
  92. package/skills/logifix/scripts/CLAUDE.md +16 -0
  93. package/skills/monitor-open-prs/CLAUDE.md +34 -0
  94. package/skills/monitor-open-prs/scripts/CLAUDE.md +17 -0
  95. package/skills/pr-consistency-audit/CLAUDE.md +34 -0
  96. package/skills/pr-consistency-audit/reference/CLAUDE.md +16 -0
  97. package/skills/pr-converge/CLAUDE.md +29 -0
  98. package/skills/pr-converge/pr_converge_skill_constants/CLAUDE.md +26 -0
  99. package/skills/pr-converge/reference/CLAUDE.md +27 -0
  100. package/skills/pr-converge/reference/obstacles/CLAUDE.md +23 -0
  101. package/skills/pr-converge/scripts/CLAUDE.md +36 -0
  102. package/skills/pr-converge/scripts/pr_converge_scripts_constants/CLAUDE.md +17 -0
  103. package/skills/pr-converge/workflows/CLAUDE.md +16 -0
  104. package/skills/pr-review-responder/CLAUDE.md +35 -0
  105. package/skills/pre-compact/CLAUDE.md +24 -0
  106. package/skills/qbug/CLAUDE.md +40 -0
  107. package/skills/rebase/CLAUDE.md +32 -0
  108. package/skills/recall/CLAUDE.md +30 -0
  109. package/skills/refine/CLAUDE.md +44 -0
  110. package/skills/refine/templates/CLAUDE.md +17 -0
  111. package/skills/remember/CLAUDE.md +31 -0
  112. package/skills/research-mode/CLAUDE.md +35 -0
  113. package/skills/session-log/CLAUDE.md +31 -0
  114. package/skills/session-tidy/CLAUDE.md +36 -0
  115. package/skills/skill-builder/CLAUDE.md +45 -0
  116. package/skills/skill-builder/references/CLAUDE.md +19 -0
  117. package/skills/skill-builder/templates/CLAUDE.md +14 -0
  118. package/skills/skill-builder/workflows/CLAUDE.md +17 -0
  119. package/skills/structure-prompt/CLAUDE.md +42 -0
  120. package/skills/structure-prompt/reference/CLAUDE.md +28 -0
  121. package/skills/task-build/CLAUDE.md +28 -0
  122. package/skills/update/CLAUDE.md +38 -0
  123. package/skills/verified-build/CLAUDE.md +33 -0
  124. package/system-prompts/CLAUDE.md +17 -0
@@ -0,0 +1,16 @@
1
+ # hooks/observability
2
+
3
+ PostToolUse hooks that record agent behavior for later review. These hooks do not block tool calls; they log or annotate them.
4
+
5
+ ## Key files
6
+
7
+ | File | Event | What it does |
8
+ |---|---|---|
9
+ | `instructions_loaded_logger.py` | PostToolUse (file load events) | Appends a JSONL record to `~/.claude/logs/instructions_loaded.jsonl` each time Claude Code loads a context file (CLAUDE.md, rules, skills), capturing the file path, load reason, memory type, and session ID |
10
+ | `test_instructions_loaded_logger.py` | — | Tests for `instructions_loaded_logger.py` |
11
+
12
+ ## Conventions
13
+
14
+ - The log file is append-only; the hook creates the parent directory if needed.
15
+ - Errors during logging are caught and written as error records rather than propagated — the hook never blocks the tool call.
16
+ - Tests run with `python -m pytest observability/test_instructions_loaded_logger.py`.
@@ -0,0 +1,21 @@
1
+ # hooks/session
2
+
3
+ SessionStart and SessionEnd hooks that manage per-session resources: cleaning up stale directories at startup and pruning plugin data at shutdown.
4
+
5
+ ## Key files
6
+
7
+ | File | Event | What it does |
8
+ |---|---|---|
9
+ | `session_env_cleanup.py` | SessionStart | Removes the current session's pre-existing `~/.claude/session-env/<session_id>/` directory and prunes sibling entries older than the stale-age threshold. Prevents `EEXIST` errors from non-recursive `mkdir` calls in the Bash tool on Windows. |
10
+ | `gh_pr_author_session_cleanup.py` | SessionEnd | Clears any PR-author swap state left over from the current session |
11
+ | `plugin_data_dir_cleanup.py` | SessionEnd | Prunes stale plugin data directories |
12
+ | `untracked_repo_detector.py` | SessionStart | Detects when the session cwd is inside a git repository that is not registered in `~/.claude/project-paths.json` and logs a warning |
13
+ | `test_gh_pr_author_session_cleanup.py` | — | Tests for `gh_pr_author_session_cleanup.py` |
14
+ | `test_session_env_cleanup.py` | — | Tests for `session_env_cleanup.py` |
15
+ | `test_untracked_repo_detector.py` | — | Tests for `untracked_repo_detector.py` |
16
+
17
+ ## Conventions
18
+
19
+ - `session_env_cleanup.py` is Windows-specific in effect but safe to run on all platforms; it exits 0 when the target directory does not exist.
20
+ - Constants (stale-age threshold, directory names) live in `hooks_constants/session_env_cleanup_constants.py`.
21
+ - Tests run with `python -m pytest session/test_<name>.py`.
@@ -0,0 +1,19 @@
1
+ # hooks/validation
2
+
3
+ PostToolUse hooks that validate code quality after Claude writes or edits a file. Unlike the blocking hooks (which fire PreToolUse and can deny the write), these hooks run after the write and report errors that need a follow-up fix.
4
+
5
+ ## Key files
6
+
7
+ | File | Event | What it does |
8
+ |---|---|---|
9
+ | `mypy_validator.py` | PostToolUse (Write/Edit on `.py` files) | Runs mypy on the written file and blocks (via PostToolUse block decision) when type errors are found — catches missing attributes, wrong signatures, type mismatches, and import errors |
10
+ | `hook_format_validator.py` | PostToolUse | Validates that a hook script's output JSON matches the expected Claude Code hook-output schema |
11
+ | `test_mypy_validator.py` | — | Tests for `mypy_validator.py` |
12
+
13
+ ## Conventions
14
+
15
+ - `mypy_validator.py` resolves the project root via `CLAUDE_PROJECT_ROOT` or `git rev-parse --show-toplevel`.
16
+ - It works on both WSL and Windows.
17
+ - Constants (timeouts, max displayed errors) are inline in `mypy_validator.py`; longer tunables go in `hooks_constants/`.
18
+ - The `eval_*.txt` files in this directory are evaluation exports used during development — not runtime artifacts.
19
+ - Tests run with `python -m pytest validation/test_<name>.py`.
@@ -0,0 +1,49 @@
1
+ # hooks/validators
2
+
3
+ A library of check modules used by the validation hooks. Each module focuses on one concern; `run_all_validators.py` runs them all and collects results. These modules do not hook into Claude Code directly — they are imported by the validation hooks.
4
+
5
+ ## Core infrastructure
6
+
7
+ | File | Role |
8
+ |---|---|
9
+ | `validator_base.py` | Defines the `Violation` dataclass (`file`, `line`, `message`) used by every check module |
10
+ | `validator_defaults.py` | Default configuration values shared across check modules |
11
+ | `exempt_paths.py` | Path exemption logic — paths that checks skip (e.g. vendored code) |
12
+ | `output_formatter.py` | Formats `Violation` lists into human-readable output |
13
+ | `run_all_validators.py` | Entry point — runs every check module and aggregates results |
14
+ | `health_check.py` | Verifies that all validator dependencies (ruff, mypy) are reachable |
15
+
16
+ ## Check modules
17
+
18
+ | Module | What it checks |
19
+ |---|---|
20
+ | `abbreviation_checks.py` | Abbreviated names in Python code |
21
+ | `code_quality_checks.py` | General code quality concerns (dead code, stub bodies, etc.) |
22
+ | `comment_checks.py` | Inline comment presence and content |
23
+ | `file_structure_checks.py` | File-level structural rules (line count, module layout) |
24
+ | `git_checks.py` | Git-state checks (untracked files, merge conflicts) |
25
+ | `magic_value_checks.py` | Magic numbers and strings |
26
+ | `mypy_integration.py` | Runs mypy and converts its output to `Violation` objects |
27
+ | `pr_reference_checks.py` | PR references in commit messages and changelogs |
28
+ | `python_antipattern_checks.py` | Python-specific anti-patterns (bare `except`, `Any`, etc.) |
29
+ | `python_style_checks.py` | Python style rules (naming, imports, type hints) |
30
+ | `react_checks.py` | React/TSX-specific checks (class component patterns, PureComponent usage) |
31
+ | `ruff_integration.py` | Runs ruff and converts its output to `Violation` objects |
32
+ | `security_checks.py` | Security anti-patterns (hardcoded secrets, unsafe calls) |
33
+ | `todo_checks.py` | TODO/FIXME markers without an associated issue reference |
34
+ | `type_safety_checks.py` | Type-safety rules (no `Any`, no `cast`, no `# type: ignore`) |
35
+ | `useless_test_checks.py` | Tests that check only existence or constant values |
36
+ | `verify_paths.py` | Validates that file paths referenced in code actually exist |
37
+
38
+ ## Subdirectory
39
+
40
+ | Directory | Role |
41
+ |---|---|
42
+ | `test_files/` | Fixture files used by the validator tests — not checked-in test code |
43
+
44
+ ## Conventions
45
+
46
+ - Every check module exposes one or more functions that take file content or an AST and return a list of `Violation` objects.
47
+ - Test files live beside the modules they test: `test_<module>.py`. Run with `python -m pytest validators/test_<name>.py`.
48
+ - `conftest.py` provides shared test fixtures (sample files, fixture paths).
49
+ - `README.md` in this directory documents the validator design and how to add a new check.
@@ -0,0 +1,22 @@
1
+ # hooks/workflow
2
+
3
+ PostToolUse hooks that trigger side-effects after Claude writes a file. They do not block writes; they produce companion artifacts or publish content automatically.
4
+
5
+ ## Key files
6
+
7
+ | File | Event | What it does |
8
+ |---|---|---|
9
+ | `auto_formatter.py` | PostToolUse (Write/Edit) | Runs the project's auto-formatter (ruff, prettier, etc.) on the written file and sends a desktop notification when formatting changes are applied |
10
+ | `doc_gist_auto_publish.py` | PostToolUse (Write on `.html` files) | When an `.html` file has the `<!-- @publish-as-gist -->` marker, uploads it as a secret GitHub Gist and prints the htmlpreview URL into the harness output |
11
+ | `md_to_html_companion.py` | PostToolUse (Write/Edit on `.md` files) | Generates a styled `.html` companion file from the `.md` source with dark-mode styling |
12
+ | `investigation_tracker_reset.py` | PostToolUse | Resets the investigation tracker state after a tool call |
13
+ | `test_auto_formatter.py` | — | Tests for `auto_formatter.py` |
14
+ | `test_doc_gist_auto_publish.py` | — | Tests for `doc_gist_auto_publish.py` |
15
+ | `test_md_to_html_companion.py` | — | Tests for `md_to_html_companion.py` |
16
+
17
+ ## Conventions
18
+
19
+ - All three main hooks exit 0 even on failure — they log warnings to stderr but do not break Claude's flow.
20
+ - `doc_gist_auto_publish.py` checks for the `<!-- @publish-as-gist -->` marker before doing any work; HTML files without it are ignored.
21
+ - Constants (marker text, blocked URL schemes, gist upload script path) live in `hooks_constants/doc_gist_auto_publish_constants.py` and `hooks_constants/html_companion_constants.py`.
22
+ - Tests run with `python -m pytest workflow/test_<name>.py`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-dev-env",
3
- "version": "1.67.2",
3
+ "version": "1.69.0",
4
4
  "description": "Claude Code development standards — rules, hooks, agents, commands, and skills",
5
5
  "type": "module",
6
6
  "bin": {
@@ -0,0 +1,46 @@
1
+ # rules
2
+
3
+ Rule files installed into `~/.claude/rules/` by `bin/install.mjs`. Claude Code loads these as always-on behavioral constraints for every session. Each `.md` file covers one named rule; hook-enforced rules are also backed by a Python hook in `hooks/`.
4
+
5
+ ## Files
6
+
7
+ | File | Rule |
8
+ |---|---|
9
+ | `agent-spawn-protocol.md` | Protocol for spawning subagents: context sufficiency check, prompt generation via `/prompt-generator`, then spawn |
10
+ | `ask-user-question-required.md` | Every user-directed question goes through the `AskUserQuestion` tool — no plain-text questions |
11
+ | `bdd.md` | BDD discovery-driven development workflow and Example Mapping reference |
12
+ | `cleanup-temp-files.md` | Remove temporary files created during a task when the task is complete |
13
+ | `code-reviews.md` | Mandatory protocol for responding to GitHub PR review feedback |
14
+ | `code-standards.md` | Pointer to `CODE_RULES.md` as the single source of truth |
15
+ | `confirm-implementation-forks.md` | Stop and ask when two or more workable implementation paths change the deliverable |
16
+ | `conservative-action.md` | Research and recommend when intent is ambiguous; act only on explicit request |
17
+ | `context7.md` | Use Context7 MCP to fetch current library docs; always prefer live docs over built-in knowledge |
18
+ | `docstring-prose-matches-implementation.md` | Prose enumerations in docstrings cover every behavior the body applies |
19
+ | `explore-thoroughly.md` | Read relevant files and map existing patterns before proposing a change |
20
+ | `file-global-constants.md` | File-global constants need at least two same-file references; otherwise move value to `config/` |
21
+ | `gh-body-file.md` | Use `--body-file` with a temp file for all `gh` commands carrying markdown body content |
22
+ | `gh-paginate.md` | Use `--paginate --slurp` piped to external `jq` for paginated GitHub API list endpoints |
23
+ | `git-workflow.md` | PR workflow: always create as draft, one commit per review stage, never commit working docs or images |
24
+ | `hook-prose-matches-detector.md` | Hook prose descriptions match what the hook actually detects |
25
+ | `long-horizon-autonomy.md` | Autonomous-run behaviors: act on what you have, do not end on a promise, delegate and keep working |
26
+ | `no-cross-skill-duplicate-helpers.md` | No duplicating shared helpers across skills; use `_shared/` |
27
+ | `no-historical-clutter.md` | Documentation describes current state only; no historical or transitional language |
28
+ | `no-inline-destructive-literals.md` | No destructive-command literals in Bash tool command strings, even as data |
29
+ | `orphan-css-class.md` | Every `class="..."` attribute in Python-generated markup has a matching selector in the `<style>` block |
30
+ | `parallel-tools.md` | Make all independent tool calls in a single response |
31
+ | `plain-language.md` | Everyday words, short active sentences, lead with the answer |
32
+ | `prompt-workflow-context-controls.md` | Keep prompt-workflow instruction layers small and stable; load heavy skills on demand |
33
+ | `research-mode.md` | Three anti-hallucination constraints: say "I don't know", verify with citations, quote for factual grounding |
34
+ | `right-sized-engineering.md` | Simple over clever; functions over classes; concrete over abstract |
35
+ | `self-contained-docs.md` | Every document is fully self-contained; no references to the conversation that produced it |
36
+ | `shell-invocation-policy.md` | All Windows shell commands use `pwsh`; `powershell.exe`, `cmd /c`, and `bash -c` are blocked |
37
+ | `tdd.md` | Test-driven development: red → green → refactor, no production code before a failing test |
38
+ | `testing.md` | Test quality and infrastructure standards |
39
+ | `vault-context.md` | Search Obsidian vault for prior sessions and decisions before substantive project work |
40
+ | `verify-before-asking.md` | Answer questions by inspecting files or running tools before asking the user |
41
+ | `windows-filesystem-safe.md` | Use safe `rmtree` patterns on Windows; `mkdirSync` with `recursive: true` on possibly-existing paths |
42
+ | `workflow-substitution-slots.md` | Per-iteration values in `.workflow.js` templates use angle-bracket slots |
43
+
44
+ ## Hook enforcement
45
+
46
+ Rules marked with ⚡ in `packages/claude-dev-env/docs/CODE_RULES.md` are backed by a blocking hook in `hooks/blocking/`. Rules without a hook are judgment-based and enforced via audit rubrics (`audit-rubrics/`).
@@ -6,7 +6,7 @@
6
6
 
7
7
  When a docstring enumerates the behaviors a body applies, the enumeration covers every behavior the body applies. A reader trusts the list to be complete: an item the code applies but the prose omits is a silent gap that misleads every future reader and reviewer.
8
8
 
9
- The gate validator `check_docstring_args_match_signature` covers the `Args:` section parameter names. Free-form prose — `"a field counts as read when ..."`, `"resolves to shared temp only"`, `"strip ceremony, then drop blockquotes"` — has no signature to compare against, so the gate cannot catch its drift. This rule is the judgment standard for that prose. It carries documented-but-pending hook coverage; the audit lane below is the enforcement until a deterministic gate check exists.
9
+ The gate validator `check_docstring_args_match_signature` covers the `Args:` section parameter names. Two more gate validators each cover one deterministic slice of the free-form prose. `check_docstring_fallback_branch_coverage` covers a summary that scopes a fallback to a single condition (`only when`, `falls back to ... when`) while the body routes to that same fallback call from two or more distinct early-return guards. `check_class_docstring_names_public_methods` covers a class whose docstring is a single summary line while the class exposes two or more public methods whose names the summary never spells out the drift where a one-line class summary keeps naming its first feature after the class grows a second public entry point. The remaining free-form prose — `"a field counts as read when ..."`, `"resolves to shared temp only"`, `"strip ceremony, then drop blockquotes"`, and module-level responsibility paragraphs — has no signature, method roster, or single structural shape to compare against, so the gate cannot catch its drift. This rule is the judgment standard for that prose; the audit lane below is the enforcement for everything outside the three gated slices.
10
10
 
11
11
  ## What to check before you write the docstring
12
12
 
@@ -14,6 +14,7 @@ Read the body and the docstring side by side:
14
14
 
15
15
  - **Read-source / match-source unions.** A body that computes `read_names = a | b | c` (or any union of "what counts") names each union member in the prose enumeration. A union member the code applies but the prose omits is a gap.
16
16
  - **Suppressor / skip lists.** A body with several early returns that suppress the check names each suppressor in the prose.
17
+ - **Shared fallback routes.** A summary that scopes a fallback call to one condition names every condition that reaches that call. When the body routes to the same fallback from two or more early-return guards (`if a is None: fallback(); return` and `if random() < p: fallback(); return`), the prose enumerates both guards. The `check_docstring_fallback_branch_coverage` gate blocks the single-condition form of this drift at Write/Edit time.
17
18
  - **Step order.** A docstring that says `A then B then C` matches the call order in the body.
18
19
  - **Predicate breadth.** A boolean helper whose prose promises a narrow check accepts only the inputs the prose names — no broader input class the name and prose do not mention.
19
20
 
@@ -36,7 +37,7 @@ A docstring that enumerates "attribute read, augmented-assignment target, class-
36
37
 
37
38
  ## Enforcement (audit lane)
38
39
 
39
- This drift class is sub-bucket **O6** in `packages/claude-dev-env/audit-rubrics/category_rubrics/category-o-docstring-vs-impl-drift.md` (free-form `Note:` / `Returns:` / responsibility-list claims). The audit teammate lists every prose enumeration in a changed docstring and verifies each item against the body, and lists every union member / suppressor / step in the body and verifies each appears in the prose. A union member or suppressor in the body that the prose omits is an O6 finding.
40
+ This drift class is sub-bucket **O6** in `packages/claude-dev-env/audit-rubrics/category_rubrics/category-o-docstring-vs-impl-drift.md` (free-form `Note:` / `Returns:` / responsibility-list claims). The audit teammate lists every prose enumeration in a changed docstring and verifies each item against the body, and lists every union member / suppressor / step in the body and verifies each appears in the prose. A union member or suppressor in the body that the prose omits is an O6 finding. The single-condition shared-fallback shape of this drift is gated deterministically by `check_docstring_fallback_branch_coverage` (`packages/claude-dev-env/hooks/blocking/code_rules_docstrings.py`); the audit lane covers every O6 shape the gate cannot match.
40
41
 
41
42
  ## Why
42
43
 
@@ -0,0 +1,34 @@
1
+ # scripts
2
+
3
+ Utility scripts installed into `~/.claude/scripts/` by `bin/install.mjs`. Each script is a standalone tool a user or hook can invoke directly.
4
+
5
+ ## Scripts
6
+
7
+ | File | Purpose |
8
+ |---|---|
9
+ | `setup_project_paths.py` | One-time bootstrap: discovers git repos via `es.exe` (Everything) and writes `~/.claude/project-paths.json`; never hardcodes scan roots |
10
+ | `sweep_empty_dirs.py` | Deletes empty directories older than a configurable age under a given root; runs once (`--once`) or in continuous-watch mode |
11
+ | `sync_to_cursor.py` | Entry point for syncing Claude rules to Cursor `.mdc` files; delegates to the `sync_to_cursor/` package |
12
+
13
+ ## PowerShell scripts
14
+
15
+ | File | Purpose |
16
+ |---|---|
17
+ | `Audit-ShellPolicy.ps1` | Audits Bash tool calls in session transcripts against the `pwsh`-only shell policy |
18
+ | `Migrate-ShellPolicy.ps1` | Applies automated fixes for common shell-policy violations found by the audit script |
19
+ | `Install-SweepEmptyDirs.ps1` | Registers `sweep_empty_dirs.py` as a scheduled task on Windows |
20
+ | `check.ps1` | Runs the full code-quality check suite |
21
+
22
+ ## Subdirectories
23
+
24
+ | Entry | Description |
25
+ |---|---|
26
+ | `dev_env_scripts_constants/` | Named constants (`timing.py`) for scripts in this directory |
27
+ | `sync_to_cursor/` | Package that builds Cursor `.mdc` files from Claude rules and docs |
28
+ | `tests/` | pytest suite for the Python scripts in this directory |
29
+
30
+ ## Running tests
31
+
32
+ ```bash
33
+ python -m pytest packages/claude-dev-env/scripts/tests/
34
+ ```
@@ -0,0 +1,14 @@
1
+ # dev_env_scripts_constants
2
+
3
+ Named constants for scripts in `scripts/`. Follows the project convention that timeouts, delays, and retries live in `timing.py`.
4
+
5
+ ## Modules
6
+
7
+ | File | Constants for |
8
+ |---|---|
9
+ | `timing.py` | `sweep_empty_dirs.py` — `DEFAULT_AGE_SECONDS` (smallest age before an empty directory is eligible for removal) and `DEFAULT_POLL_INTERVAL` (seconds between sweep passes in continuous-watch mode) |
10
+ | `__init__.py` | Empty package marker |
11
+
12
+ ## Convention
13
+
14
+ Every constant is `UPPER_SNAKE_CASE` with an explicit type annotation and a docstring. Scripts import from here rather than embedding literal values in their bodies.
@@ -0,0 +1,23 @@
1
+ # sync_to_cursor
2
+
3
+ Python package that syncs Claude rules and docs to Cursor `.mdc` files. Entry point is `packages/claude-dev-env/scripts/sync_to_cursor.py`; this package holds the implementation modules.
4
+
5
+ ## Modules
6
+
7
+ | File | Purpose |
8
+ |---|---|
9
+ | `engine.py` | Main sync logic: loads the manifest, builds rule mappings, hashes sources, writes `.mdc` files, and updates the manifest |
10
+ | `rules.py` | Builds `RuleMapping` objects from Claude rule markdown files; applies transforms to fit Cursor's `.mdc` format |
11
+ | `canonical_docs.py` | Checks and syncs canonical documentation files (`CODE_RULES.md`, `TEST_QUALITY.md`) to the Cursor rules directory |
12
+ | `paths.py` | Resolves the Claude and Cursor layout paths; respects the `LLM_SETTINGS_ROOT` env var for non-home layouts |
13
+ | `hashing.py` | SHA-256 helpers that detect whether source files changed since the last sync run |
14
+ | `config.py` | Package-level constants: `GENERATOR_VERSION`, `CANONICAL_DOC_FILES`, `MAX_RULE_BODY_LINES` |
15
+ | `__init__.py` | Empty package marker |
16
+
17
+ ## Layout resolution
18
+
19
+ `paths.py` reads `LLM_SETTINGS_ROOT` from the environment. When set, it uses that path as the base for both `.claude/` and `.cursor/`. When unset, it falls back to `Path.home()`.
20
+
21
+ ## Tests
22
+
23
+ Tests live in `packages/claude-dev-env/scripts/tests/test_sync_to_cursor.py`.
@@ -0,0 +1,18 @@
1
+ # scripts/tests
2
+
3
+ pytest suite for the Python scripts in `scripts/`.
4
+
5
+ ## Test files
6
+
7
+ | File | Covers |
8
+ |---|---|
9
+ | `test_setup_project_paths.py` | `setup_project_paths.py` — discovery, filtering, and `project-paths.json` writing |
10
+ | `test_setup_project_paths_config.py` | Configuration constants used by `setup_project_paths.py` |
11
+ | `test_sweep_empty_dirs.py` | `sweep_empty_dirs.py` — age check, one-shot mode, and continuous-watch behavior |
12
+ | `test_sync_to_cursor.py` | `sync_to_cursor/` package — mapping, hashing, manifest, and path resolution |
13
+
14
+ ## Running
15
+
16
+ ```bash
17
+ python -m pytest packages/claude-dev-env/scripts/tests/
18
+ ```
@@ -0,0 +1,66 @@
1
+ # Skills Directory
2
+
3
+ Each skill is a self-contained folder Claude Code loads on demand. At startup, only the skill's `name` and `description` metadata load. The full `SKILL.md` body and any support files load only when a skill becomes relevant to the conversation.
4
+
5
+ ## Skill folder convention
6
+
7
+ | Item | Role |
8
+ |---|---|
9
+ | `SKILL.md` | Required entry point. YAML frontmatter with `name` and `description` (the trigger). Body holds the skill's full instructions. |
10
+ | `scripts/` | Python helper scripts the skill invokes at runtime. |
11
+ | `workflow/` | `.mjs` workflow scripts run via the `Workflow` tool. |
12
+ | `templates/` | Template files the skill or workflow renders at build time. |
13
+ | `reference/` | Reference docs the skill cites or the workflow reads. |
14
+ | `*_constants/` | Python package of named constants imported by `scripts/`. |
15
+
16
+ Skills install to `~/.claude/skills/<skill-name>/` via `packages/claude-dev-env/bin/install.mjs`. See `docs/references/skill-install-system.md` for the install pipeline.
17
+
18
+ ## Shared support code
19
+
20
+ `_shared/` — support code used by more than one skill. It holds `pr-loop/`, which provides prompt templates and Python helper scripts shared between `bugteam` and `pr-converge`.
21
+
22
+ ## Skill groups
23
+
24
+ **Planning and implementation**
25
+ - `anthropic-plan` — creates a source-grounded plan packet before any code changes
26
+ - `implement` — structured implementation from an existing plan packet
27
+ - `bdd-protocol` — BDD depth: Example Mapping, scenario quality, outside-in layout
28
+ - `verified-build` — build + test loop that gates on a verifier verdict
29
+
30
+ **PR review and convergence**
31
+ - `autoconverge` — autonomous single-run workflow that drives a PR to ready
32
+ - `pr-converge` — paced convergence loop across `ScheduleWakeup` ticks
33
+ - `bugteam` — open-loop audit-fix until convergence
34
+ - `pr-review-responder` — fetches all reviewer comments and replies systematically
35
+ - `pr-consistency-audit` — cross-file consistency check on a PR diff
36
+ - `copilot-review` — requests and polls a GitHub Copilot review
37
+ - `findbugs` / `fixbugs` — find bugs then fix them in separate passes
38
+ - `code` — strict-mode code generation session
39
+
40
+ **Research and discovery**
41
+ - `deep-research` — multi-source research with citation
42
+ - `research-mode` — activates anti-hallucination discipline for a session
43
+ - `recall` — retrieves facts from memory files
44
+ - `remember` — saves a decision, gotcha, or architectural choice to the Obsidian vault
45
+ - `everything-search` — file-system search via the Everything MCP tool
46
+ - `caveman` — trims noise from a draft artifact
47
+
48
+ **Session and workflow management**
49
+ - `session-log` — logs a session report to the Obsidian vault
50
+ - `session-tidy` — tidies the session folder
51
+ - `bg-agent` — launches a background agent
52
+ - `task-build` — gathers open tasks
53
+ - `update` — updates the dev-env package
54
+ - `gh-paginate` — safe `gh api` pagination patterns
55
+ - `fresh-branch` — creates a clean branch off main
56
+ - `rebase` — rebases onto main
57
+ - `gotcha` — records a hard-won lesson to memory
58
+ - `logifix` — restores the Logitech Gaming Software (LCore) tray icon when it disappears on Windows
59
+ - `refine` — refinement pass on an artifact
60
+ - `structure-prompt` — structures a freeform prompt
61
+ - `monitor-open-prs` — polls open PRs for status
62
+ - `pre-compact` — compact-safe session handoff
63
+ - `qbug` — required baseline PR audit; one clean-coder subagent loops audit → fix → commit → push until clean or stuck
64
+ - `skill-builder` — complete skill-building lifecycle
65
+ - `doc-gist` — uploads an HTML file as a secret gist
66
+ - `auditing-claude-config` — audits a Claude Code setup for context-budget waste and produces a migration table with savings
@@ -0,0 +1,11 @@
1
+ # _shared
2
+
3
+ Support code shared across multiple skills. Each subdirectory targets a specific cross-skill concern.
4
+
5
+ ## Subdirectories
6
+
7
+ | Directory | Role |
8
+ |---|---|
9
+ | `pr-loop/` | Prompt templates and Python helper scripts used by both `bugteam` and `pr-converge` for their audit-fix loop. |
10
+
11
+ Files here are not skills themselves and have no `SKILL.md`. They install alongside each consuming skill via the install pipeline in `packages/claude-dev-env/bin/install.mjs`.
@@ -0,0 +1,27 @@
1
+ # pr-loop
2
+
3
+ Shared infrastructure for the PR audit-fix loop used by `bugteam` and `pr-converge`. Provides the XML prompt template, Python runtime scripts, and named constants that both skills invoke during each loop tick.
4
+
5
+ ## Subdirectories
6
+
7
+ | Directory | Role |
8
+ |---|---|
9
+ | `prompts/` | XML agent prompt templates. |
10
+ | `scripts/` | Python scripts for loop state management, prompt building, outcome recording, path resolution, and preflight checks. |
11
+
12
+ ## Key files
13
+
14
+ | File | Role |
15
+ |---|---|
16
+ | `prompts/pr-consistency-audit.xml` | Structured prompt artifact for the cross-file consistency audit agent. |
17
+ | `packages/claude-dev-env/skills/_shared/pr-loop/scripts/build_audit_prompt.py` | Assembles the audit agent prompt from loop state and the constants module. |
18
+ | `packages/claude-dev-env/skills/_shared/pr-loop/scripts/build_fix_prompt.py` | Assembles the fix agent prompt from loop state and findings. |
19
+ | `packages/claude-dev-env/skills/_shared/pr-loop/scripts/init_loop_state.py` | Initializes the per-PR loop state JSON file. |
20
+ | `packages/claude-dev-env/skills/_shared/pr-loop/scripts/write_audit_outcomes.py` | Writes the per-loop audit outcome XML into the workspace. |
21
+ | `packages/claude-dev-env/skills/_shared/pr-loop/scripts/write_fix_outcomes.py` | Writes the per-loop fix outcome XML into the workspace. |
22
+ | `packages/claude-dev-env/skills/_shared/pr-loop/scripts/preflight_worktree.py` | Verifies the working directory is a healthy worktree for the target PR's repo. |
23
+ | `packages/claude-dev-env/skills/_shared/pr-loop/scripts/teardown_worktrees.py` | Removes loop worktrees on clean exit. |
24
+ | `packages/claude-dev-env/skills/_shared/pr-loop/scripts/_path_resolver.py` | Resolves workspace and worktree paths from PR metadata. |
25
+ | `packages/claude-dev-env/skills/_shared/pr-loop/scripts/_cli_utils.py` | Shared CLI argument parsing helpers. |
26
+ | `packages/claude-dev-env/skills/_shared/pr-loop/scripts/_xml_utils.py` | XML serialization helpers. |
27
+ | `scripts/skills_pr_loop_constants/` | Named constants package imported by the scripts above. |
@@ -0,0 +1,9 @@
1
+ # prompts
2
+
3
+ XML agent prompt templates for the PR audit-fix loop.
4
+
5
+ ## Key files
6
+
7
+ | File | Role |
8
+ |---|---|
9
+ | `pr-consistency-audit.xml` | Structured prompt artifact for the cross-file consistency audit agent. Defines the agent role, scope anchors, a ten-rule detection workflow, and output format. `bugteam` and `pr-converge` both inject this prompt when running the consistency audit step. |
@@ -0,0 +1,23 @@
1
+ # scripts
2
+
3
+ Python scripts that run the PR audit-fix loop at runtime. Both `bugteam` and `pr-converge` invoke these scripts during each loop tick.
4
+
5
+ ## Key files
6
+
7
+ | File | Role |
8
+ |---|---|
9
+ | `build_audit_prompt.py` | Assembles the audit agent prompt from loop state and category constants. |
10
+ | `build_fix_prompt.py` | Assembles the fix agent prompt from loop state and findings XML. |
11
+ | `init_loop_state.py` | Initializes the per-PR `loop-state.json` file in the workspace directory. |
12
+ | `write_audit_outcomes.py` | Writes per-loop audit outcome XML into the workspace. |
13
+ | `write_fix_outcomes.py` | Writes per-loop fix outcome XML into the workspace. |
14
+ | `preflight_worktree.py` | Verifies the working directory is a healthy git worktree for the target PR's repo. Supports `--mode strict` to abort when the repo does not match. |
15
+ | `teardown_worktrees.py` | Removes per-PR worktrees after a clean loop exit. |
16
+ | `_path_resolver.py` | Resolves workspace and worktree paths from PR owner, repo, and number. |
17
+ | `_cli_utils.py` | Shared CLI argument parsing helpers (argparse wrappers). |
18
+ | `_xml_utils.py` | XML serialization helpers for outcome files. |
19
+ | `skills_pr_loop_constants/` | Named constants package imported by the scripts above. |
20
+
21
+ ## Tests
22
+
23
+ Each script has a paired test file (`test_build_audit_prompt.py`, `test_build_fix_prompt.py`, etc.) in this directory. Run with `python -m pytest` from the repo root.
@@ -0,0 +1,19 @@
1
+ # skills_pr_loop_constants
2
+
3
+ Python package of named constants for the `pr-loop` shared scripts. All constants are `UPPER_SNAKE_CASE` module-level names imported by the sibling scripts.
4
+
5
+ ## Key files
6
+
7
+ | File | Role |
8
+ |---|---|
9
+ | `__init__.py` | Package marker. |
10
+ | `path_resolver_constants.py` | Path template strings and format constants: workspace directory naming, worktree directory name, diff patch filename pattern, outcome XML filename patterns, loop state filename, fix status values, audit constraint texts, audit category entries, fix execution steps, fix constraint texts, and XML serialization settings. |
11
+ | `preflight_constants.py` | Constants used by `preflight_worktree.py` for exit codes and output marker strings. |
12
+
13
+ ## Usage
14
+
15
+ Scripts import directly from the package:
16
+
17
+ ```python
18
+ from skills_pr_loop_constants.path_resolver_constants import LOOP_STATE_FILENAME
19
+ ```
@@ -0,0 +1,34 @@
1
+ # anthropic-plan
2
+
3
+ **Trigger:** `/anthropic-plan`, `/plan`, "plan this first", "think before coding", "make a plan", "scope this out", "don't code yet", and non-trivial requests that need source-grounded design before build work.
4
+
5
+ Creates a repo-local plan packet under `docs/plans/<slug>/` by running the `plan-packet.mjs` workflow. The packet holds context, spec, implementation steps, validation, and a handoff prompt for the build agent. The skill stops before any production code changes.
6
+
7
+ ## Subdirectories
8
+
9
+ | Directory | Role |
10
+ |---|---|
11
+ | `scripts/` | Python validator (`validate_packet.py`) that checks the packet's required files, placeholders, and consistency. |
12
+ | `templates/` | Template files the workflow renders when building the packet (`README.md`, `build-prompt.md`, `reuse-audit.md`, `source-map.md`, `visual-plan.template.html`). |
13
+ | `workflow/` | The `.mjs` workflow scripts and their test files. |
14
+
15
+ ## Key files
16
+
17
+ | File | Role |
18
+ |---|---|
19
+ | `SKILL.md` | Entry point. Full planning protocol, workflow contract, packet shape, and validation rules. |
20
+ | `workflow/plan-packet.mjs` | Main workflow script. Reads repo context, writes the packet, runs the validator, spawns `plan-packet-validator`, runs the reuse audit, builds the visual HTML, and returns the packet path. |
21
+ | `workflow/plan-packet.contract.test.mjs` | Contract tests for the workflow script. |
22
+ | `packages/claude-dev-env/skills/anthropic-plan/scripts/validate_packet.py` | Deterministic validator: checks required files, open questions, source-map strength, TDD coverage, and `packet.json` consistency. Exits with code 2 on failure. |
23
+ | `templates/visual-plan.template.html` | Template for the single-file offline visual HTML the workflow builds after validation. |
24
+
25
+ ## Entry point
26
+
27
+ ```js
28
+ Workflow({
29
+ scriptPath: "$HOME/.claude/skills/anthropic-plan/workflow/plan-packet.mjs",
30
+ args: { task: "<user request>", cwd: "<working directory>" }
31
+ })
32
+ ```
33
+
34
+ The session must be in a worktree (path has `.claude/worktrees/`) before calling the workflow.
@@ -41,7 +41,7 @@ The workflow handles the full planning loop:
41
41
  2. Read project instructions, rules, relevant skills, manifests, docs, tests, hooks, agents, commands, configs, and workflows.
42
42
  3. Build a source inventory and extract source facts into `context/source-map.md`.
43
43
  4. Write the packet under `docs/plans/<slug>/`.
44
- 5. Run `scripts/validate_packet.py`.
44
+ 5. Run `packages/claude-dev-env/skills/anthropic-plan/scripts/validate_packet.py`.
45
45
  6. Spawn `plan-packet-validator` in fresh context.
46
46
  7. Repair packet findings up to the workflow cap.
47
47
  8. Run the reuse audit: search the codebase for existing equivalents of each new file/symbol the packet introduces, write `validation/reuse-audit.md`, and gate approval on any unjustified reproduction.
@@ -0,0 +1,11 @@
1
+ # scripts
2
+
3
+ Python scripts for the `anthropic-plan` skill.
4
+
5
+ ## Key files
6
+
7
+ | File | Role |
8
+ |---|---|
9
+ | `validate_packet.py` | Deterministic packet validator. Checks that all required files exist under `docs/plans/<slug>/`, that no placeholder text remains, that `packet.json` is consistent with the folder contents, and that the TDD plan is present. Exits with code 2 on failure; the workflow treats a non-zero exit as a blocking finding. |
10
+ | `test_validate_packet.py` | Tests for `validate_packet.py`. |
11
+ | `anthropic_plan_scripts_constants/` | Named constants package (`validate_packet_constants.py`) that lists every required relative path the validator checks. |
@@ -0,0 +1,16 @@
1
+ # anthropic_plan_scripts_constants
2
+
3
+ Python package of named constants for `anthropic-plan/scripts/`.
4
+
5
+ ## Key files
6
+
7
+ | File | Role |
8
+ |---|---|
9
+ | `__init__.py` | Package marker. |
10
+ | `validate_packet_constants.py` | Defines `ALL_REQUIRED_RELATIVE_PATHS` — the tuple of every relative path that must exist inside a valid plan packet (e.g. `README.md`, `packet.json`, `context/source-map.md`, `implementation/tdd-plan.md`, `handoff/build-prompt.md`). Also defines `MARKDOWN_FILE_SUFFIX` and `EXIT_CODE_VALIDATION_FAILED`. |
11
+
12
+ ## Usage
13
+
14
+ ```python
15
+ from anthropic_plan_scripts_constants.validate_packet_constants import ALL_REQUIRED_RELATIVE_PATHS
16
+ ```
@@ -0,0 +1,13 @@
1
+ # templates
2
+
3
+ Template files the `plan-packet.mjs` workflow renders when building a plan packet.
4
+
5
+ ## Key files
6
+
7
+ | File | Role |
8
+ |---|---|
9
+ | `README.md` | Markdown template for the packet's top-level `README.md`. Placeholder slots for plan title, goal, status, packet map, and build path. |
10
+ | `build-prompt.md` | Template for `handoff/build-prompt.md` — the standalone prompt the build agent reads to start coding without needing the rest of the packet. |
11
+ | `reuse-audit.md` | Template for `validation/reuse-audit.md` — the per-item verdict table the workflow fills in during the reuse audit step. |
12
+ | `source-map.md` | Template for `context/source-map.md` — the inventory of source files and facts the planner extracts. |
13
+ | `visual-plan.template.html` | Single-file offline HTML template. The workflow fills this with packet data after validation to produce `visual-plan.html` beside the packet. Inlines all CSS and JavaScript; references no external assets. |
@@ -0,0 +1,14 @@
1
+ # workflow
2
+
3
+ Workflow scripts for the `anthropic-plan` skill.
4
+
5
+ ## Key files
6
+
7
+ | File | Role |
8
+ |---|---|
9
+ | `plan-packet.mjs` | Main workflow script. Resolves repo root, reads project context, builds the source inventory, writes the full packet under `docs/plans/<slug>/`, runs `validate_packet.py`, spawns `plan-packet-validator` in a fresh context, runs the reuse audit, builds the visual HTML from `templates/visual-plan.template.html`, and returns the packet path and validation state. |
10
+ | `plan-packet.contract.test.mjs` | Contract tests that verify the workflow script's interface and required steps without a live repo. |
11
+
12
+ ## Running
13
+
14
+ The `plan-packet.mjs` script runs via the `Workflow` tool — do not invoke it directly with Node. The skill's `SKILL.md` specifies the exact call signature and required `args`.
@@ -0,0 +1,20 @@
1
+ # auditing-claude-config
2
+
3
+ **Trigger:** `/auditing-claude-config`, reviewing the startup instruction load, `/memory` showing unexpected files, adding new rules, periodic config hygiene.
4
+
5
+ Audits a Claude Code setup — user `CLAUDE.md`, `~/.claude/rules/`, project `.claude/` — for context-budget waste: duplicate `@`-imports, always-on rules that could be path-scoped or turned into skills, and oversized files. Produces a migration table with line savings.
6
+
7
+ ## Key files
8
+
9
+ | File | Role |
10
+ |---|---|
11
+ | `SKILL.md` | Full audit protocol: inventory the always-loaded set, find duplicate imports, classify each rule, produce the migration table, stage recommendations by risk, and verify lazy-load behavior with an optional probe hook. |
12
+
13
+ ## What the skill produces
14
+
15
+ 1. **Baseline** — total always-loaded lines, broken down by file.
16
+ 2. **Migration table** — one row per rule: current lines, verdict, specific action, lines removed from preload.
17
+ 3. **Recommended next step** — the single highest-leverage change.
18
+ 4. **Open questions** — anything not verified by the probe hook.
19
+
20
+ No scripts or workflow files. The skill body holds all logic.