@danmoisan/drm-copilot-mcp 1.0.13 → 1.0.15
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.
- package/out/mcp-server.js +3160 -458
- package/package.json +1 -1
- package/resources/claude-customizations/.claude/agents/epic-orchestrator.md +24 -0
- package/resources/claude-customizations/.claude/agents/epic-planner.md +121 -0
- package/resources/claude-customizations/.claude/agents/orchestrator.md +2 -2
- package/resources/claude-customizations/.claude/hooks/enforce-epic-invocation-origin.ps1 +246 -0
- package/resources/claude-customizations/.claude/settings.json +9 -2
- package/resources/claude-customizations/.claude/skills/epic-orchestrate/SKILL.md +7 -0
- package/resources/claude-customizations/.claude/skills/epic-plan/SKILL.md +189 -0
- package/resources/claude-customizations/.claude/skills/epic-run/SKILL.md +38 -0
- package/resources/claude-customizations/.claude/skills/orchestrate/SKILL.md +21 -2
- package/resources/claude-customizations/pack-manifests/core.json +4 -0
- package/resources/codex-and-agents-customizations/.agents/skills/architecture-boundaries/SKILL.md +0 -1
- package/resources/codex-and-agents-customizations/.agents/skills/codex-model-routing/SKILL.md +100 -0
- package/resources/codex-and-agents-customizations/.agents/skills/codex-model-routing/agents/openai.yaml +4 -0
- package/resources/codex-and-agents-customizations/.agents/skills/epic-orchestrate/SKILL.md +170 -0
- package/resources/codex-and-agents-customizations/.agents/skills/epic-plan/SKILL.md +230 -0
- package/resources/codex-and-agents-customizations/.agents/skills/epic-run/SKILL.md +39 -0
- package/resources/codex-and-agents-customizations/.agents/skills/general-code-change/SKILL.md +0 -1
- package/resources/codex-and-agents-customizations/.agents/skills/general-unit-test/SKILL.md +0 -1
- package/resources/codex-and-agents-customizations/.agents/skills/orchestrate/SKILL.md +89 -9
- package/resources/codex-and-agents-customizations/.agents/skills/orchestrator-workflow/SKILL.md +39 -4
- package/resources/codex-and-agents-customizations/.agents/skills/quality-tiers/SKILL.md +0 -1
- package/resources/codex-and-agents-customizations/.agents/skills/tonality/SKILL.md +0 -1
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-executor-c1.toml +153 -0
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-executor-c2.toml +153 -0
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-executor-c3-elevated.toml +153 -0
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-executor-c3.toml +153 -0
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-executor-c4.toml +153 -0
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-executor.toml +2 -0
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-planner-c1.toml +95 -0
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-planner-c2.toml +95 -0
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-planner-c3-elevated.toml +95 -0
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-planner-c3.toml +95 -0
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-planner-c4.toml +95 -0
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-planner.toml +2 -0
- package/resources/codex-and-agents-customizations/.codex/agents/csharp-typed-engineer-c1.toml +99 -0
- package/resources/codex-and-agents-customizations/.codex/agents/csharp-typed-engineer-c2.toml +99 -0
- package/resources/codex-and-agents-customizations/.codex/agents/csharp-typed-engineer-c3-elevated.toml +99 -0
- package/resources/codex-and-agents-customizations/.codex/agents/csharp-typed-engineer-c3.toml +99 -0
- package/resources/codex-and-agents-customizations/.codex/agents/csharp-typed-engineer-c4.toml +99 -0
- package/resources/codex-and-agents-customizations/.codex/agents/csharp-typed-engineer.toml +2 -0
- package/resources/codex-and-agents-customizations/.codex/agents/epic-orchestrator.toml +96 -0
- package/resources/codex-and-agents-customizations/.codex/agents/epic-planner.toml +97 -0
- package/resources/codex-and-agents-customizations/.codex/agents/feature-reviewer-c1.toml +62 -0
- package/resources/codex-and-agents-customizations/.codex/agents/feature-reviewer-c2.toml +62 -0
- package/resources/codex-and-agents-customizations/.codex/agents/feature-reviewer-c3-elevated.toml +62 -0
- package/resources/codex-and-agents-customizations/.codex/agents/feature-reviewer-c3.toml +62 -0
- package/resources/codex-and-agents-customizations/.codex/agents/feature-reviewer-c4.toml +62 -0
- package/resources/codex-and-agents-customizations/.codex/agents/feature-reviewer.toml +2 -0
- package/resources/codex-and-agents-customizations/.codex/agents/orchestrator-c1.toml +200 -0
- package/resources/codex-and-agents-customizations/.codex/agents/orchestrator-c2.toml +200 -0
- package/resources/codex-and-agents-customizations/.codex/agents/orchestrator-c3-elevated.toml +200 -0
- package/resources/codex-and-agents-customizations/.codex/agents/orchestrator-c3.toml +200 -0
- package/resources/codex-and-agents-customizations/.codex/agents/orchestrator-c4.toml +200 -0
- package/resources/codex-and-agents-customizations/.codex/agents/orchestrator.toml +53 -3
- package/resources/codex-and-agents-customizations/.codex/agents/powershell-typed-engineer-c1.toml +110 -0
- package/resources/codex-and-agents-customizations/.codex/agents/powershell-typed-engineer-c2.toml +110 -0
- package/resources/codex-and-agents-customizations/.codex/agents/powershell-typed-engineer-c3-elevated.toml +110 -0
- package/resources/codex-and-agents-customizations/.codex/agents/powershell-typed-engineer-c3.toml +110 -0
- package/resources/codex-and-agents-customizations/.codex/agents/powershell-typed-engineer-c4.toml +110 -0
- package/resources/codex-and-agents-customizations/.codex/agents/powershell-typed-engineer.toml +2 -0
- package/resources/codex-and-agents-customizations/.codex/agents/pr-author-c1.toml +28 -0
- package/resources/codex-and-agents-customizations/.codex/agents/pr-author-c2.toml +28 -0
- package/resources/codex-and-agents-customizations/.codex/agents/pr-author-c3-elevated.toml +28 -0
- package/resources/codex-and-agents-customizations/.codex/agents/pr-author-c3.toml +28 -0
- package/resources/codex-and-agents-customizations/.codex/agents/pr-author-c4.toml +28 -0
- package/resources/codex-and-agents-customizations/.codex/agents/pr-author.toml +2 -0
- package/resources/codex-and-agents-customizations/.codex/agents/prd-feature-c1.toml +55 -0
- package/resources/codex-and-agents-customizations/.codex/agents/prd-feature-c2.toml +55 -0
- package/resources/codex-and-agents-customizations/.codex/agents/prd-feature-c3-elevated.toml +55 -0
- package/resources/codex-and-agents-customizations/.codex/agents/prd-feature-c3.toml +55 -0
- package/resources/codex-and-agents-customizations/.codex/agents/prd-feature-c4.toml +55 -0
- package/resources/codex-and-agents-customizations/.codex/agents/prd-feature.toml +2 -0
- package/resources/codex-and-agents-customizations/.codex/agents/python-typed-engineer-c1.toml +102 -0
- package/resources/codex-and-agents-customizations/.codex/agents/python-typed-engineer-c2.toml +102 -0
- package/resources/codex-and-agents-customizations/.codex/agents/python-typed-engineer-c3-elevated.toml +102 -0
- package/resources/codex-and-agents-customizations/.codex/agents/python-typed-engineer-c3.toml +102 -0
- package/resources/codex-and-agents-customizations/.codex/agents/python-typed-engineer-c4.toml +102 -0
- package/resources/codex-and-agents-customizations/.codex/agents/python-typed-engineer.toml +2 -0
- package/resources/codex-and-agents-customizations/.codex/agents/task-researcher-c1.toml +105 -0
- package/resources/codex-and-agents-customizations/.codex/agents/task-researcher-c2.toml +105 -0
- package/resources/codex-and-agents-customizations/.codex/agents/task-researcher-c3-elevated.toml +105 -0
- package/resources/codex-and-agents-customizations/.codex/agents/task-researcher-c3.toml +105 -0
- package/resources/codex-and-agents-customizations/.codex/agents/task-researcher-c4.toml +105 -0
- package/resources/codex-and-agents-customizations/.codex/agents/task-researcher.toml +2 -0
- package/resources/codex-and-agents-customizations/.codex/agents/typescript-engineer-c1.toml +50 -0
- package/resources/codex-and-agents-customizations/.codex/agents/typescript-engineer-c2.toml +50 -0
- package/resources/codex-and-agents-customizations/.codex/agents/typescript-engineer-c3-elevated.toml +50 -0
- package/resources/codex-and-agents-customizations/.codex/agents/typescript-engineer-c3.toml +50 -0
- package/resources/codex-and-agents-customizations/.codex/agents/typescript-engineer-c4.toml +50 -0
- package/resources/codex-and-agents-customizations/.codex/agents/typescript-engineer.toml +2 -0
- package/resources/codex-and-agents-customizations/.codex/config.toml +202 -37
- package/resources/codex-and-agents-customizations/.codex/hooks/authorize-root-epic-invocation.ps1 +236 -0
- package/resources/codex-and-agents-customizations/.codex/hooks/check-powershell-test-purity.ps1 +178 -69
- package/resources/codex-and-agents-customizations/.codex/hooks/check-python-test-purity.ps1 +92 -19
- package/resources/codex-and-agents-customizations/.codex/hooks/codex-agent-profile-attestation.ps1 +199 -0
- package/resources/codex-and-agents-customizations/.codex/hooks/codex-authority-store.ps1 +182 -0
- package/resources/codex-and-agents-customizations/.codex/hooks/codex-epic-child-launch-attestation.ps1 +129 -0
- package/resources/codex-and-agents-customizations/.codex/hooks/enforce-checkpoint-monotonic.ps1 +148 -31
- package/resources/codex-and-agents-customizations/.codex/hooks/enforce-codex-model-routing.ps1 +198 -0
- package/resources/codex-and-agents-customizations/.codex/hooks/enforce-completion-consistency.ps1 +28 -19
- package/resources/codex-and-agents-customizations/.codex/hooks/enforce-epic-child-worktree-binding.ps1 +325 -0
- package/resources/codex-and-agents-customizations/.codex/hooks/enforce-epic-merge-gate.ps1 +140 -0
- package/resources/codex-and-agents-customizations/.codex/hooks/enforce-epic-planning-only.ps1 +292 -0
- package/resources/codex-and-agents-customizations/.codex/hooks/enforce-epic-root-invocation.ps1 +135 -0
- package/resources/codex-and-agents-customizations/.codex/hooks/enforce-epic-wave-barrier.ps1 +295 -0
- package/resources/codex-and-agents-customizations/.codex/hooks/enforce-epic-worktree-removal-gate.ps1 +151 -0
- package/resources/codex-and-agents-customizations/.codex/hooks/enforce-evidence-locations.ps1 +99 -34
- package/resources/codex-and-agents-customizations/.codex/hooks/enforce-orchestration-preimplementation-gate.ps1 +143 -27
- package/resources/codex-and-agents-customizations/.codex/hooks/enforce-powershell-batch-budget.ps1 +88 -43
- package/resources/codex-and-agents-customizations/.codex/hooks/enforce-promotion-mcp-only.ps1 +65 -20
- package/resources/codex-and-agents-customizations/.codex/hooks/enforce-python-batch-budget.ps1 +88 -42
- package/resources/codex-and-agents-customizations/.codex/hooks/record-subagent-routing-attestation.ps1 +414 -0
- package/resources/codex-and-agents-customizations/.codex/hooks/validate-bash.ps1 +164 -51
- package/resources/codex-and-agents-customizations/.codex/hooks/validate-codex-subagent-routing.ps1 +154 -0
- package/resources/codex-and-agents-customizations/.codex/hooks/validate-feature-review-coverage.ps1 +58 -23
- package/resources/codex-and-agents-customizations/AGENTS.md +27 -0
- package/resources/codex-and-agents-customizations/pack-manifests/core.json +66 -1
- package/resources/codex-and-agents-customizations/pack-manifests/csharp-legacy.json +6 -1
- package/resources/codex-and-agents-customizations/pack-manifests/csharp-modern.json +6 -1
- package/resources/codex-and-agents-customizations/pack-manifests/powershell.json +6 -1
- package/resources/codex-and-agents-customizations/pack-manifests/python.json +6 -1
- package/resources/codex-and-agents-customizations/pack-manifests/typescript.json +6 -1
- package/resources/config/orchestration-routing.json +167 -0
- package/resources/powershell/PoshQC/PoshQC.Analyzer.psm1 +1 -1
- package/resources/powershell/PoshQC/PoshQC.ScanConfig.psm1 +125 -0
- package/resources/powershell/PoshQC/PoshQC.Testing.psm1 +14 -2
- package/resources/powershell/PoshQC/PoshQC.psd1 +0 -4
- package/resources/powershell/PoshQC/PoshQC.psm1 +26 -6
- package/resources/powershell/PoshQC/settings/pester.runsettings.psd1 +34 -18
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: epic-run
|
|
3
|
+
description: Execute a previously planned epic by replaying the committed epic-kickoff artifact through the epic-orchestrator agent. Use after /epic-plan has prepared the epic (issues, folders, research, specs, atomic plans, preflight clearance) and the user is ready to execute end-to-end.
|
|
4
|
+
argument-hint: "[epic-slug]"
|
|
5
|
+
context: fork
|
|
6
|
+
agent: epic-orchestrator
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Epic Run Skill
|
|
10
|
+
|
|
11
|
+
A user invocation (`/epic-run <epic-slug>`) forks the `epic-orchestrator` agent to execute an
|
|
12
|
+
epic that `epic-planner` has already prepared. The epic slug (or a path under
|
|
13
|
+
`docs/features/epics/`) for this run is:
|
|
14
|
+
|
|
15
|
+
$ARGUMENTS
|
|
16
|
+
|
|
17
|
+
## Procedure
|
|
18
|
+
|
|
19
|
+
1. Resolve the epic home. A bare slug resolves to `docs/features/epics/<epic-slug>/`; a path
|
|
20
|
+
argument resolves to its containing epic folder.
|
|
21
|
+
2. Read the committed kickoff artifact at `docs/features/epics/<epic-slug>/epic-kickoff.md`.
|
|
22
|
+
- If the file does not exist, STOP without delegating anything and report that the epic has
|
|
23
|
+
no committed kickoff artifact: the user must run `/epic-plan` first (or, for an epic that
|
|
24
|
+
was authored manually, invoke `/epic-orchestrate <epic-manifest-path>` directly).
|
|
25
|
+
3. Execute the kickoff artifact's `## Invocation Prompt` section as the epic objective, applying
|
|
26
|
+
the `epic-orchestrate` skill procedure and the `## Prepared-Epic Execution (epic-planner
|
|
27
|
+
Handoff)` section of `.claude/agents/epic-orchestrator.md`: reuse the existing integration
|
|
28
|
+
branch, and have each child `Agent(orchestrator)` delegation resume at atomic execution from
|
|
29
|
+
its committed `plan-path` rather than re-running promotion, research, or planning.
|
|
30
|
+
4. Honor existing checkpoint state: if `artifacts/orchestration/epic-orchestrator-state.json`
|
|
31
|
+
already tracks this epic, resume per the `epic-orchestrate` skill's resume procedure instead
|
|
32
|
+
of restarting.
|
|
33
|
+
|
|
34
|
+
## Scope
|
|
35
|
+
|
|
36
|
+
This skill adds no procedure of its own beyond kickoff-artifact resolution; wave scheduling,
|
|
37
|
+
the wave barrier, merge-on-green fan-in, worktree cleanup, `epic-status.md` maintenance, and
|
|
38
|
+
the final integration-to-`main` PR are governed entirely by the `epic-orchestrate` skill.
|
|
@@ -6,7 +6,17 @@ argument-hint: "[objective]"
|
|
|
6
6
|
|
|
7
7
|
# Orchestrate Skill
|
|
8
8
|
|
|
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.
|
|
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. Orchestration deliberately stays in the main session on user invocation (`/orchestrate <objective>`); the same procedure governs a delegated `Agent(orchestrator)` run from `epic-planner` or `epic-orchestrator`.
|
|
10
|
+
|
|
11
|
+
## Invocation Argument
|
|
12
|
+
|
|
13
|
+
When invoked as `/orchestrate`, the orchestration objective is:
|
|
14
|
+
|
|
15
|
+
$ARGUMENTS
|
|
16
|
+
|
|
17
|
+
A delegated `Agent(orchestrator)` run receives its objective in the delegation prompt instead.
|
|
18
|
+
|
|
19
|
+
Perform the scale assessment first: if the objective is epic-scale (names an epic manifest or requires multiple independently mergeable features), stop before any delegation and direct the user to `/epic-plan` (planning) or `/epic-run` (executing a prepared epic), per `## Change Budget Routing` in `.claude/agents/orchestrator.md`.
|
|
10
20
|
|
|
11
21
|
## Prerequisites
|
|
12
22
|
|
|
@@ -77,9 +87,18 @@ After reading `artifacts/orchestration/orchestrator-state.json`, the main sessio
|
|
|
77
87
|
|
|
78
88
|
The orchestrator does not perform deep implementation itself. It coordinates, tracks state, and enforces completion.
|
|
79
89
|
|
|
90
|
+
## Preparation Mode
|
|
91
|
+
|
|
92
|
+
A delegation prompt carrying the literal marker `Preparation mode: true` (issued by `epic-planner` per the `.claude/skills/epic-plan/SKILL.md` kickoff line) scopes the run to planning only:
|
|
93
|
+
|
|
94
|
+
- **Route.** Select `route_id: preparation`. The route's routing-matrix entry requires receipts for `task-researcher`, `prd-feature`, `atomic-planner`, and `atomic-executor`; the skills `orchestrate`, `feature-promotion-lifecycle`, and `atomic-plan-contract`; and the promotion plus validator MCP tools.
|
|
95
|
+
- **Scope.** Run promotion (MCP surface), research, feature documents (`spec.md`, `user-story.md`), atomic planning, and the atomic-executor preflight (precondition validation only, R2 semantics: iterate plan revisions until `PREFLIGHT: ALL CLEAR`). Atomic execution, PR authoring, CI monitoring, and feature review are out of scope and are executed later by `epic-orchestrator`.
|
|
96
|
+
- **Terminal checkpoint.** Stop with `completed_steps` containing `S3_promotion` and `S4_atomic_planning`, `next_step: "S5_atomic_execution"`, out-of-scope step statuses set to `not-applicable`, and `blocked_reason: "none"`. Do NOT assert completion (`next_step: "complete"`, `S12_complete`, or a `completed` step8/9/10 status): the run has no PR or CI evidence, and the route's `requires_ci_gate: false` exempts it from `ci_gate` at the completion validator instead.
|
|
97
|
+
- **Commit.** Commit the prepared feature folder and plan to the current branch (the worktree branch created off the epic integration branch) before stopping, and report the `plan-path` and preflight status in the final output.
|
|
98
|
+
|
|
80
99
|
## Model Selection
|
|
81
100
|
|
|
82
|
-
Model selection is a second axis, strictly separate from `route`. `route` (`small | large | remediation | epic`) is deterministic
|
|
101
|
+
Model selection is a second axis, strictly separate from `route`. `route` (`small | large | remediation | preparation | epic`) is deterministic — file-count driven for `small`/`large`, marker-driven for `preparation` (the `Preparation mode: true` kickoff line) and `epic`; it governs `required_agents`, `required_skills`, and `required_mcp_tools` only. `route` is NOT an input to model selection anywhere. The sole feature-level input to the delegation model tier is a judgment-based `complexity_band` (`C1 | C2 | C3 | C4`). The authoritative values live in the `model_policy` block of `config/orchestration-routing.json`.
|
|
83
102
|
|
|
84
103
|
The two canonical, tested reference implementations express the formulas the orchestrator applies by judgment:
|
|
85
104
|
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
".claude/agents/atomic-planner.md",
|
|
8
8
|
".claude/agents/commit-message.md",
|
|
9
9
|
".claude/agents/epic-orchestrator.md",
|
|
10
|
+
".claude/agents/epic-planner.md",
|
|
10
11
|
".claude/agents/epic-review.md",
|
|
11
12
|
".claude/agents/feature-review.md",
|
|
12
13
|
".claude/agents/human-exception-runbook.md",
|
|
@@ -17,6 +18,7 @@
|
|
|
17
18
|
".claude/agents/task-researcher.md",
|
|
18
19
|
".claude/hooks/enforce-checkpoint-monotonic.ps1",
|
|
19
20
|
".claude/hooks/enforce-completion-consistency.ps1",
|
|
21
|
+
".claude/hooks/enforce-epic-invocation-origin.ps1",
|
|
20
22
|
".claude/hooks/enforce-epic-merge-gate.ps1",
|
|
21
23
|
".claude/hooks/enforce-epic-wave-barrier.ps1",
|
|
22
24
|
".claude/hooks/enforce-epic-worktree-removal-gate.ps1",
|
|
@@ -49,6 +51,8 @@
|
|
|
49
51
|
".claude/skills/atomic-plan-contract/SKILL.md",
|
|
50
52
|
".claude/skills/commit-message/SKILL.md",
|
|
51
53
|
".claude/skills/epic-orchestrate/SKILL.md",
|
|
54
|
+
".claude/skills/epic-plan/SKILL.md",
|
|
55
|
+
".claude/skills/epic-run/SKILL.md",
|
|
52
56
|
".claude/skills/evidence-and-timestamp-conventions/SKILL.md",
|
|
53
57
|
".claude/skills/execute-hard-lock/SKILL.md",
|
|
54
58
|
".claude/skills/feature-promotion-lifecycle/SKILL.md",
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: codex-model-routing
|
|
3
|
+
description: Resolve and validate the deterministic Codex topology plus the exact deployment agent, model slug, and reasoning effort. Use before spawning routed Codex workers, when scope or an orchestration ceiling changes, when resuming a delegating checkpoint, or when validating Codex topology and model receipts.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Codex Model Routing
|
|
7
|
+
|
|
8
|
+
Keep model selection independent from the production-file-count route. File count
|
|
9
|
+
selects the engineer/orchestrator topology; this skill selects the exact deployed
|
|
10
|
+
agent profile.
|
|
11
|
+
|
|
12
|
+
## Resolve topology first
|
|
13
|
+
|
|
14
|
+
1. Record the implementation languages, estimated production and test file counts,
|
|
15
|
+
execution context, and any cross-cutting marker.
|
|
16
|
+
2. Run the canonical topology resolver before choosing a logical agent:
|
|
17
|
+
|
|
18
|
+
```powershell
|
|
19
|
+
poetry run python -m scripts.dev_tools.resolve_codex_topology `
|
|
20
|
+
--language <python|powershell|csharp|typescript> `
|
|
21
|
+
--production-file-count <count> `
|
|
22
|
+
--test-file-count <count> `
|
|
23
|
+
--execution-context <context>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Add `--cross-cutting` when that route marker applies. Root epic entry instead
|
|
27
|
+
supplies `--root-persona epic-planner` or `--root-persona epic-orchestrator`.
|
|
28
|
+
3. Persist the returned object in `codex_topology_receipts[]` with a non-empty
|
|
29
|
+
`phase` before delegation.
|
|
30
|
+
4. Use the returned `logical_agent` as the input to the model resolver below.
|
|
31
|
+
Do not replace a small typed-engineer result with an orchestrator, or an
|
|
32
|
+
orchestrator result with a typed engineer.
|
|
33
|
+
|
|
34
|
+
Production-file count alone selects the small versus large topology: Python and
|
|
35
|
+
C# allow up to 3 production files, and PowerShell allows up to 2. The recorded
|
|
36
|
+
test-file caps govern typed-engineer execution batches without changing topology.
|
|
37
|
+
TypeScript has no canonical direct-mode budget and therefore fails closed to the
|
|
38
|
+
large orchestrator topology. Epic children always use the orchestrator topology;
|
|
39
|
+
epic root personas are forced independently of file count.
|
|
40
|
+
|
|
41
|
+
## Resolve a deployment
|
|
42
|
+
|
|
43
|
+
1. Read `config/orchestration-routing.json` and use its
|
|
44
|
+
`codex_model_policy` block without substituting aliases.
|
|
45
|
+
2. Assess `complexity_band` (`C1`-`C4`) using the shared complexity scale and
|
|
46
|
+
deterministic floor signals. C4 remains judgment-only.
|
|
47
|
+
3. Record `execution_context` as one of `standalone`,
|
|
48
|
+
`epic_preparation_child`, or `epic_execution_child`.
|
|
49
|
+
4. Record the monotonic `orchestration_complexity_ceiling`. It may increase as
|
|
50
|
+
scope is discovered, but it must not decrease during the run. When it rises,
|
|
51
|
+
add `ceiling_transition` with exact `from`, `to`, and the non-empty unique
|
|
52
|
+
`affected_delegation_ids` that must be re-resolved under the higher ceiling.
|
|
53
|
+
5. Run the canonical resolver:
|
|
54
|
+
|
|
55
|
+
```powershell
|
|
56
|
+
poetry run python -m scripts.dev_tools.resolve_codex_deployment `
|
|
57
|
+
--logical-agent <agent> `
|
|
58
|
+
--complexity-band <C1|C2|C3|C4> `
|
|
59
|
+
--execution-context <context> `
|
|
60
|
+
--orchestration-complexity-ceiling <C1|C2|C3|C4>
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
6. Persist the returned object in `codex_model_routing_receipts[]` with a
|
|
64
|
+
non-empty `phase` before spawning the returned `deployment_agent`.
|
|
65
|
+
7. Spawn the generated agent profile. Do not spawn the base alias and claim that
|
|
66
|
+
a different model was selected.
|
|
67
|
+
|
|
68
|
+
The route name `feature-review` resolves to the native
|
|
69
|
+
`feature-reviewer-<profile>` agent family; retain `feature-review` as the
|
|
70
|
+
receipt's logical agent name.
|
|
71
|
+
|
|
72
|
+
## Fixed routing outcomes
|
|
73
|
+
|
|
74
|
+
- C1: `gpt-5.6-luna`, low reasoning.
|
|
75
|
+
- C2: `gpt-5.6-terra`, medium reasoning.
|
|
76
|
+
- C3 standalone with a C3 ceiling: `gpt-5.6-terra`, high reasoning.
|
|
77
|
+
- C3 in either epic-child context, or C3 under a C4 ceiling:
|
|
78
|
+
`gpt-5.6-sol`, high reasoning through the `-c3-elevated` profile.
|
|
79
|
+
- C4: `gpt-5.6-sol`, max reasoning.
|
|
80
|
+
- `epic-planner` and `epic-orchestrator`: always `gpt-5.6-sol`, ultra
|
|
81
|
+
reasoning.
|
|
82
|
+
|
|
83
|
+
If the exact model is unavailable, record `model_unavailable`, leave the work
|
|
84
|
+
incomplete, and request a policy change. Do not silently fall back.
|
|
85
|
+
|
|
86
|
+
## Validation
|
|
87
|
+
|
|
88
|
+
Before accepting delegated results or reporting completion, validate the
|
|
89
|
+
checkpoint with the Codex routing gate:
|
|
90
|
+
|
|
91
|
+
```powershell
|
|
92
|
+
poetry run python -m scripts.dev_tools.validate_orchestration_artifacts `
|
|
93
|
+
orchestrator-state artifacts/orchestration/orchestrator-state.json `
|
|
94
|
+
--require-codex-topology `
|
|
95
|
+
--require-codex-model-routing
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
For epic execution use `epic-orchestrator-state` with the same flag. The MCP
|
|
99
|
+
`validate_orchestration_artifacts` surface is the authoritative completion gate
|
|
100
|
+
when available.
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: epic-orchestrate
|
|
3
|
+
description: Execute a manually authored multi-feature epic through deterministic waves, isolated worktrees, integration-branch fan-in, and a final integration PR.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Epic Orchestrate Skill
|
|
7
|
+
|
|
8
|
+
Use this manual-manifest compatibility entry only from the root session. The root session must
|
|
9
|
+
delegate the supplied manifest or slug to the project custom agent `epic-orchestrator`; an
|
|
10
|
+
ordinary `orchestrator` is prohibited from doing so. A committed planner kickoff is optional for
|
|
11
|
+
this entry path.
|
|
12
|
+
|
|
13
|
+
Use the epic manifest path or slug supplied in the invoking user request.
|
|
14
|
+
|
|
15
|
+
## Prerequisites
|
|
16
|
+
|
|
17
|
+
Read `AGENTS.md`, applicable language policies, `config/orchestration-routing.json`, and any
|
|
18
|
+
existing `artifacts/orchestration/epic-orchestrator-state.json` checkpoint before acting.
|
|
19
|
+
|
|
20
|
+
## Manifest Contract
|
|
21
|
+
|
|
22
|
+
The source of truth is `docs/features/epics/<epic-slug>/epic.md`. Its YAML frontmatter is:
|
|
23
|
+
|
|
24
|
+
```yaml
|
|
25
|
+
---
|
|
26
|
+
epic: <epic-slug>
|
|
27
|
+
integration_branch: epic/<epic-slug>-integration
|
|
28
|
+
created_at: <iso8601>
|
|
29
|
+
intent: # optional as a whole
|
|
30
|
+
epic_type: <business | enabler>
|
|
31
|
+
business_outcome_hypothesis: <non-empty measurable outcome>
|
|
32
|
+
leading_indicators: [<string>, ...]
|
|
33
|
+
nfrs: [<string>, ...]
|
|
34
|
+
features:
|
|
35
|
+
- issue_num: <int>
|
|
36
|
+
feature_folder: <resolvable-hint-basename>
|
|
37
|
+
depends_on: [<upstream-issue_num>, ...]
|
|
38
|
+
---
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
`issue_num` is the stable primary key. `feature_folder` is a resolvable hint under `active/` or
|
|
42
|
+
`completed/`. Every dependency must resolve against the union of issue numbers and legacy folder
|
|
43
|
+
basenames. Reject duplicate folders, unresolved dependencies, malformed optional intent, and
|
|
44
|
+
cycles before kickoff.
|
|
45
|
+
|
|
46
|
+
## Wave Computation
|
|
47
|
+
|
|
48
|
+
Use longest-path layering:
|
|
49
|
+
|
|
50
|
+
```text
|
|
51
|
+
wave(f) = 0 when depends_on(f) is empty
|
|
52
|
+
wave(f) = 1 + max(wave(d) for d in depends_on(f)) otherwise
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Use `scripts/dev_tools/epic_wave_computation.py` as the tested reference. Serialize features
|
|
56
|
+
within each wave lexicographically by folder, without changing wave membership.
|
|
57
|
+
|
|
58
|
+
## Entry Paths
|
|
59
|
+
|
|
60
|
+
- Prepared path (`epic-run`): require and validate `epic-kickoff.md`, reuse the recorded
|
|
61
|
+
integration branch, and resume each child at atomic execution.
|
|
62
|
+
- Manual path (`epic-orchestrate`): validate the manifest and create the integration branch when
|
|
63
|
+
absent. A kickoff artifact is not required.
|
|
64
|
+
|
|
65
|
+
## Integration Branch and Child Worktrees
|
|
66
|
+
|
|
67
|
+
Create a missing integration branch from current `origin/main` and push it. Before each wave,
|
|
68
|
+
fetch the current remote integration tip. Create every child worktree from that tip, never from
|
|
69
|
+
`main`, and set each feature PR base explicitly to the integration branch.
|
|
70
|
+
|
|
71
|
+
Launch all ready children in one bounded parallel wave. Before each launch, persist the
|
|
72
|
+
epic-child topology receipt, reviewed complexity assessment, delegation receipt, and Codex
|
|
73
|
+
model-routing receipt with the same `delegation_id`, then select the generated deployment agent.
|
|
74
|
+
C3 epic children use the elevated Sol/High profile. The child prompt contains:
|
|
75
|
+
|
|
76
|
+
> `Epic mode: true. epic_feature_folder: <epic-slug>. integration_branch: epic/<epic-slug>-integration. epic_checkpoint_path: artifacts/orchestration/epic-orchestrator-state.json. PR base branch MUST be <integration_branch>, not main; pass --base <integration_branch> to gh pr create.`
|
|
77
|
+
|
|
78
|
+
For prepared epics, also provide the committed `plan-path` and state that the child resumes at
|
|
79
|
+
atomic execution. For each dependency, include its concrete spec, plan, PR, merge SHA, and target
|
|
80
|
+
branch as upstream context.
|
|
81
|
+
|
|
82
|
+
Do not use native `spawn_agent` for worktree children. For each wave, write an immutable launch
|
|
83
|
+
specification under `artifacts/orchestration/epic-child-launches/<wave-id>/` and invoke
|
|
84
|
+
`.codex/scripts/launch-epic-child-wave.ps1` with `checkpoint_kind: "epic-orchestrator"`, the
|
|
85
|
+
current wave number, checkpoint path, integration branch, `max_parallel_features`, and exact
|
|
86
|
+
generated profile values for every child. Monitor the durable wave status and record each child
|
|
87
|
+
launch receipt/status path. A missing session id, nonzero exit, receipt mismatch, or incomplete
|
|
88
|
+
wave status blocks the wave barrier.
|
|
89
|
+
|
|
90
|
+
The JSON specification requires `schema_version: 1`, `wave_id`, `checkpoint_kind`,
|
|
91
|
+
`checkpoint_path`, `integration_branch`, `wave_number`, `max_parallel_features`, and `launches`.
|
|
92
|
+
Each launch requires `launch_id`, `delegation_id`, `feature_folder`, positive `issue_num`,
|
|
93
|
+
`deployment_agent`, `model`, `model_reasoning_effort`, `permissions`,
|
|
94
|
+
`execution_context: "epic_execution_child"`, canonical absolute `worktree_path`, `branch_name`,
|
|
95
|
+
and the exact prompt. Invoke it as:
|
|
96
|
+
|
|
97
|
+
```powershell
|
|
98
|
+
pwsh -NoProfile -File .codex/scripts/launch-epic-child-wave.ps1 -LaunchSpecPath <spec-path> -MaxParallel <max_parallel_features>
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Parse the returned JSON `status_path`. The status file is shared by the wave; every child has its
|
|
102
|
+
own immutable receipt but references the same `wave.<wave_id>.status.json`.
|
|
103
|
+
|
|
104
|
+
## Wave Barrier
|
|
105
|
+
|
|
106
|
+
Do not start wave N+1 until every dependency edge is durably `merged` or `worktree_removed`.
|
|
107
|
+
Reconcile this state using Git worktrees, branches, and live PR state on resume. The Codex
|
|
108
|
+
mutation hook is a per-child deterrent; the epic-state validator is the retrospective,
|
|
109
|
+
authoritative backstop.
|
|
110
|
+
|
|
111
|
+
## Fan-In and Conflict Handling
|
|
112
|
+
|
|
113
|
+
Each child owns its implementation, review, PR, CI-green gate, and merge into the integration
|
|
114
|
+
branch. A merge conflict enters that child's existing remediation loop with a blocking
|
|
115
|
+
`remediation-inputs.<timestamp>.md`. After three unresolved passes, record
|
|
116
|
+
`blocked_conflict_loop_limit` and stop that edge. The epic agent must not resolve child conflicts
|
|
117
|
+
locally.
|
|
118
|
+
|
|
119
|
+
## Worktree Cleanup
|
|
120
|
+
|
|
121
|
+
After the child merge SHA is recorded and the epic checkpoint mirrors `merge_status: "merged"`,
|
|
122
|
+
remove its worktree. The worktree-removal hook denies removal before the matching feature is
|
|
123
|
+
`merged` or `worktree_removed`. Record `worktree_removed_at` after success.
|
|
124
|
+
|
|
125
|
+
## Model and Deployment Policy
|
|
126
|
+
|
|
127
|
+
Route selection and model selection are independent. The deterministic file-count or marker
|
|
128
|
+
route selects topology; the C1-C4 assessment selects a checked-in Codex deployment profile.
|
|
129
|
+
|
|
130
|
+
- C1: `gpt-5.6-luna`, low.
|
|
131
|
+
- C2: `gpt-5.6-terra`, medium.
|
|
132
|
+
- standalone C3 with ceiling C3: `gpt-5.6-terra`, high.
|
|
133
|
+
- epic C3 or C3 with a C4 sibling: `gpt-5.6-sol`, high.
|
|
134
|
+
- C4: `gpt-5.6-sol`, max.
|
|
135
|
+
- `epic-orchestrator`: `gpt-5.6-sol`, ultra.
|
|
136
|
+
|
|
137
|
+
Persist the topology and model-routing receipts before every child or `pr-author` delegation. The
|
|
138
|
+
deployed agent type and actual model must match its receipts and start attestation. If the
|
|
139
|
+
required profile is unavailable, record `model_unavailable` and stop; do not fall back silently.
|
|
140
|
+
|
|
141
|
+
## Status Projection and Checkpoint
|
|
142
|
+
|
|
143
|
+
Regenerate `docs/features/epics/<epic-slug>/epic-status.md` from the checkpoint at kickoff, each
|
|
144
|
+
merge-status transition, each wave transition, and each final-PR transition. Never treat the
|
|
145
|
+
status document as the DAG source.
|
|
146
|
+
|
|
147
|
+
Persist `artifacts/orchestration/epic-orchestrator-state.json` with `objective`, `route_id:
|
|
148
|
+
"epic"`, epic folder/manifest/status paths, integration branch, completed and next steps,
|
|
149
|
+
timestamps, bounded `max_parallel_features`, current wave, waves, features and lifecycle
|
|
150
|
+
timestamps, final PR, complexity/model receipts, and required agent/skill/MCP receipts. Each
|
|
151
|
+
launched feature records issue/folder, unique branch/worktree, delegation receipt/id,
|
|
152
|
+
delegation-bound model receipt, and launch receipt/status paths.
|
|
153
|
+
|
|
154
|
+
On resume, reconcile the checkpoint against `git worktree list --porcelain`, branch state, and
|
|
155
|
+
`gh pr view --json state,mergedAt,headRefOid` before continuing.
|
|
156
|
+
|
|
157
|
+
## Final Integration PR
|
|
158
|
+
|
|
159
|
+
After every child is merged or its worktree removed, delegate final PR authoring to the routed
|
|
160
|
+
`pr-author` profile, refresh PR context through the MCP surface, run the CI-green procedure,
|
|
161
|
+
record the current head SHA and successful conclusion, and merge the integration branch to
|
|
162
|
+
`main` only through the merge gate.
|
|
163
|
+
|
|
164
|
+
## Completion
|
|
165
|
+
|
|
166
|
+
Do not report completion until every feature is `merged` or `worktree_removed`, the final PR is
|
|
167
|
+
merged with its merge SHA recorded, `epic-status.md` reflects that state, acceptance criteria are
|
|
168
|
+
checked, and the MCP validator passes `epic-orchestrator-state` with `require_complete: true`.
|
|
169
|
+
Require both `require_codex_topology: true` and `require_codex_model_routing: true` on that final
|
|
170
|
+
validation call.
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: epic-plan
|
|
3
|
+
description: Scope and prepare a multi-feature epic end-to-end before execution through the Codex epic-planner agent.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Epic Plan Skill
|
|
7
|
+
|
|
8
|
+
Use this skill only from the root session. The root session must delegate the supplied objective
|
|
9
|
+
to the project custom agent `epic-planner`; it must not execute this procedure locally or route it
|
|
10
|
+
through `orchestrator`. The root-invocation hook records the authorization receipt consumed when
|
|
11
|
+
`epic-planner` starts.
|
|
12
|
+
|
|
13
|
+
Use the objective or existing manifest path supplied in the invoking user request.
|
|
14
|
+
|
|
15
|
+
Planning ends after every child feature has completed promotion, research, feature documents,
|
|
16
|
+
atomic planning, and preflight clearance. Atomic execution, PR authoring, feature execution
|
|
17
|
+
review, and CI monitoring are not part of this skill.
|
|
18
|
+
|
|
19
|
+
## Prerequisites
|
|
20
|
+
|
|
21
|
+
Before proceeding, `epic-planner` must read `AGENTS.md`, the applicable language policies under
|
|
22
|
+
`.agents/skills/`, `config/orchestration-routing.json`, and any existing
|
|
23
|
+
`artifacts/orchestration/epic-planner-state.json` checkpoint.
|
|
24
|
+
|
|
25
|
+
## Epic-Worthiness Gate
|
|
26
|
+
|
|
27
|
+
The objective warrants an epic only when both conditions hold:
|
|
28
|
+
|
|
29
|
+
1. It decomposes into at least two independently mergeable child features, each with its own
|
|
30
|
+
issue, active feature folder, and eventual PR.
|
|
31
|
+
2. At least one child exceeds, or the combined work clearly exceeds, one practical large-path
|
|
32
|
+
feature budget.
|
|
33
|
+
|
|
34
|
+
When either condition fails, record `epic_worthiness.verdict: "non_epic"`, state the feature-count
|
|
35
|
+
and change-budget rationale, and offer a single root-session `orchestrator` delegation. Do not
|
|
36
|
+
create epic scaffolding unless the user explicitly overrides the verdict.
|
|
37
|
+
|
|
38
|
+
## Decomposition and Wave Design
|
|
39
|
+
|
|
40
|
+
For an epic-worthy objective:
|
|
41
|
+
|
|
42
|
+
1. Define `docs/features/epics/<epic-slug>/` and author `epic.md` using the manifest schema in
|
|
43
|
+
`epic-orchestrate`.
|
|
44
|
+
2. Record goal, scope, non-goals, shared design, acceptance criteria, decomposition rationale,
|
|
45
|
+
production-file estimates, and integration risks.
|
|
46
|
+
3. Add `depends_on` edges only for real upstream contracts.
|
|
47
|
+
4. Compute execution waves with the longest-path formula in
|
|
48
|
+
`scripts/dev_tools/epic_wave_computation.py`; unresolved references and cycles block
|
|
49
|
+
preparation.
|
|
50
|
+
5. Assess each child as C1-C4 using the central policy. Record the assessed band, rationale,
|
|
51
|
+
deployment agent, model, reasoning effort, and the monotonic orchestration complexity ceiling.
|
|
52
|
+
6. Set `max_parallel_features` to an integer from 1 through 8. Use the routing-policy default of
|
|
53
|
+
4 unless repository or user constraints require a lower value.
|
|
54
|
+
|
|
55
|
+
Child issue numbers may be placeholders only while the draft manifest is being decomposed.
|
|
56
|
+
Before creating child worktrees, promote every child through the worktree-aware MCP lifecycle,
|
|
57
|
+
backfill the final positive `issue_num` and active `feature_folder`, commit and push that resolved
|
|
58
|
+
manifest, and persist the promotion receipts. Launch specifications and their immutable receipts
|
|
59
|
+
must never use placeholders.
|
|
60
|
+
|
|
61
|
+
## Integration Branch
|
|
62
|
+
|
|
63
|
+
Create or reuse `epic/<epic-slug>-integration` from `origin/main`, push it, and commit the epic
|
|
64
|
+
home before preparation. All prepared child outputs must fan into this branch.
|
|
65
|
+
|
|
66
|
+
## Concurrent Preparation
|
|
67
|
+
|
|
68
|
+
Place all child preparations in one preparation batch, regardless of execution-wave
|
|
69
|
+
dependencies. Each child runs in an isolated worktree branched from the current
|
|
70
|
+
`origin/epic/<epic-slug>-integration` tip. Dependency context is supplied for planning, but it
|
|
71
|
+
does not serialize preparation. The batch launcher enforces `max_parallel_features`; excess
|
|
72
|
+
children remain queued in the same batch rather than being divided by execution wave.
|
|
73
|
+
|
|
74
|
+
Before each child starts, persist its epic-child topology receipt, complexity assessment,
|
|
75
|
+
delegation receipt, and Codex model-routing receipt. The model receipt must carry the same
|
|
76
|
+
`delegation_id` as the delegation receipt.
|
|
77
|
+
|
|
78
|
+
Do not use native `spawn_agent` for a worktree child because that API does not bind the child to
|
|
79
|
+
the prepared worktree. Write one immutable launch specification under
|
|
80
|
+
`artifacts/orchestration/epic-child-launches/<batch-id>/` and invoke
|
|
81
|
+
`.codex/scripts/launch-epic-child-wave.ps1`. Use `checkpoint_kind: "epic-planner"`,
|
|
82
|
+
`wave_number: 0`, the planner checkpoint path, integration branch, bounded maximum, and one
|
|
83
|
+
launch record per child. Every record supplies the unique launch/delegation ids, prepared
|
|
84
|
+
worktree and branch, generated `orchestrator-cN` profile, exact model/reasoning/permissions, and
|
|
85
|
+
prompt. C3 epic children use the elevated Sol/High profile. Monitor the returned durable status
|
|
86
|
+
path; a nonzero child exit or missing completion status blocks fan-in.
|
|
87
|
+
|
|
88
|
+
The launch specification schema is:
|
|
89
|
+
|
|
90
|
+
```json
|
|
91
|
+
{
|
|
92
|
+
"schema_version": 1,
|
|
93
|
+
"wave_id": "<safe-preparation-batch-id>",
|
|
94
|
+
"checkpoint_kind": "epic-planner",
|
|
95
|
+
"checkpoint_path": "artifacts/orchestration/epic-planner-state.json",
|
|
96
|
+
"integration_branch": "epic/<epic-slug>-integration",
|
|
97
|
+
"wave_number": 0,
|
|
98
|
+
"max_parallel_features": 4,
|
|
99
|
+
"launches": [
|
|
100
|
+
{
|
|
101
|
+
"launch_id": "<unique-id>",
|
|
102
|
+
"delegation_id": "<unique-id>",
|
|
103
|
+
"feature_folder": "<final-active-feature-folder>",
|
|
104
|
+
"issue_num": 123,
|
|
105
|
+
"deployment_agent": "orchestrator-c3-elevated",
|
|
106
|
+
"model": "gpt-5.6-sol",
|
|
107
|
+
"model_reasoning_effort": "high",
|
|
108
|
+
"permissions": "orchestrator-workspace",
|
|
109
|
+
"execution_context": "epic_preparation_child",
|
|
110
|
+
"worktree_path": "<canonical-absolute-path>",
|
|
111
|
+
"branch_name": "<child-preparation-branch>",
|
|
112
|
+
"prompt": "<preparation prompt>"
|
|
113
|
+
}
|
|
114
|
+
]
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Write it under `artifacts/orchestration/epic-child-launches/<batch-id>/`, then run:
|
|
119
|
+
|
|
120
|
+
```powershell
|
|
121
|
+
pwsh -NoProfile -File .codex/scripts/launch-epic-child-wave.ps1 -LaunchSpecPath <spec-path> -MaxParallel <max_parallel_features>
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Parse the returned JSON and persist its shared `status_path`. Every worktree must be a clean Git
|
|
125
|
+
worktree of this repository on the checkpoint branch. Its committed `.codex/`, `.agents/`,
|
|
126
|
+
`AGENTS.md`, routing configuration, and selected profile must match the trusted integration
|
|
127
|
+
source; the launcher rejects drift before starting Codex.
|
|
128
|
+
|
|
129
|
+
Every child prompt must contain this literal line:
|
|
130
|
+
|
|
131
|
+
> `Preparation mode: true. route_id: preparation. epic_feature_folder: <epic-slug>. integration_branch: epic/<epic-slug>-integration. Reuse and verify the completed promotion receipt, then perform research, feature documents (issue.md, spec.md, user-story.md), atomic planning, and preflight clearance only. Atomic execution, PR authoring, and CI monitoring are out of scope for this run and are executed later by epic-orchestrator. After the atomic-executor preflight returns PREFLIGHT: ALL CLEAR, commit the feature folder and plan to the current branch, set out-of-scope step statuses to not-applicable, set next_step to S5_atomic_execution, and stop, reporting research_path, plan-path, preflight_evidence_path, and the exact preflight status.`
|
|
132
|
+
|
|
133
|
+
The line intentionally omits `Epic mode: true`. For dependent children, also cite the upstream
|
|
134
|
+
manifest scope, specification, and planned contract.
|
|
135
|
+
|
|
136
|
+
## Preparation Route Contract
|
|
137
|
+
|
|
138
|
+
Each child selects the exact `preparation` route from the central routing configuration:
|
|
139
|
+
|
|
140
|
+
- required agents, in configured order: `task-researcher`, `prd-feature`, `atomic-planner`,
|
|
141
|
+
`atomic-executor`;
|
|
142
|
+
- required skills: `orchestrate`, `feature-promotion-lifecycle`, `atomic-plan-contract`;
|
|
143
|
+
- required MCP operations: `new_potential_entry`, `potential_to_issue`,
|
|
144
|
+
`new_active_feature_folder`, `validate_orchestration_artifacts`;
|
|
145
|
+
- mandatory completed phases: `S3_promotion`, `S4_atomic_planning`;
|
|
146
|
+
- terminal `next_step`: `S5_atomic_execution`;
|
|
147
|
+
- execution-through-CI statuses: `not-applicable`;
|
|
148
|
+
- `blocked_reason`: `none`;
|
|
149
|
+
- `requires_ci_gate`: the literal JSON Boolean `false`.
|
|
150
|
+
|
|
151
|
+
Promotion must use worktree-aware MCP calls and receipts. A child must not claim feature
|
|
152
|
+
completion, create a PR, execute the atomic plan, or monitor CI.
|
|
153
|
+
|
|
154
|
+
## Fan-In
|
|
155
|
+
|
|
156
|
+
As each preparation finishes:
|
|
157
|
+
|
|
158
|
+
1. Merge the child preparation branch into the integration branch.
|
|
159
|
+
2. Treat any conflict as a decomposition defect: abort fan-in, record blocked state, and do not
|
|
160
|
+
resolve the conflict ad hoc.
|
|
161
|
+
3. Backfill `issue_num` and `feature_folder` in `epic.md`.
|
|
162
|
+
4. Record `preparation_status: "prepared"`, `research_path`, `plan_path`,
|
|
163
|
+
`preflight_evidence_path`, and `preflight_status: "PREFLIGHT: ALL CLEAR"` in the planner
|
|
164
|
+
checkpoint. `research_path` must be under `artifacts/research/` or inside the feature folder.
|
|
165
|
+
Each child references its immutable receipt and the shared `wave.<wave_id>.status.json` path.
|
|
166
|
+
5. Remove the worktree only after its preparation branch is merged.
|
|
167
|
+
|
|
168
|
+
Push the integration branch after final fan-in.
|
|
169
|
+
|
|
170
|
+
There is no mid-planning approval pause. The planner completes promotion, research, feature
|
|
171
|
+
documents, atomic planning, and preflight before stopping at the user execution boundary.
|
|
172
|
+
|
|
173
|
+
## Execution-Readiness Gate
|
|
174
|
+
|
|
175
|
+
Do not emit a kickoff until the manifest is valid, the checkpoint has a forced `epic-planner`
|
|
176
|
+
topology receipt, and every child has a promoted issue, active folder, `issue.md`, research,
|
|
177
|
+
`spec.md`, `user-story.md`, approved atomic plan, epic-preparation topology receipt,
|
|
178
|
+
delegation-bound model-routing receipt, successful launcher receipt/status, `PREFLIGHT: ALL
|
|
179
|
+
CLEAR` evidence, and a pushed preparation commit. The durable and ignored kickoff copies must be
|
|
180
|
+
byte-identical; the manifest, durable kickoff, plans, and planning commits must pass the
|
|
181
|
+
repository-aware readiness validator without worktree drift.
|
|
182
|
+
|
|
183
|
+
Invoke `validate_orchestration_artifacts` for `epic-planner-state` with
|
|
184
|
+
`require_ready_for_execution: true` and the explicit workspace root. Do not write or delegate the
|
|
185
|
+
kickoff until this canonical gate succeeds.
|
|
186
|
+
|
|
187
|
+
## Kickoff Artifacts
|
|
188
|
+
|
|
189
|
+
Write the ignored copy to `artifacts/orchestration/epic-kickoff-<epic-slug>.md` and commit the
|
|
190
|
+
durable copy at `docs/features/epics/<epic-slug>/epic-kickoff.md`:
|
|
191
|
+
|
|
192
|
+
```markdown
|
|
193
|
+
# Epic Kickoff: <epic-slug>
|
|
194
|
+
|
|
195
|
+
Planned by epic-planner on <iso8601>. All child features are prepared. Planning state:
|
|
196
|
+
artifacts/orchestration/epic-planner-state.json (branch: epic/<epic-slug>-integration).
|
|
197
|
+
|
|
198
|
+
## Invocation Prompt
|
|
199
|
+
|
|
200
|
+
Run `/epic-run <epic-slug>` to execute this epic, or paste the prompt below.
|
|
201
|
+
|
|
202
|
+
Use the epic-orchestrator subagent to execute the prepared epic at
|
|
203
|
+
docs/features/epics/<epic-slug>/epic.md. Reuse epic/<epic-slug>-integration. Every child resumes
|
|
204
|
+
at atomic execution from its committed plan-path; do not repeat promotion, research, feature
|
|
205
|
+
documents, planning, or preflight.
|
|
206
|
+
|
|
207
|
+
## Feature Summary
|
|
208
|
+
|
|
209
|
+
| issue_num | feature_folder | wave | complexity | plan-path |
|
|
210
|
+
| --- | --- | --- | --- | --- |
|
|
211
|
+
| ... | ... | ... | ... | ... |
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
The baseline artifact shape is authoritative. An optional integrity block may record the
|
|
215
|
+
planning commit and plan hashes, but `epic-run` must derive absent integrity values from Git.
|
|
216
|
+
|
|
217
|
+
## Checkpoint and Completion
|
|
218
|
+
|
|
219
|
+
Persist `artifacts/orchestration/epic-planner-state.json` after every completed step with:
|
|
220
|
+
`objective`, epic folder and manifest, integration branch, worthiness verdict and rationale, the
|
|
221
|
+
bounded `max_parallel_features`, forced root `topology_receipt`, and kickoff path. Each feature
|
|
222
|
+
records issue/folder/dependencies/wave/complexity, `research_path`, `plan_path`, optional
|
|
223
|
+
`preflight_evidence_path`, preparation/preflight state, branch/worktree, topology receipt,
|
|
224
|
+
delegation receipt, delegation-bound model receipt, launch receipt/status paths, and planning
|
|
225
|
+
commit/hash when declared. Also record `completed_steps`, `next_step`, and `last_updated`.
|
|
226
|
+
|
|
227
|
+
The successful terminal result is `EPIC_EXECUTION_READY`. The final report lists the manifest,
|
|
228
|
+
integration branch, both kickoff paths, and one `plan-path:` and preflight-status line per child.
|
|
229
|
+
It must state that execution has not started and starts only after a later root invocation of
|
|
230
|
+
`epic-run`.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: epic-run
|
|
3
|
+
description: Execute a previously prepared epic by resolving its committed kickoff artifact and delegating it to the Codex epic-orchestrator agent.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Epic Run Skill
|
|
7
|
+
|
|
8
|
+
Use this skill only from the root session. The root session must resolve the committed kickoff
|
|
9
|
+
artifact and delegate its invocation prompt to the project custom agent `epic-orchestrator`.
|
|
10
|
+
The root-invocation hook records the authorization receipt consumed when that agent starts.
|
|
11
|
+
|
|
12
|
+
Use the epic slug or path supplied in the invoking user request.
|
|
13
|
+
|
|
14
|
+
## Procedure
|
|
15
|
+
|
|
16
|
+
1. Resolve a bare slug to `docs/features/epics/<epic-slug>/`; resolve a supplied path to its
|
|
17
|
+
containing epic home.
|
|
18
|
+
2. Require `docs/features/epics/<epic-slug>/epic-kickoff.md`.
|
|
19
|
+
- If it is absent, stop before delegation. Direct the user to run `epic-plan` first or, for a
|
|
20
|
+
manually authored epic, invoke `epic-orchestrate <manifest-path>`.
|
|
21
|
+
3. Validate the kickoff's `## Invocation Prompt`, manifest reference, integration branch,
|
|
22
|
+
per-feature plan paths, preflight evidence, and current Git state. Derive optional missing
|
|
23
|
+
hashes from Git; fail closed on actual drift.
|
|
24
|
+
Invoke `validate_orchestration_artifacts` for `epic-planner-state` with
|
|
25
|
+
`require_ready_for_execution: true` and the explicit workspace root. Do not delegate until
|
|
26
|
+
that canonical repository-aware gate succeeds.
|
|
27
|
+
4. Delegate the invocation prompt to `epic-orchestrator` and apply `epic-orchestrate`.
|
|
28
|
+
5. Reuse the existing integration branch. Every child resumes at atomic execution from its
|
|
29
|
+
committed plan path. Do not repeat promotion, research, feature documents, planning, or
|
|
30
|
+
preflight.
|
|
31
|
+
6. If `artifacts/orchestration/epic-orchestrator-state.json` already tracks this epic, resume from
|
|
32
|
+
its durable `next_step` instead of restarting.
|
|
33
|
+
7. Worktree children must be launched through `.codex/scripts/launch-epic-child-wave.ps1`; do
|
|
34
|
+
not replace the launcher with native `spawn_agent`.
|
|
35
|
+
8. Copy the validated planner checkpoint's `max_parallel_features` into the epic-orchestrator
|
|
36
|
+
checkpoint before constructing the first execution launch specification.
|
|
37
|
+
|
|
38
|
+
Wave scheduling, fan-in, worktree cleanup, `epic-status.md`, final PR creation, CI validation,
|
|
39
|
+
and completion are governed entirely by `epic-orchestrate`.
|