@nklisch/pi-agile-workflow 0.15.3 → 0.16.3
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/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/CHANGELOG.md +8 -0
- package/docs/ARCHITECTURE.md +117 -65
- package/docs/PRINCIPLES.md +84 -18
- package/docs/SPEC.md +70 -2
- package/docs/VISION.md +33 -12
- package/hooks/scripts/prompt-context.py +7 -1
- package/hooks/scripts/test_prompt_context.py +16 -0
- package/package.json +1 -1
- package/scripts/tests/convert-content-integrity.test.sh +4 -4
- package/scripts/tests/convert-review-weight.test.sh +61 -0
- package/scripts/work-view.sh +1 -1
- package/skills/autopilot/SKILL.md +138 -91
- package/skills/convert/SKILL.md +55 -11
- package/skills/epic-design/SKILL.md +37 -70
- package/skills/feature-design/SKILL.md +52 -68
- package/skills/fix/SKILL.md +52 -34
- package/skills/gate-cruft/SKILL.md +69 -24
- package/skills/gate-docs/SKILL.md +12 -5
- package/skills/gate-patterns/SKILL.md +7 -3
- package/skills/gate-refactor/SKILL.md +18 -6
- package/skills/gate-security/SKILL.md +16 -7
- package/skills/gate-tests/SKILL.md +86 -71
- package/skills/implement/SKILL.md +79 -58
- package/skills/implement-orchestrator/SKILL.md +274 -587
- package/skills/perf-design/SKILL.md +11 -12
- package/skills/principles/SKILL.md +175 -379
- package/skills/principles/references/advisory-review.md +76 -0
- package/skills/principles/references/code-design.md +164 -0
- package/skills/principles/references/models.md +42 -63
- package/skills/prose-author/SKILL.md +9 -4
- package/skills/refactor-design/SKILL.md +26 -17
- package/skills/review/SKILL.md +169 -64
- package/skills/review/references/substrate-side-effects.md +17 -10
- package/skills/scope/SKILL.md +20 -7
- package/work-view/crates/cli/.work-view-version +1 -1
- package/work-view/dist/aarch64-apple-darwin/work-view +0 -0
- package/work-view/dist/aarch64-unknown-linux-musl/work-view +0 -0
- package/work-view/dist/x86_64-apple-darwin/work-view +0 -0
- package/work-view/dist/x86_64-unknown-linux-musl/work-view +0 -0
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: principles
|
|
3
3
|
description: >
|
|
4
|
-
agile-workflow principles — code-design (
|
|
5
|
-
|
|
4
|
+
agile-workflow principles — code-design (clear boundaries, proportional rigor, code economy,
|
|
5
|
+
useful tests, and continuous simplification) and substrate-execution (Item-IS-the-Work,
|
|
6
|
+
Rolling-Foundation, Late-Binding).
|
|
6
7
|
Auto-loads when designing modules, defining interfaces, writing or implementing code, scoping work
|
|
7
8
|
in the substrate, advancing stages, scoping releases, or any time the agile-workflow
|
|
8
9
|
design/implement/review skills are active.
|
|
@@ -23,209 +24,56 @@ Each principle has guidance for design time and implementation time.
|
|
|
23
24
|
|
|
24
25
|
# Part I — Code-Design Principles
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
**Ports** are interfaces defined in the domain layer that describe what the domain needs (a database, a file store, an HTTP client, a clock). **Adapters** are infrastructure implementations of those interfaces.
|
|
31
|
-
|
|
32
|
-
### At design time
|
|
33
|
-
|
|
34
|
-
- Identify every external dependency the feature touches (DB, filesystem, HTTP, queues, time, randomness)
|
|
35
|
-
- Define an interface (port) for each one in the domain layer
|
|
36
|
-
- Infrastructure modules implement those interfaces
|
|
37
|
-
- The domain function signature takes the port as a parameter or receives it via dependency injection — it never imports the adapter directly
|
|
38
|
-
|
|
39
|
-
**Example structure:**
|
|
40
|
-
```
|
|
41
|
-
src/
|
|
42
|
-
domain/
|
|
43
|
-
user.ts # core logic — imports only domain types and ports
|
|
44
|
-
ports.ts # UserRepository interface, EmailSender interface
|
|
45
|
-
infrastructure/
|
|
46
|
-
db/user-repo.ts # implements UserRepository using Drizzle
|
|
47
|
-
email/smtp.ts # implements EmailSender using nodemailer
|
|
48
|
-
app/
|
|
49
|
-
wire.ts # assembles: new UserService(new DbUserRepo(), new SmtpEmailSender())
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
**Design checklist:**
|
|
53
|
-
- [ ] Every external dependency has an interface in the domain layer
|
|
54
|
-
- [ ] No `import { db }` or `import { fs }` in domain modules
|
|
55
|
-
- [ ] Infrastructure modules are only referenced in composition roots (wire-up / entry points)
|
|
56
|
-
|
|
57
|
-
### At implementation time
|
|
58
|
-
|
|
59
|
-
When implementing domain logic, enforce the boundary: domain code receives infrastructure as a typed parameter, never imports it directly.
|
|
60
|
-
|
|
61
|
-
**Good:**
|
|
62
|
-
```typescript
|
|
63
|
-
// domain/user-service.ts
|
|
64
|
-
export function createUser(repo: UserRepository, email: string): Promise<User> {
|
|
65
|
-
return repo.insert({ email })
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// app/wire.ts (entry point)
|
|
69
|
-
import { createUser } from '../domain/user-service'
|
|
70
|
-
import { DrizzleUserRepo } from '../infrastructure/db/user-repo'
|
|
71
|
-
const repo = new DrizzleUserRepo(db)
|
|
72
|
-
app.post('/users', (c) => createUser(repo, c.req.body.email))
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
**Bad:**
|
|
76
|
-
```typescript
|
|
77
|
-
// domain/user-service.ts
|
|
78
|
-
import { db } from '../infrastructure/db' // NEVER — domain imports infra
|
|
79
|
-
|
|
80
|
-
export function createUser(email: string) {
|
|
81
|
-
return db.insert(users).values({ email })
|
|
82
|
-
}
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
If you find yourself needing to import infrastructure into domain, that's the signal to add a port interface instead.
|
|
86
|
-
|
|
87
|
-
---
|
|
88
|
-
|
|
89
|
-
## 2. Single Source of Truth (Data-Driven Extensibility)
|
|
90
|
-
|
|
91
|
-
When a concept can have multiple variants that may grow over time (roles, statuses, event types, providers, feature flags), define that set of variants **once** as a data structure. All logic — types, validation, routing, display — derives from that single definition.
|
|
92
|
-
|
|
93
|
-
### At design time
|
|
27
|
+
These principles stay active during design and implementation. Load
|
|
28
|
+
[references/code-design.md](references/code-design.md) when concrete mechanics,
|
|
29
|
+
checklists, or examples are needed.
|
|
94
30
|
|
|
95
|
-
|
|
96
|
-
- Design a central registry: a typed constant, a config map, or a schema object
|
|
97
|
-
- Derive all downstream types and logic from that registry rather than re-enumerating variants in each consumer
|
|
98
|
-
|
|
99
|
-
**Example structure:**
|
|
100
|
-
```typescript
|
|
101
|
-
// Defined once
|
|
102
|
-
const ROLES = ['admin', 'editor', 'viewer'] as const
|
|
103
|
-
type Role = typeof ROLES[number]
|
|
104
|
-
|
|
105
|
-
// Or richer: a config map where behavior flows from data
|
|
106
|
-
const ROLE_CONFIG = {
|
|
107
|
-
admin: { level: 2, label: 'Admin' },
|
|
108
|
-
editor: { level: 1, label: 'Editor' },
|
|
109
|
-
viewer: { level: 0, label: 'Viewer' },
|
|
110
|
-
} satisfies Record<string, RoleConfig>
|
|
111
|
-
type Role = keyof typeof ROLE_CONFIG
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
**Design checklist:**
|
|
115
|
-
- [ ] Extensible sets of variants are defined as a single authoritative constant/schema
|
|
116
|
-
- [ ] Downstream types are derived from the registry (not duplicated)
|
|
117
|
-
- [ ] Adding a new variant requires changing only the registry definition
|
|
31
|
+
## 1. Ports & Adapters
|
|
118
32
|
|
|
119
|
-
|
|
33
|
+
Domain logic stays independent of databases, filesystems, HTTP, time,
|
|
34
|
+
randomness, and other infrastructure. The domain defines the ports it needs;
|
|
35
|
+
adapters implement them, and composition roots wire the two together.
|
|
120
36
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
**Good:**
|
|
124
|
-
```typescript
|
|
125
|
-
const ROLE_CONFIG = {
|
|
126
|
-
admin: { level: 2, canDelete: true },
|
|
127
|
-
editor: { level: 1, canDelete: false },
|
|
128
|
-
viewer: { level: 0, canDelete: false },
|
|
129
|
-
} as const satisfies Record<string, RoleConfig>
|
|
130
|
-
|
|
131
|
-
type Role = keyof typeof ROLE_CONFIG
|
|
132
|
-
const ROLES = Object.keys(ROLE_CONFIG) as Role[]
|
|
133
|
-
const RoleSchema = z.enum(ROLES as [Role, ...Role[]])
|
|
134
|
-
|
|
135
|
-
// Adding 'owner' role = one change, in one place
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
**Bad:**
|
|
139
|
-
```typescript
|
|
140
|
-
type Role = 'admin' | 'editor' | 'viewer' // defined here
|
|
141
|
-
const roles = ['admin', 'editor', 'viewer'] // re-enumerated here
|
|
142
|
-
const RoleSchema = z.enum(['admin', 'editor', 'viewer']) // again here
|
|
143
|
-
switch (role) {
|
|
144
|
-
case 'admin': ... // and again here
|
|
145
|
-
case 'editor': ...
|
|
146
|
-
case 'viewer': ...
|
|
147
|
-
}
|
|
148
|
-
```
|
|
37
|
+
## 2. Single Source of Truth
|
|
149
38
|
|
|
150
|
-
|
|
39
|
+
Growing variant sets have one authoritative typed registry. Types, validation,
|
|
40
|
+
routing, and display derive from it rather than re-enumerating the variants.
|
|
151
41
|
|
|
152
42
|
## 3. Generated Contracts
|
|
153
43
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
**Common approaches by boundary type:**
|
|
159
|
-
- **HTTP API → client**: OpenAPI schema → generated client types (openapi-typescript, orval)
|
|
160
|
-
- **tRPC router → client**: router type is the contract, shared directly
|
|
161
|
-
- **Database schema → app types**: Drizzle/Prisma inferred types, not hand-written interfaces
|
|
162
|
-
- **GraphQL schema → types**: codegen from SDL
|
|
44
|
+
Boundary types derive from the schema, router, database model, or a generation
|
|
45
|
+
step. Consumers import or infer that contract instead of maintaining hand-written
|
|
46
|
+
copies.
|
|
163
47
|
|
|
164
|
-
|
|
165
|
-
- For each one, choose a single source of truth (schema file, router definition, DB schema)
|
|
166
|
-
- Design the generation step into the build pipeline — not a manual step
|
|
167
|
-
- Consumers import generated types, not hand-written duplicates
|
|
48
|
+
## 4. Fail Fast—Where It Matters
|
|
168
49
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
50
|
+
Validate untrusted input and required external contracts at system boundaries.
|
|
51
|
+
Add internal checks only when the project's actual risks justify them. Do not
|
|
52
|
+
manufacture exhaustive invariants, edge handling, determinism, or defensive
|
|
53
|
+
layers that the product's scope and consequences do not need.
|
|
173
54
|
|
|
174
|
-
|
|
55
|
+
## 5. Code Economy
|
|
175
56
|
|
|
176
|
-
|
|
57
|
+
Short, direct code is a virtue when it stays clear. Prefer fewer concepts,
|
|
58
|
+
layers, branches, options, and lines over speculative generality. Match rigor to
|
|
59
|
+
the project's context rather than engineering every codebase as critical
|
|
60
|
+
infrastructure.
|
|
177
61
|
|
|
178
|
-
|
|
179
|
-
```typescript
|
|
180
|
-
import type { AppRouter } from '../../server/router'
|
|
181
|
-
// type-safe from the source
|
|
62
|
+
## 6. Tests Earn Their Keep
|
|
182
63
|
|
|
183
|
-
|
|
184
|
-
|
|
64
|
+
Test stable interfaces, important behavior, and regressions learned from real
|
|
65
|
+
bugs. Unit-test genuinely complex units, not every wrapper, branch, or line.
|
|
66
|
+
Tests are maintained code: remove duplicate, tautological, implementation-bound,
|
|
67
|
+
or otherwise low-value tests when their upkeep exceeds the confidence they add.
|
|
185
68
|
|
|
186
|
-
|
|
187
|
-
```typescript
|
|
188
|
-
// Hand-written duplicate of what Drizzle already knows
|
|
189
|
-
interface User {
|
|
190
|
-
id: number
|
|
191
|
-
email: string
|
|
192
|
-
createdAt: Date
|
|
193
|
-
}
|
|
194
|
-
```
|
|
69
|
+
## 7. Leave It Simpler
|
|
195
70
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
Catch bad data at the door, not three calls deep where the stack trace is useless. Validate inputs at the entry point of every function or system boundary.
|
|
203
|
-
|
|
204
|
-
- At system boundaries (HTTP handlers, CLI args, external API responses, config files): parse with Zod or equivalent before any logic runs
|
|
205
|
-
- At internal function boundaries: assert preconditions at the top of the function — guard clauses, not nested ifs
|
|
206
|
-
- Prefer `throw`/`return early` over propagating bad state deep into call chains
|
|
207
|
-
- Errors should be loud and specific at the point of violation — "expected positive number, got -3" beats a cryptic null reference five layers down
|
|
208
|
-
|
|
209
|
-
**Good:**
|
|
210
|
-
```typescript
|
|
211
|
-
function processOrder(input: unknown) {
|
|
212
|
-
const order = OrderSchema.parse(input) // throws immediately if invalid
|
|
213
|
-
return computeTotal(order)
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
function applyDiscount(order: Order, pct: number) {
|
|
217
|
-
if (pct < 0 || pct > 1) throw new Error(`Invalid discount: ${pct}`)
|
|
218
|
-
// ... rest of logic
|
|
219
|
-
}
|
|
220
|
-
```
|
|
221
|
-
|
|
222
|
-
**Bad:**
|
|
223
|
-
```typescript
|
|
224
|
-
function processOrder(input: any) {
|
|
225
|
-
// passes raw input through, blows up 5 calls deep
|
|
226
|
-
return computeTotal(input)
|
|
227
|
-
}
|
|
228
|
-
```
|
|
71
|
+
Exploration, design, and implementation include an elimination pass. In the
|
|
72
|
+
area being touched, look for code, tests, checks, abstractions, compatibility
|
|
73
|
+
paths, and complexity that the feature can make unnecessary. Fold safe,
|
|
74
|
+
cohesive cleanup into the work or create explicit cleanup/refactor stories;
|
|
75
|
+
park broader opportunities. Question whole systems when warranted, but ask the
|
|
76
|
+
user before removing behavior, guarantees, validation, compatibility, or safety.
|
|
229
77
|
|
|
230
78
|
---
|
|
231
79
|
|
|
@@ -237,7 +85,7 @@ dispatch. The agent applies these whenever operating on `.work/` or `docs/`,
|
|
|
237
85
|
and whenever choosing discovery or implementation dispatch during substrate
|
|
238
86
|
work.
|
|
239
87
|
|
|
240
|
-
##
|
|
88
|
+
## 8. Item-IS-the-Work
|
|
241
89
|
|
|
242
90
|
The unit of work is its file. The brief, the design, the implementation notes, and the review findings all accumulate in the item's body as stages advance. Reading the file IS reading the state of the work.
|
|
243
91
|
|
|
@@ -277,7 +125,7 @@ The unit of work is its file. The brief, the design, the implementation notes, a
|
|
|
277
125
|
|
|
278
126
|
---
|
|
279
127
|
|
|
280
|
-
##
|
|
128
|
+
## 9. Rolling-Foundation
|
|
281
129
|
|
|
282
130
|
Foundation docs (`docs/VISION.md`, `docs/SPEC.md`, `docs/ARCHITECTURE.md`, and any others) describe the project's vision (future-looking) and current intent — what is true now, OR what will be true once in-flight design lands. They roll forward in place as either evolves. No legacy comments. Git carries history; the doc carries truth.
|
|
283
131
|
|
|
@@ -329,7 +177,7 @@ The discipline is identical in both styles: replace stale assertions in place, n
|
|
|
329
177
|
|
|
330
178
|
---
|
|
331
179
|
|
|
332
|
-
##
|
|
180
|
+
## 10. Late-Binding
|
|
333
181
|
|
|
334
182
|
Items advance stages when work actually completes. Releases bind items only when the user cuts a version. Foundation docs are not pre-decided into a phase plan. Work happens, then commitments crystallize — not the other way around.
|
|
335
183
|
|
|
@@ -369,7 +217,7 @@ Items advance stages when work actually completes. Releases bind items only when
|
|
|
369
217
|
|
|
370
218
|
---
|
|
371
219
|
|
|
372
|
-
##
|
|
220
|
+
## 11. Agent Dispatch Economy
|
|
373
221
|
|
|
374
222
|
Sub-agents are for breadth, isolation, independent judgment, or parallel
|
|
375
223
|
implementation with clear write ownership. They are not a replacement for
|
|
@@ -420,43 +268,37 @@ auditable later.
|
|
|
420
268
|
|
|
421
269
|
---
|
|
422
270
|
|
|
423
|
-
# Part III — Caller Awareness
|
|
271
|
+
# Part III — Caller Awareness and Question Policy
|
|
424
272
|
|
|
425
|
-
**The rule
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
273
|
+
**The normal rule is consequence-based, not mode-based.** Resolve routine,
|
|
274
|
+
reversible decisions with judgment and record the rationale in the item body.
|
|
275
|
+
Use the structured question tool only when the answer sets product direction,
|
|
276
|
+
materially changes user-facing behavior or an external contract, or commits the
|
|
277
|
+
project to an expensive choice that is difficult to reverse. Existing `## Design decisions` and foundation
|
|
278
|
+
docs are inputs; do not re-ask what they already settle.
|
|
429
279
|
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
280
|
+
Interactive mode permits those strategic questions. An active autopilot driver
|
|
281
|
+
never asks them: use available evidence and choose the least irreversible sound
|
|
282
|
+
option, logging the decision. Ordinary ambiguity must not halt the queue.
|
|
283
|
+
|
|
284
|
+
Autopilot mode is binary and detectable. It is on when this skill was delegated
|
|
285
|
+
by an explicit autopilot invocation, an active autopilot harness goal, or a
|
|
286
|
+
prompt clearly continuing/draining that scope. An autopilot caller note is the
|
|
287
|
+
strongest signal. If no active driver exists, the invocation is interactive.
|
|
435
288
|
|
|
436
289
|
## What does NOT count as autopilot
|
|
437
290
|
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
- **
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
completes, blocks, or is interrupted, subsequent direct skill invocations are
|
|
450
|
-
interactive again.
|
|
451
|
-
|
|
452
|
-
When a user types `/agile-workflow:feature-design <id>` (or any other
|
|
453
|
-
design/implement/review skill) directly, they want a collaborator at the
|
|
454
|
-
checkpoints. Use `structured question tool` unless the direct prompt also makes clear it
|
|
455
|
-
is part of an active autopilot goal.
|
|
456
|
-
|
|
457
|
-
The disambiguation test: *"Is an active autopilot queue goal currently driving
|
|
458
|
-
this skill?"* If you cannot point to that active driver or caller note, you are
|
|
459
|
-
interactive.
|
|
291
|
+
- **General harness "auto mode"** — a reminder to work autonomously changes
|
|
292
|
+
conversational posture, but does not create an autopilot queue goal.
|
|
293
|
+
- **An earlier "just decide" instruction** — it applies to that decision, not a
|
|
294
|
+
later explicit skill invocation.
|
|
295
|
+
- **A completed, blocked, or interrupted autopilot run** — later direct skill
|
|
296
|
+
invocations are interactive again.
|
|
297
|
+
|
|
298
|
+
A direct `/agile-workflow:feature-design <id>` (or other design, implement, or
|
|
299
|
+
review skill) is interactive unless its prompt clearly belongs to an active
|
|
300
|
+
autopilot driver. The disambiguation test is: *"Can I point to the active
|
|
301
|
+
autopilot goal or caller note driving this invocation?"*
|
|
460
302
|
|
|
461
303
|
## What still warrants a hard halt (autopilot or not)
|
|
462
304
|
|
|
@@ -465,171 +307,120 @@ interactive.
|
|
|
465
307
|
- `depends_on` cycle detected when writing items
|
|
466
308
|
- Genuinely contradictory state the skill cannot recover from
|
|
467
309
|
|
|
468
|
-
Everything else
|
|
469
|
-
|
|
470
|
-
can review later.
|
|
310
|
+
Everything else resolves through evidence and judgment under autopilot. Prefer
|
|
311
|
+
the simpler, more reversible option and log why.
|
|
471
312
|
|
|
472
313
|
## Worked examples (autopilot mode)
|
|
473
314
|
|
|
474
315
|
| Situation | Judgment-mode action |
|
|
475
316
|
|---|---|
|
|
476
|
-
| Two architectural options both look valid | Pick the one with fewer moving parts; log
|
|
477
|
-
| Brief is vague, several plausible interpretations | Pick the one most consistent with foundation docs; log under `## Design decisions
|
|
478
|
-
| Multiple candidate items at a stage and no id was passed | Pick most recent by `updated:`; the next iteration picks the next |
|
|
479
|
-
| Wrong-tag invocation routed to you by mistake | Log a misroute note
|
|
480
|
-
| Empty diff during review after trying ranges | Advance to `done` with a "No diff found" note
|
|
481
|
-
| Item at unexpected stage |
|
|
317
|
+
| Two architectural options both look valid | Pick the one with fewer moving parts; log the rationale. |
|
|
318
|
+
| Brief is vague, several plausible interpretations | Pick the one most consistent with foundation docs; log under `## Design decisions`. |
|
|
319
|
+
| Multiple candidate items at a stage and no id was passed | Pick most recent by `updated:`; the next iteration picks the next. |
|
|
320
|
+
| Wrong-tag invocation routed to you by mistake | Log a misroute note; return without advancing. |
|
|
321
|
+
| Empty diff during review after trying ranges | Advance to `done` with a "No diff found" note. |
|
|
322
|
+
| Item at unexpected stage | Choose the recoverable transition and log it. |
|
|
482
323
|
|
|
483
|
-
##
|
|
324
|
+
## Explicit alignment mode
|
|
484
325
|
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
326
|
+
`--only-questions` is unchanged: it is an explicit, interactive-only alignment
|
|
327
|
+
pass that captures answers under `## Design decisions`, does not design, and
|
|
328
|
+
does not advance stage. Refuse it when autopilot is the active driver. Inside
|
|
329
|
+
that mode, surface the target's meaningful strategic ambiguities even when a
|
|
330
|
+
normal design pass would resolve a reversible point autonomously.
|
|
490
331
|
|
|
491
332
|
## Skills this applies to
|
|
492
333
|
|
|
493
|
-
|
|
494
|
-
`perf-design`, `implement`, `implement-orchestrator`, `review
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
decision points.
|
|
499
|
-
|
|
500
|
-
User-invocable-only skills (`convert`, `epicize`, `ideate`, `bold-refactor`,
|
|
501
|
-
`release-deploy`) can stay interactive-first — autopilot doesn't call them.
|
|
334
|
+
This policy governs `feature-design`, `epic-design`, `refactor-design`,
|
|
335
|
+
`perf-design`, `implement`, `implement-orchestrator`, and `review`, plus the
|
|
336
|
+
cross-plugin research orchestrator when routed from autopilot. Interactive-only
|
|
337
|
+
skills may remain workshop-oriented, but should still avoid questions whose
|
|
338
|
+
answers are routine and reversible.
|
|
502
339
|
|
|
503
340
|
---
|
|
504
341
|
|
|
505
|
-
# Part IV —
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
[references/
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
`
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
Never reverse the phases and never skip Phase 1 to jump straight to attack. For
|
|
589
|
-
autopilot-driven design work, the default peer ask is **augmentation before
|
|
590
|
-
decisions are locked**, not validation after the host has already decided.
|
|
591
|
-
|
|
592
|
-
Design-time advisory peer failures are non-blocking under autopilot. If the
|
|
593
|
-
peer wrapper is missing, the executable cannot be resolved, the invocation
|
|
594
|
-
fails, or the call would use the same model class, continue with host judgment
|
|
595
|
-
and log the reason briefly. A top-tier reasoning peer still running after only
|
|
596
|
-
a few minutes is not a failure. Do not halt the queue for an advisory review
|
|
597
|
-
failure.
|
|
598
|
-
|
|
599
|
-
The final autopilot completion review is stricter: it must succeed through a
|
|
600
|
-
different-model `peer-review` loop, a generic sub-agent prompted as a
|
|
601
|
-
fresh-context reviewer (cross-model when the caller selects a different model
|
|
602
|
-
class, otherwise same-harness), or another supported fresh-context fallback
|
|
603
|
-
before the run reports `complete`. For deep/complex scope that means clearing
|
|
604
|
-
through at least one cross-class pass per phase in §6 where two classes are
|
|
605
|
-
available; if the selected final-review path fails, the run is blocked on final
|
|
606
|
-
review rather than complete.
|
|
607
|
-
|
|
608
|
-
When invoked, summarize the result in the item body without dumping transcripts:
|
|
609
|
-
|
|
610
|
-
```markdown
|
|
611
|
-
## Other agent review
|
|
612
|
-
- Invoked because: <large/risky/deep-complex/autopilot/no prior alignment>
|
|
613
|
-
- Scope: <single peer | two-class — list classes>
|
|
614
|
-
- Reviewer (Phase 1 — advisory/completeness): <class, if known>
|
|
615
|
-
- Gaps / missing requirements / alternatives considered:
|
|
616
|
-
- <summary>
|
|
617
|
-
- Reviewer (Phase 2 — adversarial): <class, if known; different from Phase 1>
|
|
618
|
-
- Broken assumptions / failure modes / rejected points:
|
|
619
|
-
- <summary>
|
|
620
|
-
- Accepted:
|
|
621
|
-
- <decision or adjustment> (phase N)
|
|
622
|
-
- Rejected:
|
|
623
|
-
- <point> — <reason> (phase N)
|
|
624
|
-
```
|
|
625
|
-
|
|
626
|
-
If only one peer class was available (or only one phase was warranted by scope),
|
|
627
|
-
fill only the phase that ran and note the other was skipped and why.
|
|
628
|
-
|
|
629
|
-
Limit autopilot to one advisory pass per item per design stage. Do not run a
|
|
630
|
-
multi-pass `peer-review` loop inside routine autopilot design unless the user or
|
|
631
|
-
project instructions explicitly require it. The final completion review at the
|
|
632
|
-
end of autopilot is separate from these design-time advisory passes.
|
|
342
|
+
# Part IV — Risk-Driven Advisory Review
|
|
343
|
+
|
|
344
|
+
Advisory review is selected by risk in both direct and autopilot design modes;
|
|
345
|
+
it is not a stage transition and is never triggered merely because autopilot is
|
|
346
|
+
active. Small, low-risk work skips it. Uncertain or risky work gains independent
|
|
347
|
+
scrutiny, while deep or complex work may use multiple model classes. Load
|
|
348
|
+
[references/advisory-review.md](references/advisory-review.md) for scope defaults,
|
|
349
|
+
two-phase mechanics, and the item-body record format. Model classes, host-peer
|
|
350
|
+
pairing, and concrete mechanism flags remain in
|
|
351
|
+
[references/models.md](references/models.md).
|
|
352
|
+
|
|
353
|
+
## `review_weight`
|
|
354
|
+
|
|
355
|
+
`review_weight` is the canonical caller/project control consumed by review and
|
|
356
|
+
autopilot. Allowed values are `none | light | standard | thorough | maximum`;
|
|
357
|
+
the default is `standard`. It expresses the intended breadth and depth of
|
|
358
|
+
**independent** review, while the agent derives the exact topology from artifact
|
|
359
|
+
risk, item tier, scope, and available model classes:
|
|
360
|
+
|
|
361
|
+
- `none` — explicitly opt out of independent review. Implementation
|
|
362
|
+
verification and acceptance evidence remain mandatory.
|
|
363
|
+
- `light` — minimize ceremony while preserving focused scrutiny where risk
|
|
364
|
+
clearly warrants it.
|
|
365
|
+
- `standard` — balanced, risk-driven independent review.
|
|
366
|
+
- `thorough` — increase fresh-context breadth and depth for meaningful risk.
|
|
367
|
+
- `maximum` — permit multi-model, multi-pass complementary-then-adversarial
|
|
368
|
+
review for features and epics, with stories escalating dynamically by risk.
|
|
369
|
+
|
|
370
|
+
The levels are intent and ceilings, not fixed reviewer or pass counts. Explicit
|
|
371
|
+
caller and project policy takes precedence; record the effective weight and any
|
|
372
|
+
degradation. Configuration schema and foundation-doc wiring are follow-up work
|
|
373
|
+
for their owning stories.
|
|
374
|
+
|
|
375
|
+
## Load-bearing invariants
|
|
376
|
+
|
|
377
|
+
- **Different-class labeling:** call a pass cross-model only when the reviewer is
|
|
378
|
+
known to be a different model class from the host. Otherwise label it
|
|
379
|
+
fresh-context. Different-class review is valuable for independent blind spots,
|
|
380
|
+
not greater authority.
|
|
381
|
+
- **Fresh-context semantics:** when independent review is warranted and a
|
|
382
|
+
different class is unavailable, use the strongest suitable fresh-context
|
|
383
|
+
reviewer available. Do not present inline self-review as independent.
|
|
384
|
+
- **Two-phase order:** completeness / complementary / advisory comes before
|
|
385
|
+
adversarial attack. Never reverse the order or skip directly to attack.
|
|
386
|
+
- **Non-blocking design:** unavailable or failed design-time advisory review does
|
|
387
|
+
not block direct or autopilot design. Continue with judgment and record the
|
|
388
|
+
reason. A slow top-tier reviewer is not a failure until its appropriately
|
|
389
|
+
sized timeout or mechanism reports failure.
|
|
390
|
+
- **Strict completion:** final autopilot completion must clear a successful
|
|
391
|
+
review path and adjudicate every proposed finding. At weights `light` through
|
|
392
|
+
`maximum`, that path must use a supported fresh-context reviewer; if it fails,
|
|
393
|
+
the run is blocked rather than complete. At explicit weight `none`, documented
|
|
394
|
+
implementation verification and acceptance evidence satisfy the path without
|
|
395
|
+
independent review.
|
|
396
|
+
|
|
397
|
+
## Recipient-owned finding disposition
|
|
398
|
+
|
|
399
|
+
Reviewer output is evidence, not authority. The receiving agent orchestrating the
|
|
400
|
+
run independently verifies each claim and assigns its disposition against the
|
|
401
|
+
repository's actual context: acceptance criteria, supported users and deployment
|
|
402
|
+
shape, likelihood, blast radius, recoverability, existing safeguards, and the
|
|
403
|
+
cost of delaying the current work. A reviewer's `blocker` label never binds the
|
|
404
|
+
receiver by itself, and disagreement is resolved by evidence rather than
|
|
405
|
+
seniority or model strength.
|
|
406
|
+
|
|
407
|
+
A finding blocks the current cycle only when the receiver judges it a credible,
|
|
408
|
+
material risk to required correctness, security, data integrity, public
|
|
409
|
+
contracts, acceptance criteria, release safety, or trustworthy verification.
|
|
410
|
+
Fix those findings now or keep an active item that prevents completion. Park a
|
|
411
|
+
valid concern below that bar in the unbound backlog with its risk rationale and
|
|
412
|
+
continue; leave nits in review notes, and reject unsupported findings with a
|
|
413
|
+
brief reason. Rarity alone does not make a case irrelevant, but a corner case's
|
|
414
|
+
likelihood and consequence must justify its delivery cost. Repetition across
|
|
415
|
+
review passes does not elevate severity by itself.
|
|
416
|
+
|
|
417
|
+
A successful review path therefore means independent scrutiny ran when required
|
|
418
|
+
and the receiving agent adjudicated the results. It does not mean every reviewer
|
|
419
|
+
suggestion was implemented or promoted into the active queue.
|
|
420
|
+
|
|
421
|
+
User instructions and project-level review/egress rules override defaults. Do
|
|
422
|
+
not invoke an external peer mechanism when policy prohibits it. `--only-questions`
|
|
423
|
+
is user alignment and therefore skips advisory review.
|
|
633
424
|
|
|
634
425
|
---
|
|
635
426
|
|
|
@@ -656,12 +447,17 @@ family (`gate-cruft`, `gate-security`, `gate-tests`, `gate-docs`,
|
|
|
656
447
|
|
|
657
448
|
| Arg | Behavior |
|
|
658
449
|
|---|---|
|
|
659
|
-
| no arg / `--all` | Sweep the relevant scope
|
|
450
|
+
| no arg / `--all` | Sweep the relevant scope; release-bound items are a gate's focus, not a hard scan boundary |
|
|
660
451
|
| `<path>` | Scope to that subtree |
|
|
661
452
|
| `<NL scope>` | Interpret free text against the codebase; log the interpretation |
|
|
662
453
|
| `<feature-id>` (where applicable) | Per-feature design mode (refactor-design, perf-design) |
|
|
663
454
|
|
|
664
455
|
These skills *emit substrate items as findings* rather than gating pass/fail.
|
|
456
|
+
For release gates, follow relevant evidence into adjacent dependencies, shared
|
|
457
|
+
infrastructure, or system-wide mechanisms. Bind findings to the release only
|
|
458
|
+
when they are caused by, exposed by, or materially relevant to it; route merely
|
|
459
|
+
ambient discoveries to unbound backlog proposals so a gate does not silently
|
|
460
|
+
expand release scope.
|
|
665
461
|
|
|
666
462
|
## Per-item design verbs
|
|
667
463
|
|