peaks-cli 1.2.7 → 1.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -0
- package/dist/src/cli/commands/core-artifact-commands.js +36 -1
- package/dist/src/cli/commands/perf-commands.d.ts +3 -0
- package/dist/src/cli/commands/perf-commands.js +41 -0
- package/dist/src/cli/commands/progress-close-kill.d.ts +51 -0
- package/dist/src/cli/commands/progress-close-kill.js +152 -0
- package/dist/src/cli/commands/progress-commands.d.ts +3 -0
- package/dist/src/cli/commands/progress-commands.js +348 -0
- package/dist/src/cli/commands/progress-start-spawn.d.ts +59 -0
- package/dist/src/cli/commands/progress-start-spawn.js +114 -0
- package/dist/src/cli/commands/progress-watch-render.d.ts +80 -0
- package/dist/src/cli/commands/progress-watch-render.js +308 -0
- package/dist/src/cli/commands/project-commands.js +1 -1
- package/dist/src/cli/commands/scan-commands.js +22 -0
- package/dist/src/cli/program.js +4 -0
- package/dist/src/services/config/config-types.d.ts +20 -0
- package/dist/src/services/config/config-types.js +5 -1
- package/dist/src/services/memory/project-memory-service.d.ts +1 -1
- package/dist/src/services/memory/project-memory-service.js +52 -23
- package/dist/src/services/perf/perf-baseline-service.d.ts +70 -0
- package/dist/src/services/perf/perf-baseline-service.js +213 -0
- package/dist/src/services/progress/progress-service.d.ts +179 -0
- package/dist/src/services/progress/progress-service.js +276 -0
- package/dist/src/services/scan/libraries-service.d.ts +24 -0
- package/dist/src/services/scan/libraries-service.js +419 -0
- package/dist/src/services/scan/libraries-types.d.ts +59 -0
- package/dist/src/services/scan/libraries-types.js +9 -0
- package/dist/src/services/session/index.d.ts +1 -1
- package/dist/src/services/session/index.js +1 -1
- package/dist/src/services/session/session-manager.d.ts +53 -8
- package/dist/src/services/session/session-manager.js +150 -3
- package/dist/src/services/skills/skill-presence-service.d.ts +27 -1
- package/dist/src/services/skills/skill-presence-service.js +112 -9
- package/dist/src/services/skills/skill-runbook-service.js +34 -1
- package/dist/src/services/workflow/autonomous-resume-writer.js +7 -7
- package/dist/src/shared/change-id.d.ts +30 -0
- package/dist/src/shared/change-id.js +40 -6
- package/dist/src/shared/paths.d.ts +1 -1
- package/dist/src/shared/paths.js +2 -1
- package/dist/src/shared/version.d.ts +1 -1
- package/dist/src/shared/version.js +1 -1
- package/package.json +6 -2
- package/schemas/library-breaking-changes.data.json +141 -0
- package/schemas/library-breaking-changes.meta.json +6 -0
- package/schemas/library-breaking-changes.schema.json +50 -0
- package/skills/peaks-qa/SKILL.md +25 -0
- package/skills/peaks-rd/SKILL.md +221 -2
- package/skills/peaks-solo/SKILL.md +76 -316
- package/skills/peaks-solo/references/runbook.md +166 -0
- package/skills/peaks-solo/references/workflow-gates-and-types.md +177 -0
- package/skills/peaks-solo-resume/SKILL.md +81 -0
- package/skills/peaks-solo-status/SKILL.md +120 -0
- package/skills/peaks-solo-test/SKILL.md +84 -0
- package/skills/peaks-txt/SKILL.md +8 -5
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
# Peaks-Cli Workflow Order + Request Type Classification + Transition Verification Gates
|
|
2
|
+
|
|
3
|
+
> **Maintenance**: This reference holds the canonical contract for (a) how Solo sequences the 11 workflow steps, (b) which `--type` to pass to `peaks request init` for which slice shape, and (c) the executable `ls` / `grep` gate commands that physically block progression. SKILL.md keeps the narrative ("what peaks-solo does"); this file keeps the contract.
|
|
4
|
+
>
|
|
5
|
+
> **Why extracted from SKILL.md**: this content is 165 lines of mostly-tabular + bash-block contract — reference data, not orchestration prose. Inlining it bloats SKILL.md past the 800-line cap (per `common/coding-style.md`). The numbers, gate command shapes, and type-classification rules change rarely; the SKILL.md prose around them (orchestration flow, repair-loop intent, swarm fan-out shape) changes more often.
|
|
6
|
+
>
|
|
7
|
+
> **How peaks-cli tooling reads this file**:
|
|
8
|
+
> - `peaks skill runbook peaks-solo` (CLI) and the in-line LLM reading the SKILL.md should reference this file when the gate-machine or type-classification contract is in play.
|
|
9
|
+
> - The test `tests/unit/skill-default-runbook.test.ts` does NOT check this file (it only checks the runbook). Future tests can add a similar fallback for the gates-and-types contract.
|
|
10
|
+
|
|
11
|
+
## Peaks-Cli Request type classification (MANDATORY before `peaks request init`)
|
|
12
|
+
|
|
13
|
+
Before initializing any role artifact, classify the request into exactly one of six types. The choice drives RD/QA gate strictness (see "Mandatory RD QA repair loop"). Pick the **primary intent** — if a request could fit two types, the higher-strictness one wins.
|
|
14
|
+
|
|
15
|
+
| `--type` | Pick this when the PRD says... | Pick something else when... |
|
|
16
|
+
|---|---|---|
|
|
17
|
+
| `feature` | Add new capability, new page/component/route/API path, new user-facing behavior. Includes "extend X to support Y" when Y is a new code path. | The PRD is fixing an existing broken behavior → `bugfix`. The PRD is reshaping existing code without changing user-visible behavior → `refactor`. |
|
|
18
|
+
| `bugfix` | Fix a specific broken behavior; PRD includes reproduction steps or a defect description; success = "the broken thing now works as it was supposed to". | The "fix" actually adds new capability (validation that didn't exist, a missing field) → `feature`. The "fix" is purely cosmetic and has zero risk → still `bugfix`; do NOT downgrade to `chore`. |
|
|
19
|
+
| `refactor` | Restructure code without changing user-visible behavior. Examples: rename modules, extract shared utilities, migrate a library version with no API surface change, split a monolithic file. PRD mentions coverage targets or "no behavior change". | The refactor incidentally adds or changes user-visible behavior → split into `refactor` + `feature` or pick `feature`. The change is one-line formatting → `chore`. |
|
|
20
|
+
| `config` | Modify config / infrastructure files only: `tsconfig.json`, `eslint`, CI YAML, `package.json` scripts, env defaults, CORS/CSP rules, build config, Docker, deployment manifests. No application source-code changes. | The config change is paired with code changes that consume the new config → `feature` or `refactor` (whichever the code change is). |
|
|
21
|
+
| `docs` | Modify only `*.md` / docs site / inline JSDoc / README. No `.ts` / `.tsx` / `.js` / `.css` / config-file changes. | Any source code change is included → use the type matching the code change. Adding a code example to docs that requires the example to compile → still `docs` if the example is illustrative only. |
|
|
22
|
+
| `chore` | Pure mechanical hygiene: formatter run, lint fix, dependency version bump with no API surface change, dead-code removal of unused files identified by tooling. | The bump changes API behavior or requires consumer migration → `refactor` (or `feature` if it adds capability). Any logic edit → `bugfix` or `refactor`. |
|
|
23
|
+
|
|
24
|
+
**Self-check before locking the type**: read the PRD scope and answer "what is the smallest gate set that still protects users from regression?" — that is the right type. Picking `docs` or `chore` to skip gates when source code is actually changing is a workflow violation and the SC phase will reject it.
|
|
25
|
+
|
|
26
|
+
For ambiguous cases (e.g. "improve login flow"), ask the user to clarify before initializing. The cost of one `AskUserQuestion` round is much lower than running the wrong gate matrix for the whole workflow.
|
|
27
|
+
|
|
28
|
+
When Peaks-Cli Solo coordinates development in a code repository, keep this order explicit:
|
|
29
|
+
|
|
30
|
+
0. **Peaks-Cli Snapshot** — `peaks doctor` + `peaks project dashboard` to capture baseline state before anything else;
|
|
31
|
+
0.5. **Peaks-Cli Workspace initialization** — `.peaks/<session-id>/` created, directory structure verified;
|
|
32
|
+
0.6. **Peaks-Cli Project scan** — archetype, component library, CSS framework, build tool, state management, routing, data fetching, legacy signals detected and recorded to `.peaks/<session-id>/rd/project-scan.md`;
|
|
33
|
+
0.7. **Peaks-Cli Existing-system extraction** (MANDATORY when archetype ∈ {legacy-frontend, legacy-fullstack, frontend-monorepo}; SKIP for greenfield) — extract visual tokens and code conventions from the live codebase to `.peaks/<session-id>/system/existing-system.md`. The path lives under `system/` (not `ui/`) because the file also records non-UI conventions (service-layer signatures, hooks, naming) that backend-only or legacy-fullstack work consumes. See `references/existing-system-extraction.md`. UI design-draft and RD implementation MUST treat the extracted tokens and conventions as hard constraints;
|
|
34
|
+
1. **Peaks-Cli Standards preflight** — `peaks standards init/update --dry-run`, must reference concrete project-scan findings (never emit generic templates);
|
|
35
|
+
2. **Peaks-Cli PRD phase** — capture request as canonical artifact, extract scope and acceptance criteria:
|
|
36
|
+
- Full-auto/Swarm: auto-transition to `confirmed-by-user` once the artifact is complete;
|
|
37
|
+
- Assisted/Strict: pause with `AskUserQuestion` for explicit user confirmation before proceeding;
|
|
38
|
+
3. **Peaks-Cli Swarm parallel phase** — after PRD confirmed, launch UI, RD(planning), QA(test-cases) simultaneously:
|
|
39
|
+
3a. UI design draft and visual direction (MANDATORY when request is frontend/user-visible; skipped for `--type docs|chore|config` or pure-backend requests);
|
|
40
|
+
3b. RD planning artifact — `rd/tech-doc.md` for feature/refactor, `rd/bug-analysis.md` for bugfix, skipped for docs/chore/config;
|
|
41
|
+
3c. QA test-case generation (skipped for docs/chore — no acceptance surface to validate);
|
|
42
|
+
4. **Peaks-Cli RD implementation** — consumes the type-appropriate inputs: project-scan + standards + (if UI involved) UI design-draft + RD planning artifact + QA test-cases. Includes unit tests for new/changed behavior (TDD) unless `--type` is docs/chore;
|
|
43
|
+
5. **Peaks-Cli Code review + security review** — CRITICAL/HIGH issues fixed before progression; marked-blocked issues only allow a blocked handoff;
|
|
44
|
+
6. **Peaks-Cli 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;
|
|
45
|
+
7. **Peaks-Cli 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;
|
|
46
|
+
8. **Peaks-Cli SC phase** — change-control evidence: impact, retention, validate, boundary;
|
|
47
|
+
9. **Peaks-Cli OpenSpec archive** — exit gate: validate → archive only after QA verdict=pass (when `openspec/` exists);
|
|
48
|
+
10. **Peaks-Cli TXT handoff capsule** — mode, validated decisions, artifact paths, standards deltas, open questions, next action;
|
|
49
|
+
11. **Peaks-Cli Final snapshot** — `peaks project dashboard` + `peaks skill doctor` to confirm the workflow closed cleanly.
|
|
50
|
+
|
|
51
|
+
### Peaks-Cli Transition verification gates (MANDATORY — run the command, see the output)
|
|
52
|
+
|
|
53
|
+
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.
|
|
54
|
+
|
|
55
|
+
**Peaks-Cli Gate A — After workspace init + project scan:**
|
|
56
|
+
```bash
|
|
57
|
+
ls .peaks/<id>/rd/project-scan.md
|
|
58
|
+
# Expected output: .peaks/<id>/rd/project-scan.md
|
|
59
|
+
# "No such file" → STOP, run project scan first
|
|
60
|
+
# File present but missing `## Archetype` or `## Project mode` sections → INCOMPLETE, rerun scan
|
|
61
|
+
# File present and complete → reuse (project-scan is a session-scoped singleton)
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
**Peaks-Cli Gate A.5 — Existing-system extraction (legacy projects only):**
|
|
65
|
+
```bash
|
|
66
|
+
# If project-scan.md `## Archetype` is greenfield → skip this gate
|
|
67
|
+
# Otherwise:
|
|
68
|
+
ls .peaks/<id>/system/existing-system.md
|
|
69
|
+
# "No such file" → STOP, run existing-system extraction
|
|
70
|
+
# (see references/existing-system-extraction.md)
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**Peaks-Cli Gate B — After swarm convergence (UI + RD planning + QA test-cases):**
|
|
74
|
+
|
|
75
|
+
Peaks-Cli Gate B has two sub-checks: a HARD gate (blocks progression) and an INFORMATIONAL check (records degradation but does not block).
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
# B.hard — REQUIRED before continuing to RD implementation.
|
|
79
|
+
# Missing any of these → STOP, return to the role that owns the file.
|
|
80
|
+
|
|
81
|
+
# Always required (every type):
|
|
82
|
+
ls .peaks/<id>/prd/requests/<rid>.md
|
|
83
|
+
|
|
84
|
+
# Type-specific RD planning artifact:
|
|
85
|
+
# feature / refactor → ls .peaks/<id>/rd/tech-doc.md
|
|
86
|
+
# bugfix → ls .peaks/<id>/rd/bug-analysis.md
|
|
87
|
+
# config / docs / chore → (no RD planning artifact required)
|
|
88
|
+
|
|
89
|
+
# QA test-cases (skipped for docs/chore):
|
|
90
|
+
ls .peaks/<id>/qa/test-cases/<rid>.md
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
# B.info — NON-BLOCKING. Record degradation in TXT, then proceed.
|
|
95
|
+
ls .peaks/<id>/ui/design-draft.md 2>&1
|
|
96
|
+
# "No such file" + request affects user-visible UI → swarm degradation rule 1 fires:
|
|
97
|
+
# note "ui-design-missing" in TXT, RD continues with PRD visual descriptions.
|
|
98
|
+
# "No such file" + pure backend / docs / chore / config → state skip reason in TXT, proceed.
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
**Peaks-Cli Gate C — After RD implementation (before QA handoff):**
|
|
102
|
+
|
|
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
|
+
|
|
105
|
+
```bash
|
|
106
|
+
# Always required
|
|
107
|
+
ls .peaks/<id>/rd/requests/<rid>.md
|
|
108
|
+
|
|
109
|
+
# Type-specific RD evidence (must match the type recorded in the artifact body)
|
|
110
|
+
# feature / refactor → ls rd/tech-doc.md rd/code-review.md rd/security-review.md rd/perf-baseline.md qa/test-cases/<rid>.md
|
|
111
|
+
# (qa/test-cases/<rid>.md pre-drafted by the 4th sub-agent in peaks-rd's parallel fan-out — slice 004)
|
|
112
|
+
# bugfix → ls rd/bug-analysis.md rd/code-review.md rd/security-review.md qa/test-cases/<rid>.md
|
|
113
|
+
# (rd/perf-baseline.md only when the bug is performance-shaped)
|
|
114
|
+
# config → ls rd/security-review.md
|
|
115
|
+
# docs / chore → (no extra evidence required)
|
|
116
|
+
# Missing any required file → DO NOT attempt the qa-handoff transition; CLI will reject with PREREQUISITES_MISSING.
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
**Peaks-Cli Gate D — After QA validation:**
|
|
120
|
+
|
|
121
|
+
The CLI gate at `qa:verdict-issued` is the authoritative check; this `ls` lets you produce missing evidence before the CLI rejects the transition.
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
# Always required
|
|
125
|
+
ls .peaks/<id>/qa/requests/<rid>.md
|
|
126
|
+
|
|
127
|
+
# Type-specific QA evidence
|
|
128
|
+
# feature / refactor → ls qa/test-cases/<rid>.md qa/test-reports/<rid>.md qa/security-findings.md qa/performance-findings.md
|
|
129
|
+
# bugfix → ls qa/test-cases/<rid>.md qa/test-reports/<rid>.md qa/security-findings.md
|
|
130
|
+
# config → ls qa/security-findings.md
|
|
131
|
+
# docs / chore → (no QA evidence files required)
|
|
132
|
+
# Missing required file → QA incomplete; do not transition to verdict-issued.
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
**Peaks-Cli Gate E — Before declaring workflow complete:**
|
|
136
|
+
```bash
|
|
137
|
+
find .peaks/<id>/ -type f | sort
|
|
138
|
+
# Verify: files from gates A-D all appear in this list.
|
|
139
|
+
# Any mandatory file missing → NOT complete. Do not emit TXT.
|
|
140
|
+
# Peaks-Cli Gate G (CLAUDE.md + .claude/rules/**) must ALSO pass before TXT is emitted.
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
**Peaks-Cli Gate F — Root pollution check (BLOCKING before completion):**
|
|
144
|
+
```bash
|
|
145
|
+
# Verify no Peaks-Cli intermediate artifacts leaked to project root.
|
|
146
|
+
ls feishu-doc-*.md *-snapshot.md qa-server.js 2>&1
|
|
147
|
+
# Expected: "No such file or directory" for ALL patterns.
|
|
148
|
+
# Any file found → ROOT POLLUTION. Move it to .peaks/<id>/prd/source/
|
|
149
|
+
# (for doc snapshots) or .peaks/<id>/qa/ (for QA artifacts).
|
|
150
|
+
# Note the migration in TXT handoff. Do NOT complete the workflow
|
|
151
|
+
# with intermediate artifacts in the project root.
|
|
152
|
+
```
|
|
153
|
+
```bash
|
|
154
|
+
# Extended check for common leak patterns
|
|
155
|
+
find . -maxdepth 1 -name "*.png" -o -name "*.jpg" -o -name "qa-*.js" -o -name "mock-server.*" 2>&1
|
|
156
|
+
# Any Peaks-Cli QA/UI intermediate files here → ROOT POLLUTION. Move and note.
|
|
157
|
+
# Legitimate project files (e.g. favicon.png) are fine — only move Peaks-Cli artifacts.
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
**Peaks-Cli Gate G — Project standards present (BLOCKING before workflow completion):**
|
|
161
|
+
```bash
|
|
162
|
+
# After `peaks standards init/update --apply`, verify the files actually landed
|
|
163
|
+
# at the project root. The CLAUDE.md and rules files are required so that
|
|
164
|
+
# subsequent peaks-rd / peaks-qa / peaks-solo runs perform the project-local
|
|
165
|
+
# preflight described in CLAUDE.md (read coding-style.md, code-review.md, security.md).
|
|
166
|
+
ls <repo>/CLAUDE.md
|
|
167
|
+
# "No such file" → BLOCKED. Run `peaks standards init --project <repo> --apply --json`
|
|
168
|
+
# (first time) or `peaks standards update --project <repo> --apply --json` (existing).
|
|
169
|
+
ls <repo>/.claude/rules/common/coding-style.md \
|
|
170
|
+
<repo>/.claude/rules/common/code-review.md \
|
|
171
|
+
<repo>/.claude/rules/common/security.md
|
|
172
|
+
# Any "No such file" → BLOCKED. The standards apply step did not complete; re-run
|
|
173
|
+
# standards init/update with --apply and re-verify.
|
|
174
|
+
# Skipping Peaks-Cli Gate G (e.g. because the user did not explicitly authorize writes) is
|
|
175
|
+
# only acceptable in `assisted`/`strict` modes where the user actively declined; in
|
|
176
|
+
# `full-auto`/`swarm` the absence of these files is a workflow violation.
|
|
177
|
+
```
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: peaks-solo-resume
|
|
3
|
+
description: Resume an in-flight peaks-solo slice in the current session. Use when the user says "continue the unfinished work", "继续完成", "把刚才没做完的收尾", or invokes `/peaks-solo-resume` directly. Detects the current session's deepest completed gate (via the Step 0.7 detection script at `tests/fixtures/skill-resume-mode-detect.sh`) and surfaces a resume option via `AskUserQuestion`. Triggers on `/peaks-solo-resume`, "继续完成刚才的", "resume the unfinished slice", "把刚才没做完的收尾".
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Peaks-Cli Solo Resume (wrapper)
|
|
7
|
+
|
|
8
|
+
Peaks-Cli Solo Resume is a thin wrapper that handles the **most common high-frequency request shape**: "I was in the middle of something, continue it." It detects the current session's deepest completed gate, surfaces a resume option, then yields to the main `peaks-solo` skill (which runs the actual workflow from the matching gate onwards).
|
|
9
|
+
|
|
10
|
+
**This is a transparent wrapper.** The user does not stay in this skill — once the resume option is confirmed, control hands off to `peaks-solo`. The wrapper exists only to (a) detect the in-flight slice without the LLM re-reading 3-5 artifact files, and (b) surface the resume option as a `AskUserQuestion` before the main loop skips ahead.
|
|
11
|
+
|
|
12
|
+
## Skill presence (MANDATORY first action)
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
peaks skill presence:set peaks-solo-resume --project <repo> --mode <mode> --gate startup
|
|
16
|
+
peaks project memories --project <repo> --json # load durable memory
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Step 1: Detect the current session's in-flight slice
|
|
20
|
+
|
|
21
|
+
Use the Step 0.7 detection script (added in slice 003) to classify the current session:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
# 1. Confirm the current session id
|
|
25
|
+
sid=$(cat .peaks/.session.json | python3 -c "import sys,json; print(json.load(sys.stdin)['sessionId'])")
|
|
26
|
+
|
|
27
|
+
# 2. Run the detection script
|
|
28
|
+
bash tests/fixtures/skill-resume-mode-detect.sh "$sid" .peaks
|
|
29
|
+
# Possible outputs: fresh | complete | resume:rd-planning | resume:qa-validation
|
|
30
|
+
# | resume:txt-handoff | in-flight:<state>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Step 2: Branch on the detection
|
|
34
|
+
|
|
35
|
+
**If `fresh`**: no in-flight slice. Tell the user "No in-flight slice in this session." Then hand off to `peaks-solo` for a fresh start (set presence back, then run `peaks workspace init --project <repo> --json` and continue with Step 1 of `peaks-solo`).
|
|
36
|
+
|
|
37
|
+
**If `complete`**: the workflow is already done. Tell the user "This session is complete — your previous slice already shipped." Then suggest a fresh start (`peaks-solo`) or close-out.
|
|
38
|
+
|
|
39
|
+
**If `resume:<gate>`**: surface a resume option via `AskUserQuestion`:
|
|
40
|
+
|
|
41
|
+
| Option | What it does |
|
|
42
|
+
|---|---|
|
|
43
|
+
| Resume from `<gate>` (Recommended) | Hand off to `peaks-solo` with the gate already at the matching point. The main loop skips ahead; the existing artifacts are preserved as-is. |
|
|
44
|
+
| Start a fresh slice | Treat the current request as a new slice (new `rid`). Existing artifacts are preserved but not auto-resumed. |
|
|
45
|
+
| Abandon the in-flight slice | Mark the in-flight slice as `deferred` (`peaks request transition <rid> --role rd --state deferred --reason "user abandoned"`) and start fresh. |
|
|
46
|
+
|
|
47
|
+
**If `in-flight:<state>`**: the slice is mid-implementation. Surface a CONFIRM (not a resume):
|
|
48
|
+
|
|
49
|
+
> "The slice is mid-implementation (state: `<state>`). The only valid option is to resume the in-flight gate. Continue?"
|
|
50
|
+
|
|
51
|
+
Use `AskUserQuestion` with a single option (Confirm and resume from `<state>`). Do NOT auto-resume mid-implementation.
|
|
52
|
+
|
|
53
|
+
## Step 3: Hand off to peaks-solo
|
|
54
|
+
|
|
55
|
+
After the user confirms, **re-assert `peaks-solo` presence** so the status header reads correctly for the rest of the run:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
peaks skill presence:set peaks-solo --project <repo> --mode <mode> --gate <matching-gate>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Then tell the user: "Resuming from `<gate>`. The main peaks-solo skill will take over from there." and yield control. The user's next message will land in the `peaks-solo` main loop, which will pick up the workflow from the matching gate.
|
|
62
|
+
|
|
63
|
+
## Hard rules (do NOT skip)
|
|
64
|
+
|
|
65
|
+
- **Never silently auto-resume.** Always use `AskUserQuestion` first. The detection is a discovery; the user's confirmation is the gate.
|
|
66
|
+
- **Never auto-resume mid-implementation.** For `in-flight:<state>`, the only valid option is "Confirm and resume from `<state>`" — never "Start a fresh slice" or "Abandon" without the user's explicit choice.
|
|
67
|
+
- **Never write code or modify files in this skill.** This is a wrapper. The actual work (PRD, RD, QA, SC, TXT) is the main `peaks-solo` skill's job.
|
|
68
|
+
- **Never add a new `peaks <cmd>`.** Use the existing CLI primitives: `peaks workspace init`, `peaks project dashboard`, `peaks session list`, `peaks skill runbook`, `peaks skill doctor`, `peaks scan archetype`, `peaks request transition`. The detection script (`tests/fixtures/skill-resume-mode-detect.sh`) is the only executable this skill invokes.
|
|
69
|
+
|
|
70
|
+
## Anti-patterns (do NOT do)
|
|
71
|
+
|
|
72
|
+
- Do NOT re-read 3-5 artifact files to determine the workflow state. The detection script does this in <1ms; re-reading is the bug Step 0.7 was added to prevent.
|
|
73
|
+
- Do NOT skip the `AskUserQuestion` even if the user says "just continue". The user might have changed their mind, or there might be multiple in-flight slices.
|
|
74
|
+
- Do NOT write to `.peaks/<sid>/` files. This skill is read-only on the workspace; it only reads `.peaks/.session.json` + runs the detection script.
|
|
75
|
+
- Do NOT run `peaks workspace init` on a real session (would bind a new session id). Only run it on a fresh detection where no session exists.
|
|
76
|
+
|
|
77
|
+
## Cross-references
|
|
78
|
+
|
|
79
|
+
- The detection logic is canonical at `tests/fixtures/skill-resume-mode-detect.sh` (added in slice 003). The 8 vitest cases in `tests/unit/skill-resume-mode.test.ts` cover all classification outcomes.
|
|
80
|
+
- The SKILL.md prose at `skills/peaks-solo/SKILL.md` Step 0.7 (added in slice 003) is the same logic, written for LLM consumption. This wrapper reuses the same script — there is no parallel implementation.
|
|
81
|
+
- The "drives a CLI on the user's behalf" pattern (mirror of `peaks-sop`) is the closest existing precedent for this wrapper.
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: peaks-solo-status
|
|
3
|
+
description: Show the current state of the peaks-solo orchestrator in a compact summary. Use when the user says "what's the current state", "现在到哪了", "where are we", or invokes `/peaks-solo-status` directly. Reads the existing CLI primitives (`peaks skill presence`, `peaks session list`, `peaks project dashboard`, `peaks request show`) and renders a 1-screen status table. Triggers on `/peaks-solo-status`, "现在到哪了", "what is the current state", "show me the dashboard", "where are we".
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Peaks-Cli Solo Status (wrapper)
|
|
7
|
+
|
|
8
|
+
Peaks-Cli Solo Status is a thin wrapper that renders a compact status table for the current peaks-solo orchestrator state. It is the answer to "I just want to know where we are" — no PRD, no RD, no QA, no full peaks-solo orchestration. Just read the existing CLI state and render a 1-screen summary.
|
|
9
|
+
|
|
10
|
+
**This is a transparent wrapper.** The user does not stay in this skill — the status table is rendered, and control hands off (back to the user, or to `peaks-solo` if the user wants to act on the status).
|
|
11
|
+
|
|
12
|
+
## Skill presence (MANDATORY first action)
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
peaks skill presence:set peaks-solo-status --project <repo> --mode <mode> --gate startup
|
|
16
|
+
peaks project memories --project <repo> --json # load durable memory
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Step 1: Read the current state
|
|
20
|
+
|
|
21
|
+
Use only existing CLI primitives (no new commands). **Important contract note**: `peaks session list` does NOT support `--project` (verified by dogfood 2026-06-04); it returns all sessions globally. To scope to the current project, read `.peaks/.session.json` for the bound `sessionId`, then use `peaks session info <sid>` for the bound session's full state, and filter `peaks session list` output by `projectRoot` to find other sessions in the same project.
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
# 1. Active skill presence
|
|
25
|
+
peaks skill presence --json
|
|
26
|
+
|
|
27
|
+
# 2. The bound session id (from .peaks/.session.json — local read, no CLI)
|
|
28
|
+
sid=$(cat .peaks/.session.json | python3 -c "import sys,json; print(json.load(sys.stdin)['sessionId'])")
|
|
29
|
+
|
|
30
|
+
# 3. The bound session's full state
|
|
31
|
+
peaks session info "$sid" --json
|
|
32
|
+
|
|
33
|
+
# 4. All sessions globally (then post-filter to current project)
|
|
34
|
+
peaks session list --json
|
|
35
|
+
# Note: this returns all sessions across all projects; the wrapper filters by
|
|
36
|
+
# matching `projectRoot` against the bound session's `projectRoot` to show only
|
|
37
|
+
# the sessions for THIS project. Sessions from other projects are ignored.
|
|
38
|
+
|
|
39
|
+
# 5. Per-request role state (PRD / RD / QA / TXT for the bound project)
|
|
40
|
+
peaks project dashboard --project <repo> --json
|
|
41
|
+
|
|
42
|
+
# 6. Per-request detail (if a specific rid is in flight)
|
|
43
|
+
peaks request show <rid> --role rd --project <repo> --json
|
|
44
|
+
peaks request show <rid> --role qa --project <repo> --json
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
All 6 calls are read-only. Total cost: sub-second. (The original draft said "5 calls"; the corrected count is 6 because the post-filter step is now explicit.)
|
|
48
|
+
|
|
49
|
+
## Step 2: Render the status table
|
|
50
|
+
|
|
51
|
+
Compact 1-screen format:
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
=== peaks-solo status ===
|
|
55
|
+
Session: 2026-06-04-session-b60252
|
|
56
|
+
Active: peaks-solo (mode: full-auto, gate: qa-validation)
|
|
57
|
+
Workspace: /Users/yuanyuan/.../peaks-cli/.peaks/2026-06-04-session-b60252
|
|
58
|
+
|
|
59
|
+
| Role | State | Artifact |
|
|
60
|
+
|------|----------------|-------------------------|
|
|
61
|
+
| PRD | handed-off | prd/requests/003.md |
|
|
62
|
+
| RD | qa-handoff | rd/requests/003.md |
|
|
63
|
+
| QA | running | qa/requests/003.md |
|
|
64
|
+
| TXT | (not started) | - |
|
|
65
|
+
|
|
66
|
+
QA verdict: pending
|
|
67
|
+
Last activity: 2026-06-04T17:00:00.000Z (12 min ago)
|
|
68
|
+
Standards: 5/5 existing (no delta)
|
|
69
|
+
Health: skill-doctor 35/35 pass
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
If the session is fresh (no in-flight slice), render a different layout:
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
=== peaks-solo status ===
|
|
76
|
+
Session: 2026-06-04-session-b60252
|
|
77
|
+
Active: peaks-solo (mode: full-auto, gate: startup)
|
|
78
|
+
Workspace: /Users/yuanyuan/.../peaks-cli/.peaks/2026-06-04-session-b60252
|
|
79
|
+
|
|
80
|
+
No in-flight slice. Ready for a new request.
|
|
81
|
+
Health: skill-doctor 35/35 pass
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Step 3: Ask the user what to do next
|
|
85
|
+
|
|
86
|
+
| Option | What it does |
|
|
87
|
+
|---|---|
|
|
88
|
+
| Continue from the current gate | Hand off to `peaks-solo` with the gate already at the current state. Existing artifacts are preserved. |
|
|
89
|
+
| Open a new slice in this session | Keep the workspace, treat the current request as a new slice (new `rid`). |
|
|
90
|
+
| Just summarize and exit | No further action; the user will decide later. |
|
|
91
|
+
|
|
92
|
+
## Step 4: Hand off (if user picked option 1 or 2)
|
|
93
|
+
|
|
94
|
+
Re-assert `peaks-solo` presence so the status header reads correctly for the rest of the run:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
peaks skill presence:set peaks-solo --project <repo> --mode <mode> --gate <matching-gate>
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Then yield control.
|
|
101
|
+
|
|
102
|
+
## Hard rules (do NOT skip)
|
|
103
|
+
|
|
104
|
+
- **Never write to `.peaks/<sid>/`.** This skill is read-only on the workspace; it only reads existing CLI state.
|
|
105
|
+
- **Never add a new `peaks <cmd>`.** Use only the existing read-only CLI primitives: `peaks skill presence`, `peaks session list`, `peaks session info`, `peaks project dashboard`, `peaks request show`. **Note**: `peaks session list` does not support `--project`; filter its output by `projectRoot` post-hoc.
|
|
106
|
+
- **Never auto-progress the workflow.** The status table is informational only. The user chooses what to do via `AskUserQuestion`. Never silent about what comes next — always present the 3 options.
|
|
107
|
+
- **Never expose sensitive data in the table.** Do NOT include full PRD bodies, full tech-doc bodies, or any test code in the table. Just state names, paths, and counts.
|
|
108
|
+
|
|
109
|
+
## Anti-patterns (do NOT do)
|
|
110
|
+
|
|
111
|
+
- Do NOT run `peaks workspace init` on the real session. The wrapper is read-only.
|
|
112
|
+
- Do NOT run `peaks request transition` (would change state). The wrapper is informational only.
|
|
113
|
+
- Do NOT write the status to a file (e.g. `.peaks/<sid>/status.md`). The user can see it in the chat; persisting it adds noise to the workspace.
|
|
114
|
+
- Do NOT block on slow CLI calls. The 5 read-only calls are sub-second each. If any takes >5s, fail fast and report the slow command.
|
|
115
|
+
|
|
116
|
+
## Cross-references
|
|
117
|
+
|
|
118
|
+
- The "drives a CLI on the user's behalf" pattern (mirror of `peaks-sop`) is the closest existing precedent.
|
|
119
|
+
- `peaks-solo-resume` (P2.1) and `peaks-solo-test` (P2.2) are the sibling wrappers. `peaks-solo-resume` focuses on workflow-state introspection + resume decision; `peaks-solo-status` is the broader 5-CLI snapshot. The two are complementary, not redundant.
|
|
120
|
+
- The "read 5 CLI primitives, render 1 table" pattern is intentionally minimal — the wrapper does NOT add a new status-introspection CLI command (would violate the dev-preference.md "default-no on new CLI" rule).
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: peaks-solo-test
|
|
3
|
+
description: Run the project's test suite on the current repo and report results. Use when the user says "run the tests", "跑一下 test", "跑测试", or invokes `/peaks-solo-test` directly. Runs `pnpm vitest run` (or the project's equivalent test command), captures pass/fail counts and any failures, and surfaces a compact summary. Triggers on `/peaks-solo-test`, "跑一下 test", "跑测试", "run the tests", "test now".
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Peaks-Cli Solo Test (wrapper)
|
|
7
|
+
|
|
8
|
+
Peaks-Cli Solo Test is a thin wrapper that runs the project's test suite on the current repo and reports results. It is the answer to "I just want to see if the tests pass" — no PRD, no RD, no QA, no full peaks-solo orchestration. Just `pnpm vitest run` and a compact summary.
|
|
9
|
+
|
|
10
|
+
**This is a transparent wrapper.** The user does not stay in this skill — the test command runs, the result is summarized, and control hands off (back to the user, or to `peaks-solo` if the user wants to act on the result).
|
|
11
|
+
|
|
12
|
+
## Skill presence (MANDATORY first action)
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
peaks skill presence:set peaks-solo-test --project <repo> --mode <mode> --gate startup
|
|
16
|
+
peaks project memories --project <repo> --json # load durable memory
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Step 1: Detect the project's test command
|
|
20
|
+
|
|
21
|
+
The Peaks-Cli project standard is `pnpm vitest run` (per `vitest.config.ts` + `package.json` scripts). For other project types, check the package.json scripts first. If the user explicitly named a different command (e.g. "跑 `pnpm test` not vitest"), use that.
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
# Default for peaks-cli itself + most TS projects with vitest
|
|
25
|
+
pnpm vitest run
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
For non-vitest projects (jest, mocha, pytest, etc.), the wrapper respects the project's existing test command. If the user says "run jest" or "run pytest", use that. Do NOT silently default to vitest.
|
|
29
|
+
|
|
30
|
+
## Step 2: Run the test suite
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
# Run with a reasonable timeout (5 min default; override for slow suites)
|
|
34
|
+
timeout 300 pnpm vitest run 2>&1 | tail -100
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Capture both stdout and stderr. If the exit code is 0, tests passed. If non-zero, tests failed or the command errored out.
|
|
38
|
+
|
|
39
|
+
## Step 3: Summarize the result
|
|
40
|
+
|
|
41
|
+
Render a compact summary:
|
|
42
|
+
|
|
43
|
+
- **Test files**: `X passed, Y failed, Z skipped` (from the `Test Files X passed (Y)` line)
|
|
44
|
+
- **Tests**: `A passed, B failed, C skipped` (from the `Tests A passed | B skipped (C)` line)
|
|
45
|
+
- **Wall-clock**: the `Duration` line
|
|
46
|
+
- **Failures (if any)**: the first 5-10 failing test names + their failure messages, in priority order (the `FAIL` lines in the test output)
|
|
47
|
+
|
|
48
|
+
Then ask the user what they want to do next via `AskUserQuestion`:
|
|
49
|
+
|
|
50
|
+
| Option | What it does |
|
|
51
|
+
|---|---|
|
|
52
|
+
| Show the full failure list | Print all failing test names + messages (not just the first 5-10) |
|
|
53
|
+
| Open a slice to fix the failures | Hand off to `peaks-solo` with the failing tests as the slice's "acceptance criteria" |
|
|
54
|
+
| Just summarize and exit | No further action; the user will decide later |
|
|
55
|
+
|
|
56
|
+
## Step 4: Hand off (if user picked option 2)
|
|
57
|
+
|
|
58
|
+
Re-assert `peaks-solo` presence so the status header reads correctly for the rest of the run:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
peaks skill presence:set peaks-solo --project <repo> --mode <mode> --gate qa-validation
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Then yield control. The user's next message will land in `peaks-solo` (in QA validation phase, since the failing tests are the validation surface).
|
|
65
|
+
|
|
66
|
+
## Hard rules (do NOT skip)
|
|
67
|
+
|
|
68
|
+
- **Never silently fix test failures.** The user must choose what to do via `AskUserQuestion`. Silently "auto-fix"ing a failing test would mask the failure.
|
|
69
|
+
- **Never modify source code in this skill.** This is a wrapper. The actual fix (if the user wants one) is `peaks-solo`'s job.
|
|
70
|
+
- **Never add a new `peaks <cmd>`.** Use only existing primitives: `peaks skill presence:set`, `peaks project memories`, `peaks workspace init` (for the handoff), `peaks request transition` (if going to QA-validation). The actual test command is the project's existing test runner, not a `peaks <cmd>`.
|
|
71
|
+
- **Never trust the test runner's exit code as the only signal.** Some failures print partial success (e.g. 100 passed + 1 failed); the wrapper must show the failures, not just say "exit 0".
|
|
72
|
+
|
|
73
|
+
## Anti-patterns (do NOT do)
|
|
74
|
+
|
|
75
|
+
- Do NOT run `peaks workspace init` on the real session. The wrapper is read-only on the workspace; it only reads the test results, not the workflow state.
|
|
76
|
+
- Do NOT write to `.peaks/<sid>/`. This skill is read-only on the workspace.
|
|
77
|
+
- Do NOT auto-fail the workflow if the tests fail. The user gets a summary + 3 options; the workflow state is unchanged.
|
|
78
|
+
- Do NOT run `pnpm vitest run --watch` or any interactive mode. The wrapper captures the output as a one-shot run; interactive mode would block the orchestrator.
|
|
79
|
+
|
|
80
|
+
## Cross-references
|
|
81
|
+
|
|
82
|
+
- The "drives a CLI on the user's behalf" pattern (mirror of `peaks-sop`) is the closest existing precedent.
|
|
83
|
+
- `peaks-solo-resume` (sibling wrapper, P2.1) is the workflow-state introspection variant; `peaks-solo-test` is the test-execution variant.
|
|
84
|
+
- The "harness a project-native test runner" pattern is intentionally minimal — the wrapper should NOT add a new CLI for running tests (would violate the dev-preference.md "default-no on new CLI" rule + the user's explicit ask for "skill-first, CLI-auxiliary").
|
|
@@ -107,17 +107,19 @@ Each entry should include:
|
|
|
107
107
|
|
|
108
108
|
## Project memory guidance
|
|
109
109
|
|
|
110
|
-
When a skill artifact contains reusable project facts, decisions, rules,
|
|
110
|
+
When a skill artifact contains reusable project facts, decisions, rules, constraints, **or LLM-discovered runtime lessons**, mark only the stable extract with:
|
|
111
111
|
|
|
112
112
|
```markdown
|
|
113
113
|
<!-- peaks-memory:start -->
|
|
114
114
|
title: Short project memory title
|
|
115
|
-
kind: project
|
|
115
|
+
kind: project | decision | convention | rule | reference | module | lesson
|
|
116
116
|
---
|
|
117
117
|
Stable memory body.
|
|
118
118
|
<!-- peaks-memory:end -->
|
|
119
119
|
```
|
|
120
120
|
|
|
121
|
+
The `lesson` kind is specifically for **runtime observations the LLM made during work** (e.g. "this project's antv6 Drawer uses `size` not `width`"; "this codebase imports test helpers from `src/test-utils/` not `__mocks__/`"). Lessons are loaded by `peaks project memories` as `HOT` so they appear in every future RD preflight.
|
|
122
|
+
|
|
121
123
|
The primary write target is the target project's `.peaks/memory`. Use `peaks memory extract --project <path> --artifact <artifact> --apply` to write durable project memories; omit `--apply` to preview without writing.
|
|
122
124
|
|
|
123
125
|
## Matt Pocock skills integration
|
|
@@ -191,12 +193,13 @@ peaks understand show --project <repo> --json
|
|
|
191
193
|
peaks capabilities --json
|
|
192
194
|
|
|
193
195
|
# 5. Write the handoff capsule (see template above), then embed memory markers
|
|
194
|
-
# For each stable project fact, decision, rule, or
|
|
195
|
-
# append a <!-- peaks-memory:start -->
|
|
196
|
+
# For each stable project fact, decision, rule, convention, or LLM-discovered
|
|
197
|
+
# runtime LESSON discovered this session, append a <!-- peaks-memory:start -->
|
|
198
|
+
# block inside the capsule body:
|
|
196
199
|
#
|
|
197
200
|
# <!-- peaks-memory:start -->
|
|
198
201
|
# title: Short project memory title
|
|
199
|
-
# kind: project | decision | convention | rule | reference | module
|
|
202
|
+
# kind: project | decision | convention | rule | reference | module | lesson
|
|
200
203
|
# ---
|
|
201
204
|
# Stable memory body. Concrete facts only — no secrets, no transient state.
|
|
202
205
|
# <!-- peaks-memory:end -->
|