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.
- package/package.json +1 -1
- package/templates/.agents/skills/collapse-fragmented-modules/SKILL.md +31 -52
- package/templates/.agents/skills/collapse-fragmented-modules/agents/openai.yaml +4 -0
- package/templates/.agents/skills/edit-at-the-right-layer/SKILL.md +24 -17
- package/templates/.agents/skills/edit-at-the-right-layer/agents/openai.yaml +2 -2
- package/templates/.agents/skills/execution-reset/SKILL.md +68 -31
- package/templates/.agents/skills/execution-reset/agents/openai.yaml +2 -2
- package/templates/.agents/skills/find-duplicate-ownership/SKILL.md +120 -0
- package/templates/.agents/skills/find-duplicate-ownership/agents/openai.yaml +0 -0
- package/templates/.agents/skills/find-duplicate-ownership/references/audit-prompts.md +89 -0
- package/templates/.agents/skills/foundational-redesign/SKILL.md +18 -13
- package/templates/.agents/skills/foundational-redesign/agents/openai.yaml +2 -2
- package/templates/.agents/skills/hard-cut/SKILL.md +78 -0
- package/templates/.agents/skills/hard-cut/agents/openai.yaml +4 -0
- package/templates/.agents/skills/legibility-pass/SKILL.md +30 -26
- package/templates/.agents/skills/legibility-pass/agents/openai.yaml +2 -2
- package/templates/.agents/skills/make-invariants-explicit/SKILL.md +57 -26
- package/templates/.agents/skills/make-invariants-explicit/agents/openai.yaml +2 -2
- package/templates/.agents/skills/plan-start/SKILL.md +65 -28
- package/templates/.agents/skills/plan-start/agents/openai.yaml +4 -0
- package/templates/.agents/skills/plan-swarm-audit/SKILL.md +50 -6
- package/templates/.agents/skills/plan-swarm-audit/agents/openai.yaml +2 -2
- package/templates/.agents/skills/planning/SKILL.md +115 -62
- package/templates/.agents/skills/planning/agents/openai.yaml +2 -2
- package/templates/.agents/skills/replace-dont-layer/SKILL.md +68 -22
- package/templates/.agents/skills/replace-dont-layer/agents/openai.yaml +4 -0
- package/templates/.agents/skills/root-cause-finder/SKILL.md +70 -0
- package/templates/.agents/skills/root-cause-finder/agents/openai.yaml +0 -0
- package/templates/.agents/skills/test-writing/SKILL.md +53 -39
- package/templates/.agents/skills/test-writing/agents/openai.yaml +2 -2
- package/templates/.agents/skills/verify-codebase-coherence/SKILL.md +26 -27
- package/templates/.agents/skills/verify-codebase-coherence/agents/openai.yaml +3 -3
- package/templates/.agents/skills/verify-completeness/SKILL.md +38 -27
- package/templates/.agents/skills/verify-completeness/agents/openai.yaml +2 -2
- package/templates/.codex/agents/duplicate_ownership_explorer.toml +17 -0
- package/templates/.codex/agents/ownership_taxonomy_mapper.toml +16 -0
- package/templates/.codex/agents/ssot_judge.toml +17 -0
- package/templates/.codex/config.toml +12 -0
- package/templates/managed-agents-block.md +1 -0
|
@@ -2,35 +2,74 @@
|
|
|
2
2
|
name: planning
|
|
3
3
|
description: >
|
|
4
4
|
Interview-driven planning methodology that produces implementation-ready plans.
|
|
5
|
-
Use for new features,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
Use for non-trivial implementation work such as new features, refactors, migrations,
|
|
6
|
+
architecture changes, or ambiguous bugs that require repo exploration and product
|
|
7
|
+
clarification. Do not use for tiny obvious edits, straightforward one-file changes,
|
|
8
|
+
or post-implementation closeout. Ask multiple rounds of clarifying questions about
|
|
9
|
+
behavior, constraints, edge cases, and architecture; explore the repo before deciding;
|
|
10
|
+
and write the final plan into `.waypoint/plans/` so it persists in the repo.
|
|
10
11
|
---
|
|
11
12
|
|
|
12
13
|
# Planning
|
|
13
14
|
|
|
14
|
-
Good plans prove you understand the problem. Size matches complexity
|
|
15
|
+
Good plans prove you understand the problem. Size matches complexity: a rename might be 20 lines, a complex feature might be 500.
|
|
15
16
|
|
|
16
|
-
|
|
17
|
+
The handoff test: could someone implement this plan without asking you questions? If not, find what is missing.
|
|
17
18
|
|
|
18
|
-
## When
|
|
19
|
+
## When To Use This Skill
|
|
20
|
+
|
|
21
|
+
- Use it for new feature work, refactors, migrations, architecture changes, or bugs where the right fix depends on repo exploration plus product or architectural clarification.
|
|
22
|
+
- Use it when the request can affect contracts, schemas, data flow, compatibility, or multiple call sites.
|
|
23
|
+
- Use it when a durable plan doc will help someone else implement the change without re-discovering the problem.
|
|
19
24
|
|
|
20
|
-
|
|
21
|
-
- Skip it when the user explicitly wants implementation right away and the work is already straightforward.
|
|
22
|
-
- Skip it for post-implementation closeout; use the review or hygiene workflows for that.
|
|
25
|
+
Examples:
|
|
23
26
|
|
|
24
|
-
|
|
27
|
+
- Use: "Add a new billing flow with backend and frontend changes."
|
|
28
|
+
- Use: "Refactor the event pipeline to a new payload shape."
|
|
29
|
+
- Use: "Migrate the job runner to a new queue contract."
|
|
30
|
+
- Do not use: "Fix a typo in one markdown file."
|
|
31
|
+
- Do not use: "Rename this single variable in one function."
|
|
32
|
+
- Do not use: "Make this one-line styling tweak and ship it."
|
|
25
33
|
|
|
26
|
-
|
|
34
|
+
## When Not To Use This Skill
|
|
27
35
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
36
|
+
- Do not use it for tiny obvious edits where the overhead of a full planning pass would cost more than it saves.
|
|
37
|
+
- Do not use it for straightforward implementation that fits cleanly in one local change and does not need interview-driven discovery.
|
|
38
|
+
- Do not use it for post-implementation closeout; use the review or hygiene workflows for that.
|
|
39
|
+
|
|
40
|
+
## Ordered Workflow
|
|
41
|
+
|
|
42
|
+
1. Classify the request.
|
|
43
|
+
- Decide whether the work needs full planning or the reduced-depth exception.
|
|
44
|
+
- Identify the likely surface area: product behavior, architecture, migration, refactor, or local edit.
|
|
45
|
+
2. Read the routed workspace context.
|
|
46
|
+
- Read `AGENTS.md`.
|
|
47
|
+
- Read `.waypoint/WORKSPACE.md`.
|
|
48
|
+
- Read `.waypoint/ACTIVE_PLANS.md`.
|
|
49
|
+
- Read `.waypoint/DOCS_INDEX.md`.
|
|
50
|
+
- Read `.waypoint/context/SNAPSHOT.md`.
|
|
51
|
+
- Read the routed docs relevant to the task.
|
|
52
|
+
3. Explore the codebase.
|
|
53
|
+
- Find the real entry points.
|
|
54
|
+
- Trace callers, imports, and data flow.
|
|
55
|
+
- Inspect adjacent modules that already solve similar problems.
|
|
56
|
+
- Identify constraints the change must respect.
|
|
57
|
+
4. Interview the user.
|
|
58
|
+
- Ask 2-4 focused questions.
|
|
59
|
+
- Ask about behavior, edge cases, users, tradeoffs, and architecture.
|
|
60
|
+
- Do not ask for facts that the repo or routed docs already answer.
|
|
61
|
+
5. Repeat exploration and interviewing until the plan is grounded.
|
|
62
|
+
- Keep drilling until you can explain what exists today, what changes, what could go wrong, and what decisions remain.
|
|
63
|
+
6. Choose the plan depth.
|
|
64
|
+
- Use the full planning shape by default.
|
|
65
|
+
- Use the reduced-depth exception only when the task qualifies under the exception rule below.
|
|
66
|
+
7. Write or update the durable plan doc.
|
|
67
|
+
- Put it under `.waypoint/plans/`.
|
|
68
|
+
- Choose the smallest routed location that matches the work.
|
|
69
|
+
- Update `.waypoint/ACTIVE_PLANS.md` when the plan is approved or changes phase.
|
|
70
|
+
8. Self-review the plan against real code.
|
|
71
|
+
- Verify state invariants, transaction boundaries, and the current tooling.
|
|
72
|
+
- Remove assumptions that are not backed by the repo or routed docs.
|
|
34
73
|
|
|
35
74
|
## Output Location
|
|
36
75
|
|
|
@@ -57,7 +96,7 @@ Keep looping until you can explain:
|
|
|
57
96
|
|
|
58
97
|
## Interviewing
|
|
59
98
|
|
|
60
|
-
|
|
99
|
+
Interviewing is the most important part of planning. You cannot build what you do not understand. Every unasked product, behavior, edge-case, or architecture question is an assumption that will break during implementation.
|
|
61
100
|
|
|
62
101
|
Interview iteratively: 2-4 questions -> answers -> deeper follow-ups -> repeat. Each round should go deeper.
|
|
63
102
|
|
|
@@ -73,45 +112,55 @@ Ask aggressively about:
|
|
|
73
112
|
- what tradeoffs are acceptable
|
|
74
113
|
- what architecture direction the user wants
|
|
75
114
|
|
|
76
|
-
Do
|
|
115
|
+
Do not spend those questions on implementation facts that can be learned from reading the code, routed docs, or external docs already linked by the repo.
|
|
77
116
|
|
|
78
117
|
Push back when something seems off. Neutrality is not the goal; correctness is.
|
|
79
118
|
|
|
80
|
-
##
|
|
119
|
+
## Plan Content
|
|
81
120
|
|
|
82
|
-
|
|
121
|
+
Plans document your understanding. Include what matters for this task.
|
|
83
122
|
|
|
84
|
-
|
|
123
|
+
### Mandatory in every plan
|
|
85
124
|
|
|
86
|
-
|
|
125
|
+
- **Current State**: What exists today, including the relevant files, data flow, constraints, and existing patterns.
|
|
126
|
+
- **Changes**: Every file to create, modify, or delete, and how the changes connect.
|
|
127
|
+
- **Decisions**: Why this approach, tradeoffs, and assumptions.
|
|
128
|
+
- **Phase breakdown**: Distinct execution phases in the order they should happen.
|
|
129
|
+
- **Scope checklist**: Concrete implementation items that can be marked done or not done.
|
|
130
|
+
- **Acceptance criteria**: What must be true when each phase is done.
|
|
131
|
+
- **Non-Goals**: Explicitly out of scope items to prevent implementation drift.
|
|
132
|
+
- **TL;DR**: A short summary for quick review.
|
|
87
133
|
|
|
88
|
-
|
|
89
|
-
- trace callers and imports
|
|
90
|
-
- inspect nearby modules solving similar problems
|
|
91
|
-
- identify existing patterns worth following
|
|
92
|
-
- identify constraints that the change must respect
|
|
134
|
+
### Conditional artifacts
|
|
93
135
|
|
|
94
|
-
|
|
136
|
+
Add these only when the work actually needs them:
|
|
95
137
|
|
|
96
|
-
|
|
138
|
+
- **Legacy seam inventory**: Required for migrations, refactors, or compatibility-sensitive replacements where legacy readers, writers, consumers, or tests still depend on the old shape.
|
|
139
|
+
- **Removals**: Required when obsolete code, compatibility logic, dead branches, or unused files will be deleted.
|
|
140
|
+
- **Phase checkpoints**: Required when the change needs explicit phase gates, review passes, or staged verification before moving on.
|
|
141
|
+
- **File strategy**: Required when multiple files or new files need justification, locality control, or split decisions.
|
|
142
|
+
- **Test strategy**: Required when the work needs a deliberate minimal test set and the risk is not obvious from the change itself.
|
|
143
|
+
- **Grep gates**: Required when the plan must prove that legacy symbols or shapes are gone before a phase completes.
|
|
144
|
+
- **Cleanup expectations**: Required when the implementation must delete replaced paths before the work is complete.
|
|
145
|
+
- **Test cases**: Required for behavioral changes where concrete input -> expected output examples prevent ambiguity.
|
|
146
|
+
- **Docs/workspace updates**: Required when the change affects durable project behavior or operator-facing guidance.
|
|
147
|
+
Any new or updated routable doc under `.waypoint/docs/` or `.waypoint/plans/` must include `summary`, `last_updated`, and `read_when` frontmatter so `DOCS_INDEX` can route it.
|
|
97
148
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
-
|
|
103
|
-
-
|
|
104
|
-
-
|
|
105
|
-
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
-
|
|
110
|
-
-
|
|
111
|
-
-
|
|
112
|
-
-
|
|
113
|
-
- **Test cases**: For behavioral changes, include input -> expected output examples
|
|
114
|
-
- **Non-Goals**: Explicitly out of scope to prevent implementation drift
|
|
149
|
+
### Reduced-Depth Exception Rule
|
|
150
|
+
|
|
151
|
+
Use a reduced-depth plan only when all of the following are true:
|
|
152
|
+
|
|
153
|
+
- The request is small and localized.
|
|
154
|
+
- The change does not alter schemas, contracts, compatibility boundaries, or multi-step data flow.
|
|
155
|
+
- The likely implementation fits in a narrow set of files.
|
|
156
|
+
- The user wants planning support, but a full interview-and-audit pass would add more overhead than value.
|
|
157
|
+
|
|
158
|
+
When this exception applies:
|
|
159
|
+
|
|
160
|
+
- Ask at most one focused clarification round.
|
|
161
|
+
- Read only the directly relevant files and immediate neighbors.
|
|
162
|
+
- Produce a shorter plan doc that keeps `Current State`, `Changes`, `Decisions`, `Scope checklist`, `Acceptance criteria`, `Test strategy`, and `Non-Goals`.
|
|
163
|
+
- Omit `Legacy seam inventory`, `Grep gates`, and `Phase checkpoints` unless the request unexpectedly grows in scope.
|
|
115
164
|
|
|
116
165
|
Use ASCII diagrams when they clarify flow, layering, or state.
|
|
117
166
|
|
|
@@ -128,18 +177,18 @@ Before presenting the plan, verify against real code:
|
|
|
128
177
|
|
|
129
178
|
## Rules
|
|
130
179
|
|
|
131
|
-
- No TBD
|
|
132
|
-
- No "we'll figure it out during implementation"
|
|
133
|
-
- No literal code unless the user explicitly wants it
|
|
134
|
-
- No pretending you verified something you
|
|
135
|
-
- Approved scope must be explicit enough to act as an execution contract after user approval
|
|
136
|
-
- The plan must be explicit enough to support phase-by-phase execution and checkpoints without rediscovering the intended order in chat
|
|
137
|
-
- Migration and refactor plans should include a legacy seam inventory before implementation starts
|
|
138
|
-
- Migration and refactor phases should include exact grep gates for the legacy symbols being removed
|
|
139
|
-
- Refactor and replacement plans should explicitly call out what legacy or obsolete code will be removed instead of preserving it by default
|
|
180
|
+
- No TBD.
|
|
181
|
+
- No "we'll figure it out during implementation."
|
|
182
|
+
- No literal code unless the user explicitly wants it.
|
|
183
|
+
- No pretending you verified something you did not.
|
|
184
|
+
- Approved scope must be explicit enough to act as an execution contract after user approval.
|
|
185
|
+
- The plan must be explicit enough to support phase-by-phase execution and checkpoints without rediscovering the intended order in chat.
|
|
140
186
|
- Do not split files by concern labels alone. A new file requires a clear boundary, reuse need, or size reason.
|
|
141
187
|
- Do not inflate tests by default. Start from a small high-signal set and expand only when risk justifies it.
|
|
142
|
-
- If the user approves the plan, do not silently defer or drop checklist items later; discuss any proposed scope change first
|
|
188
|
+
- If the user approves the plan, do not silently defer or drop checklist items later; discuss any proposed scope change first.
|
|
189
|
+
- For migrations and refactors, include the conditional legacy seam inventory and exact grep gates required by the work.
|
|
190
|
+
- For refactors and replacements, call out what legacy or obsolete code will be removed instead of preserving it by default.
|
|
191
|
+
- If the reduced-depth exception applies, do not force the full artifact set just to satisfy a template.
|
|
143
192
|
|
|
144
193
|
If the change touches durable project behavior, include docs/workspace updates in the plan.
|
|
145
194
|
Write or update the durable plan doc under `.waypoint/plans/` as part of the skill, not as an optional follow-up.
|
|
@@ -158,9 +207,10 @@ A good durable plan doc usually includes:
|
|
|
158
207
|
4. Phase breakdown
|
|
159
208
|
5. Scope checklist
|
|
160
209
|
6. Acceptance criteria
|
|
161
|
-
7.
|
|
162
|
-
8.
|
|
163
|
-
|
|
210
|
+
7. Verification
|
|
211
|
+
8. TL;DR
|
|
212
|
+
|
|
213
|
+
Include `Legacy seam inventory`, `Phase checkpoints`, `Grep gates`, and `Cleanup expectations` only when the conditional rules above require them.
|
|
164
214
|
|
|
165
215
|
## Final Response
|
|
166
216
|
|
|
@@ -168,7 +218,9 @@ When the plan doc is written:
|
|
|
168
218
|
|
|
169
219
|
- give a short chat summary
|
|
170
220
|
- include the doc path
|
|
221
|
+
- state whether the plan is full-depth or reduced-depth
|
|
171
222
|
- call out any unresolved decisions that still need the user's input
|
|
223
|
+
- list which artifacts are mandatory and which are conditional for this task
|
|
172
224
|
- if there are no unresolved decisions and the user approves the plan, treat that approval as authorization to execute the plan end to end rather than asking again at each obvious next step
|
|
173
225
|
- once approved, update `.waypoint/ACTIVE_PLANS.md` so the active plan, current phase, and current checkpoint are visible during execution
|
|
174
226
|
- once approved, use the plan's checklist, phase checkpoints, and acceptance criteria to decide whether the work is actually done; if anything approved is skipped, report that as partial work or ask to change scope instead of calling it complete
|
|
@@ -187,6 +239,7 @@ If the plan would make the implementer ask "where does this hook in?" or "what e
|
|
|
187
239
|
- Do not leave grep gates implicit. Name the exact legacy symbols or shapes that must be gone before the phase can move forward.
|
|
188
240
|
- Do not dump a transcript into the plan doc. Distill the decisions and requirements into a clean implementation handoff.
|
|
189
241
|
- Do not treat a reviewed plan as a stopping point. Once the user approves it, the workflow expects execution to continue.
|
|
242
|
+
- Do not use the reduced-depth exception for work that crosses contracts, data flow, or compatibility boundaries.
|
|
190
243
|
|
|
191
244
|
## Keep This Skill Sharp
|
|
192
245
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
interface:
|
|
2
2
|
display_name: "Planning"
|
|
3
|
-
short_description: "Interview, explore, and write
|
|
4
|
-
default_prompt: "Use $planning
|
|
3
|
+
short_description: "Interview, explore, and write a durable plan for non-trivial implementation work"
|
|
4
|
+
default_prompt: "Use $planning for non-trivial implementation work that needs interview-driven repo exploration and a durable plan doc in .waypoint/plans/. For tiny obvious edits or one-file changes, use the reduced-depth path or skip planning."
|
|
@@ -1,32 +1,78 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: replace-dont-layer
|
|
3
|
-
description: Prevent
|
|
3
|
+
description: Prevent a replacement change from being layered on top of an old path. Use when an existing implementation, flow, abstraction, or behavior already has a clear old path and the requested change is to replace it, redirect traffic to the new path, and remove obsolete glue in the same change. Do not use for additive-only work, broad redesigns, or schema/state hard cuts.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
# Replace Don't Layer
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Replace the old path. Do not add the new path beside it.
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
## Core Instruction
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
- redirect callers to the new path
|
|
14
|
-
- remove or deprecate the old path
|
|
15
|
-
- delete obsolete conditionals, adapters, and compatibility glue
|
|
16
|
-
- update tests to reflect the intended single path
|
|
12
|
+
When the requested change is a replacement, the codebase must end with one clear active path, and the old path must be removed, redirected, or explicitly fenced at a real compatibility boundary in the same work.
|
|
17
13
|
|
|
18
|
-
|
|
19
|
-
- keep duplication to the minimum necessary
|
|
20
|
-
- make the temporary path explicit
|
|
21
|
-
- attach a concrete removal condition
|
|
22
|
-
- add a brief in-code comment only if it materially helps future cleanup, and make it specific rather than a vague TODO
|
|
14
|
+
## When To Use
|
|
23
15
|
|
|
24
|
-
|
|
16
|
+
Use this skill when all of the following are true:
|
|
25
17
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
18
|
+
1. There is already an old implementation path in the codebase.
|
|
19
|
+
2. The change is meant to replace that path, not add a separate alternative.
|
|
20
|
+
3. Leaving both paths alive would create split behavior, duplicated logic, or hidden fallback handling.
|
|
21
|
+
4. The work is not primarily a schema migration, persisted-state cutover, or architecture redesign.
|
|
22
|
+
|
|
23
|
+
Do not use this skill when the change is truly additive and both paths are intentionally independent.
|
|
24
|
+
|
|
25
|
+
## Default Workflow
|
|
26
|
+
|
|
27
|
+
1. Identify the old path, the proposed new path, and every live caller or producer/consumer that touches them.
|
|
28
|
+
2. Classify the change as one of three cases:
|
|
29
|
+
- replacement
|
|
30
|
+
- additive and independent
|
|
31
|
+
- transitional with a bounded compatibility bridge
|
|
32
|
+
3. If the change is replacement, update the owning layer first, then redirect callers to the new path, then delete obsolete adapters, branches, flags, and duplicate code.
|
|
33
|
+
4. If the change is additive, keep both paths only when they serve distinct responsibilities and do not share behavior that should be unified.
|
|
34
|
+
5. If the change is transitional, keep the bridge minimal, name the removal condition, and schedule the cleanup in the same change set.
|
|
35
|
+
6. Re-check the diff for any code that still silently preserves the old path, even indirectly through helper functions, compatibility branches, or fallback routing.
|
|
36
|
+
|
|
37
|
+
## Rules
|
|
38
|
+
|
|
39
|
+
- Do not leave both old and new paths active by default.
|
|
40
|
+
- Do not add a new path beside the old one just to reduce immediate risk.
|
|
41
|
+
- Do not preserve compatibility glue after the redirection is complete.
|
|
42
|
+
- Do not leave hidden fallback behavior, duplicate branching, or parallel implementations in place.
|
|
43
|
+
- Do not use vague TODO comments as a cleanup plan.
|
|
44
|
+
- Do not call the change complete while old logic still handles the same traffic, data, or behavior behind the scenes.
|
|
45
|
+
- Do not use this skill to justify broad redesign work that belongs under `foundational-redesign`.
|
|
46
|
+
- Do not use this skill to police schema or persisted-state compatibility that is already governed by `hard-cut`.
|
|
47
|
+
|
|
48
|
+
## Exception Rule
|
|
49
|
+
|
|
50
|
+
Keep an old path only at a real compatibility boundary that cannot be removed in the same change.
|
|
51
|
+
|
|
52
|
+
The exception is allowed only when the old path is required for one of these:
|
|
53
|
+
|
|
54
|
+
- already persisted user or system data
|
|
55
|
+
- on-disk or database state that must still load
|
|
56
|
+
- an external wire format or process boundary
|
|
57
|
+
- a documented public or supported contract
|
|
58
|
+
|
|
59
|
+
When the exception applies:
|
|
60
|
+
|
|
61
|
+
- isolate it to the exact boundary function, file, or adapter
|
|
62
|
+
- keep the bridge as small as possible
|
|
63
|
+
- name the concrete removal condition
|
|
64
|
+
- avoid spreading compatibility logic to callers or new codepaths
|
|
65
|
+
|
|
66
|
+
## Output Contract
|
|
67
|
+
|
|
68
|
+
Return a short implementation summary that states:
|
|
69
|
+
|
|
70
|
+
- the old path
|
|
71
|
+
- the new path
|
|
72
|
+
- the decision: replacement, additive, or transitional
|
|
73
|
+
- what was removed or redirected
|
|
74
|
+
- whether any compatibility boundary remains
|
|
75
|
+
- the exact removal condition if a transitional bridge remains
|
|
76
|
+
- the verification performed
|
|
77
|
+
|
|
78
|
+
If the work is incomplete, say exactly what remains instead of implying it is done.
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
interface:
|
|
2
|
+
display_name: "Replace Don't Layer"
|
|
3
|
+
short_description: "Replace an existing path instead of layering the new one on top"
|
|
4
|
+
default_prompt: "Use $replace-dont-layer when a change is intended to replace an existing implementation path. Identify the old path and the new path, redirect callers to the new path, remove obsolete glue in the same change, and keep coexistence only at a real compatibility boundary."
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: root-cause-finder
|
|
3
|
+
description: Performs root-cause-first debugging and review by tracing expected behavior to the first unintended side effect before changing contracts, parsing, or types. Use when debugging protocol errors, deserialization failures, null payloads, missing fields, restore or hydration issues, state-ownership bugs, unexpected requests, background mutations, or reviewing junior-created code where the visible failure may be downstream noise.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Root-Cause Finder
|
|
7
|
+
|
|
8
|
+
## Core Instruction
|
|
9
|
+
|
|
10
|
+
Before fixing the error, prove whether the code path that produced it was intended.
|
|
11
|
+
|
|
12
|
+
Do not stop at the first contract, parsing, type, null, or schema error. Treat it as a possible symptom.
|
|
13
|
+
|
|
14
|
+
## Default Workflow
|
|
15
|
+
|
|
16
|
+
1. State the expected behavior in plain language.
|
|
17
|
+
2. State the invariant in one sentence.
|
|
18
|
+
3. State what definitely did not happen.
|
|
19
|
+
4. Trace the causal chain from the intended action or system event to the observed system effect.
|
|
20
|
+
5. Ask whether the request or mutation should have happened at all.
|
|
21
|
+
6. Identify the canonical source of truth and every competing source.
|
|
22
|
+
7. Find the first unintended side effect or write.
|
|
23
|
+
8. Only then decide whether a downstream contract fix is still necessary.
|
|
24
|
+
|
|
25
|
+
## Questions To Answer In Order
|
|
26
|
+
|
|
27
|
+
1. What user action or system event was supposed to happen?
|
|
28
|
+
2. What exact call path caused this request or response?
|
|
29
|
+
3. Should this request, mutation, or side effect have happened at all under the expected behavior and invariants?
|
|
30
|
+
4. Who owns the state at each layer?
|
|
31
|
+
5. Is there observer-driven syncing, lifecycle startup code, persistence restore, retry logic, background work, or multiple sources of truth causing an unintended side effect?
|
|
32
|
+
6. If a contract is violated, is the contract wrong, or did unintended logic reach the contract?
|
|
33
|
+
|
|
34
|
+
## Rules
|
|
35
|
+
|
|
36
|
+
- Do not make the contract more permissive unless you can prove the observed payload is intended in the final design.
|
|
37
|
+
- Prefer fixing the upstream logic bug over accepting bad downstream data.
|
|
38
|
+
- Separate symptom, trigger, root cause, minimal safe fix, and architectural follow-up.
|
|
39
|
+
- If a low-level fix is still needed, explain why the upstream fix is not sufficient or why both are required.
|
|
40
|
+
- Identify the correct layer to fix first.
|
|
41
|
+
- Name the first visible wrong behavior, not only the final error.
|
|
42
|
+
|
|
43
|
+
## Hidden Write Checks
|
|
44
|
+
|
|
45
|
+
Treat non-explicit writes as suspicious by default.
|
|
46
|
+
|
|
47
|
+
- Audit lifecycle hooks, callbacks, subscribers, watchers, interceptors, middleware, retries, background jobs, cache refreshers, persistence restore, scheduled tasks, and startup code.
|
|
48
|
+
- Check whether derived data is being mirrored into another store, cache, file, queue, session, or database through an observer or helper layer.
|
|
49
|
+
- Prefer explicit command handlers, request handlers, job runners, or user actions as writers; treat startup-time and background writes as suspects until proven intentional.
|
|
50
|
+
- If a framework has automatic reactivity or lifecycle execution, map this rule onto its equivalent constructs without assuming the framework behavior is correct.
|
|
51
|
+
|
|
52
|
+
## Output Format
|
|
53
|
+
|
|
54
|
+
Use this structure:
|
|
55
|
+
|
|
56
|
+
- Expected behavior
|
|
57
|
+
- Invariant
|
|
58
|
+
- What definitely did not happen
|
|
59
|
+
- Bug class
|
|
60
|
+
- Causal chain from intended action to system effect
|
|
61
|
+
- First unintended side effect
|
|
62
|
+
- Canonical source of truth
|
|
63
|
+
- Competing sources of truth
|
|
64
|
+
- Symptom
|
|
65
|
+
- Trigger
|
|
66
|
+
- Root cause
|
|
67
|
+
- Correct layer to fix first
|
|
68
|
+
- Minimal safe fix
|
|
69
|
+
- Architectural follow-up
|
|
70
|
+
- Proposed patch
|
|
File without changes
|
|
@@ -1,52 +1,66 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: test-writing
|
|
3
|
-
description:
|
|
3
|
+
description: Choose and write the smallest durable automated test set for a non-trivial code change when test selection is ambiguous or high-value. Use when adding or modifying tests for a behavior change, regression fix, refactor, or other change where multiple test scopes are plausible and durable coverage matters. Do not use for documentation-only edits, cosmetic changes, or straightforward one-test maintenance.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
# Test Writing
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
## Mission
|
|
9
|
+
Choose the smallest durable automated test set that proves the requested change and protects the highest-risk behavior.
|
|
9
10
|
|
|
10
|
-
Default
|
|
11
|
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
11
|
+
## Default Workflow
|
|
12
|
+
1. Identify the contract.
|
|
13
|
+
- State the behavior that must hold after the change.
|
|
14
|
+
- Identify the smallest surface that can prove it.
|
|
15
|
+
- Check whether existing tests already cover the contract.
|
|
16
|
+
2. Rank the risks.
|
|
17
|
+
- Main path
|
|
18
|
+
- Highest-value failure path or boundary
|
|
19
|
+
- Regression that motivated the change
|
|
20
|
+
- Non-trivial pure logic
|
|
21
|
+
3. Select the minimum set.
|
|
22
|
+
- Choose one test per distinct risk.
|
|
23
|
+
- Prefer the highest-level test that proves the contract.
|
|
24
|
+
- Add unit tests only for non-trivial pure logic that is not already covered.
|
|
25
|
+
4. Remove redundancy.
|
|
26
|
+
- Drop tests that restate confidence already provided by a stronger test.
|
|
27
|
+
- Reject assertions that depend on implementation choreography instead of outcomes.
|
|
28
|
+
5. Verify sufficiency.
|
|
29
|
+
- Confirm every chosen test has a distinct reason to exist.
|
|
30
|
+
- Confirm the set is still small enough to maintain through refactors.
|
|
31
|
+
6. Report the decision.
|
|
32
|
+
- State what was chosen, what was omitted, why the set is sufficient, and what remains at risk.
|
|
14
33
|
|
|
15
|
-
|
|
34
|
+
## Rules
|
|
35
|
+
- Do not add a test unless it protects a distinct behavior or failure mode.
|
|
36
|
+
- Do not mirror implementation structure in test structure.
|
|
37
|
+
- Do not test trivial helpers, pass-through glue, or obvious mappings unless they contain a real bug risk.
|
|
38
|
+
- Do not add redundant tests across layers unless the lower-level test covers a different risk than the higher-level test.
|
|
39
|
+
- Do not use brittle assertions on incidental DOM shape, private calls, exact class strings, or unstable snapshots.
|
|
40
|
+
- Do not expand to a matrix of cases by default.
|
|
41
|
+
- Do not optimize for test count; optimize for unique confidence.
|
|
42
|
+
- For frontend work, do not choose structural assertions when a user-visible assertion can prove the behavior.
|
|
43
|
+
- For backend or domain logic, do not skip contract, invariant, permission, validation, or state-transition coverage when those are the real risks.
|
|
16
44
|
|
|
17
|
-
|
|
18
|
-
-
|
|
19
|
-
- protect important business rules and invariants
|
|
20
|
-
- cover meaningful boundaries and failure modes
|
|
21
|
-
- survive refactors
|
|
22
|
-
- exercise public interfaces rather than private helpers
|
|
45
|
+
## Exception Rule
|
|
46
|
+
Expand beyond the default budget only when the change introduces an additional high-risk contract that cannot be covered by the same test without losing clarity or coverage.
|
|
23
47
|
|
|
24
|
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
- test trivial helpers, thin wrappers, pass-through glue, or obvious mappings
|
|
28
|
-
- encode fragile structure such as incidental DOM shape, exact class strings, private function calls, or unstable snapshots
|
|
29
|
-
- expand a feature into a large matrix of low-value cases unless the risk truly requires it
|
|
48
|
+
The default budget is 2 tests:
|
|
49
|
+
- 1 main-path test
|
|
50
|
+
- 1 highest-value edge, boundary, or failure-path test
|
|
30
51
|
|
|
31
|
-
|
|
52
|
+
You may expand to 3 tests only if all of the following are true:
|
|
53
|
+
- each added test covers a distinct high-risk behavior
|
|
54
|
+
- no existing test already proves the same contract
|
|
55
|
+
- a combined test would hide an important failure mode or become unreadable
|
|
32
56
|
|
|
33
|
-
|
|
34
|
-
- prefer stable user-visible behavior over structural assertions
|
|
35
|
-
- add automated regression tests only when the behavior is worth protecting and likely to remain stable
|
|
36
|
-
- do not add large numbers of UI tests for cosmetic or refactor-sensitive details
|
|
57
|
+
Never exceed 4 total tests without explicit human approval.
|
|
37
58
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
-
|
|
59
|
+
## Output Contract
|
|
60
|
+
Return the decision in this shape:
|
|
61
|
+
- Chosen tests: list each test and the risk it covers.
|
|
62
|
+
- Omitted tests: list notable tests you did not write and why.
|
|
63
|
+
- Rationale: explain why the selected set is sufficient and minimal.
|
|
64
|
+
- Residual risk: name what remains untested and why that risk is acceptable.
|
|
41
65
|
|
|
42
|
-
If
|
|
43
|
-
|
|
44
|
-
Before finishing, remove or avoid any test whose main effect is to make future refactors harder without protecting an important contract.
|
|
45
|
-
|
|
46
|
-
Rules:
|
|
47
|
-
- Do not optimize for test count.
|
|
48
|
-
- Do not mirror the implementation structure in the test structure.
|
|
49
|
-
- Do not create one test per helper by default.
|
|
50
|
-
- Do not add redundant tests across layers unless a distinct risk justifies them.
|
|
51
|
-
- Do not test trivial code just because it exists.
|
|
52
|
-
- Prefer the smallest durable set that gives high confidence.
|
|
66
|
+
If no new test is needed, say that explicitly and explain which existing test already covers the contract.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
interface:
|
|
2
2
|
display_name: "Test Writing"
|
|
3
|
-
short_description: "
|
|
4
|
-
default_prompt: "Use $test-writing to
|
|
3
|
+
short_description: "Choose the smallest durable test set when test scope is not obvious"
|
|
4
|
+
default_prompt: "Use $test-writing to choose and add the smallest durable automated test set for this non-trivial change. Report the chosen tests, omitted tests, rationale, and residual risk."
|