claude-dev-env 2.0.2 → 2.2.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 (110) hide show
  1. package/CLAUDE.md +1 -1
  2. package/hooks/blocking/CLAUDE.md +1 -0
  3. package/hooks/blocking/code_rules_shared.py +126 -47
  4. package/hooks/blocking/config/CLAUDE.md +2 -0
  5. package/hooks/blocking/config/verified_commit_context_constants.py +21 -0
  6. package/hooks/blocking/config/verified_commit_gate_output_constants.py +14 -0
  7. package/hooks/blocking/conftest.py +36 -30
  8. package/hooks/blocking/convergence_gate_blocker.py +76 -8
  9. package/hooks/blocking/plain_language_blocker.py +8 -0
  10. package/hooks/blocking/state_description_blocker.py +4 -1
  11. package/hooks/blocking/test_code_rules_shared.py +120 -20
  12. package/hooks/blocking/test_convergence_gate_blocker.py +146 -0
  13. package/hooks/blocking/test_plain_language_blocker.py +15 -0
  14. package/hooks/blocking/test_state_description_blocker.py +15 -0
  15. package/hooks/blocking/test_verified_commit_config_bootstrap.py +18 -0
  16. package/hooks/blocking/test_verified_commit_gate_additional_context.py +134 -0
  17. package/hooks/blocking/tests/test_verified_commit_gate.py +41 -0
  18. package/hooks/blocking/verified_commit_config_bootstrap.py +22 -10
  19. package/hooks/blocking/verified_commit_gate.py +113 -568
  20. package/hooks/blocking/verified_commit_gate_parts/CLAUDE.md +28 -0
  21. package/hooks/blocking/verified_commit_gate_parts/__init__.py +1 -0
  22. package/hooks/blocking/verified_commit_gate_parts/command_tokenization.py +174 -0
  23. package/hooks/blocking/verified_commit_gate_parts/deny_payload.py +53 -0
  24. package/hooks/blocking/verified_commit_gate_parts/deny_reason.py +80 -0
  25. package/hooks/blocking/verified_commit_gate_parts/directory_resolution.py +170 -0
  26. package/hooks/blocking/verified_commit_gate_parts/gated_invocations.py +205 -0
  27. package/hooks/blocking/verified_commit_gate_parts/tests/conftest.py +10 -0
  28. package/hooks/blocking/verified_commit_gate_parts/tests/test_command_tokenization.py +94 -0
  29. package/hooks/blocking/verified_commit_gate_parts/tests/test_deny_payload.py +17 -0
  30. package/hooks/blocking/verified_commit_gate_parts/tests/test_deny_reason.py +38 -0
  31. package/hooks/blocking/verified_commit_gate_parts/tests/test_directory_resolution.py +71 -0
  32. package/hooks/blocking/verified_commit_gate_parts/tests/test_gated_invocations.py +61 -0
  33. package/hooks/hooks_constants/CLAUDE.md +4 -1
  34. package/hooks/hooks_constants/code_rules_path_utils_constants.py +1 -0
  35. package/hooks/hooks_constants/convergence_gate_blocker_constants.py +36 -0
  36. package/hooks/hooks_constants/harness_scratchpad_constants.py +10 -9
  37. package/hooks/hooks_constants/mypy_integration_constants.py +16 -0
  38. package/hooks/validators/mypy_integration.py +145 -24
  39. package/hooks/validators/python_antipattern_checks.py +16 -0
  40. package/hooks/validators/run_all_validators.py +9 -3
  41. package/hooks/validators/test_mypy_integration.py +154 -0
  42. package/hooks/validators/test_python_antipattern_checks.py +112 -1
  43. package/hooks/validators/test_run_all_validators_pretooluse.py +16 -0
  44. package/package.json +1 -1
  45. package/rules/CLAUDE.md +1 -0
  46. package/rules/verified-commit-gate-skip.md +28 -0
  47. package/skills/_shared/pr-loop/CLAUDE.md +18 -13
  48. package/skills/_shared/pr-loop/portable-driver.md +150 -0
  49. package/skills/_shared/pr-loop/scripts/CLAUDE.md +3 -0
  50. package/skills/_shared/pr-loop/scripts/build_converge_task_list.py +310 -0
  51. package/skills/_shared/pr-loop/scripts/portable_converge_driver.py +1637 -0
  52. package/skills/_shared/pr-loop/scripts/select_converge_pacer.py +215 -0
  53. package/skills/_shared/pr-loop/scripts/skills_pr_loop_constants/CLAUDE.md +3 -0
  54. package/skills/_shared/pr-loop/scripts/skills_pr_loop_constants/converge_task_list_constants.py +56 -0
  55. package/skills/_shared/pr-loop/scripts/skills_pr_loop_constants/pacer_constants.py +47 -0
  56. package/skills/_shared/pr-loop/scripts/skills_pr_loop_constants/portable_driver_constants.py +181 -0
  57. package/skills/_shared/pr-loop/scripts/test_build_converge_task_list.py +140 -0
  58. package/skills/_shared/pr-loop/scripts/test_portable_converge_driver.py +1119 -0
  59. package/skills/_shared/pr-loop/scripts/test_select_converge_pacer.py +207 -0
  60. package/skills/auditing-claude-config/CLAUDE.md +2 -1
  61. package/skills/auditing-claude-config/SKILL.md +114 -176
  62. package/skills/auditing-claude-config/reference/probe-hook.md +74 -0
  63. package/skills/autoconverge/CLAUDE.md +6 -3
  64. package/skills/autoconverge/SKILL.md +421 -346
  65. package/skills/autoconverge/reference/CLAUDE.md +1 -0
  66. package/skills/autoconverge/reference/convergence.md +5 -5
  67. package/skills/autoconverge/reference/copilot-findings.md +51 -0
  68. package/skills/autoconverge/reference/multi-pr.md +33 -2
  69. package/skills/autoconverge/reference/stop-conditions.md +9 -6
  70. package/skills/autoconverge/test_portable_pacer_gate.py +54 -0
  71. package/skills/closeout/SKILL.md +7 -9
  72. package/skills/copilot-finding-triage/SKILL.md +21 -11
  73. package/skills/copilot-review/CLAUDE.md +3 -2
  74. package/skills/copilot-review/SKILL.md +119 -155
  75. package/skills/copilot-review/templates/subagent-prompt.md +49 -0
  76. package/skills/fresh-branch/CLAUDE.md +6 -9
  77. package/skills/fresh-branch/SKILL.md +84 -33
  78. package/skills/fresh-branch/scripts/create_fresh_branch.py +445 -0
  79. package/skills/fresh-branch/scripts/fresh_branch_scripts_constants/__init__.py +1 -0
  80. package/skills/fresh-branch/scripts/fresh_branch_scripts_constants/fresh_branch_cli_constants.py +74 -0
  81. package/skills/fresh-branch/scripts/test_create_fresh_branch.py +670 -0
  82. package/skills/pr-converge/CLAUDE.md +4 -3
  83. package/skills/pr-converge/SKILL.md +469 -422
  84. package/skills/pr-converge/reference/CLAUDE.md +1 -0
  85. package/skills/pr-converge/reference/multi-pr-orchestration.md +5 -1
  86. package/skills/pr-converge/reference/per-tick.md +51 -24
  87. package/skills/pr-converge/reference/progress-checklist.md +168 -0
  88. package/skills/pr-converge/test_portable_pacer_gate.py +67 -0
  89. package/skills/pr-converge/test_step5_host_branch.py +8 -6
  90. package/skills/pr-converge/workflows/schedule-wakeup-loop.md +5 -3
  91. package/skills/pr-loop-cloud-transport/SKILL.md +1 -1
  92. package/skills/privacy-hygiene/SKILL.md +68 -115
  93. package/skills/privacy-hygiene/reference/sweep-procedure.md +62 -0
  94. package/skills/session-log/CLAUDE.md +2 -1
  95. package/skills/session-log/SKILL.md +4 -26
  96. package/skills/session-log/templates/frontmatter.md +40 -0
  97. package/skills/skill-builder/CLAUDE.md +8 -7
  98. package/skills/skill-builder/SKILL.md +26 -11
  99. package/skills/skill-builder/references/CLAUDE.md +3 -1
  100. package/skills/skill-builder/references/delegation-map.md +21 -12
  101. package/skills/skill-builder/references/description-field.md +9 -11
  102. package/skills/skill-builder/references/deterministic-elements.md +218 -0
  103. package/skills/skill-builder/references/self-audit-checklist.md +62 -45
  104. package/skills/skill-builder/references/skill-modularity.md +8 -9
  105. package/skills/skill-builder/templates/CLAUDE.md +2 -2
  106. package/skills/skill-builder/templates/gap-analysis.md +15 -0
  107. package/skills/skill-builder/workflows/CLAUDE.md +5 -5
  108. package/skills/skill-builder/workflows/improve-skill.md +18 -9
  109. package/skills/skill-builder/workflows/new-skill.md +23 -15
  110. package/skills/skill-builder/workflows/polish-skill.md +28 -21
@@ -0,0 +1,218 @@
1
+ # Deterministic skill elements
2
+
3
+ Source: [Anthropic — Skill authoring best practices](https://platform.claude.com/docs/en/agents-and-tools/agent-skills/best-practices) (scripts, progressive disclosure), [Lessons from Building Claude Code](thariq-x-post-skills.json), repo skill conventions (`skills/CLAUDE.md`), `docs/CODE_RULES.md`, host task tools (`TaskCreate`, `TodoWrite`, and equivalents).
4
+
5
+ ## Contents
6
+
7
+ - [Rule](#rule)
8
+ - [What counts as deterministic](#what-counts-as-deterministic)
9
+ - [Placement](#placement)
10
+ - [Task-tool tracking (not markdown checklists)](#task-tool-tracking-not-markdown-checklists)
11
+ - [CODE_RULES bar (every code file in the skill)](#code_rules-bar-every-code-file-in-the-skill)
12
+ - [Inventory (required before Write)](#inventory-required-before-write)
13
+ - [Required task seeds (Gather / gates)](#required-task-seeds-gather--gates)
14
+ - [Anti-patterns (fail self-audit)](#anti-patterns-fail-self-audit)
15
+ - [How the body should look](#how-the-body-should-look)
16
+ - [Relation to other skill-builder specs](#relation-to-other-skill-builder-specs)
17
+
18
+ ## Rule
19
+
20
+ Any skill element that is **deterministic** ships as **code**, a **fixed artifact**, or a **session task** — never as prose-only work tracking.
21
+
22
+ | Deterministic shape | Required home |
23
+ |---|---|
24
+ | Validators, transforms, detection, mechanical sequences | `scripts/` or `workflow/*.mjs` (+ tests, `*_constants/`) |
25
+ | Verbatim templates | `templates/` |
26
+ | Long fixed tables / catalogs Claude must not paraphrase | `reference/` |
27
+ | Ordered work the agent must complete without skipping | Host **task tool** (`TaskCreate`, `TodoWrite`, or equivalent) |
28
+
29
+ > "One of the most powerful tools you can give Claude is code — letting Claude spend its turns on composition rather than reconstructing boilerplate."
30
+
31
+ > "These can include deterministic scripts or tools for maximum robustness."
32
+
33
+ Judgment, routing, and refusal stay in markdown. Fixed procedures and transforms stay in scripts. Required step lists stay on the task list — not as markdown `[ ]` boxes.
34
+
35
+ ## What counts as deterministic
36
+
37
+ A process step is deterministic when **all** of these hold:
38
+
39
+ 1. Same inputs → same outputs (no open-ended taste or design judgment).
40
+ 2. Success or failure is machine-checkable (exit code, schema, path exists, token present, task marked complete with evidence).
41
+ 3. A human could write the step as a pure function, a fixed command sequence, or a fixed task list.
42
+
43
+ ### Deterministic (must leave prose-only tracking)
44
+
45
+ | Shape | Home |
46
+ |---|---|
47
+ | Validators, linters, schema/packet checks | `scripts/` (or `workflow/*.mjs`) |
48
+ | Multi-step mechanical sequences (compile, collect, gate, scan) | `scripts/` |
49
+ | Detection logic (regex sets, path rules, pattern catalogs) | `scripts/` + `*_constants/` |
50
+ | Sorting, ranking, ID assignment, path resolution | `scripts/` |
51
+ | Verbatim prompt or output templates | `templates/` (skill body points to the path) |
52
+ | Long fixed tables / catalogs | `reference/` or a script that prints the list |
53
+ | Inline Python / JS fences meant to run | Extract to `scripts/` or `workflow/` |
54
+ | Ordered gates, audits, author checks the agent must finish | **Task tool** — seed each item; mark complete with evidence |
55
+
56
+ ### Judgment (markdown is correct)
57
+
58
+ | Shape | Home |
59
+ |---|---|
60
+ | When to invoke the skill; refusal lines | `SKILL.md` |
61
+ | How to weigh trade-offs or pick among valid approaches | `SKILL.md` / `reference/` |
62
+ | Gotchas and failure modes | `SKILL.md` |
63
+ | Sub-skill routing and composition | `SKILL.md` |
64
+ | Degree-of-freedom guidance | `SKILL.md` |
65
+
66
+ ### Borderline
67
+
68
+ - A one-liner that only launches a tool with no branching → may stay in body; the moment it grows patterns, branches, or magic strings → `scripts/`.
69
+ - A short narrative process outline (Step 1 / Step 2 headings) may stay in body **if** every required work item is also registered on the task list. Headings are orientation; the task list is the completion surface.
70
+ - Markdown `[ ]` as the only place an agent is expected to track progress → **always fail** when a task tool is available.
71
+
72
+ ## Placement
73
+
74
+ | Artifact | Directory / surface | Role |
75
+ |---|---|---|
76
+ | Python helpers | `scripts/` | Run, do not load into context as source |
77
+ | Workflow scripts | `workflow/` (`*.mjs`) | Host `Workflow` tool entrypoints |
78
+ | Named constants | `*_constants/` next to the scripts that import them | CODE_RULES config surface for skill code |
79
+ | Fixed templates | `templates/` | Copy/fill or pass to a script |
80
+ | Domain tables, long fixed lists | `reference/` | Load on demand |
81
+ | Required work items | Host task tool | Create at skill start; complete with evidence |
82
+ | Process skeleton + pointers | `SKILL.md` | "Run `scripts/foo.py` …" / "Register tasks from …" |
83
+
84
+ `SKILL.md` names the script, when to run it, what it prints, and how to treat non-zero exit. It does not restate the algorithm. It names which task-seed lists to load and when to register them.
85
+
86
+ ## Task-tool tracking (not markdown checklists)
87
+
88
+ Harnesses expose task tools so agents cannot silently skip steps. A skill that expects the agent to finish an ordered set of work **must**:
89
+
90
+ 1. Publish the items as a **task seed list** (plain bullets or numbered lines in a reference file — **no** `- [ ]` syntax).
91
+ 2. Instruct the agent, at the start of that phase, to **create one session task per item** via the host tool:
92
+ - Prefer `TaskCreate` (or host `Task` / tasks MCP) when present.
93
+ - Else `TodoWrite` / equivalent.
94
+ - Fail closed: if no task tool exists, say so and stop — do not fall back to markdown checkboxes as the tracking plan.
95
+ 3. Require each task to be marked complete only with evidence (PASS / FAIL+file:line / N/A+reason / exit code / path).
96
+ 4. Ban "copy this checklist into your response and check it off" as the primary tracking method.
97
+
98
+ Reference files may still **catalog** the required items so authors and agents know what to seed. Catalogs are data for `TaskCreate`; they are not the live work board.
99
+
100
+ ### Skills that ship multi-step process
101
+
102
+ Any skill whose process has two or more required steps must include a short **Task seeding** instruction in `SKILL.md` or the active workflow:
103
+
104
+ ```markdown
105
+ ## Task seeding
106
+
107
+ Before Step N, register every item under [reference/…-tasks.md] as a session task
108
+ (TaskCreate / TodoWrite). Work only from the task list. Mark complete with evidence.
109
+ ```
110
+
111
+ The seed list file lives under `reference/` (or is a named section of an existing reference). Do not use `- [ ]` in that file.
112
+
113
+ ## CODE_RULES bar (every code file in the skill)
114
+
115
+ Skill scripts are production code. They obey the same rules as the rest of the repo (`docs/CODE_RULES.md` / root `AGENTS.md`), including:
116
+
117
+ - **Named constants** — no bare magic numbers/strings in function bodies; skill-local values live in a `*_constants/` package the script imports.
118
+ - **Types** — parameters and returns annotated; no bare `Any` / untyped escape hatches.
119
+ - **Naming** — full words; `is_`/`has_` booleans; `all_` collections; `each_` multi-letter loops; banned prefixes (`handle_`, `process_`, `manage_`, `do_`).
120
+ - **Errors** — catch specific exceptions; exit with a clear code and message; do not punt raw traces to Claude as the recovery plan.
121
+ - **Tests** — every new production path ships a paired test in the same change (`test_*.py` beside the script, or `*.test.mjs` for workflow helpers).
122
+ - **Execute intent** — body says `Run scripts/…` (execute), not "see the script for the algorithm," unless the script is deliberately reference-only.
123
+
124
+ JS/TS skill helpers follow the same spirit: named constants, no silent stubs, paired tests.
125
+
126
+ ## Inventory (required before Write)
127
+
128
+ Every new skill and every improve pass that touches process steps records a **deterministic elements inventory** in the gap analysis:
129
+
130
+ | Column | Content |
131
+ |---|---|
132
+ | Step | Short name |
133
+ | Class | `deterministic` \| `judgment` \| `borderline` |
134
+ | Home | Path (`scripts/…`, `workflow/…`, `templates/…`, `reference/…`, `task-seed:…`, or `SKILL.md`) |
135
+ | Evidence | Why this class (one line) |
136
+ | Paired test | Path if code; `task-tool` if work list; N/A + reason if pure judgment |
137
+
138
+ Rules:
139
+
140
+ - Every `deterministic` row has a real path under `scripts/`, `workflow/`, `templates/`, `reference/`, or a `task-seed:` pointer — not prose-only.
141
+ - Every code path under `scripts/` or `workflow/` has a paired test path (or a one-line pure-data reason).
142
+ - Every required multi-step work list has a `task-seed:` home and a body instruction to register those tasks.
143
+ - A `borderline` row kept in prose has a one-line why it is not worth extracting.
144
+
145
+ ## Required task seeds (Gather / gates)
146
+
147
+ At the **deterministic-elements gate** (and again at self-audit), register **each** line below as its own session task, then complete it with evidence. Do not track these as markdown checkboxes.
148
+
149
+ 1. Every process step is classified (deterministic / judgment / borderline).
150
+ 2. Every deterministic step has a script, workflow, template, reference, or task-seed path — not prose-only.
151
+ 3. No fenced executable source lives only inside `SKILL.md` when it is meant to run.
152
+ 4. No multi-branch detection/validation logic lives only as an `rg`/`grep` one-liner in the body.
153
+ 5. Each script states execute vs read intent from the body.
154
+ 6. Each script uses a `*_constants/` (or equivalent) package for non-obvious literals.
155
+ 7. Each new script path has a paired test in the same delivery.
156
+ 8. `SKILL.md` process steps point at paths; they do not re-implement the script in markdown.
157
+ 9. Every required multi-step work list in the skill is a task-seed catalog plus a seed instruction — not a markdown `- [ ]` board.
158
+
159
+ ## Anti-patterns (fail self-audit)
160
+
161
+ - Full Python/JS program in a markdown code fence as the skill's real implementation.
162
+ - Giant shell one-liner with many alternations as the only form of a detector.
163
+ - 10+ step mechanical verification sequence written only as numbered markdown with no script.
164
+ - "Deterministic" claim in prose with no executable path Claude can run.
165
+ - Script that dumps unhandled exceptions for Claude to interpret.
166
+ - Magic literals and unnamed thresholds inside skill scripts.
167
+ - New script with no paired test.
168
+ - Markdown `- [ ]` checklist as the agent's progress tracker when a task tool is available.
169
+ - "Copy this checklist into your response and check off items" as the skill's completion protocol.
170
+ - Task-seed list written with checkbox syntax (`- [ ]`) so agents tick markdown instead of creating tasks.
171
+
172
+ ## How the body should look
173
+
174
+ **Good (script):**
175
+
176
+ ```markdown
177
+ ## Step 3: Validate packet
178
+
179
+ Run `scripts/validate_packet.py --packet <path>`.
180
+ - Exit 0 → continue.
181
+ - Exit 2 → fix listed paths, re-run (do not invent missing sections).
182
+ ```
183
+
184
+ **Good (required work list):**
185
+
186
+ ```markdown
187
+ ## Task seeding
188
+
189
+ Before self-audit, register every item in `reference/self-audit-tasks.md`
190
+ as a session task (TaskCreate). Complete each with PASS / FAIL+evidence / N/A+reason.
191
+ ```
192
+
193
+ **Bad:**
194
+
195
+ ```markdown
196
+ ## Step 3: Validate packet
197
+
198
+ Check that README.md, packet.json, context/source-map.md, …
199
+ Also run compileall, then pytest --collect-only, then scan for …
200
+ (and three more mechanical steps only in prose)
201
+
202
+ ## Self-audit
203
+
204
+ Copy this checklist into your response and check every box:
205
+ - [ ] Item one
206
+ - [ ] Item two
207
+ ```
208
+
209
+ ## Relation to other skill-builder specs
210
+
211
+ | Spec | Concern |
212
+ |---|---|
213
+ | `progressive-disclosure.md` | Where files live and how the hub points to them |
214
+ | `skill-modularity.md` | One capability; compose peer skills by name |
215
+ | `description-field.md` | Frontmatter trigger catalog |
216
+ | **This file** | Which elements must be code, task-tool lists, or fixed artifacts |
217
+
218
+ Progressive disclosure alone does not satisfy this file: moving a mechanical sequence into `reference/` as prose still fails when the sequence is deterministic — it belongs in `scripts/` or on the task list.
@@ -1,109 +1,126 @@
1
- # Self-Audit Checklist
1
+ # Self-Audit Task Seeds
2
2
 
3
3
  Mandatory post-build verification. Every item must pass before a skill is delivered. Run after writing a new skill, improving an existing one, or polishing.
4
4
 
5
- Source synthesis: [Anthropic best practices](https://platform.claude.com/docs/en/agents-and-tools/agent-skills/best-practices), [Lessons from Building Claude Code](thariq-x-post-skills.json), model skills (bugteam, pr-converge).
5
+ **How to run:** Register **each** bullet below as a session task (`TaskCreate`, `TodoWrite`, or host equivalent). Complete tasks only with evidence (PASS / FAIL+file:line / N/A+reason). Do not track progress as markdown `- [ ]` boxes in chat.
6
+
7
+ Source synthesis: [Anthropic best practices](https://platform.claude.com/docs/en/agents-and-tools/agent-skills/best-practices), [Lessons from Building Claude Code](thariq-x-post-skills.json), model skills (bugteam, pr-converge), host task tools.
6
8
 
7
9
  ## Core quality
8
10
 
9
- - [ ] **Conciseness** — Only context Claude doesn't already have. Every line justifies its token cost.
11
+ - **Conciseness** — Only context Claude doesn't already have. Every line justifies its token cost.
10
12
  > "Default assumption: Claude is already very smart."
11
- - [ ] **Degree of freedom** — Matches task fragility. Low for narrow bridges, high for open fields.
13
+ - **Degree of freedom** — Matches task fragility. Low for narrow bridges, high for open fields.
12
14
  > "Match the level of specificity to the task's fragility and variability."
13
- - [ ] **Naming convention** — Name uses gerund form (verb-ing) unless it's a well-known acronym or proper name. Lowercase, numbers, hyphens only. Max 64 chars. No reserved words.
15
+ - **Naming convention** — Name uses gerund form (verb-ing) unless it's a well-known acronym or proper name. Lowercase, numbers, hyphens only. Max 64 chars. No reserved words.
14
16
  > "Use consistent naming patterns to make Skills easier to reference."
15
- - [ ] **Description is a trigger catalog** — Capability stem (what tokens) + concrete Triggers list (when). Third person. Max 1024 chars. No XML. Spec: `description-field.md`.
17
+ - **Description is a trigger catalog** — Capability stem (what tokens) + concrete Triggers list (when). Third person. Max 1024 chars. No XML. Spec: `description-field.md`.
16
18
  > "The description is critical for skill selection: Claude uses it to choose the right Skill from potentially 100+ available Skills."
17
- - [ ] **Description is not a story** — No narrative prose, benefits language ("helps you"), first/second person, or process/implementation dump in frontmatter.
19
+ - **Description is not a story** — No narrative prose, benefits language ("helps you"), first/second person, or process/implementation dump in frontmatter.
18
20
  > "The description field is not a summary — it's a description of when to trigger."
19
- - [ ] **Description match surface** — Includes specific phrases, slash forms, and file types a user would say; distinguishable from sibling skills.
21
+ - **Description match surface** — Includes specific phrases, slash forms, and file types a user would say; distinguishable from sibling skills.
20
22
  > "Be specific and include key terms."
21
- - [ ] **SKILL.md body under 500 lines**
23
+ - **SKILL.md body under 500 lines**
22
24
  > "Keep SKILL.md body under 500 lines for optimal performance."
23
- - [ ] **One level deep** — All reference files link directly from SKILL.md. No nested references.
25
+ - **One level deep** — All reference files link directly from SKILL.md. No nested references.
24
26
  > "Claude may partially read files when they're referenced from other referenced files."
25
- - [ ] **TOC on files over 100 lines** — Every reference file >100 lines has a table of contents.
27
+ - **TOC on files over 100 lines** — Every reference file >100 lines has a table of contents.
26
28
  > "This ensures Claude can see the full scope of available information even when previewing with partial reads."
27
- - [ ] **No time-sensitive claims** — Or isolated in "old patterns" section.
29
+ - **No time-sensitive claims** — Or isolated in "old patterns" section.
28
30
  > "Don't include information that will become outdated."
29
- - [ ] **Consistent terminology** — One term per concept throughout.
31
+ - **Consistent terminology** — One term per concept throughout.
30
32
  > "Consistency helps Claude understand and follow instructions."
31
- - [ ] **Forward slashes only** — File paths use `/`, not `\`.
33
+ - **Forward slashes only** — File paths use `/`, not `\`.
32
34
  > "Unix-style paths work across all platforms."
33
- - [ ] **Default provided, not options menu** — One recommended approach, escape hatch for special cases.
35
+ - **Default provided, not options menu** — One recommended approach, escape hatch for special cases.
34
36
  > "Don't present multiple approaches unless necessary. Provide a default with escape hatch."
35
- - [ ] **Gotchas section present** — Highest-signal content. Built from real failure observations.
37
+ - **Gotchas section present** — Highest-signal content. Built from real failure observations.
36
38
  > "The highest-signal content in any skill is the Gotchas section."
37
- - [ ] **Doesn't state the obvious** — Pushes Claude out of defaults, doesn't re-teach what Claude knows.
39
+ - **Doesn't state the obvious** — Pushes Claude out of defaults, doesn't re-teach what Claude knows.
38
40
  > "Focus on information that pushes Claude out of its normal way of thinking."
39
- - [ ] **Not railroading** — Gives information and flexibility, not rigid scripts.
41
+ - **Not railroading** — Gives information and flexibility, not rigid scripts.
40
42
  > "Give Claude the information it needs, but give it the flexibility to adapt to the situation."
41
- - [ ] **When-this-applies section** — Trigger conditions clear. Refusal cases with exact response text.
43
+ - **When-this-applies section** — Trigger conditions clear. Refusal cases with exact response text.
42
44
  > bugteam pattern — "Refusals — first match wins; respond with the quoted line exactly and stop."
43
- - [ ] **File index present** — Every file in the package listed with its purpose.
45
+ - **File index present** — Every file in the package listed with its purpose.
44
46
  > "Tell Claude what files are in your skill, and it will read them at appropriate times."
45
- - [ ] **Concrete examples** — Input/output pairs or exit scenarios, not abstract descriptions.
47
+ - **Concrete examples** — Input/output pairs or exit scenarios, not abstract descriptions.
46
48
  > "Examples help Claude understand the desired style and level of detail more clearly than descriptions alone."
47
- - [ ] **Workflows have checklists** — Multi-step processes include copyable `[ ]` checklists.
48
- > "For particularly complex workflows, provide a checklist that Claude can copy into its response and check off as it progresses."
49
- - [ ] **Feedback loops where quality-critical** — Run validator → fix → repeat pattern.
49
+ - **Workflows seed tasks** — Multi-step processes ship a task-seed list and instruct the agent to register each item on the host task tool (`TaskCreate` / `TodoWrite`). No markdown `- [ ]` as the progress board when a task tool is available.
50
+ > Spec: `deterministic-elements.md` Task-tool tracking.
51
+ - **Feedback loops where quality-critical** — Run validator → fix → repeat pattern.
50
52
  > "This pattern greatly improves output quality."
51
- - [ ] **Constraints separated** — Non-negotiables in CONSTRAINTS.md or equivalent section.
53
+ - **Constraints separated** — Non-negotiables in CONSTRAINTS.md or equivalent section.
52
54
  > bugteam pattern — constraints file with design rationale.
53
- - [ ] **Folder map at bottom** — Lists directories and their purposes.
55
+ - **Folder map at bottom** — Lists directories and their purposes.
54
56
  > pr-converge pattern — "Folder map" section.
55
57
 
56
58
  ## Skill-type-specific
57
59
 
58
- - [ ] **Skill type classified** — Fits one of 9 types. Folder structure matches type recommendation.
60
+ - **Skill type classified** — Fits one of 9 types. Folder structure matches type recommendation.
59
61
  > "The best skills fit cleanly into one; the more confusing ones straddle several."
60
- - [ ] **Domain layout appropriate** — If multiple domains, organized by domain (reference/finance.md, reference/sales.md).
62
+ - **Domain layout appropriate** — If multiple domains, organized by domain (reference/finance.md, reference/sales.md).
61
63
  > Pattern 2 — domain-specific organization.
62
64
 
63
- ## Code and scripts (if applicable)
65
+ ## Deterministic elements
66
+
67
+ Mandatory for every skill. Spec: `deterministic-elements.md`. Progressive disclosure alone does not satisfy these items.
64
68
 
65
- - [ ] **Scripts solve, don't punt** Error handling explicit, no raw exceptions for Claude to figure out.
69
+ - **Process steps classified** Every process step is marked deterministic, judgment, or borderline (inventory in gap analysis or equivalent).
70
+ > "One of the most powerful tools you can give Claude is code."
71
+ - **Deterministic steps are not prose-only** — Each deterministic step has a real path under `scripts/`, `workflow/`, `templates/`, `reference/`, or a task-seed list — not only markdown steps, fenced source, markdown checkboxes, or a giant shell one-liner in the body.
72
+ > "These can include deterministic scripts or tools for maximum robustness."
73
+ - **Body points at code** — SKILL.md names when to run each script, what it prints, and how to treat non-zero exit; it does not restate the algorithm.
74
+ > "Make clear in your instructions whether Claude should execute the script or read it as reference."
75
+ - **No executable-only fences** — Full programs meant to run do not live only inside `SKILL.md` code fences.
76
+ - **CODE_RULES on skill scripts** — Any `scripts/` or `workflow/` code uses named constants (`*_constants/` or equivalent), type annotations where the language supports them, specific error handling, and no banned identifier/prefix patterns from CODE_RULES.
77
+ - **Paired tests for new scripts** — Each new production script path ships a paired test in the same delivery (N/A only when the package has zero code files).
78
+ - **Task seeds for required work lists** — Every ordered gate/audit/process list the agent must finish is a plain task-seed catalog plus a seed instruction; no markdown checkbox board.
79
+ - **Scripts solve, don't punt** — Error handling explicit, no raw exceptions for Claude to figure out.
66
80
  > "Handle error conditions rather than punting to Claude."
67
- - [ ] **No voodoo constants** — Every magic number has a documented justification.
68
- > "Configuration parameters should be justified and documented."
69
- - [ ] **Execute vs read intent clear** — "Run script.py" (execute) vs "See script.py for algorithm" (read).
81
+ - **Execute vs read intent clear** — "Run script.py" (execute) vs "See script.py for algorithm" (read).
70
82
  > "Make clear in your instructions whether Claude should execute the script or read it as reference."
71
- - [ ] **Dependencies listed** — Required packages stated, verified as available.
83
+ - **Dependencies listed** — Required packages stated, verified as available (N/A when no scripts).
72
84
  > "List required packages in your SKILL.md and verify they're available."
73
- - [ ] **MCP tools fully qualified** — `ServerName:tool_name` format.
85
+ - **MCP tools fully qualified** — `ServerName:tool_name` format when MCP tools appear.
74
86
  > "Always use fully qualified tool names to avoid 'tool not found' errors."
75
- - [ ] **Plan-validate-execute for high-stakes ops** — Verifiable intermediate outputs before destructive actions.
87
+ - **Plan-validate-execute for high-stakes ops** — Verifiable intermediate outputs before destructive actions (N/A when no high-stakes ops).
76
88
  > "Catches errors early: validation finds problems before changes are applied."
77
89
 
78
90
  ## Setup and memory (if applicable)
79
91
 
80
- - [ ] **Setup instructions clear** — config.json pattern or AskUserQuestion for initial context.
92
+ - **Setup instructions clear** — config.json pattern or AskUserQuestion for initial context.
81
93
  > "If the config is not set up, the agent can then ask the user for information."
82
- - [ ] **Persistent data uses `${CLAUDE_PLUGIN_DATA}`** — Not stored in skill directory itself.
94
+ - **Persistent data uses `${CLAUDE_PLUGIN_DATA}`** — Not stored in skill directory itself.
83
95
  > "Data stored in the skill directory may be deleted when you upgrade the skill."
84
96
 
85
97
  ## Modularity and composition
86
98
 
87
99
  Mandatory for every skill. Spec: `skill-modularity.md`. Progressive disclosure (file split) does not satisfy these items.
88
100
 
89
- - [ ] **Single capability boundary** — One clear job in one sentence. Unrelated jobs are separate skills or an orchestrator that only routes to named sub-skills.
101
+ - **Single capability boundary** — One clear job in one sentence. Unrelated jobs are separate skills or an orchestrator that only routes to named sub-skills.
90
102
  > "The best skills fit cleanly into one; the more confusing ones straddle several."
91
- - [ ] **Compose before reimplement** — Steps an existing skill already owns are invoked by name, not pasted into this package. Local reimplementation has a one-line why in the gap analysis or gotchas.
103
+ - **Compose before reimplement** — Steps an existing skill already owns are invoked by name, not pasted into this package. Local reimplementation has a one-line why in the gap analysis or gotchas.
92
104
  > "You can just reference other skills by name, and the model will invoke them if they are installed."
93
- - [ ] **Sub-skills table (when composing)** — Each invoked skill lists when to call it, what it produces, and missing-install behavior. N/A only when the skill is a pure leaf (invokes no peers).
105
+ - **Sub-skills table (when composing)** — Each invoked skill lists when to call it, what it produces, and missing-install behavior. N/A only when the skill is a pure leaf (invokes no peers).
94
106
  > "You may want to have skills that depend on each other."
95
- - [ ] **Sibling boundary clear** — Description and when-this-applies distinguish this skill from related skills in the same domain. No silent overlap.
107
+ - **Sibling boundary clear** — Description and when-this-applies distinguish this skill from related skills in the same domain. No silent overlap.
96
108
  > "The description field is not a summary — it's a description of when to trigger."
97
- - [ ] **No monolith packing** — Multi-capability content is not stuffed under one description. Either split packages or thin orchestrator + peer sub-skills (not nested fake skills under `workflows/`).
109
+ - **No monolith packing** — Multi-capability content is not stuffed under one description. Either split packages or thin orchestrator + peer sub-skills (not nested fake skills under `workflows/`).
98
110
  > skill-modularity.md — anti-patterns: monolith, silent reimplementation, folder nesting as composition.
99
111
 
100
112
  ## Hooks (if applicable)
101
113
 
102
- - [ ] **Hooks declared** — If skill registers hooks, their purpose and scope is stated.
114
+ - **Hooks declared** — If skill registers hooks, their purpose and scope is stated.
103
115
  > "Skills can include hooks that are only activated when the skill is called."
104
116
 
105
117
  ---
106
118
 
107
119
  ## Usage
108
120
 
109
- Copy this checklist into your response after building. Check off each item. Any item that fails → fix before delivering. Any item marked "if applicable" that doesn't apply → mark N/A with a one-line reason. Sub-skills table may be N/A for pure leaf skills; single capability boundary and no-monolith never are.
121
+ 1. Register every bullet in this file as a session task (batch create is fine).
122
+ 2. Work only from the task list. Mark complete with PASS, FAIL+file:line+fix, or N/A+one-line reason.
123
+ 3. Any FAIL must be fixed before delivery; re-open a task if the fix needs re-check.
124
+ 4. Sub-skills table may be N/A for pure leaf skills; single capability boundary and no-monolith never are. Process-step classification and "deterministic steps are not prose-only" never are N/A — pure-judgment skills still inventory steps and mark each as judgment.
125
+ 5. Deliver a short audit summary (counts of PASS / N/A / FAIL fixed) — not a markdown checkbox dump.
126
+
@@ -100,14 +100,13 @@ Self-audit requires this table (or equivalent) whenever the skill composes other
100
100
  - **Vague dependency** — "use other skills as needed" with no names, when, or outputs.
101
101
  - **Redundant twin** — a new skill whose description overlaps an existing one without a refusal boundary.
102
102
 
103
- ## Checklist for authors
103
+ ## Task seeds for authors
104
104
 
105
- Copy into the response during new-skill Gather and improve Diagnose:
105
+ Register each item as a session task during new-skill Gather and improve Diagnose (`TaskCreate` / `TodoWrite`). Complete with evidence. Do not track as markdown checkboxes.
106
+
107
+ - Capability fits one sentence without an unrelated "and"
108
+ - Related skills scanned; inventory written
109
+ - Reusable steps map to named skills (or justify local procedure)
110
+ - Multi-capability work is split or is an orchestrator with sub-skills
111
+ - SKILL.md will name each sub-skill with when + produces + missing behavior
106
112
 
107
- ```
108
- - [ ] Capability fits one sentence without an unrelated "and"
109
- - [ ] Related skills scanned; inventory written
110
- - [ ] Reusable steps map to named skills (or justify local procedure)
111
- - [ ] Multi-capability work is split or is an orchestrator with sub-skills
112
- - [ ] SKILL.md will name each sub-skill with when + produces + missing behavior
113
- ```
@@ -6,9 +6,9 @@ Reusable templates for skill-building artifacts.
6
6
 
7
7
  | File | Purpose |
8
8
  |---|---|
9
- | `gap-analysis.md` | Template for gaps, composition plan, and description triggers. Used in new-skill Gather and improve diagnosis. |
9
+ | `gap-analysis.md` | Template for gaps, composition plan, description triggers, and deterministic-elements inventory. Used in new-skill Gather and improve diagnosis. |
10
10
 
11
11
  ## Conventions
12
12
 
13
13
  - Fill the template inline during the workflow; do not commit completed gap analyses to this directory.
14
- - Composition plan and Description triggers sections are required before Write on a new skill.
14
+ - Composition plan, Description triggers, and Deterministic Elements Inventory sections are required before Write on a new skill.
@@ -36,6 +36,21 @@ description: >-
36
36
  <stem>. Triggers: <phrases>.
37
37
  ```
38
38
 
39
+ ## Deterministic Elements Inventory
40
+
41
+ See `references/deterministic-elements.md`. Required before Write.
42
+
43
+ | Step | Class (`deterministic` / `judgment` / `borderline`) | Home path | Evidence (one line) | Paired test (if code) |
44
+ |---|---|---|---|---|
45
+ | [step name] | [class] | [`scripts/…` / `workflow/…` / `templates/…` / `reference/…` / `SKILL.md`] | [why this class] | [`test_…` / N/A + reason] |
46
+
47
+ Rules:
48
+
49
+ - Every `deterministic` row has a real path under `scripts/`, `workflow/`, `templates/`, `reference/`, or `task-seed:…` — not prose-only.
50
+ - Every code path has a paired test path (or a one-line pure-data reason).
51
+ - Every required multi-step work list uses `task-seed:…` plus a body seed instruction (no markdown `- [ ]` board).
52
+ - A `borderline` row kept in prose has a one-line why it stays in the body.
53
+
39
54
  ## Gaps Identified
40
55
 
41
56
  ### Gap 1: [Descriptive Name]
@@ -6,14 +6,14 @@ Step-by-step workflow files for each skill lifecycle phase, loaded on demand by
6
6
 
7
7
  | File | Purpose |
8
8
  |---|---|
9
- | `new-skill.md` | Full lifecycle: classify, scaffold, gather (composition + description triggers), write via skill-writer, self-audit, deliver. |
10
- | `improve-skill.md` | Observation-first improve: diagnose activation/modularity/quality, targeted fix, re-audit. |
11
- | `polish-skill.md` | Description trigger-catalog audit, progressive disclosure + modularity audit, checklist sign-off. |
9
+ | `new-skill.md` | Full lifecycle: classify, scaffold, gather (composition + description triggers + deterministic inventory), write via skill-writer, self-audit, deliver. |
10
+ | `improve-skill.md` | Observation-first improve: diagnose activation/modularity/quality/deterministic prose, targeted fix, re-audit. |
11
+ | `polish-skill.md` | Description trigger-catalog audit; progressive disclosure + modularity + deterministic audit; task-seeded self-audit. |
12
12
 
13
13
  ## Conventions
14
14
 
15
15
  - `SKILL.md` routes to exactly one workflow file per invocation based on the user's intent (new / improve / polish).
16
16
  - Each workflow references `../references/self-audit-checklist.md` at its final verification step.
17
- - New and improve load `skill-modularity.md` and `description-field.md` when gathering or diagnosing.
18
- - Polish Step 1 is the dedicated description rewrite pass.
17
+ - New and improve load `skill-modularity.md`, `description-field.md`, and `deterministic-elements.md` when gathering or diagnosing.
18
+ - Polish Step 1 is the dedicated description rewrite pass; Step 2 covers structure, modularity, and deterministic placement.
19
19
  - Load only the workflow that matches the active task; the other two stay out of context.
@@ -52,10 +52,16 @@ Failure classification:
52
52
  | Claude over-explains basics | Skill states what Claude already knows | Principles: Concision |
53
53
  | Claude follows instructions too rigidly | Skill railroads instead of guiding | Principles: Degree of freedom |
54
54
  | Claude makes same mistake repeatedly | Missing gotcha | Principles: Gotchas |
55
- | Claude errors on script execution | Script doesn’t handle errors, missing deps | Principles: Scripts |
55
+ | Claude errors on script execution | Script doesn’t handle errors, missing deps | Principles: Scripts + `deterministic-elements.md` CODE_RULES bar |
56
56
  | Output format is wrong | Missing template or examples | Principles: Templates and examples |
57
+ | Mechanical sequence only in markdown | Deterministic work left as prose | `deterministic-elements.md` — extract to scripts/workflow |
58
+ | Detection/validation is a giant one-liner in body | Executable logic not in `scripts/` | `deterministic-elements.md` |
59
+ | Fenced Python/JS in SKILL.md is the real implementation | Code not shipped as a file | Extract to `scripts/` or `workflow/` + paired test |
60
+ | Script has magic literals / no tests | CODE_RULES bar missed | `deterministic-elements.md` + CODE_RULES |
61
+ | Skill uses `- [ ]` for agent progress | Work list not on task tool | Task-seed catalog + seed instruction (`deterministic-elements.md`) |
62
+ | "Copy checklist into response" protocol | Markdown as tracker | Switch to TaskCreate / TodoWrite seeding |
57
63
 
58
- When scope or activation is in play, re-read `${CLAUDE_SKILL_DIR}/references/skill-modularity.md` and `${CLAUDE_SKILL_DIR}/references/description-field.md`.
64
+ When scope, activation, or deterministic placement is in play, re-read `${CLAUDE_SKILL_DIR}/references/skill-modularity.md`, `${CLAUDE_SKILL_DIR}/references/description-field.md`, and `${CLAUDE_SKILL_DIR}/references/deterministic-elements.md`.
59
65
 
60
66
  **Output:** Diagnosis per failure — which best practice was violated.
61
67
 
@@ -69,11 +75,13 @@ When scope or activation is in play, re-read `${CLAUDE_SKILL_DIR}/references/ski
69
75
 
70
76
  For each diagnosis from Step 2:
71
77
 
72
- 1. Read the matching reference (`description-field.md`, `skill-modularity.md`, `progressive-disclosure.md`, or SKILL.md principles).
78
+ 1. Read the matching reference (`description-field.md`, `skill-modularity.md`, `deterministic-elements.md`, `progressive-disclosure.md`, or SKILL.md principles).
73
79
  2. Make the minimum change that addresses the failure.
74
80
  3. For description failures: rewrite frontmatter into a trigger catalog (capability stem + Triggers list); strip story prose.
75
81
  4. For modularity failures: add sub-skills table, split packages, or thin the orchestrator; do not paste peer skill procedures.
76
- 5. Verify the fix doesn’t break anything that was working.
82
+ 5. For deterministic failures: extract mechanical work to `scripts/` / `workflow/` / `templates/` / `reference/`; body only points and handles exit codes; apply CODE_RULES + paired tests to new code.
83
+ 6. For checkbox/tracker failures: replace markdown `- [ ]` boards with a plain task-seed list and a seed instruction (`TaskCreate` / `TodoWrite`).
84
+ 7. Verify the fix doesn’t break anything that was working.
77
85
 
78
86
  Delegate larger rewrites to `/skill-writer` using the refine-skill handoff from delegation-map.md.
79
87
 
@@ -104,10 +112,10 @@ For each failure observed in Step 1:
104
112
  Same process as new-skill Step 5:
105
113
 
106
114
  1. Read `${CLAUDE_SKILL_DIR}/references/self-audit-checklist.md`.
107
- 2. Check every item. Fix failures. Re-check.
115
+ 2. Register every bullet as a session task; complete with evidence. Fix failures. Re-complete those tasks.
108
116
  3. Pay special attention to items that overlap with the diagnosis from Step 2 — those were the failures; confirm they’re now fixed.
109
117
 
110
- **Output:** Completed checklist, all PASS or N/A.
118
+ **Output:** Audit summary; all PASS or N/A.
111
119
 
112
120
  ---
113
121
 
@@ -122,6 +130,7 @@ Present to the user:
122
130
  3. **What changed** — delta summary (files modified, lines added/removed).
123
131
  4. **Description** — final frontmatter if rewritten (paste the trigger catalog).
124
132
  5. **Composition** — sub-skills or splits if modularity changed.
125
- 6. **New gotchas added** — list of gotchas captured.
126
- 7. **Audit summary** — post-fix audit results.
127
- 8. **Suggested re-test** — a concrete task to verify the fix with Claude B.
133
+ 6. **Deterministic extracts** — scripts/workflows/templates added or moved out of prose.
134
+ 7. **New gotchas added** — list of gotchas captured.
135
+ 8. **Audit summary** — post-fix audit results.
136
+ 9. **Suggested re-test** — a concrete task to verify the fix with Claude B.