$npx -y skills add PolicyEngine/policyengine-claude --skill encode-policy-v2Use when the user invokes $encode-policy-v2 or asks Codex or Claude Code to implement a new PolicyEngine-US state benefit program or a new structural program component from official rules. Covers existing-program routing, source collection and full PDF rendering, user-approved sc
| 1 | # encode-policy-v2 |
| 2 | |
| 3 | Thin launcher. The canonical workflow—routing, arguments, phases, roles, checkpoints, |
| 4 | artifact contracts, retry budgets, and completion gates—lives in |
| 5 | [references/workflow.md](references/workflow.md). Read it completely before acting and |
| 6 | follow it exactly; do not redefine or compress its behavior here. |
| 7 | |
| 8 | Treat the text after `$encode-policy-v2` as raw workflow arguments: |
| 9 | |
| 10 | ```text |
| 11 | $encode-policy-v2 STATE PROGRAM [--skip-review] [--research-only] [--600dpi] |
| 12 | [--resume] [--from-phase N] [--full-validation] |
| 13 | ``` |
| 14 | |
| 15 | Mandatory gates that no surface may skip: |
| 16 | |
| 17 | - Route purely parametric changes to `encode-reform` unless the user chooses to continue. |
| 18 | - Make no GitHub write before the user-approved scope decision exists. |
| 19 | - Render every page of every collected PDF; extracted text is not a substitute. |
| 20 | - Do not push through a red structural or quick-audit gate, or silently push failing tests. |
| 21 | - Keep the PR draft and complete the required follow-up review after any review-fix round. |
| 22 | - Do not finish before the Phase 7 summary and canonical completion contract are satisfied. |
| 23 | |
| 24 | Surface adapters: |
| 25 | |
| 26 | - **Claude Code**: also read |
| 27 | [references/claude-launcher.md](references/claude-launcher.md), which maps canonical |
| 28 | roles and abstract operations to Claude Code mechanics. |
| 29 | - **Codex**: use the delegation mapping below. |
| 30 | |
| 31 | Codex delegation mapping, when subagent use is available and authorized: |
| 32 | |
| 33 | - Use `worker` for every role that writes repository files, runtime artifacts, reports, |
| 34 | GitHub state, or Git state. Use `explorer` only for bounded read-only discovery or audit |
| 35 | questions whose result can be returned directly without writing an artifact. |
| 36 | - Preserve canonical dependencies. Run independent review-fixer-vars and |
| 37 | review-fixer-tests roles concurrently; keep implementation, validation, and push roles |
| 38 | in canonical order. |
| 39 | - Pass concrete `WORKTREE_ROOT`, `WORKTREE_ID`, `RUN_ROOT`, and `PREFIX` values, the role's |
| 40 | full canonical task contract, owned paths, required outputs, and named PolicyEngine |
| 41 | skills to every subagent. Do not assume child agents inherit parent skill context. |
| 42 | - Remind every implementation subagent that other agents may share the worktree, it must |
| 43 | not revert unrelated edits, and only the canonical pusher roles may commit or push. |
| 44 | - If subagents are unavailable or not authorized, execute roles directly in phase order |
| 45 | while preserving the same ownership, handoff files, user checkpoints, and gates. |