@hecer/yoke 0.2.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/LICENSE +21 -0
- package/README.md +494 -0
- package/canon/AGENTS.md +28 -0
- package/canon/context/DECISIONS.md +4 -0
- package/canon/context/KNOWLEDGE.md +4 -0
- package/canon/context/PROJECT.md +15 -0
- package/canon/loop/loop-spec.md +30 -0
- package/canon/loop/prd.schema.md +14 -0
- package/canon/manifest.yaml +47 -0
- package/canon/policy/gates.md +7 -0
- package/canon/policy/roles.md +9 -0
- package/canon/skills/ATTRIBUTION.md +71 -0
- package/canon/skills/authoring-prd/SKILL.md +44 -0
- package/canon/skills/brainstorming/SKILL.md +164 -0
- package/canon/skills/dispatching-parallel-agents/SKILL.md +182 -0
- package/canon/skills/document-release/SKILL.md +297 -0
- package/canon/skills/executing-plans/SKILL.md +70 -0
- package/canon/skills/finishing-a-development-branch/SKILL.md +200 -0
- package/canon/skills/health/SKILL.md +177 -0
- package/canon/skills/maintaining-context/SKILL.md +34 -0
- package/canon/skills/minimal-code/SKILL.md +21 -0
- package/canon/skills/plan-ceo-review/SKILL.md +541 -0
- package/canon/skills/plan-eng-review/SKILL.md +362 -0
- package/canon/skills/receiving-code-review/SKILL.md +213 -0
- package/canon/skills/requesting-code-review/SKILL.md +105 -0
- package/canon/skills/retro/SKILL.md +397 -0
- package/canon/skills/review/SKILL.md +246 -0
- package/canon/skills/ship/SKILL.md +696 -0
- package/canon/skills/subagent-driven-development/SKILL.md +277 -0
- package/canon/skills/systematic-debugging/SKILL.md +296 -0
- package/canon/skills/tdd/SKILL.md +371 -0
- package/canon/skills/unslop-ui/SKILL.md +34 -0
- package/canon/skills/using-git-worktrees/SKILL.md +218 -0
- package/canon/skills/verification-before-completion/SKILL.md +139 -0
- package/canon/skills/visual-verification/SKILL.md +54 -0
- package/canon/skills/workflow/SKILL.md +18 -0
- package/canon/skills/writing-plans/SKILL.md +152 -0
- package/canon/skills/writing-skills/SKILL.md +655 -0
- package/canon/skills/yoke-retrofit/SKILL.md +18 -0
- package/canon/tools/graphify.md +3 -0
- package/canon/tools/playwright-mcp.md +3 -0
- package/canon/tools/rtk.md +7 -0
- package/canon/tools/serena.md +7 -0
- package/dist/canon/frontmatter.js +10 -0
- package/dist/canon/manifest.js +26 -0
- package/dist/canon/validate.js +73 -0
- package/dist/cli.js +244 -0
- package/dist/context/command.js +33 -0
- package/dist/context/context.js +57 -0
- package/dist/loop/cleanup.js +42 -0
- package/dist/loop/gates.js +12 -0
- package/dist/loop/git.js +25 -0
- package/dist/loop/lock.js +45 -0
- package/dist/loop/loop.js +190 -0
- package/dist/loop/prd.js +29 -0
- package/dist/loop/reporter.js +91 -0
- package/dist/loop/run-command.js +134 -0
- package/dist/loop/runner.js +157 -0
- package/dist/loop/verify.js +38 -0
- package/dist/loop/watchdog.js +86 -0
- package/dist/new/command.js +53 -0
- package/dist/prd/command.js +129 -0
- package/dist/retrofit/apply.js +54 -0
- package/dist/retrofit/canon-dir.js +22 -0
- package/dist/retrofit/command.js +37 -0
- package/dist/retrofit/config.js +53 -0
- package/dist/retrofit/context-actions.js +21 -0
- package/dist/retrofit/detect.js +17 -0
- package/dist/retrofit/gitignore.js +26 -0
- package/dist/retrofit/gstack.js +19 -0
- package/dist/retrofit/merge-json.js +38 -0
- package/dist/retrofit/plan.js +29 -0
- package/dist/retrofit/planners/claude.js +67 -0
- package/dist/retrofit/planners/codex.js +36 -0
- package/dist/retrofit/planners/gemini.js +54 -0
- package/dist/retrofit/report.js +14 -0
- package/dist/retrofit/tools.js +23 -0
- package/dist/retrofit/wsl.js +15 -0
- package/dist/review/command.js +43 -0
- package/dist/scan/design.js +79 -0
- package/dist/smoke/command.js +141 -0
- package/package.json +61 -0
|
@@ -0,0 +1,696 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ship
|
|
3
|
+
description: |
|
|
4
|
+
Fully automated ship workflow. Merges the base branch, runs tests, audits coverage,
|
|
5
|
+
reviews the diff, generates a CHANGELOG entry, bumps the version, commits, pushes,
|
|
6
|
+
and creates the PR. Use when asked to "ship", "create a PR", or "open a pull request".
|
|
7
|
+
triggers:
|
|
8
|
+
- ship
|
|
9
|
+
- create a pr
|
|
10
|
+
- open a pull request
|
|
11
|
+
- ship this branch
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Ship: Fully Automated Ship Workflow
|
|
15
|
+
|
|
16
|
+
You are running the `ship` workflow. This is a **non-interactive, fully automated** workflow. Do NOT ask for confirmation at any step. The user said `/ship` which means DO IT. Run straight through and output the PR URL at the end.
|
|
17
|
+
|
|
18
|
+
**Only stop for:**
|
|
19
|
+
- On the base branch (abort)
|
|
20
|
+
- Merge conflicts that can't be auto-resolved (stop, show conflicts)
|
|
21
|
+
- In-branch test failures (pre-existing failures are triaged, not auto-blocking)
|
|
22
|
+
- Pre-landing review finds ASK items that need user judgment
|
|
23
|
+
- MINOR or MAJOR version bump needed (ask — see Step 12)
|
|
24
|
+
- AI-assessed coverage below minimum threshold (hard gate with user override — see Step 7)
|
|
25
|
+
- Plan items NOT DONE with no user override (see Step 8)
|
|
26
|
+
|
|
27
|
+
**Never stop for:**
|
|
28
|
+
- Uncommitted changes (always include them)
|
|
29
|
+
- Version bump choice (auto-pick MICRO or PATCH — see Step 12)
|
|
30
|
+
- CHANGELOG content (auto-generate from diff)
|
|
31
|
+
- Commit message approval (auto-commit)
|
|
32
|
+
- Multi-file changesets (auto-split into bisectable commits)
|
|
33
|
+
- TODOS.md completed-item detection (auto-mark)
|
|
34
|
+
- Auto-fixable review findings (dead code, N+1, stale comments — fixed automatically)
|
|
35
|
+
|
|
36
|
+
**Re-run behavior (idempotency):**
|
|
37
|
+
Re-running `ship` means "run the whole checklist again." Every verification step runs on every invocation. Only *actions* are idempotent:
|
|
38
|
+
- Step 12: If VERSION already bumped, skip the bump but still read the version
|
|
39
|
+
- Step 17: If already pushed, skip the push command
|
|
40
|
+
- Step 19: If PR exists, update the body instead of creating a new PR
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Step 0: Detect platform and base branch
|
|
45
|
+
|
|
46
|
+
Detect the git hosting platform from the remote URL:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
git remote get-url origin 2>/dev/null
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
- URL contains "github.com" → platform is **GitHub**
|
|
53
|
+
- URL contains "gitlab" → platform is **GitLab**
|
|
54
|
+
- Otherwise check: `gh auth status 2>/dev/null` → GitHub; `glab auth status 2>/dev/null` → GitLab
|
|
55
|
+
|
|
56
|
+
Determine the base branch (target of the PR, or the repo's default):
|
|
57
|
+
|
|
58
|
+
- GitHub: `gh pr view --json baseRefName -q .baseRefName` or `gh repo view --json defaultBranchRef -q .defaultBranchRef.name`
|
|
59
|
+
- GitLab: `glab mr view -F json 2>/dev/null` → extract `target_branch`
|
|
60
|
+
- Fallback: `git symbolic-ref refs/remotes/origin/HEAD`, then `main`, then `master`
|
|
61
|
+
|
|
62
|
+
Print the detected base branch. Use it as `<base>` in all subsequent commands.
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Step 1: Pre-flight
|
|
67
|
+
|
|
68
|
+
1. Check the current branch. If on the base branch or the repo's default branch, **abort**: "You're on the base branch. Ship from a feature branch."
|
|
69
|
+
|
|
70
|
+
2. Run `git status` (never use `-uall`). Uncommitted changes are always included — no need to ask.
|
|
71
|
+
|
|
72
|
+
3. Run `git diff <base>...HEAD --stat` and `git log <base>..HEAD --oneline` to understand what's being shipped.
|
|
73
|
+
|
|
74
|
+
4. **Review readiness check:** Check if a recent pre-landing review or plan review exists in this session (from the conversation context). If a plan-eng-review or review was run recently and found no blocking issues, note it. If no review has been run, note it — ship will run its own review in Step 9.
|
|
75
|
+
|
|
76
|
+
Check diff size: `git diff <base>...HEAD --stat | tail -1`. If the diff is >200 lines, add: "Note: This is a large diff. Consider running `plan-eng-review` for architecture-level review before shipping."
|
|
77
|
+
|
|
78
|
+
Continue to Step 2 — do NOT block or ask. Ship runs its own review in Step 9.
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Step 2: Distribution Pipeline Check
|
|
83
|
+
|
|
84
|
+
If the diff introduces a new standalone artifact (CLI binary, library package, tool) — not a web service with existing deployment — verify that a distribution pipeline exists.
|
|
85
|
+
|
|
86
|
+
1. Check if the diff adds a new `cmd/` directory, `main.go`, or `bin/` entry point.
|
|
87
|
+
|
|
88
|
+
2. If new artifact detected, check for a release workflow in `.github/workflows/` or `.gitlab-ci.yml`.
|
|
89
|
+
|
|
90
|
+
3. **If no release pipeline exists and a new artifact was added:** Use AskUserQuestion:
|
|
91
|
+
- "This PR adds a new binary/tool but there's no CI/CD pipeline to build and publish it."
|
|
92
|
+
- A) Add a release workflow now
|
|
93
|
+
- B) Defer — add to TODOS.md
|
|
94
|
+
- C) Not needed — this is internal/web-only
|
|
95
|
+
|
|
96
|
+
4. If release pipeline exists or no new artifact detected: Continue silently.
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## Step 3: Merge the base branch (BEFORE tests)
|
|
101
|
+
|
|
102
|
+
Fetch and merge the base branch into the feature branch so tests run against the merged state:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
git fetch origin <base> && git merge origin/<base> --no-edit
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
**If there are merge conflicts:** Try to auto-resolve if simple (VERSION, schema.rb, CHANGELOG ordering). If conflicts are complex or ambiguous, **STOP** and show them.
|
|
109
|
+
|
|
110
|
+
**If already up to date:** Continue silently.
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## Step 4: Test Framework Bootstrap
|
|
115
|
+
|
|
116
|
+
**Detect existing test framework and project runtime:**
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
[ -f Gemfile ] && echo "RUNTIME:ruby"
|
|
120
|
+
[ -f package.json ] && echo "RUNTIME:node"
|
|
121
|
+
[ -f requirements.txt ] || [ -f pyproject.toml ] && echo "RUNTIME:python"
|
|
122
|
+
[ -f go.mod ] && echo "RUNTIME:go"
|
|
123
|
+
[ -f Cargo.toml ] && echo "RUNTIME:rust"
|
|
124
|
+
[ -f Gemfile ] && grep -q "rails" Gemfile 2>/dev/null && echo "FRAMEWORK:rails"
|
|
125
|
+
[ -f package.json ] && grep -q '"next"' package.json 2>/dev/null && echo "FRAMEWORK:nextjs"
|
|
126
|
+
ls jest.config.* vitest.config.* playwright.config.* .rspec pytest.ini pyproject.toml phpunit.xml 2>/dev/null
|
|
127
|
+
ls -d test/ tests/ spec/ __tests__/ cypress/ e2e/ 2>/dev/null
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
**If test framework detected:** Print "Test framework detected: {name}. Skipping bootstrap." Read 2-3 existing test files to learn conventions. **Skip the rest of bootstrap.**
|
|
131
|
+
|
|
132
|
+
**If NO runtime detected:** Use AskUserQuestion: "I couldn't detect your project's language. What runtime are you using?"
|
|
133
|
+
Options: A) Node.js/TypeScript B) Ruby/Rails C) Python D) Go E) Rust F) PHP G) Elixir H) This project doesn't need tests.
|
|
134
|
+
|
|
135
|
+
**If runtime detected but no test framework:** Research best practices for the detected runtime. Ask the user which test framework to set up. Install, configure, run first tests, set up CI if GitHub Actions is detected, write TESTING.md and update CLAUDE.md.
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## Step 5: Run tests (on merged code)
|
|
140
|
+
|
|
141
|
+
Run the project's test suite. Consult CLAUDE.md for the test command. If no command is documented, use the detected test framework's default.
|
|
142
|
+
|
|
143
|
+
Run tests and capture output. If the project has multiple test suites (e.g. unit + frontend), run them in parallel.
|
|
144
|
+
|
|
145
|
+
**If any test fails:** Do NOT immediately stop. Apply Test Failure Ownership Triage:
|
|
146
|
+
|
|
147
|
+
### Test Failure Ownership Triage
|
|
148
|
+
|
|
149
|
+
#### Step T1: Classify each failure
|
|
150
|
+
|
|
151
|
+
For each failing test:
|
|
152
|
+
|
|
153
|
+
1. Get the files changed on this branch: `git diff origin/<base>...HEAD --name-only`
|
|
154
|
+
2. Classify:
|
|
155
|
+
- **In-branch** if: the failing test file itself was modified on this branch, OR the test output references code that was changed on this branch.
|
|
156
|
+
- **Likely pre-existing** if: neither the test file nor the code it tests was modified on this branch.
|
|
157
|
+
- When ambiguous, default to **in-branch**.
|
|
158
|
+
|
|
159
|
+
#### Step T2: Handle in-branch failures
|
|
160
|
+
|
|
161
|
+
**STOP.** These are your failures. Show them. The developer must fix their own broken tests before shipping.
|
|
162
|
+
|
|
163
|
+
#### Step T3: Handle pre-existing failures
|
|
164
|
+
|
|
165
|
+
Use AskUserQuestion:
|
|
166
|
+
|
|
167
|
+
> These test failures appear pre-existing (not caused by your branch changes):
|
|
168
|
+
> [list each failure with file:line and brief error description]
|
|
169
|
+
>
|
|
170
|
+
> RECOMMENDATION: Choose A — fix now while the context is fresh.
|
|
171
|
+
> A) Investigate and fix now (recommended)
|
|
172
|
+
> B) Add as P0 TODO — fix after this branch lands
|
|
173
|
+
> C) Skip — I know about this, ship anyway
|
|
174
|
+
|
|
175
|
+
#### Step T4: Execute the chosen action
|
|
176
|
+
|
|
177
|
+
**If "Investigate and fix now":**
|
|
178
|
+
- Fix the pre-existing failure.
|
|
179
|
+
- Commit the fix separately: `git commit -m "fix: pre-existing test failure in <test-file>"`
|
|
180
|
+
- Continue with the workflow.
|
|
181
|
+
|
|
182
|
+
**If "Add as P0 TODO":**
|
|
183
|
+
- Add an entry to TODOS.md (or create it) with priority P0.
|
|
184
|
+
- Continue — treat the pre-existing failure as non-blocking.
|
|
185
|
+
|
|
186
|
+
**If "Skip":**
|
|
187
|
+
- Continue. Note: "Pre-existing test failure skipped: <test-name>"
|
|
188
|
+
|
|
189
|
+
**After triage:** If any in-branch failures remain unfixed, **STOP**. If all failures were pre-existing and handled, continue to Step 6.
|
|
190
|
+
|
|
191
|
+
**If all pass:** Continue silently — just note the counts briefly.
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
## Step 6: Eval Suites (conditional)
|
|
196
|
+
|
|
197
|
+
Evals are mandatory when prompt-related files change. Skip this step entirely if no prompt files are in the diff.
|
|
198
|
+
|
|
199
|
+
1. Check if the diff touches prompt-related files. Match against patterns listed in CLAUDE.md (look for `Prompt/LLM changes` or a `## Evals` section).
|
|
200
|
+
|
|
201
|
+
2. If no matches: Print "No prompt-related files changed — skipping evals." and continue to Step 9.
|
|
202
|
+
|
|
203
|
+
3. If matches: Identify affected eval suites and run them at full tier (if eval infrastructure exists). If any eval fails, show the failures and **STOP**. If all pass, note pass counts.
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
## Step 7: Test Coverage Audit
|
|
208
|
+
|
|
209
|
+
**Dispatch this step as a subagent** using the Agent tool with `subagent_type: "general-purpose"`. The subagent runs the coverage audit in a fresh context window — the parent only sees the conclusion.
|
|
210
|
+
|
|
211
|
+
**Subagent prompt:** Pass these instructions to the subagent, with `<base>` substituted:
|
|
212
|
+
|
|
213
|
+
> You are running a ship-workflow test coverage audit. Run `git diff <base>...HEAD` as needed. Do not commit or push — report only.
|
|
214
|
+
>
|
|
215
|
+
> 100% coverage is the goal — every untested path is a path where bugs hide.
|
|
216
|
+
>
|
|
217
|
+
> **Test Framework Detection:** Read CLAUDE.md for a `## Testing` section. If not found, auto-detect by checking for jest.config.*, vitest.config.*, .rspec, pytest.ini, go.mod, Cargo.toml, etc.
|
|
218
|
+
>
|
|
219
|
+
> **0. Count test files before any generation:**
|
|
220
|
+
> `find . -name '*.test.*' -o -name '*.spec.*' -o -name '*_test.*' -o -name '*_spec.*' | grep -v node_modules | wc -l`
|
|
221
|
+
>
|
|
222
|
+
> **1. Trace every codepath changed** using `git diff <base>...HEAD`. For each changed file, trace how data flows through the code. Draw ASCII diagrams showing every function/method, every conditional branch, every error path.
|
|
223
|
+
>
|
|
224
|
+
> **2. Map user flows, interactions, and error states.** For each changed feature, think through user flows, interaction edge cases, error states the user can see, and empty/zero/boundary states.
|
|
225
|
+
>
|
|
226
|
+
> **3. Check each branch against existing tests.** Go branch by branch. Rate each: ★★★ (behavior + edge + error), ★★ (happy path), ★ (smoke test).
|
|
227
|
+
>
|
|
228
|
+
> **4. Output ASCII coverage diagram** with both code paths and user flows. Mark [→E2E] for integration-test-worthy paths and [→EVAL] for LLM eval-worthy paths. Include COVERAGE: N/M (X%) line.
|
|
229
|
+
>
|
|
230
|
+
> **5. Generate tests for uncovered paths.** Read 2-3 existing test files to match conventions. Write real tests with meaningful assertions. Run each test. Passes → keep. Fails → fix once. Still fails → delete silently. Cap: 20 tests maximum.
|
|
231
|
+
>
|
|
232
|
+
> **6. Count test files after generation.** For PR body: "Tests: {before} → {after} (+{delta} new)"
|
|
233
|
+
>
|
|
234
|
+
> **Coverage gate:** Check CLAUDE.md for `## Test Coverage` section with `Minimum:` and `Target:` fields. Default: Minimum=60%, Target=80%. If below target, report it.
|
|
235
|
+
>
|
|
236
|
+
> After your analysis, output a single JSON object on the LAST LINE of your response:
|
|
237
|
+
> `{"coverage_pct":N,"gaps":N,"diagram":"<full markdown coverage diagram>","tests_added":["path",...]}`
|
|
238
|
+
|
|
239
|
+
**Parent processing:**
|
|
240
|
+
1. Parse the LAST line as JSON.
|
|
241
|
+
2. Store `coverage_pct` for Step 20 metrics.
|
|
242
|
+
3. Embed `diagram` verbatim in the PR body's `## Test Coverage` section (Step 19).
|
|
243
|
+
4. Print: `Coverage: {coverage_pct}%, {gaps} gaps. {tests_added.length} tests added.`
|
|
244
|
+
|
|
245
|
+
**Coverage gate:** If coverage_pct < minimum (60%), use AskUserQuestion to ask whether to generate more tests or override. If coverage_pct >= target (80%), pass silently.
|
|
246
|
+
|
|
247
|
+
**If the subagent fails or returns invalid JSON:** Fall back to running the audit inline. Never block ship on subagent failure.
|
|
248
|
+
|
|
249
|
+
---
|
|
250
|
+
|
|
251
|
+
## Step 8: Plan Completion Audit
|
|
252
|
+
|
|
253
|
+
**Dispatch this step as a subagent** using the Agent tool with `subagent_type: "general-purpose"`. The subagent reads the plan file in its own fresh context.
|
|
254
|
+
|
|
255
|
+
**Subagent prompt:** Pass these instructions:
|
|
256
|
+
|
|
257
|
+
> You are running a ship-workflow plan completion audit. The base branch is `<base>`. Use `git diff <base>...HEAD` to see what shipped. Do not commit or push — report only.
|
|
258
|
+
>
|
|
259
|
+
> **Plan File Discovery:**
|
|
260
|
+
> 1. Check if there is an active plan file in the conversation context (plan file paths may be referenced in system messages).
|
|
261
|
+
> 2. If not found, search by content:
|
|
262
|
+
> ```bash
|
|
263
|
+
> BRANCH=$(git branch --show-current 2>/dev/null | tr '/' '-')
|
|
264
|
+
> REPO=$(basename "$(git rev-parse --show-toplevel 2>/dev/null)")
|
|
265
|
+
> for PLAN_DIR in "$HOME/.claude/plans" ".claude/plans" "."; do
|
|
266
|
+
> [ -d "$PLAN_DIR" ] || continue
|
|
267
|
+
> PLAN=$(ls -t "$PLAN_DIR"/*.md 2>/dev/null | xargs grep -l "$BRANCH" 2>/dev/null | head -1)
|
|
268
|
+
> [ -z "$PLAN" ] && PLAN=$(find "$PLAN_DIR" -name '*.md' -mmin -1440 -maxdepth 1 2>/dev/null | xargs ls -t 2>/dev/null | head -1)
|
|
269
|
+
> [ -n "$PLAN" ] && break
|
|
270
|
+
> done
|
|
271
|
+
> [ -n "$PLAN" ] && echo "PLAN_FILE: $PLAN" || echo "NO_PLAN_FILE"
|
|
272
|
+
> ```
|
|
273
|
+
> 3. If a plan file was found via content-based search, read the first 20 lines and verify it is relevant to the current branch's work.
|
|
274
|
+
>
|
|
275
|
+
> No plan file found → skip with "No plan file detected — skipping."
|
|
276
|
+
>
|
|
277
|
+
> **Actionable Item Extraction:** Read the plan. Extract checkboxes, numbered steps, imperative statements, file-level specs, test requirements, data model changes. Ignore context/background sections, questions/TBD items, explicitly deferred items. Cap at 50 items.
|
|
278
|
+
>
|
|
279
|
+
> **Cross-Reference Against Diff:** For each item: DONE (clear evidence), PARTIAL (incomplete), NOT DONE (no evidence), CHANGED (different approach, same goal).
|
|
280
|
+
>
|
|
281
|
+
> **Output:**
|
|
282
|
+
> ```
|
|
283
|
+
> PLAN COMPLETION AUDIT
|
|
284
|
+
> ═══════════════════════
|
|
285
|
+
> Plan: {path}
|
|
286
|
+
> [DONE] Create UserService
|
|
287
|
+
> [NOT DONE] Add caching layer
|
|
288
|
+
> COMPLETION: N/M DONE
|
|
289
|
+
> ```
|
|
290
|
+
>
|
|
291
|
+
> **Gate Logic:** If any NOT DONE items exist, ask: Stop to implement / Ship anyway + defer to P1 TODOs / Intentionally dropped.
|
|
292
|
+
>
|
|
293
|
+
> After your analysis, output a single JSON object on the LAST LINE:
|
|
294
|
+
> `{"total_items":N,"done":N,"changed":N,"deferred":N,"summary":"<markdown checklist for PR body>"}`
|
|
295
|
+
|
|
296
|
+
**Parent processing:** Parse the LAST line as JSON. If `deferred > 0` and no user override, present deferred items via AskUserQuestion before continuing. Embed `summary` in PR body.
|
|
297
|
+
|
|
298
|
+
**If the subagent fails or returns invalid JSON:** Fall back to running the audit inline.
|
|
299
|
+
|
|
300
|
+
---
|
|
301
|
+
|
|
302
|
+
## Step 8.1: Plan Verification
|
|
303
|
+
|
|
304
|
+
Using the plan file already discovered in Step 8, look for a verification section. Match headings: `## Verification`, `## Test plan`, `## Testing`, `## How to test`, or similar.
|
|
305
|
+
|
|
306
|
+
**If no verification section found:** Skip with "No verification steps found in plan — skipping auto-verification."
|
|
307
|
+
|
|
308
|
+
**If no plan file was found in Step 8:** Skip.
|
|
309
|
+
|
|
310
|
+
Check if a dev server is reachable before invoking browser-based verification:
|
|
311
|
+
|
|
312
|
+
```bash
|
|
313
|
+
curl -s -o /dev/null -w '%{http_code}' http://localhost:3000 2>/dev/null || \
|
|
314
|
+
curl -s -o /dev/null -w '%{http_code}' http://localhost:8080 2>/dev/null || \
|
|
315
|
+
curl -s -o /dev/null -w '%{http_code}' http://localhost:5173 2>/dev/null || echo "NO_SERVER"
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
**If NO_SERVER:** Skip with "No dev server detected — skipping plan verification."
|
|
319
|
+
|
|
320
|
+
If a dev server is reachable and a verification section exists: Execute the verification steps using the browser MCP (Playwright) or by running the project's automated test suite. Treat each verification item as a test case.
|
|
321
|
+
|
|
322
|
+
- **All pass:** Continue silently. "Plan verification: PASS."
|
|
323
|
+
- **Any FAIL:** Use AskUserQuestion showing failures. Options: A) Fix before shipping, B) Ship anyway — known issues.
|
|
324
|
+
|
|
325
|
+
---
|
|
326
|
+
|
|
327
|
+
## Step 8.2: Scope Drift Detection
|
|
328
|
+
|
|
329
|
+
Before reviewing code quality, check: **did they build what was requested — nothing more, nothing less?**
|
|
330
|
+
|
|
331
|
+
1. Read `TODOS.md` (if it exists). Read PR description. Read commit messages.
|
|
332
|
+
2. Identify the **stated intent** — what was this branch supposed to accomplish?
|
|
333
|
+
3. Run `git diff origin/<base>...HEAD --stat` and compare files changed against stated intent.
|
|
334
|
+
|
|
335
|
+
4. Evaluate for:
|
|
336
|
+
- **SCOPE CREEP** — files changed that are unrelated to the stated intent
|
|
337
|
+
- **MISSING REQUIREMENTS** — requirements not addressed in the diff
|
|
338
|
+
|
|
339
|
+
5. Output:
|
|
340
|
+
```
|
|
341
|
+
Scope Check: [CLEAN / DRIFT DETECTED / REQUIREMENTS MISSING]
|
|
342
|
+
Intent: <1-line summary of what was requested>
|
|
343
|
+
Delivered: <1-line summary of what the diff actually does>
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
6. This is **INFORMATIONAL** — does not block the review. Proceed.
|
|
347
|
+
|
|
348
|
+
---
|
|
349
|
+
|
|
350
|
+
## Step 9: Pre-Landing Review
|
|
351
|
+
|
|
352
|
+
Review the diff for structural issues that tests don't catch.
|
|
353
|
+
|
|
354
|
+
1. Read `.claude/skills/review/checklist.md`. If the file cannot be read, continue with the built-in checks below.
|
|
355
|
+
|
|
356
|
+
2. Run `git diff origin/<base>` to get the full diff.
|
|
357
|
+
|
|
358
|
+
3. Apply the review checklist in two passes:
|
|
359
|
+
- **Pass 1 (CRITICAL):** SQL & Data Safety, LLM Output Trust Boundary violations, Shell Injection, Race Conditions, Enum Completeness
|
|
360
|
+
- **Pass 2 (INFORMATIONAL):** All remaining categories (async/sync mixing, N+1, stale comments, dead code)
|
|
361
|
+
|
|
362
|
+
**Confidence Calibration:** Every finding must include a confidence score (1-10).
|
|
363
|
+
- 9-10: Verified by reading specific code. Show normally.
|
|
364
|
+
- 7-8: High confidence. Show normally.
|
|
365
|
+
- 5-6: Moderate. Show with caveat "Medium confidence, verify this is actually an issue."
|
|
366
|
+
- 3-4: Low. Suppress from main report — include in appendix only.
|
|
367
|
+
- 1-2: Speculation. Only report if P0.
|
|
368
|
+
|
|
369
|
+
**Finding format:** `[SEVERITY] (confidence: N/10) file:line — description`
|
|
370
|
+
|
|
371
|
+
### Design Review (conditional)
|
|
372
|
+
|
|
373
|
+
Check if the diff touches frontend files:
|
|
374
|
+
|
|
375
|
+
```bash
|
|
376
|
+
git diff origin/<base> --name-only | grep -iE '\.(tsx?|jsx?|css|scss|sass|vue|svelte|html)$' | head -5
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
If frontend files changed:
|
|
380
|
+
1. Read `DESIGN.md` or `design-system.md` in the repo root (if it exists). Findings are calibrated against it.
|
|
381
|
+
2. Read `.claude/skills/review/design-checklist.md` (if it exists). If not found, use universal design principles.
|
|
382
|
+
3. Apply the design checklist against changed frontend files.
|
|
383
|
+
4. Mechanical CSS AUTO-FIX items: apply directly. Design judgment ASK items: present to user.
|
|
384
|
+
|
|
385
|
+
### Step 9.1: Adversarial Review (always-on)
|
|
386
|
+
|
|
387
|
+
Dispatch an independent subagent via the Agent tool. The subagent has fresh context — no checklist bias from the structured review.
|
|
388
|
+
|
|
389
|
+
Subagent prompt:
|
|
390
|
+
"Read the diff for this branch with `git diff origin/<base>`. Think like an attacker and a chaos engineer. Your job is to find ways this code will fail in production. Look for: edge cases, race conditions, security holes, resource leaks, failure modes, silent data corruption, logic errors that produce wrong results silently, error handling that swallows failures, and trust boundary violations. Be adversarial. Be thorough. No compliments — just the problems. For each finding, classify as FIXABLE (you know how to fix it) or INVESTIGATE (needs human judgment)."
|
|
391
|
+
|
|
392
|
+
Present findings under an `ADVERSARIAL REVIEW (subagent):` header. **FIXABLE findings** flow into the same Fix-First pipeline as the structured review. **INVESTIGATE findings** are presented as informational.
|
|
393
|
+
|
|
394
|
+
**Cross-review synthesis:**
|
|
395
|
+
```
|
|
396
|
+
ADVERSARIAL REVIEW SYNTHESIS:
|
|
397
|
+
High confidence (found by multiple sources): [findings agreed on by >1 pass]
|
|
398
|
+
Unique to structured review: [from checklist pass]
|
|
399
|
+
Unique to adversarial subagent: [from subagent]
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
### Step 9.2: Fix-First Flow
|
|
403
|
+
|
|
404
|
+
After all review passes (checklist + adversarial):
|
|
405
|
+
|
|
406
|
+
1. **Classify each finding as AUTO-FIX or ASK:**
|
|
407
|
+
- AUTO-FIX: mechanical, low-risk, single-file changes (dead code, stale comments, obvious formatting)
|
|
408
|
+
- ASK: architectural, security-sensitive, ambiguous scope, or user preference
|
|
409
|
+
|
|
410
|
+
2. **Auto-fix all AUTO-FIX items.** Apply each fix. Output: `[AUTO-FIXED] [file:line] Problem → what you did`
|
|
411
|
+
|
|
412
|
+
3. **If ASK items remain,** present them in ONE AskUserQuestion:
|
|
413
|
+
- List each with number, severity, problem, recommended fix
|
|
414
|
+
- Per-item options: A) Fix B) Skip
|
|
415
|
+
- Overall RECOMMENDATION
|
|
416
|
+
|
|
417
|
+
4. **After all fixes (auto + user-approved):**
|
|
418
|
+
- If ANY fixes were applied: commit fixed files by name (`git add <fixed-files> && git commit -m "fix: pre-landing review fixes"`), then **STOP** and tell the user to run `ship` again to re-test.
|
|
419
|
+
- If no fixes applied: continue to Step 12.
|
|
420
|
+
|
|
421
|
+
5. Output summary: `Pre-Landing Review: N issues — M auto-fixed, K asked (J fixed, L skipped)`
|
|
422
|
+
|
|
423
|
+
---
|
|
424
|
+
|
|
425
|
+
## Step 10: Address Code Review Comments (if PR exists)
|
|
426
|
+
|
|
427
|
+
If a PR already exists, check for any open review comments:
|
|
428
|
+
|
|
429
|
+
- **GitHub:** `gh pr review list` and `gh api repos/:owner/:repo/pulls/{pr_number}/comments`
|
|
430
|
+
- **GitLab:** `glab mr view --comments`
|
|
431
|
+
|
|
432
|
+
For each comment:
|
|
433
|
+
- **VALID & ACTIONABLE:** Use AskUserQuestion. Options: A) Fix now, B) Acknowledge and ship anyway, C) It's a false positive.
|
|
434
|
+
- **ALREADY FIXED in this diff:** Reply to the comment noting it was fixed.
|
|
435
|
+
|
|
436
|
+
If fixes were applied, re-run tests (Step 5) before continuing.
|
|
437
|
+
|
|
438
|
+
If no PR exists yet: skip this step silently.
|
|
439
|
+
|
|
440
|
+
---
|
|
441
|
+
|
|
442
|
+
## Step 11: (Placeholder for future steps)
|
|
443
|
+
|
|
444
|
+
Continue to Step 12.
|
|
445
|
+
|
|
446
|
+
---
|
|
447
|
+
|
|
448
|
+
## Step 12: Version bump (auto-decide)
|
|
449
|
+
|
|
450
|
+
**Idempotency check:** Compare `VERSION` against the base branch.
|
|
451
|
+
|
|
452
|
+
```bash
|
|
453
|
+
BASE_VERSION=$(git show origin/<base>:VERSION 2>/dev/null | tr -d '\r\n[:space:]' || echo "0.0.0.0")
|
|
454
|
+
CURRENT_VERSION=$(cat VERSION 2>/dev/null | tr -d '\r\n[:space:]' || echo "0.0.0.0")
|
|
455
|
+
echo "BASE: $BASE_VERSION VERSION: $CURRENT_VERSION"
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
If `CURRENT_VERSION == BASE_VERSION`: **STATE = FRESH** → proceed with bump.
|
|
459
|
+
If `CURRENT_VERSION != BASE_VERSION`: **STATE = ALREADY_BUMPED** → skip bump, reuse `CURRENT_VERSION`.
|
|
460
|
+
|
|
461
|
+
**If FRESH — auto-decide the bump level:**
|
|
462
|
+
- Count lines changed: `git diff origin/<base>...HEAD --stat | tail -1`
|
|
463
|
+
- Check for feature signals: new route/page files, new DB migrations, branch name starting with `feat/`
|
|
464
|
+
- **MICRO** (4th digit): < 50 lines changed, trivial tweaks, typos, config
|
|
465
|
+
- **PATCH** (3rd digit): 50+ lines changed, no feature signals detected
|
|
466
|
+
- **MINOR** (2nd digit): **ASK the user** if ANY feature signal is detected, OR 500+ lines changed, OR new packages added
|
|
467
|
+
- **MAJOR** (1st digit): **ASK the user** — only for milestones or breaking changes
|
|
468
|
+
|
|
469
|
+
Compute new version (bumping a digit resets all digits to its right to 0). Write it to `VERSION` (and `package.json` if it exists).
|
|
470
|
+
|
|
471
|
+
---
|
|
472
|
+
|
|
473
|
+
## Step 13: CHANGELOG (auto-generate)
|
|
474
|
+
|
|
475
|
+
1. Read `CHANGELOG.md` header to know the format.
|
|
476
|
+
|
|
477
|
+
2. **Enumerate every commit on the branch:**
|
|
478
|
+
```bash
|
|
479
|
+
git log <base>..HEAD --oneline
|
|
480
|
+
```
|
|
481
|
+
|
|
482
|
+
3. **Read the full diff** to understand what each commit actually changed.
|
|
483
|
+
|
|
484
|
+
4. **Group commits by theme:** New features, Performance, Bug fixes, Cleanup, Infrastructure, Refactoring.
|
|
485
|
+
|
|
486
|
+
5. **Write the CHANGELOG entry** covering ALL groups:
|
|
487
|
+
- Categorize into `### Added`, `### Changed`, `### Fixed`, `### Removed`
|
|
488
|
+
- Insert after the file header, dated today
|
|
489
|
+
- Format: `## [X.Y.Z.W] - YYYY-MM-DD`
|
|
490
|
+
- **Voice:** Lead with what the user can now **do**. Use plain language, not implementation details.
|
|
491
|
+
|
|
492
|
+
6. **Cross-check:** Every commit must map to at least one bullet point.
|
|
493
|
+
|
|
494
|
+
---
|
|
495
|
+
|
|
496
|
+
## Step 14: TODOS.md (auto-update)
|
|
497
|
+
|
|
498
|
+
1. Check if TODOS.md exists. If not, use AskUserQuestion: create it now or skip.
|
|
499
|
+
|
|
500
|
+
2. Check structure and organization (priority fields, component groupings, Completed section).
|
|
501
|
+
|
|
502
|
+
3. **Detect completed TODOs:** Using the diff and commit history already gathered, match TODO items against what was shipped. Be conservative — only mark items as completed when the diff clearly shows the work is done.
|
|
503
|
+
|
|
504
|
+
4. **Move completed items** to the `## Completed` section. Append: `**Completed:** vX.Y.Z (YYYY-MM-DD)`
|
|
505
|
+
|
|
506
|
+
5. Output summary: `TODOS.md: N items marked complete. M items remaining.`
|
|
507
|
+
|
|
508
|
+
---
|
|
509
|
+
|
|
510
|
+
## Step 15: Commit (bisectable chunks)
|
|
511
|
+
|
|
512
|
+
### Step 15.1: Bisectable Commits
|
|
513
|
+
|
|
514
|
+
Analyze the diff and group changes into logical commits. Each commit should represent **one coherent change** — not one file, but one logical unit.
|
|
515
|
+
|
|
516
|
+
**Commit ordering** (earlier commits first):
|
|
517
|
+
- Infrastructure: migrations, config changes, route additions
|
|
518
|
+
- Models & services: new models, services (with their tests)
|
|
519
|
+
- Controllers & views: controllers, views, components (with their tests)
|
|
520
|
+
- VERSION + CHANGELOG + TODOS.md: always in the final commit
|
|
521
|
+
|
|
522
|
+
**Rules for splitting:**
|
|
523
|
+
- A model and its test file go in the same commit
|
|
524
|
+
- A service and its test file go in the same commit
|
|
525
|
+
- If total diff is small (< 50 lines across < 4 files), a single commit is fine
|
|
526
|
+
|
|
527
|
+
**Each commit must be independently valid** — no broken imports, no references to code that doesn't exist yet.
|
|
528
|
+
|
|
529
|
+
The **final commit** (VERSION + CHANGELOG) gets the version tag and co-author trailer:
|
|
530
|
+
|
|
531
|
+
```bash
|
|
532
|
+
git commit -m "$(cat <<'EOF'
|
|
533
|
+
chore: bump version and changelog (vX.Y.Z.W)
|
|
534
|
+
|
|
535
|
+
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
536
|
+
EOF
|
|
537
|
+
)"
|
|
538
|
+
```
|
|
539
|
+
|
|
540
|
+
---
|
|
541
|
+
|
|
542
|
+
## Step 16: Verification Gate
|
|
543
|
+
|
|
544
|
+
**IRON LAW: NO COMPLETION CLAIMS WITHOUT FRESH VERIFICATION EVIDENCE.**
|
|
545
|
+
|
|
546
|
+
Before pushing, re-verify if code changed during Steps 4-13:
|
|
547
|
+
|
|
548
|
+
1. **Test verification:** If ANY code changed after Step 5's test run, re-run the test suite. Stale output from Step 5 is NOT acceptable.
|
|
549
|
+
|
|
550
|
+
2. **Build verification:** If the project has a build step, run it.
|
|
551
|
+
|
|
552
|
+
3. **Rationalization prevention:**
|
|
553
|
+
- "Should work now" → RUN IT.
|
|
554
|
+
- "I'm confident" → Confidence is not evidence.
|
|
555
|
+
- "I already tested earlier" → Code changed since then. Test again.
|
|
556
|
+
|
|
557
|
+
**If tests fail here:** STOP. Do not push. Fix and return to Step 5.
|
|
558
|
+
|
|
559
|
+
---
|
|
560
|
+
|
|
561
|
+
## Step 17: Push
|
|
562
|
+
|
|
563
|
+
**Idempotency check:**
|
|
564
|
+
|
|
565
|
+
```bash
|
|
566
|
+
git fetch origin <branch-name> 2>/dev/null
|
|
567
|
+
LOCAL=$(git rev-parse HEAD)
|
|
568
|
+
REMOTE=$(git rev-parse origin/<branch-name> 2>/dev/null || echo "none")
|
|
569
|
+
[ "$LOCAL" = "$REMOTE" ] && echo "ALREADY_PUSHED" || echo "PUSH_NEEDED"
|
|
570
|
+
```
|
|
571
|
+
|
|
572
|
+
If `ALREADY_PUSHED`, skip the push but continue to Step 18. Otherwise:
|
|
573
|
+
|
|
574
|
+
```bash
|
|
575
|
+
git push -u origin <branch-name>
|
|
576
|
+
```
|
|
577
|
+
|
|
578
|
+
**You are NOT done.** Continue to Step 18.
|
|
579
|
+
|
|
580
|
+
---
|
|
581
|
+
|
|
582
|
+
## Step 18: Documentation sync (via subagent, before PR creation)
|
|
583
|
+
|
|
584
|
+
**Dispatch the `document-release` workflow as a subagent** using the Agent tool with `subagent_type: "general-purpose"`.
|
|
585
|
+
|
|
586
|
+
**Subagent prompt:**
|
|
587
|
+
|
|
588
|
+
> You are executing the document-release workflow after a code push. Run the complete document-release workflow end-to-end. The skill's steps are: pre-flight & diff analysis, per-file doc audit, auto-updates, ask about risky changes, CHANGELOG voice polish, cross-doc consistency, TODOS cleanup, VERSION bump question, commit & output. Branch: `<branch>`, base: `<base>`.
|
|
589
|
+
>
|
|
590
|
+
> Do NOT attempt to edit the PR body — no PR exists yet.
|
|
591
|
+
>
|
|
592
|
+
> After completing the workflow, output a single JSON object on the LAST LINE of your response:
|
|
593
|
+
> `{"files_updated":["README.md","CLAUDE.md",...],"commit_sha":"abc1234","pushed":true,"documentation_section":"<markdown block for PR body ## Documentation section>"}`
|
|
594
|
+
>
|
|
595
|
+
> If no documentation files needed updating, output:
|
|
596
|
+
> `{"files_updated":[],"commit_sha":null,"pushed":false,"documentation_section":null}`
|
|
597
|
+
|
|
598
|
+
**Parent processing:**
|
|
599
|
+
1. Parse the LAST line as JSON.
|
|
600
|
+
2. Store `documentation_section` — Step 19 embeds it in the PR body.
|
|
601
|
+
3. Print: `Documentation synced: {N} files updated.` or `Documentation is current — no updates needed.`
|
|
602
|
+
|
|
603
|
+
**If the subagent fails or returns invalid JSON:** Warn and proceed to Step 19 without a `## Documentation` section.
|
|
604
|
+
|
|
605
|
+
---
|
|
606
|
+
|
|
607
|
+
## Step 19: Create PR/MR
|
|
608
|
+
|
|
609
|
+
**Idempotency check:** Check if a PR/MR already exists for this branch.
|
|
610
|
+
|
|
611
|
+
- GitHub: `gh pr view --json url,number,state 2>/dev/null`
|
|
612
|
+
- GitLab: `glab mr view -F json 2>/dev/null`
|
|
613
|
+
|
|
614
|
+
If an **open** PR/MR already exists: **update** the PR body with fresh results from this run. Never reuse stale PR body content. Print the existing URL and continue.
|
|
615
|
+
|
|
616
|
+
If no PR/MR exists: create one.
|
|
617
|
+
|
|
618
|
+
**PR/MR body:**
|
|
619
|
+
|
|
620
|
+
```markdown
|
|
621
|
+
## Summary
|
|
622
|
+
[Summarize ALL changes being shipped. Run `git log <base>..HEAD --oneline` to enumerate every commit. Group into logical sections. Every substantive commit must appear in at least one section.]
|
|
623
|
+
|
|
624
|
+
## Test Coverage
|
|
625
|
+
[coverage diagram from Step 7, or "All new code paths have test coverage."]
|
|
626
|
+
[If Step 7 ran: "Tests: {before} → {after} (+{delta} new)"]
|
|
627
|
+
|
|
628
|
+
## Pre-Landing Review
|
|
629
|
+
[findings from Step 9, or "No issues found."]
|
|
630
|
+
|
|
631
|
+
## Plan Completion
|
|
632
|
+
[If plan file found: completion checklist summary from Step 8]
|
|
633
|
+
[If no plan file: "No plan file detected."]
|
|
634
|
+
|
|
635
|
+
## Verification Results
|
|
636
|
+
[If verification ran: summary from Step 8.1]
|
|
637
|
+
[If skipped: reason]
|
|
638
|
+
|
|
639
|
+
## TODOS
|
|
640
|
+
[If items marked complete: bullet list with version]
|
|
641
|
+
[If no items completed: "No TODO items completed in this PR."]
|
|
642
|
+
|
|
643
|
+
## Documentation
|
|
644
|
+
[Embed documentation_section from Step 18 verbatim, or omit section if null]
|
|
645
|
+
|
|
646
|
+
## Test plan
|
|
647
|
+
- [x] All tests pass
|
|
648
|
+
|
|
649
|
+
🤖 Generated with [Claude Code](https://claude.com/claude-code)
|
|
650
|
+
```
|
|
651
|
+
|
|
652
|
+
**GitHub:**
|
|
653
|
+
```bash
|
|
654
|
+
gh pr create --base <base> --title "<type>: <summary>" --body "..."
|
|
655
|
+
```
|
|
656
|
+
|
|
657
|
+
**GitLab:**
|
|
658
|
+
```bash
|
|
659
|
+
glab mr create -b <base> -t "<type>: <summary>" -d "..."
|
|
660
|
+
```
|
|
661
|
+
|
|
662
|
+
**If neither CLI is available:** Print the branch name, remote URL, and instruct the user to create the PR/MR manually.
|
|
663
|
+
|
|
664
|
+
**Output the PR/MR URL** — then proceed to Step 20.
|
|
665
|
+
|
|
666
|
+
---
|
|
667
|
+
|
|
668
|
+
## Step 20: Record metrics (in project state)
|
|
669
|
+
|
|
670
|
+
Save ship metrics to the project's `.context/` directory for `retro` to track trends:
|
|
671
|
+
|
|
672
|
+
```bash
|
|
673
|
+
mkdir -p .context/ships
|
|
674
|
+
```
|
|
675
|
+
|
|
676
|
+
Use the Write tool to append a JSON line to `.context/ships/log.jsonl`:
|
|
677
|
+
|
|
678
|
+
```json
|
|
679
|
+
{"skill":"ship","timestamp":"<ISO datetime>","coverage_pct":N,"plan_items_total":N,"plan_items_done":N,"version":"X.Y.Z.W","branch":"<branch>","pr_url":"<url>"}
|
|
680
|
+
```
|
|
681
|
+
|
|
682
|
+
This step is automatic — never skip it, never ask for confirmation.
|
|
683
|
+
|
|
684
|
+
---
|
|
685
|
+
|
|
686
|
+
## Important Rules
|
|
687
|
+
|
|
688
|
+
- **Never skip tests.** If tests fail, stop.
|
|
689
|
+
- **Never force push.** Use regular `git push` only.
|
|
690
|
+
- **Never ask for trivial confirmations** (e.g., "ready to push?", "create PR?"). DO stop for: version bumps (MINOR/MAJOR), pre-landing review ASK items.
|
|
691
|
+
- **Always use the 4-digit version format** from the VERSION file (MAJOR.MINOR.PATCH.MICRO).
|
|
692
|
+
- **Date format in CHANGELOG:** `YYYY-MM-DD`
|
|
693
|
+
- **Split commits for bisectability** — each commit = one logical change.
|
|
694
|
+
- **TODOS.md completion detection must be conservative.** Only mark items as completed when the diff clearly shows the work is done.
|
|
695
|
+
- **Never push without fresh verification evidence.** If code changed after Step 5 tests, re-run before pushing.
|
|
696
|
+
- **The goal is: user says `ship`, next thing they see is the review + PR URL + auto-synced docs.**
|