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.
- package/CHANGELOG.md +179 -0
- package/LICENSE +21 -0
- package/README.md +171 -0
- package/_shared/auto-design.md +129 -0
- package/_shared/layout-convention.md +198 -0
- package/_shared/quality-profile.md +134 -0
- package/_shared/recommendation-hardening.md +166 -0
- package/_shared/scope-expansion-control.md +176 -0
- package/_shared/spec-first-ordering.md +79 -0
- package/_shared/zero-ambiguity-gate.md +311 -0
- package/agent-templates/codebase-scout.md +17 -0
- package/agent-templates/concurrency-auditor.md +5 -0
- package/agent-templates/design-challenger.md +26 -0
- package/agent-templates/financial-integrity-auditor.md +5 -0
- package/agent-templates/perf-auditor.md +23 -0
- package/agent-templates/phase-reviewer.md +54 -0
- package/agent-templates/plan-task-executor-opus.md +46 -0
- package/agent-templates/plan-task-executor.md +43 -0
- package/agent-templates/preflight-auditor.md +45 -0
- package/agent-templates/security-auditor.md +42 -0
- package/agent-templates/semantics-reviewer.md +5 -0
- package/agent-templates/spec-test-author.md +29 -0
- package/agents/concurrency-auditor.md +15 -0
- package/agents/correctness-reviewer.md +66 -0
- package/agents/demanding-executor.md +58 -0
- package/agents/design-challenger.md +38 -0
- package/agents/executor.md +55 -0
- package/agents/explorer.md +29 -0
- package/agents/financial-integrity-auditor.md +15 -0
- package/agents/performance-auditor.md +35 -0
- package/agents/preflight-auditor.md +57 -0
- package/agents/security-auditor.md +54 -0
- package/agents/semantics-reviewer.md +15 -0
- package/agents/spec-test-author.md +41 -0
- package/bin/codeops-worktree +244 -0
- package/bin/index.mjs +106 -0
- package/bin/install-agents.mjs +453 -0
- package/bin/install-skills.mjs +466 -0
- package/bin/lib/opencode-install.mjs +185 -0
- package/install.sh +55 -0
- package/package.json +73 -0
- package/plugin/index.ts +181 -0
- package/references/domains/compiler-and-language.md +28 -0
- package/references/domains/data-and-migration.md +22 -0
- package/references/domains/distributed-and-concurrent.md +26 -0
- package/references/domains/financial-system.md +28 -0
- package/references/domains/selection.md +19 -0
- package/references/domains/web-application.md +23 -0
- package/schemas/codeops-config.schema.json +56 -0
- package/scripts/check-version.mjs +163 -0
- package/scripts/codeops-migrate.sh +355 -0
- package/scripts/codeops-roadmap-compact.sh +232 -0
- package/scripts/codeops-roadmap-sync.sh +275 -0
- package/scripts/codeops_outcomes.py +155 -0
- package/scripts/codeops_plan.py +239 -0
- package/scripts/codeops_plan_migrate.py +318 -0
- package/scripts/codeops_worktree_snapshot.py +99 -0
- package/scripts/install_agents.py +288 -0
- package/scripts/release.mjs +533 -0
- package/skills/analyze-project/SKILL.md +28 -0
- package/skills/clean-comments/SKILL.md +22 -0
- package/skills/exec-plan/SKILL.md +267 -0
- package/skills/exec-plan/commit-modes.md +113 -0
- package/skills/exec-plan/execution-protocol.md +471 -0
- package/skills/git-commit/SKILL.md +35 -0
- package/skills/github-issues/SKILL.md +38 -0
- package/skills/grill-me/SKILL.md +342 -0
- package/skills/make-plan/SKILL.md +282 -0
- package/skills/make-plan/quality-checklist.md +96 -0
- package/skills/make-plan/templates.md +535 -0
- package/skills/make-plan/zero-ambiguity-gate.md +19 -0
- package/skills/make-requirements/SKILL.md +268 -0
- package/skills/make-requirements/discovery-phases.md +255 -0
- package/skills/make-requirements/review-and-add.md +73 -0
- package/skills/make-requirements/templates.md +296 -0
- package/skills/make-requirements/zero-ambiguity-gate.md +18 -0
- package/skills/outcome-review/SKILL.md +34 -0
- package/skills/preflight/SKILL.md +310 -0
- package/skills/preflight/dimensions.md +181 -0
- package/skills/preflight/report-format.md +300 -0
- package/skills/retro-requirements/SKILL.md +218 -0
- package/skills/retro-requirements/confidence-classification.md +45 -0
- package/skills/retro-requirements/phases.md +609 -0
- package/skills/retro-requirements/triage-gate.md +135 -0
- package/skills/roadmap/SKILL.md +381 -0
- package/skills/roadmap/stage-hooks.md +80 -0
- package/skills/roadmap/template.md +200 -0
- package/skills/setup-codeops/SKILL.md +94 -0
- package/skills/setup-codeops/migration.md +106 -0
- package/skills/setup-codeops/scaffold.md +99 -0
- package/skills/setup-routing/SKILL.md +102 -0
- package/skills/setup-routing/routing.md +44 -0
- package/skills/techdocs/SKILL.md +199 -0
- package/skills/techdocs/authoring-and-update.md +178 -0
- package/skills/techdocs/templates.md +655 -0
- package/skills/techdocs/vitepress-setup.md +143 -0
- package/skills/upgrade-plan/SKILL.md +75 -0
- package/skills/upgrade-plan/content-quality-gate.md +35 -0
- package/skills/upgrade-plan/upgrade-checklists.md +107 -0
- package/standards/coding-standards-full.md +124 -0
- package/standards/coding-standards.md +64 -0
- package/standards/output-style.md +17 -0
|
@@ -0,0 +1,471 @@
|
|
|
1
|
+
# Execution Protocol (Reference)
|
|
2
|
+
|
|
3
|
+
Detailed execution protocol for the exec-plan skill. SKILL.md links here. Read this for the
|
|
4
|
+
load-the-plan edge cases, specification-first ordering, the real-time update mandate, the
|
|
5
|
+
session summary template, and error handling.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Step 1: Load the Plan
|
|
10
|
+
|
|
11
|
+
1. Read `plans/[feature-name]/99-execution-plan.md`.
|
|
12
|
+
2. Find incomplete tasks: **both** unchecked `[ ]` items **and** implemented-but-unverified `[~]`
|
|
13
|
+
items (see the two-stage marks below).
|
|
14
|
+
3. Read supporting technical specs in `plans/[feature-name]/`.
|
|
15
|
+
4. Determine the starting point: a `[~]` task is resumed FIRST — re-read its partial-completion
|
|
16
|
+
note, re-run verification, then promote it to `[x]` or continue fixing. Otherwise start at the
|
|
17
|
+
first `[ ]` task.
|
|
18
|
+
5. **Resume spot-check:** before building on prior work, confirm the most recent `[x]` task's
|
|
19
|
+
named files actually exist (branch switches and reverts happen). If they don't, flag the drift
|
|
20
|
+
to the user before continuing.
|
|
21
|
+
|
|
22
|
+
If the execution plan can't be loaded cleanly, **STOP** and handle as follows:
|
|
23
|
+
|
|
24
|
+
| Condition | Action |
|
|
25
|
+
|-----------|--------|
|
|
26
|
+
| `plans/` directory doesn't exist | STOP — suggest using the make-plan skill first |
|
|
27
|
+
| `plans/[feature-name]/` doesn't exist | STOP — suggest the make-plan skill, or check for typos in the feature name |
|
|
28
|
+
| `plans/[feature-name]/` exists but `99-execution-plan.md` is missing | STOP — plan is incomplete; suggest recreating it with the make-plan skill |
|
|
29
|
+
| `99-execution-plan.md` exists but has no tasks | STOP — plan is empty; suggest recreating it with the make-plan skill |
|
|
30
|
+
| All tasks already marked `[x]` | Report "All tasks are already complete." Suggest re-analyzing the project via the `analyze-project` skill |
|
|
31
|
+
| No verify command resolvable — the plan's Verify lines are empty/generic AND neither the project's AGENTS.md nor its manifests name one | STOP — ask the user to name the verify command, write it into the plan's Verify lines, then proceed. **Never invent a command** (a plausible-looking `npm test` that was never configured verifies nothing) |
|
|
32
|
+
|
|
33
|
+
### Artifact schema check
|
|
34
|
+
|
|
35
|
+
Read `00-index.md` and `99-execution-plan.md`. A current plan declares one or more RDs on its
|
|
36
|
+
`> **Implements**:` line and uses `[ ]`, `[~]`, `[x]`, and `[!]` as its complete task-state
|
|
37
|
+
vocabulary. A legacy `CodeOps Skills Version` stamp or no schema stamp triggers a read-only
|
|
38
|
+
upgrade assessment. Do not execute a legacy plan merely because its task checkbox shape can be
|
|
39
|
+
parsed; the user must approve migration or explicitly accept the recorded compatibility risk.
|
|
40
|
+
|
|
41
|
+
Before implementation, directly check required documents, closed material ambiguities,
|
|
42
|
+
specification-first ordering, and unresolved critical/major findings. Before promoting a task to
|
|
43
|
+
`[x]`, run its verification. A task update never advances siblings.
|
|
44
|
+
|
|
45
|
+
Suggestion only — the user may proceed without upgrading.
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Step 2: Execute Tasks
|
|
50
|
+
|
|
51
|
+
### Phase start
|
|
52
|
+
|
|
53
|
+
Before a phase's first task (and before a T-NN mini-plan's first task), snapshot the complete
|
|
54
|
+
non-ignored worktree—including staged, unstaged, and untracked files—into a temporary Git tree,
|
|
55
|
+
without changing the real index:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
python3 "${CODEOPS_PLUGIN_ROOT}/scripts/codeops_worktree_snapshot.py" snapshot --root .
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Write the returned SHA as `> **Phase baseline tree**: <sha>` in the phase header (for a mini-plan,
|
|
62
|
+
its single header). This snapshot works in every commit mode and prevents pre-phase dirty work from
|
|
63
|
+
entering the review. Also record the phase's expected modification set from its task target paths
|
|
64
|
+
and deliverables. A changed path outside that set is scope drift: attribute it to the phase and
|
|
65
|
+
expand the recorded set, or identify it as unrelated work and exclude it from the review packet.
|
|
66
|
+
Never silently review or commit unrelated user changes as phase work.
|
|
67
|
+
Record the invocation's scope mode (`strict` by default or `explore`) beside the expected
|
|
68
|
+
modification set. Every executor and reviewer packet receives that mode plus the confirmed product
|
|
69
|
+
scope baseline; missing mode context fails closed to strict scope.
|
|
70
|
+
When opt-in outcome metrics are enabled, record only a content-free execution-stage event through
|
|
71
|
+
`codeops_outcomes.py`; metrics never gate execution.
|
|
72
|
+
|
|
73
|
+
**Spec-author dispatch (profile-gated).** Tasks marked `[spec-author]` dispatch the
|
|
74
|
+
spec-test-author agent — packet per `_shared/quality-profile.md` — BEFORE any implementation
|
|
75
|
+
task of that phase, and the red phase is confirmed from its report. A spec test that cannot be
|
|
76
|
+
written from the packet is a blocker for the user, never guessed around. Without an active
|
|
77
|
+
profile the session writes the spec tests itself; specification-first ordering is identical
|
|
78
|
+
either way.
|
|
79
|
+
|
|
80
|
+
Task completion is **two-stage**: `[~]` = implemented (crash-safe progress mark), `[x]` = verified
|
|
81
|
+
complete. For each task, in order:
|
|
82
|
+
|
|
83
|
+
1. Run the **minimum-sufficient checkpoint** before editing. Compare the intended work with the
|
|
84
|
+
original goal, established project patterns, relevant approved complexity AR/PF/RV decisions,
|
|
85
|
+
and the smallest viable implementation. If it triggers the Complexity Escalation Gate in
|
|
86
|
+
`_shared/zero-ambiguity-gate.md`, mark the task `[!]`. For a T-NN mini-plan, preserve the current
|
|
87
|
+
diff without marking it verified and switch to the full standalone-plan path before dispatching
|
|
88
|
+
the challenger, presenting the packet, or accepting a decision; its
|
|
89
|
+
`00-ambiguity-register.md` owns the decision. For a full plan, dispatch the required blind
|
|
90
|
+
challenger, present the complete visible stop packet, and wait for explicit user approval.
|
|
91
|
+
Auto-design, auto-commit, or a generic finding ruling cannot approve the larger option.
|
|
92
|
+
2. Implement the task following the technical specifications. **The code and doc comments you
|
|
93
|
+
write must never reference the plan, requirements, `codeops/`, or any RD/AR/task ID** — those
|
|
94
|
+
files are ephemeral; the shipped code must stand on its own (per the standards' Documentation
|
|
95
|
+
ban). Restate any rationale you drew from the plan in plain language instead.
|
|
96
|
+
3. **🚨 Immediately update `99-execution-plan.md`** — mark the task `[~]` with a timestamp
|
|
97
|
+
(`- [~] 1.1.1 … ⏳ (implemented: YYYY-MM-DD HH:MM)`, timestamp via `date '+%Y-%m-%d %H:%M'`)
|
|
98
|
+
and update the Progress header. Do this before running verification or anything else — if the
|
|
99
|
+
session crashes now, the implementation progress is preserved and the resume session knows the
|
|
100
|
+
task still needs verification.
|
|
101
|
+
4. Run verification (your project's verify command — from the project's AGENTS.md, or detected
|
|
102
|
+
project conventions), with output captured per the **Verify-output capture rule** below.
|
|
103
|
+
- **PASS** → before promoting, run the **documentation-standard self-check** below on the files
|
|
104
|
+
this task changed. Missing documentation and leaked plan references are invisible to
|
|
105
|
+
build+test, so a green verify is NOT sufficient — the self-check is a hard part of the
|
|
106
|
+
done-criterion. Only when it is clean,
|
|
107
|
+
promote the mark to `[x]` with a completion timestamp
|
|
108
|
+
(`- [x] 1.1.1 … ✅ (completed: YYYY-MM-DD HH:MM)`).
|
|
109
|
+
Immediately derive and show the user the current task progress from the selected plan directory:
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
python3 "${CODEOPS_PLUGIN_ROOT}/scripts/codeops_plan.py" --root . --plan "<selected-plan-directory>" --progress-bar
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Present the command's single `Progress: […] X/Y tasks (Z%)` line in the next commentary update.
|
|
116
|
+
This read-only display is required after every `[x]` promotion; never estimate it or count
|
|
117
|
+
`[~]` as complete.
|
|
118
|
+
- **FAIL** → the mark STAYS `[~]`. Fix the implementation and re-verify; promote only on pass.
|
|
119
|
+
A task is never `[x]` with a failing verify.
|
|
120
|
+
|
|
121
|
+
**Documentation-standard self-check (NON-NEGOTIABLE, before every `[x]`).** Read the changed
|
|
122
|
+
code as a junior developer and confirm:
|
|
123
|
+
|
|
124
|
+
- every public, exported, or external-facing class, interface, method, function, property, type,
|
|
125
|
+
and constant has a language-appropriate doc comment;
|
|
126
|
+
- every non-trivial internal entity is documented;
|
|
127
|
+
- applicable purpose, parameters, return value, thrown errors, side effects, and important
|
|
128
|
+
invariants are explained;
|
|
129
|
+
- complex logic, invariants, edge cases, and non-obvious decisions have calm comments that
|
|
130
|
+
explain why without narrating obvious syntax;
|
|
131
|
+
- public API has `@example` or the language equivalent wherever practical; and
|
|
132
|
+
- genuinely trivial private code is not padded with comments that only restate its name or type.
|
|
133
|
+
|
|
134
|
+
Use the project's documentation linter when one is configured. Lint cannot replace the semantic
|
|
135
|
+
read. Missing required documentation blocks `[x]`.
|
|
136
|
+
|
|
137
|
+
Then confirm the code and comments reference no ephemeral CodeOps artifact. Grep the files this
|
|
138
|
+
task changed:
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
git diff --name-only | xargs grep -nEI \
|
|
142
|
+
-e '\b(RD|AR|PA|PF|HR|GATE|AC|ST|ADR|DEF)-[0-9]+' \
|
|
143
|
+
-e '\b(codeops|plans|requirements)/[[:alnum:]._/-]*' 2>/dev/null
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Any hit inside a comment or doc comment is a leak — rewrite it per the standard (keep the
|
|
147
|
+
behavior it annotated, drop the citation; restate any plan rationale in plain language) before
|
|
148
|
+
marking the task `[x]`. Hits inside real code strings/paths the program actually uses are fine.
|
|
149
|
+
5. Commit per the active commit mode (see [commit-modes.md](commit-modes.md)) — the commit gate
|
|
150
|
+
keys off `[x]`, never `[~]`.
|
|
151
|
+
6. **Post-phase quality step (after each phase, profile-gated):** when the phase's last task has
|
|
152
|
+
verified, run the quality step below before anything else starts.
|
|
153
|
+
7. **Techdocs check (after each phase):** if techdocs exist and the just-completed phase
|
|
154
|
+
introduced architectural changes (new components, data entities, API endpoints, integrations,
|
|
155
|
+
or infrastructure), perform an incremental techdocs update via the techdocs skill.
|
|
156
|
+
8. Continue until all tasks are complete. OpenCode auto-compacts context, so there is no
|
|
157
|
+
manual context-threshold handling — just keep going.
|
|
158
|
+
|
|
159
|
+
### Post-phase quality step (profile-gated)
|
|
160
|
+
|
|
161
|
+
Runs after a phase's last task verifies — and after a T-NN mini-plan's work verifies, on the
|
|
162
|
+
whole-task diff. Activation rules, packets, supersession, and caps are defined in
|
|
163
|
+
`_shared/quality-profile.md`; this section owns the order of operations:
|
|
164
|
+
|
|
165
|
+
1. **Determine activation.** Strict defaults review every non-trivial phase. Adaptive mode may
|
|
166
|
+
explicitly disable independent review; announce that choice. Trivial tasks are never reviewed.
|
|
167
|
+
A docs-only diff → phase-reviewer only, and the auditor skip is logged — never silent.
|
|
168
|
+
2. **Dispatch in parallel:** the correctness reviewer plus every risk-selected auditor (security,
|
|
169
|
+
financial integrity, concurrency, performance, semantics, or migration), each with the
|
|
170
|
+
dispatch header on line 1 of its prompt and its packet
|
|
171
|
+
Create the review diff with:
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
python3 "${CODEOPS_PLUGIN_ROOT}/scripts/codeops_worktree_snapshot.py" diff \
|
|
175
|
+
--root . --baseline <phase-baseline-tree>
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
This includes committed, staged, unstaged, and newly created files while excluding changes that
|
|
179
|
+
existed at phase start.
|
|
180
|
+
3. **Merge findings** (RV/SA/PE) and present them in severity-grouped batches (reuse the
|
|
181
|
+
preflight skill's batch pacing). In normal mode, 🔴 CRITICAL / 🟠 MAJOR findings PAUSE
|
|
182
|
+
execution for the user's ruling in ALL commit modes. With active auto-design, an eligible
|
|
183
|
+
technical fix may be selected and recorded, but risk may never be waived and a critical/major
|
|
184
|
+
finding may never be dismissed automatically; reserved decisions pause for the user. 🟡 MINOR
|
|
185
|
+
findings are report-only.
|
|
186
|
+
Before merging, apply `_shared/scope-expansion-control.md`: a necessary correction or blocking
|
|
187
|
+
uncertainty remains a finding, while an optional remediation is omitted in strict scope or
|
|
188
|
+
moved to a separate `SE-*` proposal in exploration mode. A finding ruling never chooses `Keep`.
|
|
189
|
+
For escaped complexity, first dispatch the blind design challenger and then use the complete
|
|
190
|
+
visible packet from `_shared/zero-ambiguity-gate.md`. Explicit approval of the named larger
|
|
191
|
+
machinery resolves the finding without a code change. Choosing the smaller design, revision, or
|
|
192
|
+
deferral stays blocked until the code changes and passes re-review.
|
|
193
|
+
For a T-NN mini-plan, stop before presenting or accepting a complexity decision: mark the task
|
|
194
|
+
`[!]`, preserve the diff without marking it verified, and switch to the full standalone-plan
|
|
195
|
+
path. The new `00-ambiguity-register.md` owns the packet and decision. Resume only after that
|
|
196
|
+
plan's gates pass.
|
|
197
|
+
4. **Record decisions durably** in the finding artifact after each ruling batch. When the user
|
|
198
|
+
approves larger machinery, also append a `Technical (complexity escalation)` runtime AR with
|
|
199
|
+
every approval-evidence field required by the shared gate; the RV finding references that AR.
|
|
200
|
+
5. **Accepted fixes:** implement → verify → follow-up commit per the commit mode. If any 🔴/🟠
|
|
201
|
+
fix was applied, dispatch ONE re-review scoped to the fix diff — never a third pass. A fix
|
|
202
|
+
the re-review still rejects is reported. Normal mode returns the ruling to the user; active
|
|
203
|
+
auto-design may select one eligible technical correction, but cannot waive the finding.
|
|
204
|
+
6. **Record review evidence** in the plan or its review report, optionally record a content-free
|
|
205
|
+
review outcome, then proceed to the next phase.
|
|
206
|
+
|
|
207
|
+
A dispatch that fails or dies mid-loop is reported — the phase completes UNreviewed only on the
|
|
208
|
+
user's explicit say-so.
|
|
209
|
+
|
|
210
|
+
### Outcome evidence (opt-in)
|
|
211
|
+
|
|
212
|
+
When `codeops/codeops.json` sets `metrics.enabled` to `true`, record only enumerated, content-free
|
|
213
|
+
outcomes through `"${CODEOPS_PLUGIN_ROOT}/scripts/codeops_outcomes.py" emit`. Useful events include
|
|
214
|
+
verification results, rework cycles, scope drift, invalidated assumptions, runtime ambiguities,
|
|
215
|
+
review completion, escaped findings, and recovery accuracy. Event recording always exits without
|
|
216
|
+
changing gate results. Never include prompts, paths, source content, finding prose, or user text.
|
|
217
|
+
|
|
218
|
+
### Verify-output capture (NON-NEGOTIABLE)
|
|
219
|
+
|
|
220
|
+
Never let a full verify run's output into the conversation. Every verification run — per-task,
|
|
221
|
+
red-phase, green-phase, session wrap-up — executes with output captured to a temp log:
|
|
222
|
+
|
|
223
|
+
```bash
|
|
224
|
+
<verify command> > "$VERIFY_LOG" 2>&1
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
(`$VERIFY_LOG` = a file in the session temp/scratchpad dir, e.g. `verify-<task-id>.log`.)
|
|
228
|
+
|
|
229
|
+
- **PASS** → surface ONE line: `VERIFY PASS (task N.N.N)`, plus the test count if it is
|
|
230
|
+
extractable from the log tail at no extra cost.
|
|
231
|
+
- **FAIL** → surface the **last 50 lines** of the log + the log path, nothing more. Read further
|
|
232
|
+
slices of the log file on demand while fixing — do not re-run verify just to "see the output".
|
|
233
|
+
- **Red-phase runs** (spec tests expected to fail) → surface only the failing spec-test
|
|
234
|
+
names/count confirming the red state — never the full dump.
|
|
235
|
+
|
|
236
|
+
The full log always remains on disk for the session. If the log location is unwritable, fall
|
|
237
|
+
back to running verify plainly ONCE and note the fallback in the session summary. This rule is
|
|
238
|
+
about CONTEXT, not rigor: the verify command itself, its scope, and pass/fail gating are
|
|
239
|
+
unchanged — and the temp log is read-only evidence, never executed.
|
|
240
|
+
|
|
241
|
+
### Zero-Ambiguity During Execution
|
|
242
|
+
|
|
243
|
+
If you encounter any implementation detail, behavioral question, edge case, or design choice not
|
|
244
|
+
covered by the plan documents or `00-ambiguity-register.md`, first record it and mark affected
|
|
245
|
+
tasks `[!]` with `Blocked: <short reason>` until the owning artifact is resolved.
|
|
246
|
+
|
|
247
|
+
First determine whether the discovery is an ambiguity inside authorized scope, a necessary
|
|
248
|
+
correction, or an optional expansion. Optional expansions do not enter the ambiguity register:
|
|
249
|
+
they are silent in strict scope or use the Scope Expansion Register during exploration.
|
|
250
|
+
|
|
251
|
+
1. **STOP** — do not guess, infer, or apply "reasonable defaults".
|
|
252
|
+
2. **Classify authority.** With active auto-design, apply the shared auto-design policy: resolve
|
|
253
|
+
and record an eligible technical decision; present a reserved decision to the user. In normal
|
|
254
|
+
mode, present every material ambiguity to the user with options and trade-offs.
|
|
255
|
+
3. **Obtain authority.** Wait for the user's explicit decision when normal mode or reserved
|
|
256
|
+
authority applies. An auto-design resolution must include the policy's complete provenance.
|
|
257
|
+
4. **Record** it in `00-ambiguity-register.md` with the next sequential AR number, tagged
|
|
258
|
+
`(runtime)` in the Category column. Update the register header to note items added during
|
|
259
|
+
execution.
|
|
260
|
+
5. **Only then** update affected plan artifacts, confirm direct entry checks still pass, and
|
|
261
|
+
resume implementation using the authorized decision.
|
|
262
|
+
|
|
263
|
+
This applies to ALL ambiguities — architectural, behavioral, naming, formatting, UX, error
|
|
264
|
+
handling. Never fill gaps by guessing.
|
|
265
|
+
|
|
266
|
+
A runtime complexity escalation always uses reserved authority. Its required challenger and
|
|
267
|
+
visible stop packet come from `_shared/zero-ambiguity-gate.md`. Record an approved larger option as
|
|
268
|
+
`Technical (complexity escalation)`. If the user defers it, keep it out of executable work.
|
|
269
|
+
|
|
270
|
+
---
|
|
271
|
+
|
|
272
|
+
## Execution mode — inline first (routing-aware)
|
|
273
|
+
|
|
274
|
+
When `codeops/codeops.json` carries routing policy (see the setup-routing skill), route by PHASE,
|
|
275
|
+
not by task, and prefer inline unless isolation, independence, context control, or a capability
|
|
276
|
+
match materially improves the result:
|
|
277
|
+
|
|
278
|
+
1. **Inline for tightly coupled work.** Keep the primary agent responsible for decisions, durable
|
|
279
|
+
state, plan/roadmap updates, and work whose tasks share substantial context.
|
|
280
|
+
2. **Dispatch bounded phases.** Use an executor role for a self-contained phase when a fresh
|
|
281
|
+
context, different capability/effort, or isolation from the decision conversation is useful.
|
|
282
|
+
3. **Parallelize only independent work.** Read-heavy reconnaissance and independent reviews are
|
|
283
|
+
preferred candidates. Parallel writes require disjoint ownership and an explicit merge plan.
|
|
284
|
+
4. **Select reviewers by risk.** Every non-trivial phase gets correctness review; add security,
|
|
285
|
+
financial-integrity, concurrency, performance, semantics, or migration reviewers from tags.
|
|
286
|
+
|
|
287
|
+
**The phase packet.** When a phase IS dispatched, the parent composes the packet; the executor
|
|
288
|
+
receives nothing else and must not need anything else:
|
|
289
|
+
|
|
290
|
+
- the phase's task lines, Deliverables, and Verify lines verbatim from `99-execution-plan.md`;
|
|
291
|
+
- the relevant excerpts of the governing `03-XX` spec documents (the excerpts, not filenames);
|
|
292
|
+
- the applicable ST-cases from `07-testing-strategy.md`;
|
|
293
|
+
- the AR decisions that bear on the phase and any relevant approved complexity PF/RV decisions
|
|
294
|
+
(quoted entries, not whole reports);
|
|
295
|
+
- the original goal and smallest viable design from `00-index.md`, or the session-derived legacy
|
|
296
|
+
baseline when the plan predates that section;
|
|
297
|
+
- the scope mode (`strict` or `explore`) and confirmed product scope baseline; missing or invalid
|
|
298
|
+
scope context fails closed to strict mode. Missing or invalid original-goal or smallest-design
|
|
299
|
+
context blocks dispatch;
|
|
300
|
+
- the target file paths and the project's verify command.
|
|
301
|
+
|
|
302
|
+
Excerpting owned content into a packet is the intended retrieval mechanism, not restatement. The
|
|
303
|
+
quoted AR/ST/spec content is context for the executor's *understanding* — it must not surface as a
|
|
304
|
+
citation in shipped code (the executor carries the same doc-standard ban and self-check).
|
|
305
|
+
|
|
306
|
+
**Division of labor.** The PARENT — never the executor — updates `99-execution-plan.md`
|
|
307
|
+
(two-stage marks), the Progress header, and the roadmap. The executor implements task-by-task,
|
|
308
|
+
runs verify per the Verify-output capture rule, and reports per task. Mark `[~]` as the executor
|
|
309
|
+
reports each implementation; verify (or trust the executor's verify run and spot-check it);
|
|
310
|
+
promote to `[x]` on pass.
|
|
311
|
+
|
|
312
|
+
**Blocker path.** On ambiguity, missing packet context, or a failing SPEC test, the executor
|
|
313
|
+
stops and returns a blocker report. The parent then runs the zero-ambiguity loop above with the
|
|
314
|
+
applicable authority: normal mode or a reserved decision uses STOP → options → user decision →
|
|
315
|
+
AR `(runtime)` entry; active auto-design resolves and records an eligible technical decision under
|
|
316
|
+
the shared policy. The parent re-dispatches with the enriched packet. An executor never asks the
|
|
317
|
+
user directly, widens delegated authority, or guesses.
|
|
318
|
+
|
|
319
|
+
**Missing-executor guard.** If a named role is unavailable, spawn a generic subagent with the
|
|
320
|
+
complete packet or run the phase inline and report why. Dispatch is an optimization — the
|
|
321
|
+
protocol's guarantees hold either way.
|
|
322
|
+
|
|
323
|
+
---
|
|
324
|
+
|
|
325
|
+
## Specification-First Task Ordering (NON-NEGOTIABLE)
|
|
326
|
+
|
|
327
|
+
The ordering `spec tests → red phase → implement → green phase → impl tests → verify` is defined
|
|
328
|
+
ONCE in **[../../_shared/spec-first-ordering.md](../../_shared/spec-first-ordering.md)** — read it
|
|
329
|
+
before executing the first implementation task. Enforce it exactly as written there: never start
|
|
330
|
+
implementation before that feature's spec tests exist and have a recorded red phase, and apply the
|
|
331
|
+
immutable-oracle rule — a failing spec test means the implementation is wrong, never the test.
|
|
332
|
+
|
|
333
|
+
---
|
|
334
|
+
|
|
335
|
+
## Real-Time Execution Plan Update Mandate (ULTRA-CRITICAL)
|
|
336
|
+
|
|
337
|
+
`99-execution-plan.md` is the SINGLE SOURCE OF TRUTH for progress and the user's lifeline if a
|
|
338
|
+
session ends unexpectedly. Update it after completing EACH task. No exceptions.
|
|
339
|
+
|
|
340
|
+
### Update-first order (two-stage)
|
|
341
|
+
|
|
342
|
+
```
|
|
343
|
+
Implement task → 🚨 MARK [~] IN THE PLAN → verify → PASS: promote to [x] / FAIL: fix, stays [~] → commit → next task
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
NOT: batch-updating later, updating only at the end, or "maybe update and maybe forget". If the
|
|
347
|
+
agent crashes during verify or commit, the plan already reflects exactly how far the work got —
|
|
348
|
+
`[~]` says "implemented, verification not yet passed"; `[x]` says "verified complete".
|
|
349
|
+
|
|
350
|
+
### Update procedure
|
|
351
|
+
|
|
352
|
+
1. On implementation: change `[ ]` → `[~]` with an implemented-timestamp in the plan's task
|
|
353
|
+
list — the **phase checkbox lists** (3.3.0 format) or the **Master Progress Checklist**
|
|
354
|
+
(legacy format); on verify pass: promote `[~]` → `[x]` with a completion timestamp.
|
|
355
|
+
2. Update the Progress counter in the header (e.g., `3/12 tasks (25%)`) — only `[x]` tasks count
|
|
356
|
+
as complete.
|
|
357
|
+
3. Update the Last Updated timestamp (obtain timestamps via `date '+%Y-%m-%d %H:%M'` — never
|
|
358
|
+
invent them).
|
|
359
|
+
|
|
360
|
+
Task mark formats:
|
|
361
|
+
|
|
362
|
+
```markdown
|
|
363
|
+
- [~] 1.1.1 Task description ⏳ (implemented: YYYY-MM-DD HH:MM)
|
|
364
|
+
- [x] 1.1.1 Task description ✅ (completed: YYYY-MM-DD HH:MM)
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
### Native progress mirror (visibility aid)
|
|
368
|
+
|
|
369
|
+
After every `[x]` promotion, show the deterministic progress line required by the per-task loop.
|
|
370
|
+
Where the session also provides a plan or goal UI, mirror the current phase's tasks and update their
|
|
371
|
+
statuses alongside the Markdown marks. Both displays are convenience layers only —
|
|
372
|
+
**`99-execution-plan.md` remains the durable source of truth**. Skip silently when unavailable.
|
|
373
|
+
|
|
374
|
+
### Task-list format detection (dual-format)
|
|
375
|
+
|
|
376
|
+
After loading the plan, detect its task-list format — both formats execute identically otherwise:
|
|
377
|
+
|
|
378
|
+
- A `## 🚨 Master Progress Checklist` section present → **legacy format (≤3.2.0)**: the checklist
|
|
379
|
+
remains the single source of truth. Maintain it exactly as before — if it is missing task
|
|
380
|
+
entries, or the section is absent while phase sections carry task TABLES, reconstruct it from
|
|
381
|
+
the phase/session/task details (`- [ ] X.X.X [desc]`, grouped by phase) before any task
|
|
382
|
+
execution begins.
|
|
383
|
+
- No such section AND the phase sections carry task checkboxes → **3.3.0 format**: the phase
|
|
384
|
+
checkbox lists are the single source of truth. Do NOT create a Master Progress Checklist.
|
|
385
|
+
- Neither found → STOP (empty plan — see the load table).
|
|
386
|
+
|
|
387
|
+
Never suggest an upgrade on format grounds (AR-5, plans/plan-token-efficiency).
|
|
388
|
+
|
|
389
|
+
### Hard gate
|
|
390
|
+
|
|
391
|
+
Before running verification you MUST have already marked the task `[~]` with a timestamp. Before
|
|
392
|
+
committing, proceeding to the next task, ending a session, or presenting a session summary, the
|
|
393
|
+
task's final state MUST be recorded truthfully — `[x]` (with timestamp) only if its verify passed,
|
|
394
|
+
otherwise still `[~]` — with the progress counter and Last Updated stamp current.
|
|
395
|
+
|
|
396
|
+
---
|
|
397
|
+
|
|
398
|
+
## Step 3: Session Wrap-Up
|
|
399
|
+
|
|
400
|
+
1. Complete the current task before stopping.
|
|
401
|
+
2. **🚨 First: update `99-execution-plan.md`** with ALL completed tasks (before anything else).
|
|
402
|
+
3. Run the verify command (output captured per the Verify-output capture rule).
|
|
403
|
+
4. Handle the commit per the active commit mode (see [commit-modes.md](commit-modes.md)).
|
|
404
|
+
5. Report the session summary (must include `Execution Plan Updated: ✅`).
|
|
405
|
+
|
|
406
|
+
### Session Summary Template
|
|
407
|
+
|
|
408
|
+
```markdown
|
|
409
|
+
## Session Complete
|
|
410
|
+
|
|
411
|
+
**Feature:** [feature-name]
|
|
412
|
+
**Execution Plan:** `plans/[feature-name]/99-execution-plan.md`
|
|
413
|
+
|
|
414
|
+
**Completed This Session:**
|
|
415
|
+
- [x] Phase X, Task X.X.X: [description]
|
|
416
|
+
- [x] Phase X, Task X.X.X: [description]
|
|
417
|
+
|
|
418
|
+
**Remaining Work:**
|
|
419
|
+
- [ ] Phase X, Task X.X.X: [description]
|
|
420
|
+
- [ ] Phase Y: [phase description]
|
|
421
|
+
|
|
422
|
+
**Execution Plan Updated:** ✅ `99-execution-plan.md` reflects all completed work
|
|
423
|
+
**Verification:** [Status — e.g., "All tests passing", "Build successful"]
|
|
424
|
+
**Commit Mode:** [ask-commit | no-commit | auto-commit]
|
|
425
|
+
**Commit:** [hash] / "Committed successfully" / "Uncommitted — user deferred" / "No-commit mode"
|
|
426
|
+
|
|
427
|
+
**To Continue:**
|
|
428
|
+
Run `/exec-plan [feature-name]` again in a new session.
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
---
|
|
432
|
+
|
|
433
|
+
## Error Handling During Execution
|
|
434
|
+
|
|
435
|
+
### If verification fails
|
|
436
|
+
|
|
437
|
+
1. The task's mark stays `[~]` (it was set at implementation time — never promote on a failing
|
|
438
|
+
verify).
|
|
439
|
+
2. Fix the failing tests/build (for a failing SPEC test, fix the implementation — never the test).
|
|
440
|
+
3. Re-run verification until all checks pass.
|
|
441
|
+
4. Only then promote the mark to `[x]`.
|
|
442
|
+
|
|
443
|
+
**Convergence guard:** after three consecutive failures with the same failure signature (the same
|
|
444
|
+
failing tests, compiler errors, or command failure), stop retrying. Classify the blocker as one of:
|
|
445
|
+
implementation defect, stale/impossible plan, pre-existing repository failure, or environment/tool
|
|
446
|
+
failure. Present evidence and the viable next action to the user. A materially different failure
|
|
447
|
+
signature resets the counter; expected red-phase failures do not count.
|
|
448
|
+
|
|
449
|
+
### If implementation deviates from the plan
|
|
450
|
+
|
|
451
|
+
A deviation is by definition territory the plan doesn't cover — route it by materiality:
|
|
452
|
+
|
|
453
|
+
- **Material deviation** (different approach, different files, different behavior than the plan
|
|
454
|
+
specifies): run the Zero-Ambiguity loop above — STOP, present the deviation with options in
|
|
455
|
+
normal mode, or apply active auto-design to an eligible technical choice and escalate a reserved
|
|
456
|
+
choice. Record the authorized resolution in `00-ambiguity-register.md` tagged `(runtime)` and
|
|
457
|
+
update the task description. If it changes artifacts outside the selected plan, obtain approval
|
|
458
|
+
for the exact expanded modification set before editing, then continue.
|
|
459
|
+
- **Mechanical correction** (typo'd path, renamed symbol, an import the plan forgot): note it in
|
|
460
|
+
the execution plan and continue — no user round-trip needed.
|
|
461
|
+
|
|
462
|
+
When unsure which it is, treat it as material.
|
|
463
|
+
|
|
464
|
+
### If a session is interrupted mid-task
|
|
465
|
+
|
|
466
|
+
1. Save progress so far.
|
|
467
|
+
2. Ensure the task is marked `[~]` with a clear partial-completion note (what is done, what
|
|
468
|
+
remains, what to verify).
|
|
469
|
+
3. Do NOT commit the half-done task (the commit gate keys off `[x]`).
|
|
470
|
+
4. Resume later by running `/exec-plan [feature-name]` again — Step 1 finds the `[~]` task,
|
|
471
|
+
resumes it first, and re-verifies before promoting.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: git-commit
|
|
3
|
+
description: Safely verify, stage, and commit repository changes with a detailed Conventional Commit message, optionally rebasing and pushing when the user explicitly requests push. Use for commit my changes, git commit, commit and push, or prepare a CodeOps checkpoint. Inspects untracked files and secrets, never bypasses hooks, never force-pushes, and stops on verification or rebase failure.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Guarded Git commit
|
|
7
|
+
|
|
8
|
+
## Authority
|
|
9
|
+
|
|
10
|
+
A request to commit authorizes a local commit only. Push only when the user explicitly asks to push or has already granted continuing push authority for this repository. Never amend published history, force-push, reset, or bypass hooks without separate explicit authorization.
|
|
11
|
+
|
|
12
|
+
## Protocol
|
|
13
|
+
|
|
14
|
+
1. Resolve the repository root and inspect `git status --short`, staged/unstaged diffs, and recent commit style.
|
|
15
|
+
2. If clean, report `nothing to commit` and stop.
|
|
16
|
+
3. Inspect every untracked file. Stop and ask before staging likely secrets, credentials, build output, large binaries, or unrelated scratch files.
|
|
17
|
+
4. Resolve the authoritative verification command from `AGENTS.md`, CodeOps plan Verify lines, or project manifests. Run it with output captured to a temporary log. On failure, report the failure tail and do not stage or commit.
|
|
18
|
+
5. Stage deliberately by explicit paths or coherent groups. Avoid `git add .` when the working directory may be a monorepo subtree or unrelated changes exist.
|
|
19
|
+
6. Review `git diff --cached --check`, the staged stat, and the staged diff. Ensure the commit contains one coherent purpose and preserves unrelated user changes.
|
|
20
|
+
7. Write a Conventional Commit message to a temporary file and commit with `git commit -F`. Never use an inline multiline message.
|
|
21
|
+
8. If a commit hook modifies files, inspect and restage only relevant changes, then retry once. Never use `--no-verify` automatically.
|
|
22
|
+
9. For push mode, fetch/rebase only when appropriate for the branch policy. Stop on conflicts; never resolve ambiguous conflicts automatically. Push normally, never with force.
|
|
23
|
+
10. Report the resulting commit, verification, and push state.
|
|
24
|
+
|
|
25
|
+
## Message shape
|
|
26
|
+
|
|
27
|
+
```text
|
|
28
|
+
type(scope): imperative summary
|
|
29
|
+
|
|
30
|
+
- concrete behavior or artifact changed
|
|
31
|
+
- important invariant or compatibility note
|
|
32
|
+
- verification performed
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Use `feat`, `fix`, `refactor`, `test`, `docs`, or `chore` unless repository guidance defines another convention.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: github-issues
|
|
3
|
+
description: Inspect a repository's GitHub issues as an adaptive table using its own labels, issue types, project fields, dependencies, priorities, and effort scheme; or close/reopen explicitly named issues with guarded native reasons. Use for GitHub issue overview, issue triage, dependencies, close issue, reopen issue, duplicate issue, or CodeOps backlog review. Read operations may be implicit; mutations require explicit user intent.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# GitHub issue operations
|
|
7
|
+
|
|
8
|
+
Use the installed `gh` CLI. Run `gh auth status` first and resolve the target repository from an explicit repository argument or `gh repo view`.
|
|
9
|
+
|
|
10
|
+
## Overview mode — read only
|
|
11
|
+
|
|
12
|
+
1. Discover the repository's labels and available issue/project metadata. Never impose a universal label vocabulary.
|
|
13
|
+
2. Fetch issues once with requested native filters: state, label, assignee, author, milestone, search, and limit.
|
|
14
|
+
3. Resolve type, priority, and effort using native fields first, then the repository's own label families.
|
|
15
|
+
4. Resolve open dependencies using native relations when available and conventional body markers as a documented fallback.
|
|
16
|
+
5. Apply semantic filters only after explaining mappings such as `high → P1` in the detected scheme.
|
|
17
|
+
6. Render `# · Title · Type · Priority · Effort · Deps · Assignee`. Do not truncate titles and disclose result limits or degraded metadata.
|
|
18
|
+
|
|
19
|
+
All user strings remain quoted command arguments. Never use `eval` or construct a shell command from issue content.
|
|
20
|
+
|
|
21
|
+
## Close/reopen mode — explicit mutation only
|
|
22
|
+
|
|
23
|
+
Validate the complete batch before mutation:
|
|
24
|
+
|
|
25
|
+
- issue identifiers must be numeric after stripping `#`;
|
|
26
|
+
- `completed`, `not-planned`, `duplicate`, and `reopen` modes are mutually consistent;
|
|
27
|
+
- a duplicate target cannot be among issues being closed; and
|
|
28
|
+
- the repository and requested comment are unambiguous.
|
|
29
|
+
|
|
30
|
+
For each issue:
|
|
31
|
+
|
|
32
|
+
1. Fetch and echo its title, current state, and intended action.
|
|
33
|
+
2. Skip already-satisfied state.
|
|
34
|
+
3. Before closing, list open dependents. If any exist, pause for explicit confirmation.
|
|
35
|
+
4. Use native `gh issue close` or `gh issue reopen`. When native duplicate reasons are unavailable, comment `Duplicate of #N` and close as not planned.
|
|
36
|
+
5. Continue past nonexistent individual issues but record every outcome.
|
|
37
|
+
|
|
38
|
+
Return a per-issue summary. Never create, edit, label, close, reopen, or comment unless the user's request explicitly authorizes that mutation.
|