arreio 1.0.0-dev.1
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/README.md +81 -0
- package/package.json +42 -0
- package/scripts/postinstall.js +50 -0
- package/skills/arreio-init/SKILL.md +214 -0
- package/skills/arreio-init/references/architecture-template.md +85 -0
- package/skills/arreio-init/references/learn-index-template.md +15 -0
- package/skills/arreio-init/references/plan-index-template.md +29 -0
- package/skills/arreio-init/references/tasks-index-template.md +15 -0
- package/skills/learn/SKILL.md +151 -0
- package/skills/learn/modules/capture.md +108 -0
- package/skills/learn/modules/index.md +94 -0
- package/skills/learn/modules/maintain.md +116 -0
- package/skills/learn/modules/refine.md +104 -0
- package/skills/learn/references/dedup-rules.md +129 -0
- package/skills/learn/references/entry-schema.md +152 -0
- package/skills/learn/references/error-handling.md +178 -0
- package/skills/learn/references/id-generation.md +114 -0
- package/skills/learn/references/index-format.md +140 -0
- package/skills/learn/references/interaction-mode-propagation.md +89 -0
- package/skills/learn/references/migration-bootstrap.md +142 -0
- package/skills/learn/references/templates/artifacts/captured-entry.md +172 -0
- package/skills/learn/references/templates/artifacts/index-update.md +135 -0
- package/skills/learn/references/templates/artifacts/learn-input.md +100 -0
- package/skills/learn/references/templates/artifacts/maintain-log.md +142 -0
- package/skills/learn/references/templates/artifacts/refined-entry.md +168 -0
- package/skills/plan/SKILL.md +129 -0
- package/skills/plan/modules/design.md +140 -0
- package/skills/plan/modules/generate.md +156 -0
- package/skills/plan/modules/research.md +122 -0
- package/skills/plan/modules/scope.md +121 -0
- package/skills/plan/modules/tasks.md +190 -0
- package/skills/plan/references/design-complexity-assessment.md +118 -0
- package/skills/plan/references/error-handling.md +155 -0
- package/skills/plan/references/external-research-guidance.md +61 -0
- package/skills/plan/references/high-risk-detection.md +111 -0
- package/skills/plan/references/id-generation.md +55 -0
- package/skills/plan/references/interaction-mode-propagation.md +75 -0
- package/skills/plan/references/learnings-gate-logic.md +93 -0
- package/skills/plan/references/plan-tier-selection.md +174 -0
- package/skills/plan/references/task-slicing-rules.md +220 -0
- package/skills/plan/references/templates/artifacts/design.md +134 -0
- package/skills/plan/references/templates/artifacts/final-plan.md +265 -0
- package/skills/plan/references/templates/artifacts/research-findings.md +50 -0
- package/skills/plan/references/templates/artifacts/scoped-context.md +53 -0
- package/skills/plan/references/templates/artifacts/task.md +192 -0
- package/skills/plan/references/templates/artifacts/user-input.md +112 -0
- package/skills/review/SKILL.md +163 -0
- package/skills/review/modules/analyze.md +104 -0
- package/skills/review/modules/prepare.md +103 -0
- package/skills/review/modules/report.md +109 -0
- package/skills/review/modules/scope.md +126 -0
- package/skills/review/references/approval-criteria.md +101 -0
- package/skills/review/references/change-set-resolution.md +126 -0
- package/skills/review/references/error-handling.md +172 -0
- package/skills/review/references/id-generation.md +80 -0
- package/skills/review/references/interaction-mode-propagation.md +80 -0
- package/skills/review/references/review-categories.md +124 -0
- package/skills/review/references/scope-creep-detection.md +120 -0
- package/skills/review/references/severity-rubric.md +107 -0
- package/skills/review/references/templates/artifacts/findings.md +161 -0
- package/skills/review/references/templates/artifacts/review-input.md +116 -0
- package/skills/review/references/templates/artifacts/review-kit.md +135 -0
- package/skills/review/references/templates/artifacts/review-report.md +175 -0
- package/skills/review/references/templates/artifacts/review-scope.md +146 -0
- package/skills/work/SKILL.md +163 -0
- package/skills/work/modules/execute.md +109 -0
- package/skills/work/modules/prepare.md +140 -0
- package/skills/work/modules/review.md +164 -0
- package/skills/work/modules/triage.md +181 -0
- package/skills/work/references/ad-hoc-input-resolution.md +122 -0
- package/skills/work/references/error-handling.md +183 -0
- package/skills/work/references/execution-mode-selection.md +95 -0
- package/skills/work/references/id-generation.md +85 -0
- package/skills/work/references/interaction-mode-propagation.md +80 -0
- package/skills/work/references/review-checklist.md +94 -0
- package/skills/work/references/task-execution-rules.md +116 -0
- package/skills/work/references/templates/artifacts/execution-log.md +123 -0
- package/skills/work/references/templates/artifacts/execution-plan.md +111 -0
- package/skills/work/references/templates/artifacts/work-input.md +78 -0
- package/skills/work/references/templates/artifacts/work-manifest.md +119 -0
- package/skills/work/references/templates/artifacts/work-report.md +143 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Scoped Context Artifact
|
|
3
|
+
description: Template for the Scoped Context Artifact produced by the Scope phase. Captures problem frame, intended behavior, success criteria, and relevant learnings or requirements.
|
|
4
|
+
type: template
|
|
5
|
+
version: 1.1
|
|
6
|
+
timestamp: "2026-08-07"
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Scoped Context Artifact
|
|
10
|
+
|
|
11
|
+
The product of the **Scope** phase is a structured context object that downstream modules (research, design, generate) consume. It captures the problem frame, intended behavior, success criteria, and any relevant learnings or requirements.
|
|
12
|
+
|
|
13
|
+
When the **Scope** phase completes, the orchestrator produces a scoped context block (as markdown) with this schema:
|
|
14
|
+
|
|
15
|
+
```yaml
|
|
16
|
+
title: [plan title]
|
|
17
|
+
type: scope
|
|
18
|
+
scope-id: YYYY-MM-DD-NNN-scope
|
|
19
|
+
domain: software | non-software
|
|
20
|
+
status: complete
|
|
21
|
+
interactionMode: detailed | smart | autopilot
|
|
22
|
+
timestamp: ISO-8601 timestamp (e.g., 2026-07-04T14:30:00Z)
|
|
23
|
+
|
|
24
|
+
# Scoped Context
|
|
25
|
+
|
|
26
|
+
## Problem
|
|
27
|
+
[Clear statement of the problem frame]
|
|
28
|
+
|
|
29
|
+
## Intended Behavior
|
|
30
|
+
[Description of desired outcome]
|
|
31
|
+
|
|
32
|
+
## Success Criteria
|
|
33
|
+
- [Criterion 1]
|
|
34
|
+
- [Criterion 2]
|
|
35
|
+
|
|
36
|
+
## Existing Plan
|
|
37
|
+
path: docs/plans/...md | null
|
|
38
|
+
action: resume | review | archive | delete | create-new | none
|
|
39
|
+
|
|
40
|
+
## Related Learnings
|
|
41
|
+
- docs/learn/XXX.md — [1-line applicability note]
|
|
42
|
+
- (List from docs/learn/index.md; empty list if none)
|
|
43
|
+
|
|
44
|
+
## Learning Gaps
|
|
45
|
+
- [Gap name] — [Follow-up action via /learnings]
|
|
46
|
+
|
|
47
|
+
## Requirements Found
|
|
48
|
+
- docs/brainstorms/XXX.md — [relevant excerpt]
|
|
49
|
+
- docs/requirements/XXX.md — [relevant excerpt]
|
|
50
|
+
- (Empty list if none found)
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Also save the scoped context to `docs/plans/.scope/<scope-id>.md` for future reference or reuse. The `interactionMode` value flows into `research`, `design`, and `generate` artifacts.
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Task Artifact
|
|
3
|
+
description: Template for the Task Artifact produced by the Tasks phase. One task per Acceptance Criterion; one test per task; Red→Green→Refactor Steps. Defines the schema for a single executable, test-driven task file.
|
|
4
|
+
type: template
|
|
5
|
+
version: 2.0
|
|
6
|
+
timestamp: "2026-08-07"
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Task Artifact
|
|
10
|
+
|
|
11
|
+
The product of the **Tasks** phase (Phase 5) is a set of granular, executable, **test-driven** task files — **one per Acceptance Criterion**. Each task carries exactly one Acceptance Criterion and exactly one test file, follows Red→Green→Refactor, and is self-contained enough to execute without re-reading the full plan. It is the handoff point to the Work skill (`work/SKILL.md`).
|
|
12
|
+
|
|
13
|
+
## Core rule
|
|
14
|
+
|
|
15
|
+
- **One Acceptance Criterion per task.**
|
|
16
|
+
- **One test per task** (in `files.test`, exactly one entry) — that test asserts this task's single Acceptance Criterion.
|
|
17
|
+
- **Test-Driven:** `## Steps` run **Red → Green → Refactor** (write the failing test first and confirm it fails, implement the minimum code to pass, then refactor with the test green).
|
|
18
|
+
|
|
19
|
+
## Schema
|
|
20
|
+
|
|
21
|
+
```yaml
|
|
22
|
+
---
|
|
23
|
+
id: <plan-id>-T<NN>
|
|
24
|
+
title: "[Task title]"
|
|
25
|
+
plan-id: <plan-id>
|
|
26
|
+
unit: U<NN> | U<NN><letter>
|
|
27
|
+
tier: fast | standard | deep
|
|
28
|
+
status: not-started
|
|
29
|
+
priority: P0 | P1 | P2
|
|
30
|
+
dependencies: [<task-id>, ...]
|
|
31
|
+
files:
|
|
32
|
+
create: [path/to/file, ...]
|
|
33
|
+
modify: [path/to/file, ...]
|
|
34
|
+
test: [path/to/test] # exactly one — the test for this task's AC
|
|
35
|
+
estimated-effort: "<hours or days>"
|
|
36
|
+
timestamp: ISO-8601 timestamp (e.g., 2026-08-07T14:30:00Z)
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
# [Task Title]
|
|
40
|
+
|
|
41
|
+
## Goal
|
|
42
|
+
[What this task accomplishes, inherited from the implementation unit and scoped to this one criterion. 1-2 sentences.]
|
|
43
|
+
|
|
44
|
+
## Acceptance Criterion
|
|
45
|
+
[Exactly one, single, verifiable criterion this task delivers.]
|
|
46
|
+
|
|
47
|
+
## Steps
|
|
48
|
+
1. **Red — Write the failing test:** add the test at `files.test[0]` asserting this Acceptance Criterion. Run it and confirm it fails for the right reason (not a setup/import error).
|
|
49
|
+
2. **Green — Implement:** add the minimum code in `files.create`/`files.modify` to make the test pass.
|
|
50
|
+
3. **Refactor:** clean up naming, duplication, and structure while keeping the test green.
|
|
51
|
+
|
|
52
|
+
## Test Scenarios
|
|
53
|
+
- [Scenario]: [Input -> Expected Outcome] # the assertion(s) for this criterion (may be a single scenario)
|
|
54
|
+
|
|
55
|
+
## Acceptance Criteria
|
|
56
|
+
- [ ] [This task's single Acceptance Criterion, restated as a checkable box]
|
|
57
|
+
|
|
58
|
+
## Dependencies
|
|
59
|
+
- [task-id]: [why this task must complete first, or "None"]
|
|
60
|
+
|
|
61
|
+
## Notes
|
|
62
|
+
[Any context, gotchas, references to learnings, or links to related tasks. Optional.]
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Validation Rules
|
|
66
|
+
|
|
67
|
+
- **id:** Required. Format `<plan-id>-T<NN>` where `NN` is zero-padded 2 digits matching dependency order. Sub-IDs use letters (e.g., `T02a`).
|
|
68
|
+
- **title:** Required. Short, action-oriented (e.g., "Set up Redis client and session store interface").
|
|
69
|
+
- **plan-id:** Required. Must match the Final Plan's `plan-id` for traceability.
|
|
70
|
+
- **unit:** Required. The originating implementation unit (e.g., `U1`, `U2a`). A task never spans more than one Acceptance Criterion, so it records exactly one unit (or one sub-id).
|
|
71
|
+
- **tier:** Required. Inherited from the Final Plan (`fast | standard | deep`).
|
|
72
|
+
- **status:** Required. Initial value `not-started`. The Work skill updates this to `in-progress`, `completed`, or `blocked`.
|
|
73
|
+
- **priority:** Required. `P0` (blocks all), `P1` (critical path), `P2` (deferrable).
|
|
74
|
+
- **dependencies:** Required (may be empty list). Must reference task IDs that appear earlier in dependency order.
|
|
75
|
+
- **files:** Required. `test` must contain **exactly one** path — the test for this task's single Acceptance Criterion. At least one of `create`, `modify`, or `test` must be non-empty. All paths must be repository-relative.
|
|
76
|
+
- **estimated-effort:** Required. Rough estimate in hours or days. Used by the Work phase for sequencing.
|
|
77
|
+
- **Goal:** Required. 1–2 sentences, inherited from the unit and scoped to this criterion.
|
|
78
|
+
- **Acceptance Criterion:** Required. **Exactly one** verifiable criterion. Single, not bundled.
|
|
79
|
+
- **Steps:** Required. Exactly three, in **Red → Green → Refactor** order, with the failing test written and confirmed **before** implementation.
|
|
80
|
+
- **Test Scenarios:** Required for foundation/integration tasks (phases 1–2). Optional for rollout-only tasks. Format: `[Scenario]: [Input -> Expected Outcome]`. May be a single scenario (one task = one criterion = one test).
|
|
81
|
+
- **Acceptance Criteria (checkbox):** Required. Exactly one checkable item restating the criterion above.
|
|
82
|
+
- **Notes:** Optional. May reference learnings, gotchas, or related tasks.
|
|
83
|
+
|
|
84
|
+
## Example
|
|
85
|
+
|
|
86
|
+
```yaml
|
|
87
|
+
---
|
|
88
|
+
id: 2026-07-03-001-T01
|
|
89
|
+
title: "Redis client connects and backs the SessionStore interface"
|
|
90
|
+
plan-id: 2026-07-03-001
|
|
91
|
+
unit: U1
|
|
92
|
+
tier: standard
|
|
93
|
+
status: not-started
|
|
94
|
+
priority: P0
|
|
95
|
+
dependencies: []
|
|
96
|
+
files:
|
|
97
|
+
create:
|
|
98
|
+
- src/lib/redis-client.ts
|
|
99
|
+
- src/lib/session-store.ts
|
|
100
|
+
test:
|
|
101
|
+
- src/lib/redis-client.test.ts
|
|
102
|
+
estimated-effort: "4 hours"
|
|
103
|
+
timestamp: 2026-07-03T09:00:00Z
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
# Redis client connects and backs the SessionStore interface
|
|
107
|
+
|
|
108
|
+
## Goal
|
|
109
|
+
Create a Redis client wrapper that connects from `REDIS_URL` with retry-on-failure, and define the `SessionStore` interface it satisfies. This is the foundation for all later session work.
|
|
110
|
+
|
|
111
|
+
## Acceptance Criterion
|
|
112
|
+
The Redis client connects using `REDIS_URL` with retry on failure, and `SessionStore` exports `get`, `save`, and `delete` — verified by a failing-then-passing test.
|
|
113
|
+
|
|
114
|
+
## Steps
|
|
115
|
+
1. **Red — Write the failing test:** add `src/lib/redis-client.test.ts` asserting: store `{id, data}` → retrieve returns the same data; a 1s TTL session returns null after expiry; dropping the connection makes `get` throw a retryable error. Run it and confirm it fails (interface/client not yet implemented).
|
|
116
|
+
2. **Green — Implement:** add `ioredis` to `package.json`; create `src/lib/redis-client.ts` (configured client with connection retry) and `src/lib/session-store.ts` (`get`, `save`, `delete`) until the test passes.
|
|
117
|
+
3. **Refactor:** keep the client wrapper thin (business logic belongs in the store implementation — T02); ensure all three test scenarios stay green.
|
|
118
|
+
|
|
119
|
+
## Test Scenarios
|
|
120
|
+
- Store/retrieve session: store {id, data} -> retrieve returns same data
|
|
121
|
+
- TTL expiration: store with 1s TTL -> after 1s, get returns null
|
|
122
|
+
- Connection error: drop connection -> get throws retryable error
|
|
123
|
+
|
|
124
|
+
## Acceptance Criteria
|
|
125
|
+
- [ ] Redis client connects from `REDIS_URL` with retry on failure and `SessionStore` exposes `get`/`save`/`delete` (all three test scenarios pass)
|
|
126
|
+
|
|
127
|
+
## Dependencies
|
|
128
|
+
- None
|
|
129
|
+
|
|
130
|
+
## Notes
|
|
131
|
+
- Reuse the connection retry pattern from `docs/learn/pattern/redis-retry-2026-07-02.md` if it exists.
|
|
132
|
+
- Feature flag `feature.redis_sessions` is added in T04, not here.
|
|
133
|
+
- T02 implements the Redis-backed `SessionStore`; keep this task limited to the client + interface + its own test.
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## File-Naming Convention
|
|
137
|
+
|
|
138
|
+
Task files are named and stored as:
|
|
139
|
+
|
|
140
|
+
```
|
|
141
|
+
docs/tasks/<plan-id>/T<NN>-<kebab-case-name>.md
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
**Example:**
|
|
145
|
+
|
|
146
|
+
```
|
|
147
|
+
docs/tasks/2026-07-03-001/
|
|
148
|
+
T01-redis-client-and-session-store-interface.md
|
|
149
|
+
T02a-redis-session-store-implementation.md
|
|
150
|
+
T02b-session-middleware-refactor.md
|
|
151
|
+
T04-dual-write-cutover.md
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
## Usage in Workflow
|
|
155
|
+
|
|
156
|
+
1. **Tasks Phase** reads the Final Plan's Implementation Units and slices them into tasks per [task-slicing-rules.md](../../task-slicing-rules.md) — **one task per Acceptance Criterion**.
|
|
157
|
+
2. Each task file is saved to `docs/tasks/<plan-id>/T<NN>-<name>.md`.
|
|
158
|
+
3. **Tasks Phase** updates `docs/tasks/<plan-id>/index.md` with a checklist of all tasks for the plan.
|
|
159
|
+
4. **Work skill** (`work/SKILL.md`) reads task files, runs each task's Red→Green→Refactor cycle, and updates `status` and the index checklist.
|
|
160
|
+
|
|
161
|
+
## Index Entry Format
|
|
162
|
+
|
|
163
|
+
After saving all task files, append a section to `docs/tasks/<plan-id>/index.md`:
|
|
164
|
+
|
|
165
|
+
```markdown
|
|
166
|
+
## 2026-07-03-001 — Migrate Session Storage to Redis
|
|
167
|
+
|
|
168
|
+
- [ ] T01 — Redis client connects and backs the SessionStore interface (`U1`, AC: client connects with retry + SessionStore get/save/delete) — `docs/tasks/2026-07-03-001/T01-redis-client-and-session-store-interface.md`
|
|
169
|
+
- [ ] T02a — Redis-backed SessionStore implementation (`U2a`, AC: get/save/delete persist sessions to Redis with TTL) — `docs/tasks/2026-07-03-001/T02a-redis-session-store-implementation.md`
|
|
170
|
+
- [ ] T02b — Session middleware refactor (`U2b`, AC: middleware loads valid sessions and rejects invalid/expired JWTs) — `docs/tasks/2026-07-03-001/T02b-session-middleware-refactor.md`
|
|
171
|
+
- [ ] T04 — Dual-write and cutover (`U4`, AC: dual-write to Redis with feature-flagged cutover) — `docs/tasks/2026-07-03-001/T04-dual-write-cutover.md`
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
The `- [ ]` (unchecked) markers are updated to `- [x]` by the Work skill as tasks complete.
|
|
175
|
+
|
|
176
|
+
## Missing Field Recovery
|
|
177
|
+
|
|
178
|
+
If a task file is incomplete at validation, use this recovery workflow:
|
|
179
|
+
|
|
180
|
+
| Field | Validation | Recovery |
|
|
181
|
+
| ------------------- | ------------------------------------ | --------------------------------------------------- |
|
|
182
|
+
| id | Matches `<plan-id>-T<NN>` | Regenerate from dependency order |
|
|
183
|
+
| unit | References a single plan unit | Ask user to map the task to one unit |
|
|
184
|
+
| files.test | Exactly one path | Ask user for the single test file for this criterion |
|
|
185
|
+
| files (create/modify) | At least one path non-empty | Ask user which files the task touches |
|
|
186
|
+
| Acceptance Criterion | Exactly one, verifiable | Ask user to state the single criterion |
|
|
187
|
+
| Steps | Red → Green → Refactor ordering | Re-sequence; ensure test is written and run first |
|
|
188
|
+
| Test Scenarios | Present for phases 1–2 | Inherit from the unit's test scenarios |
|
|
189
|
+
| Acceptance Criteria | Exactly one checkable item | Derive from the single Acceptance Criterion |
|
|
190
|
+
| dependencies | References earlier task IDs | Re-run dependency ordering algorithm |
|
|
191
|
+
|
|
192
|
+
**Note:** If a task cannot be produced because the plan has no Implementation Units (or a unit has no Acceptance Criteria), abort the Tasks phase and ask the user to re-run the Design/Generate phases — the plan is incomplete.
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: User Input Artifact
|
|
3
|
+
description: Template for the User Input Artifact produced by the Orchestrator. Captures raw user input, task description, intended behavior, goals, constraints, and context for downstream phases.
|
|
4
|
+
type: template
|
|
5
|
+
version: 1.1
|
|
6
|
+
timestamp: "2026-08-07"
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# User Input Artifact
|
|
10
|
+
|
|
11
|
+
The **User Input Artifact** is the entry point to the Plan workflow. It captures the raw input from the user before the Scope phase processes and structures it. The Orchestrator produces this artifact and passes it to Phase 1 (Scope) for validation and context enrichment.
|
|
12
|
+
|
|
13
|
+
## Schema
|
|
14
|
+
|
|
15
|
+
```yaml
|
|
16
|
+
type: user-input
|
|
17
|
+
timestamp: ISO-8601 timestamp (e.g., 2026-07-02T14:30:00Z)
|
|
18
|
+
source: user-prompt | saved-prompt | document | previous-plan | hybrid
|
|
19
|
+
status: provided | incomplete | invalid
|
|
20
|
+
|
|
21
|
+
# User Input
|
|
22
|
+
|
|
23
|
+
## Task Description
|
|
24
|
+
[1-3 sentence description of the task or project]
|
|
25
|
+
|
|
26
|
+
## Intended Behavior
|
|
27
|
+
[Description of the desired outcome or what should happen after completion]
|
|
28
|
+
|
|
29
|
+
## Goals & Objectives
|
|
30
|
+
- [Goal 1]
|
|
31
|
+
- [Goal 2]
|
|
32
|
+
- (Optional; may be empty if not provided)
|
|
33
|
+
|
|
34
|
+
## Constraints & Limitations
|
|
35
|
+
- [Constraint 1]
|
|
36
|
+
- [Constraint 2]
|
|
37
|
+
- (Optional; may be empty if not provided)
|
|
38
|
+
|
|
39
|
+
## Context Source
|
|
40
|
+
[Where the input came from: direct user question, saved prompt file, attached document, resume of previous plan, or combination]
|
|
41
|
+
|
|
42
|
+
## Additional Context
|
|
43
|
+
[Any other relevant information: related files, previous attempts, team notes, external references]
|
|
44
|
+
(Optional; may be empty)
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Validation Rules
|
|
48
|
+
|
|
49
|
+
- **Task Description:** Required. Must be non-empty and non-ambiguous.
|
|
50
|
+
- **Intended Behavior:** Required. Must describe an observable outcome.
|
|
51
|
+
- **Goals & Objectives:** Optional but recommended. If empty, Scope will ask clarifying questions.
|
|
52
|
+
- **Constraints & Limitations:** Optional. If empty, Scope assumes no explicit constraints.
|
|
53
|
+
- **Context Source:** Required. Must be one of: `user-prompt`, `saved-prompt`, `document`, `previous-plan`, or `hybrid`.
|
|
54
|
+
- **Additional Context:** Optional. May be empty or contain freeform notes.
|
|
55
|
+
|
|
56
|
+
## Example
|
|
57
|
+
|
|
58
|
+
```yaml
|
|
59
|
+
type: user-input
|
|
60
|
+
timestamp: 2026-07-02T10:15:00Z
|
|
61
|
+
source: user-prompt
|
|
62
|
+
status: provided
|
|
63
|
+
|
|
64
|
+
# User Input
|
|
65
|
+
|
|
66
|
+
## Task Description
|
|
67
|
+
Add real-time collaboration features to the editor. Multiple users should be able to edit the same document simultaneously and see changes update in real-time.
|
|
68
|
+
|
|
69
|
+
## Intended Behavior
|
|
70
|
+
When User A types in a document, User B sees the text appear within 200ms. Cursor positions and selections are also synchronized. Conflicts are resolved using operational transformation.
|
|
71
|
+
|
|
72
|
+
## Goals & Objectives
|
|
73
|
+
- Enable simultaneous multi-user editing
|
|
74
|
+
- Keep latency under 200ms
|
|
75
|
+
- Support up to 10 concurrent users per document
|
|
76
|
+
- Maintain backward compatibility with single-user editing
|
|
77
|
+
|
|
78
|
+
## Constraints & Limitations
|
|
79
|
+
- Must use WebSocket protocol (no long-polling)
|
|
80
|
+
- Backend infrastructure limited to 2 GB RAM per instance
|
|
81
|
+
- Cannot require changes to existing client API
|
|
82
|
+
|
|
83
|
+
## Context Source
|
|
84
|
+
user-prompt
|
|
85
|
+
|
|
86
|
+
## Additional Context
|
|
87
|
+
Related issue: https://github.com/org/repo/issues/42
|
|
88
|
+
Previous prototype: /docs/brainstorms/collab-v1.md
|
|
89
|
+
Team notes in Slack: channel #editor-features
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Usage in Workflow
|
|
93
|
+
|
|
94
|
+
1. **Orchestrator** generates this artifact from user input, saved prompt, or document
|
|
95
|
+
2. **Scope Phase (Step 0)** validates the artifact for completeness and format
|
|
96
|
+
3. **Scope Phase (Steps 1-5)** enriches the artifact with learnings, requirements, and existing plans
|
|
97
|
+
4. **Scoped Context Artifact** is the output that downstream phases consume
|
|
98
|
+
|
|
99
|
+
## Missing Input Recovery
|
|
100
|
+
|
|
101
|
+
If the User Input Artifact is incomplete or invalid at Step 0, the Scope phase uses this recovery workflow:
|
|
102
|
+
|
|
103
|
+
| Field | Validation | Recovery |
|
|
104
|
+
| ------------------------- | ----------------------------- | ------------------------------------------------------------ |
|
|
105
|
+
| Task Description | Non-empty, < 500 chars | Ask: "What problem are you trying to solve?" |
|
|
106
|
+
| Intended Behavior | Non-empty, observable outcome | Ask: "What should happen after this is implemented?" |
|
|
107
|
+
| Goals & Objectives | Optional | Ask: "What specific outcomes define success?" (collect 1-3) |
|
|
108
|
+
| Constraints & Limitations | Optional | Ask: "Are there any hard constraints?" (collect if provided) |
|
|
109
|
+
| Context Source | Must be valid type | Infer from input origin; ask if ambiguous |
|
|
110
|
+
| Additional Context | Optional | Skip if empty |
|
|
111
|
+
|
|
112
|
+
**Note:** If Task Description or Intended Behavior cannot be provided, abort planning and ask the user to return with more context.
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: review
|
|
3
|
+
description: "Review code changes through a deterministic pipeline of micro-skills: Scope -> Prepare -> Analyze -> Report. Accepts a PR / branch diff / commit range / working tree, a /work run's changes, or an ad-hoc target; produces graded findings and an approval status. Local-only; no GitHub sync. No agent dependency, no fallback paths."
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Review
|
|
8
|
+
|
|
9
|
+
Orchestrates a deterministic pipeline of micro-skills: `Scope -> Prepare -> Analyze -> Report`. Reviews code changes against quality, security, tests, documentation, integration, and scope-creep standards; produces graded findings (`blocker` / `major` / `minor` / `nit`) and an approval status (`approved` / `changes-requested` / `rejected`). Accepts any code change set, a `/work` run's changes, **or** an ad-hoc target. Local-only — findings are written to a report on disk, never posted to GitHub. No agent dependency, no fallback paths.
|
|
10
|
+
|
|
11
|
+
## Skill Invocation
|
|
12
|
+
|
|
13
|
+
This skill is invoked by prompting:
|
|
14
|
+
|
|
15
|
+
- `/review <change-set>` — review a git change set: `git diff <base>..<head>`, a PR's commits, a commit range (`A..B`), `HEAD` (uncommitted), staged changes, a branch-vs-base diff, or a set of paths/globs.
|
|
16
|
+
- `/review <work-id>` — review the changes a `/work` run produced. Scope discovers `status: for-review` tasks (see below); if found, reviews those task changes and gates approval. Also accepts a Work `review-id` to scope to that run.
|
|
17
|
+
- `/review <target description>` — ad-hoc review of a described target (e.g. "review the auth module", "review `src/lib/redis-client.ts`"). Scope resolves the description into a concrete change boundary.
|
|
18
|
+
|
|
19
|
+
This skill runs the review pipeline, analyzing changes and producing a report, acting as the Orchestrator.
|
|
20
|
+
|
|
21
|
+
## Interaction Method
|
|
22
|
+
|
|
23
|
+
- Ask the user one structured question at a time (2–4 concrete options) using the agent's interactive question capability; never hardcode a specific tool name.
|
|
24
|
+
- If input is empty, ask: "What would you like to review? Provide a git ref/range, a work-id, or describe a target."
|
|
25
|
+
|
|
26
|
+
Before starting the workflow, ask the user to choose an interaction mode:
|
|
27
|
+
|
|
28
|
+
- **Detailed** — Confirm at each phase transition and before surfacing each finding category; inspect artifacts; maximum control. Best for high-stakes or sensitive reviews.
|
|
29
|
+
- **Autopilot** — All phases run automatically; only the final Review Report is presented. Fastest. Best for routine reviews of well-understood changes.
|
|
30
|
+
- **Smart** — Phases run automatically; pause only when `blocker`/`major` findings appear or when scope creep is detected.
|
|
31
|
+
|
|
32
|
+
Store in the context object:
|
|
33
|
+
|
|
34
|
+
```yaml
|
|
35
|
+
interactionMode: detailed | smart | autopilot
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
**Propagation:** `interactionMode` flows into the `scope`, `prepare`, `analyze`, and `report` artifacts; each downstream phase reads it to adjust confirmation behaviour (detailed = pause every transition; autopilot = run all; smart = pause only on `blocker`/`major` findings or detected scope creep).
|
|
39
|
+
|
|
40
|
+
## Orchestration Implementation
|
|
41
|
+
|
|
42
|
+
Each phase runs sequentially: the orchestrator calls the phase module, receives the output artifact, validates it with a quality gate, and passes it to the next phase.
|
|
43
|
+
|
|
44
|
+
### INPUT
|
|
45
|
+
|
|
46
|
+
- Receives a context object from the user, a saved prompt, a document, or a combination.
|
|
47
|
+
- **Four input shapes:**
|
|
48
|
+
1. **Change-set** — a git change set spec: a diff range (`<base>..<head>`), a commit range (`A..B`), `HEAD` (uncommitted working tree), staged changes, a branch-vs-base diff, or a set of paths/globs. Scope resolves it to a concrete file + hunk boundary.
|
|
49
|
+
2. **Work-linked** — a `work-id` (e.g. `2026-07-10-001`) or a Work `review-id`. Scope resolves it to the changes that `/work` run touched: the union of every task file's `files.create` / `files.modify` (filtered by the `completed`/`blocked`/`skipped` outcomes in the Work Report), bounded to commits attributable to that run if discoverable.
|
|
50
|
+
3. **Task-in-review** — ✅ **NEW**: a `work-id` where one or more tasks have `status: for-review` (gated by Work Review Phase 4). Scope resolves it to files touched by those tasks. After Analyze, Report updates task file frontmatter: `status: completed` (if approved) or `status: blocked` (if changes-requested). This is the approval gate for tasks awaiting review.
|
|
51
|
+
4. **Ad-hoc** — a free-form target description. Scope maps it to a concrete change boundary by locating matching files/paths and, where applicable, the commits that most recently touched them.
|
|
52
|
+
- **Optional requirements:** any review is sharper when there is a reference spec to test against. Accept an optional requirements ref — a `/plan` plan-id, a task's `## Acceptance Criterion`, a markdown spec, or a referenced doc. If provided, scope-creep detection runs against it; if absent, Scope marks `requirements-source: none` and Analyze skips the scope-creep-vs-requirements category (noting it).
|
|
53
|
+
- **If no context is provided**, ask: "What would you like to review? Provide a git ref/range, a work-id, or describe a target."
|
|
54
|
+
- **Unified key:** downstream phases key off a `review-id` (`YYYY-MM-DD-NNN`), allocated by Scope per [id-generation.md](references/id-generation.md). For work-linked and task-in-review input, the `review-id` is **distinct** from the Work `review-id` (the two skills produce independent artifacts) — the work-id is carried alongside for traceability and optional index cross-linking. For task-in-review input specifically, Report's approval verdict updates the task files' frontmatter `status:` field (new behavior).
|
|
55
|
+
- Output: [Review Input Artifact](references/templates/artifacts/review-input.md)
|
|
56
|
+
|
|
57
|
+
### Pre-Flight Check
|
|
58
|
+
|
|
59
|
+
Before starting the review pipeline, the orchestrator verifies that required folders exist:
|
|
60
|
+
|
|
61
|
+
- `docs/plans/.review/.scope/`, `docs/plans/.review/.prepare/`, `docs/plans/.review/.analyze/`, `docs/plans/.review/.report/` — must exist for saving the four phase artifacts
|
|
62
|
+
- `docs/plans/.review/index.md` — must exist as the review registry (Report appends to it)
|
|
63
|
+
|
|
64
|
+
**Self-Healing:** If any are missing, the orchestrator automatically creates them (`mkdir -p`, and a seed `index.md` with a registry header). This allows the Review skill to run even if `arreio-init` wasn't explicitly run.
|
|
65
|
+
|
|
66
|
+
For **change-set** input, verify the repo is a git working tree and the spec parses to a non-empty diff; if not, ask the user to provide a valid ref/range or switch to ad-hoc.
|
|
67
|
+
|
|
68
|
+
For **work-linked** input, verify the `work-id` exists (`docs/tasks/<work-id>/index.md`) and is non-empty; if given a Work `review-id`, verify `docs/plans/.work/.review/<review-id>.md` exists. If missing, ask the user to run `/work <work-id>` first or switch to a change-set spec.
|
|
69
|
+
|
|
70
|
+
For **task-in-review** input, verify the `work-id` exists and contains at least one task with `status: for-review` (read task files' frontmatter or check the Work Report's task-outcome-rollup `for-review` count). If none found, inform the user: "No tasks in for-review status for this work-id. Did you run `/work <work-id>` first?" or offer to review the work-linked changes instead.
|
|
71
|
+
|
|
72
|
+
### Phases
|
|
73
|
+
|
|
74
|
+
| Phase | Phase Module | Output Artifact | Saved to |
|
|
75
|
+
| ----- | ----------------------------- | ---------------------------------------------------------------- | ------------------------------------- |
|
|
76
|
+
| 1 | [Scope](modules/scope.md) | [Review scope](references/templates/artifacts/review-scope.md) | `docs/plans/.review/.scope/<id>.md` |
|
|
77
|
+
| 2 | [Prepare](modules/prepare.md) | [Review kit](references/templates/artifacts/review-kit.md) | `docs/plans/.review/.prepare/<id>.md` |
|
|
78
|
+
| 3 | [Analyze](modules/analyze.md) | [Findings](references/templates/artifacts/findings.md) | `docs/plans/.review/.analyze/<id>.md` |
|
|
79
|
+
| 4 | [Report](modules/report.md) | [Review report](references/templates/artifacts/review-report.md) | `docs/plans/.review/.report/<id>.md` |
|
|
80
|
+
|
|
81
|
+
### Quality Gates
|
|
82
|
+
|
|
83
|
+
Between phases, the orchestrator validates the output artifact before passing it to the next phase:
|
|
84
|
+
|
|
85
|
+
1. **Schema validation** — required fields present and well-formed (see [error-handling.md](references/error-handling.md) for the per-type field list).
|
|
86
|
+
2. **Cross-phase consistency** — IDs (`review-id`, `scope-id`, `prepare-id`, `analyze-id`, `report-id`) match the upstream artifacts; `interactionMode` is identical across artifacts.
|
|
87
|
+
3. **Status check** — the artifact's `status` is `complete` (not `pending` or `failed`).
|
|
88
|
+
4. **Scope coherence** (after Scope) — the change boundary is non-empty and parses to a concrete file list; referenced requirements resolve (or are explicitly marked `none`). Required- vs optional-only files are separated.
|
|
89
|
+
5. **Findings coherence** (after Analyze) — every finding carries a `severity`, a `category` (quality / security / tests / documentation / integration / scope-creep), a repository-relative `location`, and either a requirement trace or a `scope-creep` flag.
|
|
90
|
+
|
|
91
|
+
If a gate fails, the orchestrator returns to the producing phase with the error context (per the recovery workflow in [error-handling.md](references/error-handling.md)).
|
|
92
|
+
|
|
93
|
+
### Index Registration
|
|
94
|
+
|
|
95
|
+
Each phase is responsible for its own index updates:
|
|
96
|
+
|
|
97
|
+
| Phase | Registers To | Update |
|
|
98
|
+
| ------- | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
|
|
99
|
+
| Scope | _(none — produces artifact only)_ | Allocates the `review-id`; no index write. |
|
|
100
|
+
| Prepare | _(none)_ | Gathers the review kit; no index write. |
|
|
101
|
+
| Analyze | _(none)_ | Produces findings; no index write. |
|
|
102
|
+
| Report | `docs/plans/.review/index.md` | Append a registry row: `<report-id>`, review target summary, approval status, link to the report file. |
|
|
103
|
+
| Report | `docs/tasks/<work-id>/index.md` _(work-linked or task-in-review only)_ | Append a distinct `## Review Report — <report-id>` block (separate from Work's own `## Work Report` block). |
|
|
104
|
+
| Report | Task frontmatter _(task-in-review only)_ | Update task file `status:` field to `completed` (if approved) or `blocked` (if changes-requested, with reason in frontmatter). |
|
|
105
|
+
|
|
106
|
+
**Idempotency rule:** re-running Review over the same target re-derives findings fresh (reviews are not resume-safe like execution — the change set may have evolved). The registry row and any work-index block are **idempotent on `report-id`**: a re-run overwrites the row/block with the same id, never duplicates it.
|
|
107
|
+
|
|
108
|
+
### FINAL OUTPUT
|
|
109
|
+
|
|
110
|
+
- **Review Report:** Saved to `docs/plans/.review/.report/<report-id>.md`, with: the change boundary, the approval status (`approved` / `changes-requested` / `rejected`), the graded findings rollup, recommendations, and (when requirements were available) the scope-creep summary.
|
|
111
|
+
- **Registry row:** `docs/plans/.review/index.md` updated with the new review.
|
|
112
|
+
- **(Work-linked or task-in-review only) Index cross-link:** `docs/tasks/<work-id>/index.md` gets a `## Review Report — <report-id>` block so a future glance at the work index shows that an external Review ran over it.
|
|
113
|
+
- **(Task-in-review only) Task Status Update:** ✅ **NEW**: For each task with `status: for-review`:
|
|
114
|
+
- If approval status = `approved` → update task file's frontmatter `status: completed`
|
|
115
|
+
- If approval status = `changes-requested` → update task file's frontmatter `status: blocked` (with reason in `block-reason:` field)
|
|
116
|
+
- Idempotent on `report-id` (re-running overwrites, never duplicates)
|
|
117
|
+
- **No GitHub sync:** This skill does not post comments, formal reviews, or labels to GitHub. Findings live on disk only — the user wires outbound posting as a separate step if desired.
|
|
118
|
+
- **(Optional) Learnings:** Recurring traps or confirmed patterns surfaced during Analyze are handed to the Learn skill (`/learn`) to persist — Review does not write `docs/learn/` directly.
|
|
119
|
+
|
|
120
|
+
## References
|
|
121
|
+
|
|
122
|
+
The orchestrator and phase modules share these reference files:
|
|
123
|
+
|
|
124
|
+
| Reference | Used By |
|
|
125
|
+
| ----------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
|
|
126
|
+
| [error-handling.md](references/error-handling.md) | All phases (Step 0 verification) |
|
|
127
|
+
| [id-generation.md](references/id-generation.md) | Scope, Prepare, Analyze, Report (ID assignment, including `review-id` allocation) |
|
|
128
|
+
| [interaction-mode-propagation.md](references/interaction-mode-propagation.md) | All phases (Step N confirmation) |
|
|
129
|
+
| [change-set-resolution.md](references/change-set-resolution.md) | Scope (resolve change-set / work-id / ad-hoc into a change boundary) |
|
|
130
|
+
| [scope-creep-detection.md](references/scope-creep-detection.md) | Scope (pre-check) + Analyze (final) detect creep vs requirements |
|
|
131
|
+
| [review-categories.md](references/review-categories.md) | Analyze (quality / security / tests / documentation / integration / scope-creep) |
|
|
132
|
+
| [severity-rubric.md](references/severity-rubric.md) | Analyze + Report (severity assignment) |
|
|
133
|
+
| [approval-criteria.md](references/approval-criteria.md) | Report (final approval status derivation) |
|
|
134
|
+
| [learnings-gate-logic.md](../plan/references/learnings-gate-logic.md) | Scope (pull related learnings from `docs/learn/index.md`) — reused from `/plan` |
|
|
135
|
+
|
|
136
|
+
Artifact templates live in [references/templates/artifacts/](references/templates/artifacts/):
|
|
137
|
+
|
|
138
|
+
| Template | Produced By |
|
|
139
|
+
| ------------------------------------------------------------------- | ------------ |
|
|
140
|
+
| [review-input.md](references/templates/artifacts/review-input.md) | Orchestrator |
|
|
141
|
+
| [review-scope.md](references/templates/artifacts/review-scope.md) | Scope |
|
|
142
|
+
| [review-kit.md](references/templates/artifacts/review-kit.md) | Prepare |
|
|
143
|
+
| [findings.md](references/templates/artifacts/findings.md) | Analyze |
|
|
144
|
+
| [review-report.md](references/templates/artifacts/review-report.md) | Report |
|
|
145
|
+
|
|
146
|
+
## Core Principles
|
|
147
|
+
|
|
148
|
+
- **Deterministic Pipeline:** Phases always execute in sequence (no agent switching, no fallback paths).
|
|
149
|
+
- **Review ≠ Work's Review phase:** This is a heavyweight code review of arbitrary changes against standards (quality / security / tests / docs / integration / scope-creep) with an explicit approval status. Work's built-in Phase-4 Review is a lightweight, behavior-preserving cleanup + gate of the tasks it just executed. The two are **complementary, not overlapping**:
|
|
150
|
+
- **Work Review** (Phase 4 of `/work`): Pre-check gate. Simplify, consolidate, run regression check, detect scope-creep. If any regression/scope-creep found → tasks enter `for-review` status (not `completed`).
|
|
151
|
+
- **Standalone Review** (this skill): Comprehensive audit. Full quality/security/tests/docs analysis. Can accept `/review <work-id>` → finds `status: for-review` tasks (task-in-review input shape) → audits them with full severity rubric → approval verdict updates task status to `completed` or `blocked`.
|
|
152
|
+
- **Sequential**, not parallel: `/work` executes and gates to `for-review`; user runs `/review` next to approve or reject. No overlap in purpose.
|
|
153
|
+
- **Cascade Graded Findings:** Every finding has a severity (`blocker` / `major` / `minor` / `nit`) that drives the final approval status. Severity criteria are authoritative in [severity-rubric.md](references/severity-rubric.md); Analyze assigns, Report aggregates and never re-encodes the rubric.
|
|
154
|
+
- **Scope-Creep Requires Requirements:** Scope-creep detection runs only when a reference spec is available; without one, Analyze skips that category and records `requirements-source: none`. The logic is authoritative in [scope-creep-detection.md](references/scope-creep-detection.md).
|
|
155
|
+
- **Test the Tests:** Reviewing changes includes evaluating the tests that accompany them — coverage, correctness of assertions, and whether they assert the intended Acceptance Criterion — not just production code.
|
|
156
|
+
- **Read-Only Review:** Review analyzes and reports; it never edits the code under review. Required changes become a follow-up task (a new `/plan` + `/work`, or manual edits) — never applied inline here.
|
|
157
|
+
- **Single Source of Truth:** This skill defines all its own rules; it does not depend on any external agent rule file. Category, severity, and approval definitions live once in their authoritative references and are never re-encoded inline in the modules.
|
|
158
|
+
- **Transparent Artifacts:** Each phase produces an explicit output artifact for the next phase.
|
|
159
|
+
- **Behavior-Described, Tool-Agnostic:** Steps describe required capabilities ("read the diff", "run the test suite", "update the index"), not specific tool names; each agent maps to its native tools.
|
|
160
|
+
- **Interaction Mode Propagation:** `interactionMode` is read at the start of each subsequent phase and determines whether confirmation steps execute.
|
|
161
|
+
- **Error Handling:** Fail explicitly, not silently; each phase has clear error handling with recovery suggestions.
|
|
162
|
+
- **Stay Portable:** Use repository-relative paths only.
|
|
163
|
+
- **Local-Only, No GitHub Sync:** Findings are written on disk only. This skill deliberately does not post to GitHub — outbound posting is left to a separate, optional step the user may add later.
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Analyze
|
|
3
|
+
description: Third step in the Review workflow. Runs the review categories (quality / security / tests / documentation / integration / scope-creep) across the Review Kit's diffs, assigns each finding a severity (blocker / major / minor / nit) per the authoritative severity rubric, attaches a requirement trace or a scope-creep flag to every finding, and aggregates the tallies. Returns Findings for the Report phase.
|
|
4
|
+
type: module
|
|
5
|
+
version: 1.0
|
|
6
|
+
timestamp: "2026-08-08"
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Phase 3 - Analyze
|
|
10
|
+
|
|
11
|
+
**Purpose:** Third step in the Review workflow. Reads the [Review Kit](../references/templates/artifacts/review-kit.md) from Prepare, runs the review **categories** (quality / security / tests / documentation / integration / scope-creep) across the diffs, assigns each finding a **severity** (`blocker` / `major` / `minor` / `nit`) per the authoritative rubric, attaches a **requirement trace** or a **scope-creep flag** to every finding, and aggregates the tallies. Returns [Findings](../references/templates/artifacts/findings.md) for the Report phase. Analyze reviews the diffs; it does not edit the code under review (Review is read-only).
|
|
12
|
+
|
|
13
|
+
## Workflow
|
|
14
|
+
|
|
15
|
+
This is the Phase 3 pipeline for the Review Skill. It orchestrates the following steps:
|
|
16
|
+
|
|
17
|
+
### Step 0: Verification
|
|
18
|
+
|
|
19
|
+
Run the **[Step 0 verification](../references/error-handling.md)**. Required input: a valid **Review Kit** from Prepare. Specifically verify:
|
|
20
|
+
|
|
21
|
+
1. The Review Kit carries `prepare-id`, `scope-id`, `review-id`, `input-shape`, `interactionMode`, the `diffs`, `spec-content` (or `none`), `test-context`, and `tool-inventory`.
|
|
22
|
+
2. `interactionMode` is present and valid (default to `smart` if missing; log warning).
|
|
23
|
+
3. Cross-phase consistency: `review-id`, `scope-id` match the upstream artifacts; `interactionMode` is identical.
|
|
24
|
+
|
|
25
|
+
If the kit records `diffs: none` (the empty nothing-to-review case carried from Scope), Analyze produces an empty Findings set (Step 5) and returns — do not fabricate findings.
|
|
26
|
+
|
|
27
|
+
### Step 1: Run Review Categories
|
|
28
|
+
|
|
29
|
+
Run the six review categories across the kit's diffs. The category definitions and per-category checks are authoritative in **[review-categories.md](../references/review-categories.md)** — Analyze looks them up, it does not re-derive them:
|
|
30
|
+
|
|
31
|
+
- **quality** — design, clarity, DRY, naming, error handling, and structural soundness of the changed code.
|
|
32
|
+
- **security** — input validation, authn/authz, secret leakage, injection, and unsafe patterns introduced by the change.
|
|
33
|
+
- **tests** — **Test the tests:** coverage of changed behavior (from `test-context`), assertion correctness (do tests assert the intended behavior?), flakiness, test smells, and whether production-code changes ship without tests.
|
|
34
|
+
- **documentation** — public API docs, README, inline comments, and changelog entries for changed behavior.
|
|
35
|
+
- **integration** — caller/contract impact (use the kit's `context` callers), module-boundary and convention conformance, and whether the change breaks consumers.
|
|
36
|
+
- **scope-creep** — **only when** `spec-content` is not `none`: confirm Scope's `preliminary-scope-creep` candidates with severity, and detect any further changes beyond the requirements. When `spec-content: none`, record this category as **skipped** with the note `skipped (no requirements)` and emit no scope-creep findings (Review does not invent requirements).
|
|
37
|
+
|
|
38
|
+
Optionally run the available tools captured in `tool-inventory` (linters / type-checkers / the test suite) to **corroborate** a finding — but tools are corroborative, not authoritative: a finding must be warranted by the change, not by a pre-existing repo-wide condition outside the change boundary.
|
|
39
|
+
|
|
40
|
+
### Step 2: Assign Severity
|
|
41
|
+
|
|
42
|
+
For each finding, assign a severity per **[severity-rubric.md](../references/severity-rubric.md)** (authoritative) — Analyze assigns; it does not re-encode the rubric:
|
|
43
|
+
|
|
44
|
+
- **blocker** — must fix before merge: a security hole, data-loss risk, a broken core flow, or a regression in a green-baseline suite.
|
|
45
|
+
- **major** — should fix: a significant quality / test / integration issue that will cause maintenance pain.
|
|
46
|
+
- **minor** — nice to fix: a small quality or documentation issue.
|
|
47
|
+
- **nit** — style / preference; optional.
|
|
48
|
+
|
|
49
|
+
If a finding's severity is borderline, default to the **lower** severity (do not over-escalate); Report derives the approval status from the tallies.
|
|
50
|
+
|
|
51
|
+
### Step 3: Attach a Requirement Trace or a Scope-Creep Flag
|
|
52
|
+
|
|
53
|
+
Every finding must carry either a **requirement trace** or a **scope-creep flag** (the orchestrator's gate #5 requires this):
|
|
54
|
+
|
|
55
|
+
1. **Requirement trace** — for findings inside the intended scope: reference the requirement/expected-behavior from `spec-content` the finding relates to (by criterion id or short label). Format: `trace: <criterion>` (or `trace: general-quality` for quality findings that are not tied to a specific criterion but are within the change's intent — acceptable as a trace).
|
|
56
|
+
2. **Scope-creep flag** — for findings the change **goes beyond** the requirements: set `scope-creep: true` (no requirement trace). These findings describe the creep, not a defect in the intended change. When `spec-content: none`, all findings carry `trace: no-requirements` (scope-creep cannot be assessed) — never `scope-creep: true` without a spec.
|
|
57
|
+
|
|
58
|
+
This makes the findings set self-describing for Report's scope-creep summary and approval derivation.
|
|
59
|
+
|
|
60
|
+
### Step 4: Optionally Run Tools to Corroborate
|
|
61
|
+
|
|
62
|
+
When a finding would be strengthened by tool evidence, run the relevant configured tool from `tool-inventory`:
|
|
63
|
+
|
|
64
|
+
- Re-run the **test suite** to confirm a claimed regression (Analyze runs the changed file's covering tests, or the targeted suite) — record the result as corroboration on the finding.
|
|
65
|
+
- Run a **linter / type-checker** on the changed files to surface corroborated quality/security issues; attach the tool output (message + rule id) to the finding.
|
|
66
|
+
|
|
67
|
+
Tools never **create** a finding on their own outside the change boundary; they only corroborate an already-warranted finding or sharpen its severity. If a tool is unconfigured, proceed without it (Prepare already warned).
|
|
68
|
+
|
|
69
|
+
### Step 5: Aggregate Tallies and Generate the Findings Artifact
|
|
70
|
+
|
|
71
|
+
1. **Aggregate** findings by category and count by severity. Compute preliminary tallies (Report derives the final approval status from these — Analyze does not pre-derive approval).
|
|
72
|
+
2. **Assign an `analyze-id`** per [id-generation.md](../references/id-generation.md) (format `YYYY-MM-DD-NNN-analyze`, saved to `docs/plans/.review/.analyze/`). Reuse it if the user later picks **Edit & Retry**.
|
|
73
|
+
3. Produce a **Findings** block (as markdown) following the schema in [findings.md](../references/templates/artifacts/findings.md). Include:
|
|
74
|
+
- `analyze-id`, inherited `prepare-id`, `scope-id`, `review-id`, `input-shape`, `interactionMode`
|
|
75
|
+
- the findings list: per finding — `id`, `severity`, `category`, `location` (repository-relative `file:line` or `file:hunk`), `message`, `trace` **or** `scope-creep: true`, and an optional non-binding `suggested-fix` (Review is read-only — suggestions are informational, never applied)
|
|
76
|
+
- per-category and per-severity tallies
|
|
77
|
+
- a note whether the scope-creep category ran or was `skipped (no requirements)`
|
|
78
|
+
- `work-id` carried (work-linked only)
|
|
79
|
+
|
|
80
|
+
### Step 6: Present, Confirm, and Save
|
|
81
|
+
|
|
82
|
+
Apply the **[phase confirmation behavior](../references/interaction-mode-propagation.md)** for the current `interactionMode`, using these analyze-specific **Smart pause triggers**:
|
|
83
|
+
|
|
84
|
+
- Any **blocker** finding was detected (pause before auto-continuing to Report), or
|
|
85
|
+
- Any **major** finding was detected (smart mode), or
|
|
86
|
+
- A finding was flagged `scope-creep: true` (confirm the creep is real before finalizing), or
|
|
87
|
+
- The scope-creep category ran and the count of confirmed creep findings differs from Scope's `preliminary-scope-creep` (sanity-check the delta).
|
|
88
|
+
|
|
89
|
+
- **Detailed:** present the Findings and ask one question with options *(1) Proceed to Report, (2) Edit & Retry, (3) Abort*. On **Edit & Retry**, loop back through Steps 1–5 reusing the `analyze-id`. On **Abort**, stop and inform the Orchestrator.
|
|
90
|
+
- **Smart:** pause only when a pause trigger above is true; otherwise auto-proceed.
|
|
91
|
+
- **Autopilot:** auto-proceed (no confirmation).
|
|
92
|
+
|
|
93
|
+
Then save the artifact to `docs/plans/.review/.analyze/<analyze-id>.md` (ensure `interactionMode` included) and return it, with the `interactionMode` value, to the Orchestrator for the transition to Phase 4 (Report).
|
|
94
|
+
|
|
95
|
+
## Output: Findings Artifact
|
|
96
|
+
|
|
97
|
+
- Verify that the Findings are complete and valid: `analyze-id`, `prepare-id`, `scope-id`, `review-id`, `input-shape`, `interactionMode`, the findings list, and the per-category / per-severity tallies.
|
|
98
|
+
- Verify **findings coherence** (orchestrator gate #5): every finding has a `severity`, a `category`, a repository-relative `location`, and either a `trace` or `scope-creep: true`.
|
|
99
|
+
- Verify the **scope-creep** category either ran (with `spec-content` not `none`) or is recorded `skipped (no requirements)` — never silently absent, never inventing requirements.
|
|
100
|
+
- Verify severities were **assigned from** [severity-rubric.md](../references/severity-rubric.md) rather than re-defined inline (no second rubric contradicting the authoritative reference).
|
|
101
|
+
- Verify the category checks were **run from** [review-categories.md](../references/review-categories.md) rather than re-encoded inline.
|
|
102
|
+
- Verify that the artifact is saved to `docs/plans/.review/.analyze/<analyze-id>.md`.
|
|
103
|
+
|
|
104
|
+
> Pass the Findings to `report` (Phase 4) for the approval-status derivation, the report write, and the registry / work-index cross-link.
|