waypoint-codex 1.0.14 → 1.0.16

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 (39) hide show
  1. package/package.json +1 -1
  2. package/templates/.agents/skills/collapse-fragmented-modules/SKILL.md +31 -52
  3. package/templates/.agents/skills/collapse-fragmented-modules/agents/openai.yaml +4 -0
  4. package/templates/.agents/skills/edit-at-the-right-layer/SKILL.md +24 -17
  5. package/templates/.agents/skills/edit-at-the-right-layer/agents/openai.yaml +2 -2
  6. package/templates/.agents/skills/execution-reset/SKILL.md +68 -31
  7. package/templates/.agents/skills/execution-reset/agents/openai.yaml +2 -2
  8. package/templates/.agents/skills/find-duplicate-ownership/SKILL.md +120 -0
  9. package/templates/.agents/skills/find-duplicate-ownership/agents/openai.yaml +0 -0
  10. package/templates/.agents/skills/find-duplicate-ownership/references/audit-prompts.md +89 -0
  11. package/templates/.agents/skills/foundational-redesign/SKILL.md +18 -13
  12. package/templates/.agents/skills/foundational-redesign/agents/openai.yaml +2 -2
  13. package/templates/.agents/skills/hard-cut/SKILL.md +78 -0
  14. package/templates/.agents/skills/hard-cut/agents/openai.yaml +4 -0
  15. package/templates/.agents/skills/legibility-pass/SKILL.md +30 -26
  16. package/templates/.agents/skills/legibility-pass/agents/openai.yaml +2 -2
  17. package/templates/.agents/skills/make-invariants-explicit/SKILL.md +57 -26
  18. package/templates/.agents/skills/make-invariants-explicit/agents/openai.yaml +2 -2
  19. package/templates/.agents/skills/plan-start/SKILL.md +65 -28
  20. package/templates/.agents/skills/plan-start/agents/openai.yaml +4 -0
  21. package/templates/.agents/skills/plan-swarm-audit/SKILL.md +50 -6
  22. package/templates/.agents/skills/plan-swarm-audit/agents/openai.yaml +2 -2
  23. package/templates/.agents/skills/planning/SKILL.md +115 -62
  24. package/templates/.agents/skills/planning/agents/openai.yaml +2 -2
  25. package/templates/.agents/skills/replace-dont-layer/SKILL.md +68 -22
  26. package/templates/.agents/skills/replace-dont-layer/agents/openai.yaml +4 -0
  27. package/templates/.agents/skills/root-cause-finder/SKILL.md +70 -0
  28. package/templates/.agents/skills/root-cause-finder/agents/openai.yaml +0 -0
  29. package/templates/.agents/skills/test-writing/SKILL.md +53 -39
  30. package/templates/.agents/skills/test-writing/agents/openai.yaml +2 -2
  31. package/templates/.agents/skills/verify-codebase-coherence/SKILL.md +26 -27
  32. package/templates/.agents/skills/verify-codebase-coherence/agents/openai.yaml +3 -3
  33. package/templates/.agents/skills/verify-completeness/SKILL.md +38 -27
  34. package/templates/.agents/skills/verify-completeness/agents/openai.yaml +2 -2
  35. package/templates/.codex/agents/duplicate_ownership_explorer.toml +17 -0
  36. package/templates/.codex/agents/ownership_taxonomy_mapper.toml +16 -0
  37. package/templates/.codex/agents/ssot_judge.toml +17 -0
  38. package/templates/.codex/config.toml +12 -0
  39. package/templates/managed-agents-block.md +1 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waypoint-codex",
3
- "version": "1.0.14",
3
+ "version": "1.0.16",
4
4
  "description": "Make Codex better by default with stronger planning, code quality, reviews, tracking, and repo guidance.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,56 +1,35 @@
1
1
  ---
2
2
  name: collapse-fragmented-modules
3
- description: Consolidate over-fragmented existing code within a defined scope. Use when a feature, module, or directory has been split into too many tiny files, thin wrappers, pass-through layers, single-use helpers, local-only types, local-only constants, or other low-value fragments that make future changes harder. Reduce file count by merging code that changes together, removing unnecessary indirection, and reorganizing the scope into a smaller number of cohesive files without changing intended behavior.
3
+ description: Consolidate internal file fragmentation inside an existing module, feature, or directory when the code is split into too many tiny files, thin wrappers, pass-through layers, single-use helpers, or local-only types/constants. Use when the task is to reduce file count and remove low-value indirection without changing schemas, public contracts, persisted formats, or cross-boundary behavior.
4
4
  ---
5
5
 
6
- Refactor the given scope to reduce unnecessary file fragmentation.
7
-
8
- Treat this as consolidation work, not feature work. Preserve behavior while making the code easier to change.
9
-
10
- Within the requested scope:
11
-
12
- 1. Identify files that should be merged, removed, or kept.
13
- Target especially:
14
- - tiny files with little logic
15
- - single-use helpers
16
- - local-only types
17
- - local-only constants
18
- - thin wrappers
19
- - pass-through adapters
20
- - split files that always change together
21
-
22
- 2. Merge code that belongs to the same feature or responsibility into a smaller number of cohesive files.
23
-
24
- 3. Remove low-value indirection.
25
- Collapse wrappers, adapters, and helper layers that do not enforce a real boundary or protect meaningful complexity.
26
-
27
- 4. Keep splits only when they are justified by one of these:
28
- - real shared reuse
29
- - clear architectural boundary
30
- - meaningful file size
31
- - clearly separate responsibility that does not usually change with neighboring code
32
-
33
- 5. Prefer edit locality over theoretical separation.
34
- A routine change in this scope should touch as few files as reasonably possible.
35
-
36
- 6. Preserve external behavior and stable public contracts unless the user asked for behavioral change.
37
-
38
- 7. Update imports, exports, and tests to match the new structure.
39
-
40
- 8. Delete obsolete files as part of the same work. Do not leave dead fragments behind.
41
-
42
- Rules:
43
- - Do not keep tiny files just because they already exist.
44
- - Do not preserve thin wrappers, pass-through hooks, local-only type files, or local-only constants files unless they provide real value.
45
- - Do not split by category alone.
46
- - Do not create a new abstraction while trying to remove fragmentation.
47
- - Prefer one cohesive file over several microscopic files when the code changes together.
48
- - Keep public boundaries clean, but aggressively collapse internal fragmentation.
49
- - If unsure whether two files should be merged, merge them unless there is a clear boundary reason not to.
50
-
51
- Before finishing, do a consolidation pass:
52
- - remove newly obsolete files
53
- - collapse redundant exports
54
- - simplify import paths
55
- - check whether the same feature is still spread across too many files
56
- - reduce file count further if behavior and clarity allow
6
+ # Collapse Fragmented Modules
7
+
8
+ ## Core Instruction
9
+ Consolidate internal fragmentation into the smallest cohesive file set that preserves current behavior.
10
+
11
+ ## Default Workflow
12
+ 1. Map the scope and classify each file as merge, keep, or delete.
13
+ 2. Merge code that changes together or serves one local responsibility.
14
+ 3. Remove thin wrappers, pass-through layers, and local-only helper/type/constant files.
15
+ 4. Update imports, exports, and tests to match the new file shape.
16
+ 5. Delete obsolete fragments and rerun a consolidation pass for any remaining avoidable splits.
17
+
18
+ ## Rules
19
+ - Do not create new abstractions to justify keeping fragmentation.
20
+ - Do not keep a split file unless at least one is true: multiple live callers reuse it, it sits on a real public or cross-boundary interface, it protects a distinct runtime or lifecycle boundary, or merging would create an unreasonably large file.
21
+ - Do not preserve local-only types, constants, or helpers in separate files unless they are reused outside the consolidation scope.
22
+ - Do not split code by category alone.
23
+ - Do not leave obsolete wrappers, adapters, re-export layers, or dead fragment files in place after the merge.
24
+ - Do not change schemas, wire formats, persisted state, or public contracts in this skill.
25
+
26
+ ## Exception Rule
27
+ If a file is tied to a real external boundary that must remain separate, keep only that boundary file and consolidate everything else around it. If the requested work requires schema, contract, migration, or compatibility changes to proceed, stop and hand off to the appropriate redesign or hard-cut skill instead of stretching this one.
28
+
29
+ ## Output Contract
30
+ Report:
31
+ - files merged
32
+ - files deleted
33
+ - files kept with the specific boundary reason
34
+ - imports, exports, or tests updated
35
+ - any remaining split that is still justified
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Collapse Fragmented Modules"
3
+ short_description: "Consolidate internal file fragmentation without changing contracts"
4
+ default_prompt: "Use $collapse-fragmented-modules when an existing module, feature, or directory is split into too many tiny files, thin wrappers, pass-through layers, single-use helpers, or local-only types/constants. Merge the internal pieces, delete obsolete fragments, and keep only splits that are justified by reuse or a real public or cross-boundary boundary."
@@ -1,26 +1,33 @@
1
1
  ---
2
2
  name: edit-at-the-right-layer
3
- description: Make changes at the true ownership layer instead of patching nearby call sites. Use when implementing features, bug fixes, or refactors where behavior should be corrected at its source of truth rather than through wrappers, flags, or duplicated logic.
3
+ description: Use when a change should be implemented at the owning layer of an existing behavior, not in callers, wrappers, adapters, or duplicated checks. Trigger only when the main decision is which layer owns the contract. Examples: moving validation into the domain model, fixing serialization in the owning mapper, or deleting a controller workaround after the service layer can enforce the rule.
4
4
  ---
5
5
 
6
- Identify where this behavior is actually owned, then edit there.
6
+ # Edit At The Right Layer
7
7
 
8
- ## Goal
8
+ ## Core Instruction
9
+ Change the layer that owns the contract, not the layer that merely observes the failure.
9
10
 
10
- Fix or extend behavior at the layer that owns the contract so future changes stay local and coherent.
11
-
12
- ## Workflow
13
-
14
- 1. Trace the path from entry point to ownership.
15
- 2. Identify the contract owner (domain/service/model/state boundary) for the requested behavior.
16
- 3. Prefer changing that owner over adding patches in callers, controllers, views, adapters, or wrappers.
17
- 4. Remove compensating logic that became unnecessary after the ownership-layer fix.
18
- 5. Update boundary tests at the owning layer and only add higher/lower-layer tests when they cover a distinct risk.
11
+ ## Default Workflow
12
+ 1. Trace the request path to the first layer that can enforce the behavior once.
13
+ 2. Name the owning layer and the exact contract it must own.
14
+ 3. Implement the behavior at that layer.
15
+ 4. Remove caller-side workarounds, duplicate checks, and pass-through code made obsolete by the fix.
16
+ 5. Update tests at the owning layer first; add outer-layer tests only for distinct integration risk.
19
17
 
20
18
  ## Rules
21
-
22
- - Do not patch symptoms in outer layers when the source-of-truth layer can be fixed directly.
23
- - Do not add pass-through wrappers or compatibility branches as a default response.
19
+ - Do not patch symptoms in controllers, views, clients, wrappers, or adapters when the source-of-truth layer can enforce the behavior.
24
20
  - Do not duplicate the same rule across multiple layers.
25
- - If a temporary cross-layer patch is unavoidable, mark it as transitional and remove it in the same phase whenever possible.
26
- - Prefer one clear owner per rule.
21
+ - Do not add compatibility branches, feature flags, or fallback paths unless a bounded migration requires them and they are removed in the same phase.
22
+ - Do not leave temporary cross-layer patches in place after the owning-layer fix is available.
23
+ - Do not use this skill for pure redesign, greenfield architecture, or broad refactors whose goal is to rebase the system; use the more appropriate skill for that work.
24
+
25
+ ## Exception Rule
26
+ If the owning layer cannot be changed in the current phase because of an external dependency, a hard compatibility constraint, or an unowned migration boundary, allow a temporary outer-layer patch only when it is isolated, explicitly time-bounded, and paired with a tracked follow-up to move the rule inward.
27
+
28
+ ## Output Contract
29
+ - Owning layer identified
30
+ - Change made at that layer
31
+ - Obsolete outer-layer logic removed or retained with a reason
32
+ - Tests updated at the owning layer
33
+ - Exception used, if any, with the follow-up plan
@@ -1,4 +1,4 @@
1
1
  interface:
2
2
  display_name: "Edit At The Right Layer"
3
- short_description: "Apply changes at the true ownership layer"
4
- default_prompt: "Use $edit-at-the-right-layer to locate the source-of-truth ownership layer, implement the change there, and remove outer-layer patches or duplicated logic."
3
+ short_description: "Implement existing behavior at its owning layer"
4
+ default_prompt: "Use $edit-at-the-right-layer when the main decision is where an existing behavior should be owned. Trace to the source-of-truth layer, change it there, remove outer-layer workarounds or duplicate checks, and avoid using this skill for broad redesigns."
@@ -1,28 +1,72 @@
1
1
  ---
2
2
  name: execution-reset
3
- description: Recover momentum in long-running implementation plans when progress degrades into tiny local edits, repeated patching, or phase drift. Use when working from a referenced plan or roadmap and the current session is stalled, compacted, or no longer completing meaningful milestones. Reconstruct actual progress from the codebase, detect whether the current phase is stuck, and choose the next substantial work package that advances or completes the phase.
3
+ description: Recover stalled mid-execution work on a referenced implementation plan when progress has degraded into local edits, repeated patching, or phase drift. Use only after a phase has already started and the current session is no longer advancing a concrete milestone. Reconstruct actual progress from the codebase, test for a stall, and select the next substantial work package that advances or completes the active phase.
4
4
  ---
5
5
 
6
- Rebuild state from the current codebase and the referenced plan, not from memory.
7
-
8
- 1. Identify the active phase and its intended outcome.
9
- 2. Inspect the current implementation and determine:
10
- - complete
11
- - partial
12
- - missing
13
- - broken or stale
14
- 3. Decide whether execution is stalled.
15
- 4. If stalled, restate the current phase as concrete system behavior.
16
- 5. Pick exactly one substantial work package that will:
17
- - complete a sub-milestone
18
- - unblock the main dependency
19
- - or finish the end-to-end path
20
- 6. Execute that package.
21
- 7. Re-check whether system capability materially increased.
22
-
23
- Use this output shape:
24
-
25
- ## Execution Reset
6
+ ## Core Instruction
7
+ Reset execution from evidence, not memory, when an in-progress phase has stalled and the next meaningful unit of work is unclear.
8
+
9
+ ## Required Inputs
10
+ You must have all of the following before you act:
11
+ 1. A referenced plan or roadmap.
12
+ 2. The active phase or checkpoint within that plan.
13
+ 3. The relevant workspace or codebase context needed to inspect current state.
14
+
15
+ ## Blocked Behavior
16
+ If any required input is missing, do not infer it, do not continue, and do not propose a reset package.
17
+ State exactly which input is missing and request it.
18
+
19
+ ## Trigger Boundary
20
+ Use this skill only when:
21
+ 1. Work on the current phase has already started.
22
+ 2. The current session is not advancing the phase toward completion.
23
+ 3. The problem is execution drift, not plan creation, backlog grooming, or initial scoping.
24
+
25
+ Do not use this skill at plan start or for ordinary planning questions.
26
+
27
+ ## Stall Test
28
+ Treat execution as stalled when inspection shows at least one of the following:
29
+ - Three consecutive implementation attempts have changed files or run checks without moving any acceptance condition from missing or partial to complete.
30
+ - The same local area has been patched twice or more in the current phase without producing a measurable milestone change.
31
+ - The current state is still partial, broken, or stale after a review of the codebase, and no next step can be named that clearly advances the phase end-to-end.
32
+ - Progress is limited to micro-edits, reformatting, or cleanup that does not change the phase outcome.
33
+
34
+ The stall test is objective: if none of the conditions above hold, do not declare a reset.
35
+
36
+ ## Workflow
37
+ 1. Identify the active phase and its intended outcome from the plan.
38
+ 2. Inspect the codebase and classify the phase state as complete, partial, missing, or broken/stale.
39
+ 3. Apply the stall test.
40
+ 4. If stalled, restate the phase as concrete system behavior and identify one work package that will complete a sub-milestone, unblock the main dependency, or complete the end-to-end path.
41
+ 5. Execute only that work package.
42
+ 6. Re-check whether the change moved at least one acceptance condition from missing or partial to complete.
43
+
44
+ ## Rules
45
+ - Do not continue with micro-edits unless they directly unblock the selected work package.
46
+ - Do not polish incomplete phases.
47
+ - Do not trust prior session context over the codebase.
48
+ - Do not select more than one work package per reset cycle.
49
+ - Do not expand scope to adjacent cleanup unless it is required for the chosen package to finish.
50
+
51
+ ## Exception Rule
52
+ You may relax the stall test only when the workspace evidence shows a phase-critical blocker outside the current code path, such as a missing prerequisite, unavailable dependency, or an upstream change that makes the current plan invalid. This exception is bounded:
53
+ - The blocker must be named.
54
+ - The blocker must be evidenced in the inspected state.
55
+ - The response must switch to blocker resolution, not continued execution.
56
+
57
+ ## Stop Condition
58
+ Stop the reset cycle immediately when one of these is true:
59
+ - The selected package cannot be executed because a required input is still missing.
60
+ - The selected package fails to move at least one acceptance condition from missing or partial to complete after a concrete attempt.
61
+ - The inspected codebase shows the phase is no longer the right unit of work.
62
+
63
+ ## Next Action If Reset Package Fails
64
+ If the chosen package fails, do not chain into a second package. Report the blocker, the evidence, and the smallest next question or dependency needed to continue.
65
+
66
+ ## Output Contract
67
+ Use this shape:
68
+
69
+ ### Execution Reset
26
70
  ### Active Phase
27
71
  [phase]
28
72
 
@@ -36,20 +80,13 @@ Use this output shape:
36
80
  - Broken/stale: [...]
37
81
 
38
82
  ### Stall Diagnosis
39
- [why progress is not advancing]
83
+ [why the stall test passed, or why it did not]
40
84
 
41
85
  ### Next Work Package
42
- [one substantial chunk]
86
+ [one substantial chunk, or the blocker if execution is stopped]
43
87
 
44
88
  ### Definition of Done
45
- [concrete completion conditions]
89
+ [concrete completion conditions for the package]
46
90
 
47
91
  ### Plan Correction
48
92
  [only if the plan is locally stale]
49
-
50
- Rules:
51
- - Do not continue with micro-edits unless they directly unblock the chosen work package.
52
- - Do not polish incomplete phases.
53
- - Do not trust prior session context over the codebase.
54
- - Prefer end-to-end completion over local cleanup.
55
- - Revise the current phase if the original plan no longer matches reality, but do not rewrite the whole roadmap unless necessary.
@@ -1,4 +1,4 @@
1
1
  interface:
2
2
  display_name: "Execution Reset"
3
- short_description: "Reset stalled plan execution and restore phase progress"
4
- default_prompt: "Use $execution-reset with the active plan path and current phase to reset execution momentum and drive meaningful checklist progress."
3
+ short_description: "Recover stalled mid-execution work on an active plan phase"
4
+ default_prompt: "Use $execution-reset only after a plan phase has already started and execution has stalled; provide the referenced plan, the active phase, and the relevant workspace context so the skill can inspect current state, test for a stall, and pick one substantial next work package."
@@ -0,0 +1,120 @@
1
+ ---
2
+ name: find-duplicate-ownership
3
+ description: Find duplicate ownership, hidden second sources of truth, and contract drift in layered codebases. Use when reviewing normalization, validation, defaulting, canonicalization, persistence mapping, runtime-vs-durable state, duplicated helpers, query or cache ownership, or any "who owns this rule?" architecture question. Especially useful for SSOT audits across frontend, backend, shared core, and adapter layers, and when the user explicitly asks for duplicate-ownership exploration with subagents.
4
+ ---
5
+
6
+ # Find Duplicate Ownership
7
+
8
+ ## Overview
9
+
10
+ Audit the codebase for multiply-owned rules instead of blindly grepping `normalize`.
11
+ Classify each case as real SSOT drift, local dedupe cleanup, legitimate boundary work, or legitimate domain constraint.
12
+
13
+ ## Workflow
14
+
15
+ 1. Define the audit target before searching.
16
+ Narrow by feature, contract, package, service, or file slice when possible.
17
+ Good targets: session state, persistence contracts, runtime geometry, provider options, path helpers, JSON canonicalization.
18
+
19
+ 2. Build a taxonomy first.
20
+ Use these buckets:
21
+ - `architecture / SSOT bug`: same business rule owned in more than one layer
22
+ - `local dedupe cleanup`: same helper semantics copied nearby
23
+ - `legitimate boundary adapter`: wire, vendor, or untrusted input transformation with one clear owner
24
+ - `legitimate domain constraint`: runtime clamp, math, security, or path logic that cannot be removed architecturally
25
+
26
+ 3. Search for ownership smells, not words.
27
+ Look for:
28
+ - validation, defaults, or clamps duplicated across frontend and backend
29
+ - generated bindings or shared type aliases hiding the real contract owner
30
+ - runtime mutators calling boundary repair or coercion
31
+ - persisted shape differing from runtime shape and requiring glue
32
+ - query, store, or cache logic re-owning domain policy
33
+ - two helpers with the same semantics but different names
34
+ - thin wrapper functions that hide a second path
35
+ - copied deterministic serializers or hash inputs
36
+ - local component, hook, or service helper clones instead of one domain owner
37
+
38
+ 4. Separate true duplicates from valid boundaries.
39
+ Do not flag these by default:
40
+ - pure UI formatting or presentation transforms
41
+ - provider or protocol adapters with one clear boundary owner
42
+ - security or path canonicalization with one clear security owner
43
+ - runtime-only clamp or math logic with one clear runtime owner
44
+
45
+ 5. For each finding, name the winning owner.
46
+ Always answer:
47
+ - what exact rule is multiply owned
48
+ - who owns it today
49
+ - who should own it
50
+ - what gets deleted in a hard cut
51
+ - whether anything remains as real boundary adapter code
52
+
53
+ ## Heuristics
54
+
55
+ - Be suspicious when frontend and backend both shape or repair the same contract.
56
+ - Be suspicious when trusted runtime state is "normalized" after every mutation.
57
+ - Be suspicious when query glue, cache glue, or store glue maps between two supposedly canonical state shapes.
58
+ - Be suspicious when multiple languages or services define the same min, max, enum, or default constants independently.
59
+ - Be suspicious when a helper exists in a domain library and again in a hook, component, controller, or service.
60
+
61
+ ## Subagent Use
62
+
63
+ Only use subagents when the user explicitly asks for them or asks for parallel exploration.
64
+
65
+ Reusable read-only agent definitions live in `.codex/agents/`:
66
+
67
+ - `ownership_taxonomy_mapper.toml`
68
+ Use first for broad slice mapping and taxonomy.
69
+ - `duplicate_ownership_explorer.toml`
70
+ Use one per independent slice: persistence, runtime state, contracts, helpers, adapters.
71
+ - `ssot_judge.toml`
72
+ Use after explorers when you need one strict verdict on winning owner and hard-cut cleanup.
73
+
74
+ Recommended fan-out:
75
+
76
+ - 1 taxonomy mapper
77
+ - 2 to 5 explorers for disjoint slices
78
+ - 1 SSOT judge to merge and challenge findings
79
+
80
+ Tell subagents:
81
+
82
+ - stay read-only
83
+ - cite files and symbols
84
+ - do not propose compatibility shims
85
+ - distinguish duplicate ownership from legitimate boundary work
86
+ - return winner owner plus delete or keep plan
87
+
88
+ ## Output Contract
89
+
90
+ For each finding, return:
91
+
92
+ 1. severity
93
+ 2. rule or contract being multiply owned
94
+ 3. competing owners
95
+ 4. why it is a duplicate-owner bug or why it is legitimate boundary work
96
+ 5. exact files or symbols
97
+ 6. recommended single owner
98
+ 7. hard-cut cleanup:
99
+ - delete
100
+ - keep
101
+ - rename
102
+ 8. classification:
103
+ - architecture / SSOT bug
104
+ - local dedupe cleanup
105
+ - legitimate boundary adapter
106
+ - legitimate domain constraint
107
+
108
+ Order findings by severity, then finish with a prioritized backlog by impact versus effort.
109
+
110
+ ## Prompting
111
+
112
+ Use prompt patterns from references/audit-prompts.md.
113
+
114
+ ## Guardrails
115
+
116
+ - Do not reduce the audit to `rg normalize`.
117
+ - Do not flag every adapter or clamp as bad architecture.
118
+ - Do not recommend wrappers, fallbacks, shims, or dual paths.
119
+ - Prefer deleting the losing owner, not introducing a mediator.
120
+ - If ownership is ambiguous because the diff is mixed or the contract is unclear, say so explicitly.
@@ -0,0 +1,89 @@
1
+ # Audit Prompts
2
+
3
+ ## Generic Full Audit
4
+
5
+ ```text
6
+ Use $find-duplicate-ownership to audit this codebase for duplicate ownership and hidden second sources of truth.
7
+
8
+ Goal:
9
+ Find places where the same business rule, normalization, validation, canonicalization, defaulting, mapping, or persistence policy is owned in more than one place.
10
+
11
+ Focus on:
12
+ - frontend and backend owning the same contract differently
13
+ - runtime mutators re-applying boundary repair or coercion
14
+ - duplicate helpers with the same semantics but different names
15
+ - thin wrappers that hide a second path
16
+ - validation or default constants duplicated across layers
17
+ - serialization or canonicalization logic copied across modules
18
+ - local helper clones in hooks, components, controllers, or services instead of one domain owner
19
+ - persistence shapes that differ from runtime shapes and require translation glue
20
+ - query, cache, or store logic acting as a second owner of domain rules
21
+
22
+ Do not flag as problems by default:
23
+ - pure UI-only formatting
24
+ - security or path sandbox canonicalization with one clear owner
25
+ - vendor or protocol adapters that are clearly boundary-only
26
+ - necessary runtime clamp or math logic with one clear owner
27
+
28
+ For each finding, output:
29
+ 1. severity
30
+ 2. rule or contract being multiply owned
31
+ 3. current competing owners
32
+ 4. why this is duplicate ownership rather than legitimate boundary work
33
+ 5. exact files or symbols
34
+ 6. recommended single owner
35
+ 7. hard-cut cleanup plan: delete / keep / rename
36
+ 8. classification
37
+
38
+ Start with a taxonomy, then concrete findings ordered by severity.
39
+ ```
40
+
41
+ ## Layered-App Audit
42
+
43
+ ```text
44
+ Use $find-duplicate-ownership to audit this layered application for duplicate ownership.
45
+
46
+ Primary targets:
47
+ - runtime state versus durable state
48
+ - API contract ownership
49
+ - persistence mapping
50
+ - query, cache, or store ownership
51
+ - duplicated helper ownership in UI, services, domain libraries, and adapters
52
+
53
+ Repository policy:
54
+ - hard cut only
55
+ - one canonical current-state implementation
56
+ - no shims
57
+ - no fallbacks
58
+ - no compatibility glue
59
+ - fail fast
60
+ - one source of truth per business rule
61
+
62
+ Deliver:
63
+ - a taxonomy first
64
+ - then concrete findings with file paths and symbols
65
+ - then a prioritized refactor backlog by impact versus effort
66
+ - clearly separate real SSOT bugs from harmless local utilities
67
+
68
+ Be especially suspicious of code that normalizes after reading trusted state or after mutating already-canonical runtime state.
69
+ ```
70
+
71
+ ## Parallel Subagent Audit
72
+
73
+ ```text
74
+ Use $find-duplicate-ownership to audit this codebase for duplicate ownership.
75
+ Spawn one `ownership-taxonomy-mapper`, three `duplicate-ownership-explorer` agents for disjoint slices, and one `ssot-judge`.
76
+ Wait for all of them and merge the result.
77
+
78
+ Slices:
79
+ 1. runtime state and persistence
80
+ 2. contracts, helpers, and canonicalization
81
+ 3. adapters, queries, and caches
82
+
83
+ Return:
84
+ - shared taxonomy
85
+ - concrete findings by slice
86
+ - merged severity order
87
+ - winning owner for each finding
88
+ - hard-cut delete or keep or rename plan
89
+ ```
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: foundational-redesign
3
- description: Use for code changes, refactors, and migrations when quality matters. Treat the request as if it had been a foundational assumption from day one, inspect the current system, choose the clean target shape, implement direct replacement, and aggressively delete obsolete legacy code unless coexistence is explicitly required.
3
+ description: Use for non-trivial code changes, refactors, or migrations where the right answer is to redesign the system around a new or corrected assumption instead of patching the current shape. Use when the change affects architecture, data flow, interfaces, or long-lived abstractions; do not use for trivial bug fixes, cosmetic edits, or one-line patches.
4
4
  ---
5
5
 
6
6
  # Foundational Redesign
@@ -20,19 +20,24 @@ For each change, examine the existing system and redesign it into the most elega
20
20
  5. Implement with direct replacement and aggressively delete legacy seams or compatibility scaffolding unless coexistence is explicitly required.
21
21
  6. Before stopping, re-read every changed file (mandatory), compare against the current plan and agreed scope, and continue working if any gap remains.
22
22
 
23
- ## Output contract for non-trivial changes
23
+ ## Rules
24
24
 
25
- Summarize:
25
+ - Do not start redesigning until you have inspected the current shape and the approved scope.
26
+ - Do not preserve legacy branches, adapters, or compatibility scaffolding unless coexistence is explicitly required.
27
+ - Do not execute a non-trivial architecture, interface, or data-model redesign unless the user has seen and agreed to the redesign decision.
28
+ - Do not call the work complete unless every changed file has been re-read and the result matches the agreed scope.
26
29
 
27
- - current shape
28
- - target shape
29
- - redesign decision confirmed with user (for non-trivial redesign)
30
- - what legacy code was deleted
31
- - what verification was run
32
- - any remaining gap to close
30
+ ## Exception Rule
31
+
32
+ Relax the direct-replacement and legacy-deletion rules only when the approved scope explicitly requires coexistence, migration bridging, or phased rollout. In that case, keep the bridge minimal, state the removal condition, and do not extend the exception beyond the approved scope.
33
33
 
34
- ## Gotchas
34
+ ## Output Contract
35
35
 
36
- - Do not preserve legacy branches by default "just in case".
37
- - Do not call work complete before the mandatory final file re-read.
38
- - Do not stop at partial scope; continue until approved scope is actually satisfied.
36
+ Always report:
37
+
38
+ - current shape
39
+ - target shape
40
+ - redesign decision confirmed with user, or `not needed`
41
+ - legacy code removed, or `none`
42
+ - verification run
43
+ - remaining gap, or `none`
@@ -1,4 +1,4 @@
1
1
  interface:
2
2
  display_name: "Foundational Redesign"
3
- short_description: "Redesign from first principles and delete legacy seams"
4
- default_prompt: "Use $foundational-redesign for this change: inspect the existing system, design the clean target shape as if this requirement were foundational from the start, replace directly, and aggressively remove obsolete legacy code unless coexistence is explicitly required."
3
+ short_description: "Use for non-trivial redesigns that should replace the current shape"
4
+ default_prompt: "Use $foundational-redesign for this change if it alters architecture, data flow, interfaces, or long-lived abstractions: inspect the current system, design the clean target shape as if this requirement were foundational from the start, replace directly, and remove legacy seams unless coexistence is explicitly required."
@@ -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