waypoint-codex 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.
Files changed (43) hide show
  1. package/dist/src/core.js +4 -5
  2. package/package.json +1 -1
  3. package/templates/.agents/skills/collapse-fragmented-modules/SKILL.md +31 -52
  4. package/templates/.agents/skills/collapse-fragmented-modules/agents/openai.yaml +4 -0
  5. package/templates/.agents/skills/edit-at-the-right-layer/SKILL.md +33 -0
  6. package/templates/.agents/skills/edit-at-the-right-layer/agents/openai.yaml +4 -0
  7. package/templates/.agents/skills/execution-reset/SKILL.md +68 -31
  8. package/templates/.agents/skills/execution-reset/agents/openai.yaml +2 -2
  9. package/templates/.agents/skills/find-duplicate-ownership/SKILL.md +120 -0
  10. package/templates/.agents/skills/find-duplicate-ownership/agents/openai.yaml +0 -0
  11. package/templates/.agents/skills/find-duplicate-ownership/references/audit-prompts.md +89 -0
  12. package/templates/.agents/skills/foundational-redesign/SKILL.md +18 -13
  13. package/templates/.agents/skills/foundational-redesign/agents/openai.yaml +2 -2
  14. package/templates/.agents/skills/hard-cut/SKILL.md +78 -0
  15. package/templates/.agents/skills/hard-cut/agents/openai.yaml +4 -0
  16. package/templates/.agents/skills/legibility-pass/SKILL.md +30 -26
  17. package/templates/.agents/skills/legibility-pass/agents/openai.yaml +2 -2
  18. package/templates/.agents/skills/make-invariants-explicit/SKILL.md +73 -0
  19. package/templates/.agents/skills/make-invariants-explicit/agents/openai.yaml +4 -0
  20. package/templates/.agents/skills/plan-start/SKILL.md +65 -28
  21. package/templates/.agents/skills/plan-start/agents/openai.yaml +4 -0
  22. package/templates/.agents/skills/plan-swarm-audit/SKILL.md +50 -6
  23. package/templates/.agents/skills/plan-swarm-audit/agents/openai.yaml +2 -2
  24. package/templates/.agents/skills/planning/SKILL.md +114 -62
  25. package/templates/.agents/skills/planning/agents/openai.yaml +2 -2
  26. package/templates/.agents/skills/replace-dont-layer/SKILL.md +68 -22
  27. package/templates/.agents/skills/replace-dont-layer/agents/openai.yaml +4 -0
  28. package/templates/.agents/skills/root-cause-finder/SKILL.md +70 -0
  29. package/templates/.agents/skills/root-cause-finder/agents/openai.yaml +0 -0
  30. package/templates/.agents/skills/test-writing/SKILL.md +53 -39
  31. package/templates/.agents/skills/test-writing/agents/openai.yaml +2 -2
  32. package/templates/.agents/skills/verify-codebase-coherence/SKILL.md +35 -0
  33. package/templates/.agents/skills/verify-codebase-coherence/agents/openai.yaml +4 -0
  34. package/templates/.agents/skills/verify-completeness/SKILL.md +38 -27
  35. package/templates/.agents/skills/verify-completeness/agents/openai.yaml +2 -2
  36. package/templates/.codex/agents/duplicate_ownership_explorer.toml +17 -0
  37. package/templates/.codex/agents/ownership_taxonomy_mapper.toml +16 -0
  38. package/templates/.codex/agents/ssot_judge.toml +17 -0
  39. package/templates/.codex/config.toml +12 -0
  40. package/templates/.agents/skills/adversarial-review/SKILL.md +0 -86
  41. package/templates/.agents/skills/adversarial-review/agents/openai.yaml +0 -4
  42. package/templates/.agents/skills/code-guide-audit/SKILL.md +0 -86
  43. package/templates/.agents/skills/code-guide-audit/agents/openai.yaml +0 -4
@@ -0,0 +1,78 @@
1
+ ---
2
+ name: hard-cut
3
+ description: "Enforce a hard-cut cleanup policy: keep one canonical implementation and delete compatibility, migration, fallback, adapter, coercion, and dual-shape code. Use for pre-release or internal-draft refactors where the goal is one final shape, especially when changing schemas, contracts, persisted state, routing, configuration, feature flags, enum/value sets, or architecture."
4
+ ---
5
+
6
+ # Hard-Cut Policy
7
+
8
+ Apply a hard-cut policy by default for refactors or behavior changes that alter schemas, contracts, persisted state, routing, configuration, feature flags, enum/value sets, or architecture where old-state preservation might otherwise be retained.
9
+
10
+ Keep one canonical codepath. Remove old-shape handling. Do not preserve draft or legacy behavior unless there is concrete evidence of a real external compatibility boundary.
11
+
12
+ ## Default assumption
13
+
14
+ Treat previous shapes as internal draft shapes unless there is concrete evidence they are already:
15
+ - persisted external or user data
16
+ - on-disk or database state that must still load
17
+ - a wire format used across process or service boundaries
18
+ - a documented or publicly supported contract
19
+ - actively depended on outside the refactor boundary
20
+
21
+ Mere existence of old code is not proof of a compatibility obligation.
22
+
23
+ ## Core policy
24
+
25
+ When an old shape appears, remove that path and convert the codebase to the canonical shape. Do not add code to support it. Do not add code specifically to reject it just because it once existed.
26
+
27
+ ## Hard rules
28
+
29
+ Apply these rules in order:
30
+
31
+ 1. Do not add fallback behavior.
32
+ 2. Do not add compatibility branches.
33
+ 3. Do not add shims, adapters, coercions, aliases, or dual-shape support.
34
+ 4. Do not add fail-fast guards whose purpose is to detect or reject old shapes.
35
+ 5. Do not add tests whose purpose is to assert rejection of old or legacy shapes.
36
+ 6. Prefer deleting old-shape handling over preserving or policing it.
37
+ 7. Update producers, consumers, fixtures, and tests to use only the canonical shape.
38
+ 8. Remove dead code, dead conditionals, obsolete comments, and translation helpers related to old shapes.
39
+ 9. Keep validation only for the current canonical contract. Validation may reject malformed current-shape input, but must not branch on legacy discriminators, old field names, aliases, old enum members, or draft formats.
40
+ 10. When choosing between backward compatibility and simplification, choose simplification.
41
+
42
+ ## Execution workflow
43
+
44
+ 1. Identify the canonical target shape.
45
+ 2. Trace every producer and consumer of that shape.
46
+ 3. Update all live codepaths to emit and consume only the canonical shape.
47
+ 4. Update fixtures, test data, builders, and snapshots to the canonical shape.
48
+ 5. Delete legacy handling, branching, comments, and helpers.
49
+ 6. Keep only current-shape validation that is still required for correctness.
50
+ 7. If a real external compatibility boundary exists, isolate it and call out the exact file, function, boundary, and reason it cannot be removed yet.
51
+
52
+ ## Review checklist
53
+
54
+ - Reject changes that preserve old-shape behavior behind conditionals.
55
+ - Reject translation layers between old and new shapes.
56
+ - Reject validation branches added only to reject legacy inputs.
57
+ - Reject tests added only to memorialize abandoned draft formats.
58
+ - Remove dead helpers and comments that describe removed draft formats.
59
+ - Keep one owner for the canonical contract.
60
+
61
+ ## Deliverables
62
+
63
+ Deliver only:
64
+ - a minimal implementation that supports the canonical shape
65
+ - updated tests for the canonical shape only
66
+ - removal of obsolete legacy-shape tests
67
+ - no new rejection tests for old shapes
68
+ - no runtime logic dedicated to recognizing legacy formats
69
+
70
+ ## Exception rule
71
+
72
+ Make an exception only when removing the old shape would break already persisted external or user data, on-disk or database state, cross-boundary wire formats, or a real public contract.
73
+
74
+ If such a boundary exists:
75
+ - do not invent new compatibility layers elsewhere
76
+ - name the exact file and function
77
+ - describe the concrete persisted or public dependency
78
+ - limit any compatibility discussion to that boundary only
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Hard Cut"
3
+ short_description: "Prefer one canonical shape and delete legacy paths"
4
+ default_prompt: "Use $hard-cut to enforce a single canonical implementation, remove legacy/compatibility layers, and keep exceptions only at proven external boundaries."
@@ -1,34 +1,38 @@
1
1
  ---
2
2
  name: legibility-pass
3
- description: Improve code legibility within a defined scope without changing intended behavior. Use when code is correct but hard to read, reason about, or safely modify. Focus on making intent, control flow, state, boundaries, and important behavior easier to see through better naming, clearer structure, reduced indirection, and simpler local reasoning.
3
+ description: Legibility-only refactors for code that is already behaviorally correct but hard to read, reason about, or safely modify. Use only for local readability improvements inside an explicitly requested scope. Do not use for behavior changes, invariant redesign, architectural cleanup, or broad refactors that change boundaries.
4
4
  ---
5
5
 
6
- Refactor the given scope to make the current truth easier to see.
6
+ # Legibility Pass
7
7
 
8
- Preserve behavior unless the user asked for functional change.
8
+ Refactor the requested scope so the current behavior is easier to read without changing what the code does.
9
9
 
10
- Focus on:
11
- - clearer names for modules, functions, variables, and states
12
- - making the main flow easy to follow
13
- - making failure paths and edge conditions explicit
14
- - reducing indirection that hides important behavior
15
- - making state, contracts, and boundaries easier to understand
16
- - collapsing unnecessary wrappers or pass-through helpers
17
- - improving local reasoning so a reader needs less cross-referencing
10
+ ## Core Instruction
11
+ Make the smallest readable change that improves comprehension while preserving the existing contract, control flow, and runtime behavior.
18
12
 
19
- Within the requested scope:
20
- 1. Identify the parts that are hardest to understand or easiest to misread.
21
- 2. Improve naming so intent is obvious.
22
- 3. Restructure code so the main path is visible and important branches are easy to spot.
23
- 4. Make hidden assumptions, state transitions, and invariants more explicit.
24
- 5. Remove low-value indirection that makes behavior harder to trace.
25
- 6. Keep comments rare; prefer making the code itself explain the behavior.
26
- 7. Add a brief clarifying comment only when the underlying rule or constraint is not obvious from the code alone.
13
+ ## Default Workflow
14
+ 1. Identify the narrow scope where readability is actively hurting maintenance or review.
15
+ 2. Find the least intrusive change that improves naming, flow, or local structure.
16
+ 3. Rewrite the code so the main path, failure path, and key boundary are easier to see.
17
+ 4. Keep the public shape, observable behavior, and important data flow unchanged.
18
+ 5. Verify the refactor did not introduce a new abstraction, boundary shift, or hidden dependency.
27
19
 
28
- Rules:
29
- - Do not preserve confusing structure just because it already exists.
30
- - Do not add abstractions that make reading harder.
31
- - Do not replace clear code with clever code.
32
- - Do not rely on comments to explain code that should be rewritten instead.
33
- - Prefer fewer mental hops.
34
- - Prefer one obvious reading of the code over multiple plausible interpretations.
20
+ ## Rules
21
+ - Do not change behavior, public API, persistence shape, wire format, timing, or error semantics.
22
+ - Do not rename or restructure code unless the change reduces reading friction in the requested scope.
23
+ - Do not introduce new layers, helper abstractions, or framework patterns just to make the diff look cleaner.
24
+ - Do not perform broad cleanup, mechanical formatting, dead-code sweeps, or unrelated simplification.
25
+ - Do not use this skill for collapsing unrelated abstractions, making invariants stricter, or redesigning architecture.
26
+ - Do not use this skill as a substitute for a foundational refactor, make-invariants pass, or behavior-preserving optimization.
27
+ - Do not rely on comments to explain code that can be made directly legible.
28
+ - Do not add comments unless they capture a local constraint that cannot be expressed clearly in code.
29
+
30
+ ## Exception Rule
31
+ If the only readability improvement would require a change that risks an unacceptable behavior shift, boundary violation, or contract change, stop and leave the code unchanged except for a brief explanation of the constraint. Use this exception only when the safer rewrite would cross one of the hard rules above.
32
+
33
+ ## Output Contract
34
+ - Return a diff limited to the explicitly requested scope.
35
+ - Include only legibility edits that preserve observable behavior.
36
+ - List the files changed and the specific readability improvements made.
37
+ - State any tempting cleanup, boundary change, or abstraction you intentionally left out because it would exceed the skill boundary.
38
+ - If no safe readability improvement exists, report that the scope was left unchanged and why.
@@ -1,4 +1,4 @@
1
1
  interface:
2
2
  display_name: "Legibility Pass"
3
- short_description: "Improve readability without changing behavior"
4
- default_prompt: "Use $legibility-pass on the current scope to improve naming, control-flow clarity, and local reasoning while preserving intended behavior."
3
+ short_description: "Legibility-only refactors within a requested scope"
4
+ default_prompt: "Use $legibility-pass only for local readability refactors in the requested scope. Improve naming, flow, and local reasoning without changing behavior, boundaries, invariants, or architecture."
@@ -0,0 +1,73 @@
1
+ ---
2
+ name: make-invariants-explicit
3
+ description: Use when behavior depends on hidden assumptions about data shape, ordering, uniqueness, idempotency, authorization, state transitions, or lifecycle constraints. Surface the invariant, choose the correct enforcement layer, and make invalid states hard to represent or hard to persist.
4
+ ---
5
+
6
+ # Make Invariants Explicit
7
+
8
+ ## Core Instruction
9
+ Find the invariant that correctness depends on, enforce it at the strongest appropriate layer, and remove hidden assumptions from the implementation.
10
+
11
+ ## Trigger Examples
12
+ Use this skill when the requested change involves one or more of these cases:
13
+ - a value must always be present before processing
14
+ - operations must happen in a specific order
15
+ - a transition is forbidden from a given state
16
+ - a record must be unique
17
+ - a side effect must happen exactly once
18
+ - retries, duplicate delivery, or replay are possible
19
+ - a caller may have skipped validation
20
+ - authorization depends on a stable contract, not an informal assumption
21
+ - external data may not match the expected shape
22
+
23
+ Do not use this skill for purely stylistic cleanup, broad refactors with no correctness invariant, or features where the only goal is to make code shorter.
24
+
25
+ ## Default Workflow
26
+ 1. State the invariant in one sentence.
27
+ 2. Identify the owner of the invariant.
28
+ - If the invariant is owned by persistence, enforce it in schema, constraints, or transactional logic.
29
+ - If the invariant is owned by the domain model, encode it in types, constructors, or state transitions.
30
+ - If the invariant is owned by an external boundary, validate it at ingress before it reaches core logic.
31
+ 3. Choose the enforcement layer using this order:
32
+ - persistence or database constraint when multiple writers, processes, or retries can violate the rule
33
+ - type or schema constraint when the invalid state should not be representable
34
+ - state machine or transition guard when the rule depends on lifecycle order
35
+ - boundary validation when the input is untrusted or externally shaped
36
+ - idempotency key, deduplication, or lock when duplicates or replay are possible
37
+ - assertion or defensive guard only when the invariant is guaranteed elsewhere and this code sits at the true correctness boundary
38
+ 4. Replace scattered checks with one authoritative enforcement point unless the invariant genuinely exists at multiple boundaries.
39
+ 5. Add or update tests that prove the invariant is enforced and that the failure mode is rejected.
40
+ 6. Call out any remaining gap that the code does not and cannot fully eliminate.
41
+
42
+ If an important invariant is only implied, make it explicit.
43
+
44
+ When correcting violations:
45
+ - encode the invariant where it is naturally enforced
46
+ - remove duplicate or scattered half-checks when one authoritative check is better
47
+ - keep the invariant visible in the code structure
48
+ - preserve intended behavior unless the user asked for a change in behavior
49
+
50
+ ## Rules
51
+ - Do not rely on hidden assumptions for correctness.
52
+ - Do not assume earlier layers already enforced a critical invariant unless that contract is explicit, stable, and tested.
53
+ - Do not scatter partial checks across many places when one authoritative enforcement point exists.
54
+ - Do not normalize invalid state away when the correct behavior is to reject it.
55
+ - Do not use assertions as the primary enforcement mechanism when a stronger boundary exists.
56
+ - Do not leave a critical invariant implicit if it can be represented in code, types, schema, or transitions.
57
+
58
+ ## Exception Rule
59
+ You may leave an invariant implicit only when all of the following are true:
60
+ - the invariant is already enforced by a documented contract in the same repository or a strictly stronger upstream boundary
61
+ - that contract is stable enough that breaking it would be a compatibility defect, not a routine possibility
62
+ - the current change does not weaken, duplicate, or relocate that enforcement point
63
+ - the output explicitly records the dependency and residual risk
64
+
65
+ This exception does not apply to correctness, security, permissions, uniqueness, idempotency, duplicate handling, or lifecycle-transition invariants.
66
+
67
+ ## Output Contract
68
+ Return the result with these fields:
69
+ - Invariant: the exact rule being enforced
70
+ - Owner: the layer or component responsible for the invariant
71
+ - Enforcement point: the concrete code, schema, type, or transition boundary used
72
+ - Verification/tests: the tests or checks added or updated to prove enforcement
73
+ - Residual risk: any remaining assumption, dependency, or gap
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Make Invariants Explicit"
3
+ short_description: "Enforce hidden correctness assumptions at the right layer"
4
+ default_prompt: "Use $make-invariants-explicit when correctness depends on hidden assumptions about data shape, ordering, uniqueness, idempotency, authorization, or lifecycle state. Identify the invariant, choose the authoritative enforcement layer, implement it, and report the verification/tests and residual risk."
@@ -1,42 +1,79 @@
1
1
  ---
2
2
  name: plan-start
3
- description: Start execution on an existing implementation plan in a fresh session. Use when a plan, roadmap, or phase list already exists and Codex needs to begin work on it without re-deriving everything from scratch. Rebuild context from the plan and current codebase, identify the active phase, choose the first meaningful work package, and begin execution.
3
+ description: Bootstrap a fresh session onto an existing implementation plan. Use when a referenced plan already exists, execution has not meaningfully started in the current session, and Codex needs to reconstruct the active phase from the plan plus current repository state before beginning the first substantial work package.
4
4
  ---
5
5
 
6
- Start from the plan and the current codebase, not from assumptions.
6
+ # Plan Start
7
7
 
8
- 1. Read the referenced plan.
9
- 2. Inspect the current repository state relevant to that plan.
8
+ ## Core Instruction
9
+ Convert a referenced plan into the first executable work package for a fresh session.
10
+
11
+ ## Trigger Boundary
12
+ Use this skill when:
13
+ - a durable plan, roadmap, or phase list already exists
14
+ - the current session has not yet become a stalled execution loop
15
+ - the task is to re-enter the plan, recover the active phase, and begin substantive work
16
+
17
+ Do not use this skill when:
18
+ - the session is already mid-execution and progress has degraded into micro-edits, repeated patching, or phase drift
19
+ - the current problem is recovering momentum on a stuck phase
20
+ - the request is to revise the plan itself before execution can begin
21
+
22
+ In those cases, route to:
23
+ - `$execution-reset` for stalled or compacted plan execution
24
+ - `$planning` when the plan is missing, non-durable, or too underspecified to execute
25
+
26
+ ## Required Inputs
27
+ Do not proceed until you have:
28
+ - a plan path, plan identifier, or equivalent durable plan reference
29
+ - the current repository/worktree state relevant to that plan
30
+ - enough current context to tell whether the referenced plan is still actionable
31
+
32
+ If any required input is missing, stop and route to `$planning` or ask for the missing reference instead of guessing.
33
+
34
+ ## Workflow
35
+ 1. Read the referenced plan end to end.
36
+ 2. Inspect the current repository state relevant to the plan.
10
37
  3. Determine:
11
- - which phases are already complete
38
+ - which phases are complete
12
39
  - which phase is active
13
- - what remains in the active phase
40
+ - what remains inside the active phase
14
41
  4. Restate the active phase as concrete system behavior.
15
- 5. Select the first substantial work package.
16
- 6. Begin executing it immediately.
17
-
18
- Use this output shape:
42
+ 5. Select the first substantial work package that most directly advances that phase.
43
+ 6. Begin execution on that package.
19
44
 
20
- ## Plan Start
21
- ### Active Phase
22
- [phase]
45
+ ## Rules
46
+ - Do not re-plan the whole project unless the referenced plan is locally stale.
47
+ - Do not use this skill to recover from a stalled session; that is `$execution-reset`.
48
+ - Do not spend the session on summaries, narration, or cosmetic cleanup when a substantive work package is available.
49
+ - Do not choose a micro-edit as the first move unless it is the smallest change that unblocks the first substantial package.
50
+ - Select the work package that most directly advances the active phase.
23
51
 
24
- ### Goal
25
- [what this phase must accomplish]
52
+ ## Bounded Exception
53
+ If the plan is locally stale, allow one bounded re-anchoring pass:
54
+ - reconcile the active phase against the current codebase
55
+ - update the phase boundary only as needed to make execution possible
56
+ - do not rewrite the whole roadmap
26
57
 
27
- ### Current State
28
- - Complete: [...]
29
- - In progress: [...]
30
- - Missing: [...]
58
+ If the plan still cannot be executed after that pass, stop and route to `$planning`.
31
59
 
32
- ### First Work Package
33
- [one substantial chunk]
60
+ ## Output Contract
61
+ ### Normal
62
+ Return:
63
+ - `Active Phase`
64
+ - `Objective`
65
+ - `Current State`
66
+ - `First Work Package`
67
+ - `Definition of Done`
34
68
 
35
- ### Definition of Done
36
- [what makes this chunk complete]
69
+ ### Blocked
70
+ Return `Blocked` when required inputs are missing or the plan cannot be safely actioned yet. Include:
71
+ - what is missing
72
+ - why execution cannot start
73
+ - the exact reroute target: `$planning` or `$execution-reset`
37
74
 
38
- Rules:
39
- - Do not re-plan the whole project unless the plan is clearly stale.
40
- - Do not spend the session on broad summaries when execution can begin.
41
- - Do not start with cosmetic cleanup.
42
- - Prefer the work package that most directly advances the active phase.
75
+ ### Reroute
76
+ Return `Reroute` when the request belongs to another skill. Include:
77
+ - `Reroute Target`
78
+ - `Reason`
79
+ - the minimal handoff needed to continue
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Plan Start"
3
+ short_description: "Bootstrap a fresh session onto an existing implementation plan"
4
+ default_prompt: "Use $plan-start when a durable implementation plan already exists and this is a fresh-session bootstrap, not a stalled execution recovery. Read the plan, inspect the current repo state, identify the active phase, pick the first substantial work package, and begin execution. If the plan is missing or underspecified, route to $planning; if the session is already stalled, route to $execution-reset."
@@ -1,21 +1,35 @@
1
1
  ---
2
2
  name: plan-swarm-audit
3
- description: Use during execution of an approved multi-phase plan when a second-pass audit is needed. Spawn five parallel subagents with distinct audit scopes, consolidate findings, fix blockers, and repeat in bounded rounds until the phase or plan meets acceptance criteria.
3
+ description: Use during execution of an approved plan phase when a bounded second-pass audit is needed. Requires plan path, active phase, changed-file scope or scope anchor commit, phase acceptance criteria, and a verify-completeness closeout target. If those inputs are missing or subagents cannot be staffed, block instead of spawning.
4
4
  ---
5
5
 
6
6
  # Plan Swarm Audit
7
7
 
8
- Use this skill while implementing an approved plan when you want an independent multi-agent audit loop before calling work complete.
8
+ Use this skill while executing an approved plan phase when you need an independent audit loop before closeout. Do not improvise the audit shape or start from partial context.
9
9
 
10
10
  ## Required inputs
11
11
 
12
12
  - plan path (for example `.waypoint/plans/<plan>.md`)
13
13
  - active phase
14
14
  - current changed-file scope (or scope anchor commit)
15
+ - phase acceptance criteria for the active phase
16
+ - verify-completeness closeout target
15
17
 
16
- ## Swarm setup (5 agents, disjoint scopes)
18
+ ## Precondition validation
17
19
 
18
- Spawn exactly five subagents in parallel, each with one owned audit lens:
20
+ Before spawning any audit agents, confirm all of the following:
21
+
22
+ 1. The referenced plan exists and is the approved source of truth for the work.
23
+ 2. The active phase is identified and not already closed.
24
+ 3. The changed-file scope or scope anchor commit is available.
25
+ 4. The active phase acceptance criteria are explicit enough to test against.
26
+ 5. A `verify-completeness` closeout pass will be run after the swarm loop.
27
+
28
+ If any required input is missing, ambiguous, or stale, do not spawn the swarm. Return `blocked` with the missing input(s) and the exact next input needed from the user or from the plan.
29
+
30
+ ## Swarm setup
31
+
32
+ Spawn five parallel subagents when the preconditions are satisfied. Keep their scopes disjoint and narrow.
19
33
 
20
34
  1. Plan-scope compliance
21
35
  2. Correctness and regression risk
@@ -29,7 +43,9 @@ Each subagent must return:
29
43
  - exact file/line references
30
44
  - whether each finding blocks phase completion
31
45
  - recommended fix
32
- - a final status suitable for immediate closeout
46
+ - a final status suitable for immediate closeout or escalation
47
+
48
+ If a subagent cannot be spawned, use the exception rule below. Do not silently reduce coverage.
33
49
 
34
50
  ## Consolidation pass
35
51
 
@@ -47,7 +63,17 @@ After all five return:
47
63
  2. Run targeted verification for the changed area.
48
64
  3. Re-check plan checklist and acceptance criteria.
49
65
  4. Update `ACTIVE_PLANS.md` / `WORKSPACE.md` when state materially changes.
50
- 5. If blockers remain, run another swarm round.
66
+ 5. If blockers remain and the round cap has not been reached, run another swarm round.
67
+
68
+ ## Exception rule
69
+
70
+ Use the normal five-agent shape by default. You may deviate only in these bounded cases:
71
+
72
+ - Missing required inputs: block immediately and do not spawn any agents.
73
+ - Unavailable subagents: run fewer than five only if the remaining agents can still cover the five lenses by merging at most one adjacent lens per missing agent. Do not run with fewer than three agents.
74
+ - Justified fewer-agents mode: document why the reduction is necessary, which lenses were merged, and what residual risk remains. Treat the reduced coverage as a blocker if it weakens the audit materially.
75
+
76
+ Do not use the exception rule for convenience, speed, or to avoid waiting for missing context.
51
77
 
52
78
  ## Stop condition
53
79
 
@@ -57,6 +83,20 @@ You may stop only when all are true:
57
83
  - active phase acceptance criteria are satisfied
58
84
  - `verify-completeness` closeout is clean
59
85
 
86
+ ## Escalation
87
+
88
+ Escalate to the user instead of continuing when either of these is true:
89
+
90
+ - the round cap for the phase has been reached
91
+ - the same blocker appears in two rounds after targeted fixes
92
+
93
+ Escalation must include:
94
+
95
+ - the exact blocker(s)
96
+ - what was tried
97
+ - why the blocker still remains
98
+ - the decision needed from the user, such as scope change, plan update, more context, or acceptance of a blocked phase
99
+
60
100
  ## Guardrails
61
101
 
62
102
  - Use at most 3 swarm rounds per phase by default.
@@ -70,8 +110,12 @@ You may stop only when all are true:
70
110
 
71
111
  Report:
72
112
 
113
+ - status: `complete`, `blocked`, or `escalated`
73
114
  - swarm round number
115
+ - precondition check result
74
116
  - consolidated blockers (with file/line refs)
75
117
  - fixes applied
76
118
  - verification run
119
+ - verify-completeness handoff result
77
120
  - remaining blockers or confirmation that stop condition is met
121
+ - escalation, if any, with the decision needed from the user
@@ -1,4 +1,4 @@
1
1
  interface:
2
2
  display_name: "Plan Swarm Audit"
3
- short_description: "Run a 5-agent audit loop against the active plan phase"
4
- default_prompt: "Use $plan-swarm-audit with the current plan path and active phase. Spawn five parallel audit agents with distinct scopes, consolidate blockers, fix them, and repeat in bounded rounds until phase acceptance criteria are satisfied."
3
+ short_description: "Run a bounded 5-agent audit loop against an approved plan phase"
4
+ default_prompt: "Use $plan-swarm-audit only when you already have the plan path, active phase, changed-file scope or scope anchor commit, phase acceptance criteria, and a verify-completeness closeout target. Validate those inputs first; if any are missing or stale, return blocked and do not spawn agents. Otherwise spawn five parallel audit agents with distinct scopes, consolidate findings, fix blockers, repeat in bounded rounds, and hand off to $verify-completeness before reporting complete. Escalate if the round cap is reached or the same blocker repeats after targeted fixes."