claude-dev-env 2.4.0 → 2.5.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 (195) hide show
  1. package/CLAUDE.md +53 -49
  2. package/_shared/pr-loop/scripts/_claude_permissions_common.py +84 -0
  3. package/_shared/pr-loop/scripts/code_rules_gate.py +4 -2
  4. package/_shared/pr-loop/scripts/grant_project_claude_permissions.py +306 -306
  5. package/_shared/pr-loop/scripts/pr_loop_shared_constants/claude_permissions_constants.py +44 -0
  6. package/_shared/pr-loop/scripts/pr_loop_shared_constants/copilot_quota_constants.py +24 -24
  7. package/_shared/pr-loop/scripts/pr_loop_shared_constants/stale_worktree_rule_sweep_constants.py +107 -107
  8. package/_shared/pr-loop/scripts/revoke_project_claude_permissions.py +290 -48
  9. package/_shared/pr-loop/scripts/tests/test_claude_permissions_common.py +42 -2
  10. package/_shared/pr-loop/scripts/tests/test_claude_permissions_constants.py +36 -0
  11. package/_shared/pr-loop/scripts/tests/test_code_rules_gate.py +100 -1
  12. package/_shared/pr-loop/scripts/tests/test_fix_hookspath.py +497 -497
  13. package/_shared/pr-loop/scripts/tests/test_revoke_project_claude_permissions.py +311 -2
  14. package/_shared/pr-loop/scripts/tests/test_stale_worktree_rule_sweep.py +301 -301
  15. package/_shared/pr-loop/scripts/tests/test_stale_worktree_rule_sweep_constants.py +85 -85
  16. package/_shared/pr-loop/worker-spawn.md +1 -1
  17. package/agents/CLAUDE.md +2 -1
  18. package/agents/caveman.md +0 -1
  19. package/agents/clasp-deployment-orchestrator.md +0 -1
  20. package/agents/clean-coder.md +0 -1
  21. package/agents/code-advisor.md +0 -1
  22. package/agents/code-quality-agent.md +1 -2
  23. package/agents/code-verifier.md +0 -1
  24. package/agents/deep-research.md +0 -1
  25. package/agents/docs-agent.md +0 -1
  26. package/agents/git-commit-crafter.md +0 -1
  27. package/agents/issue-tracker.md +42 -0
  28. package/agents/plan-packet-validator.md +0 -1
  29. package/agents/pr-description-writer.md +0 -1
  30. package/agents/test_agent_frontmatter.py +67 -18
  31. package/audit-rubrics/category_rubrics/category-o-docstring-vs-impl-drift.md +143 -141
  32. package/bin/CLAUDE.md +68 -5
  33. package/bin/ever-shipped-skills.mjs +1 -0
  34. package/bin/install-constants.mjs +88 -0
  35. package/bin/install.mjs +1138 -114
  36. package/bin/install.prune.test.mjs +869 -19
  37. package/bin/install.test.mjs +906 -2
  38. package/commands/implement.md +1 -1
  39. package/commands/right-size.md +1 -1
  40. package/docs/CLAUDE.md +1 -0
  41. package/docs/host-pool-health-monitor.md +102 -0
  42. package/docs/references/CLAUDE.md +4 -2
  43. package/docs/references/advisor-tool.md +13 -0
  44. package/docs/references/code-review-enforcement.md +10 -0
  45. package/docs/references/team-advisor-skill.md +14 -0
  46. package/hooks/blocking/CLAUDE.md +1 -0
  47. package/hooks/blocking/code_review_pr_create_gate.py +7 -3
  48. package/hooks/blocking/code_review_push_gate.py +9 -4
  49. package/hooks/blocking/code_review_stamp_directory_write_blocker.py +8 -0
  50. package/hooks/blocking/config/__init__.py +5 -5
  51. package/hooks/blocking/config/code_review_enforcement_constants.py +4 -1
  52. package/hooks/blocking/config/test_code_review_enforcement_constants.py +5 -0
  53. package/hooks/blocking/config/verified_commit_constants.py +160 -159
  54. package/hooks/blocking/orchestrator_refresh_reschedule_gate.py +256 -0
  55. package/hooks/blocking/pre_tool_use_dispatcher.py +24 -24
  56. package/hooks/blocking/test_code_review_pr_create_gate.py +14 -0
  57. package/hooks/blocking/test_code_review_push_gate.py +16 -0
  58. package/hooks/blocking/test_code_review_stamp_directory_write_blocker.py +19 -0
  59. package/hooks/blocking/test_orchestrator_refresh_reschedule_gate.py +231 -0
  60. package/hooks/blocking/test_pre_tool_use_dispatcher.py +10 -1
  61. package/hooks/blocking/test_verdict_directory_write_blocker.py +808 -808
  62. package/hooks/blocking/test_verification_verdict_store.py +54 -0
  63. package/hooks/blocking/test_verified_commit_gate.py +581 -581
  64. package/hooks/blocking/test_verified_commit_message_accuracy_blocker.py +131 -131
  65. package/hooks/blocking/verdict_directory_write_blocker.py +687 -687
  66. package/hooks/blocking/verification_verdict_store.py +1039 -1036
  67. package/hooks/blocking/verified_commit_message_accuracy_blocker.py +167 -167
  68. package/hooks/blocking/verifier_verdict_minter.py +280 -280
  69. package/hooks/git-hooks/test_pre_push.py +25 -0
  70. package/hooks/hooks.json +10 -0
  71. package/hooks/hooks_constants/CLAUDE.md +2 -1
  72. package/hooks/hooks_constants/enter_worktree_prefetch_constants.py +18 -18
  73. package/hooks/hooks_constants/orchestrator_refresh_reschedule_gate_constants.py +48 -0
  74. package/hooks/hooks_constants/ruff_integration_constants.py +16 -0
  75. package/hooks/lifecycle/enter_worktree_origin_prefetch.py +163 -146
  76. package/hooks/lifecycle/test_enter_worktree_origin_prefetch.py +185 -178
  77. package/hooks/pyproject.toml +1 -0
  78. package/hooks/validators/CLAUDE.md +1 -0
  79. package/hooks/validators/config/__init__.py +0 -0
  80. package/hooks/validators/config/directory_exemption_constants.py +183 -0
  81. package/hooks/validators/config/test_directory_exemption_constants.py +21 -0
  82. package/hooks/validators/conftest.py +4 -0
  83. package/hooks/validators/ruff_integration.py +49 -5
  84. package/hooks/validators/run_all_validators.py +206 -9
  85. package/hooks/validators/test_directory_exemption_constants.py +185 -0
  86. package/hooks/validators/test_python_antipattern_checks.py +110 -5
  87. package/hooks/validators/test_ruff_integration.py +92 -1
  88. package/hooks/validators/test_run_all_validators.py +115 -68
  89. package/hooks/validators/test_run_all_validators_pretooluse.py +159 -1
  90. package/package.json +10 -2
  91. package/rules/CLAUDE.md +1 -0
  92. package/rules/docstring-prose-matches-implementation.md +45 -44
  93. package/rules/state-what-is.md +25 -0
  94. package/rules/verified-commit-gate-skip.md +1 -1
  95. package/scripts/CLAUDE.md +1 -0
  96. package/scripts/Capture-PoolHealth.ps1 +410 -0
  97. package/scripts/_code_review_test_support.py +404 -0
  98. package/scripts/claude_chain_runner.py +141 -1
  99. package/scripts/conftest.py +16 -1
  100. package/scripts/dev_env_scripts_constants/CLAUDE.md +1 -1
  101. package/scripts/dev_env_scripts_constants/claude_chain_constants.py +9 -0
  102. package/scripts/resolve_worker_spawn.py +626 -626
  103. package/scripts/spawn_grok_batch.py +672 -672
  104. package/scripts/test_claude_chain_runner.py +131 -0
  105. package/scripts/test_invoke_code_review_chain.py +70 -0
  106. package/scripts/test_invoke_code_review_cli.py +192 -0
  107. package/scripts/test_invoke_code_review_contract.py +256 -0
  108. package/scripts/test_invoke_code_review_git.py +123 -0
  109. package/scripts/test_invoke_code_review_mode.py +99 -0
  110. package/scripts/test_resolve_worker_spawn.py +1014 -1014
  111. package/skills/CLAUDE.md +2 -0
  112. package/skills/auditing-claude-config/SKILL.md +114 -114
  113. package/skills/autoconverge/SKILL.md +427 -427
  114. package/skills/autoconverge/reference/convergence.md +24 -3
  115. package/skills/autoconverge/workflow/CLAUDE.md +1 -0
  116. package/skills/autoconverge/workflow/converge.clean-audit.test.mjs +3 -3
  117. package/skills/autoconverge/workflow/converge.contract.test.mjs +1263 -1263
  118. package/skills/autoconverge/workflow/converge.mjs +167 -0
  119. package/skills/autoconverge/workflow/converge.p2-advance.test.mjs +202 -0
  120. package/skills/autoconverge/workflow/fixtures/wf_run/subagents/workflows/wf_881252e6-700/agent-a11d903476b803493.jsonl +2 -2
  121. package/skills/autoconverge/workflow/fixtures/wf_run/subagents/workflows/wf_881252e6-700/agent-a26213978adeef6fb.jsonl +2 -2
  122. package/skills/autoconverge/workflow/fixtures/wf_run/subagents/workflows/wf_881252e6-700/agent-a3def0d15ed9d9110.jsonl +2 -2
  123. package/skills/autoconverge/workflow/fixtures/wf_run/subagents/workflows/wf_881252e6-700/agent-a41f41b1b708ee3b7.jsonl +2 -2
  124. package/skills/autoconverge/workflow/fixtures/wf_run/subagents/workflows/wf_881252e6-700/agent-a758b880abecc3ff7.jsonl +2 -2
  125. package/skills/autoconverge/workflow/fixtures/wf_run/subagents/workflows/wf_881252e6-700/agent-a8897b89656b1bd16.jsonl +2 -2
  126. package/skills/autoconverge/workflow/fixtures/wf_run/subagents/workflows/wf_881252e6-700/agent-abd463d744a1437bc.jsonl +2 -2
  127. package/skills/autoconverge/workflow/fixtures/wf_run/subagents/workflows/wf_881252e6-700/agent-ad19d027ae8ee1816.jsonl +2 -2
  128. package/skills/autoconverge/workflow/fixtures/wf_run/workflows/wf_881252e6-700.json +265 -265
  129. package/skills/closeout/SKILL.md +33 -50
  130. package/skills/codex-review/scripts/codex_review_scripts_constants/run_constants.py +8 -0
  131. package/skills/codex-review/scripts/run_codex_review.py +233 -1
  132. package/skills/codex-review/scripts/test_run_codex_review.py +189 -0
  133. package/skills/condensing-instructions/SKILL.md +81 -0
  134. package/skills/copilot-review/SKILL.md +119 -119
  135. package/skills/e-code-review/SKILL.md +52 -0
  136. package/skills/e-code-review/reference/fix.md +54 -0
  137. package/skills/e-code-review/reference/loop.md +43 -0
  138. package/skills/e-code-review/reference/low.md +57 -0
  139. package/skills/e-code-review/reference/medium.md +153 -0
  140. package/skills/e-code-review/reference/xhigh.md +182 -0
  141. package/skills/e-simplify/SKILL.md +97 -0
  142. package/skills/issue-tracker/SKILL.md +92 -0
  143. package/skills/issue-tracker/reference/epic-and-sub-issue-model.md +55 -0
  144. package/skills/issue-tracker/reference/handoff-schema.md +64 -0
  145. package/skills/issue-tracker/reference/operation-matrix.md +41 -0
  146. package/skills/orchestrator/SKILL.md +162 -21
  147. package/skills/orchestrator/scripts/status_gate.py +625 -0
  148. package/skills/orchestrator/scripts/status_gate_constants/__init__.py +1 -0
  149. package/skills/orchestrator/scripts/status_gate_constants/config/__init__.py +1 -0
  150. package/skills/orchestrator/scripts/status_gate_constants/config/constants.py +47 -0
  151. package/skills/orchestrator/scripts/test_status_gate.py +439 -0
  152. package/skills/orchestrator-refresh/SKILL.md +110 -35
  153. package/skills/plan-to-pr/SKILL.md +155 -0
  154. package/skills/plan-to-pr/reference/final-validation-tasks.md +15 -0
  155. package/skills/plan-to-pr/reference/model-routing.md +36 -0
  156. package/skills/plan-to-pr/reference/packet-contract.md +43 -0
  157. package/skills/plan-to-pr/reference/packet-schema.json +57 -0
  158. package/skills/plan-to-pr/reference/process-inventory.md +22 -0
  159. package/skills/plan-to-pr/reference/review-loop.md +33 -0
  160. package/skills/plan-to-pr/reference/run-record.schema.json +27 -0
  161. package/skills/plan-to-pr/reference/self-audit-tasks.md +15 -0
  162. package/skills/plan-to-pr/reference/task-seeds.md +14 -0
  163. package/skills/plan-to-pr/reference/task-ticket.md +38 -0
  164. package/skills/plan-to-pr/scripts/config/__init__.py +1 -0
  165. package/skills/plan-to-pr/scripts/config/constants.py +193 -0
  166. package/skills/plan-to-pr/scripts/create_packet.py +173 -0
  167. package/skills/plan-to-pr/scripts/test_create_packet.py +102 -0
  168. package/skills/plan-to-pr/scripts/test_validate_packet.py +256 -0
  169. package/skills/plan-to-pr/scripts/test_validate_protocol.py +135 -0
  170. package/skills/plan-to-pr/scripts/test_validate_run.py +158 -0
  171. package/skills/plan-to-pr/scripts/validate_packet.py +655 -0
  172. package/skills/plan-to-pr/scripts/validate_protocol.py +622 -0
  173. package/skills/plan-to-pr/scripts/validate_run.py +173 -0
  174. package/skills/plan-to-pr/test_skill_contract.py +207 -0
  175. package/skills/plan-to-pr/test_task_ticket_contract.py +151 -0
  176. package/skills/pr-converge/SKILL.md +472 -469
  177. package/skills/pr-converge/reference/examples.md +3 -3
  178. package/skills/pr-converge/reference/fix-protocol.md +1 -1
  179. package/skills/pr-converge/reference/ground-rules.md +7 -4
  180. package/skills/pr-converge/reference/multi-pr-orchestration.md +4 -1
  181. package/skills/pr-converge/reference/per-tick.md +5 -5
  182. package/skills/pr-converge/reference/progress-checklist.md +1 -1
  183. package/skills/pr-converge/scripts/check_convergence_gates.py +279 -279
  184. package/skills/pr-converge/scripts/test_check_convergence_codex.py +507 -507
  185. package/skills/pr-converge/scripts/test_check_convergence_gates.py +84 -84
  186. package/skills/pr-converge/test_step5_host_branch.py +1 -1
  187. package/skills/pr-fix-protocol/SKILL.md +1 -1
  188. package/skills/privacy-hygiene/SKILL.md +68 -68
  189. package/skills/prototype/workflows/promotion.md +1 -1
  190. package/skills/release-notes-html/SKILL.md +164 -0
  191. package/skills/task-build/CLAUDE.md +8 -7
  192. package/skills/task-build/SKILL.md +16 -8
  193. package/skills/task-build/reference/tool-routing.md +19 -0
  194. package/scripts/test_invoke_code_review.py +0 -966
  195. package/skills/closeout/reference/issue-body-templates.md +0 -108
@@ -0,0 +1,155 @@
1
+ ---
2
+ name: plan-to-pr
3
+ description: >-
4
+ Coordinates source-grounded implementation through a validated plan packet,
5
+ planned task tickets, fixed model routing, verified commits, independent Luna
6
+ review, and publication gates. Triggers: "Plan-to-PR", "plan to PR",
7
+ "implement this with one task per commit", "run the Plan-to-PR workflow",
8
+ "validate Plan-to-PR", "publish the PR".
9
+ ---
10
+
11
+ # Plan-to-PR
12
+
13
+ ## Purpose and boundary
14
+
15
+ Use this skill for source-grounded implementation with one deliverable, one
16
+ allowed file set, one acceptance check, and one commit per task. The planning
17
+ phase creates and validates a tool-neutral `docs/plans/<slug>/` packet
18
+ before any `TaskCreate` or `TodoWrite` seeding.
19
+
20
+ The skill coordinates planning, task records, model routing, commit order,
21
+ review, verification, and publication. It does not replace the orchestrator or
22
+ advisor capabilities used by later phases.
23
+
24
+ ## Native planning phase
25
+
26
+ Run this phase before task seeding and before implementation:
27
+
28
+ 1. The Luna max planner reads the request, repository guidance, relevant
29
+ source, tests, and documentation, then selects a unique lowercase slug.
30
+ 2. The planner consults a Sol xhigh advisor heavily at scope, dependency,
31
+ task-boundary, acceptance, and risk decisions. The advisor supports planning
32
+ decisions and packet review.
33
+ 3. The planner writes the packet files and validates them against
34
+ [`reference/packet-contract.md`](reference/packet-contract.md) and
35
+ [`reference/packet-schema.json`](reference/packet-schema.json).
36
+ 4. The planner repairs packet findings and repeats deterministic validation
37
+ until the packet passes. A failed validation blocks task seeding.
38
+ 5. Only a passing packet with `status: approved` may seed host tasks. Record the
39
+ packet path and validation result in the task ledger.
40
+
41
+ The packet is the sole planning handoff. It contains its own scope, evidence,
42
+ task boundaries, acceptance checks, risks, and implementation order. Do not
43
+ seed tasks from conversational notes or an incomplete packet.
44
+
45
+ ## Capability boundary
46
+
47
+ This skill owns the native planning packet, task records, routing, review,
48
+ verification, and publication decisions. Later execution uses the companion
49
+ orchestrator and advisor capabilities.
50
+
51
+ ## Refusal cases
52
+
53
+ Refuse the first matching case and stop:
54
+
55
+ - The request has no source-grounded plan packet.
56
+ - The packet is missing, invalid, outside `docs/plans/<slug>/`, or not approved.
57
+ - A requested change spans files outside the packet's allowed file set.
58
+ - A task contains more than one deliverable, acceptance check, or commit.
59
+ - A required task tool, verifier, model tier, advisor, review path, or gate is unavailable.
60
+ - The user asks to bypass verification, `verified_commit_gate`, independent
61
+ review, final validation, or a publication gate.
62
+
63
+ Return exactly: `Plan-to-PR blocked: <missing input or capability>.`
64
+
65
+ ## Runtime and task seeding
66
+
67
+ The packet and task-run validators use Python 3 standard library only. From this
68
+ skill directory, create a packet skeleton with:
69
+
70
+ `python scripts/create_packet.py --repo-root <repository> --slug <slug> --base-ref <base-ref>`
71
+
72
+ After the planner fills the packet, validate it with:
73
+
74
+ `python scripts/validate_packet.py <repository>/docs/plans/<slug>`
75
+
76
+ Run `python scripts/validate_protocol.py <record.json>` for each task record;
77
+ exit `0` means valid and exit `2` means invalid.
78
+
79
+ After packet approval, seed one host task for every packet task with
80
+ `TaskCreate`, `TodoWrite`, or its equivalent. Each task records exactly one
81
+ deliverable, one allowed file set, one acceptance check, and one commit. Mark a
82
+ task complete only with verifier output and its commit identity. Use the fixed
83
+ contracts in `reference/task-ticket.md`, `reference/model-routing.md`,
84
+ `reference/task-seeds.md`, `reference/final-validation-tasks.md`, and
85
+ `reference/self-audit-tasks.md`. The fixed fields live in those references.
86
+
87
+ ## Model contract
88
+
89
+ The planner and final validator use Luna max with Sol xhigh advisory heavily
90
+ at decisive points. The orchestrator uses the max route and delegates every work
91
+ task. Every implementation,
92
+ review, and repair worker uses fast, low-effort Luna. Unavailable models or routing tools
93
+ fail closed; never promote workers,
94
+ demote planners or validators, or substitute a role route.
95
+
96
+ The planner owns the approved packet. The orchestrator owns task assignment,
97
+ ledger state, and result reconciliation. Workers change only their ticket's
98
+ files and run its acceptance check. The final validator checks the complete
99
+ history and publication gates.
100
+
101
+ ## One-task and one-commit protocol
102
+
103
+ For each seeded task:
104
+
105
+ 1. The orchestrator issues the standalone task ticket.
106
+ 2. One worker implements one deliverable within the ticket's allowed files.
107
+ 3. The worker runs the one acceptance check and reports exact output and blockers.
108
+ 4. A fresh verifier checks the task diff, baseline, named gates, and ticket-to-diff
109
+ scope. It must pass `verified_commit_gate` for the exact surface.
110
+ 5. The orchestrator creates exactly one commit and records its hash.
111
+
112
+ No task borrows files, acceptance checks, or commit history from another task.
113
+ Unrelated changes remain untouched and uncommitted.
114
+
115
+ ## Review and repair
116
+
117
+ Before every commit, require fresh verification and `verified_commit_gate`.
118
+ After the commit, a separate fast low-effort Luna review worker runs native
119
+ findings-only correctness review at `/e-code-review low`. The review returns
120
+ findings only and has no repair flag.
121
+
122
+ A separate fast low-effort Luna repair worker applies only confirmed findings.
123
+ Record resolved model, effort, command, findings, repair status, and surface
124
+ hash. Rerun the task acceptance check and fresh exact-surface verification, amend the task commit,
125
+ and repeat native review until clean. The max review is the correctness
126
+ gate after cleanup.
127
+
128
+ ## Final validation and publication
129
+
130
+ The Luna max final validator maps every commit to one packet task and checks
131
+ cumulative behavior, the allowed-file ledger, acceptance checks, verifier
132
+ output, `verified_commit_gate` evidence, and post-commit review records. Any
133
+ unmapped commit, missing record, failed gate, or unresolved finding blocks
134
+ publication.
135
+
136
+ Run the workflow self-audit and retain its evidence. Publish only when final validation
137
+ and self-audit pass. After the branch is finalized and pushed, run Luna max `/e-simplify`
138
+ for cleanup-only fixes, then Luna low `/e-code-review max loop` with a separate
139
+ Luna low repair worker. commit, and push every validated repair;
140
+ finish only when the max review is clean.
141
+
142
+ ## Companion references
143
+
144
+ - [`reference/packet-contract.md`](reference/packet-contract.md) — native planning packet contract.
145
+ - [`reference/packet-schema.json`](reference/packet-schema.json) — machine-readable packet schema.
146
+ - [`scripts/create_packet.py`](scripts/create_packet.py) — deterministic packet skeleton creator.
147
+ - [`scripts/validate_packet.py`](scripts/validate_packet.py) — deterministic packet validator.
148
+ - [`reference/model-routing.md`](reference/model-routing.md) — fixed model and gate matrix.
149
+ - [`reference/task-ticket.md`](reference/task-ticket.md) — task, commit, and review record contract.
150
+ - [`reference/review-loop.md`](reference/review-loop.md) — review and repair loop.
151
+ - [`reference/process-inventory.md`](reference/process-inventory.md) — evidence homes.
152
+ - [`reference/run-record.schema.json`](reference/run-record.schema.json) — machine-checkable task-run record.
153
+
154
+ Run `scripts/validate_run.py` with the task records and commit set during final
155
+ validation. Add `--worktree PATH` when the commit set belongs to another tree.
@@ -0,0 +1,15 @@
1
+ # Final Validation Task Seeds
2
+
3
+ Register each item as a host task before final validation. Complete each with
4
+ PASS, FAIL plus file and line evidence, or N/A plus a reason.
5
+
6
+ 1. Map every task commit to exactly one approved task identity.
7
+ 2. Confirm every task record has required identity, files, acceptance, and commit fields.
8
+ 3. Confirm every committed task has native findings-only review and separate repair records.
9
+ 4. Confirm every repair has acceptance output, fresh exact-surface verification, and an amended commit before the next review.
10
+ 5. Confirm all review records are clean and all verifier records pass.
11
+ 6. Confirm the complete allowed-file ledger contains no extra changed files.
12
+ 7. Confirm final validation and workflow self-audit evidence are present before release.
13
+ 8. Confirm the finalized PR branch receives Luna max `/e-simplify` cleanup with
14
+ fixes, then Luna low `/e-code-review max loop` with separate repairs, required
15
+ checks, commits, pushes, and a clean final max review.
@@ -0,0 +1,36 @@
1
+ # Model Routing Contract
2
+
3
+ This reference fixes the model role for native packet planning, task execution,
4
+ review, repair, validation, and post-PR cleanup.
5
+ Unavailable models or unavailable model-selection tools fail closed.
6
+
7
+ ## Role matrix
8
+
9
+ | Role | Required route | Required behavior |
10
+ |---|---|---|
11
+ | Planner | Luna max with Sol xhigh advisor | Creates and validates the native packet before task seeding; consults the warm advisor heavily at decisive planning points |
12
+ | Orchestrator | Max route | Assigns tickets, owns the ledger, delegates every work task, and reconciles results |
13
+ | Implementation worker | Fast, low-effort Luna | Changes only the ticket's allowed files and runs its acceptance check |
14
+ | Review worker | Fast, low-effort Luna | Invokes the native `/e-code-review low` correctness review against the committed diff and returns findings only |
15
+ | Repair worker | Fast, low-effort Luna | Applies only confirmed findings from the native correctness review |
16
+ | Final validator | Luna max with Sol xhigh advisor | Maps commits to tasks and validates the cumulative release surface; consults the warm advisor heavily at decisive validation points |
17
+
18
+ ## Routing gates
19
+
20
+ 1. Bind the planner and final validator to Luna max.
21
+ 2. Bind the planner and final validator to a Sol xhigh advisor and consult it before routing decisions, task approval, repair plans, commit authorization, and final validation decisions.
22
+ 3. Bind the orchestrator to the max route and require it to delegate work tasks.
23
+ 4. Bind every implementation, review, and repair worker to fast, low-effort Luna.
24
+ 5. Stop when a required tier, model, advisor, or routing tool is unavailable.
25
+ 6. Do not promote workers, demote planners or validators, or substitute a role's route.
26
+
27
+ The orchestrator records the selected route and the final validator checks it
28
+ against this matrix. The native review is findings-only and has no repair flag.
29
+ The review record captures resolved model, effort, command, findings, repair status,
30
+ and surface hash. Missing native review or verifier capability fails closed.
31
+
32
+ After the PR is finalized and pushed, run `/e-simplify` with Luna max for
33
+ cleanup-only fixes. Then run `/e-code-review max loop` with Luna low. A separate
34
+ Luna low repair worker applies confirmed findings, runs required checks, commits,
35
+ and pushes before the next loop. A clean max review is required; nits are fixed
36
+ and pushed before the next max review, while any non-nit finding blocks readiness.
@@ -0,0 +1,43 @@
1
+ # Native Plan-to-PR packet contract
2
+
3
+ The planning phase produces one self-contained packet at
4
+ `docs/plans/<slug>/`. The slug contains lowercase letters, numbers, and single
5
+ hyphens, starts and ends with a letter or number, and is unique among active
6
+ plans. The packet is complete before `TaskCreate` or `TodoWrite` runs.
7
+
8
+ ## Required files
9
+
10
+ | File | Required content |
11
+ |---|---|
12
+ | `packet.json` | Validates against `reference/packet-schema.json`; includes every required field. |
13
+ | `context.md` | Request, repository facts, constraints, source references, and open questions. |
14
+ | `plan.md` | Ordered implementation approach, decisions, dependencies, and risks. |
15
+ | `tasks.md` | Ordered task list with one deliverable, file set, acceptance command, and commit per task. |
16
+ | `handoff.md` | Exact task-seeding input and the approval state. |
17
+
18
+ ## Deterministic boundaries
19
+
20
+ - `packet.json` is the machine-readable authority. Markdown restates the same
21
+ scope, tasks, files, commands, and acceptance criteria.
22
+ - `status` is `draft` while writing and `approved` only after all checks pass.
23
+ - `allowed_files` contains repository-relative file paths only. Every task file
24
+ belongs to that set, so task edits stay within the packet scope.
25
+ - `tasks` is ordered, non-empty, and each task has exactly one deliverable,
26
+ one non-empty `allowed_files` list, one acceptance command, one test command,
27
+ one verification command, and one commit.
28
+ - Every source reference identifies a repository-relative path and a line or
29
+ section locator. Unknown facts are recorded in `open_questions`.
30
+ - Acceptance commands are executable, deterministic checks against real behavior.
31
+ Each task carries an executable command rather than a prose-only statement.
32
+ - `handoff.md` names the packet path, validation result, task order, and exact
33
+ host-task fields. It lists exactly the tasks declared in `packet.json`.
34
+
35
+ ## Validation sequence
36
+
37
+ 1. Parse `packet.json` as JSON and validate it against the schema.
38
+ 2. Validate the slug, required files, path boundaries, task uniqueness, and
39
+ task-to-file containment.
40
+ 3. Confirm every source reference, command, and acceptance check is concrete.
41
+ 4. Compare Markdown task and handoff content with `packet.json`.
42
+ 5. Set `status` to `approved` after every check passes. Keep `draft` packets in
43
+ planning and validation until that approval state is reached.
@@ -0,0 +1,57 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "Native Plan-to-PR packet",
4
+ "type": "object",
5
+ "additionalProperties": false,
6
+ "required": ["schema_version", "slug", "status", "request", "allowed_files", "sources", "decisions", "open_questions", "tasks", "validation"],
7
+ "properties": {
8
+ "schema_version": {"const": 1},
9
+ "slug": {"type": "string", "pattern": "^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$"},
10
+ "status": {"enum": ["draft", "approved"]},
11
+ "request": {"type": "string", "minLength": 1},
12
+ "allowed_files": {"type": "array", "minItems": 1, "uniqueItems": true, "items": {"type": "string", "minLength": 1, "pattern": "^(?!/)(?!.*\\\\)(?!.*\\.\\.).+$"}},
13
+ "sources": {"type": "array", "minItems": 1, "items": {"$ref": "#/$defs/source"}},
14
+ "decisions": {"type": "array", "minItems": 1, "items": {"type": "string", "minLength": 1}},
15
+ "open_questions": {"type": "array", "items": {"type": "string", "minLength": 1}},
16
+ "tasks": {"type": "array", "minItems": 1, "items": {"$ref": "#/$defs/task"}},
17
+ "validation": {"$ref": "#/$defs/validation"}
18
+ },
19
+ "$defs": {
20
+ "source": {
21
+ "type": "object",
22
+ "additionalProperties": false,
23
+ "required": ["path", "locator", "fact"],
24
+ "properties": {
25
+ "path": {"type": "string", "minLength": 1, "pattern": "^(?!/)(?!.*\\\\)(?!.*\\.\\.).+$"},
26
+ "locator": {"type": "string", "minLength": 1, "pattern": "^(?:[lL][iI][nN][eE][sS]?|[sS][eE][cC][tT][iI][oO][nN])\\s+\\S(?:.*\\S)?$"},
27
+ "fact": {"type": "string", "minLength": 1}
28
+ }
29
+ },
30
+ "task": {
31
+ "type": "object",
32
+ "additionalProperties": false,
33
+ "required": ["id", "deliverable", "allowed_files", "acceptance_command", "test_command", "verification_command", "commit"],
34
+ "properties": {
35
+ "id": {"type": "string", "pattern": "^task-[0-9]+$"},
36
+ "deliverable": {"type": "string", "minLength": 1},
37
+ "allowed_files": {"type": "array", "minItems": 1, "uniqueItems": true, "items": {"type": "string", "minLength": 1}},
38
+ "dependencies": {"type": "array", "uniqueItems": true, "items": {"type": "string", "pattern": "^task-[0-9]+$"}},
39
+ "acceptance_command": {"type": "string", "minLength": 1},
40
+ "test_command": {"type": "string", "minLength": 1},
41
+ "verification_command": {"type": "string", "minLength": 1},
42
+ "commit": {"const": 1}
43
+ }
44
+ },
45
+ "validation": {
46
+ "type": "object",
47
+ "additionalProperties": false,
48
+ "required": ["schema_valid", "boundary_valid", "markdown_matches", "validated_by"],
49
+ "properties": {
50
+ "schema_valid": {"type": "boolean"},
51
+ "boundary_valid": {"type": "boolean"},
52
+ "markdown_matches": {"type": "boolean"},
53
+ "validated_by": {"const": "native-plan-to-pr"}
54
+ }
55
+ }
56
+ }
57
+ }
@@ -0,0 +1,22 @@
1
+ # Process Inventory
2
+
3
+ This inventory classifies every required workflow step and names its evidence
4
+ home. Deterministic work is represented by a fixed reference or task seed;
5
+ judgment remains in the hub or companion reference.
6
+
7
+ | Step | Class | Home | Evidence | Paired test |
8
+ |---|---|---|---|---|
9
+ | Create and validate native plan packet | deterministic | `reference/packet-contract.md` and `reference/packet-schema.json` | Approved packet, validation result, and packet path | `test_skill_contract.py` and `test_task_ticket_contract.py` |
10
+ | Approve scope and acceptance | judgment | `SKILL.md` | Approved plan and acceptance contract | N/A: human decision |
11
+ | Seed implementation work after packet approval | deterministic | `task-seed:reference/task-seeds.md` | Host task IDs, packet path, and evidence | task-tool |
12
+ | Record task fields | deterministic | `reference/run-record.schema.json` and `scripts/validate_protocol.py` | Validator output and exit code | `scripts/test_validate_protocol.py` |
13
+ | Implement one deliverable | judgment | `SKILL.md` | Worker report and diff | N/A: implementation choice |
14
+ | Verify exact surface | deterministic | `task-seed:reference/task-seeds.md` | Verifier output and `verified_commit_gate` | task-tool |
15
+ | Review committed task | deterministic | `reference/review-loop.md` | Findings-only native review record | `test_task_ticket_contract.py` |
16
+ | Repair confirmed findings | deterministic | `reference/review-loop.md` | Separate repair record and confirmed findings | `test_task_ticket_contract.py` |
17
+ | Decide whether a finding is confirmed | judgment | `reference/review-loop.md` | Repair record names the confirmed finding | N/A: review judgment |
18
+ | Repeat until clean | borderline | `reference/review-loop.md` | Amended commit and clean review record | `test_task_ticket_contract.py` |
19
+ | Validate cumulative release | deterministic | `task-seed:reference/final-validation-tasks.md` | Final validator task evidence | task-tool |
20
+ | Self-audit the workflow | deterministic | `task-seed:reference/self-audit-tasks.md` | Self-audit task evidence | task-tool |
21
+ | Run post-PR cleanup | deterministic | `SKILL.md` and `reference/model-routing.md` | Luna max `/e-simplify` result and pushed cleanup commit | task-tool |
22
+ | Run post-PR max review | deterministic | `reference/review-loop.md` | Luna low max-loop findings, repairs, pushes, and clean result | task-tool |
@@ -0,0 +1,33 @@
1
+ # Review Loop
2
+
3
+ Run this loop for every committed task. Store each pass in the task record.
4
+
5
+ 1. A separate fast low-effort Luna review worker reads the committed task diff.
6
+ 2. It invokes the native findings-only `/e-code-review low` correctness
7
+ capability; the review has no repair flag.
8
+ 3. Record resolved model, effort, command, findings, repair status, and surface
9
+ hash. Missing native review or verifier capability fails closed.
10
+ 4. A separate fast low-effort Luna repair worker applies only confirmed findings.
11
+ 5. Rerun the task acceptance check and fresh exact-surface verification.
12
+ 6. Amend the task commit and repeat the native review until clean.
13
+
14
+ ## Accepted records
15
+
16
+ Clean means the native review reports no findings for the exact committed
17
+ surface. A repaired pass is not accepted until acceptance and fresh verifier
18
+ output are recorded against the amended commit.
19
+
20
+ ## Example
21
+
22
+ `review: findings=["missing field"]` → `repair: confirmed=["missing field"]` →
23
+ `acceptance: PASS` → `verification: PASS` → `amend` → `review: clean`.
24
+
25
+ ## Post-PR max loop
26
+
27
+ After the PR branch is finalized and pushed, Luna max runs `/e-simplify` and
28
+ applies only cleanup fixes. Commit and push those fixes before correctness review.
29
+
30
+ Then Luna low invokes `/e-code-review max loop`. It returns findings only. A
31
+ separate Luna low repair worker applies confirmed bugs or nits, runs required
32
+ checks, commits, and pushes. Repeat the max loop until it is clean. Fix and push
33
+ all nits before the next loop; any non-nit finding blocks readiness until repaired.
@@ -0,0 +1,27 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "Plan-to-PR task run record",
4
+ "type": "object",
5
+ "additionalProperties": false,
6
+ "required": ["task_identity", "deliverable", "allowed_files", "acceptance_check", "baseline", "worker_route", "commit", "review_record", "repair_record", "reverification_record", "verification_record"],
7
+ "properties": {
8
+ "task_identity": {"type": "string", "minLength": 1},
9
+ "deliverable": {"type": "string", "minLength": 1},
10
+ "allowed_files": {"type": "array", "items": {"type": "string", "minLength": 1}, "minItems": 1},
11
+ "acceptance_check": {"type": "string", "minLength": 1},
12
+ "baseline": {"type": "string", "minLength": 1},
13
+ "worker_route": {"type": "string", "minLength": 1},
14
+ "commit": {"type": "string", "pattern": "^[0-9a-f]{7,40}$"},
15
+ "worktree": {"type": "string", "minLength": 1},
16
+ "review_record": {"$ref": "#/$defs/review_record"},
17
+ "repair_record": {"$ref": "#/$defs/repair_record"},
18
+ "reverification_record": {"$ref": "#/$defs/verification_record"},
19
+ "verification_record": {"$ref": "#/$defs/verification_record"}
20
+ },
21
+ "$defs": {
22
+ "finding": {"type": "object", "additionalProperties": false, "required": ["finding", "disposition"], "properties": {"finding": {"type": "string", "minLength": 1}, "disposition": {"enum": ["confirmed", "dismissed"]}}},
23
+ "review_record": {"type": "object", "additionalProperties": false, "required": ["resolved_model", "effort", "command", "findings", "repair_status", "surface_hash", "findings_only", "has_repair_flag"], "properties": {"resolved_model": {"type": "string", "minLength": 1}, "effort": {"type": "string", "minLength": 1}, "command": {"type": "string", "minLength": 1}, "findings": {"type": "array", "items": {"$ref": "#/$defs/finding"}}, "repair_status": {"type": "string", "minLength": 1}, "surface_hash": {"type": "string", "minLength": 1}, "findings_only": {"const": true}, "has_repair_flag": {"const": false}}},
24
+ "repair_record": {"type": "object", "additionalProperties": false, "required": ["resolved_model", "effort", "confirmed_findings", "repair_status", "surface_hash"], "properties": {"resolved_model": {"type": "string", "minLength": 1}, "effort": {"type": "string", "minLength": 1}, "confirmed_findings": {"type": "array", "items": {"type": "string", "minLength": 1}}, "repair_status": {"type": "string", "minLength": 1}, "surface_hash": {"type": "string", "minLength": 1}}},
25
+ "verification_record": {"type": "object", "additionalProperties": false, "required": ["acceptance_output", "verifier_output", "verified_commit_gate", "surface_hash"], "properties": {"acceptance_output": {"type": "string", "minLength": 1}, "verifier_output": {"type": "string", "minLength": 1}, "verified_commit_gate": {"type": "string", "minLength": 1}, "surface_hash": {"type": "string", "minLength": 1}}}
26
+ }
27
+ }
@@ -0,0 +1,15 @@
1
+ # Self-Audit Task Seeds
2
+
3
+ Register each item as a host task before delivery. Complete each with PASS,
4
+ FAIL plus file and line evidence, or N/A plus a reason.
5
+
6
+ 1. Confirm the hub names native packet planning before task seeding.
7
+ 2. Confirm every packet, task, review, validation, and audit reference is linked directly from the hub.
8
+ 3. Confirm packet markdown and schema paths exist with the validation scripts.
9
+ 4. Confirm the ordered task-seed catalog and task-tool seeding instruction are present after packet approval.
10
+ 5. Confirm every process step is classified with a home and evidence path.
11
+ 6. Confirm final-validation and self-audit seed lists are present.
12
+ 7. Confirm concrete review-loop examples show findings, repair, reverify, amend, and clean review.
13
+ 8. Confirm the schema requires task identity, commit, review, repair, reverification, and verification records.
14
+ 9. Confirm planning uses the native packet contract and no absolute machine paths appear.
15
+ 10. Confirm the focused contract tests pass and the owned-file diff is complete.
@@ -0,0 +1,14 @@
1
+ # Task Seeds
2
+
3
+ Register each item as one host task with `TaskCreate`, `TodoWrite`, or the host
4
+ equivalent before implementation. Mark it complete only with evidence.
5
+
6
+ 1. Approve the plan, task scope, acceptance check, and allowed files.
7
+ 2. Capture the baseline and create one task record from the run-record schema.
8
+ 3. Implement the single deliverable within the allowed file set.
9
+ 4. Run the acceptance check and record its exact output.
10
+ 5. Run fresh exact-surface verification and `verified_commit_gate`.
11
+ 6. Create exactly one task commit and record its identity.
12
+ 7. Run the separate native review and record findings-only output.
13
+ 8. Run separate Luna repair only for confirmed findings; rerun acceptance and
14
+ exact-surface verification before amending and reviewing again.
@@ -0,0 +1,38 @@
1
+ # Task Ticket Contract
2
+
3
+ Each ticket is created from an approved native plan packet after packet validation
4
+ passes. It describes one independently verifiable deliverable. The orchestrator
5
+ must reject a ticket that combines deliverables, file sets, acceptance checks, or
6
+ commits.
7
+
8
+ ## Required ticket fields
9
+
10
+ | Field | Contract |
11
+ |---|---|
12
+ | Task identity | One stable task name and one planned task mapping |
13
+ | Deliverable | Exactly one concrete output |
14
+ | Allowed files | The complete file set the worker may change |
15
+ | Acceptance check | Exactly one command or deterministic check |
16
+ | Baseline | Fresh output captured before implementation |
17
+ | Worker route | The model role and selected route from `reference/model-routing.md`; planner and final-validator records include Luna max plus Sol xhigh advisor evidence, and orchestrator records the max route |
18
+ | Commit record | Exactly one commit hash for this ticket |
19
+ | Review record | Separate fast low-effort Luna review output that invokes native `/e-code-review low` and returns findings only, followed by separate fast low-effort Luna repair output, including resolved model, effort, command, findings, repair status, and surface hash |
20
+ | Verification record | Fresh verifier output and `verified_commit_gate` result for the exact surface |
21
+
22
+ ## Execution contract
23
+
24
+ The worker changes only the allowed files, runs the acceptance check, and reports
25
+ the exact output. A fresh verifier checks the ticket against the diff before one
26
+ commit is created. The commit hash is recorded before the separate review pass.
27
+
28
+ ## Review and completion contract
29
+
30
+ A separate fast low-effort Luna review worker invokes native `/e-code-review low`
31
+ after the commit. It reads the committed diff, returns findings only, and has no
32
+ repair flag. A separate fast low-effort Luna repair worker applies only confirmed findings. The record names
33
+ the resolved model, effort, command, findings, repair status, and surface hash.
34
+ Confirmed repairs require the acceptance check and fresh exact-surface verification
35
+ again; amend the task commit and repeat the native review until clean. Missing
36
+ native review or required verifier capability fails closed. The
37
+ final validator maps the commit to this ticket and rejects missing or extra
38
+ records.
@@ -0,0 +1 @@
1
+ """Configuration values for the skill protocol validator."""