@seanyao/roll 4.630.1 → 4.702.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +74 -0
- package/README.md +65 -55
- package/conventions/global/AGENTS.md +8 -7
- package/dist/roll.mjs +13277 -8746
- package/docs/INDEX.md +32 -0
- package/docs/architecture.md +444 -0
- package/docs/difftest-freeze-paradigm.md +113 -0
- package/docs/live-console.md +203 -0
- package/docs/manifesto.md +65 -0
- package/docs/migration/role-taxonomy-v4.md +60 -0
- package/docs/verification.md +83 -0
- package/guide/INDEX.md +86 -0
- package/guide/assets/layouts/cards-2.png +0 -0
- package/guide/assets/layouts/cards-3.png +0 -0
- package/guide/assets/layouts/cards-4.png +0 -0
- package/guide/assets/layouts/compare.png +0 -0
- package/guide/assets/layouts/highlight.png +0 -0
- package/guide/assets/layouts/pipeline.png +0 -0
- package/guide/assets/layouts/plain.png +0 -0
- package/guide/assets/layouts/quote.png +0 -0
- package/guide/assets/layouts/timeline.png +0 -0
- package/guide/en/acceptance-evidence.md +231 -0
- package/guide/en/ai-agents.md +185 -0
- package/guide/en/backlog-github-sync.md +108 -0
- package/guide/en/changelog.md +66 -0
- package/guide/en/configuration.md +112 -0
- package/guide/en/consistency.md +58 -0
- package/guide/en/conventions.md +113 -0
- package/guide/en/dream.md +121 -0
- package/guide/en/faq.md +855 -0
- package/guide/en/feedback.md +31 -0
- package/guide/en/getting-started.md +103 -0
- package/guide/en/installation.md +86 -0
- package/guide/en/legacy-onboarding.md +195 -0
- package/guide/en/loop-data-layout.md +256 -0
- package/guide/en/loop-driven-architecture.md +186 -0
- package/guide/en/loop.md +1324 -0
- package/guide/en/methodology.md +715 -0
- package/guide/en/migration-2.0.md +154 -0
- package/guide/en/overview.md +190 -0
- package/guide/en/pairing.md +151 -0
- package/guide/en/patterns/README.md +76 -0
- package/guide/en/patterns/graft-pattern.md +110 -0
- package/guide/en/patterns/replant-pattern.md +114 -0
- package/guide/en/patterns/seed-pattern.md +132 -0
- package/guide/en/peer.md +71 -0
- package/guide/en/pr-review.md +62 -0
- package/guide/en/practices/engineering-common-sense.md +395 -0
- package/guide/en/pricing.md +116 -0
- package/guide/en/project-setup.md +126 -0
- package/guide/en/roll-doc-audit.md +98 -0
- package/guide/en/skills.md +206 -0
- package/guide/en/test-isolation.md +51 -0
- package/guide/en/testing/quality-rubric.md +340 -0
- package/guide/en/testing.md +123 -0
- package/guide/en/tools.md +173 -0
- package/guide/skills.md +30 -0
- package/guide/zh/acceptance-evidence.md +194 -0
- package/guide/zh/ai-agents.md +170 -0
- package/guide/zh/backlog-github-sync.md +105 -0
- package/guide/zh/changelog.md +57 -0
- package/guide/zh/configuration.md +99 -0
- package/guide/zh/consistency.md +48 -0
- package/guide/zh/conventions.md +96 -0
- package/guide/zh/dream.md +97 -0
- package/guide/zh/faq.md +773 -0
- package/guide/zh/feedback.md +30 -0
- package/guide/zh/getting-started.md +96 -0
- package/guide/zh/installation.md +83 -0
- package/guide/zh/legacy-onboarding.md +192 -0
- package/guide/zh/loop-data-layout.md +236 -0
- package/guide/zh/loop-driven-architecture.md +186 -0
- package/guide/zh/loop.md +1124 -0
- package/guide/zh/methodology.md +702 -0
- package/guide/zh/migration-2.0.md +154 -0
- package/guide/zh/overview.md +186 -0
- package/guide/zh/pairing.md +117 -0
- package/guide/zh/patterns/README.md +74 -0
- package/guide/zh/patterns/graft-pattern.md +108 -0
- package/guide/zh/patterns/replant-pattern.md +112 -0
- package/guide/zh/patterns/seed-pattern.md +130 -0
- package/guide/zh/peer.md +63 -0
- package/guide/zh/pr-review.md +54 -0
- package/guide/zh/practices/engineering-common-sense.md +393 -0
- package/guide/zh/pricing.md +97 -0
- package/guide/zh/project-setup.md +114 -0
- package/guide/zh/roll-doc-audit.md +90 -0
- package/guide/zh/skills.md +191 -0
- package/guide/zh/test-isolation.md +46 -0
- package/guide/zh/testing/quality-rubric.md +284 -0
- package/guide/zh/testing.md +116 -0
- package/guide/zh/tools.md +173 -0
- package/package.json +4 -1
- package/skills/README.md +1 -0
- package/skills/roll-.qa/SKILL.md +1 -1
- package/skills/roll-.review/SKILL.md +1 -1
- package/skills/roll-build/SKILL.md +1 -1
- package/skills/roll-build/references/full-contract.md +16 -13
- package/skills/roll-design/SKILL.md +3 -3
- package/skills/roll-design/references/full-contract.md +17 -13
- package/skills/roll-fix/SKILL.md +1 -1
- package/skills/roll-fix/references/full-contract.md +13 -10
- package/skills/roll-peer/SKILL.md +1 -1
- package/skills/roll-prime/SKILL.md +77 -0
- package/skills/roll-prime/references/explorer-annex.md +39 -0
- package/skills/roll-prime/references/supervisor-prompt.md +165 -0
- package/skills/route-cases/skills.json +10 -0
- package/template/AGENTS.md +3 -1
|
@@ -0,0 +1,715 @@
|
|
|
1
|
+
# Roll Engineering Methodology: A Standardized AI Agent Delivery Framework
|
|
2
|
+
|
|
3
|
+
> **Version:** 1.0
|
|
4
|
+
> **Date:** 2026-04-15
|
|
5
|
+
> **Status:** Internal Engineering Whitepaper
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Abstract
|
|
10
|
+
|
|
11
|
+
As AI coding assistants evolve from point tools into team infrastructure, engineering organizations face an underappreciated challenge: **inconsistent behavior across AI clients (Claude Code, Antigravity (agy), Cursor, Codex), fragmented environment configuration, and the absence of auditable quality gates on deliverables**. One developer writes code with Claude that passes local tests; another uses Cursor and bypasses those same tests — not because of a capability gap between the models, but because the two received entirely different engineering constraints.
|
|
12
|
+
|
|
13
|
+
Roll is an **instruction and workflow management framework for AI Agents**. It does not invent new methodology. Instead, it encodes proven software engineering practices (Scrum, TDD, TCR, SRE) as standardized, AI-executable Skill definitions, and enforces cross-client configuration consistency through a CLI tool.
|
|
14
|
+
|
|
15
|
+
This document describes Roll's three-loop engineering architecture and its corresponding technical implementation.
|
|
16
|
+
|
|
17
|
+
The name is the design philosophy: Roll (悟空), the shape-shifting trickster, gains discipline from the golden headband (_金箍_) without losing any of his power. Roll the framework takes the same position — AI Agent capability is not diminished by constraint. Standardized constraints are precisely what make that capability composable and transferable at team scale.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## 1. Architecture Overview: Three Interlocking Loops
|
|
22
|
+
|
|
23
|
+
Roll decomposes the software delivery lifecycle into three loops, each independently operable yet mutually reinforcing. Every loop inherits a set of classical methodologies and automates their execution through concrete Skills.
|
|
24
|
+
|
|
25
|
+
```mermaid
|
|
26
|
+
graph TB
|
|
27
|
+
subgraph "Loop A: Design"
|
|
28
|
+
A2["$roll-design<br/>Requirements → INVEST Stories"] --> A3[".roll/backlog.md<br/>Status Index"]
|
|
29
|
+
A3 --> A4[".roll/features/<br/>Acceptance Criteria & Design"]
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
subgraph "Loop B: Implementation & Iteration"
|
|
33
|
+
B1["roll init<br/>CLI Command"] --> B2["$roll-build<br/>TCR-Driven Development"]
|
|
34
|
+
B2 --> B3["$roll-.review<br/>Pre-commit Review"]
|
|
35
|
+
B3 --> B4["CI / Deploy"]
|
|
36
|
+
B4 --> B5["Verification Gate<br/>Live Evidence Required"]
|
|
37
|
+
B5 --> B6["$roll-.changelog<br/>Change Log"]
|
|
38
|
+
B2 -.->|High-risk path| B7["$roll-spar<br/>Adversarial TDD"]
|
|
39
|
+
B7 --> B3
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
subgraph "Loop C: Observability & Maintenance"
|
|
43
|
+
C1["roll status / roll loop cycle / story reports<br/>CLI-first Truth Surface"] --> C2{"Drift or health issue?"}
|
|
44
|
+
C2 -->|Yes| C3["$roll-debug / $roll-doc-audit / $roll-doctor<br/>Diagnostics + Root Cause Analysis"]
|
|
45
|
+
C3 --> C5["$roll-fix / REFACTOR<br/>Correction filed to backlog"]
|
|
46
|
+
C6["$roll-.dream<br/>Nightly Code-Health Scan"] --> C2
|
|
47
|
+
C5 --> C1
|
|
48
|
+
C2 -->|No| C1
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
A4 -->|"Story handoff"| B2
|
|
52
|
+
B6 -->|"Delivery complete"| C1
|
|
53
|
+
C5 -->|"Issue escalation"| A2
|
|
54
|
+
|
|
55
|
+
style A2 fill:#e8f4fd,stroke:#2196F3
|
|
56
|
+
style B2 fill:#e8f5e9,stroke:#4CAF50
|
|
57
|
+
style B7 fill:#fff3e0,stroke:#FF9800
|
|
58
|
+
style C1 fill:#fce4ec,stroke:#F44336
|
|
59
|
+
style C3 fill:#fce4ec,stroke:#F44336
|
|
60
|
+
style C5 fill:#fce4ec,stroke:#F44336
|
|
61
|
+
style C6 fill:#fce4ec,stroke:#F44336
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
How the three loops interact:
|
|
65
|
+
|
|
66
|
+
- **Loop A → Loop B**: User Stories produced by the design loop flow into the implementation loop as execution units.
|
|
67
|
+
- **Loop B → Loop C**: Each delivery feeds the truth ledger, so the maintenance loop sees shipped / in-progress / queue / truth drift / release readiness as facts.
|
|
68
|
+
- **Loop C → Loop A**: Drift or code-health issues surfaced by the observability surfaces become `FIX-XXX` / `REFACTOR-XXX` entries; anything beyond a quick fix escalates back to the design loop for reassessment.
|
|
69
|
+
|
|
70
|
+
**Optional autonomous layer** (enabled via `roll loop on`): `roll-loop` executes pending BACKLOG items on a configurable schedule; `roll-.dream` scans code health nightly and produces `REFACTOR` entries. The human reads CLI-first surfaces (`roll status`, `roll loop watch`, `roll loop cycle`, alerts, and story reports). The human retains sole authority over `roll-release`. See §9 for details.
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## 2. Global Configuration Management (Configuration Infrastructure)
|
|
75
|
+
|
|
76
|
+
### 2.1 The Problem
|
|
77
|
+
|
|
78
|
+
In environments where multiple AI clients coexist, each client has its own configuration entry point (Claude reads `CLAUDE.md`, agy reads `GEMINI.md`). Maintaining these files manually leads to:
|
|
79
|
+
|
|
80
|
+
- **Behavioral drift**: Different AI clients on the same project enforce different coding standards.
|
|
81
|
+
- **Fragmented configuration**: Engineering constraints scattered across multiple locations, with updates prone to gaps.
|
|
82
|
+
- **Cross-project inconsistency**: New projects cannot inherit the organization's engineering standards.
|
|
83
|
+
|
|
84
|
+
### 2.2 Technical Implementation
|
|
85
|
+
|
|
86
|
+
Roll uses the `roll` CLI to centralize configuration management and distribute it atomically.
|
|
87
|
+
|
|
88
|
+
**2.2.1 Skill Mounting (`roll setup`)**
|
|
89
|
+
|
|
90
|
+
On first run, the CLI performs two operations:
|
|
91
|
+
|
|
92
|
+
1. **Establish a Single Source of Truth**: Copies global conventions (`conventions/global/`) and skill definitions (`skills/`) from the repository into `~/.roll/`, making it the sole authoritative configuration source on the machine.
|
|
93
|
+
2. **Per-skill symlinks**: Creates individual symlinks for each `roll-*` skill into each AI client's skills directory (`~/.claude/skills/roll-*`, `~/.gemini/skills/roll-*`, etc.). Existing user skills are untouched — Roll skills are added alongside.
|
|
94
|
+
|
|
95
|
+
Setup never modifies any AI tool configuration files or global git settings. It is fully non-invasive and safe to re-run.
|
|
96
|
+
|
|
97
|
+
**2.2.2 Configuration Sync (rolled into `roll setup` — one command for everything)**
|
|
98
|
+
|
|
99
|
+
Distributes content from `~/.roll/` to each AI client's configuration path — conventions and skills in one step.
|
|
100
|
+
|
|
101
|
+
- **Conventions**: uses `@include` append mode — writes Roll conventions to `{ai_dir}/roll.md`, then appends a single `@roll.md` line to the user's main config. Existing content is never overwritten.
|
|
102
|
+
- **Skills**: refreshes skills from the repo into the local cache and creates/repairs per-skill symlinks for each client.
|
|
103
|
+
|
|
104
|
+
Append `--force` (or `-f`) to force-rewrite `roll.md` or rebuild symlinks.
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
~/.roll/conventions/global/
|
|
108
|
+
├── AGENTS.md → ~/.kimi/roll.md (+ @roll.md appended to AGENTS.md)
|
|
109
|
+
├── CLAUDE.md → ~/.claude/roll.md (+ @roll.md appended to CLAUDE.md)
|
|
110
|
+
├── GEMINI.md → ~/.gemini/roll.md (+ @roll.md appended to GEMINI.md)
|
|
111
|
+
└── project_rules.md → (project-level distribution)
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
**2.2.3 Project-Level Configuration (`roll init`)**
|
|
115
|
+
|
|
116
|
+
`roll init` first diagnoses the current directory, then chooses the safest
|
|
117
|
+
adoption path:
|
|
118
|
+
|
|
119
|
+
- **Seed**: create `AGENTS.md` + `.roll/` as a minimal starting point and show
|
|
120
|
+
the next design/backlog step.
|
|
121
|
+
- **PRD-only**: preserve the requirement/brief as the source of truth and route
|
|
122
|
+
to design.
|
|
123
|
+
- **Existing codebase**: route to onboard diagnosis and an apply checkpoint
|
|
124
|
+
before writing project changes.
|
|
125
|
+
|
|
126
|
+
For **existing projects** (AGENTS.md already present), `roll init` re-merges the global conventions section-by-section, preserving all existing project-specific content.
|
|
127
|
+
|
|
128
|
+
Project-type templates (`conventions/templates/`) still exist as **reference material for skills** — `$roll-build` and `$roll-design` read them to infer conventions for a given project type. Users no longer select a type at init time.
|
|
129
|
+
|
|
130
|
+
### 2.3 Configuration Hierarchy
|
|
131
|
+
|
|
132
|
+
```
|
|
133
|
+
Organization (Global) ← Coding standards, Git discipline, TCR workflow, test standards
|
|
134
|
+
↓ roll init (direct copy, no type selection)
|
|
135
|
+
Project Instance ← AGENTS.md (constraints) + .claude/CLAUDE.md (client config)
|
|
136
|
+
(skills infer type from existing files)
|
|
137
|
+
Project Type (Template) ← Reference only — consulted by $roll-build / $roll-design at runtime
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## 3. Loop A: Product Definition and Requirements Design
|
|
143
|
+
|
|
144
|
+
### 3.1 Methodology Inheritance
|
|
145
|
+
|
|
146
|
+
| Classical Methodology | Roll Implementation |
|
|
147
|
+
|----------------------|--------------------|
|
|
148
|
+
| BDD (Behavior-Driven Development) | `$roll-design`: Requirements expressed as Acceptance Criteria |
|
|
149
|
+
| Scrum Backlog | `.roll/backlog.md` + `.roll/features/`: Two-tier index structure |
|
|
150
|
+
| INVEST Principles | Mandatory constraints on Story decomposition |
|
|
151
|
+
|
|
152
|
+
### 3.2 From Idea to BACKLOG: `$roll-design`
|
|
153
|
+
|
|
154
|
+
Translates raw ideas and business requirements into executable instruction contracts. The journey from an undeveloped thought to a BACKLOG Story follows a staged, gate-controlled flow:
|
|
155
|
+
|
|
156
|
+
```
|
|
157
|
+
Clarify → Discuss → [peer: direction] → Analyze+DDD → Design → [peer: plan] → Split → Write
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
**Clarify** — When input is vague, `$roll-design` summarizes intent, assesses complexity, and asks 3–5 targeted questions. Nothing proceeds until the scope is clear.
|
|
161
|
+
|
|
162
|
+
**Discuss** — When the approach is uncertain, the skill enters a multi-turn conversation. It leads with an opinionated recommendation rather than a full comparison menu, follows the user's thread when they want to dig into a specific option, and explicitly surfaces hidden assumptions. The discussion runs as many rounds as needed. When a direction crystallizes, the skill names the conclusion and asks — *"Continue to solution design, or keep exploring?"* — then waits for an explicit answer before moving on.
|
|
163
|
+
|
|
164
|
+
**Direction Review** (`$roll-peer`, optional) — For large-scope or cross-context decisions, a peer agent challenges the chosen direction before any DDD modeling begins. 10-second opt-out window. On REFINE/OBJECT, the discussion resumes.
|
|
165
|
+
|
|
166
|
+
**Analyze + DDD** — Scope is assessed and DDD depth is calibrated automatically: full Event Storming for greenfield projects, a Domain Slice for new features, a Domain Tag for bug fixes.
|
|
167
|
+
|
|
168
|
+
**Solution Design** — Architecture and module decomposition written to `.roll/features/<feature>-plan.md`. Greenfield Tactical Models (Aggregates, Entities, Invariants, Domain Events) written to `.roll/domain/`.
|
|
169
|
+
|
|
170
|
+
**Plan Review** (`$roll-peer`, optional) — For large-scope work, a peer agent reviews the complete plan before Stories are split. Same opt-out behavior.
|
|
171
|
+
|
|
172
|
+
**Split + Write** — The plan is decomposed into INVEST-compliant User Stories, written to `.roll/features/<feature>.md` with full AC, and indexed in `.roll/backlog.md`. The human confirms before `$roll-build` is invoked.
|
|
173
|
+
|
|
174
|
+
The core output is User Stories that conform to the **INVEST principles**:
|
|
175
|
+
|
|
176
|
+
| Principle | Requirement |
|
|
177
|
+
|-----------|-------------|
|
|
178
|
+
| **I**ndependent | Each Story can be delivered independently with no cross-dependencies |
|
|
179
|
+
| **N**egotiable | Defines acceptance criteria, not implementation details |
|
|
180
|
+
| **V**aluable | Each Story delivers perceptible user value |
|
|
181
|
+
| **E**stimable | Implementation scope is assessable; Action granularity is 2–5 minutes |
|
|
182
|
+
| **S**mall | A single Story can be completed within one session cycle |
|
|
183
|
+
| **T**estable | Each Story includes verifiable acceptance criteria |
|
|
184
|
+
|
|
185
|
+
> **Scenario**: A product manager says "admins should be able to see everyone's activity logs." During Discuss, the skill asks: "Is this for compliance or operational monitoring? That changes whether we need tamper-proof storage." After direction is confirmed, `$roll-design` decomposes the requirement into three independent Stories: US-007 (write audit events), US-008 (audit list UI with filtering), and US-009 (export audit data as CSV).
|
|
186
|
+
>
|
|
187
|
+
> Each Story carries its own acceptance criteria — US-007's AC includes "create/delete/modify operations all generate audit events" and "events include actor ID, timestamp, and change diff." The export capability, which was buried implicitly in the original requirement, is surfaced as an explicit standalone Story rather than hidden in implementation details.
|
|
188
|
+
|
|
189
|
+
### 3.3 Management Artifacts: Two-Tier Index Structure
|
|
190
|
+
|
|
191
|
+
**`.roll/backlog.md` (status index)** — the project's central state machine. Contains only Story ID, title, and status summary; implementation details are excluded:
|
|
192
|
+
|
|
193
|
+
```markdown
|
|
194
|
+
## Stories
|
|
195
|
+
| ID | Title | Status |
|
|
196
|
+
|--------|----------------------|--------|
|
|
197
|
+
| US-001 | User login | ✅ Done |
|
|
198
|
+
| US-002 | Role-based access | 🔨 In Progress |
|
|
199
|
+
| US-003 | Audit logging | 📋 Ready |
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
**`.roll/features/` (detailed design)** — each Story has two dedicated documents:
|
|
203
|
+
|
|
204
|
+
- `<feature>.md`: Full User Story including the Acceptance Criteria checklist.
|
|
205
|
+
- `<feature>-plan.md`: Technical design document with architectural decisions and implementation approach.
|
|
206
|
+
|
|
207
|
+
This separation keeps `.roll/backlog.md` concise and readable as a progress dashboard, while detailed design lives in a dedicated location.
|
|
208
|
+
|
|
209
|
+
> **Design principle — Markdown as Code**: In Roll, `.roll/backlog.md` and `.roll/features/` are not documentation artifacts generated after development — they are the planning input that drives development. A Story does not exist until it has a Markdown file. A Story is not delivered until merge evidence on `main` and Verification Gate evidence both exist. The file system is the durable planning record; truth projections reconcile it with git and evidence anchors.
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## 4. Loop B: Automated Implementation and Continuous Integration
|
|
214
|
+
|
|
215
|
+
### 4.1 Methodology Inheritance
|
|
216
|
+
|
|
217
|
+
| Classical Methodology | Roll Implementation |
|
|
218
|
+
|----------------------|--------------------|
|
|
219
|
+
| TDD (Test-Driven Development) | Tests written first; RED → GREEN → Refactor |
|
|
220
|
+
| TCR (Test && Commit ∥ Revert) | `$roll-build`: commit on pass, revert on failure |
|
|
221
|
+
| DevOps / CI-CD | Objective arbitration layer: CI is the final authority on "deliverable"; minute-level feedback loops compress defect discovery cost |
|
|
222
|
+
| Defensive Programming | `$roll-spar`: adversarial TDD for high-risk paths |
|
|
223
|
+
|
|
224
|
+
### 4.2 Project Initialization: `roll init`
|
|
225
|
+
|
|
226
|
+
Diagnoses the current directory before choosing a path — see the adoption patterns ([patterns/](patterns/README.md)):
|
|
227
|
+
|
|
228
|
+
- **Seed** (empty dir): create `AGENTS.md` + `.roll/` as a minimal starting point
|
|
229
|
+
and show the next design/backlog step.
|
|
230
|
+
- **PRD-only** (requirements docs, no source): preserve the requirement/brief as
|
|
231
|
+
the source of truth and point to design as the new-project path.
|
|
232
|
+
- **Graft** (existing code, no `.roll/`): surfaces `$roll-onboard`, which scans the code, asks a short clarification set, and writes `.roll/init-diagnosis.yaml` plus `.roll/onboard-plan.yaml` for review; `roll init --apply` then prints a planned-operation checkpoint, waits for confirmation before writing, and hands back to `roll next` — see [legacy-onboarding.md](legacy-onboarding.md).
|
|
233
|
+
- **Roll-ready / partial / pre-2.0 Roll**: print `roll status`, `roll init --repair`, or migration guidance without fresh-scaffolding over existing Roll markers.
|
|
234
|
+
|
|
235
|
+
Pre-2.0 projects (`BACKLOG.md` at root, `docs/features/`) should run `npx @seanyao/roll@2 migrate` first — see [migration-2.0.md](migration-2.0.md).
|
|
236
|
+
|
|
237
|
+
**What `roll init` creates:**
|
|
238
|
+
|
|
239
|
+
```
|
|
240
|
+
my-project/
|
|
241
|
+
├── AGENTS.md # Engineering constraints (from global conventions)
|
|
242
|
+
└── .roll/
|
|
243
|
+
├── backlog.md # Task index
|
|
244
|
+
├── features/ # Story details & design documents
|
|
245
|
+
└── domain/ # DDD models, context map
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
Three files. Under 5 seconds. Run `roll setup` again to distribute conventions and skills to AI tool configs.
|
|
249
|
+
|
|
250
|
+
**Existing project (re-merge):**
|
|
251
|
+
|
|
252
|
+
When `AGENTS.md` already exists, `roll init` re-merges the global conventions section-by-section — adding any new sections from the global template while preserving all existing project-specific content.
|
|
253
|
+
|
|
254
|
+
**Project structure is inferred, not declared:**
|
|
255
|
+
|
|
256
|
+
Directory structure (`src/`, `api/`, `cmd/`, etc.) is created **on demand** by `$roll-build` and `$roll-design` as Stories are executed. Skills read existing project files (`package.json`, `go.mod`, directory layout) to infer conventions — the right structure emerges from evidence, not from an upfront type declaration.
|
|
257
|
+
|
|
258
|
+
Project-type templates (`conventions/templates/fullstack/`, `cli/`, etc.) remain available as reference material for skills to consult.
|
|
259
|
+
|
|
260
|
+
### 4.3 TCR-Driven Development: `$roll-build`
|
|
261
|
+
|
|
262
|
+
This is Roll's core execution unit. Its engineering significance lies in a fundamental shift: **correctness is not determined by the AI's own assertions, but exclusively by the pass/fail status of automated tests**.
|
|
263
|
+
|
|
264
|
+
**TCR (Test && Commit || Revert) execution flow:**
|
|
265
|
+
|
|
266
|
+
```
|
|
267
|
+
┌─────────────────────────────────────────────────────┐
|
|
268
|
+
│ TCR Micro-Step │
|
|
269
|
+
├─────────────────────────────────────────────────────┤
|
|
270
|
+
│ │
|
|
271
|
+
│ 1. Write failing test (RED) │
|
|
272
|
+
│ │ │
|
|
273
|
+
│ ▼ │
|
|
274
|
+
│ 2. Write minimal code to pass (GREEN) │
|
|
275
|
+
│ │ │
|
|
276
|
+
│ ▼ │
|
|
277
|
+
│ 3. Run tests ──── FAIL? ──── Revert changes │
|
|
278
|
+
│ │ │
|
|
279
|
+
│ PASS │
|
|
280
|
+
│ │ │
|
|
281
|
+
│ ▼ │
|
|
282
|
+
│ 4. $roll-.review (self-review gate) │
|
|
283
|
+
│ │ │
|
|
284
|
+
│ ▼ │
|
|
285
|
+
│ 5. git commit (micro-commit) │
|
|
286
|
+
│ │ │
|
|
287
|
+
│ └──── Back to Step 1, next Action │
|
|
288
|
+
│ │
|
|
289
|
+
└─────────────────────────────────────────────────────┘
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
Each Action is constrained to **2–5 minutes** of scope. The engineering rationale for this constraint:
|
|
293
|
+
|
|
294
|
+
- **Near-zero rollback cost**: Any failure discards at most a few minutes of work.
|
|
295
|
+
- **Errors do not compound**: Failing logic cannot be depended on by subsequent code, preventing hidden debt from accumulating in the codebase.
|
|
296
|
+
- **Observable progress**: The micro-commit sequence is itself a real-time record of delivery progress.
|
|
297
|
+
|
|
298
|
+
**The complete delivery pipeline** — `$roll-build` does not stop at local tests passing. It requires completing the full end-to-end delivery chain:
|
|
299
|
+
|
|
300
|
+
```
|
|
301
|
+
TCR Micro-commits → git push → CI Pass → Deploy → Verification Gate
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
The **Verification Gate** is the final checkpoint: it requires **live evidence** (test output screenshots, curl responses, browser screenshots). The AI's own assertions ("I confirmed it works") are not accepted.
|
|
305
|
+
|
|
306
|
+
That evidence now crystallizes into a per-story acceptance report — see [Acceptance Evidence (`roll attest`)](acceptance-evidence.md): per-AC verdicts, the no-evidence red line, and a single offline HTML non-engineers can audit.
|
|
307
|
+
|
|
308
|
+
> **Scenario**: Executing US-007 (write audit events).
|
|
309
|
+
>
|
|
310
|
+
> Action 1: Write a RED test for `AuditService.record()` asserting that task creation triggers an audit write → implement minimal code → GREEN → code-review passes → `tcr: audit event on task create`.
|
|
311
|
+
>
|
|
312
|
+
> Action 2: Write a RED test for delete operations → discover `TaskService.delete()` is missing a hook injection point → add the implementation → GREEN → commit.
|
|
313
|
+
>
|
|
314
|
+
> 4 micro-commits total, zero manual intervention throughout. CI triggers all GREEN, auto-deploys to staging. Verification Gate collects evidence: `curl /api/audit` returns the correct event list, screenshot archived, US-007 closed.
|
|
315
|
+
|
|
316
|
+
**Mechanical TCR enforcement** — The TCR contract is enforced by a pre-commit hook, not by convention alone. When `npm test` passes, the test runner writes a proof-of-pass record containing a Unix timestamp and the current working tree hash (`git write-tree`). Before any commit, the hook verifies two conditions: (1) the proof is no older than 60 seconds, and (2) the tree hash matches the current working tree. If either fails, the commit is blocked. This makes it physically impossible to commit untested code — rewriting commit messages after the fact cannot bypass it because the working tree hash would no longer match.
|
|
317
|
+
|
|
318
|
+
### 4.4 Continuous Integration / Continuous Delivery: The Fast Feedback Infrastructure
|
|
319
|
+
|
|
320
|
+
CI/CD is not an "add-on" to Roll — it is the **objective arbitration layer** for all of Loop B. Passing tests locally is a necessary condition, not a sufficient one. Local environments carry implicit dependencies, uncommitted state, and machine-specific configuration. CI re-executes the same code in a clean, deterministic environment, making it the final authority on whether something is truly deliverable.
|
|
321
|
+
|
|
322
|
+
**4.4.1 CI as Objective Arbiter**
|
|
323
|
+
|
|
324
|
+
TCR promises "commit on passing tests," but that promise only holds once it is validated at the CI layer:
|
|
325
|
+
|
|
326
|
+
```
|
|
327
|
+
Local GREEN ≠ Deliverable
|
|
328
|
+
CI GREEN = Deliverable
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
CI's scope extends beyond running the test suite — it is a complete quality gate sequence:
|
|
332
|
+
|
|
333
|
+
| Check | Purpose |
|
|
334
|
+
|-------|---------|
|
|
335
|
+
| **Lint / Type Check** | Coding standards and type safety; prevents low-grade errors from reaching the main branch |
|
|
336
|
+
| **Unit & Integration Tests** | Regression assurance for business logic; corroborates local TCR results |
|
|
337
|
+
| **Coverage Gate** | Enforces coverage thresholds; prevents test debt accumulation |
|
|
338
|
+
| **Build Artifact** | Confirms the build artifact can be generated; rules out dependency resolution issues |
|
|
339
|
+
| **E2E Smoke** | Smoke validation of critical paths in a real environment |
|
|
340
|
+
|
|
341
|
+
If any check fails, the deployment pipeline halts automatically. There is no "deploy first, fix tests later" path.
|
|
342
|
+
|
|
343
|
+
**4.4.2 The Engineering Value of Fast Feedback Loops**
|
|
344
|
+
|
|
345
|
+
The later a defect is discovered, the more expensive it is to fix — this is not folk wisdom, it is an empirically supported engineering finding. A bug caught within 5 minutes of commit costs roughly the same as initial development to fix. Caught in a test environment, the cost multiplies by 10. Caught in production, by 100.
|
|
346
|
+
|
|
347
|
+
Roll's TCR + CI combination compresses the feedback window to **minutes**:
|
|
348
|
+
|
|
349
|
+
```
|
|
350
|
+
micro-commit (2–5 min granularity)
|
|
351
|
+
→ git push (immediate)
|
|
352
|
+
→ CI triggered (seconds)
|
|
353
|
+
→ result returned (minutes)
|
|
354
|
+
→ problem localized (to this exact commit)
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
The micro-step granularity constraint (2–5 min/Action) delivers a second benefit here: when CI fails, the amount of code to triage is minimal, and the root cause is almost always immediately obvious.
|
|
358
|
+
|
|
359
|
+
**4.4.3 The CI Pipeline and the Truth Ledger**
|
|
360
|
+
|
|
361
|
+
A Roll project's CI pipeline is triggered on every push / PR:
|
|
362
|
+
|
|
363
|
+
```
|
|
364
|
+
.github/workflows/
|
|
365
|
+
└── ci.yml # Triggered on every push / PR
|
|
366
|
+
# Runs the complete quality gate sequence
|
|
367
|
+
# GREEN → unlocks CD deployment permission
|
|
368
|
+
# Records the run into the truth ledger
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
Every CI run is recorded into the same truth ledger that Loop C reads from. That is the infrastructure-level unity across all three loops: Loop C's observability surfaces (`roll status`, `roll loop cycle`, story reports, truth signals) are projections of the same delivery facts CI produces — not a separate monitoring system bolted on top.
|
|
372
|
+
|
|
373
|
+
**4.4.4 The CD and Verification Gate Dependency Chain**
|
|
374
|
+
|
|
375
|
+
The Verification Gate (live evidence acceptance) sits at the very end of Loop B, and its existence depends on a successful CD deployment:
|
|
376
|
+
|
|
377
|
+
```
|
|
378
|
+
CI PASS
|
|
379
|
+
→ CD: deploy to target environment
|
|
380
|
+
→ Verification Gate: collect evidence from the deployed version
|
|
381
|
+
→ screenshots / curl responses / test output
|
|
382
|
+
→ Story closed
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
Without CD there is no verifiable target, rendering the Verification Gate meaningless. This dependency chain ensures that **Story closure evidence must come from the live production environment, not a local simulation**.
|
|
386
|
+
|
|
387
|
+
---
|
|
388
|
+
|
|
389
|
+
### 4.5 Cross-Agent Code Review: `$roll-peer`
|
|
390
|
+
|
|
391
|
+
`$roll-peer` implements bilateral negotiation-style code review across AI clients. Supports arbitrary pairing between Claude, Kimi, DeepSeek, and Codex.
|
|
392
|
+
|
|
393
|
+
How it works: the initiating agent submits a change summary and diff; the receiving agent independently reviews and issues an APPROVE / REFINE / OBJECT verdict. REFINE triggers revision and re-review; OBJECT escalates to discussion. The `$roll-peer` skill owns the multi-round protocol; the TS-native adapter records structured reviewer facts in `.roll/peer/runs.jsonl` plus transcripts.
|
|
394
|
+
|
|
395
|
+
Automatic trigger: `$roll-design` optionally invokes `$roll-peer` during direction review and plan review phases, where a different agent challenges the chosen direction or complete plan.
|
|
396
|
+
|
|
397
|
+
### 4.6 Adversarial TDD: `$roll-spar`
|
|
398
|
+
|
|
399
|
+
For high-risk paths — authorization, payments, data integrity — standard TDD coverage is insufficient. Tests and implementation are written by the same Agent, creating cognitive blind spots. `$roll-spar` introduces an adversarial mechanism:
|
|
400
|
+
|
|
401
|
+
| Role | Responsibility | Constraint |
|
|
402
|
+
|------|---------------|------------|
|
|
403
|
+
| **Attacker** | Writes test cases designed to break the system | May not write any implementation code |
|
|
404
|
+
| **Defender** | Writes the minimal code to make tests pass | May not modify the Attacker's tests |
|
|
405
|
+
|
|
406
|
+
The adversarial cycle continues until the Attacker cannot produce a new RED test for two consecutive rounds, or all predefined scenarios are covered (maximum 5 rounds). Each round's results are committed independently, keeping the adversarial process fully traceable.
|
|
407
|
+
|
|
408
|
+
Automatic trigger signals: when a Story touches authentication/authorization, payment/billing, data integrity validation, complex state machines, or historically high-defect modules, `$roll-build` automatically routes the Action to `$roll-spar`.
|
|
409
|
+
|
|
410
|
+
> **Scenario**: US-010 (organization member permission changes) triggers the `$roll-spar` auto-route.
|
|
411
|
+
>
|
|
412
|
+
> The Attacker's first round produces 3 RED tests: a regular member escalating privileges to modify another's role, whether an admin can continue operating after demoting themselves, and concurrent requests simultaneously modifying the same user's role. After the Defender implements passing code for all three, the Attacker's second round adds: if a role change succeeds at the DB level but the notification fails, does the permission atomically roll back?
|
|
413
|
+
>
|
|
414
|
+
> On round three, the Attacker cannot produce any new RED tests — the adversarial session ends. Test coverage on the permission module rises from the typical TDD baseline of 71% to 93%.
|
|
415
|
+
|
|
416
|
+
### 4.7 Delivery Traceability
|
|
417
|
+
|
|
418
|
+
After each successful deployment, two mechanisms ensure deliverables remain traceable:
|
|
419
|
+
|
|
420
|
+
- **`$roll-.changelog`**: Automatically extracts completed Stories from `.roll/backlog.md`, filters out internal technical details, and generates a user-facing changelog.
|
|
421
|
+
- **`Co-Authored-By` trailer (AI source tagging)**: AI tools (Claude Code, Codex, Cursor, etc.) natively append a `Co-Authored-By: <Model> <email>` trailer on commit. In multi-Agent workflows, `git log` shows the actual executor of every commit at a glance.
|
|
422
|
+
|
|
423
|
+
---
|
|
424
|
+
|
|
425
|
+
## 5. Loop C: Observability and Maintenance
|
|
426
|
+
|
|
427
|
+
Loop C is observability and maintenance: status, cycle trace, story reports, debug/doc/doctor, dream code-health scans, and truth signals feed corrections back into the backlog.
|
|
428
|
+
|
|
429
|
+
### 5.1 Methodology Inheritance
|
|
430
|
+
|
|
431
|
+
| Classical Methodology | Roll Implementation |
|
|
432
|
+
|----------------------|--------------------|
|
|
433
|
+
| SRE (Site Reliability Engineering) | `roll status` / `roll loop cycle` / story reports: delivery truth surface from a single ledger |
|
|
434
|
+
| Observability | CLI-first truth signals (`roll loop watch`, `roll loop status`, cycle traces, release readiness) |
|
|
435
|
+
| Continuous maintenance | `$roll-.dream`: nightly code-health scans that file `REFACTOR-XXX` entries |
|
|
436
|
+
| Digital Forensics + RCA | `$roll-debug` / `$roll-doc-audit` / `$roll-doctor`: project-owned diagnostics, documentation, and toolchain health |
|
|
437
|
+
|
|
438
|
+
### 5.2 Delivery Truth Surface: CLI-first status, cycle trace, and story reports
|
|
439
|
+
|
|
440
|
+
Loop C is not production patrol. It is the mature delivery-control surface: it reads from a single truth ledger and presents shipped / in-progress / queue / truth drift / release readiness as **facts**, not assertions.
|
|
441
|
+
|
|
442
|
+
**The observability surfaces:**
|
|
443
|
+
|
|
444
|
+
| Surface | What it shows |
|
|
445
|
+
|---------|--------------|
|
|
446
|
+
| `roll status` | Sync status, skill links, detected AI tools, and the live delivery state |
|
|
447
|
+
| `roll loop watch` | Live ActivitySignal stream for the current cycle |
|
|
448
|
+
| `roll loop cycle <id>` | One cycle's trace tape, PR/diff pointers, and evidence links |
|
|
449
|
+
| Story attest report | The Story's own AC map, screenshots, command artifacts, and verdicts |
|
|
450
|
+
| Truth signals | release readiness, `roll loop status`, and machine-readable event facts |
|
|
451
|
+
|
|
452
|
+
**Truth drift** — these surfaces reconcile the planning record (`.roll/backlog.md`, `.roll/features/`) against git history and acceptance evidence. When a Story is marked Done but lacks merge evidence on `main` or Verification Gate evidence, that mismatch shows up as drift rather than passing silently.
|
|
453
|
+
|
|
454
|
+
**Corrections feed back to the backlog** — anything the surfaces reveal as a problem becomes a `FIX-XXX` or `REFACTOR-XXX` entry that re-enters the loop. Loop C → Loop A: anything beyond a quick fix escalates to design.
|
|
455
|
+
|
|
456
|
+
> **Scenario**: Following the TaskFlow v1.3 release, the owner runs `roll status` and opens the US-007 story report. The status output shows a truth-drift flag: the latest acceptance evidence captured `GET /api/audit` returning audit events with an empty `timestamp` field, which contradicts US-007's AC ("events include a timestamp"). At the same time, the most recent `$roll-.dream` nightly scan flagged the serialization layer as a code-health hot spot after the v1.3 ORM upgrade.
|
|
457
|
+
>
|
|
458
|
+
> The drift is real, so `FIX-012: audit event timestamp is null` is filed to the Backlog. On the next loop cycle it is routed to `$roll-fix`, and the release-readiness signal stays red until the fix lands.
|
|
459
|
+
|
|
460
|
+
### 5.3 Automated Forensics and Root Cause Diagnosis: `$roll-debug`
|
|
461
|
+
|
|
462
|
+
A Playwright-based end-to-end debugger supporting two operating modes:
|
|
463
|
+
|
|
464
|
+
- **Native mode**: The target page has integrated the Black Box (BB) SDK; diagnostic data is collected directly via the SDK interface.
|
|
465
|
+
- **Universal mode**: No integration required on the target page; Playwright injects a collection script, enabling forensics on any web page.
|
|
466
|
+
|
|
467
|
+
Data dimensions collected automatically:
|
|
468
|
+
|
|
469
|
+
| Dimension | Collected Data |
|
|
470
|
+
|-----------|---------------|
|
|
471
|
+
| Console | Error logs, warnings, uncaught exceptions |
|
|
472
|
+
| Network | Request/response payloads, failed requests, slow requests |
|
|
473
|
+
| DOM | Page structure, render state, presence of critical elements |
|
|
474
|
+
| Performance | Load times, resource timing, interaction latency |
|
|
475
|
+
| Screenshot | Visual snapshot of the current page state |
|
|
476
|
+
|
|
477
|
+
After collection, `$roll-debug` performs structured multi-dimensional analysis (content state, network failures, DOM rendering anomalies, performance bottlenecks), outputting diagnostic conclusions and remediation recommendations.
|
|
478
|
+
|
|
479
|
+
> **Scenario (cont.)**: `$roll-debug` runs forensics on the audit list page. The Network dimension captures `GET /api/audit` returning 200 but with `timestamp` as `null`; the Console dimension simultaneously shows `[warn] AuditEvent serializer: missing timestamp`.
|
|
480
|
+
>
|
|
481
|
+
> `$roll-debug` consumes the diagnostic JSON and isolates the root cause: the v1.3 ORM upgrade introduced a field alias change that was not reflected in the serialization layer, breaking the `created_at` → `timestamp` mapping. The fix direction is clear; handed off to `$roll-fix`.
|
|
482
|
+
|
|
483
|
+
### 5.4 Regression Repair: `$roll-fix`
|
|
484
|
+
|
|
485
|
+
Executes a fix for a single issue — lighter-weight than `$roll-build`, but held to the same quality standards:
|
|
486
|
+
|
|
487
|
+
- **Mandatory regression tests**: Every fix patch must include a regression test case targeting the specific issue, preventing recurrence.
|
|
488
|
+
- **Scope constraint**: One Fix handles one issue. If the fix reveals a scope wider than expected, it escalates to a User Story and re-enters Loop A.
|
|
489
|
+
- **Same quality gates**: Verification Gate, CI Pass, and production verification all apply equally.
|
|
490
|
+
|
|
491
|
+
> **Scenario (cont.)**: `$roll-fix` executes FIX-012, with scope strictly limited to the serialization layer field mapping. A regression test is added (asserting `timestamp` is non-null and conforms to ISO 8601 format).
|
|
492
|
+
>
|
|
493
|
+
> 1 commit, CI GREEN, post-deployment Verification Gate confirms the audit list timestamps have recovered, FIX-012 closed. The new acceptance evidence reconciles against US-007's AC, so `roll status` and the story report clear the truth-drift signal and release readiness returns to green.
|
|
494
|
+
|
|
495
|
+
---
|
|
496
|
+
|
|
497
|
+
## 6. Engineering Baseline: Engineering Common Sense
|
|
498
|
+
|
|
499
|
+
Roll defines 9 non-negotiable engineering baselines that apply across all three loops. These are not "best practice suggestions" — they are mandatory checks in the Test Design Review phase of every Story:
|
|
500
|
+
|
|
501
|
+
| # | Baseline | Definition | Anti-Pattern |
|
|
502
|
+
|---|----------|-----------|--------------|
|
|
503
|
+
| 1 | **Idempotency** | Executing the same operation N times yields the same result as executing it once | "This won't be called twice anyway" |
|
|
504
|
+
| 2 | **Cross-Module Contracts** | Shared IDs, formats, and algorithms are consistent across all modules | "The other side will handle the format conversion" |
|
|
505
|
+
| 3 | **Data Flow Integrity** | Producer → storage → consumer validated end-to-end | "As long as it's in the database it's fine" |
|
|
506
|
+
| 4 | **Atomicity** | On partial failure, perform a complete rollback — leave no intermediate state | "The failure probability is very low" |
|
|
507
|
+
| 5 | **Input Validation** | All external inputs (API, user, file) are validated at the boundary | "Internal calls don't need validation" |
|
|
508
|
+
| 6 | **Graceful Degradation** | When a dependency fails, degrade service rather than crash | "That service won't go down" |
|
|
509
|
+
| 7 | **Observability** | Progress, state, and errors are visible to the user | "It can be looked up in the logs" |
|
|
510
|
+
| 8 | **Concurrency Safety** | Shared resource access is safe under multi-thread / multi-process conditions | "We only have a single instance right now" |
|
|
511
|
+
| 9 | **Infer First, Confirm Intent** | Never ask the user for facts the machine can deduce; only ask the user to decide intent (keep / switch / merge) | "Just let the user pick — safer that way" |
|
|
512
|
+
|
|
513
|
+
**Baseline 9 expanded:** Before prompting the user, any tool must exhaust available context (files, config, environment). Present the inferred result as "confirm or override" — never ask users to fill in information from scratch when the system already has signals. Two modes:
|
|
514
|
+
- **new-scratch** (no context whatsoever): a selection menu is the correct prompt
|
|
515
|
+
- **legacy-auto** (code, config, or metadata exists): scan → infer → ask only "keep [Y] or switch [1-4]?"
|
|
516
|
+
|
|
517
|
+
The full menu is a fallback, not the default entry point. An `--auto` / `auto` argument is reserved for non-interactive CI/script use.
|
|
518
|
+
|
|
519
|
+
---
|
|
520
|
+
|
|
521
|
+
## 7. Passive Support Skills
|
|
522
|
+
|
|
523
|
+
Beyond the active Skills in the three loops, Roll includes a set of passively triggered support skills:
|
|
524
|
+
|
|
525
|
+
| Skill | Trigger | Purpose |
|
|
526
|
+
|-------|---------|---------|
|
|
527
|
+
| `$roll-.echo` | When user input is ambiguous or contradictory | Restates intent and resolves ambiguity before proceeding, avoiding wasted compute on a misunderstood instruction |
|
|
528
|
+
| `$roll-.clarify` | When the request needs scope boundaries (what/who/where) | Summarizes intent and asks 3–5 targeted questions before design begins |
|
|
529
|
+
| `$roll-.review` | After each TCR micro-step completes | Multi-dimensional self-review (security, maintainability, performance, scope); a Critical finding blocks the commit |
|
|
530
|
+
| `$roll-.qa` | During the Test Design Review phase | Defines the test pyramid (Unit > E2E > Visual > Smoke) and enforces coverage thresholds |
|
|
531
|
+
| `$roll-.changelog` | After a successful deployment | Extracts completed items from BACKLOG and generates a user-readable changelog |
|
|
532
|
+
|
|
533
|
+
---
|
|
534
|
+
|
|
535
|
+
## 8. Relationship to Classical Methodologies
|
|
536
|
+
|
|
537
|
+
Roll is not a new methodology. It encodes proven engineering practices as standardized instructions that AI Agents can understand and execute.
|
|
538
|
+
|
|
539
|
+
```mermaid
|
|
540
|
+
graph LR
|
|
541
|
+
subgraph "Classical Methodologies"
|
|
542
|
+
BDD["BDD<br/>Behavior-Driven Dev"]
|
|
543
|
+
S["Scrum<br/>Sprint / Backlog"]
|
|
544
|
+
T["TDD<br/>RED-GREEN-Refactor"]
|
|
545
|
+
TCR["TCR<br/>Test && Commit ∥ Revert"]
|
|
546
|
+
SRE["SRE<br/>Observability / Error Budget"]
|
|
547
|
+
end
|
|
548
|
+
|
|
549
|
+
subgraph "Roll Implementation"
|
|
550
|
+
D["$roll-design<br/>INVEST Stories"]
|
|
551
|
+
SB["$roll-build<br/>TCR Micro-steps"]
|
|
552
|
+
SP["$roll-spar<br/>Adversarial TDD"]
|
|
553
|
+
ST["roll status / cycle / reports<br/>CLI-first Truth Surface"]
|
|
554
|
+
BB["$roll-debug<br/>Auto Forensics"]
|
|
555
|
+
end
|
|
556
|
+
|
|
557
|
+
BDD -->|"Acceptance criteria"| D
|
|
558
|
+
S -->|"Backlog management"| D
|
|
559
|
+
T -->|"Test first"| SB
|
|
560
|
+
TCR -->|"Atomic commits"| SB
|
|
561
|
+
T -->|"Attack-defense split"| SP
|
|
562
|
+
SRE -->|"Observability surfaces"| ST
|
|
563
|
+
SRE -->|"Live forensics"| BB
|
|
564
|
+
```
|
|
565
|
+
|
|
566
|
+
The key distinction lies in the shift of execution subject: these methodologies originally depended on engineers' personal discipline (humans tire, humans cut corners). Roll hardens them into instruction constraints for AI Agents — an Agent will never "skip the tests just this once," because that branch does not exist in the Skill definition.
|
|
567
|
+
|
|
568
|
+
---
|
|
569
|
+
|
|
570
|
+
## 9. Autonomous Evolution Layer (Optional)
|
|
571
|
+
|
|
572
|
+
### 9.1 Design Principle
|
|
573
|
+
|
|
574
|
+
The three-loop architecture (Loop A → B → C) describes how a human developer works *with* Roll. The autonomous evolution layer is a **separate, optional overlay** that lets the agent continue working without the human present — picking up pending BACKLOG items and reflecting on code health nightly, while keeping the delivery truth surface up to date for the human to read on their own schedule.
|
|
575
|
+
|
|
576
|
+
It is off by default. Enabling it requires an explicit `roll loop on`.
|
|
577
|
+
|
|
578
|
+
```
|
|
579
|
+
┌─────────────────────────────────────────────────────────┐
|
|
580
|
+
│ Base layer (always active) │
|
|
581
|
+
│ $roll-design → $roll-build → $roll-fix → $roll-spar │
|
|
582
|
+
│ Human drives every action │
|
|
583
|
+
├─────────────────────────────────────────────────────────┤
|
|
584
|
+
│ Autonomous layer (opt-in: roll loop on) │
|
|
585
|
+
│ roll-loop — BACKLOG executor (configurable schedule) │
|
|
586
|
+
│ roll-.dream — nightly code health scan │
|
|
587
|
+
│ Human reads status / cycle / reports; release stays human │
|
|
588
|
+
└─────────────────────────────────────────────────────────┘
|
|
589
|
+
```
|
|
590
|
+
|
|
591
|
+
### 9.2 Components
|
|
592
|
+
|
|
593
|
+
**`roll-loop`** — Runs on a configurable schedule via macOS launchd (Linux: crontab). Scans BACKLOG for `📋 Todo` items and routes them: `US-XXX → $roll-build`, `FIX-XXX → $roll-fix`, `REFACTOR-XXX → $roll-build`. Caps items per run to limit blast radius. Rebuilds the generated morning report page from events/runs as it goes. Built-in TCR enforcement: after a story completes, checks for `tcr:` micro-commits — if zero are found, reverts the story to Todo with an ALERT, preventing agents from skipping the TCR rhythm.
|
|
594
|
+
|
|
595
|
+
**`roll-.dream`** — Runs nightly (03:00 local) via macOS launchd (Linux: crontab). Scans the codebase for dead code, architectural drift against `.roll/domain/`, pruning candidates, and emerging patterns. Outputs `REFACTOR-XXX` entries to BACKLOG and a log to `.roll/dream/YYYY-MM-DD.md`.
|
|
596
|
+
|
|
597
|
+
**Reading delivery state** — There is no owner-brief skill. The human reads CLI-first surfaces (`roll status`, `roll loop watch`, `roll loop cycle <id>`, `roll loop status`, alerts, and story reports) on their own schedule. This is distinct from `roll-.changelog` (the user-facing changelog).
|
|
598
|
+
|
|
599
|
+
### 9.3 Why Local Scheduling, Not GitHub Actions
|
|
600
|
+
|
|
601
|
+
GitHub Actions runs on remote servers with no access to the local codebase, local test runner, or local agent CLI. The TCR loop — which is the core of `$roll-build` — requires local execution. Using GitHub Actions would mean the agent could only read the repo as a snapshot, not run tests, not observe the dev environment.
|
|
602
|
+
|
|
603
|
+
On macOS, Roll uses **launchd** (plists installed to `~/Library/LaunchAgents/`); on Linux, crontab. `roll loop on` automatically installs scheduling for both services (loop/dream); `roll loop off` removes them.
|
|
604
|
+
|
|
605
|
+
```bash
|
|
606
|
+
# macOS launchd plists (auto-generated, no manual editing needed)
|
|
607
|
+
~/Library/LaunchAgents/com.roll.loop.<project-slug>.plist
|
|
608
|
+
~/Library/LaunchAgents/com.roll.dream.<project-slug>.plist
|
|
609
|
+
```
|
|
610
|
+
|
|
611
|
+
`roll loop status` provides the scheduler snapshot: launchd status, current execution state, pending queue, alerts, and recent run history. For the live terminal, attach directly with `tmux attach -t roll-loop-<project-slug>`.
|
|
612
|
+
|
|
613
|
+
If the agent supports native scheduling (e.g. Claude Code hooks), that is preferred over raw launchd/cron for cleaner lifecycle management.
|
|
614
|
+
|
|
615
|
+
### 9.4 Scoped Agent Roles
|
|
616
|
+
|
|
617
|
+
Agent selection is expressed as `Scope -> Role -> Binding -> Agent -> optional
|
|
618
|
+
Model`. Machine Scope lives in `~/.roll/agents.yaml`; Project Scope lives in
|
|
619
|
+
`.roll/agents.yaml`. The loop resolves `story.execute` for the Builder and
|
|
620
|
+
`story.evaluate` for review/score.
|
|
621
|
+
|
|
622
|
+
```yaml
|
|
623
|
+
schema: roll-agents/v1
|
|
624
|
+
scope: project
|
|
625
|
+
inherits: machine
|
|
626
|
+
defaults:
|
|
627
|
+
story:
|
|
628
|
+
roles:
|
|
629
|
+
execute:
|
|
630
|
+
kind: select
|
|
631
|
+
from: [kimi, codex, pi]
|
|
632
|
+
require: [execute]
|
|
633
|
+
strategy: first-available
|
|
634
|
+
```
|
|
635
|
+
|
|
636
|
+
Runtime availability is checked at resolution/spawn time. A failed auth,
|
|
637
|
+
network, VPN, account, or binary probe skips that candidate for the current
|
|
638
|
+
resolution; it does not rewrite the static pool.
|
|
639
|
+
|
|
640
|
+
### 9.5 Human Authority
|
|
641
|
+
|
|
642
|
+
The autonomous layer **never** invokes `roll-release`. Production deployment is always a human decision, made after reading the delivery truth surface and optionally inspecting the diff. CLI-first surfaces provide:
|
|
643
|
+
|
|
644
|
+
- What the agent completed since the human last looked
|
|
645
|
+
- Any escalations that require human input
|
|
646
|
+
- A release-readiness signal (heuristic, not a gate)
|
|
647
|
+
|
|
648
|
+
This keeps the human informed without requiring them to be present for every step.
|
|
649
|
+
|
|
650
|
+
### 9.6 CLI Management
|
|
651
|
+
|
|
652
|
+
```bash
|
|
653
|
+
roll loop on|off # enable / disable scheduled execution for this project
|
|
654
|
+
roll loop now # trigger one cycle immediately
|
|
655
|
+
roll loop status # show scheduler state + any ALERT
|
|
656
|
+
roll loop cycle <id> # inspect one cycle trace and evidence pointers
|
|
657
|
+
roll agent # inspect Machine Scope, Project Scope, roles, pool
|
|
658
|
+
roll agent migrate # convert legacy agent files to roll-agents/v1
|
|
659
|
+
roll agent list # show installed agents
|
|
660
|
+
roll # project dashboard (in project dir): loop status + summary
|
|
661
|
+
```
|
|
662
|
+
|
|
663
|
+
---
|
|
664
|
+
|
|
665
|
+
## 10. Limitations and Current State
|
|
666
|
+
|
|
667
|
+
**Validated:**
|
|
668
|
+
|
|
669
|
+
- Feedback-driven continuous delivery loop (Design → Build → Check → Fix)
|
|
670
|
+
- A standardized skill set spanning the three loops (active delivery skills + passive support skills)
|
|
671
|
+
- Cross-AI-client configuration consistency management (`roll` CLI)
|
|
672
|
+
- TCR micro-commits + Verification Gate quality assurance mechanism
|
|
673
|
+
- Multi-Agent audit tracing via `Co-Authored-By` trailers (written natively by each AI tool)
|
|
674
|
+
|
|
675
|
+
**Current Limitations:**
|
|
676
|
+
|
|
677
|
+
- **Multi-Agent coordination overhead**: `$roll-build` evaluates Action dependencies to determine whether to launch parallel sub-Agents, but cross-Agent state synchronization and conflict resolution currently depend on conventions rather than enforced protocols, incurring coordination overhead in high-concurrency scenarios.
|
|
678
|
+
- **Framework coupling**: Skill definitions are written in Markdown and rely on AI clients' ability to interpret natural language instructions — execution precision varies across different models. Each Skill now pins a model in its frontmatter (`model:` — e.g. Opus for `roll-design`, Haiku for `roll-idea`) and declares a tool allowlist (`allowed-tools:`), mitigating precision drift and accidental tool misuse, though both fields still depend on the client honoring them.
|
|
679
|
+
- **Observability is reactive**: Loop C's truth surfaces (`roll status`, `roll loop cycle`, story reports) and `$roll-.dream` scans surface drift and code-health issues from delivery facts and nightly analysis, but they do not continuously re-exercise shipped features the way a live regression suite would — a regression that produces no new evidence and no failing test can persist until the next acceptance run or scan touches it.
|
|
680
|
+
|
|
681
|
+
---
|
|
682
|
+
|
|
683
|
+
## Appendix A: Skill Quick Reference
|
|
684
|
+
|
|
685
|
+
| Skill | Phase | Input | Output |
|
|
686
|
+
|-------|-------|-------|--------|
|
|
687
|
+
| `$roll-design` | Design | Requirements description | `.roll/backlog.md` + `.roll/features/` |
|
|
688
|
+
| `$roll-build` | Implementation | Story ID / one-sentence requirement | Deployed code + verification evidence |
|
|
689
|
+
| `$roll-spar` | Defensive implementation | Feature description | Adversarial test suite + implementation code |
|
|
690
|
+
| `$roll-fix` | Bug fix | Fix ID | Fix code + regression test |
|
|
691
|
+
| `$roll-release` | Release | — | Version + tag + npm publish + GitHub Release |
|
|
692
|
+
| `$roll-peer` | Code review | Change diff | APPROVE / REFINE / OBJECT verdict |
|
|
693
|
+
| `$roll-debug` | Debugging & Diagnosis | URL | Diagnostic JSON + screenshots + root cause analysis |
|
|
694
|
+
| `$roll-doc-audit` | Docs/product audit | Codebase + docs/site/help | Drift findings + docs inventory + draft fills |
|
|
695
|
+
| `$roll-doctor` | Toolchain health | Install state | Conventions sync / skill health / config validity report |
|
|
696
|
+
| `$roll-loop` | Autonomous execution | BACKLOG todos | Completed Story / Fix / Refactor |
|
|
697
|
+
| `$roll-.dream` | Autonomous scan | Codebase | REFACTOR entries + scan log |
|
|
698
|
+
|
|
699
|
+
## Appendix B: CLI Command Quick Reference
|
|
700
|
+
|
|
701
|
+
Commands fall into two categories: bash commands run pure shell logic; agent commands (🤖) launch a full AI agent session to execute a SKILL.md.
|
|
702
|
+
|
|
703
|
+
| Command | Purpose |
|
|
704
|
+
|---------|---------|
|
|
705
|
+
| `roll setup [-f]` | First-time install on this machine, or re-sync (use `--force` to overwrite local cache) |
|
|
706
|
+
| `roll update` | One-step upgrade: detects install method (curl/npm/git) and upgrades accordingly, then re-sync |
|
|
707
|
+
| `roll init` | Create `AGENTS.md` + `.roll/` scaffold (`backlog.md`, `features/`, `domain/`) in cwd; surfaces `$roll-onboard` for legacy code; re-merges if `AGENTS.md` exists |
|
|
708
|
+
| `roll status` | Display current sync status, skill links, and detected AI tools |
|
|
709
|
+
| `roll backlog` | Show all pending tasks from `.roll/backlog.md` |
|
|
710
|
+
| `roll agent [migrate\|list]` | Inspect/migrate scoped agent roles in `~/.roll/agents.yaml` and `.roll/agents.yaml` |
|
|
711
|
+
| `roll loop <on\|off\|now\|status\|runs\|log\|story\|events\|eval\|signals\|pause\|resume\|reset\|gc>` | 🤖 Manage the autonomous BACKLOG executor (three lanes: loop/dream/pr) |
|
|
712
|
+
| `roll loop cycle <id>` | Show one cycle's trace tape, PR/diff pointers, and evidence links |
|
|
713
|
+
| Loop pairing evidence | 🤖 Pairing observability and explicit review scoring; new defaults live in `.roll/agents.yaml` |
|
|
714
|
+
| `roll release [ship\|waiver]` | Release guidance · gated tag push · recorded drift waiver — npm publish stays human |
|
|
715
|
+
| `roll` (no args, in project dir) | Dashboard: loop status, pending count, latest summary |
|