@seanyao/roll 3.625.2 → 3.627.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.
@@ -1,238 +1,288 @@
1
1
  ---
2
2
  name: roll-onboard
3
3
  license: MIT
4
- description: "Load when bringing a legacy project into Roll through interactive discovery questions and generation of .roll/onboard-plan.yaml for roll init --apply."
4
+ description: "Load when bringing an existing codebase without Roll markers into Roll through read-only diagnosis and structured .roll/init-diagnosis.yaml + .roll/onboard-plan.yaml artifacts."
5
5
  ---
6
6
  # Roll Onboard
7
7
 
8
8
  ## Gotchas
9
9
 
10
- - Onboard gathers a contract for roll init --apply; it should not mutate the project before the plan is reviewed.
10
+ - This skill is for an **existing codebase without Roll**, not an empty project, PRD-only project, already-onboarded Roll project, or pre-v2 Roll layout.
11
+ - The agent is the cognition layer. It may diagnose, ask questions, and write structured artifacts only.
11
12
  - Respect privacy/scope answers from the interactive questions as hard constraints.
12
13
 
13
14
  > Follows the Architecture Constraints, Development Discipline, and Engineering Common Sense defined in the project AGENTS.md.
14
15
 
15
- Interactive onboarding flow for **legacy projects**: existing code that needs to adopt the Roll convention without disrupting how the team already works.
16
-
17
16
  ## Trigger
18
17
 
19
- This skill runs when:
18
+ Use this skill when:
19
+
20
+ - `roll init` detected an existing codebase without Roll and printed `Next: $roll-onboard`.
21
+ - The CLI told the user that `$roll-onboard` requires an AI agent.
22
+ - The user invokes `$roll-onboard` from the existing codebase root.
23
+
24
+ Do not use this skill for PRD-only workspaces. Those are new projects and should go through `$roll-design` / fresh init.
25
+
26
+ ## Hard Responsibility Boundary
20
27
 
21
- - `roll init` detected a legacy project (≥10 source files, no `AGENTS.md`)
22
- - The CLI told the user to open an AI agent and run `$roll-onboard`
23
- - The user has now invoked you here
28
+ You may write exactly these two files:
24
29
 
25
- ## Hard responsibility boundary
30
+ 1. `.roll/init-diagnosis.yaml`
31
+ 2. `.roll/onboard-plan.yaml`
26
32
 
27
- You are the **认知 (cognition) layer**. Your job ends with writing a plan file.
33
+ You must not create, edit, delete, move, or shell-mutate any other project file.
28
34
 
29
35
  | You do | You do NOT |
30
36
  |--------|------------|
31
- | Read project code, infer type/domains/modules | Modify any source file |
32
- | Call `roll-doc-audit --dry-run` to get a gap report | Call `roll-doc-audit` (write mode) |
33
- | Ask the user 9 questions across 3 groups | Decide for the user |
34
- | Produce `.roll/onboard-plan.yaml` | Write `.gitignore` |
35
- | Produce `.roll/onboard-plan.yaml` | Run `roll init --apply` |
37
+ | Read project code, manifests, docs, and tests | Modify source files |
38
+ | Run read-only probes and `roll-doc-audit --dry-run` | Write `AGENTS.md` |
39
+ | Ask the user nine focused onboarding questions | Write `.gitignore` |
40
+ | Write `.roll/init-diagnosis.yaml` | Write `.roll/backlog.md` |
41
+ | Write `.roll/onboard-plan.yaml` | Write docs or feature specs |
42
+ | Stop and tell the user to review and apply the plan | Run `roll init --apply` |
36
43
 
37
- Hard constraint: **AI cannot create files in the user's project other than `.roll/onboard-plan.yaml`.** Anything else is `bash`'s job (`roll init --apply`).
44
+ Hard constraint: the plan may describe CLI-owned merge intents, but any source, `AGENTS.md`, `.gitignore`, backlog, docs, features, or offboard mutation is the responsibility of `roll init --apply`, not the agent.
38
45
 
39
- ## Inputs you must read
46
+ ## Inputs You Must Read
40
47
 
41
- 1. The repository tree (use the project's own structure to infer technologies)
42
- 2. Any existing `README.md` / `package.json` / `pyproject.toml` / `Cargo.toml` / `go.mod` etc. as evidence
43
- 3. `roll-doc-audit --dry-run` output identifies what documentation gaps exist
44
- 4. The path-audit pattern: scan for legacy structure markers (`BACKLOG.md`, `docs/features/`, etc.) — if any are present, REFUSE and tell the user to run `npx @seanyao/roll@2 migrate` first
48
+ 1. Run `roll init` first and record the non-mutating diagnosis, especially `facts hash: sha256:...`.
49
+ 2. The repository tree, manifests, source roots, test roots, and existing docs.
50
+ 3. Any existing `README.md` / `package.json` / `pyproject.toml` / `Cargo.toml` / `go.mod` etc. as evidence.
51
+ 4. `roll-doc-audit --dry-run` output to identify documentation gaps without writing.
52
+ 5. The pre-v2 Roll marker scan: `BACKLOG.md`, `PROPOSALS.md`, `docs/features/`, `docs/briefs/`, `docs/dream/`.
53
+
54
+ If pre-v2 Roll markers are present, stop and tell the user to run:
55
+
56
+ ```sh
57
+ npx @seanyao/roll@2 migrate --dry-run
58
+ ```
45
59
 
46
60
  ## Workflow
47
61
 
48
- ### Step 0 Pre-flight
62
+ ### Step 0 - Pre-flight
49
63
 
50
- 1. Check that you're in a legacy project root (no `AGENTS.md`, has source code)
51
- 2. If `BACKLOG.md` or `docs/features/` already present STOP, tell user to run `npx @seanyao/roll@2 migrate` first (this is a partial-migration project, not legacy)
52
- 3. Check `.roll/onboard-plan.yaml` doesn't already exist; if it does, ask user whether to overwrite
64
+ 1. Confirm the current directory is an existing codebase root with source/manifests and no current Roll markers (`.roll/`, `.roll/backlog.md`, `.roll/features/`, `AGENTS.md`).
65
+ 2. Confirm no pre-v2 Roll markers are present. If they are present, stop and route to the v2 migration command above.
66
+ 3. Check whether `.roll/init-diagnosis.yaml` or `.roll/onboard-plan.yaml` already exists. If either exists, ask the user before overwriting it.
53
67
 
54
- ### Step 1 Read code, build understanding
68
+ ### Step 1 - Read Code And Build Understanding
55
69
 
56
70
  Walk the repo. Identify:
57
- - **type**: one of `backend-service` / `frontend-only` / `fullstack` / `cli`
58
- - **description**: 1-2 sentence summary of what this project does
59
- - **domains**: top business/technical domains (e.g., "auth", "billing", "search")
60
- - **key_modules**: top 3-5 modules that hold most of the logic
61
71
 
62
- ### Step 1b Phase 2 analysis: business model, tech, tests (US-ONBOARD-016)
72
+ - `type`: one of `backend-service` / `frontend-only` / `fullstack` / `cli`
73
+ - `description`: 1-2 sentence summary of what this project does
74
+ - `domains`: top business/technical domains
75
+ - `key_modules`: top 3-5 modules that hold most of the logic
63
76
 
64
- A single onboard now produces three structured analysis sections in the plan
65
- (`domain_model`, `tech_analysis`, `test_assessment`). Build them here so Step 4
66
- can serialise them.
77
+ ### Step 1b - Business Model, Tech, Tests
67
78
 
68
- **`domain_model`** from the code you read, identify the bounded contexts. For
69
- each: a `name`, its `aggregates` (the entities that own consistency), and its
70
- `ubiquitous_language` (the domain terms the code/docs actually use). If you
71
- genuinely cannot infer contexts from the code, emit an empty
72
- `bounded_contexts: []` — do NOT invent contexts that aren't in the code.
79
+ A normal onboard produces three structured plan sections: `domain_model`, `tech_analysis`, and `test_assessment`.
73
80
 
74
- **`tech_analysis`** — `stack` (languages/frameworks evidenced by manifests),
75
- `dependencies` (from `package.json` / `pyproject.toml` / `go.mod` / `Cargo.toml`
76
- etc.), `architecture_notes` (observed structure, not aspirational), and `risks`
77
- (each a mapping with a `description`; optionally `severity: LOW|MEDIUM|HIGH` and
78
- an `evidence: detected|inferred` tag).
81
+ `domain_model`:
79
82
 
80
- **`test_assessment`** this section is under a **hard anti-hallucination
81
- constraint** (next sub-step). Do NOT write it from intuition.
83
+ - Identify bounded contexts from code and docs.
84
+ - For each context, emit `name`, `aggregates`, and `ubiquitous_language`.
85
+ - If contexts cannot be inferred, emit `bounded_contexts: []`. Do not invent contexts.
82
86
 
83
- #### The verifiable test scan (ANTI-HALLUCINATION HARD CONSTRAINT)
87
+ `tech_analysis`:
84
88
 
85
- Every `test_assessment` claim must be backed by a real filesystem scan you run
86
- here never by "what a project like this usually needs". Run these probes and
87
- record the raw counts/paths:
89
+ - `stack`: languages/frameworks evidenced by manifests.
90
+ - `dependencies`: dependencies from manifests.
91
+ - `architecture_notes`: observed structure, not aspirational design.
92
+ - `risks`: mappings with `description`; optional `severity: LOW|MEDIUM|HIGH`; optional `evidence: detected|inferred`.
88
93
 
89
- 1. **Count test files** by the conventional patterns:
90
- - `*.test.*` / `*.spec.*` (JS/TS), `*_test.go` (Go), `test_*.py` / `*_test.py` (Python), `*_spec.rb` (Ruby), `*Test.java` (Java)
91
- - e.g. `git ls-files | grep -cE '\.(test|spec)\.[jt]sx?$'` and similar per pattern
92
- 2. **Probe for runner configs**: `jest.config.*`, `pytest.ini` (or `[tool.pytest]` in `pyproject.toml`), `.mocharc.*`, `vitest.config.*`, `karma.conf.*`, `phpunit.xml`, `go test` (implied by `*_test.go`)
93
- 3. **Probe for a `coverage/` directory** (and `.coverage` / `coverage.xml` artifacts)
94
+ `test_assessment` must be backed by a real filesystem scan:
94
95
 
95
- Then turn the raw findings into claims, each a **mapping** carrying a `claim`
96
- string plus an `evidence` tag:
96
+ 1. Count test files by conventional patterns:
97
+ - `*.test.*` / `*.spec.*`
98
+ - `*_test.go`
99
+ - `test_*.py` / `*_test.py`
100
+ - `*_spec.rb`
101
+ - `*Test.java`
102
+ 2. Probe for runner configs:
103
+ - `jest.config.*`, `vitest.config.*`, `.mocharc.*`, `pytest.ini`, `[tool.pytest]` in `pyproject.toml`, `karma.conf.*`, `phpunit.xml`
104
+ - `go test` is implied by `*_test.go`
105
+ 3. Probe for coverage artifacts:
106
+ - `coverage/`, `.coverage`, `coverage.xml`
97
107
 
98
- - `evidence: detected` the scan directly found it (e.g. "42 `*.test.ts` files detected", "vitest.config.ts present", "coverage/ directory present").
99
- - `evidence: inferred` — a judgement you derived FROM the detected facts (e.g. "unit layer present but no E2E config — integration coverage likely thin"). The inference must trace back to something the scan detected.
108
+ Every `test_assessment` claim must be a mapping with an evidence tag:
100
109
 
101
- **"none detected" rule**: when a probe finds nothing, you MUST say so explicitly
102
- with a tagged claim — `{claim: "none detected", evidence: detected}` (a scan that
103
- ran and returned zero is a genuine `detected` finding). You must NOT silently
104
- omit the dimension, and you must NOT invent generic filler like "needs more E2E
105
- tests" / "consider adding integration tests" with no detected basis. The plan
106
- validator (`lib/roll-plan-validate.py`) rejects any untagged free-text claim, so
107
- filler will fail `roll init --apply`.
110
+ ```yaml
111
+ claim: "42 *.test.ts files detected"
112
+ evidence: detected
113
+ ```
114
+
115
+ Use `evidence: detected` for direct scan results, including `claim: "none detected"` when a scan returns zero. Use `evidence: inferred` only for judgement derived from detected facts.
108
116
 
109
- Map the findings into the three buckets:
110
- - `current_layers`: what test layers actually exist (each tagged `detected`)
111
- - `gaps`: dimensions where the scan found nothing (`none detected`, tagged `detected`) or thin coverage you can justify (`inferred`)
112
- - `recommended_actions`: actions that trace to a detected gap (tag `inferred`); if nothing is missing, this bucket may be `[]`
117
+ ### Step 2 - Get Gap Report
113
118
 
114
- ### Step 2 — Get gap report
119
+ Run:
120
+
121
+ ```sh
122
+ roll-doc-audit --dry-run
123
+ ```
115
124
 
116
- Run `roll-doc-audit --dry-run` (READ-ONLY mode). This reports:
117
- - Which standard Roll artifacts (BACKLOG, features, domain models) are missing
118
- - Which existing docs Roll could `include` rather than regenerate
125
+ Use it as read-only input. Do not run write mode.
119
126
 
120
- ### Step 3 Three groups of nine questions
127
+ ### Step 3 - Ask Nine Questions
121
128
 
122
- Present these in chat. **Aim for total time 3 minutes.** Group 1 confirms your understanding; group 2 scopes the work; group 3 handles privacy and next steps.
129
+ Aim for total time <= 3 minutes.
123
130
 
124
- **$(msg onboard.questions_group1)**
131
+ Group 1 - confirm understanding:
125
132
 
126
- 1. $(msg onboard.q1 "[type]" "[description]")
127
- 2. $(msg onboard.q2 "[domain A, domain B, …]")
128
- 3. $(msg onboard.q3 "[X, Y, Z]")
133
+ 1. Is this type/description right?
134
+ 2. Are these domains right?
135
+ 3. Are these key modules right?
129
136
 
130
- **$(msg onboard.questions_group2)**
137
+ Group 2 - scope:
131
138
 
132
- 4. $(msg onboard.q4) Multi-select:
133
- - `backlog` initial BACKLOG with seeded stories
134
- - `features` features index + per-feature spec stubs
135
- - `domain` DDD context map
136
- - `briefs` directory for `$roll-brief` outputs
137
- 5. Of these existing docs, which should I `include` rather than regenerate?
138
- - (list candidates: README.md, docs/architecture.md, etc.)
139
- 6. Put drafts inside `.roll/`? (default: yes; "no" means use the legacy `docs/` layout — not recommended for new adoption)
139
+ 4. Which Roll surfaces should `roll init --apply` create? Multi-select:
140
+ - `backlog` - initial backlog
141
+ - `features` - features index and per-feature spec stubs
142
+ - `domain` - DDD context map
143
+ - `briefs` - directory for brief outputs
144
+ 5. Which existing docs should Roll include rather than regenerate?
145
+ 6. Put drafts inside `.roll/`? Default yes.
140
146
 
141
- **Group 3 Privacy & next steps**
147
+ Group 3 - privacy and next steps:
142
148
 
143
- 7. Add `.roll/` to `.gitignore`? (yes = keep project management private; no = commit it like Roll itself does)
144
- 8. Sync Roll conventions to which AI tools? Multi-select from detected agents (claude / kimi / codex / pi / agy / reasonix)
149
+ 7. Add `.roll/` to `.gitignore`?
150
+ 8. Sync Roll conventions to which detected AI tools?
145
151
  9. Enable `roll loop` autonomous execution after init?
146
152
 
147
- ### Step 4 Write plan file
153
+ ### Step 4 - Write `.roll/init-diagnosis.yaml`
154
+
155
+ Create `.roll/` if needed, then write this schema:
156
+
157
+ ```yaml
158
+ version: 1
159
+ createdAt: "2026-06-27T00:00:00+08:00"
160
+ factsHash: "sha256:<64 lowercase hex chars from roll init>"
161
+ diagnosis:
162
+ kind: codebase-no-roll
163
+ recommendedPath: agentic-onboard
164
+ confidence: high
165
+ reasons:
166
+ - Existing source, tests, or manifests found without Roll markers.
167
+ agent:
168
+ name: codex
169
+ status: available
170
+ ```
171
+
172
+ ### Step 5 - Write `.roll/onboard-plan.yaml`
148
173
 
149
- Write `.roll/onboard-plan.yaml` with this exact schema (validated by `lib/roll-plan-validate.py`):
174
+ Write this schema. `factsHash` must exactly match `.roll/init-diagnosis.yaml`.
150
175
 
151
176
  ```yaml
152
177
  version: 1
153
- generated_at: "2026-05-19T14:30:00+08:00" # current ISO 8601, your timezone OK
178
+ generated_at: "2026-06-27T00:00:00+08:00"
179
+ factsHash: "sha256:<same value as init-diagnosis.yaml>"
180
+
181
+ file_operations:
182
+ - path: .roll/init-diagnosis.yaml
183
+ operation: write
184
+ idempotent: true
185
+ - path: .roll/onboard-plan.yaml
186
+ operation: write
187
+ idempotent: true
188
+
189
+ merge_intents:
190
+ - target: roll_conventions
191
+ owner: roll-init-apply
192
+ strategy: merge global Roll conventions into AGENTS.md
193
+ - target: backlog
194
+ owner: roll-init-apply
195
+ strategy: create only when approved by scope
196
+ - target: features
197
+ owner: roll-init-apply
198
+ strategy: create only when approved by scope
199
+ - target: domain
200
+ owner: roll-init-apply
201
+ strategy: create only when approved by scope
202
+ - target: briefs
203
+ owner: roll-init-apply
204
+ strategy: create only when approved by scope
205
+ - target: agent_routes
206
+ owner: roll-init-apply
207
+ strategy: seed selected routing template
208
+ - target: gitignore
209
+ owner: roll-init-apply
210
+ strategy: append .roll/ only when privacy requests it
211
+ - target: sync_targets
212
+ owner: roll-init-apply
213
+ strategy: sync conventions after apply succeeds
154
214
 
155
215
  project_understanding:
156
- type: cli # one of: backend-service / frontend-only / fullstack / cli
216
+ type: cli
157
217
  description: "..."
158
- domains: [...]
159
- key_modules: [...]
218
+ domains: []
219
+ key_modules: []
160
220
 
161
221
  scope:
162
- approved: [backlog, features, domain] # user's Q4 multi-select
163
- declined: [briefs] # what they said no to
222
+ approved: [backlog, features, domain]
223
+ declined: [briefs]
164
224
 
165
225
  include_existing:
166
- - README.md # user's Q5 selections
167
- - docs/architecture.md
226
+ - README.md
168
227
 
169
228
  privacy:
170
- gitignore_dot_roll: true # user's Q7
171
-
172
- sync_targets: [claude, pi] # user's Q8
173
- enable_loop: false # user's Q9
174
- agent_routes_template: default # user's Q10 — agent routing preset
175
- # one of: default / minimal / heavy / skip
176
- # default = pi/claude + history (US-AGENT-002)
177
- # minimal = single agent (pi), no history
178
- # heavy = pi/claude/kimi + larger window
179
- # skip = don't seed .roll/agent-routes.yaml
229
+ gitignore_dot_roll: true
180
230
 
181
- # ── US-ONBOARD-016: Phase 2 analysis sections (optional, but emit all three) ──
182
- # All three are validated only when present, so they are backward-compatible,
183
- # but a normal onboard should produce them from Step 1b.
231
+ sync_targets: [claude, pi]
232
+ enable_loop: false
233
+ agent_routes_template: default
184
234
 
185
235
  domain_model:
186
- bounded_contexts: # [] if none can be inferred — never invent
187
- - name: auth
188
- aggregates: [User, Session]
189
- ubiquitous_language: [login, token, refresh]
236
+ bounded_contexts: []
190
237
 
191
238
  tech_analysis:
192
- stack: [bash, python3] # evidenced by manifests
193
- dependencies: [pyyaml] # from package.json / pyproject / go.mod / ...
194
- architecture_notes: ["single-binary CLI + python helpers in lib/"]
195
- risks:
196
- - description: "no automated test run on macOS bash 3.2"
197
- severity: HIGH # optional: LOW | MEDIUM | HIGH
198
- evidence: detected # optional: detected | inferred
199
-
200
- # test_assessment — ANTI-HALLUCINATION: every claim is a mapping with an
201
- # `evidence` tag (detected | inferred). A zero-result scan is `none detected`
202
- # tagged `detected`. Untagged free-text is REJECTED by the validator.
239
+ stack: []
240
+ dependencies: []
241
+ architecture_notes: []
242
+ risks: []
243
+
203
244
  test_assessment:
204
245
  current_layers:
205
- - claim: "112 bats files detected under tests/" # evidence: a real scan count
246
+ - claim: "none detected"
206
247
  evidence: detected
207
248
  gaps:
208
- - claim: "none detected" # e.g. no coverage/ dir found
249
+ - claim: "none detected"
209
250
  evidence: detected
210
- recommended_actions: # [] if nothing is missing
211
- - claim: "add a macOS CI runner (inferred from launchd-only test skips)"
212
- evidence: inferred # an inference traceable to a detected fact
251
+ recommended_actions: []
213
252
  ```
214
253
 
215
- Then tell the user:
254
+ Forbidden plan content:
255
+
256
+ - No `cmd`, `command`, `commands`, `exec`, `run`, `script`, `shell`, or `shell_commands` keys.
257
+ - No `file_operations` path except `.roll/init-diagnosis.yaml` and `.roll/onboard-plan.yaml`.
258
+ - No direct path mutation intent for source files, `AGENTS.md`, `.gitignore`, `.roll/backlog.md`, docs, features, or offboard files.
259
+ - No `merge_intents[].path`; use `target` + `owner: roll-init-apply`.
260
+
261
+ ### Step 6 - Stop
262
+
263
+ Tell the user:
216
264
 
217
- > Onboard conversation done. Plan saved to `.roll/onboard-plan.yaml`.
265
+ > Onboard conversation done. Diagnosis saved to `.roll/init-diagnosis.yaml`.
266
+ > Plan saved to `.roll/onboard-plan.yaml`.
267
+ > Review `.roll/init-diagnosis.yaml` and `.roll/onboard-plan.yaml` before applying.
218
268
  > Return to your terminal and run:
219
269
  >
220
270
  > roll init --apply
221
271
  >
272
+ > In non-interactive automation after review, use:
273
+ >
274
+ > roll init --apply --auto
275
+ >
276
+ > After apply, continue with:
277
+ >
278
+ > roll next
279
+ >
222
280
  > The plan expires in 24 hours.
223
281
 
224
- ### Step 5 Stop
225
-
226
- Do NOT run `roll init --apply` yourself. Do NOT modify other project files. Your job is done.
227
-
228
- ## When NOT to use
229
-
230
- - **Not a legacy project**: empty dir or fresh project → use plain `roll init` instead
231
- - **Has BACKLOG.md or docs/features/**: this is a pre-2.0 Roll project → run `npx @seanyao/roll@2 migrate` first
232
- - **Has .roll/ already**: already onboarded → don't re-run
282
+ Do not run `roll init --apply` yourself.
233
283
 
234
- ## Failure modes
284
+ ## Failure Modes
235
285
 
236
- - User aborts mid-conversation don't write partial plan; tell user to re-run from scratch
237
- - User answers contradict the gap report (e.g., declines `features` but has lots of code) → ask the contradictory question once more before accepting; if they confirm, respect the choice
238
- - You can't read enough code to fill `project_understanding` (e.g., binary repo) write a placeholder plan but ask user to fill in `type` and `description` manually before applying
286
+ - User aborts mid-conversation: do not write partial artifacts; tell the user to rerun from scratch.
287
+ - Answers contradict detected facts: ask the contradictory question once more; if they confirm, respect the choice.
288
+ - You cannot infer enough project understanding: write the artifact with detected facts only and tell the user which fields must be edited before apply.