peaks-cli 1.4.2 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +51 -0
- package/CHANGELOG.md +238 -0
- package/README-en.md +226 -0
- package/README.md +152 -122
- package/dist/src/cli/commands/agent-commands.d.ts +20 -0
- package/dist/src/cli/commands/agent-commands.js +48 -0
- package/dist/src/cli/commands/audit-commands.d.ts +18 -0
- package/dist/src/cli/commands/audit-commands.js +138 -0
- package/dist/src/cli/commands/classify-classify-commands.d.ts +19 -0
- package/dist/src/cli/commands/classify-classify-commands.js +151 -0
- package/dist/src/cli/commands/code-review-commands.d.ts +34 -0
- package/dist/src/cli/commands/code-review-commands.js +83 -0
- package/dist/src/cli/commands/config-commands.js +90 -0
- package/dist/src/cli/commands/context-commands.d.ts +21 -0
- package/dist/src/cli/commands/context-commands.js +167 -0
- package/dist/src/cli/commands/core-artifact-commands.js +60 -2
- package/dist/src/cli/commands/hook-handle.js +50 -0
- package/dist/src/cli/commands/loop-commands.d.ts +21 -0
- package/dist/src/cli/commands/loop-commands.js +128 -0
- package/dist/src/cli/commands/openspec-commands.js +37 -0
- package/dist/src/cli/commands/preferences-commands.d.ts +2 -0
- package/dist/src/cli/commands/preferences-commands.js +147 -0
- package/dist/src/cli/commands/skill-conformance-commands.d.ts +9 -0
- package/dist/src/cli/commands/skill-conformance-commands.js +39 -0
- package/dist/src/cli/commands/understand-commands.js +34 -0
- package/dist/src/cli/commands/upgrade-commands.d.ts +23 -0
- package/dist/src/cli/commands/upgrade-commands.js +57 -0
- package/dist/src/cli/commands/workflow-commands.js +70 -0
- package/dist/src/cli/commands/workspace-commands.js +86 -0
- package/dist/src/cli/program.js +30 -0
- package/dist/src/services/agent/ecc-agent-service.d.ts +47 -0
- package/dist/src/services/agent/ecc-agent-service.js +143 -0
- package/dist/src/services/artifacts/request-artifact-service.js +14 -0
- package/dist/src/services/audit/backing-detector.d.ts +24 -0
- package/dist/src/services/audit/backing-detector.js +59 -0
- package/dist/src/services/audit/classifier.d.ts +38 -0
- package/dist/src/services/audit/classifier.js +127 -0
- package/dist/src/services/audit/enforcers/active-skill-resolver.d.ts +29 -0
- package/dist/src/services/audit/enforcers/active-skill-resolver.js +71 -0
- package/dist/src/services/audit/enforcers/design-draft-confirm.d.ts +25 -0
- package/dist/src/services/audit/enforcers/design-draft-confirm.js +54 -0
- package/dist/src/services/audit/enforcers/lint-audit-regression.d.ts +21 -0
- package/dist/src/services/audit/enforcers/lint-audit-regression.js +86 -0
- package/dist/src/services/audit/enforcers/lint-catalog-governance.d.ts +27 -0
- package/dist/src/services/audit/enforcers/lint-catalog-governance.js +38 -0
- package/dist/src/services/audit/enforcers/lint-cli-back.d.ts +16 -0
- package/dist/src/services/audit/enforcers/lint-cli-back.js +35 -0
- package/dist/src/services/audit/enforcers/lint-output-style.d.ts +11 -0
- package/dist/src/services/audit/enforcers/lint-output-style.js +94 -0
- package/dist/src/services/audit/enforcers/lint-reference-integrity.d.ts +6 -0
- package/dist/src/services/audit/enforcers/lint-reference-integrity.js +83 -0
- package/dist/src/services/audit/enforcers/lint-reference-shape.d.ts +30 -0
- package/dist/src/services/audit/enforcers/lint-reference-shape.js +272 -0
- package/dist/src/services/audit/enforcers/lint-style.d.ts +49 -0
- package/dist/src/services/audit/enforcers/lint-style.js +173 -0
- package/dist/src/services/audit/enforcers/lint-workflow-shape.d.ts +5 -0
- package/dist/src/services/audit/enforcers/lint-workflow-shape.js +141 -0
- package/dist/src/services/audit/enforcers/login-gate.d.ts +23 -0
- package/dist/src/services/audit/enforcers/login-gate.js +40 -0
- package/dist/src/services/audit/enforcers/mock-placement.d.ts +25 -0
- package/dist/src/services/audit/enforcers/mock-placement.js +48 -0
- package/dist/src/services/audit/enforcers/no-root-pollution.d.ts +21 -0
- package/dist/src/services/audit/enforcers/no-root-pollution.js +56 -0
- package/dist/src/services/audit/enforcers/pre-rd-scan.d.ts +22 -0
- package/dist/src/services/audit/enforcers/pre-rd-scan.js +23 -0
- package/dist/src/services/audit/enforcers/prototype-fidelity.d.ts +25 -0
- package/dist/src/services/audit/enforcers/prototype-fidelity.js +75 -0
- package/dist/src/services/audit/enforcers/resume-detection.d.ts +21 -0
- package/dist/src/services/audit/enforcers/resume-detection.js +52 -0
- package/dist/src/services/audit/enforcers/solo-code-ban.d.ts +23 -0
- package/dist/src/services/audit/enforcers/solo-code-ban.js +27 -0
- package/dist/src/services/audit/enforcers/sub-agent-sid.d.ts +25 -0
- package/dist/src/services/audit/enforcers/sub-agent-sid.js +63 -0
- package/dist/src/services/audit/enforcers/tech-doc-presence.d.ts +28 -0
- package/dist/src/services/audit/enforcers/tech-doc-presence.js +35 -0
- package/dist/src/services/audit/red-line-catalog-p2-a.d.ts +21 -0
- package/dist/src/services/audit/red-line-catalog-p2-a.js +233 -0
- package/dist/src/services/audit/red-line-catalog-p2-b.d.ts +19 -0
- package/dist/src/services/audit/red-line-catalog-p2-b.js +225 -0
- package/dist/src/services/audit/red-line-catalog.d.ts +51 -0
- package/dist/src/services/audit/red-line-catalog.js +210 -0
- package/dist/src/services/audit/red-lines-service.d.ts +23 -0
- package/dist/src/services/audit/red-lines-service.js +486 -0
- package/dist/src/services/audit/scanners/openspec-scanner.d.ts +15 -0
- package/dist/src/services/audit/scanners/openspec-scanner.js +55 -0
- package/dist/src/services/audit/scanners/rules-tree-scanner.d.ts +16 -0
- package/dist/src/services/audit/scanners/rules-tree-scanner.js +56 -0
- package/dist/src/services/audit/scanners/skills-tree-scanner.d.ts +17 -0
- package/dist/src/services/audit/scanners/skills-tree-scanner.js +46 -0
- package/dist/src/services/audit/static-service.d.ts +57 -0
- package/dist/src/services/audit/static-service.js +125 -0
- package/dist/src/services/audit/types.d.ts +69 -0
- package/dist/src/services/audit/types.js +13 -0
- package/dist/src/services/classify/classify-service.d.ts +42 -0
- package/dist/src/services/classify/classify-service.js +122 -0
- package/dist/src/services/classify/classify-types.d.ts +79 -0
- package/dist/src/services/classify/classify-types.js +90 -0
- package/dist/src/services/code-review/ocr-service.d.ts +129 -0
- package/dist/src/services/code-review/ocr-service.js +362 -0
- package/dist/src/services/config/config-migration.d.ts +32 -0
- package/dist/src/services/config/config-migration.js +92 -0
- package/dist/src/services/config/config-restore.d.ts +10 -0
- package/dist/src/services/config/config-restore.js +47 -0
- package/dist/src/services/config/config-rollback.d.ts +13 -0
- package/dist/src/services/config/config-rollback.js +26 -0
- package/dist/src/services/config/config-service.d.ts +35 -2
- package/dist/src/services/config/config-service.js +81 -0
- package/dist/src/services/config/config-types.d.ts +58 -0
- package/dist/src/services/config/config-types.js +6 -0
- package/dist/src/services/doctor/doctor-service.js +96 -0
- package/dist/src/services/ide/adapters/hermes-adapter.d.ts +21 -0
- package/dist/src/services/ide/adapters/hermes-adapter.js +51 -0
- package/dist/src/services/ide/adapters/openclaw-adapter.d.ts +14 -0
- package/dist/src/services/ide/adapters/openclaw-adapter.js +42 -0
- package/dist/src/services/ide/ide-registry.js +7 -0
- package/dist/src/services/ide/ide-types.d.ts +1 -1
- package/dist/src/services/openspec/openspec-propose-from-doctor-service.d.ts +31 -0
- package/dist/src/services/openspec/openspec-propose-from-doctor-service.js +95 -0
- package/dist/src/services/preferences/preferences-service.d.ts +6 -0
- package/dist/src/services/preferences/preferences-service.js +43 -0
- package/dist/src/services/preferences/preferences-types.d.ts +90 -0
- package/dist/src/services/preferences/preferences-types.js +38 -0
- package/dist/src/services/skills/skill-conformance-service.d.ts +40 -0
- package/dist/src/services/skills/skill-conformance-service.js +136 -0
- package/dist/src/services/skills/skill-runbook-service.js +44 -10
- package/dist/src/services/skills/sync-service.d.ts +43 -0
- package/dist/src/services/skills/sync-service.js +99 -0
- package/dist/src/services/slice/slice-check-service.js +166 -13
- package/dist/src/services/slice/slice-check-types.d.ts +1 -1
- package/dist/src/services/standards/migrate-claude-rules-service.d.ts +19 -0
- package/dist/src/services/standards/migrate-claude-rules-service.js +193 -0
- package/dist/src/services/understand/understand-scan-service.js +15 -2
- package/dist/src/services/understand/understand-types.d.ts +26 -0
- package/dist/src/services/upgrade/1x-detector-service.d.ts +7 -0
- package/dist/src/services/upgrade/1x-detector-service.js +94 -0
- package/dist/src/services/upgrade/gitignore-migrate-service.d.ts +56 -0
- package/dist/src/services/upgrade/gitignore-migrate-service.js +170 -0
- package/dist/src/services/upgrade/upgrade-service.d.ts +47 -0
- package/dist/src/services/upgrade/upgrade-service.js +381 -0
- package/dist/src/services/workspace/sid-naming-guard.d.ts +14 -0
- package/dist/src/services/workspace/sid-naming-guard.js +31 -0
- package/dist/src/services/workspace/workspace-archive-service.d.ts +19 -0
- package/dist/src/services/workspace/workspace-archive-service.js +32 -0
- package/dist/src/services/workspace/workspace-clean-service.d.ts +41 -0
- package/dist/src/services/workspace/workspace-clean-service.js +86 -0
- package/dist/src/services/workspace/workspace-state-service.d.ts +7 -0
- package/dist/src/services/workspace/workspace-state-service.js +43 -0
- package/dist/src/shared/change-id.js +4 -1
- package/dist/src/shared/version.d.ts +1 -1
- package/dist/src/shared/version.js +1 -1
- package/package.json +8 -2
- package/schemas/doctor-report.schema.json +1 -1
- package/scripts/install-skills.mjs +296 -12
- package/skills/peaks-doctor/SKILL.md +59 -0
- package/skills/peaks-doctor/references/doctor-check-catalog.md +31 -0
- package/skills/peaks-doctor/references/from-doctor-flow.md +64 -0
- package/skills/peaks-doctor/test_prompts.json +17 -0
- package/skills/peaks-ide/SKILL.md +2 -0
- package/skills/peaks-qa/SKILL.md +9 -7
- package/skills/peaks-qa/references/artifact-per-request.md +19 -5
- package/skills/peaks-qa/references/qa-perf-test-plan.md +6 -6
- package/skills/peaks-qa/references/qa-runbook.md +1 -1
- package/skills/peaks-rd/SKILL.md +25 -10
- package/skills/peaks-rd/references/ocr-integration.md +214 -0
- package/skills/peaks-rd/references/rd-fanout-contracts.md +70 -0
- package/skills/peaks-rd/references/rd-runbook.md +1 -1
- package/skills/peaks-solo/SKILL.md +10 -4
- package/skills/peaks-solo/references/step-0-55-1x-detection.md +82 -0
- package/skills/peaks-solo/references/workflow-gates-and-types.md +9 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# peaks-rd 4-way parallel fan-out (slice 004)
|
|
2
|
+
|
|
3
|
+
The Parallel review fan-out is the canonical RD-side review pattern: at the
|
|
4
|
+
end of implementation, RD fires 4 sub-agents in parallel via
|
|
5
|
+
`peaks sub-agent dispatch <role>` instead of running them sequentially.
|
|
6
|
+
|
|
7
|
+
## The 4 sub-agents
|
|
8
|
+
|
|
9
|
+
- **Sub-agent 1 — code-reviewer** runs `code-review` against the diff and
|
|
10
|
+
writes `rd/code-review.md`.
|
|
11
|
+
- **Sub-agent 2 — security-reviewer** runs `security-review` against the
|
|
12
|
+
changed surface and writes `rd/security-review.md`.
|
|
13
|
+
- **Sub-agent 3 — perf-baseline-reviewer** measures the perf surface
|
|
14
|
+
(slice 025) and writes `rd/perf-baseline.md`. Skipped when the slice
|
|
15
|
+
has no perf surface (e.g. config / docs / chore) or when the bugfix
|
|
16
|
+
is not perf-shaped.
|
|
17
|
+
- **Sub-agent 4 — qa-test-cases-writer** drafts the QA test plan and
|
|
18
|
+
writes `qa/test-cases/<rid>.md`. The test plan is the deliverable —
|
|
19
|
+
these test cases do NOT need to be executed by this sub-agent (the
|
|
20
|
+
QA reviewer executes them in Gate D). Do NOT write to `tests/`; the
|
|
21
|
+
writer's only write target is `qa/test-cases/<rid>.md`.
|
|
22
|
+
|
|
23
|
+
## Hard prohibitions on all 4 sub-agents (single block)
|
|
24
|
+
|
|
25
|
+
- Sub-agents are spawned via `Skill(skill="...")` and run in their own
|
|
26
|
+
conversation context. They MUST NOT mutate parent settings
|
|
27
|
+
(`peaks skill presence:set`, hooks install, `.claude/settings.json`).
|
|
28
|
+
- Sub-agents MUST NOT call `peaks workflow verify-pipeline` — that is
|
|
29
|
+
Solo's responsibility.
|
|
30
|
+
- Sub-agents MUST NOT modify the request artifact body — they only
|
|
31
|
+
write their respective review artifact.
|
|
32
|
+
- Sub-agents MUST NOT install or persist external material (no
|
|
33
|
+
`npm install` of unapproved packages, no Playwright MCP install).
|
|
34
|
+
- Sub-agents return a compact JSON envelope
|
|
35
|
+
(`{ ok, artifact, blockers, notes }`) to the parent RD loop; the
|
|
36
|
+
parent aggregates into the final qa-handoff.
|
|
37
|
+
|
|
38
|
+
## Aggregation
|
|
39
|
+
|
|
40
|
+
The parent RD loop receives the 4 envelopes, runs `peaks request lint`
|
|
41
|
+
on the produced artifacts, and only then attempts
|
|
42
|
+
`peaks request transition --state qa-handoff`. The aggregation step
|
|
43
|
+
runs 4 ls checks: Gate B3 (code-review file), Gate B4 (security-review
|
|
44
|
+
file), Gate B9 (perf-baseline file, when the slice has a perf
|
|
45
|
+
surface), and the `qa-test-cases` pre-draft (the 4th sub-agent's
|
|
46
|
+
deliverable). A failure in any of the 4 sub-agents → blocked, no
|
|
47
|
+
auto-downgrade.
|
|
48
|
+
|
|
49
|
+
## Degradation
|
|
50
|
+
|
|
51
|
+
When the `qa-test-cases-writer` sub-agent fails, the parent RD loop
|
|
52
|
+
records the failure as `qa-test-cases-subagent-degraded-to-inline-qa-draft`
|
|
53
|
+
in the request artifact and proceeds; the QA main loop falls back to
|
|
54
|
+
drafting the test plan inline at Gate D. The other 3 sub-agents
|
|
55
|
+
(code-reviewer, security-reviewer, perf-baseline-reviewer) are NOT
|
|
56
|
+
degradeable — their failure blocks qa-handoff.
|
|
57
|
+
|
|
58
|
+
## Gate C evidence (RD-side, type-specific)
|
|
59
|
+
|
|
60
|
+
| Request type | Required RD evidence (under `.peaks/<id>/`) |
|
|
61
|
+
|---|---|
|
|
62
|
+
| feature / refactor | `rd/tech-doc.md` + `rd/code-review.md` + `rd/security-review.md` + `rd/perf-baseline.md` + `qa/test-cases/<rid>.md` |
|
|
63
|
+
| bugfix | `rd/bug-analysis.md` + `rd/code-review.md` + `rd/security-review.md` + `qa/test-cases/<rid>.md` (rd/perf-baseline.md only when perf-shaped) |
|
|
64
|
+
| config | `rd/security-review.md` |
|
|
65
|
+
| docs / chore | (no extra evidence required) |
|
|
66
|
+
|
|
67
|
+
Always required (in addition to the type-specific row):
|
|
68
|
+
`ls .peaks/<id>/rd/requests/<rid>.md`. Missing any required file →
|
|
69
|
+
DO NOT attempt the qa-handoff transition; CLI will reject with
|
|
70
|
+
`PREREQUISITES_MISSING`.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
## Default runbook (RD)
|
|
2
2
|
|
|
3
3
|
> Body of `## Default runbook` + numbered runbook steps #0–#8. The default sequence the RD skill should execute for a code-touching request. Skip steps that do not apply to the request type; do not skip the artifact, coverage gate, or red-line scope steps.
|
|
4
4
|
|
|
@@ -72,6 +72,12 @@ After Step 0 anchored the workspace, run the resume-detection probe (one `find`
|
|
|
72
72
|
|
|
73
73
|
→ see `references/resume-detection.md` for the full detection algorithm + classification table.
|
|
74
74
|
|
|
75
|
+
### Peaks-Cli Step 0.55: 1.x → 2.0 detection (BLOCKING on first invocation per session, when the project is not on a 2.0 layout)
|
|
76
|
+
|
|
77
|
+
Per the "one-key completion" tenet (2026-06-11), peaks-cli 2.0 should detect a 1.x consumer project and prompt the user to upgrade. After Step 0.7 returns "fresh" (no in-flight slice), run the 1.x detection probe: `peaks upgrade --detect-1x --project <root> --json`. If the result is `isOneX: true`, surface an `AskUserQuestion` with the upgrade prompt. Persist the decision to `.peaks/preferences.json` (key: `autoUpgradePrompt` with values `opt-in` / `skip-this-session` / `skip-forever`) so subsequent runs in the same project don't re-ask.
|
|
78
|
+
|
|
79
|
+
→ see `references/step-0-55-1x-detection.md` for the full detection algorithm + AskUserQuestion options + persistence contract.
|
|
80
|
+
|
|
75
81
|
### Peaks-Cli Step 1: Mode selection
|
|
76
82
|
|
|
77
83
|
When the user did not name a profile (`full-auto` / `assisted` / `swarm` / `strict`), use `AskUserQuestion` with `Full auto (Recommended)` as the first option. Map the choice to `--mode` value.
|
|
@@ -191,15 +197,15 @@ After final validation, refresh project-local standards via `peaks standards ini
|
|
|
191
197
|
|
|
192
198
|
## Peaks-Cli External references and lifecycle
|
|
193
199
|
|
|
194
|
-
Inventory of 3rd-party integrations (codegraph, mattpocock/skills, shadcn/ui, MCPs, Context7). Three-stage pattern: capability discovery via `peaks capabilities` → references only → Peaks-Cli CLI for side effects.
|
|
200
|
+
Inventory of 3rd-party integrations (codegraph, mattpocock/skills, shadcn/ui, MCPs, Context7). Three-stage pattern: capability discovery via `peaks capabilities` → references only → Peaks-Cli CLI for side effects. Peaks-Cli artifacts and Peaks-Cli acceptance criteria remain authoritative; do not execute upstream installer scripts; MCP servers (Playwright MCP, Chrome DevTools MCP, Figma Context MCP) are not managed by peaks-cli — the LLM checks its own tool list for `mcp__<server>__*` entries; if absent, the user installs via the IDE-native install command (e.g. `claude mcp add playwright -- npx @playwright/mcp@latest` for Claude Code).
|
|
195
201
|
|
|
196
|
-
→ see `references/external-references.md` for the full inventory + lifecycle rules.
|
|
202
|
+
→ see `references/external-references.md` for the full inventory + lifecycle rules, and `references/external-skill-invocation.md` for the three-stage (Discovery → Reference → Side effect through Peaks CLI only) contract + the do-not-execute / do-not-persist / tool-list self-check rules.
|
|
197
203
|
|
|
198
204
|
## Codegraph orchestration context
|
|
199
205
|
|
|
200
|
-
Solo treats `peaks codegraph affected --project <path> <changed-files...> --json` as optional project-analysis enhancement. Output is untrusted supporting evidence — never treat as approval for scope, design, or QA verdict.
|
|
206
|
+
Solo treats `peaks codegraph affected --project <path> <changed-files...> --json` as optional project-analysis enhancement. Output is untrusted supporting evidence — never treat as approval for scope, design, or QA verdict. Solo must not treat codegraph output as approval; never mutate agent settings, Claude settings, or hooks from codegraph; do not commit `.codegraph/` artifacts or persist generated `.codegraph/` databases into git. Solo coordinates codegraph context across the role handoff between RD (writes `.peaks/<session-id>/rd/codegraph-context.md`) and QA / TXT (consume the same envelope).
|
|
201
207
|
|
|
202
|
-
→ see `references/codegraph-orchestration.md` for the full contract.
|
|
208
|
+
→ see `references/codegraph-orchestration.md` for the full contract (including the agent-settings / settings-mutation prohibition, the no-`.codegraph/` commit rule, and the role-handoff envelope).
|
|
203
209
|
|
|
204
210
|
## Sub-agent context governance (G7 + G7.7 + G8 + G9 — slice #010)
|
|
205
211
|
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Step 0.55 — 1.x → 2.0 detection reference
|
|
2
|
+
|
|
3
|
+
> Body of `### Peaks-Cli Step 0.55`. Slice: 2026-06-12-solo-step-0-55-1x-detection.
|
|
4
|
+
|
|
5
|
+
## Why this step exists
|
|
6
|
+
|
|
7
|
+
The peaks-cli 1.x → 2.0 closeout ships:
|
|
8
|
+
|
|
9
|
+
1. A postinstall that auto-detects 1.x state and dispatches the upgrade (slice 1, commit `b6e34e6`).
|
|
10
|
+
2. A standards-migrate path that thins `.claude/rules/**/*.md` and scaffolds `.peaks/standards/` (slice 2, commit `33dd392`).
|
|
11
|
+
3. **THIS STEP** — a peaks-solo startup sequence probe that detects 1.x state when the user invokes `/peaks-solo` directly in a 1.x consumer project, and prompts the user to upgrade.
|
|
12
|
+
|
|
13
|
+
The 1.x user experience is: "I just typed /peaks-solo. Why is it not working in 2.0 mode?" Step 0.55 catches this case and surfaces an `AskUserQuestion` with a one-click upgrade.
|
|
14
|
+
|
|
15
|
+
## Detection algorithm
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
# 1. Read-only probe via the umbrella CLI
|
|
19
|
+
peaks upgrade --detect-1x --project <root> --json
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
The CLI returns:
|
|
23
|
+
```json
|
|
24
|
+
{
|
|
25
|
+
"ok": true,
|
|
26
|
+
"command": "upgrade.detect-1x",
|
|
27
|
+
"data": {
|
|
28
|
+
"isOneX": true,
|
|
29
|
+
"signals": [
|
|
30
|
+
"<path> has schema_version 1.0.0, expected '2.0.0'",
|
|
31
|
+
"..."
|
|
32
|
+
],
|
|
33
|
+
"projectRoot": "/path/to/project",
|
|
34
|
+
"configPath": null
|
|
35
|
+
},
|
|
36
|
+
"warnings": [],
|
|
37
|
+
"nextActions": [
|
|
38
|
+
"Detected 1.x state. peaks-solo Step 0.55 should present an AskUserQuestion to invoke `peaks upgrade --to 2.0 --auto --project /path/to/project`."
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
The detection logic mirrors `scripts/install-skills.mjs:detect1xProjectState` (canonical implementation) — it walks up to find `.peaks/_runtime/`, then sniffs:
|
|
44
|
+
|
|
45
|
+
1. `~/.peaks/config.json` for `version: 1.x`
|
|
46
|
+
2. `<projectRoot>/.claude/rules/common/dev-preference.md` for "peaks progress"
|
|
47
|
+
3. `<projectRoot>/.peaks/preferences.json` for missing or non-`2.0.0` `schema_version`
|
|
48
|
+
|
|
49
|
+
The TS mirror in `src/services/upgrade/1x-detector-service.ts` is the canonical entrypoint for the skill; the postinstall `.mjs` version is the canonical entrypoint for the npm-install flow. The two implementations MUST stay in parity (a parity test is in the slice's test suite).
|
|
50
|
+
|
|
51
|
+
## AskUserQuestion (only when `isOneX: true`)
|
|
52
|
+
|
|
53
|
+
| Option | What it does |
|
|
54
|
+
|---|---|
|
|
55
|
+
| Run `peaks upgrade --to 2.0 --auto --project <root>` (Recommended) | Invokes the umbrella. The user sees the 6 sub-step results in the terminal. After the upgrade, re-run peaks-solo with the standing 2.0 layout. Persist `autoUpgradePrompt: opt-in` to `.peaks/preferences.json`. |
|
|
56
|
+
| Skip for this session | Continue with the standing 1.x layout. Persist `autoUpgradePrompt: skip-this-session` to `.peaks/preferences.json`. The next time the user invokes peaks-solo in this project, the question re-asks. |
|
|
57
|
+
| Never ask again for this project | Persist `autoUpgradePrompt: skip-forever` to `.peaks/preferences.json`. Step 0.55 becomes a no-op for this project from now on. The user can re-enable later by removing the `autoUpgradePrompt` key from preferences.json. |
|
|
58
|
+
|
|
59
|
+
## Persistence contract
|
|
60
|
+
|
|
61
|
+
The decision is persisted via `peaks preferences set --project <root> --key autoUpgradePrompt --value <opt-in|skip-this-session|skip-forever> --apply`. Subsequent Step 0.55 invocations read the value first:
|
|
62
|
+
|
|
63
|
+
- If `opt-in` (and Step 0.55 is the first invocation in the session), the user has already opted in; auto-run the umbrella without re-asking.
|
|
64
|
+
- If `skip-this-session`, the user already said no this session; skip without re-asking (but re-ask next session).
|
|
65
|
+
- If `skip-forever`, the user said no permanently; skip without re-asking.
|
|
66
|
+
- If the key is absent, present the AskUserQuestion.
|
|
67
|
+
|
|
68
|
+
## What is NOT in this step
|
|
69
|
+
|
|
70
|
+
- The auto-upgrade execution itself: the umbrella is invoked via the AskUserQuestion's recommended option. The umbrella's behavior (6 sub-commands + write-upgrade-record) is documented in the umbrella's own help text.
|
|
71
|
+
- The postinstall auto-dispatch: that's `scripts/install-skills.mjs:autoUpgrade1xProjectIfPresent`, which fires fire-and-forget on `npm i -g peaks-cli@2.0`. Step 0.55 is the user-invoked path.
|
|
72
|
+
- Re-authoring the 1.x detector heuristics: the implementation is a 1:1 mirror of the canonical `.mjs` version. Drift is prevented by the parity test.
|
|
73
|
+
|
|
74
|
+
## How this integrates with the rest of the workflow
|
|
75
|
+
|
|
76
|
+
- Step 0.5 (OpenSpec opt-in) — runs first if `openspec/` is missing.
|
|
77
|
+
- Step 0 (anchor) — runs always.
|
|
78
|
+
- Step 0.7 (resume detection) — runs after Step 0.
|
|
79
|
+
- **Step 0.55 (1.x detection) — runs after Step 0.7, only when the project is not on a 2.0 layout.**
|
|
80
|
+
- Step 1 (mode selection) — runs after Step 0.55.
|
|
81
|
+
|
|
82
|
+
The 1.x detection is intentionally placed AFTER Step 0.7 because the user might already have a 1.x-converted in-flight slice; the resume flow takes precedence over the upgrade prompt.
|
|
@@ -102,6 +102,15 @@ ls .peaks/<id>/ui/design-draft.md 2>&1
|
|
|
102
102
|
|
|
103
103
|
The CLI gate (`peaks request transition --state qa-handoff`) is the authoritative check; running this `ls` first lets you produce missing files before the CLI rejects the transition.
|
|
104
104
|
|
|
105
|
+
| Request type | Required RD evidence (under `.peaks/<id>/`) |
|
|
106
|
+
|---|---|
|
|
107
|
+
| `feature` / `refactor` | `rd/tech-doc.md` + `rd/code-review.md` + `rd/security-review.md` + `rd/perf-baseline.md` + `qa/test-cases/<rid>.md` (qa/test-cases pre-drafted by the 4th sub-agent in peaks-rd's parallel fan-out — slice 004) |
|
|
108
|
+
| `bugfix` | `rd/bug-analysis.md` + `rd/code-review.md` + `rd/security-review.md` + `qa/test-cases/<rid>.md` (rd/perf-baseline.md only when the bug is performance-shaped) |
|
|
109
|
+
| `config` | `rd/security-review.md` |
|
|
110
|
+
| `docs` / `chore` | (no extra evidence required) |
|
|
111
|
+
|
|
112
|
+
Always required (in addition to the type-specific row): `ls .peaks/<id>/rd/requests/<rid>.md`. Missing any required file → DO NOT attempt the qa-handoff transition; CLI will reject with PREREQUISITES_MISSING.
|
|
113
|
+
|
|
105
114
|
```bash
|
|
106
115
|
# Always required
|
|
107
116
|
ls .peaks/<id>/rd/requests/<rid>.md
|