peaks-cli 1.0.15 → 1.0.17
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/bin/peaks.js +0 -0
- package/dist/src/shared/version.d.ts +1 -1
- package/dist/src/shared/version.js +1 -1
- package/package.json +1 -1
- package/skills/peaks-prd/SKILL.md +46 -1
- package/skills/peaks-qa/SKILL.md +165 -15
- package/skills/peaks-rd/SKILL.md +188 -56
- package/skills/peaks-sc/SKILL.md +56 -5
- package/skills/peaks-solo/SKILL.md +374 -126
- package/skills/peaks-solo/references/artifact-contracts.md +60 -2
- package/skills/peaks-txt/SKILL.md +48 -1
- package/skills/peaks-ui/SKILL.md +175 -18
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: peaks-solo
|
|
3
|
-
description: Full-auto orchestration facade for the Peaks skill family. Use when the user asks Peaks to handle a project workflow end-to-end, especially
|
|
3
|
+
description: Full-auto orchestration facade for the Peaks skill family. Use when the user asks Peaks to handle a project workflow end-to-end (端到端/全流程/需求开发), especially from a product document (产品文档/PRD/飞书文档/Feishu doc) through implementation and validation. Coordinates peaks-prd, peaks-rd, peaks-ui, peaks-qa, peaks-sc, and peaks-txt while preserving user confirmation gates. Triggers on `/peaks-solo`, "peaks solo", "全流程开发", "端到端迭代", "根据产品文档开发", "从需求到上线".
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Peaks Solo
|
|
@@ -9,12 +9,34 @@ Peaks Solo is the orchestration facade for the Peaks short skill family.
|
|
|
9
9
|
|
|
10
10
|
Use this skill to identify the user scenario, recommend an execution mode, coordinate role skills, and produce the final handoff report. Do not collapse role responsibilities into this skill.
|
|
11
11
|
|
|
12
|
-
##
|
|
12
|
+
## Startup sequence (MANDATORY — execute in order)
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
### Step 1: Mode selection (MUST run before presence:set)
|
|
15
|
+
|
|
16
|
+
When the user invokes Peaks Solo without explicitly naming an execution profile, use `AskUserQuestion` BEFORE any other action. Present the recommended full-auto path as the first/default option with a practical description for each:
|
|
17
|
+
|
|
18
|
+
1. **Full auto (Recommended)** — Peaks handles planning, role coordination, validation, and compact handoff end-to-end while preserving required confirmation gates for risky or shared-state actions.
|
|
19
|
+
2. **Assisted** — Peaks proposes plans, artifacts, and checks, then pauses for user decisions at major workflow boundaries.
|
|
20
|
+
3. **Swarm** — Peaks maximizes safe parallel role/worker execution for larger RD or QA workloads while keeping reducer validation and artifact boundaries explicit.
|
|
21
|
+
4. **Strict** — Peaks uses the most conservative gates: explicit confirmations, strict slice specs, coverage evidence, QA acceptance, and commit boundaries before continuing.
|
|
22
|
+
|
|
23
|
+
Map the user's selection to the `--mode` flag value:
|
|
24
|
+
|
|
25
|
+
| User selects | `--mode` value |
|
|
26
|
+
|---|---|
|
|
27
|
+
| Full auto | `solo` |
|
|
28
|
+
| Assisted | `assisted` |
|
|
29
|
+
| Swarm | `swarm` |
|
|
30
|
+
| Strict | `strict` |
|
|
31
|
+
|
|
32
|
+
If the user already names a profile in their invocation (e.g. `/peaks-solo --full-auto`, "用全自动模式"), skip this question and use the named profile directly.
|
|
33
|
+
|
|
34
|
+
### Step 2: Set skill presence
|
|
35
|
+
|
|
36
|
+
Only after the mode is known (user selected or explicitly named), run:
|
|
15
37
|
|
|
16
38
|
```bash
|
|
17
|
-
peaks skill presence:set peaks-solo --mode <mode> --gate startup
|
|
39
|
+
peaks skill presence:set peaks-solo --mode <mode-value> --gate startup
|
|
18
40
|
```
|
|
19
41
|
|
|
20
42
|
Then display the compact status header: `Peaks Skill: peaks-solo | Gate: startup | Next: <one short action>`. Display this header on EVERY turn while the skill is active.
|
|
@@ -45,45 +67,297 @@ Use the Peaks CLI for runtime side effects.
|
|
|
45
67
|
|
|
46
68
|
## GStack integration
|
|
47
69
|
|
|
48
|
-
|
|
70
|
+
Map gstack stages to Peaks role artifacts; preserve Peaks confirmation gates. Do not delegate orchestration to gstack commands.
|
|
71
|
+
|
|
72
|
+
For frontend workflows, RD and QA must use Playwright MCP for real browser E2E (`peaks mcp plan/apply --capability playwright-mcp.browser-validation --yes`). Chrome DevTools MCP is a secondary CDP surface only. Sanitize browser artifacts before retention (no login URLs, cookies, tokens, PII). See `references/browser-workflow.md`.
|
|
73
|
+
|
|
74
|
+
## Local intermediate artifact workspace (MANDATORY)
|
|
75
|
+
|
|
76
|
+
### Workspace initialization gate
|
|
77
|
+
|
|
78
|
+
Before ANY role handoff or artifact write, Peaks Solo MUST create the workspace. The session-id uses the format `YYYY-MM-DD-<kebab-slug>` where `<kebab-slug>` is the **request-id or a 2-5 word topic description** (e.g. `2026-05-25-v3-indicator-model`, `2026-05-25-add-user-auth`).
|
|
79
|
+
|
|
80
|
+
**PROHIBITED session-id patterns** — block the workflow if any of these appear:
|
|
81
|
+
- Numeric-only: `1779674289`, `1779672642`
|
|
82
|
+
- Generic suffixes: `session`, `work`, `task`, `test`, `temp`, `tmp`
|
|
83
|
+
- Bare dates without topic: `2026-05-25`
|
|
84
|
+
- Timestamps: `20260525T093000`
|
|
85
|
+
|
|
86
|
+
**Existing old-session cleanup**: If `.peaks/` contains numeric-only or generic session directories from prior runs, create the new correctly-named session, migrate any reusable artifacts into it, and note the migration in the TXT handoff. Delete empty old-session directories.
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
peaks workspace init --project <repo> --session-id <YYYY-MM-DD-<slug>> --json
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
The workspace initialization creates this structure under `.peaks/<session-id>/`:
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
prd/source/ # PRD source documents (Feishu exports, pasted content)
|
|
96
|
+
prd/requests/ # PRD request artifacts (goals, non-goals, acceptance, frontend delta)
|
|
97
|
+
ui/requests/ # UI request artifacts (visual direction, taste reports)
|
|
98
|
+
rd/requests/ # RD request artifacts (slice specs, coverage, CR findings)
|
|
99
|
+
qa/test-cases/ # QA test cases
|
|
100
|
+
qa/test-reports/ # QA test reports (regression matrices, browser evidence)
|
|
101
|
+
qa/requests/ # QA request artifacts
|
|
102
|
+
sc/ # SC artifacts (change-control, impact, retention, boundary)
|
|
103
|
+
txt/ # TXT artifacts (handoff capsules, lessons, memory extraction)
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Role skills create these key files at the directory levels shown above:
|
|
107
|
+
- `rd/project-scan.md` (Solo step 0.6), `rd/tech-doc.md` (RD planning step 3b)
|
|
108
|
+
- `ui/design-draft.md` (UI step 3a)
|
|
109
|
+
- Request-scoped files under each role's `requests/` subdirectory
|
|
110
|
+
|
|
111
|
+
### Root pollution prohibition (CRITICAL)
|
|
112
|
+
|
|
113
|
+
**NEVER write Peaks intermediate artifacts to the project root directory.** Specifically prohibited at root level:
|
|
114
|
+
|
|
115
|
+
- PRD snapshots, document extracts, or requirement notes (`feishu-doc-*.md`, `*-snapshot.md`, etc.)
|
|
116
|
+
- RD tech docs, scan reports, slice specs, or architecture notes
|
|
117
|
+
- QA screenshots, browser evidence, test reports, or validation logs (`.png`, `.jpg`)
|
|
118
|
+
- QA test helper files, mock servers, or fixture scripts (`qa-server.js`, etc.)
|
|
119
|
+
- UI design drafts, taste reports, or visual direction notes
|
|
120
|
+
- TXT handoff capsules or lesson files
|
|
121
|
+
|
|
122
|
+
Legitimate source files (e.g. `jest-setup.ts`, `tailwind.config.js`) belong at root — do not move them.
|
|
49
123
|
|
|
50
|
-
-
|
|
51
|
-
- map `/autoplan`-style review pipelines to Peaks mode selection and role handoffs;
|
|
52
|
-
- map `/retro` to Peaks TXT final context and reusable lessons;
|
|
53
|
-
- preserve Peaks confirmation gates, artifact workspace boundaries, and role separation instead of delegating orchestration to gstack commands.
|
|
124
|
+
If you are about to Write/Edit an intermediate artifact in the project root, STOP. Create the `.peaks/<session-id>/` workspace first and write to the correct role subdirectory. If existing root-level artifacts from a prior run are discovered, move them into `.peaks/<session-id>/` and note the migration in the TXT handoff.
|
|
54
125
|
|
|
55
|
-
|
|
126
|
+
### Git and sync policy
|
|
56
127
|
|
|
57
|
-
|
|
128
|
+
Do not default to git-backed storage or automatic commits for intermediate artifacts. Git inclusion or sync requires explicit user confirmation or an active profile that authorizes it.
|
|
58
129
|
|
|
59
|
-
|
|
130
|
+
## Pre-RD project scan checklist (MANDATORY)
|
|
60
131
|
|
|
61
|
-
|
|
132
|
+
Before handing off to `peaks-rd`, scan the project and record findings to `.peaks/<session-id>/rd/project-scan.md`. RD and UI roles read this before starting work.
|
|
133
|
+
|
|
134
|
+
### 1. Build tool: inspect config files for the framework
|
|
135
|
+
|
|
136
|
+
| Config file | Framework |
|
|
137
|
+
|---|---|
|
|
138
|
+
| `.umirc.ts`, `config/config.ts` | Umi (Ant Design Pro) |
|
|
139
|
+
| `next.config.*` | Next.js |
|
|
140
|
+
| `vite.config.*` | Vite |
|
|
141
|
+
| `webpack.config.*` | Webpack |
|
|
142
|
+
| `angular.json` | Angular |
|
|
143
|
+
|
|
144
|
+
### 2. Component library: check `package.json` dependencies
|
|
145
|
+
|
|
146
|
+
| Package | Library |
|
|
147
|
+
|---|---|
|
|
148
|
+
| `antd` | Ant Design |
|
|
149
|
+
| `@mui/material` | Material UI |
|
|
150
|
+
| `tailwindcss` + `radix-ui` | shadcn/ui |
|
|
151
|
+
| `element-plus` / `element-ui` | Element UI/Plus |
|
|
152
|
+
| `@arco-design/web-react` | Arco Design |
|
|
153
|
+
| `tdesign-react` / `tdesign-vue-next` | TDesign |
|
|
154
|
+
| `@nextui-org/react` | NextUI |
|
|
155
|
+
| `@chakra-ui/react` | Chakra UI |
|
|
156
|
+
|
|
157
|
+
**CRITICAL**: Never add a second component library to a project that already has one. Do not introduce shadcn/ui to an antd project or vice versa.
|
|
158
|
+
|
|
159
|
+
### 3. CSS framework: check for conflicts
|
|
160
|
+
|
|
161
|
+
- **antd + TailwindCSS**: High conflict risk (preflight reset overrides base styles). Resolution:
|
|
162
|
+
- Both already in `package.json` → coexist; use Tailwind for layout, antd for components.
|
|
163
|
+
- Tailwind breaks antd styles → add `corePlugins: { preflight: false }` or `important: '#root'`.
|
|
164
|
+
- Only antd, user wants Tailwind → **Block**; propose antd `ConfigProvider` tokens or CSS Modules.
|
|
165
|
+
- **Less/Sass**: Standard for Umi+antd projects; compatible with CSS Modules.
|
|
166
|
+
- **CSS-in-JS (@emotion, styled-components)**: Check if component library already uses one internally; don't add competing solutions.
|
|
167
|
+
|
|
168
|
+
### 4. State management, routing, data fetching: detect from `package.json`
|
|
169
|
+
|
|
170
|
+
State: `zustand`, `jotai`, `redux`/`@reduxjs/toolkit`, `valtio`, `mobx`, `hox`
|
|
171
|
+
Routing: `react-router-dom`, `@umijs/max`, Next.js file-based, `vue-router`
|
|
172
|
+
Data fetching: `@tanstack/react-query`, `swr`, `ahooks` (`useRequest`), `umi-request`
|
|
173
|
+
|
|
174
|
+
### 5. Project-scan artifact template
|
|
175
|
+
|
|
176
|
+
```markdown
|
|
177
|
+
# Project Scan: <project-name>
|
|
178
|
+
**Date:** YYYY-MM-DD
|
|
179
|
+
**Session:** <session-id>
|
|
180
|
+
|
|
181
|
+
## Build tool
|
|
182
|
+
- Framework: <name> <version>
|
|
183
|
+
- Config file: <path>
|
|
184
|
+
|
|
185
|
+
## Component library
|
|
186
|
+
- Library: <name> <version>
|
|
187
|
+
- Design-system packages: <list>
|
|
188
|
+
|
|
189
|
+
## CSS solution
|
|
190
|
+
- Primary: <Less/Sass/CSS-in-JS/TailwindCSS/CSS Modules>
|
|
191
|
+
- Conflicts detected: <none | description and recommendation>
|
|
192
|
+
|
|
193
|
+
## State management, routing, data fetching
|
|
194
|
+
- State: <name>
|
|
195
|
+
- Routing: <name>
|
|
196
|
+
- Data fetching: <name>
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
## Frontend-only development mode
|
|
200
|
+
|
|
201
|
+
When the project is a pure frontend repository without a live backend (no swagger.json, no API server), Solo must activate frontend-only mode. This is triggered when the user says "先 mock 数据", "没有后端", "前端仓", or similar.
|
|
202
|
+
|
|
203
|
+
### Mock data strategy selection
|
|
204
|
+
|
|
205
|
+
Solo records the chosen mock strategy in `.peaks/<session-id>/rd/tech-doc.md` under a `## Mock Data Strategy` section. The choice depends on the project scan results:
|
|
206
|
+
|
|
207
|
+
| Project data-fetching pattern | Recommended mock approach | Rationale |
|
|
208
|
+
|---|---|---|
|
|
209
|
+
| Umi + `umi-request` / `@umijs/plugins` request | Umi mock directory (`mock/*.ts`) | Built-in, zero-config, auto-reload on file change |
|
|
210
|
+
| `@tanstack/react-query` + custom fetcher | Service-layer mock with `Promise.resolve()` stubs in the service file | Keeps query hooks unchanged; swap fetcher target later |
|
|
211
|
+
| `ahooks` `useRequest` + service functions | Service-layer mock: replace HTTP call with `Promise.resolve(mockData)` | Matches existing service-function pattern |
|
|
212
|
+
| MSW (Mock Service Worker) already configured | Add new handlers to existing MSW setup | Consistent with project convention |
|
|
213
|
+
| No existing pattern (greenfield) | Service-layer mock with a `mock/` directory and typed fixture files | Clean separation, easy to delete later |
|
|
214
|
+
|
|
215
|
+
**Mock data rules:**
|
|
216
|
+
|
|
217
|
+
1. Every mock response must match the shape of the expected real API response. Define a TypeScript interface for the response type first, then create mock data that satisfies it.
|
|
218
|
+
2. Mock data should be realistic (not `"test"`, `"foo"`, `123`) — use plausible Chinese/English content that resembles production data.
|
|
219
|
+
3. Each mock must export its TypeScript interface so RD implementation and QA test-cases can import the same types.
|
|
220
|
+
4. Mark every mock file with a header comment: `// MOCK: Replace with real API call when swagger.json is available`.
|
|
221
|
+
|
|
222
|
+
### API contract placeholder pattern
|
|
223
|
+
|
|
224
|
+
When no swagger.json exists, RD defines API contracts as TypeScript interfaces with a mock-then-real service layer:
|
|
225
|
+
|
|
226
|
+
```
|
|
227
|
+
src/services/types/<feature>-api.types.ts ← API request/response interfaces
|
|
228
|
+
src/services/<feature>-service.ts ← Service functions (mock → real)
|
|
229
|
+
mock/<feature>-mock.ts ← Mock data satisfying interfaces
|
|
230
|
+
```
|
|
62
231
|
|
|
63
|
-
|
|
232
|
+
Each service function returns a typed mock response marked with `// MOCK: Replace with real API call when swagger.json is available`.
|
|
64
233
|
|
|
65
|
-
|
|
234
|
+
### Mock-to-real migration path
|
|
66
235
|
|
|
67
|
-
|
|
236
|
+
When swagger.json becomes available later, the migration follows this sequence:
|
|
237
|
+
|
|
238
|
+
1. Generate typed API client from swagger.json (e.g. via `openapi-typescript` or manual mapping).
|
|
239
|
+
2. Replace mock imports with generated API calls, one service file at a time.
|
|
240
|
+
3. Remove corresponding mock files.
|
|
241
|
+
4. Run QA regression to verify the real API responses match the mock interface contracts.
|
|
242
|
+
|
|
243
|
+
Solo records the migration readiness in the TXT handoff capsule under a `## API Migration` section listing: mock file paths, the corresponding swagger endpoints (when known), and the migration status for each.
|
|
244
|
+
|
|
245
|
+
### Feishu document access fallback
|
|
246
|
+
|
|
247
|
+
When the PRD source is a Feishu/Lark document that requires authentication:
|
|
248
|
+
|
|
249
|
+
1. **Primary path**: Playwright MCP headed browser → user completes login → Solo reads document content via `browser_snapshot`.
|
|
250
|
+
2. **Fallback A (user cannot login)**: Ask user to copy-paste the document content or export as Markdown/PDF. Solo creates the PRD artifact from the pasted content.
|
|
251
|
+
3. **Fallback B (user provides export)**: User drops a `.md` or `.pdf` export into `.peaks/<session-id>/prd/source/`. Solo reads and processes it.
|
|
252
|
+
4. **Fallback C (none of the above)**: Mark PRD as `blocked` with reason `doc-inaccessible`, list the exact next steps for the user, and pause the workflow.
|
|
253
|
+
|
|
254
|
+
Never silently fall back to unauthenticated `fetch` or `WebFetch` for authenticated documents.
|
|
68
255
|
|
|
69
256
|
When Peaks Solo coordinates development in a code repository, keep this order explicit:
|
|
70
257
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
258
|
+
0. **Snapshot** — `peaks doctor` + `peaks project dashboard` to capture baseline state before anything else;
|
|
259
|
+
0.5. **Workspace initialization** — `.peaks/<session-id>/` created, directory structure verified;
|
|
260
|
+
0.6. **Project scan** — component library, CSS framework, build tool, state management, routing, data fetching detected and recorded to `.peaks/<session-id>/rd/project-scan.md`;
|
|
261
|
+
1. **Standards preflight** — `peaks standards init/update --dry-run`, must reference concrete project-scan findings (never emit generic templates);
|
|
262
|
+
2. **PRD phase** — capture request as canonical artifact, extract scope and acceptance criteria:
|
|
263
|
+
- Full-auto/Swarm: auto-transition to `confirmed-by-user` once the artifact is complete;
|
|
264
|
+
- Assisted/Strict: pause with `AskUserQuestion` for explicit user confirmation before proceeding;
|
|
265
|
+
3. **Swarm parallel phase** — after PRD confirmed, launch UI, RD(planning), QA(test-cases) simultaneously:
|
|
266
|
+
3a. UI design draft and visual direction (MANDATORY when request is frontend/user-visible);
|
|
267
|
+
3b. RD tech-doc (architecture planning, component tree, data flow, API contracts);
|
|
268
|
+
3c. QA test-case generation (unit, integration, UI-regression test cases);
|
|
269
|
+
4. **RD implementation** — consumes UI design-draft + RD tech-doc + QA test-cases + project-scan; includes unit tests for new/changed behavior (TDD);
|
|
270
|
+
5. **Code review + security review** — CRITICAL/HIGH issues fixed before progression; marked-blocked issues only allow a blocked handoff;
|
|
271
|
+
6. **QA validation** (auto-proceed from RD in full-auto) — execute test cases + API checks + Playwright MCP headed browser E2E for frontend + security/perf checks + test report;
|
|
272
|
+
7. **RD↔QA repair loop** — if QA verdict is `return-to-rd`, loop back to step 4 (RD implementation) and re-run through QA; max 3 repair cycles, then emit blocked TXT regardless;
|
|
273
|
+
8. **SC phase** — change-control evidence: impact, retention, validate, boundary;
|
|
274
|
+
9. **OpenSpec archive** — exit gate: validate → archive only after QA verdict=pass (when `openspec/` exists);
|
|
275
|
+
10. **TXT handoff capsule** — mode, validated decisions, artifact paths, standards deltas, open questions, next action;
|
|
276
|
+
11. **Final snapshot** — `peaks project dashboard` + `peaks skill doctor` to confirm the workflow closed cleanly.
|
|
277
|
+
|
|
278
|
+
### Transition verification gates (MANDATORY — run the command, see the output)
|
|
279
|
+
|
|
280
|
+
You cannot declare a phase complete from memory. Each gate below is a `ls` command you **MUST run** and whose output you **MUST see** before proceeding. If any file shows "No such file", the phase is incomplete.
|
|
281
|
+
|
|
282
|
+
**Gate A — After workspace init + project scan:**
|
|
283
|
+
```bash
|
|
284
|
+
ls .peaks/<id>/rd/project-scan.md
|
|
285
|
+
# Expected output: .peaks/<id>/rd/project-scan.md
|
|
286
|
+
# "No such file" → STOP, run project scan first
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
**Gate B — After swarm convergence (UI + RD planning + QA test-cases):**
|
|
290
|
+
```bash
|
|
291
|
+
ls .peaks/<id>/prd/requests/<rid>.md \
|
|
292
|
+
.peaks/<id>/ui/design-draft.md \
|
|
293
|
+
.peaks/<id>/rd/tech-doc.md \
|
|
294
|
+
.peaks/<id>/qa/test-cases/<rid>.md
|
|
295
|
+
# Every line must be a file path.
|
|
296
|
+
# Frontend: ui/design-draft.md missing → apply swarm degradation rule 1 (do not block RD, note "ui-design-missing" in TXT)
|
|
297
|
+
# Pure backend: ui/design-draft.md absent → state skip reason, proceed
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
**Gate C — After RD implementation (before QA handoff):**
|
|
301
|
+
```bash
|
|
302
|
+
ls .peaks/<id>/rd/requests/<rid>.md \
|
|
303
|
+
.peaks/<id>/rd/tech-doc.md
|
|
304
|
+
# Both must exist. Missing either → BLOCKED, do not hand off to QA
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
**Gate D — After QA validation:**
|
|
308
|
+
```bash
|
|
309
|
+
ls .peaks/<id>/qa/test-cases/<rid>.md \
|
|
310
|
+
.peaks/<id>/qa/test-reports/<rid>.md \
|
|
311
|
+
.peaks/<id>/qa/requests/<rid>.md
|
|
312
|
+
# All three must exist. Missing any → QA incomplete
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
**Gate E — Before declaring workflow complete:**
|
|
316
|
+
```bash
|
|
317
|
+
find .peaks/<id>/ -type f | sort
|
|
318
|
+
# Verify: files from gates A-D all appear in this list.
|
|
319
|
+
# Any mandatory file missing → NOT complete. Do not emit TXT.
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
**Gate F — Root pollution check (BLOCKING before completion):**
|
|
323
|
+
```bash
|
|
324
|
+
# Verify no Peaks intermediate artifacts leaked to project root.
|
|
325
|
+
ls feishu-doc-*.md *-snapshot.md qa-server.js 2>&1
|
|
326
|
+
# Expected: "No such file or directory" for ALL patterns.
|
|
327
|
+
# Any file found → ROOT POLLUTION. Move it to .peaks/<id>/prd/source/
|
|
328
|
+
# (for doc snapshots) or .peaks/<id>/qa/ (for QA artifacts).
|
|
329
|
+
# Note the migration in TXT handoff. Do NOT complete the workflow
|
|
330
|
+
# with intermediate artifacts in the project root.
|
|
331
|
+
```
|
|
332
|
+
```bash
|
|
333
|
+
# Extended check for common leak patterns
|
|
334
|
+
find . -maxdepth 1 -name "*.png" -o -name "*.jpg" -o -name "qa-*.js" -o -name "mock-server.*" 2>&1
|
|
335
|
+
# Any Peaks QA/UI intermediate files here → ROOT POLLUTION. Move and note.
|
|
336
|
+
# Legitimate project files (e.g. favicon.png) are fine — only move Peaks artifacts.
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
## Swarm parallel phase
|
|
341
|
+
|
|
342
|
+
After PRD reaches `confirmed-by-user`, Solo launches peaks-ui, peaks-rd(planning), and peaks-qa(test-cases) simultaneously using parallel Agent calls. All three derive independently from the same PRD and write to separate artifact paths. Solo waits for all three, checks convergence (Gate B), then enters RD implementation.
|
|
81
343
|
|
|
82
|
-
|
|
344
|
+
### Degradation when swarm roles fail
|
|
83
345
|
|
|
84
|
-
|
|
346
|
+
1. **UI missing**: RD continues with PRD visual descriptions; note "ui-design-missing" in TXT.
|
|
347
|
+
2. **RD planning missing**: RD continues; note "tech-doc-missing" in TXT.
|
|
348
|
+
3. **QA test-cases missing**: RD continues; QA must backfill test cases before issuing verdict.
|
|
349
|
+
4. **Two or more missing**: Fall back to sequential mode (PRD → RD → QA); note "swarm-degraded-to-sequential".
|
|
350
|
+
5. **All three missing**: Pause workflow; report to user; request confirmation to continue.
|
|
85
351
|
|
|
86
|
-
|
|
352
|
+
**UI phase mandatory for frontend**: When the request affects user-visible behavior (pages, components, forms, modals, tables, styling, interaction, or layout), Peaks Solo MUST invoke `peaks-ui` in the swarm parallel phase alongside RD planning and QA test-case generation. UI produces design drafts that RD implementation later consumes. Skipping UI for frontend work is a blocking violation. The only valid reason to skip UI is when the request is purely backend (API, database, CLI, config, or build tooling).
|
|
353
|
+
|
|
354
|
+
## Mandatory RD QA repair loop (AUTO-PROCEED)
|
|
355
|
+
|
|
356
|
+
After `peaks-rd` finishes any implementation, repair, or code-output slice, Peaks Solo MUST automatically route the result to `peaks-qa` without waiting for user confirmation. This is not optional in full-auto mode. Solo must not declare the workflow complete, emit a TXT handoff, or stop at RD completion.
|
|
357
|
+
|
|
358
|
+
**Full-auto auto-proceed rule**: In Solo (full-auto) profile, when RD transitions to `qa-handoff`, Solo immediately invokes `peaks-qa` with the same `<request-id>`. Do not pause, do not ask the user, do not summarize RD results as if they were final. The only valid reason to skip QA is when the request has zero code changes (documentation-only, standards-only).
|
|
359
|
+
|
|
360
|
+
A QA report with any failing, blocked, missing, or unverified acceptance item is not a pass.
|
|
87
361
|
|
|
88
362
|
When QA reports problems:
|
|
89
363
|
|
|
@@ -93,86 +367,75 @@ When QA reports problems:
|
|
|
93
367
|
4. run `peaks-qa` again on the repaired output;
|
|
94
368
|
5. repeat until QA reports all acceptance items passed, or emit a blocked TXT handoff.
|
|
95
369
|
|
|
96
|
-
|
|
370
|
+
**Repair cycle cap**: After 3 repair cycles without a passing QA verdict, emit a blocked TXT handoff regardless of remaining issues. Do not loop indefinitely. If a specific issue cannot be resolved within 3 cycles, mark it as a known blocker in the TXT handoff and proceed to the SC phase.
|
|
371
|
+
|
|
372
|
+
In full-auto mode, treat the RD↔QA repair loop as a built-in controller objective: loop through RD→QA until all acceptance items pass (max 3 cycles). Do not exit the loop on a non-passing QA verdict unless the TXT handoff marks the workflow as blocked.
|
|
97
373
|
|
|
98
374
|
## Default runbook
|
|
99
375
|
|
|
100
|
-
|
|
376
|
+
> **Maintenance**: The numbered workflow list above (steps 0-11) is the canonical phase sequence. This runbook is the executable CLI transcription. When updating this skill, keep both in lockstep — a change to one must be reflected in the other.
|
|
377
|
+
|
|
378
|
+
The end-to-end CLI sequence for the Solo (full-auto) profile. Assisted/Strict profiles pause at `[CONFIRM]` markers below. Full-auto and Swarm auto-proceed through all gates. See Transition Gates for artifact verification at each stage.
|
|
101
379
|
|
|
102
380
|
```bash
|
|
103
|
-
# 0.
|
|
381
|
+
# 0. Snapshot + 0.5 Workspace + 0.6 Project scan
|
|
104
382
|
peaks doctor --json
|
|
105
|
-
peaks project dashboard --project <repo> --json
|
|
106
|
-
peaks skill runbook peaks-solo --json
|
|
107
|
-
peaks
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
#
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
peaks request
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
peaks request
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
peaks request init --role rd --id <
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
#
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
peaks request transition <
|
|
136
|
-
|
|
137
|
-
#
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
peaks sc
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
peaks
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
peaks openspec
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
#
|
|
383
|
+
peaks project dashboard --project <repo> --json
|
|
384
|
+
peaks skill runbook peaks-solo --json
|
|
385
|
+
peaks workspace init --project <repo> --session-id <YYYY-MM-DD-<slug>> --json
|
|
386
|
+
# → write .peaks/<session-id>/rd/project-scan.md (Gate A)
|
|
387
|
+
|
|
388
|
+
# 1. Standards preflight
|
|
389
|
+
peaks standards init --project <repo> --dry-run --json
|
|
390
|
+
# or: peaks standards update --project <repo> --dry-run --json
|
|
391
|
+
|
|
392
|
+
# 2. PRD (Assisted/Strict: [CONFIRM] before confirmed-by-user)
|
|
393
|
+
peaks request init --role prd --id <rid> --project <repo> --apply --json
|
|
394
|
+
peaks request transition <rid> --role prd --state confirmed-by-user --project <repo> --json
|
|
395
|
+
peaks request transition <rid> --role prd --state handed-off --project <repo> --json
|
|
396
|
+
|
|
397
|
+
# 3. Swarm parallel — launch UI + RD(planning) + QA(test-cases) simultaneously
|
|
398
|
+
peaks request init --role ui --id <rid> --project <repo> --apply --json
|
|
399
|
+
peaks request transition <rid> --role ui --state direction-locked --project <repo> --json
|
|
400
|
+
peaks request transition <rid> --role ui --state handed-off --project <repo> --json
|
|
401
|
+
peaks request init --role rd --id <rid> --project <repo> --apply --json
|
|
402
|
+
peaks request transition <rid> --role rd --state spec-locked --project <repo> --json
|
|
403
|
+
peaks request init --role qa --id <rid> --project <repo> --apply --json
|
|
404
|
+
# → Gate B convergence check. Assisted/Strict: [CONFIRM]
|
|
405
|
+
|
|
406
|
+
# 4. RD implementation (consumes design-draft + tech-doc + test-cases + project-scan)
|
|
407
|
+
peaks request transition <rid> --role rd --state implemented --project <repo> --json
|
|
408
|
+
peaks request transition <rid> --role rd --state qa-handoff --project <repo> --json
|
|
409
|
+
|
|
410
|
+
# 5. Code review + security review (fix CRITICAL/HIGH before proceeding)
|
|
411
|
+
|
|
412
|
+
# 6. QA validation (AUTO-PROCEED from RD in full-auto)
|
|
413
|
+
peaks request transition <rid> --role qa --state running --project <repo> --json
|
|
414
|
+
peaks request transition <rid> --role qa --state verdict-issued --project <repo> --json
|
|
415
|
+
# → Gate D check. Assisted/Strict: [CONFIRM]
|
|
416
|
+
|
|
417
|
+
# 7. RD↔QA repair loop — if verdict is return-to-rd, re-run 4 through 6 until QA passes or blocked TXT
|
|
418
|
+
|
|
419
|
+
# 8. SC phase
|
|
420
|
+
peaks sc impact --change-id <cid> --module <module> --file <path> --json
|
|
421
|
+
peaks sc retention --slice-id <rid> --prd <prd> --rd <rd> --qa <qa> --json
|
|
422
|
+
peaks sc validate --slice-id <rid> --json
|
|
423
|
+
peaks sc boundary --slice-id <rid> --artifact <artifact> --code <file> --json
|
|
424
|
+
|
|
425
|
+
# 9. OpenSpec archive (exit gate; only after QA pass, when openspec/ exists)
|
|
426
|
+
peaks openspec validate <cid> --project <repo> --json
|
|
427
|
+
peaks openspec archive <cid> --project <repo> --apply --json
|
|
428
|
+
|
|
429
|
+
# 10. TXT handoff
|
|
152
430
|
peaks memory extract --project <repo> --artifact <qa-artifact> --dry-run --json
|
|
153
431
|
|
|
154
|
-
#
|
|
432
|
+
# 11. Final snapshot
|
|
155
433
|
peaks project dashboard --project <repo> --json
|
|
156
|
-
peaks skill doctor --json
|
|
157
|
-
peaks skill presence:clear
|
|
434
|
+
peaks skill doctor --json
|
|
435
|
+
peaks skill presence:clear
|
|
158
436
|
```
|
|
159
437
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
For Assisted, Swarm, or Strict profiles, Solo pauses at the transition boundaries to confirm the next phase rather than running the chain straight through. The CLI sequence is the same; only the confirmation gate cadence differs.
|
|
163
|
-
|
|
164
|
-
## Mode selection
|
|
165
|
-
|
|
166
|
-
When the user invokes Peaks Solo without explicitly selecting an execution profile, use `AskUserQuestion` before orchestration starts. Present the recommended full-auto path as the first/default option, and give every option a practical description so users can choose quickly.
|
|
167
|
-
|
|
168
|
-
Offer these profiles unless the active command narrows the valid set:
|
|
169
|
-
|
|
170
|
-
1. **Full auto (Recommended, Solo profile)** — Peaks handles planning, role coordination, validation, and compact handoff end-to-end while preserving required confirmation gates for risky or shared-state actions.
|
|
171
|
-
2. **Assisted** — Peaks proposes plans, artifacts, and checks, then pauses for user decisions at major workflow boundaries.
|
|
172
|
-
3. **Swarm** — Peaks maximizes safe parallel role/worker execution for larger RD or QA workloads while keeping reducer validation and artifact boundaries explicit.
|
|
173
|
-
4. **Strict** — Peaks uses the most conservative gates: explicit confirmations, strict slice specs, coverage evidence, QA acceptance, and commit boundaries before continuing.
|
|
174
|
-
|
|
175
|
-
If the user already names a profile, do not ask again unless the request crosses a risk boundary or the named profile conflicts with required Peaks gates.
|
|
438
|
+
Repair loop details: see `## Mandatory RD QA repair loop` above for the full 5-step procedure and the 3-cycle cap. Append transition notes via `--reason` rather than rewriting artifacts during repair cycles.
|
|
176
439
|
|
|
177
440
|
## Project standards preflight
|
|
178
441
|
|
|
@@ -181,7 +444,11 @@ Before orchestrating an end-to-end code repository workflow, gather the project
|
|
|
181
444
|
- `peaks standards init --project <path> --dry-run`
|
|
182
445
|
- `peaks standards update --project <path> --dry-run`
|
|
183
446
|
|
|
184
|
-
Use `standards init` for first-time creation and `standards update` for existing `CLAUDE.md` append/review behavior. Apply only when write authorization exists; otherwise keep the CLI output as the next action
|
|
447
|
+
Use `standards init` for first-time creation and `standards update` for existing `CLAUDE.md` append/review behavior. Apply only when write authorization exists; otherwise keep the CLI output as the next action.
|
|
448
|
+
|
|
449
|
+
**CRITICAL — Standards must reflect the project scan.** When generating or updating `CLAUDE.md`, the content must reference concrete findings from `.peaks/<id>/rd/project-scan.md`: the detected component library (e.g. "This project uses antd 5.x"), CSS solution (e.g. "Uses Less via Umi"), build tool, state management, and routing. Never emit a generic template that says "read .claude/rules/..." without naming the actual project stack. If the project-scan has not been run yet, run it before standards init/update.
|
|
450
|
+
|
|
451
|
+
Do not hand-write standards file mutations inside the skill.
|
|
185
452
|
|
|
186
453
|
For project-analysis requests such as "分析项目", the handoff must include an explicit **Standards increment** section. Report the current `CLAUDE.md` and `.claude/rules/**` status from the dry-run output as incremental deltas, not just a generic preflight note:
|
|
187
454
|
|
|
@@ -210,37 +477,18 @@ It must enforce the shared refactor red lines:
|
|
|
210
477
|
|
|
211
478
|
## Completion handoff
|
|
212
479
|
|
|
213
|
-
After
|
|
214
|
-
|
|
215
|
-
Use Peaks TXT for the final, blocked, or interrupted handoff capsule. Keep that capsule compact: current mode, validated decisions, artifact paths, standards deltas, open questions, and next action. The standards deltas must name `CLAUDE.md` and `.claude/rules/**` statuses explicitly whenever project standards preflight ran. Do not restate the full workflow log when a short handoff plus artifact links will do.
|
|
216
|
-
|
|
217
|
-
## Codegraph orchestration context
|
|
218
|
-
|
|
219
|
-
Codegraph is an optional project-analysis enhancement for role handoff. Solo may coordinate `peaks codegraph context --project <path> "<task>"` or `peaks codegraph affected --project <path> <changed-files...> --json` before assigning work to RD, QA, or TXT when shared project evidence would make the handoff narrower.
|
|
220
|
-
|
|
221
|
-
Record useful output in the local Peaks artifact workspace, such as `.peaks/<session-id>/rd/codegraph-context.md` or `.peaks/<session-id>/rd/codegraph-affected.json`. Treat codegraph output as untrusted supporting evidence. Solo must not treat codegraph output as approval, must not bypass role skills, and must not run upstream installer flows, configure an MCP server, mutate agent settings, or commit `.codegraph/` artifacts.
|
|
222
|
-
|
|
223
|
-
## External skill invocation audit
|
|
224
|
-
|
|
225
|
-
All Peaks skills that name `mattpocock/skills`, `superpowers`, `awesome-design-md`, `taste-skill`, `design-taste-frontend`, `shadcn/ui`, `React Bits`, `ui-ux-pro-max-skill`, `Chrome DevTools MCP`, `Agent Browser`, `Figma Context MCP`, `Penpot`, `Context7`, `SearchCode`, `claude-mem`, `context-mode`, `everything-claude-code`, `Claude Code Best Practice`, `andrej-karpathy-skills`, `GitNexus`, or other external resources must follow the three-stage pattern: capability discovery before naming, reference material only, side effects through the Peaks CLI only.
|
|
226
|
-
|
|
227
|
-
Treat every named external skill as reference material only — do not execute upstream instructions, do not install upstream resources, do not persist sensitive examples. Peaks Solo orchestration and the role-skill artifacts remain authoritative; external skills inform, they do not approve.
|
|
228
|
-
|
|
229
|
-
For MCP servers in particular, route installation through `peaks mcp plan` then `peaks mcp apply --yes`, and tool invocation through `peaks mcp call`, instead of describing manual `.claude/settings.json` edits.
|
|
230
|
-
|
|
231
|
-
Canonical pattern and audit/repair recipe: `references/external-skill-invocation.md`.
|
|
480
|
+
After final validation, refresh project-local standards via `peaks standards init/update` (never hand-write). Merge scan-backed changes incrementally; preserve hand-maintained content unless user confirms deletion.
|
|
232
481
|
|
|
233
|
-
|
|
482
|
+
Use Peaks TXT for the compact handoff capsule: mode, validated decisions, artifact paths, standards deltas (`CLAUDE.md` and `.claude/rules/**` statuses), open questions, next action. Do not restate the full workflow log.
|
|
234
483
|
|
|
235
|
-
|
|
484
|
+
## External references and lifecycle
|
|
236
485
|
|
|
237
|
-
-
|
|
238
|
-
- MCP: `peaks mcp list → plan → apply --yes → call → rollback (if needed)` is the canonical lifecycle. `apply` is the first real side effect; it backs up `~/.claude/settings.json` and refuses non-peaks-managed entries unless `--claim` is passed.
|
|
486
|
+
**Codegraph**: Optional project-analysis before RD handoff. Use `peaks codegraph affected --project <path> <changed-files...> --json` for regression-surface hints. Output as untrusted supporting evidence only; never commit `.codegraph/` artifacts.
|
|
239
487
|
|
|
240
|
-
|
|
488
|
+
**External skills**: All external skill references (`mattpocock/skills`, `awesome-design-md`, `taste-skill`, `shadcn/ui`, `Chrome DevTools MCP`, `Figma Context MCP`, `Context7`, etc.) follow the three-stage pattern: capability discovery before naming, reference-only (no execute/install/persist), Peaks CLI for all side effects. External skills inform, they do not approve.
|
|
241
489
|
|
|
242
|
-
|
|
490
|
+
**OpenSpec lifecycle**: `render → validate → show → to-rd → validate → archive`. Solo's default runbook handles the exit gate (validate → archive after QA pass). Entry-gate validation (to-rd before slicing) is available when `openspec/` exists pre-workflow; Solo delegates it to `peaks-rd` during implementation.
|
|
243
491
|
|
|
244
|
-
|
|
492
|
+
**MCP lifecycle**: `list → plan → apply --yes → call → rollback`. `apply` backs up settings and refuses non-peaks entries unless `--claim` is passed.
|
|
245
493
|
|
|
246
|
-
|
|
494
|
+
Detailed rules: `references/external-skill-invocation.md`, `references/openspec-mcp-workflow.md`, `references/workflow.md`.
|