liteagents 2.19.0 → 2.21.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 (49) hide show
  1. package/CHANGELOG.md +60 -0
  2. package/README.md +4 -4
  3. package/package.json +1 -1
  4. package/packages/ampcode/AGENT.md +4 -4
  5. package/packages/ampcode/agents/code-developer.md +2 -2
  6. package/packages/ampcode/agents/quality-assurance.md +1 -1
  7. package/packages/ampcode/commands/branch-review.md +123 -0
  8. package/packages/ampcode/commands/release.md +108 -79
  9. package/packages/ampcode/commands/remember/AGENT_RULES.md +26 -26
  10. package/packages/ampcode/commands/remember.md +4 -4
  11. package/packages/ampcode/commands/security.md +34 -18
  12. package/packages/ampcode/commands/ship.md +29 -26
  13. package/packages/ampcode/commands/stash.md +12 -6
  14. package/packages/claude/CLAUDE.md +4 -4
  15. package/packages/claude/agents/code-developer.md +2 -2
  16. package/packages/claude/agents/quality-assurance.md +1 -1
  17. package/packages/claude/commands/branch-review.md +123 -0
  18. package/packages/claude/commands/release.md +108 -79
  19. package/packages/claude/commands/remember/AGENT_RULES.md +26 -26
  20. package/packages/claude/commands/remember.md +4 -4
  21. package/packages/claude/commands/security.md +34 -18
  22. package/packages/claude/commands/ship.md +29 -26
  23. package/packages/claude/commands/stash.md +12 -6
  24. package/packages/droid/AGENTS.md +4 -4
  25. package/packages/droid/commands/branch-review.md +123 -0
  26. package/packages/droid/commands/release.md +108 -79
  27. package/packages/droid/commands/remember/AGENT_RULES.md +26 -26
  28. package/packages/droid/commands/remember.md +4 -4
  29. package/packages/droid/commands/security.md +34 -18
  30. package/packages/droid/commands/ship.md +29 -26
  31. package/packages/droid/commands/stash.md +12 -6
  32. package/packages/droid/droids/code-developer.md +2 -2
  33. package/packages/droid/droids/quality-assurance.md +1 -1
  34. package/packages/opencode/AGENTS.md +4 -4
  35. package/packages/opencode/agent/code-developer.md +2 -2
  36. package/packages/opencode/agent/quality-assurance.md +1 -1
  37. package/packages/opencode/command/branch-review.md +123 -0
  38. package/packages/opencode/command/release.md +108 -79
  39. package/packages/opencode/command/remember/AGENT_RULES.md +26 -26
  40. package/packages/opencode/command/remember.md +4 -4
  41. package/packages/opencode/command/security.md +34 -18
  42. package/packages/opencode/command/ship.md +29 -26
  43. package/packages/opencode/command/stash.md +12 -6
  44. package/packages/opencode/opencode.jsonc +6 -6
  45. package/packages/subagentic-manual.md +5 -5
  46. package/packages/ampcode/commands/diff-review.md +0 -78
  47. package/packages/claude/commands/diff-review.md +0 -78
  48. package/packages/droid/commands/diff-review.md +0 -78
  49. package/packages/opencode/command/diff-review.md +0 -78
@@ -10,10 +10,10 @@ Run friction analysis, then consolidate session stashes + friction antigens into
10
10
  - Favor straightforward, minimal implementations first and add complexity only when requested or clearly required.
11
11
  - Keep changes tightly scoped to the requested outcome.
12
12
  - **Precision over recall for hot memory.** A false antigen loaded into `@MEMORY.md` steers every future session. When unsure, do not promote — leave it to recurrence (a ledger `observing` entry at 2 sessions, nothing at 1).
13
- - **Mid-tier model, not hardcoded.** Steps 2/3/4a delegate to a mid-tier model — capable of
14
- semantic judgment, cheaper/faster than your top reasoning tier (e.g. Claude's Sonnet vs
15
- Opus). Use whatever your tool designates as that balanced default; never hardcode a
16
- vendor-specific model name.
13
+ - **Mid-tier model, not hardcoded.** Steps 2/3/4a delegate to your tool's balanced default
14
+ tier judgment-capable, cheaper and faster than your top reasoning tier. **Not the
15
+ cheapest/fastest tier**: on judgment work it measurably degrades (misclassification rates
16
+ several times higher). Never hardcode a vendor-specific model name.
17
17
  - **Batch stashes, don't fan out.** Step 2 gives each extraction agent **up to 5 stashes**
18
18
  and uses as few agents as possible (3 stashes → 1 agent, 7 → 2). One agent reading several
19
19
  sessions sees the same lesson recur and writes it once; one agent per stash writes it once
@@ -1,12 +1,20 @@
1
1
  ---
2
2
  name: security
3
- description: Scan security [target]
3
+ description: Security audit — recurring six, injection, auth, trust boundaries
4
4
  usage: /security
5
5
  argument-hint: [file, directory, or leave empty for full scan]
6
- allowed-tools: Read, Edit, Grep, Glob, Bash(git log *), Bash(git grep *), Bash(rg *)
6
+ allowed-tools: Read, Grep, Glob, Bash(git log *), Bash(git grep *), Bash(rg *)
7
7
  ---
8
- Audit $ARGUMENTS for security vulnerabilities. Adapt scope to what the target
9
- actually is — a library, CLI, web app, and service won't all have every
8
+ Audit $ARGUMENTS for security vulnerabilities. **Reports, never edits** it
9
+ verifies every claim, then hands the findings to whoever asked.
10
+
11
+ **Runs identically standalone or as stage 2 of `/branch-review`.** The only
12
+ difference is where the report goes: to the orchestrator when called as a
13
+ stage, to you when you run it directly. Same checks, same verify pass, same
14
+ escalation. It does **not** spawn a worker of its own — run it inline; when
15
+ `/branch-review` calls it, it is already inside that command's worker.
16
+
17
+ Adapt scope to what the target actually is — a library, CLI, web app, and service won't all have every
10
18
  category. Skip what genuinely doesn't apply; never invent findings to fill a
11
19
  section.
12
20
 
@@ -58,22 +66,23 @@ End with: which of the six classes were checked and found **clean**, and any
58
66
  marked **N/A** for this target — so the scan's coverage is auditable, not just
59
67
  its hits.
60
68
 
61
- ## After the scan — verify, then fix
69
+ ## After the scan — verify, then escalate
62
70
 
63
- Findings are claims, not facts. Validate before acting; validate again after.
71
+ Findings are claims, not facts. Validate every one before reporting it; an
72
+ unverified finding wastes more time than a missed one.
64
73
 
65
- **Verify each claim.** Re-read the cited `file:line` in context. Confirm the
66
- risk actually holds here not in the abstract. Mark each **confirmed**, **false
67
- positive** (with reason), or **uncertain**.
74
+ **Verify each claim — adversarially.** Re-read the cited `file:line` in full
75
+ context and **try to break the claim, not to confirm it**: is there a gate
76
+ upstream, a framework default, a caller that already validates? A pass that
77
+ sets out to confirm reliably misses what an adversarial pass finds. Mark each
78
+ **confirmed**, **false positive** (with reason), or **uncertain** (with what
79
+ would settle it).
68
80
 
69
- **Fix what's confirmed and unambiguous** — minimal shape, one obvious way, no
70
- change to a public API / response / caller contract. Apply directly. After
71
- each edit, re-read the changed region and confirm it closes the gap without
72
- breaking nearby logic. A fix isn't done until you've grounded it the same way
73
- you grounded the claim.
81
+ **Never fix.** Not even a confirmed, one-line, obvious fix. Describe the
82
+ minimal remediation and hand it back applying it is a separate, separately
83
+ authorized action.
74
84
 
75
- **Stop and ask** when any of these hold (HITL gates — not all the time, only
76
- here):
85
+ **Flag these explicitly** they need a human decision, not a recommendation:
77
86
  - the finding is **uncertain** after grounding (you'd need info you don't have),
78
87
  - the fix has **multiple reasonable shapes** (e.g. reject-vs-sanitize,
79
88
  index-vs-paginate) — present options with tradeoffs, not a chosen path,
@@ -82,5 +91,12 @@ here):
82
91
  - it touches **auth / crypto / session / token** primitives — even an "obvious"
83
92
  fix here warrants confirmation.
84
93
 
85
- Final report: **confirmed-and-fixed** · **confirmed-but-asking** (why + options)
86
- · **false-positive** (why) · **uncertain** (what's needed to decide).
94
+ Final report: **confirmed** (with remediation described) · **needs a decision**
95
+ (why + the options and their tradeoffs) · **false positive** (why) ·
96
+ **uncertain** (what is needed to decide).
97
+
98
+ **Escalate, never assume.** Anything you cannot decide, cannot verify, or that
99
+ this spec does not cover → say so plainly in the report rather than guessing.
100
+ When running as a stage of `/branch-review`, that report goes to the
101
+ orchestrator; standalone, it goes to the user. Never widen scope, never fix a
102
+ side issue you noticed along the way.
@@ -1,14 +1,24 @@
1
1
  ---
2
2
  name: ship
3
- description: Check pre-deployment
3
+ description: Mechanical pre-deploy gate — tests, build, tree state
4
4
  usage: /ship
5
5
  allowed-tools: Read, Grep, Glob, Bash(git *), Bash(npm *), Bash(pnpm *), Bash(yarn *), Bash(pytest *), Bash(python *), Bash(go *), Bash(cargo *), Bash(make *)
6
6
  ---
7
- Pre-deploy / pre-merge gate. **Detect the stack first** (look for
8
- `package.json`, `pyproject.toml`/`setup.cfg`, `go.mod`, `Cargo.toml`,
9
- `Makefile`) and run only the checks that actually exist never assume a
10
- script (`lint`, `build`, `migrate`) is present. Report each item as
11
- **pass / fail / N/A**.
7
+ Mechanical pre-deploy / pre-merge gate. Every item here is answerable by
8
+ **running a command** and reading its exit code — no code judgment. Code
9
+ judgment belongs to `/branch-review` (which runs `/security` in full as its
10
+ second stage); this gate does not duplicate it.
11
+
12
+ **Detect the stack first** (look for `package.json`,
13
+ `pyproject.toml`/`setup.cfg`, `go.mod`, `Cargo.toml`, `Makefile`) and run only
14
+ the checks that actually exist — never assume a script (`lint`, `build`,
15
+ `migrate`) is present.
16
+
17
+ ## Evidence rule
18
+ Report each item as **pass / fail / N/A**, and record **the exact command and
19
+ its exit code**. A check you did not run is a **fail**, never a pass. **N/A
20
+ requires a stated reason** ("no build script in `package.json`") — N/A must
21
+ never stand in for "didn't get to it."
12
22
 
13
23
  ## Checklist
14
24
  - [ ] **Tests pass** — run the project's real test command (`npm test`,
@@ -17,24 +27,17 @@ script (`lint`, `build`, `migrate`) is present. Report each item as
17
27
  - [ ] **Build succeeds** — only if the project has a build step.
18
28
  - [ ] **No debug leftovers** — stray `console.log` / `print` / `debugger` /
19
29
  `dbg!` / commented-out blocks / blocker `TODO`s in the changed files.
20
- - [ ] **No hardcoded secrets** — scan the diff. Secrets load from env / a
21
- secret store; `.env` is gitignored and only a value-less `.env.example`
22
- is tracked.
23
- - [ ] **Error handling complete** every new IO / network / DB call has a
24
- failure path; nothing fails silently; no internal detail leaks to clients.
25
- - [ ] **Authorization** — new endpoints/actions check **ownership + role**,
26
- not just authentication (no IDOR via id-swapping).
27
- - [ ] **Rate limiting** — new externally reachable routes, including
28
- authenticated writes, are bounded.
29
- - [ ] **Data access scoped & scales** new queries are constrained to the
30
- requesting principal (no cross-tenant leak) and avoid obvious N+1 /
31
- unindexed scans on hot paths.
32
- - [ ] **Migrations ready** — only if the project has a schema / migrations.
33
- - [ ] **Docs & config in sync** — `.env.example`, README, and any
34
- threat-model / PRD updated for new config or new attack surface.
35
- - [ ] **Clean tree, correct branch, in sync with `origin`.**
36
-
37
- For any security-sensitive change in the diff, run **`/security`** on the
38
- changed files before shipping.
30
+ - [ ] **No hardcoded secrets** — grep the diff for keys, tokens, credentials;
31
+ confirm `.env` is gitignored and only a value-less `.env.example` is
32
+ tracked. *This is the one check `/security` also makes, kept
33
+ deliberately: it is a grep with a binary answer, and a leaked key is the
34
+ one failure worth catching twice.*
35
+ - [ ] **Migrations ready** — only if the project has a schema / migrations:
36
+ they apply cleanly and are ordered.
37
+ - [ ] **Docs & config in sync** — `.env.example`, README, and any PRD /
38
+ context doc updated for new config or new usage.
39
+ - [ ] **Clean tree, correct branch, in sync with `origin`** and never on
40
+ `main`.
39
41
 
40
- Report: **Ready 🚀** or **Blocked 🛑** with the specific failing items.
42
+ Report: **Ready 🚀** or **Blocked 🛑** with the specific failing items and the
43
+ command output that proves each one.
@@ -8,12 +8,18 @@ argument-hint: [optional stash name]
8
8
  Save session context for compaction recovery or handoffs.
9
9
 
10
10
  **Guardrails**
11
- - Favor straightforward, minimal implementations first and add complexity only when requested or clearly required.
12
- - Keep changes tightly scoped to the requested outcome.
13
- - **Mid-tier model, not hardcoded.** The write-up subagent (step 2) uses a mid-tier model
14
- capable of semantic judgment, cheaper/faster than your top reasoning tier (e.g. Claude's
15
- Sonnet vs Opus). Use whatever your tool designates as that balanced default; never hardcode
16
- a vendor-specific model name.
11
+ - **Write only what the brief contains.** The subagent expands the brief into a file; it does
12
+ not research, re-derive, or infer. Every fact, number, SHA, path, and identifier in the
13
+ stash comes from the brief verbatim never invent, never round, never fill a gap with a
14
+ plausible guess. Missing detail stays missing.
15
+ - **Escalate, never assume.** Anything the subagent cannot do, cannot verify, or that this
16
+ spec does not cover → report it back to the orchestrator (the main session) rather than
17
+ improvising. Never widen scope beyond writing the file and counting the backlog.
18
+ - **Mid-tier model, not hardcoded.** Run the worker on your tool's balanced default tier —
19
+ judgment-capable, cheaper and faster than your top reasoning tier. **Not the
20
+ cheapest/fastest tier**: on judgment work it measurably degrades (misclassification rates
21
+ several times higher). Never hardcode a vendor-specific model name; use whatever your tool
22
+ designates as that default.
17
23
  - **Background dispatch where supported.** Run the write-up subagent in the background
18
24
  (non-blocking) so the session isn't held up waiting on formatting/file I/O. Fall back to
19
25
  writing inline (today's behavior) if your tool has no subagent or background-dispatch
@@ -43,10 +43,10 @@ These subagents are available when using Claude Code CLI. Droid can reference th
43
43
  | optimize | Analyze and optimize performance issues | /optimize <target-area> |
44
44
  | refactor | Refactor code while maintaining behavior and tests | /refactor <code-section> |
45
45
  | remember | Consolidate stashes + friction into project memory | /remember |
46
- | diff-review | Comprehensive code review including quality, tests, and architecture | /diff-review |
47
- | security | Security vulnerability scan and analysis | /security |
48
- | ship | Pre-deployment verification checklist | /ship |
49
- | release | Deliver a feature end-to-end: verify, docs, merge, tag (publish stays manual) | /release [branch] |
46
+ | branch-review | Pre-merge review: general review + full security audit, verify pass, no fixes | /branch-review [target] [level] |
47
+ | security | Security audit recurring six, injection, auth, trust boundaries; reports, never fixes | /security [target] |
48
+ | ship | Mechanical pre-deploy gate tests, build, tree state | /ship |
49
+ | release | Verify, sweep docs, cut a version then hand back the merge/tag/publish sequence | /release |
50
50
  | stash | Save session context for compaction recovery or handoffs | /stash ["optional-name"] |
51
51
  | test-generate | Generate tests, run them, verify each one actually exercises the code | /test-generate <file> |
52
52
 
@@ -75,7 +75,7 @@ digraph CodeDeveloper {
75
75
  regression_fixable [label="Fixable?", shape=diamond];
76
76
 
77
77
  // Review and complete
78
- code_review [label="Run /diff-review"];
78
+ code_review [label="Run /branch-review"];
79
79
  verification [label="Run /verify-done", fillcolor=orange];
80
80
 
81
81
  // Story-specific
@@ -191,7 +191,7 @@ All require `*` prefix. Invocation commands in table above. Additional:
191
191
  | Writing any test | `/test-traps` (avoid mocks, production pollution) |
192
192
  | Before completion | `/verify-done` |
193
193
  | After code changes | `/security` |
194
- | Task complete / general review | `/diff-review` (diffs branch or staged changes, verifies, fixes confirmed issues, asks on ambiguous ones) |
194
+ | Task complete / general review | `/branch-review` (reviews the branch + full security audit, verifies claims, reports findings never fixes) |
195
195
  | Performance issues | `/optimize` |
196
196
 
197
197
  You are an autonomous implementation specialist. Execute with precision, delegate appropriately, and communicate clearly when you need guidance or encounter blockers.
@@ -65,7 +65,7 @@ Before any analysis, read (if exists):
65
65
 
66
66
  ## Slash Commands Available
67
67
 
68
- Use these during analysis: `/diff-review`, `/security`, `/verify-done`
68
+ Use these during analysis: `/branch-review`, `/security`, `/verify-done`
69
69
 
70
70
  ## Analysis Areas
71
71
 
@@ -0,0 +1,123 @@
1
+ ---
2
+ name: branch-review
3
+ description: Review a branch before merge [target] [level]
4
+ usage: /branch-review [target] [low|medium|high|max]
5
+ argument-hint: [file, branch (e.g. main), range (main..HEAD), or empty] [effort level]
6
+ allowed-tools: Read, Grep, Glob, Agent, Bash(git diff:*), Bash(git log:*), Bash(git show:*), Bash(git status:*), Bash(git grep:*), Bash(git rev-parse:*), Bash(git merge-base:*), Bash(rg:*)
7
+ ---
8
+ Pre-merge review gate. Two stages — **general review** then a **full security
9
+ audit** — followed by an adversarial verify pass. It **never edits code**: it
10
+ reports findings and hands them back. Fixing is a separate, separately
11
+ authorized action.
12
+
13
+ Run this **before** `/release`. `/release` will refuse to run without a review
14
+ at the current HEAD SHA.
15
+
16
+ ## Guardrails
17
+ - **Spawn a worker on a mid-tier model, not hardcoded.** The review runs in a
18
+ subagent on your tool's balanced default tier — judgment-capable, cheaper and
19
+ faster than your top reasoning tier. **Not the cheapest/fastest tier**: on
20
+ judgment work it measurably degrades (misclassification rates several times
21
+ higher). Never hardcode a vendor-specific model name. Fall back to running
22
+ inline if your tool has no subagent mechanism.
23
+ - **Escalate, never assume.** Anything you cannot decide, cannot verify, or
24
+ that this spec does not cover → **stop and report it to the orchestrator**
25
+ (the main session). Never improvise, never widen scope, never fix a side
26
+ issue you noticed along the way.
27
+ - **No edits.** You have no authorization to change code, even for a finding
28
+ you are certain about. Report it.
29
+
30
+ ## Target — interpret `$ARGUMENTS` in this order
31
+ 1. **Empty** → the current branch vs its merge-base with `main`
32
+ (`git diff $(git merge-base main HEAD)..HEAD`). If that is empty, the
33
+ staged diff; if that is empty too, the working tree.
34
+ 2. **A range** like `main..HEAD` or `origin/main...HEAD` → `git diff <range>`.
35
+ 3. **A single ref** (branch / tag / SHA — confirm with `git rev-parse
36
+ --verify`) → that ref's merge-base against `HEAD`.
37
+ 4. **A file or directory path** → that target.
38
+ 5. Otherwise → ask.
39
+
40
+ Record the **HEAD SHA** you reviewed. `/release` checks it, and any commit
41
+ made after the review makes the review stale.
42
+
43
+ ## Effort level
44
+ `low | medium | high | max` — default **medium** if not given. The level
45
+ governs **stage 1 only**:
46
+ - **low / medium** — fewer findings, only ones you are confident in.
47
+ - **high / max** — broader coverage; uncertain findings are allowed, but each
48
+ must be labelled uncertain.
49
+
50
+ **Stage 2 (security) always runs full, at every level.** A shallow security
51
+ pass is worse than none — it reads as coverage while missing the class of bug
52
+ that costs the most.
53
+
54
+ ## Stage 1 — General review
55
+ The diff is the subject, but **read the whole file around every hunk** — a
56
+ hunk-only read cannot see that a caller further down the same file is now
57
+ wrong. For multi-commit ranges, skim `git log <range>` for intent before
58
+ judging.
59
+
60
+ - **Bugs needing a fix.** Logic errors, off-by-one, null/undefined paths,
61
+ races, wrong defaults, broken edge cases.
62
+ - **Dead code.** Unreferenced functions / vars / imports / params, unreachable
63
+ branches, commented-out blocks, legacy paths the diff just obsoleted.
64
+ `git grep` the symbol before flagging — easy to be wrong.
65
+ - **Loose ends.** TODO / FIXME / XXX added by this diff, half-finished
66
+ branches, silently swallowed errors, stub bodies, mocked-out paths,
67
+ "temporary" names, abandoned feature flags.
68
+ - **Correctness.** Edge cases, error handling, type / contract violations,
69
+ broken invariants.
70
+ - **Performance.** N+1, blocking calls in hot paths, unbounded loops, indexes
71
+ the diff actually touches.
72
+ - **Maintainability.** Complexity, naming, duplication — only when material.
73
+
74
+ ## Stage 2 — Security (always full)
75
+ **Delegate; do not re-implement.** Locate and **read** the installed
76
+ `security.md` and run its actual checklist — the recurring six (secrets in the
77
+ repo *and in git history*, data-access authorization / tenant isolation, rate
78
+ limiting, unhappy-path error handling, authorization beyond authentication,
79
+ inefficient data access) plus injection, auth/session, and trust boundaries.
80
+
81
+ If `security.md` cannot be found, run what you can from the list above and
82
+ **flag that the full checklist was unavailable** — never report it as passed.
83
+
84
+ This stage is repo- and history-scoped, not diff-scoped: a key committed forty
85
+ commits ago, an unbounded route the diff never touched, or a missing row
86
+ policy on a table the new code now reads are all in scope.
87
+
88
+ ## Stage 3 — Verify (adversarial)
89
+ Findings are claims, not facts. **Try to break each one, not to confirm it** —
90
+ a pass that sets out to confirm reliably misses what an adversarial pass
91
+ finds.
92
+
93
+ - Re-read the cited `file:line` in full context.
94
+ - `git grep` the name across the repo before trusting any dead-code or
95
+ unused-symbol claim.
96
+ - Mark each **confirmed**, **false positive** (with the reason), or
97
+ **uncertain** (with what would settle it).
98
+
99
+ **Every surviving finding must carry a concrete failure scenario**: specific
100
+ inputs or state → the wrong output, crash, or exposure that results. If you
101
+ cannot write that sentence, the finding is not ready — drop it or mark it
102
+ uncertain. No vibes.
103
+
104
+ ## Report — then escalate
105
+ Order findings most severe first.
106
+
107
+ ### 🚨 Critical (blocks merge)
108
+ ### ⚠️ Warnings (should fix)
109
+ ### 💡 Suggestions (nice to have)
110
+
111
+ Each finding: **Location** (`file:line`) · **What's wrong** · **Failure
112
+ scenario** (inputs/state → result) · **Why it matters** · **Suggested fix**
113
+ (described, not applied) · **Verdict** (confirmed / uncertain).
114
+
115
+ Then a coverage line: stage 1 at level `<level>`, stage 2 full — each `ran ✓/✗`
116
+ with its evidence. A stage you did not actually run is a **✗**, never an
117
+ assumed pass.
118
+
119
+ End with:
120
+ - **Reviewed at HEAD `<sha>` on `<branch>`.**
121
+ - One-line verdict: **Ready to merge? Yes / No / Not until these are fixed.**
122
+ - **Escalate to the orchestrator** with the findings. It decides what gets
123
+ fixed and by whom. Say plainly what you could not verify.
@@ -1,90 +1,119 @@
1
1
  ---
2
2
  name: release
3
- description: Deliver a feature end-to-end verify, docs, merge, tag (publish stays manual)
4
- usage: /release [branch]
5
- argument-hint: [branch new or existing; else current]
6
- allowed-tools: Read, Grep, Glob, Edit, Write, Bash(git:*), Bash(gh:*), Bash(npm:*), Bash(pnpm:*), Bash(yarn:*), Bash(pytest:*), Bash(python:*), Bash(go:*), Bash(cargo:*), Bash(make:*)
3
+ description: Verify, sweep docs, cut a versionthen hand the release sequence back
4
+ usage: /release
5
+ allowed-tools: Read, Grep, Glob, Edit, Write, Agent, Bash(git status:*), Bash(git diff:*), Bash(git log:*), Bash(git show:*), Bash(git fetch:*), Bash(git add:*), Bash(git commit:*), Bash(git rev-parse:*), Bash(git merge-base:*), Bash(npm:*), Bash(pnpm:*), Bash(yarn:*), Bash(pytest:*), Bash(python:*), Bash(go:*), Bash(cargo:*), Bash(make:*)
7
6
  ---
8
- End-to-end feature-delivery **orchestrator**. It does **not** re-implement
9
- checks it runs your existing gates (`/ship`, `/security`, `/diff-review`)
10
- under `/verify-done` discipline, then performs the release actions. Two halves
11
- split by a hard gate: everything **before** the gate is safe and read-only;
12
- everything **after** rewrites history and is confirmed step by step.
13
-
14
- **A feature branch is required `main` is only the merge target.** `$ARGUMENTS`
15
- names the branch to release. Omit it only if you are already on a feature
16
- branch. If you are on `main` with nothing named, a branch is created for you —
17
- but you should be releasing a deliberately-named feature branch.
18
-
19
- ## Phase 0 Preflight (resolve a feature branch never `main`)
20
- - **Resolve the release branch** whatever gets merged into `main`:
21
- - `$ARGUMENTS` given `git switch` to it (create it if it does not exist).
22
- - else not on `main` release the **current** branch.
23
- - else on `main` with no arg **create** `feat/<slug>` (named for the
24
- change) and carry your working changes onto it. **Never release `main`.**
25
- - **Land the feature on the branch** if the working tree still has
26
- uncommitted feature changes, commit them now; the gates must review a real
27
- diff, not a dirty tree.
28
- - `git fetch origin`; the release diff is `origin/main...HEAD` (now guaranteed
29
- to be the resolved branch). If it is empty, **stop** — nothing to release.
30
- - Print a one-line plan: branch · commit count · files changed.
31
-
32
- ## Phase 1 VERIFY (delegate; no hand-waving)
33
- **First, load the real checklists.** Locate and **read** the sibling command
34
- definitions so you apply their exact checks, not an approximation — glob your
35
- installed commands/skills for `ship.md`, `security.md`, `diff-review.md`, and
36
- `verify-done` (a skill or command). If one cannot be found, run that check from
37
- its name and **flag that its full checklist was unavailable** — never pretend
38
- it passed.
39
-
40
- Then run each gate and capture **fresh evidence** — the exact command, its exit
41
- code, and the result. Per `/verify-done`: a check you did **not** actually run
42
- is a **FAIL**, never an assumed pass.
43
- - **`/ship`** pre-deploy gate (tests, lint, build, secrets, authz, rate
44
- limit, data scope, migrations, docs-sync).
45
- - **`/security`** on the changed files.
46
- - **`/diff-review`** on `origin/main...HEAD`.
47
-
48
- Emit a coverage table, one row per gate: `ran? ✓/✗` · evidence · verdict. If
49
- any row is (could not run), the run is **Blocked 🛑** — do not continue.
7
+ Release **preparation** orchestrator for the **current branch**. It runs your
8
+ existing pre-deploy gate, sweeps the docs, bumps the version and commits —
9
+ then **stops and reports**. It never pushes, opens a PR, merges, tags, or
10
+ publishes: those are yours to authorize by name.
11
+
12
+ It does not re-implement checks, and it does not review code. Review is a
13
+ separate command that must have run first.
14
+
15
+ ## Guardrails
16
+ - **Spawn a worker on a mid-tier model, not hardcoded.** The run happens in a
17
+ subagent on your tool's balanced default tier — judgment-capable, cheaper and
18
+ faster than your top reasoning tier. **Not the cheapest/fastest tier**: on
19
+ judgment work it measurably degrades (misclassification rates several times
20
+ higher). Never hardcode a vendor-specific model name. Fall back to running
21
+ inline if your tool has no subagent mechanism.
22
+ - **Escalate, never assume.** Anything you cannot decide, cannot verify, or
23
+ that this spec does not cover **stop and report it to the orchestrator**
24
+ (the main session). Never improvise, never widen scope, never fix a finding
25
+ you noticed along the way.
26
+ - **Nothing leaves the machine.** No `git push`, no `gh`, no `npm publish`,
27
+ under any circumstance not even if every gate is green. You report the
28
+ sequence; a human authorizes it.
29
+
30
+ ## Phase 0 — Preflight (current branch, always)
31
+ - **Release the branch you are on.** No branch argument, no branch creation.
32
+ - **On `main` stop and ask** what should be released. `main` is only ever
33
+ the merge target; never release it, never commit to it.
34
+ - If the working tree still has uncommitted feature changes, commit them to
35
+ the branch now the gate must see a real diff, not a dirty tree.
36
+ - `git fetch origin`; the release diff is `origin/main...HEAD`. Empty
37
+ **stop**, nothing to release.
38
+ - Print a one-line plan: branch · commit count · files changed · HEAD SHA.
39
+
40
+ ## Phase 0.5 Review precondition (do not skip)
41
+ Ask the orchestrator: **has `/branch-review` or `/code-review` run on this
42
+ branch at the current HEAD SHA?**
43
+
44
+ - **No review** **stop**: "No review at `<sha>`. Run `/branch-review medium`
45
+ (or `/code-review medium`) first."
46
+ - **Stale** — the review ran at an earlier SHA, i.e. commits landed after it
47
+ (including fix commits) **stop** and ask for a re-review. This is what
48
+ makes "all findings fixed" checkable instead of promised.
49
+ - **Reviewed at this SHA with findings outstanding** → **stop**. Findings are
50
+ resolved before a release is cut.
51
+
52
+ This is the only thing guaranteeing the branch was reviewed *and* security
53
+ scanned, so treat a missing answer as a **stop**, never as a pass.
54
+
55
+ ## Phase 1 — Verify
56
+ **Load the real checklist**: locate and **read** the installed `ship.md` so
57
+ you apply its exact checks, not an approximation. If it cannot be found, run
58
+ what you can from its name and **flag that the full checklist was
59
+ unavailable** — never pretend it passed.
60
+
61
+ - **`/ship`** — mechanical pre-deploy gate (tests, lint, build, debug
62
+ leftovers, secrets grep, migrations, docs/config sync, tree state).
63
+
64
+ Capture **fresh evidence**: the exact command, its exit code, and the result.
65
+ A check you did not actually run is a **FAIL**, never an assumed pass. Emit a
66
+ coverage row: `ran? ✓/✗` · evidence · verdict. A ✗ is **Blocked 🛑**.
67
+
68
+ Security is **not** re-run here — it is stage 2 of the review, already
69
+ confirmed in Phase 0.5.
50
70
 
51
71
  ## 🚦 Gate
52
- - **Any Critical** (failing tests/build, a Critical security or diff-review
53
- finding) → **stop**, report, ask how to proceed. Touch no history.
72
+ - **Any Critical** (failing tests, broken build) **stop**, report, escalate.
54
73
  - **Warnings, or anything you cannot confidently decide** → **stop**,
55
- summarize, ask.
56
- - **All clean** → continue to Phase 2.
74
+ summarize, escalate. Do not weigh it yourself.
75
+ - **All clean** → continue.
76
+
77
+ ## Phase 2 — Docs sweep
78
+ Update what this feature actually changed, wherever those docs live in this
79
+ project — match each file's existing format, touch nothing unrelated. Use
80
+ `docs/index.md` when the project has one to find what exists.
57
81
 
58
- ## Phase 2 — DOCS (only what the feature changed)
59
- Update as needed, matching each file's existing format; touch nothing
60
- unrelated. If a doc needs no change, **say so** rather than editing for its
61
- own sake.
62
82
  - **CHANGELOG.md** — new entry.
63
- - **PRD** — the feature's PRD entry / status.
64
- - **context / guide** — the project's context or guide doc.
65
83
  - **README.md** — only if user-facing usage changed.
84
+ - **PRD** — the feature's entry / status.
85
+ - **Guide / context docs** — the project's standing context.
86
+ - **Findings / learnings** — where the project keeps them.
87
+ - **Any other frequently-updated doc** this change makes stale.
88
+
89
+ If a doc needs no change, **say so** rather than editing it for its own sake.
66
90
 
67
- ## Phase 3 — RELEASE (irreversible — confirm each step)
91
+ ## Phase 3 — Cut (local only)
68
92
  1. **Version bump** — pick the semver level from the change (patch / minor /
69
- major; ask if ambiguous) and update `package.json`.
70
- 2. **Commit** `release: vX.Y.Z<summary>`, including the docs + bump.
71
- 3. **Push** the branch.
72
- 4. **Open PR** — `gh pr create` into `main` (main is PR-protected: 1 approving
73
- review).
74
- 5. **Merge** — `gh pr merge --delete-branch`. If the review requirement blocks
75
- it, **stop** and ask — never force or silently bypass. On a **solo repo** you
76
- cannot approve your own PR, so the expected path is an owner-authorized
77
- admin-merge (`gh pr merge --admin`), run only on the user's explicit say-so.
78
- 6. **Tag** — after the merge, `git tag vX.Y.Z` on `main` and push it. Keep
79
- cut→tag tight one frozen step.
80
-
81
- ## Stop herepublish is your call
82
- Do **not** publish. `publish.yml` is manual `workflow_dispatch` **by design**.
83
- Print the handoff:
84
- > Merged, branch deleted, tagged **vX.Y.Z**. To publish, run it yourself:
85
- > `gh workflow run publish.yml`
86
- > Then confirm the version is actually live (`npm view <pkg> versions`) and
87
- > validate the **installed** artifact, not the working tree.
88
-
89
- Final report: **Delivered (vX.Y.Z publish pending)** or **Blocked 🛑**
90
- with the specific reason.
93
+ major; **ask if ambiguous**) and update `package.json`. The bump must land
94
+ on the branch, before any merge a version committed to `main` directly,
95
+ or added after the merge, breaks the tag/package match.
96
+ 2. **Commit** — `release: vX.Y.Z <summary>`, including the docs and the
97
+ bump.
98
+
99
+ Then **stop.** Nothing else.
100
+
101
+ ## Report the sequence, for a human to authorize
102
+ Print the evidence, then hand back the exact remaining steps so the
103
+ orchestrator can run them on the user's named go:
104
+
105
+ > **Cut vX.Y.Z on `<branch>`** `/ship` green, docs updated, release commit
106
+ > made locally. Reviewed at `<sha>`.
107
+ > Ready when you are:
108
+ > 1. `git push -u origin <branch>`
109
+ > 2. `gh pr create` into `main`
110
+ > 3. `gh pr merge --admin --squash --delete-branch` (main is PR-protected;
111
+ > owner-authorized admin merge on a solo repo)
112
+ > 4. `git tag vX.Y.Z` on `main` and push the tag
113
+ > 5. Publish **if this project has a publish path** (e.g.
114
+ > `gh workflow run publish.yml`) — manual by design
115
+ > 6. Verify it is actually live (`npm view <pkg> version`, and the published
116
+ > tarball's contents), not the working tree
117
+
118
+ Final line: **Cut ✅ (vX.Y.Z — ready to push)** or **Blocked 🛑** with the
119
+ specific reason.