opencode-codeops 1.4.0

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 (102) hide show
  1. package/CHANGELOG.md +179 -0
  2. package/LICENSE +21 -0
  3. package/README.md +171 -0
  4. package/_shared/auto-design.md +129 -0
  5. package/_shared/layout-convention.md +198 -0
  6. package/_shared/quality-profile.md +134 -0
  7. package/_shared/recommendation-hardening.md +166 -0
  8. package/_shared/scope-expansion-control.md +176 -0
  9. package/_shared/spec-first-ordering.md +79 -0
  10. package/_shared/zero-ambiguity-gate.md +311 -0
  11. package/agent-templates/codebase-scout.md +17 -0
  12. package/agent-templates/concurrency-auditor.md +5 -0
  13. package/agent-templates/design-challenger.md +26 -0
  14. package/agent-templates/financial-integrity-auditor.md +5 -0
  15. package/agent-templates/perf-auditor.md +23 -0
  16. package/agent-templates/phase-reviewer.md +54 -0
  17. package/agent-templates/plan-task-executor-opus.md +46 -0
  18. package/agent-templates/plan-task-executor.md +43 -0
  19. package/agent-templates/preflight-auditor.md +45 -0
  20. package/agent-templates/security-auditor.md +42 -0
  21. package/agent-templates/semantics-reviewer.md +5 -0
  22. package/agent-templates/spec-test-author.md +29 -0
  23. package/agents/concurrency-auditor.md +15 -0
  24. package/agents/correctness-reviewer.md +66 -0
  25. package/agents/demanding-executor.md +58 -0
  26. package/agents/design-challenger.md +38 -0
  27. package/agents/executor.md +55 -0
  28. package/agents/explorer.md +29 -0
  29. package/agents/financial-integrity-auditor.md +15 -0
  30. package/agents/performance-auditor.md +35 -0
  31. package/agents/preflight-auditor.md +57 -0
  32. package/agents/security-auditor.md +54 -0
  33. package/agents/semantics-reviewer.md +15 -0
  34. package/agents/spec-test-author.md +41 -0
  35. package/bin/codeops-worktree +244 -0
  36. package/bin/index.mjs +106 -0
  37. package/bin/install-agents.mjs +453 -0
  38. package/bin/install-skills.mjs +466 -0
  39. package/bin/lib/opencode-install.mjs +185 -0
  40. package/install.sh +55 -0
  41. package/package.json +73 -0
  42. package/plugin/index.ts +181 -0
  43. package/references/domains/compiler-and-language.md +28 -0
  44. package/references/domains/data-and-migration.md +22 -0
  45. package/references/domains/distributed-and-concurrent.md +26 -0
  46. package/references/domains/financial-system.md +28 -0
  47. package/references/domains/selection.md +19 -0
  48. package/references/domains/web-application.md +23 -0
  49. package/schemas/codeops-config.schema.json +56 -0
  50. package/scripts/check-version.mjs +163 -0
  51. package/scripts/codeops-migrate.sh +355 -0
  52. package/scripts/codeops-roadmap-compact.sh +232 -0
  53. package/scripts/codeops-roadmap-sync.sh +275 -0
  54. package/scripts/codeops_outcomes.py +155 -0
  55. package/scripts/codeops_plan.py +239 -0
  56. package/scripts/codeops_plan_migrate.py +318 -0
  57. package/scripts/codeops_worktree_snapshot.py +99 -0
  58. package/scripts/install_agents.py +288 -0
  59. package/scripts/release.mjs +533 -0
  60. package/skills/analyze-project/SKILL.md +28 -0
  61. package/skills/clean-comments/SKILL.md +22 -0
  62. package/skills/exec-plan/SKILL.md +267 -0
  63. package/skills/exec-plan/commit-modes.md +113 -0
  64. package/skills/exec-plan/execution-protocol.md +471 -0
  65. package/skills/git-commit/SKILL.md +35 -0
  66. package/skills/github-issues/SKILL.md +38 -0
  67. package/skills/grill-me/SKILL.md +342 -0
  68. package/skills/make-plan/SKILL.md +282 -0
  69. package/skills/make-plan/quality-checklist.md +96 -0
  70. package/skills/make-plan/templates.md +535 -0
  71. package/skills/make-plan/zero-ambiguity-gate.md +19 -0
  72. package/skills/make-requirements/SKILL.md +268 -0
  73. package/skills/make-requirements/discovery-phases.md +255 -0
  74. package/skills/make-requirements/review-and-add.md +73 -0
  75. package/skills/make-requirements/templates.md +296 -0
  76. package/skills/make-requirements/zero-ambiguity-gate.md +18 -0
  77. package/skills/outcome-review/SKILL.md +34 -0
  78. package/skills/preflight/SKILL.md +310 -0
  79. package/skills/preflight/dimensions.md +181 -0
  80. package/skills/preflight/report-format.md +300 -0
  81. package/skills/retro-requirements/SKILL.md +218 -0
  82. package/skills/retro-requirements/confidence-classification.md +45 -0
  83. package/skills/retro-requirements/phases.md +609 -0
  84. package/skills/retro-requirements/triage-gate.md +135 -0
  85. package/skills/roadmap/SKILL.md +381 -0
  86. package/skills/roadmap/stage-hooks.md +80 -0
  87. package/skills/roadmap/template.md +200 -0
  88. package/skills/setup-codeops/SKILL.md +94 -0
  89. package/skills/setup-codeops/migration.md +106 -0
  90. package/skills/setup-codeops/scaffold.md +99 -0
  91. package/skills/setup-routing/SKILL.md +102 -0
  92. package/skills/setup-routing/routing.md +44 -0
  93. package/skills/techdocs/SKILL.md +199 -0
  94. package/skills/techdocs/authoring-and-update.md +178 -0
  95. package/skills/techdocs/templates.md +655 -0
  96. package/skills/techdocs/vitepress-setup.md +143 -0
  97. package/skills/upgrade-plan/SKILL.md +75 -0
  98. package/skills/upgrade-plan/content-quality-gate.md +35 -0
  99. package/skills/upgrade-plan/upgrade-checklists.md +107 -0
  100. package/standards/coding-standards-full.md +124 -0
  101. package/standards/coding-standards.md +64 -0
  102. package/standards/output-style.md +17 -0
@@ -0,0 +1,342 @@
1
+ ---
2
+ name: grill-me
3
+ description: >-
4
+ Relentlessly interrogate a design to eliminate ambiguity before any planning,
5
+ requirements, or implementation work begins. Use for "grill me", "grill-me",
6
+ "disambiguate", "deep-dive", or "interview me about this". Runs a structured,
7
+ branch-by-branch interview: maps the design tree of major decision branches,
8
+ walks each branch surfacing options, assumptions, and sub-decisions one at a
9
+ time, resolves cross-branch dependencies, and confirms explicit shared
10
+ understanding. Acts as a senior architect conducting a design review — never
11
+ accepts vague answers, names every decision/assumption/constraint, resolves
12
+ dependencies first, and tracks the decision tree until zero ambiguity remains.
13
+ ---
14
+
15
+ # Deep Disambiguation Protocol (`grill-me`)
16
+
17
+ When the user types `grill-me` (with or without additional context), enter
18
+ **relentless interview mode** — a structured, branch-by-branch interrogation
19
+ designed to eliminate every ambiguity before any plan, requirement, or
20
+ implementation work begins.
21
+
22
+ > **CodeOps Artifact Schema**: 1
23
+
24
+ ## Core Directive
25
+
26
+ > **Interview the user relentlessly about every aspect of the topic until you reach a shared understanding. Walk down each branch of the design tree, resolving dependencies between decisions one-by-one.**
27
+
28
+ You are **NOT** a polite assistant trying to move fast. You are a **senior
29
+ architect conducting a design review**. Your job is to find every hole, every
30
+ ambiguity, every unstated assumption. Be thorough. Be persistent. Do not accept
31
+ vague answers — ask for specifics. Do not assume you understand — verify
32
+ explicitly.
33
+
34
+ Before you begin, read the project's AGENTS.md (or detected project
35
+ conventions) for project-specific constraints, if it exists.
36
+
37
+ ## When to Use
38
+
39
+ | Usage Pattern | What the User Types | What Happens |
40
+ |---|---|---|
41
+ | **Standalone deep-dive** | `grill-me` + topic description | Full interrogation on the topic. Output: shared understanding summary. |
42
+ | **Before planning** | `grill-me` → then `make-plan` | Grill-me resolves ambiguities before plan creation; feeds the make-plan skill's Phase 1C Zero-Ambiguity Gate as pre-resolved context. |
43
+ | **Before requirements** | `grill-me` → then `make-requirements` | Grill-me deeply explores the topic before structured RD authoring; feeds the make-requirements skill's Phase 2B gate. |
44
+ | **Focused on one area** | `grill-me on [specific topic]` | Targeted interrogation on a single aspect (e.g., "grill-me on the auth flow"). |
45
+
46
+ ## The Protocol
47
+
48
+ ### Step 1: Identify the Design Tree
49
+
50
+ After the user describes the topic, **do not start asking random questions**.
51
+ First, identify the **top-level decision branches** — the major design
52
+ dimensions that need to be resolved.
53
+
54
+ Present them as a map:
55
+
56
+ ```markdown
57
+ ## Design Tree for [Topic]
58
+
59
+ I see these major decision branches:
60
+
61
+ 1. **[Branch 1]** — [brief description of what needs to be decided]
62
+ 2. **[Branch 2]** — [brief description]
63
+ 3. **[Branch 3]** — [brief description]
64
+ 4. **[Branch 4]** — [brief description]
65
+
66
+ I'll walk through each one. Let's start with [Branch 1] since [Branch 2-4] depend on it.
67
+ ```
68
+
69
+ **Rules:**
70
+ - Identify 3-8 top-level branches (not more — you can discover sub-branches as you go)
71
+ - Order them by dependency — resolve foundational decisions first
72
+ - Name the dependencies explicitly: "We need to decide X before we can decide Y"
73
+
74
+ ### Step 2: Walk Each Branch
75
+
76
+ For each branch, follow this drilling pattern:
77
+
78
+ #### 2a. State the Decision
79
+
80
+ > "For [Branch X], we need to decide: **[the specific decision in one sentence]**"
81
+
82
+ #### 2b. Present Options
83
+
84
+ > "The common approaches are:
85
+ > 1. **[Option A]** — [what it means, when it's good]
86
+ > 2. **[Option B]** — [what it means, when it's good]
87
+ > 3. **[Option C]** — [what it means, when it's good]
88
+ >
89
+ > Which direction are you leaning, and why?"
90
+
91
+ **Rules:**
92
+ - Present ≥2 options only when ≥2 are genuinely viable; if one path clearly dominates, present it alone and name what you considered and dropped (never pad with strawmen)
93
+ - Include trade-offs for each option
94
+ - If the user's domain has industry-standard approaches, mention them
95
+ - If you have a recommendation, state it and explain why
96
+ - **Prefer structured multiple-choice prompts** where the active OpenCode surface provides them — an
97
+ enumerated option set with descriptions is exactly this shape. Fall back to numbered text
98
+ options where structured input is unavailable.
99
+
100
+ > **Grounded Options & Recommendations (coding standards → Working style) apply here.** Before presenting options/findings/recommendations: filter out non-viable ones (no strawmen; ≥2 only when ≥2 are genuinely viable, else present the single viable path and name what was rejected), second-guess each, verify any code-modifying option against the actual current code (cite `file:line`), and lead with a recommendation backed by grounded reasoning. Match ceremony to stakes — the user decides. Apply the recommendation-hardening protocol (`_shared/recommendation-hardening.md`) to consequential recommendations; challenger escalation follows ONLY that protocol's high-stakes definition — grill-me has no private trigger, and the user may always request a challenger explicitly.
101
+
102
+ #### 2c. Drill Into the Choice
103
+
104
+ After the user picks an option, **do not move on**. Drill deeper:
105
+
106
+ - "You chose [Option B]. That implies [consequence]. Is that acceptable?"
107
+ - "What about [edge case]? Does [Option B] still work there?"
108
+ - "This creates a dependency on [thing]. Have you considered that?"
109
+ - "How does this interact with [Branch Y] that we haven't resolved yet?"
110
+
111
+ #### 2d. Surface Assumptions
112
+
113
+ After each decision, explicitly state what is now assumed:
114
+
115
+ > "Based on this decision, I'm now assuming:
116
+ > - [Assumption 1]
117
+ > - [Assumption 2]
118
+ > - [Assumption 3]
119
+ >
120
+ > Are these correct?"
121
+
122
+ **This is mandatory.** The user must confirm assumptions before you proceed.
123
+
124
+ #### 2e. Resolve Sub-Branches
125
+
126
+ If a decision spawns sub-decisions, walk those before moving to the next
127
+ top-level branch:
128
+
129
+ ```
130
+ Branch 1: Caching Strategy
131
+ ├── Decision: What cache backend? → Redis
132
+ │ ├── Sub-decision: Cluster or standalone? → Standalone for now
133
+ │ └── Sub-decision: Connection pooling strategy? → ...
134
+ ├── Decision: Invalidation strategy? → TTL
135
+ │ ├── Sub-decision: Default TTL value? → ...
136
+ │ └── Sub-decision: Per-entity TTL overrides? → ...
137
+ └── Decision: Cache key naming convention? → ...
138
+ ```
139
+
140
+ ### Step 3: Check Cross-Branch Dependencies
141
+
142
+ After resolving all branches, check for cross-cutting concerns:
143
+
144
+ > "Now let me check how these decisions interact:
145
+ > - [Branch 1] chose [X], and [Branch 3] chose [Y]. These interact at [point]. Is [resolution] correct?"
146
+ > - "The combination of [decision A] + [decision B] means [implication]. Have you considered this?"
147
+
148
+ ### Step 4: Confirm Shared Understanding
149
+
150
+ Before concluding, present the full picture and explicitly ask:
151
+
152
+ ```markdown
153
+ ## Shared Understanding: [Topic]
154
+
155
+ ### Decisions Made
156
+
157
+ | # | Decision | Choice | Key Rationale |
158
+ |---|----------|--------|---------------|
159
+ | 1 | [Decision] | [Choice] | [Why] |
160
+ | 2 | [Decision] | [Choice] | [Why] |
161
+ | ... | ... | ... | ... |
162
+
163
+ ### Assumptions
164
+
165
+ - [Assumption 1]
166
+ - [Assumption 2]
167
+ - ...
168
+
169
+ ### Constraints Identified
170
+
171
+ - [Constraint 1]
172
+ - [Constraint 2]
173
+ - ...
174
+
175
+ ### Out of Scope (Explicitly Deferred)
176
+
177
+ <!-- Shared deferral format (_shared/zero-ambiguity-gate.md) — downstream gates accept these
178
+ rows as-is; all three parts are mandatory. -->
179
+ - ⏸ Deferred — [the decision, named precisely] · owner: [who decides] · revisit: [the trigger]
180
+
181
+ ### Open Risks
182
+
183
+ - [Risk 1] — [mitigation or acceptance]
184
+
185
+ ---
186
+
187
+ **Do you feel we've reached shared understanding on this topic?**
188
+ Are there any branches I missed, or decisions you want to revisit?
189
+ ```
190
+
191
+ **The user must explicitly confirm** before you move on or transition to another
192
+ protocol.
193
+
194
+ When opt-in outcome metrics are enabled, record only aggregate rounds, decisions, and deferrals
195
+ with an enumerated result. Never store the topic, questions, answers, or decision content.
196
+
197
+ ## Agent Behavior Rules
198
+
199
+ ### Rule 1: Never Accept Vague Answers
200
+
201
+ | User Says | Your Response |
202
+ |---|---|
203
+ | "Probably TTL" | "Let's make this concrete. What TTL value? 30 seconds? 5 minutes? 1 hour? What's the staleness tolerance?" |
204
+ | "We'll figure that out later" | "We can defer this, but let me name it so it's tracked: [decision]. Who owns it, and what triggers the revisit?" — record it in the shared deferral format (`⏸ Deferred — <decision> · owner · revisit-trigger`, per `_shared/zero-ambiguity-gate.md`), which the downstream gates accept as-is. Then: "Is it safe to defer, or does it block other decisions?" |
205
+ | "Something like X" | "Let me sharpen that. Do you mean [specific interpretation A] or [specific interpretation B]?" |
206
+ | "I'm not sure" | "That's fine. Let me lay out the options and trade-offs so we can decide together." |
207
+
208
+ ### Rule 2: One Decision at a Time (with a leaf-batching exception)
209
+
210
+ Never ask 5 unrelated questions in a batch. Walk through **one decision**, resolve it
211
+ fully (including sub-branches and assumptions), then move to the next. The user
212
+ should never feel overwhelmed.
213
+
214
+ **Exception — independent leaves:** once a branch's parent decision is resolved, its remaining
215
+ sub-decisions that are genuinely independent of each other (e.g. three TTL values, a set of
216
+ display labels) MAY be presented together — 3–5 at most, each with its own options. Batch only
217
+ leaves; never batch decisions that constrain each other.
218
+
219
+ ### Rule 3: Dependencies First
220
+
221
+ If Decision B depends on Decision A, resolve A first. Never ask the user to make
222
+ a dependent decision without its foundation. If you discover a dependency
223
+ mid-conversation, pause and say:
224
+
225
+ > "Wait — before we can decide [B], we need to resolve [A] first. Let me switch to that."
226
+
227
+ ### Rule 4: Name Everything
228
+
229
+ Every decision, assumption, constraint, and deferral gets a name. Anonymous
230
+ decisions become forgotten decisions. Use clear labels:
231
+
232
+ - "**Decision: Cache Backend**" — not "the caching thing"
233
+ - "**Assumption: Single-region deployment**" — not "we're assuming it's simple"
234
+ - "**Constraint: Must use existing PostgreSQL**" — not "the database is already there"
235
+
236
+ ### Rule 5: Track the Tree
237
+
238
+ Maintain an explicit map of the decision tree as you go. At any point, you should
239
+ be able to say:
240
+
241
+ > "We've resolved Branches 1-3. Branch 4 has two open sub-decisions. Branch 5 is untouched. Here's where we are: [tree visualization]"
242
+
243
+ ### Rule 6: Respect the User's Time
244
+
245
+ Being relentless does not mean being repetitive or pedantic. If the user gives a
246
+ detailed, specific answer that covers sub-branches, acknowledge it and move on.
247
+ The goal is **zero ambiguity**, not **maximum questions**.
248
+
249
+ ### Rule 7: Know When You're Done
250
+
251
+ The grill-me protocol is complete when:
252
+
253
+ - Every top-level branch has been walked
254
+ - Every decision has been made (or explicitly deferred with a name)
255
+ - All assumptions are surfaced and confirmed
256
+ - Cross-branch dependencies are checked
257
+ - The user has explicitly confirmed shared understanding
258
+
259
+ ## Integration with Other Skills
260
+
261
+ ### With the `make-plan` skill
262
+
263
+ When the user runs `grill-me` followed by `make-plan`:
264
+
265
+ 1. The grill-me shared understanding summary **replaces the clarifying-questions interview** at the start of make-plan
266
+ 2. Code/current-implementation analysis still runs — it is always needed
267
+ 3. Scope confirmation uses the grill-me summary as the baseline
268
+ 4. **🚨 The make-plan skill's Phase 1C (Zero-Ambiguity Gate) STILL FIRES** — grill-me feeds INTO the Ambiguity Register as pre-resolved context but does NOT replace the formal gate. You must still systematically scan all categories and compile the register. Items already resolved by grill-me are recorded as `✅ Resolved` with a reference to the grill-me session.
269
+ 5. The "Shared Understanding" document is saved alongside the plan documents as reference
270
+
271
+ ### With the `make-requirements` skill
272
+
273
+ When the user runs `grill-me` followed by `make-requirements`:
274
+
275
+ 1. The grill-me output **enhances the discovery phase** — the discovery interview is already deeply explored
276
+ 2. Comparable-systems analysis still runs — domain knowledge adds value on top of shared understanding
277
+ 3. User journeys and edge-case exploration are streamlined — many edge cases already surfaced during grill-me
278
+ 4. **🚨 The make-requirements skill's Phase 2B (Zero-Ambiguity Gate) STILL FIRES** — grill-me feeds INTO the Ambiguity Register as pre-resolved context but does NOT replace the formal gate. You must still systematically scan all categories and compile the register.
279
+ 5. The decisions and assumptions from grill-me feed directly into RD authoring
280
+
281
+ ### Standalone
282
+
283
+ When `grill-me` is used without a follow-up skill:
284
+
285
+ 1. Complete the full interrogation
286
+ 2. Present the shared understanding summary
287
+ 3. Ask: *"What would you like to do next? I can create a plan (the make-plan skill), start requirements (the make-requirements skill), or we can continue discussing."*
288
+
289
+ ## Session Management
290
+
291
+ ### Progress Persistence (save-as-you-go)
292
+
293
+ Notes are checkpointed **as the interview progresses, not on interruption** — a crash must lose
294
+ at most the branch in flight:
295
+
296
+ 1. **Location (fixed, layout-aware):** `<resolved plans dir>/_draft/grill-notes-<topic-slug>.md`
297
+ (flat: `plans/_draft/…`; nested: `codeops/features/<f>/plans/_draft/…` — resolve per
298
+ `_shared/layout-convention.md`; if no plans dir exists yet, create `_draft/` lazily).
299
+ 2. **Checkpoint cadence:** write/update the file after the design tree is mapped and after EACH
300
+ branch resolves — never only when the session "feels long".
301
+ 3. **Schema (minimal):** topic + date + git ref (or mtime) of any artifact under discussion;
302
+ the design tree; resolved decisions; confirmed assumptions; named deferrals (shared format);
303
+ remaining branches; which branch/step to resume from.
304
+
305
+ ### Resuming
306
+
307
+ When the user types `grill-me --continue`:
308
+
309
+ 1. Read the notes file from the resolved location.
310
+ 2. **Staleness check:** if a referenced artifact changed since the recorded ref/mtime, say so
311
+ and re-open the branches it affects.
312
+ 3. Summarize where you left off and continue from the next unresolved branch.
313
+
314
+ ### On completion
315
+
316
+ Fold the notes into the Shared Understanding summary and **delete the notes file** — a stale
317
+ notes file must never be picked up by a later `--continue` on a different topic (the schema's
318
+ topic line is the second guard: a mismatch is treated as stale and reported).
319
+
320
+ ## Technical Decisions
321
+
322
+ For technical decisions about architecture and patterns, defer to your project's
323
+ coding standards (AGENTS.md) so the resolved design stays consistent with
324
+ existing conventions.
325
+
326
+ ## Summary
327
+
328
+ | Trigger | Action |
329
+ |---------|--------|
330
+ | `grill-me` | Full deep-dive interrogation on a topic |
331
+ | `grill-me on [topic]` | Focused interrogation on a specific area |
332
+ | `grill-me --continue` | Resume an interrupted grill-me session |
333
+
334
+ **Typical Session Flow:**
335
+ ```
336
+ grill-me → identify design tree → walk each branch → resolve decisions →
337
+ surface assumptions → check cross-dependencies → confirm shared understanding →
338
+ (optional) make-plan or make-requirements
339
+ ```
340
+
341
+ **Output:** A shared understanding summary with all decisions, assumptions,
342
+ constraints, and deferrals — ready to feed into any downstream skill.
@@ -0,0 +1,282 @@
1
+ ---
2
+ name: make-plan
3
+ description: >-
4
+ Creates a detailed, multi-document implementation plan for a software feature or task before any code is written. Use when the user wants to "make a plan", types "make-plan", or asks to "plan this feature", "create an implementation plan", "plan out this work", or "write a spec/plan" for something to be built. Drives a mandatory clarifying-questions interview, a hard Zero-Ambiguity Gate, and produces a feature plan document set ending in a task-by-task execution plan. For EXECUTING an existing plan, use the exec-plan skill instead.
5
+ ---
6
+
7
+ # Implementation Plan Creation (`make-plan`)
8
+
9
+ Create a detailed, multi-document implementation plan for a software feature or task. This skill covers plan **creation** only. To **execute** a finished plan, use the **exec-plan skill**.
10
+
11
+ ## Auto-design option
12
+
13
+ If `$ARGUMENTS` contains exactly one exact standalone `--auto-design` token before the first `--` sentinel, remove it before resolving targets, paths, or modes; zero occurrences means normal mode, more than one is invalid, and tokens at or after the sentinel are target content; announce `Auto-design active — eligible technical decisions are
14
+ delegated and recorded`; then read and apply
15
+ [../../_shared/auto-design.md](../../_shared/auto-design.md). Resolve eligible architecture and
16
+ technical design decisions under that policy and propagate its downward-only context to explicitly
17
+ invoked supported children; an unsupported child fails closed. This mode does not grant action permission or scope expansion. **Normal mode:** without the exact token, every material choice
18
+ still requires an explicit user decision; historical delegated records must not infer delegated authority.
19
+
20
+ ## Scope exploration option
21
+
22
+ If `$ARGUMENTS` contains exactly one exact standalone `--explore-scope` token before the first `--` sentinel, remove it before resolving targets, paths, or modes; zero occurrences means strict scope, more than one is invalid, and tokens at or after the sentinel are target content; announce `Scope exploration active — optional additions will be proposed for your decision`; then read and apply
23
+ [../../_shared/scope-expansion-control.md](../../_shared/scope-expansion-control.md). Strict scope is the default:
24
+ do not report or plan optional additions. Exploration may propose `SE-*` items but
25
+ never accepts them; only the user may choose `Keep`.
26
+
27
+ ## Plan readiness proof
28
+
29
+ A plan is not ready merely because its documents exist. Before presenting it as executable,
30
+ directly confirm that its required documents exist, its `00-index.md` declares every implemented
31
+ RD on one `> **Implements**:` line, its ambiguity register has no open material item, and its
32
+ specification tests are ordered before implementation tasks. Run the semantic Zero-Ambiguity Gate.
33
+ Do not create a graph, readiness record, or transition request. `99-execution-plan.md` is the sole
34
+ mutable task-progress authority.
35
+
36
+ ## Planning scope contract
37
+
38
+ Record three boundaries before discovery:
39
+
40
+ | Boundary | Meaning |
41
+ |---|---|
42
+ | **Planning target** | The selected RD, task, or standalone feature the plan will implement |
43
+ | **Context artifacts** | Related requirements, plans, code, and docs read to verify the target |
44
+ | **Modification set** | The requirement/specification artifacts the user has authorized make-plan to change |
45
+
46
+ Reading an artifact does not authorize changing it. If planning exposes an upstream defect, reopen
47
+ the owning requirement or specification and mark affected downstream plan content stale, but do
48
+ not edit it until the user confirms the exact expanded modification set. If the correction would
49
+ redesign sibling RDs or the requirement set, pause and offer a separate requirements revision
50
+ instead of silently absorbing it into plan creation.
51
+
52
+ Apply the shared scope-expansion classification before adding any newly suggested functionality.
53
+ Every planned item must trace either to the confirmed scope baseline or to a user-kept `SE-*`
54
+ entry. A necessary correction is reported with its causal evidence but does not itself authorize an
55
+ expanded modification set. An optional idea is silent in strict scope and becomes a proposal only
56
+ with active scope exploration.
57
+
58
+ > **CodeOps Artifact Schema**: 1
59
+
60
+ ## What you produce
61
+
62
+ Re-run [../../references/domains/selection.md](../../references/domains/selection.md) before component decomposition. Requirements-stage lens selection is evidence, not a permanent assumption. Apply every selected lens to specifications, acceptance criteria, failure narratives, and test strategy.
63
+
64
+ A folder `plans/<feature-name>/` containing:
65
+
66
+ ```
67
+ plans/<feature-name>/
68
+ ├── 00-ambiguity-register.md # Zero-Ambiguity Gate register (audit trail)
69
+ ├── 00-index.md # Overview and navigation
70
+ ├── 01-requirements.md # Requirements and scope
71
+ ├── 02-current-state.md # Current implementation analysis
72
+ ├── 03-XX-<component>.md # Technical spec per component (one or more)
73
+ ├── 07-testing-strategy.md # Spec test cases + verification
74
+ └── 99-execution-plan.md # Phases, sessions, task checklist
75
+ ```
76
+
77
+ The full templates for every document live in **[templates.md](templates.md)** — read it before writing any plan document in Phase 2.
78
+
79
+ ## Resolve paths first (layout-aware)
80
+
81
+ Determine the layout via **[../../_shared/layout-convention.md](../../_shared/layout-convention.md)** before creating the plan folder:
82
+
83
+ - **Flat layout** (no marker): the plan folder is `plans/<feature-name>/`; `00-index.md` declares `> **Implements**: RD-NN` — exactly as flat layout always has.
84
+ - **Nested layout** (marker present): the plan folder is `codeops/features/<f>/plans/<plan>/`. **Ask/confirm the target feature** first (create the feature folder lazily if new — never guess). `00-index.md` declares a **feature-qualified** `> **Implements**: <feature>/RD-NN`, and any `> **Source**` link points at the feature's own `requirements/` dir. Everywhere below that says `plans/<feature-name>/` means this nested plan path.
85
+
86
+ ## Lightweight tasks (mini-plan path — both layouts)
87
+
88
+ Not every change is a feature. Ad-hoc work (a bugfix, chore, small change) is a **task** (`T-NN`), and a *non-trivial* task gets a **single mini-plan**, not the full multi-document set. When the work is a task (see the routing rule in **[../../_shared/layout-convention.md](../../_shared/layout-convention.md)**):
89
+
90
+ - Write **only** the mini-plan at the resolved task path (flat: `plans/<task-slug>/99-execution-plan.md`; nested: `codeops/features/<f>/plans/<task-slug>/99-execution-plan.md`) — an execution doc with an **Objective**, a **Smallest viable design**, a short **task checklist**, and a **Verify** line. **No** `00–07` docs, **no** RD, and no main Zero-Ambiguity Gate.
91
+ - Stamp it `> **Type**: Task (lightweight) · **Feature**: <f> · **CodeOps Artifact Schema**: 1` and a `> **Progress**:` line (in flat layout drop the `**Feature**:` part).
92
+ - Specification-first ordering still applies *when the task warrants tests* (e.g. a bugfix gets a regression test first); a trivial doc/config tweak may not.
93
+ - A **trivial** task needs no plan at all — it is just a roadmap row + the commit (point the user to the roadmap skill, then do the work).
94
+ - The shared Complexity Escalation Gate still applies before a mini-plan or direct trivial-task
95
+ execution. If the proposed approach triggers it, the task is not trivial: stop and run its
96
+ challenger and visible packet. An approved larger support surface means the work is no longer
97
+ lightweight. Use the full standalone-plan path below so the approval has an Ambiguity Register
98
+ owner. Do not add a second decision file to the mini-plan.
99
+
100
+ Mini-plan shape:
101
+
102
+ ```markdown
103
+ # Task T-05: Debounce the search input
104
+
105
+ > **Type**: Task (lightweight) · **Feature**: search · **CodeOps Artifact Schema**: 1
106
+ > **Progress**: 0/3 tasks (0%)
107
+
108
+ ## Objective
109
+ Debounce the search box to 300ms to cut redundant queries.
110
+
111
+ **Smallest viable design:** Reuse the existing input handler and timer utility; add no framework or
112
+ shared debounce subsystem.
113
+
114
+ ## Tasks
115
+ - [ ] T-05.1 Write a spec test: rapid keystrokes ⇒ one query after 300ms
116
+ - [ ] T-05.2 Implement the debounce; verify the test passes
117
+ - [ ] T-05.3 Full verify
118
+
119
+ **Verify**: [project verify command]
120
+ ```
121
+
122
+ Everything below is the **full feature** pipeline; skip it for tasks.
123
+
124
+ ## Project configuration
125
+
126
+ These rules are universal. For build/test/verify commands, package manager, structure, language conventions, and commit scope, read **the project's AGENTS.md (or detected project conventions)**. If there is no AGENTS.md, detect settings from manifest files (`package.json`, `Cargo.toml`, `go.mod`, `pyproject.toml`, `Makefile`, `docker-compose.yml`, `pom.xml`, `build.gradle`, `CMakeLists.txt`, `*.sln`, `*.csproj`). Use only facts you can read from those files — never invent settings.
127
+
128
+ ## Hard rules for every generated plan
129
+
130
+ - **No raw git commands in plan documents.** Plans must not contain `git add/commit/push` or bash blocks running git. When a plan needs to commit, it references the **git-commit skill** (commit) or **git-commit skill in push mode** (commit + push) command. Execution commit behavior is owned by the exec-plan skill.
131
+ - **Specification-first testing ordering is non-negotiable** (see Phase 2 and [templates.md](templates.md)): spec tests → red phase → implement → green phase → impl tests → verify.
132
+ - **Zero-Ambiguity Gate (Phase 1C) must pass before any plan document except its incrementally
133
+ persisted `00-ambiguity-register.md` is written.** No other exceptions.
134
+
135
+ ## Optional input: requirements documents
136
+
137
+ When a `requirements/` directory exists with `RD-XX-*.md` files (produced by the make-requirements skill), ask the user whether to base this plan on a specific RD. If they pick one, read it as primary input and shorten the Phase 1.1 interview (the RD answers most questions) — but still do Phase 1.2 current-state analysis and still run the Phase 1C gate. If they decline, run standard Phase 1. When a plan is based on an RD, `01-requirements.md` must include `> **Source**: [RD-XX](../../requirements/RD-XX-feature-name.md)` (in nested layout the relative link resolves within the same feature, e.g. `../../requirements/RD-XX-*.md` under `codeops/features/<f>/`) and `00-index.md` must declare `> **Implements**: RD-NN` — **feature-qualified** (`> **Implements**: <feature>/RD-NN`) in nested layout (used by the roadmap skill).
138
+
139
+ ---
140
+
141
+ ## Phase 1 — Information Gathering (MANDATORY)
142
+
143
+ ### 1.1 Ask clarifying questions
144
+
145
+ > **ZERO-AMBIGUITY RULE — active from the first question.** Applies to every decision with semantic weight: design, architecture, behavior, scope, edge cases, error messages, naming, file structure. Behavior/scope/data/security decisions ALWAYS gate; cosmetic choices with zero semantic impact are exempt (per the shared gate's semantic-impact exemptions), and low-stakes cosmetic items may be batched. In normal mode, if there is more than one semantically distinct option, the **user decides**. With active auto-design, resolve and record eligible technical decisions under the shared policy; reserved decisions still require the user. Demand concrete, specific answers. Do not fill gaps with assumptions, infer intent, or apply "reasonable defaults" outside that delegated policy. If an answer is vague, ask again with sharper options.
146
+
147
+ Cover at minimum: **Feature scope** (what it does / does NOT do, boundaries), **Technical context** (affected code, existing patterns, constraints), **Dependencies** (prerequisites, external deps), and **Success criteria** (definition of done, required tests, required docs).
148
+
149
+ ### 1.2 Analyze current implementation
150
+
151
+ Read relevant source files; identify affected components; find similar/reference patterns; note technical debt; review project docs and AGENTS.md. If `docs/index.md` exists with `techdocs: true` frontmatter, read the relevant architecture sections first (see the techdocs skill).
152
+
153
+ ### 1.3 Confirm scope
154
+
155
+ Present a scope confirmation (feature, IN scope, OUT of scope, key decisions needed) and ask the user to confirm or adjust. While doing this, start compiling the **Ambiguity Register** — finalized and enforced in Phase 1C.
156
+ This confirmation is the authorized scope baseline. Do not place optional suggestions in IN scope,
157
+ OUT of scope, or the Ambiguity Register in strict mode. With active scope exploration, collect them
158
+ separately in the Scope Expansion Register and wait for `Keep`, `Defer`, or `Discard` rulings.
159
+
160
+ ---
161
+
162
+ ## Phase 1B — Pre-Implementation Re-evaluation
163
+
164
+ Before writing documents (and again before each execution phase), re-check: Completeness (all requirements + edge cases), Context/Reasoning (can you justify each phase?), Task Granularity (2–4h tasks, independently testable), Dependencies (documented, no cycles), Testing (every task has validation), Architecture (anything >700 lines? plan a split), Scope Boundaries, No Dead Code, and Security (every user-input path identified; injection/auth/authz/rate-limiting/data protection addressed). Establish the smallest viable design as the baseline. Run every material support surface beyond it through the shared Complexity Escalation Gate. Re-evaluate when requirements change or new constraints surface.
165
+ Completeness, security, and edge-case review close the requested behavior; they do not authorize
166
+ adjacent features. Apply the necessary-correction burden of proof before treating newly discovered
167
+ work as required.
168
+
169
+ ---
170
+
171
+ ## Phase 1C — Zero-Ambiguity Gate (NON-NEGOTIABLE HARD GATE)
172
+
173
+ **This gate MUST pass before any plan document except the incrementally persisted Ambiguity
174
+ Register is created. No exceptions, no overrides, no "good enough."** Plans built on ambiguity
175
+ produce code the user did not ask for. Every item in every plan document must trace to an explicit,
176
+ user-confirmed decision.
177
+
178
+ The mechanism is the **Ambiguity Register** (`00-ambiguity-register.md`): a numbered inventory of every gap, ambiguity, unstated assumption, and open question, hunted systematically across all 12 categories. The full category checklist, register template, gate-enforcement rules, named-deferral policy, traceability requirement, surface-during-authoring rule, and interactions with the grill-me / upgrade-plan skills are in **[zero-ambiguity-gate.md](zero-ambiguity-gate.md)** — **read it now, before Phase 2.**
179
+
180
+ That shared protocol also owns the always-active **Complexity Escalation Gate**. A new layer,
181
+ dependency, harness, framework, infrastructure surface, cross-cutting refactor, or other material
182
+ support mechanism is blocked until its visible stop packet receives an independent challenger
183
+ verdict and explicit user approval. Record it as `Technical (complexity escalation)`. Auto-design
184
+ cannot approve the larger option.
185
+
186
+ When opt-in outcome metrics are enabled, record only the enumerated planning result and aggregate
187
+ round/decision counts. Never store feature names, questions, decisions, or artifact content.
188
+
189
+ Gate opens only under the shared gate contract: every row is either `✅ Resolved` or a fully named,
190
+ explicitly approved `⏸ Deferred` entry; normal mode has user confirmation of the complete register,
191
+ while auto-design mode has complete delegated provenance for every eligible resolution and user
192
+ confirmation for reserved ones; nothing is silently deferred; and the header reads
193
+ `✅ GATE PASSED`. A deferred decision cannot be implemented
194
+ by this plan unless it is later resolved. If zero ambiguities are found, still create the register
195
+ file proving the review ran. In normal mode, you may recommend an option but may never decide for
196
+ the user. With active auto-design, eligible technical decisions use the shared policy and reserved
197
+ decisions remain user-owned.
198
+
199
+ > **Grounded Options & Recommendations (coding standards → Working style) apply here.** Before presenting options/findings/recommendations: filter out non-viable ones (no strawmen; ≥2 only when ≥2 are genuinely viable, else present the single viable path and name what was rejected), second-guess each, verify any code-modifying option against the actual current code (cite `file:line`), and lead with a recommendation backed by grounded reasoning. Match ceremony to stakes. In normal mode, the user decides; active auto-design resolves eligible technical decisions and escalates reserved ones. **Recommendation hardening:** apply `_shared/recommendation-hardening.md` — for **high-stakes** Phase 1C gate decisions (complex/sensitive-tagged) spawn one independent challenger and reconcile *before* presenting; for all consequential decisions run the in-context layers and close with the `Confidence:` / `Hardening:` disclosure.
200
+
201
+ ---
202
+
203
+ ## Phase 2 — Create Plan Documents
204
+
205
+ 1. Create the plan folder (`plans/<feature-name>/` flat, or `codeops/features/<f>/plans/<plan>/` nested — resolve via the convention doc).
206
+ 2. Write each document using the templates in **[templates.md](templates.md)** — including its **Reference, don't restate** rule (one owning doc per fact; everything else cites ST-# / 03-doc § / AR-# with at most a one-line gloss). Stamp `00-index.md` and `99-execution-plan.md` with `> **CodeOps Artifact Schema**: 1`.
207
+ 3. Every design decision, scope decision, and error-handling strategy must carry an `AR #` back-reference to the register (only exceptions: universally obvious facts and zero-semantic-impact formatting).
208
+ 3b. Every addition accepted through scope exploration must also carry its owning `SE-*`
209
+ back-reference. `Defer`, `Discard`, and `Superseded` entries never produce plan tasks.
210
+ 4. `07-testing-strategy.md` must contain concrete **Specification Test Cases (ST-*)** with input→expected-output pairs, each traced to a requirement / spec doc / AR entry. Expectations come from the SPEC, never from imagined implementation behavior.
211
+ 4b. **Confirm the verify command once.** The command that fills every Verify line comes from the
212
+ project's AGENTS.md or manifests — state what you detected and have the user confirm it (an AR
213
+ entry like any decision). If nothing is detectable, ask — **never invent a command**.
214
+ 5. `99-execution-plan.md` must structure every feature phase with the mandatory three-session ordering (Spec Tests → Implementation → Impl Tests & Hardening), carrying each phase's tasks as a **single checkbox list** — the plan's single source of truth for progress; a task line appears exactly once in the document. The full ordering rules are in [templates.md](templates.md).
215
+ 6. If you discover a NEW ambiguity while writing, STOP immediately and add it to the register.
216
+ In normal mode get the user's decision; with active auto-design resolve an eligible technical
217
+ item under the shared policy or escalate a reserved item. Only then resume
218
+ (surface-during-authoring rule — see [zero-ambiguity-gate.md](zero-ambiguity-gate.md)).
219
+ 7. If authoring introduces or enlarges a material support surface, STOP and rerun the shared
220
+ Complexity Escalation Gate. Prior approval covers only the machinery and cost recorded in its
221
+ packet.
222
+
223
+ **Authoring convergence:** after two post-gate ambiguity batches, pause document creation and
224
+ reconfirm the planning target, context artifacts, and modification set. The user chooses whether
225
+ to return to discovery or stop with the plan incomplete. Do not keep alternating between document
226
+ generation and newly expanded discovery without that explicit scope decision.
227
+
228
+ Adapt component documents to the project type (Web App, API, Library, CLI, UI Components, Mobile, Compiler, Microservices, Infrastructure, Database, Bug Fix, Refactoring — the typical component breakdowns are listed in [templates.md](templates.md)).
229
+
230
+ ---
231
+
232
+ ## Phase 3 — Quality Checklist
233
+
234
+ Before finalizing, run the full quality checklist in **[quality-checklist.md](quality-checklist.md)** (Completeness, Granularity, Dependencies, Testing, Specification-First Testing, No Dead Code, Security-First, Zero-Ambiguity, Execution Plan Completeness, Format). The Specification-First, Security-First, Zero-Ambiguity, and Execution-Plan-Completeness blocks are NON-NEGOTIABLE.
235
+
236
+ ---
237
+
238
+ ## Phase 4 — Present Plan Summary
239
+
240
+ Report what was created:
241
+
242
+ ```markdown
243
+ ## Plan Created: [Feature Name]
244
+
245
+ **Location:** `plans/[feature-name]/`
246
+
247
+ **Documents Created:**
248
+ - 00-ambiguity-register.md ✅ (Zero-Ambiguity Gate — all items resolved)
249
+ - 00-index.md ✅
250
+ - 01-requirements.md ✅
251
+ - 02-current-state.md ✅
252
+ - [component docs] ✅
253
+ - 07-testing-strategy.md ✅
254
+ - 99-execution-plan.md ✅
255
+
256
+ **Summary:** Total Phases: X · Total Sessions: X · Estimated Time: X–X hours
257
+
258
+ **To begin implementation:** use the exec-plan skill on `[feature-name]`.
259
+ ```
260
+
261
+ ---
262
+
263
+ ## Phase 5 — Roadmap Sync
264
+
265
+ After the plan is created, sync the roadmap if one is in play:
266
+
267
+ - **If `plans/00-roadmap.md` exists:** set the implemented RD's row to stage `Plan Created` (📋) and link the new plan. The link is deterministic — `00-index.md` declares `> **Implements**: RD-NN`, and the row is matched from that line. A plan with no declared RD is linked only when the user explicitly says which RD (or `DEF-n`) it belongs to. Update the roadmap BEFORE moving on.
268
+ - **If it does NOT exist:** ask the user whether to create a roadmap. Never auto-create it silently.
269
+
270
+ See the **roadmap skill** for the full Roadmap Keeper protocol.
271
+
272
+ ---
273
+
274
+ ## Related skills
275
+
276
+ - **exec-plan skill** — executes a finished plan (`99-execution-plan.md`), commit modes, real-time progress updates, post-completion re-analysis.
277
+ - **grill-me skill** — deep disambiguation before planning; its shared understanding feeds into the register as pre-resolved context but does NOT replace the Phase 1C gate.
278
+ - **make-requirements skill** — produces the `RD-XX-*.md` documents this skill can consume.
279
+ - **roadmap skill** — `make-plan` sets `Plan Created`; the roadmap tracks stages.
280
+ - **upgrade-plan skill** — upgrades outdated plans; the gate applies to new decisions only.
281
+ - **techdocs skill** — architecture docs read during Phase 1.2 and updated during execution.
282
+ - For coding, testing, and git standards, follow **your project's coding standards (AGENTS.md)** and use **git-commit skill** / **git-commit skill in push mode** for commits.