@danmoisan/drm-copilot-mcp 0.0.5 → 0.0.6

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 (47) hide show
  1. package/out/mcp-server.js +93 -20
  2. package/package.json +1 -1
  3. package/resources/claude-customizations/.claude/agents/orchestrator.md +6 -2
  4. package/resources/claude-customizations/.claude/agents/pr-author.md +78 -0
  5. package/resources/claude-customizations/.claude/agents/task-researcher.md +10 -6
  6. package/resources/claude-customizations/.claude/hooks/enforce-checkpoint-monotonic.ps1 +68 -10
  7. package/resources/claude-customizations/.claude/hooks/enforce-completion-consistency.ps1 +28 -1
  8. package/resources/claude-customizations/.claude/hooks/enforce-evidence-locations.ps1 +40 -14
  9. package/resources/claude-customizations/.claude/hooks/enforce-orchestration-preimplementation-gate.ps1 +210 -0
  10. package/resources/claude-customizations/.claude/hooks/enforce-pr-author-skill.ps1 +153 -10
  11. package/resources/claude-customizations/.claude/hooks/validate-pr-author-output.ps1 +136 -0
  12. package/resources/claude-customizations/.claude/hooks/validate-task-researcher-output.ps1 +22 -6
  13. package/resources/claude-customizations/.claude/settings.json +22 -0
  14. package/resources/claude-customizations/.claude/skills/evidence-and-timestamp-conventions/SKILL.md +0 -1
  15. package/resources/claude-customizations/.claude/skills/orchestrate/SKILL.md +76 -2
  16. package/resources/claude-customizations/.claude/skills/research-issue/SKILL.md +5 -3
  17. package/resources/claude-customizations/.claude-variants/csharp-legacy/agents/csharp-typed-engineer.md +69 -0
  18. package/resources/claude-customizations/.claude-variants/csharp-legacy/rules/csharp.md +96 -0
  19. package/resources/claude-customizations/.claude-variants/csharp-legacy/skills/csharp-qa-gate/SKILL.md +77 -0
  20. package/resources/claude-customizations/.claude-variants/csharp-legacy/skills/invoke-csharp-engineer/SKILL.md +64 -0
  21. package/resources/claude-customizations/pack-manifests/core.json +65 -0
  22. package/resources/claude-customizations/pack-manifests/csharp-legacy.json +11 -0
  23. package/resources/claude-customizations/pack-manifests/csharp-modern.json +12 -0
  24. package/resources/claude-customizations/pack-manifests/powershell.json +14 -0
  25. package/resources/claude-customizations/pack-manifests/python.json +14 -0
  26. package/resources/claude-customizations/pack-manifests/typescript.json +9 -0
  27. package/resources/codex-and-agents-customizations/.agents/skills/feature-promotion-lifecycle/SKILL.md +30 -13
  28. package/resources/codex-and-agents-customizations/.agents/skills/orchestrate/SKILL.md +113 -10
  29. package/resources/codex-and-agents-customizations/.agents/skills/orchestrator-workflow/SKILL.md +33 -8
  30. package/resources/codex-and-agents-customizations/.agents/skills/repo-automation-adapter/SKILL.md +12 -7
  31. package/resources/codex-and-agents-customizations/.codex/config.toml +65 -6
  32. package/resources/codex-and-agents-customizations/.codex/hooks/enforce-checkpoint-monotonic.ps1 +303 -0
  33. package/resources/codex-and-agents-customizations/.codex/hooks/enforce-completion-consistency.ps1 +300 -0
  34. package/resources/codex-and-agents-customizations/.codex/hooks/enforce-orchestration-preimplementation-gate.ps1 +148 -0
  35. package/resources/codex-and-agents-customizations/.codex/hooks/enforce-pr-author-skill.ps1 +336 -0
  36. package/resources/codex-and-agents-customizations/.codex/hooks/enforce-promotion-mcp-only.ps1 +83 -17
  37. package/resources/config/orchestration-routing.json +2 -10
  38. package/resources/customizations/.github/agents/pr-author.agent.md +25 -0
  39. package/resources/customizations/.github/agents/task-researcher.agent.md +4 -4
  40. package/resources/customizations/.github/prompts/fillout-prd-feature.prompt.md +1 -1
  41. package/resources/customizations/.github/prompts/research-issue.prompt.md +4 -3
  42. package/resources/scripts/dev_tools/push_down_claude_customizations.py +253 -224
  43. package/resources/scripts/dev_tools/push_down_claude_filesystem.py +472 -0
  44. package/resources/scripts/dev_tools/push_down_claude_pack_selection.py +401 -0
  45. package/resources/scripts/dev_tools/validate_orchestrator_state.py +106 -29
  46. package/resources/scripts/dev_tools/validate_policy_audit_artifact.py +24 -0
  47. package/resources/templates/push_down_claude_customizations.py +128 -304
@@ -29,7 +29,10 @@ If the required MCP tools are unavailable, stop before potential-entry creation,
29
29
 
30
30
  ## Agent-Session Promotion Execution Rule
31
31
 
32
- Execute the lifecycle only through the MCP tool forms listed above. The MCP path is the sole authoritative execution path for agent sessions.
32
+ Execute MCP-backed lifecycle operations only through the MCP tool forms listed
33
+ above. The MCP path is the sole authoritative execution path for potential
34
+ entry creation, issue promotion, and active feature folder creation in agent
35
+ sessions.
33
36
 
34
37
  After each successful promotion operation, persist the raw MCP receipt payload under the matching checkpoint key in `artifacts/orchestration/orchestrator-state.json`:
35
38
  - `delegation_receipts.promotion.potential_entry`
@@ -38,6 +41,11 @@ After each successful promotion operation, persist the raw MCP receipt payload u
38
41
 
39
42
  Each `delegation_receipts.promotion.*` field stores the raw MCP receipt payload returned by the corresponding promotion operation without lossy normalization.
40
43
 
44
+ Branch creation and branch rename are required lifecycle sequencing evidence,
45
+ but they are not `surface: "mcp"` lifecycle operations unless a future MCP tool
46
+ exists for those branch operations. Record branch creation and branch rename as
47
+ branch/checkpoint evidence in `artifacts/orchestration/orchestrator-state.json`.
48
+
41
49
  Note: VS Code command-palette commands may exist for interactive extension use, but this note is non-authoritative for agent sessions.
42
50
 
43
51
  ## Canonical Variables
@@ -51,6 +59,8 @@ Note: VS Code command-palette commands may exist for interactive extension use,
51
59
  - `${plan-path}`: single canonical plan file path reused across planning and preflight revisions
52
60
  - `${work-mode}`: `minor-audit`, `full-feature`, or `full-bug` (legacy `full` is accepted only as an alias for `full-feature`)
53
61
  - `${short-path-flag}`: `--work-mode minor-audit` (mandatory for short-path promotion/folder creation)
62
+ - `${pre-issue-branch}`: `${promotion-type}/${short-name}`, created or verified before issue creation
63
+ - `${final-branch}`: `${promotion-type}/${short-name}-${issue-num}`, created by branch rename after promotion returns a numeric issue number
54
64
 
55
65
  `${relativeFile}` MUST resolve to a real potential markdown path before promotion begins. If the path is missing, invalid, or non-markdown, stop. Do not infer or synthesize the missing value.
56
66
 
@@ -62,37 +72,44 @@ Lifecycle guardrails:
62
72
  - `${relativeFile}` MUST resolve to a real potential markdown path before promotion.
63
73
  - `${issue-num}` MUST be numeric after promotion and before branch or folder creation.
64
74
  - Do not infer or synthesize the missing value.
65
- - If `${relativeFile}` or `${issue-num}` is missing, placeholder text, or unverified, stop before branch creation, active-folder creation, or active-folder authoring.
75
+ - If `${relativeFile}` or `${issue-num}` is missing, placeholder text, or unverified, stop before final branch rename, active-folder creation, or active-folder authoring.
66
76
 
67
77
  1) Use the same MCP tool-availability preflight described above and continue only when the required promotion tools are available.
68
78
 
69
- 2) Promote the potential document through `mcp__drm-copilot__potential_to_issue` with `work_mode=minor-audit`.
79
+ 2) Verify route metadata readiness in `artifacts/orchestration/orchestrator-state.json`, including selected `route_id`, required route metadata, and `${work-mode}`.
80
+
81
+ 3) Create or verify the pre-issue branch:
82
+ - `${pre-issue-branch}`
83
+
84
+ 4) Create the potential entry through `mcp__drm-copilot__new_potential_entry` or `mcp__drm-copilot__new_potential_bug_entry`.
85
+
86
+ 5) Promote the potential document through `mcp__drm-copilot__potential_to_issue` with the selected `${work-mode}` and capture the numeric `${issue-num}`.
70
87
 
71
- 3) Create branch:
72
- - `${promotion-type}/${short-name}-${issue-num}`
88
+ 6) Rename the branch to the final branch:
89
+ - `${final-branch}`
73
90
 
74
- 4) Create the active feature folder through `mcp__drm-copilot__new_active_feature_folder` with `work_mode=minor-audit`.
91
+ 7) Create the active feature folder through `mcp__drm-copilot__new_active_feature_folder` with the selected `${work-mode}`.
75
92
 
76
- 4a) Verify minor-audit folder integrity before proceeding:
93
+ 7a) Verify minor-audit folder integrity before proceeding:
77
94
  - `${feature-folder}/issue.md` exists and contains `- Work Mode: minor-audit`
78
95
  - `${feature-folder}/issue.md` contains an explicit `## Acceptance Criteria` section
79
96
  - `${feature-folder}/spec.md` does not exist
80
97
  - `${feature-folder}/user-story.md` does not exist
81
98
  - if any check fails, stop and remediate before planning
82
99
 
83
- 5) Delegate minimal-audit plan creation to `atomic_planner` with directive:
100
+ 8) Delegate minimal-audit plan creation to `atomic_planner` with directive:
84
101
  - `DIRECTIVE: MINIMAL-AUDIT PLAN REQUIRED`
85
102
 
86
- 5a) Resolve and persist `${plan-path}` before delegation:
103
+ 8a) Resolve and persist `${plan-path}` before delegation:
87
104
  - reuse the earliest existing `plan*.md` in `${feature-folder}` when present
88
105
  - otherwise create exactly one canonical plan file path and reuse it for all revisions
89
106
 
90
- 6) Require preflight validation via `atomic_executor` until:
107
+ 9) Require preflight validation via `atomic_executor` until:
91
108
  - `PREFLIGHT: ALL CLEAR`
92
109
 
93
- 7) Execute plan Phase 0 only via executor and checkpoint evidence.
110
+ 10) Execute plan Phase 0 only via executor and checkpoint evidence.
94
111
 
95
- 8) Branch:
112
+ 11) Branch:
96
113
  - manual bootstrap: save state and stop ONLY when the initial user request explicitly opted into manual orchestration from the beginning,
97
114
  - non-bootstrap: continue with constrained small-path development.
98
115
 
@@ -100,7 +117,7 @@ Automation rule:
100
117
  - do not introduce manual bootstrap, human-operator validation, or any other manual handoff later in orchestration unless that initial explicit opt-in exists
101
118
  - if automation cannot proceed, record blocked automated state instead of asking for manual intervention
102
119
 
103
- 9) Validate delivery via executor against `issue.md`, then run reduced audit/remediation loop until ready-to-merge.
120
+ 12) Validate delivery via executor against `issue.md`, then run reduced audit/remediation loop until ready-to-merge.
104
121
 
105
122
  ## Required Outputs for Downstream Handoffs
106
123
 
@@ -8,6 +8,17 @@ argument-hint: "[objective]"
8
8
 
9
9
  This skill frames work for the already-active main session, which serves as the orchestrator runtime for end-to-end feature or bug delivery.
10
10
 
11
+ ## Entry-Point Contract
12
+
13
+ The already-active main session is the canonical orchestrator runtime for this
14
+ skill. Optional orchestrator profiles, agent configuration files, or named
15
+ profiles are configuration aids only; they do not replace the active
16
+ main-session orchestration contract.
17
+
18
+ The main session owns route selection, checkpoint updates, lifecycle sequencing,
19
+ delegation decisions, and completion gating unless a required workflow step is
20
+ explicitly delegated by this skill or by `orchestrator-workflow`.
21
+
11
22
  ## Prerequisites
12
23
 
13
24
  Before proceeding, the orchestrator must:
@@ -27,6 +38,94 @@ On every invocation, the main session must:
27
38
  selected route's required agents, skills, and MCP tools into checkpoint
28
39
  state.
29
40
 
41
+ ## Read-Only Intake and Route Selection Gate
42
+
43
+ Before any lifecycle MCP call, the main session must complete a read-only scope
44
+ assessment. This gate is the read-only scope assessment for orchestration
45
+ intake. It includes policy reads, checkpoint reads, route config reads,
46
+ objective and scope assessment, language/file assessment, route selection, and
47
+ route metadata persistence.
48
+
49
+ The route-selection gate must be complete before calling any of:
50
+
51
+ - `new_potential_entry`
52
+ - `new_potential_bug_entry`
53
+ - `potential_to_issue`
54
+ - `new_active_feature_folder`
55
+
56
+ Until this gate is complete, the main session may read repository files and
57
+ checkpoint state, but must not create lifecycle entries, promote issues, create
58
+ active feature folders, edit implementation files, run formatters or tests,
59
+ stage files, commit files, or delegate implementation.
60
+
61
+ ## Route-Derived Work Mode
62
+
63
+ The main session must derive `${work-mode}` from the selected route before
64
+ lifecycle automation starts:
65
+
66
+ - small route -> `minor-audit`
67
+ - large feature route -> `full-feature`
68
+ - large bug route -> `full-bug`
69
+
70
+ The selected `route_id`, exact route metadata, and derived `${work-mode}` must
71
+ be persisted in `artifacts/orchestration/orchestrator-state.json` before any
72
+ lifecycle MCP call or implementation action. Route metadata must include the
73
+ selected route's `required_agents`, `required_skills`, and
74
+ `required_mcp_tools` copied from `config/orchestration-routing.json`.
75
+
76
+ ## Lifecycle Branch Sequencing
77
+
78
+ After route metadata is persisted and before potential entry creation, the main
79
+ session must create or verify a slug-only pre-issue branch:
80
+
81
+ - `${pre-issue-branch}`: `${promotion-type}/${short-name}`
82
+
83
+ The pre-issue branch must be derived only from `${promotion-type}` and
84
+ `${short-name}` because no numeric issue number exists yet. The main session
85
+ must create or verify this branch before calling `new_potential_entry` or
86
+ `new_potential_bug_entry`.
87
+
88
+ After potential entry creation, `potential_to_issue` must return a numeric
89
+ `${issue-num}` before the main session renames the branch to the final issue
90
+ branch:
91
+
92
+ - `${final-branch}`: `${promotion-type}/${short-name}-${issue-num}`
93
+
94
+ The branch rename to `${final-branch}` must complete before calling
95
+ `new_active_feature_folder`.
96
+
97
+ ## Pre-Implementation Gate
98
+
99
+ The pre-implementation gate must pass before any edits, formatters, tests,
100
+ staging, commits, or implementation delegation. This gate covers edits, formatters, tests, staging, commits, and implementation delegation. The main session must verify and persist all of the following before implementation can begin:
101
+
102
+ - checkpoint route metadata is present and matches the selected route;
103
+ - selected `${work-mode}` is present and matches the selected route;
104
+ - lifecycle readiness is complete for the selected path;
105
+ - branch state records `${pre-issue-branch}`, `${final-branch}`, and branch
106
+ rename status where lifecycle setup is required;
107
+ - required MCP receipts exist for completed lifecycle operations.
108
+
109
+ If any required item is missing, implementation is blocked until the checkpoint
110
+ and lifecycle state are corrected.
111
+
112
+ ## Pre-Implementation Violation Handling
113
+
114
+ If an implementation action is attempted before a required orchestration gate
115
+ passes, the main session must stop implementation and persist a blocked
116
+ checkpoint state. The required checkpoint outcome is blocked checkpoint state.
117
+ The checkpoint or companion artifact must record:
118
+
119
+ - violated gate name;
120
+ - attempted action;
121
+ - known mutated files, if any;
122
+ - corrective next step;
123
+ - current route metadata, lifecycle, branch, and MCP receipt state.
124
+
125
+ After a pre-implementation gate violation, the main session must not continue
126
+ implementation. It may only record the violation, restore or reconcile state
127
+ when policy permits, and resume from the corrective orchestration step.
128
+
30
129
  ## Hard Enforcement Boundary
31
130
 
32
131
  The hard completion boundary for Codex orchestration is the deterministic
@@ -88,7 +187,8 @@ After reading `artifacts/orchestration/orchestrator-state.json`, the main sessio
88
187
 
89
188
  - `atomic-planner` — generates phased implementation plans
90
189
  - `atomic-executor` — executes approved plans task-by-task
91
- - `feature-review` — produces policy, code, and feature audit artifacts
190
+ - `feature-reviewer` — produces policy, code, and feature audit artifacts by
191
+ applying the `feature-review` workflow skill
92
192
  - `task-researcher` — performs deep research and writes findings to `artifacts/research/`
93
193
  - `prd-feature` — produces issue, specification, and user-story artifacts when required by the selected workflow
94
194
  - `staged-review` — reviews staged changes when a pre-commit review is required
@@ -144,21 +244,22 @@ The orchestrator must not report completion until:
144
244
  3. The checkpoint file at `artifacts/orchestration/orchestrator-state.json` reflects the completed state.
145
245
  4. The orchestrator-state validator passes with `--require-complete`.
146
246
 
147
- ## Pre-Feature-Review Commit
247
+ ## Pre-Review Commit
148
248
 
149
- Before delegating to the `feature-review` subagent, the orchestrator must:
249
+ Before delegating to the `feature-reviewer` agent, the orchestrator must:
150
250
 
151
251
  1. Stage all modified and new files: `git add -A`.
152
252
  2. Run MCP tool `collect_commit_context` and capture the returned on-disk artifact path.
153
253
  3. Delegate to `commit_steward` using that commit-context artifact as the authoritative staged-change input.
154
254
  4. Commit using the generated message: `git commit -m "<generated message>"`.
155
- 5. Only after a successful commit may the orchestrator proceed to the `feature-review` delegation.
255
+ 5. Only after a successful commit may the orchestrator proceed to the
256
+ `feature-reviewer` delegation.
156
257
 
157
258
  The review subagent compares against a base branch; uncommitted changes are invisible to the diff tool and cannot be audited.
158
259
 
159
260
  ## Post-Review Outcome Evaluation
160
261
 
161
- After each `feature-review` delegation returns:
262
+ After each `feature-reviewer` delegation returns:
162
263
 
163
264
  1. Read the exact terminal status lines from the review result.
164
265
  2. If the result does not include `REVIEW_STATUS: PASS` or `REVIEW_STATUS: REMEDIATION_REQUIRED`, stop and record blocked state.
@@ -173,7 +274,7 @@ A bounded loop consisting of five steps. The loop variable `remediation_pass` st
173
274
  - **R2 — Preflight clearance:** Delegate to `atomic-executor` for precondition validation only (no implementation). If the executor does not return `PREFLIGHT: ALL CLEAR`, return to R1 by re-delegating to `atomic-planner` against the same remediation-plan path with the required-changes output from the executor. Only after `PREFLIGHT: ALL CLEAR` may the orchestrator advance to R3.
174
275
  - **R3 — Remediation execution:** Delegate to `atomic-executor` with full execution authorization. Each task's toolchain loop (format → lint → type-check → test) is mandatory; no skipping.
175
276
  - **Pre-R4 commit:** Stage all changes (`git add -A`), run MCP tool `collect_commit_context`, delegate to `commit_steward` using the resulting artifact, and commit with the generated message. Advance to R4 only after a successful commit.
176
- - **R4 — Re-audit:** Refresh PR context via MCP tool `collect_pr_context`, then delegate to `feature-review` with the same inputs as the original review (resolved base branch, feature folder, refreshed PR context artifacts, acceptance-criteria source). No scope narrowing. The canonical issue number line must be included.
277
+ - **R4 — Re-audit:** Refresh PR context via MCP tool `collect_pr_context`, then delegate to `feature-reviewer` with the same inputs as the original review (resolved base branch, feature folder, refreshed PR context artifacts, acceptance-criteria source). No scope narrowing. The canonical issue number line must be included.
177
278
  - **R5 — Loop-exit decision:** If the re-audit returns `REVIEW_STATUS: PASS`, exit the loop and advance to the PR creation gate. Otherwise, record `remediation_pass` increment in the checkpoint and return to R1.
178
279
 
179
280
  **Termination guard:** If `remediation_pass` reaches 3 without resolution, the orchestrator records `step6_status: "blocked_remediation_loop_limit"` in the checkpoint and halts. No further automation is attempted.
@@ -182,7 +283,8 @@ A bounded loop consisting of five steps. The loop variable `remediation_pass` st
182
283
 
183
284
  The canonical issue number is derived once from the active feature folder name: extract the trailing integer from the folder base name (e.g., `2026-04-26-push-down-claude-customizations-162` yields `162`). Record as `issue_num` in the checkpoint.
184
285
 
185
- Every delegation prompt to `atomic-planner`, `atomic-executor`, and `feature-review` must include the line:
286
+ Every delegation prompt to `atomic-planner`, `atomic-executor`, and
287
+ `feature-reviewer` must include the line:
186
288
 
187
289
  > `Canonical issue number for this feature is <issue_num>. All artifact content, file paths, and cross-references must use this number.`
188
290
 
@@ -199,7 +301,8 @@ current PR head SHA.
199
301
 
200
302
  The orchestrator must not create a PR, push a branch for PR purposes, or report work complete until all four conditions are simultaneously true:
201
303
 
202
- 1. `blocking_findings_resolved: true` — the most recent `feature-review` produced zero blocking findings.
304
+ 1. `blocking_findings_resolved: true` — the most recent `feature-reviewer`
305
+ result produced zero blocking findings.
203
306
  Equivalent deterministic gate: the latest review returned `REVIEW_STATUS: PASS`.
204
307
  2. The AC verification artifact (`p14-acceptance-criteria-checkoff.md` or equivalent) confirms all acceptance criteria pass.
205
308
  3. The mandatory toolchain passed in its most recent run on the branch (no linting/type-check/test failures).
@@ -210,14 +313,14 @@ This gate is non-negotiable. Each condition is independently verified before PR
210
313
 
211
314
  ## Step 6 Delegation — Prohibited Prompt Language
212
315
 
213
- When delegating to the `feature-review` subagent, the orchestrator prompt MUST NOT:
316
+ When delegating to the `feature-reviewer` agent, the orchestrator prompt MUST NOT:
214
317
 
215
318
  - describe the review scope as "plan scope," "plan-scope only," or any equivalent narrowing of scope to the currently-executed plan;
216
319
  - instruct the agent to skip, waive, or mark as "out of scope," "informational only," or "not applicable" any toolchain step or coverage check for a language that has changed files in the branch diff;
217
320
  - assert that a language category is "not applicable" when that language has changed files in the branch diff;
218
321
  - imply that coverage is not required because the plan scope contains only documentation changes when the branch diff contains non-documentation changes contributed by prior commits on the same branch.
219
322
 
220
- The orchestrator supplies only the following to the `feature-review` subagent:
323
+ The orchestrator supplies only the following to the `feature-reviewer` agent:
221
324
 
222
325
  - the resolved base branch and merge-base SHA;
223
326
  - the active feature folder path;
@@ -64,6 +64,9 @@ Persist and reuse these fields exactly:
64
64
  - `path_selected`
65
65
  - `promotion-type`
66
66
  - `short-name`
67
+ - `pre-issue-branch`
68
+ - `final-branch`
69
+ - `branch-rename-status`
67
70
  - `relativeFile`
68
71
  - `long-name`
69
72
  - `issue-num`
@@ -96,6 +99,7 @@ Persist and reuse these fields exactly:
96
99
  - `local_execution_overrides`
97
100
  - `delegation_bypasses`
98
101
  - `lifecycle_operations`
102
+ - `pre-implementation-violation`
99
103
 
100
104
  For small-path runs, also persist:
101
105
  - `bootstrap_mode`
@@ -126,6 +130,15 @@ Blocked-reason enum:
126
130
  - `review_status_missing`
127
131
  - `commit_context_missing`
128
132
  - `no_staged_changes`
133
+ - `pre_implementation_gate_violation`
134
+
135
+ Pre-implementation violation schema:
136
+ - `pre-implementation-violation` MUST be either `null` or an object with:
137
+ - `violated_gate`
138
+ - `attempted_action`
139
+ - `known_mutated_files`
140
+ - `corrective_next_step`
141
+ - `recorded_at`
129
142
 
130
143
  Delegation receipt schema:
131
144
  - `delegation_receipts` MUST be a list of objects with:
@@ -233,10 +246,12 @@ Required behavior:
233
246
  2. Use `feature-promotion-lifecycle` as the source of truth for lifecycle variables, branch naming, and `${plan-path}` resolution.
234
247
  3. Route all promotion, issue, and feature-folder automation through `repo-automation-adapter`.
235
248
  4. Enforce lifecycle preconditions before any active-folder authoring:
249
+ - route metadata persistence must be complete in the canonical checkpoint before potential-entry creation
250
+ - `${pre-issue-branch}` must be created or verified before potential-entry creation
236
251
  - `${relativeFile}` must resolve to a real potential markdown path and must not be `NONE`, `TBD`, or empty
237
- - issue promotion must complete before branch or folder creation
238
- - `${issue-num}` must be numeric before `new_active_feature_folder` runs
239
- - do not create or edit `${feature-folder}/issue.md`, `${feature-folder}/spec.md`, `${feature-folder}/user-story.md`, or `plan*.md` until promotion and folder creation both succeed
252
+ - `${issue-num}` must be numeric before final branch rename or `new_active_feature_folder` runs
253
+ - final branch rename must complete before `new_active_feature_folder` runs
254
+ - do not create or edit `${feature-folder}/issue.md`, `${feature-folder}/spec.md`, `${feature-folder}/user-story.md`, or `plan*.md` until potential-entry creation, promotion, final branch rename, and folder creation all succeed
240
255
  - if any lifecycle precondition fails, set the relevant step status to `blocked`, set `blocked_reason` to `lifecycle_preconditions_missing`, and stop
241
256
  5. Enforce minor-audit folder integrity:
242
257
  - `${feature-folder}/issue.md` must exist
@@ -280,10 +295,12 @@ Required behavior:
280
295
  2. Use `feature-promotion-lifecycle` as the source of truth for lifecycle variables, branch naming, and `${plan-path}` resolution.
281
296
  3. Route all promotion, issue, and feature-folder automation through `repo-automation-adapter`.
282
297
  4. Enforce lifecycle preconditions before any active-folder authoring:
298
+ - route metadata persistence must be complete in the canonical checkpoint before potential-entry creation
299
+ - `${pre-issue-branch}` must be created or verified before potential-entry creation
283
300
  - `${relativeFile}` must resolve to a real potential markdown path and must not be `NONE`, `TBD`, or empty
284
- - issue promotion must complete before branch or folder creation
285
- - `${issue-num}` must be numeric before `new_active_feature_folder` runs
286
- - do not create or edit `${feature-folder}/issue.md`, `${feature-folder}/spec.md`, `${feature-folder}/user-story.md`, or `plan*.md` until promotion and folder creation both succeed
301
+ - `${issue-num}` must be numeric before final branch rename or `new_active_feature_folder` runs
302
+ - final branch rename must complete before `new_active_feature_folder` runs
303
+ - do not create or edit `${feature-folder}/issue.md`, `${feature-folder}/spec.md`, `${feature-folder}/user-story.md`, or `plan*.md` until potential-entry creation, promotion, final branch rename, and folder creation all succeed
287
304
  - if any lifecycle precondition fails, set the relevant step status to `blocked`, set `blocked_reason` to `lifecycle_preconditions_missing`, and stop
288
305
  5. Complete the requirements-authoring steps before planning:
289
306
  - fill the potential entry details
@@ -347,6 +364,8 @@ Do not claim mission completion until all of the following are true:
347
364
  - the canonical checkpoint path was used without sidecar replacement or backup substitution
348
365
  - `${relativeFile}` is a real promoted-input path and `${issue-num}` is numeric when lifecycle setup was required
349
366
  - `${feature-folder}` and `${plan-path}` are known when lifecycle setup was required
367
+ - route metadata, selected work mode, branch state, lifecycle receipts, and
368
+ folder readiness are present before implementation begins
350
369
  - the approved plan is executor-compliant and references the required baseline and final-QA evidence tasks
351
370
  - required review artifacts exist on disk
352
371
  - small path has Phase 0 evidence plus reduced audit artifacts
@@ -366,8 +385,14 @@ Do not claim mission completion until all of the following are true:
366
385
  - Do not bypass `repo-automation-adapter` for host-specific lifecycle steps.
367
386
  - Do not rename, back up, or create sidecar checkpoint files to avoid using the canonical checkpoint path.
368
387
  - Do not proceed when the canonical checkpoint belongs to another in-progress mission; stop and report the conflict.
369
- - Do not create or edit active feature docs before potential-entry creation, issue promotion, and active-folder creation succeed.
370
- - Do not call `new_active_feature_folder` before `${issue-num}` is numeric and backed by promotion output.
388
+ - Do not create or edit active feature docs before route metadata persistence,
389
+ pre-issue branch setup, potential-entry creation, issue promotion, final branch
390
+ rename, and active-folder creation succeed.
391
+ - Do not call `new_active_feature_folder` before `${issue-num}` is numeric,
392
+ backed by promotion output, and the final branch rename is complete.
393
+ - Do not begin implementation edits, formatters, tests, staging, commits, or
394
+ implementation delegation when route metadata, branch state, lifecycle
395
+ receipts, or folder readiness are missing.
371
396
  - Do not persist placeholder lifecycle values such as `NONE` or `TBD` for `${relativeFile}`, `${issue-num}`, `${feature-folder}`, or `${plan-path}` once lifecycle setup begins.
372
397
  - Do not create replacement audit artifacts yourself for any required delegated review step.
373
398
  - Do not execute required delegated steps locally as a fallback.
@@ -111,13 +111,18 @@ Required tools:
111
111
 
112
112
  Execute these lifecycle operations as one ordered chain:
113
113
 
114
- 1. Create the potential entry.
115
- 2. Promote with `potential_to_issue`.
116
- 3. Capture numeric issue number from promotion output.
117
- 4. Create or check out `${promotion-type}/${short-name}-${issue-num}`.
118
- 5. Create the active feature folder with `new_active_feature_folder`.
119
-
120
- `new_active_feature_folder` is not an allowed bootstrap substitute for missing promotion state. If `${issue-num}` is missing, non-numeric, or placeholder text, stop. Do not synthesize GitHub issue state, active-folder scaffolding, or placeholder lifecycle variables.
114
+ 1. Verify route metadata and selected `${work-mode}` are persisted in the
115
+ canonical checkpoint.
116
+ 2. Create or verify pre-issue branch `${promotion-type}/${short-name}` before
117
+ `new_potential_entry` or `new_potential_bug_entry`.
118
+ 3. Create the potential entry with `new_potential_entry` or
119
+ `new_potential_bug_entry`.
120
+ 4. Promote with `potential_to_issue`.
121
+ 5. Capture numeric issue number from promotion output.
122
+ 6. Rename the branch to `${promotion-type}/${short-name}-${issue-num}`.
123
+ 7. Create the active feature folder with `new_active_feature_folder`.
124
+
125
+ `new_active_feature_folder` is not an allowed bootstrap substitute for missing promotion state. If `${issue-num}` is missing, non-numeric, or placeholder text, stop before final branch rename or active folder creation. Do not synthesize GitHub issue state, active-folder scaffolding, or placeholder lifecycle variables.
121
126
 
122
127
  ### Customization publishing and hard-lock resolution
123
128
 
@@ -1,4 +1,4 @@
1
- default_permissions = "orchestrator-workspace"
1
+ default_permissions = ":danger-full-access"
2
2
 
3
3
  [mcp_servers.drm-copilot]
4
4
  command = "npx"
@@ -7,17 +7,24 @@ required = true
7
7
  enabled_tools = [
8
8
  "collect_commit_context",
9
9
  "collect_pr_context",
10
- "new_potential_entry",
10
+ "run_codex_native_converter",
11
+ "push_down_copilot_customizations",
12
+ "push_down_codex_and_agents_customizations",
13
+ "push_down_claude_customizations",
11
14
  "new_potential_bug_entry",
15
+ "new_potential_entry",
16
+ "link_parent_child",
12
17
  "potential_to_issue",
13
18
  "new_active_feature_folder",
14
- "validate_orchestration_artifacts",
15
- "resolve_atomic_plan_prompt",
16
- "resolve_execute_hard_lock_prompt",
17
19
  "run_poshqc_format",
18
20
  "run_poshqc_analyze",
19
- "run_poshqc_analyze_autofix",
20
21
  "run_poshqc_test",
22
+ "run_poshqc_analyze_autofix",
23
+ "run_poshqc_suite",
24
+ "resolve_policy_audit_template_asset",
25
+ "resolve_execute_hard_lock_prompt",
26
+ "resolve_atomic_plan_prompt",
27
+ "validate_orchestration_artifacts",
21
28
  ]
22
29
  default_tools_approval_mode = "prompt"
23
30
 
@@ -27,6 +34,58 @@ approval_mode = "approve"
27
34
  [features]
28
35
  multi_agent = true
29
36
 
37
+ [[hooks.PreToolUse]]
38
+ matcher = "Bash"
39
+ command = "pwsh -NoProfile -File .codex/hooks/validate-bash.ps1"
40
+
41
+ [[hooks.PreToolUse]]
42
+ matcher = "Bash"
43
+ command = "pwsh -NoProfile -File .codex/hooks/enforce-promotion-mcp-only.ps1"
44
+
45
+ [[hooks.PreToolUse]]
46
+ matcher = "Bash"
47
+ command = "pwsh -NoProfile -File .codex/hooks/enforce-orchestration-preimplementation-gate.ps1"
48
+
49
+ [[hooks.PreToolUse]]
50
+ matcher = "Write|Edit"
51
+ command = "pwsh -NoProfile -File .codex/hooks/check-python-test-purity.ps1"
52
+
53
+ [[hooks.PreToolUse]]
54
+ matcher = "Write|Edit"
55
+ command = "pwsh -NoProfile -File .codex/hooks/enforce-python-batch-budget.ps1"
56
+
57
+ [[hooks.PreToolUse]]
58
+ matcher = "Write|Edit"
59
+ command = "pwsh -NoProfile -File .codex/hooks/check-powershell-test-purity.ps1"
60
+
61
+ [[hooks.PreToolUse]]
62
+ matcher = "Write|Edit"
63
+ command = "pwsh -NoProfile -File .codex/hooks/enforce-powershell-batch-budget.ps1"
64
+
65
+ [[hooks.PreToolUse]]
66
+ matcher = "Write|Edit"
67
+ command = "pwsh -NoProfile -File .codex/hooks/enforce-evidence-locations.ps1"
68
+
69
+ [[hooks.PreToolUse]]
70
+ matcher = "Write|Edit"
71
+ command = "pwsh -NoProfile -File .codex/hooks/enforce-orchestration-preimplementation-gate.ps1"
72
+
73
+ [[hooks.PreToolUse]]
74
+ matcher = "Write|Edit"
75
+ command = "pwsh -NoProfile -File .codex/hooks/enforce-checkpoint-monotonic.ps1"
76
+
77
+ [[hooks.PreToolUse]]
78
+ matcher = "Write|Edit"
79
+ command = "pwsh -NoProfile -File .codex/hooks/enforce-completion-consistency.ps1"
80
+
81
+ [[hooks.PreToolUse]]
82
+ matcher = "Agent"
83
+ command = "pwsh -NoProfile -File .codex/hooks/enforce-orchestration-preimplementation-gate.ps1"
84
+
85
+ [[hooks.SubagentStop]]
86
+ matcher = "feature-review|feature-reviewer"
87
+ command = "pwsh -NoProfile -File .codex/hooks/validate-feature-review-coverage.ps1"
88
+
30
89
  [permissions.orchestrator-workspace]
31
90
  description = "Workspace editing for deterministic orchestration with secret-path deny rules."
32
91
  extends = ":workspace"