peaks-cli 1.3.7 → 1.3.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/dist/src/cli/commands/core-artifact-commands.js +119 -14
- package/dist/src/cli/commands/project-commands.js +58 -1
- package/dist/src/cli/commands/request-commands.js +124 -4
- package/dist/src/cli/commands/retrospective-commands.d.ts +3 -0
- package/dist/src/cli/commands/retrospective-commands.js +113 -0
- package/dist/src/cli/program.js +2 -0
- package/dist/src/services/artifacts/request-artifact-service.d.ts +16 -0
- package/dist/src/services/artifacts/request-artifact-service.js +18 -2
- package/dist/src/services/memory/project-memory-service.d.ts +19 -0
- package/dist/src/services/memory/project-memory-service.js +33 -0
- package/dist/src/services/retrospective/migrate-from-md.d.ts +37 -0
- package/dist/src/services/retrospective/migrate-from-md.js +528 -0
- package/dist/src/services/retrospective/retrospective-index.d.ts +37 -0
- package/dist/src/services/retrospective/retrospective-index.js +110 -0
- package/dist/src/services/retrospective/retrospective-show.d.ts +40 -0
- package/dist/src/services/retrospective/retrospective-show.js +109 -0
- package/dist/src/services/session/caller-binding-service.d.ts +70 -0
- package/dist/src/services/session/caller-binding-service.js +148 -0
- package/dist/src/services/session/caller-id-types.d.ts +77 -0
- package/dist/src/services/session/caller-id-types.js +46 -0
- package/dist/src/services/session/index.d.ts +4 -0
- package/dist/src/services/session/index.js +5 -0
- package/dist/src/services/session/platform-fallbacks.d.ts +31 -0
- package/dist/src/services/session/platform-fallbacks.js +35 -0
- package/dist/src/services/session/resolve-caller-id.d.ts +57 -0
- package/dist/src/services/session/resolve-caller-id.js +88 -0
- package/dist/src/services/skills/skill-presence-service.d.ts +11 -0
- package/dist/src/services/skills/skill-presence-service.js +59 -0
- package/dist/src/shared/format-md-compact.d.ts +32 -0
- package/dist/src/shared/format-md-compact.js +297 -0
- package/dist/src/shared/stale-policy.d.ts +67 -0
- package/dist/src/shared/stale-policy.js +85 -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-qa/SKILL.md +86 -515
- package/skills/peaks-qa/references/artifact-per-request.md +7 -79
- package/skills/peaks-qa/references/browser-validation-contracts.md +51 -0
- package/skills/peaks-qa/references/codegraph-regression-focus.md +5 -0
- package/skills/peaks-qa/references/external-capability-guidance.md +9 -0
- package/skills/peaks-qa/references/qa-compact-handoff.md +3 -0
- package/skills/peaks-qa/references/qa-context-governance.md +24 -0
- package/skills/peaks-qa/references/qa-fanout-contract.md +8 -0
- package/skills/peaks-qa/references/qa-gstack-integration.md +7 -0
- package/skills/peaks-qa/references/qa-local-artifacts.md +3 -0
- package/skills/peaks-qa/references/qa-matt-pocock-integration.md +9 -0
- package/skills/peaks-qa/references/qa-refactor-role.md +3 -0
- package/skills/peaks-qa/references/qa-runbook.md +74 -0
- package/skills/peaks-qa/references/qa-skill-presence.md +22 -0
- package/skills/peaks-qa/references/qa-standards-preflight.md +8 -0
- package/skills/peaks-qa/references/qa-sub-agent-dispatch.md +38 -0
- package/skills/peaks-qa/references/qa-transition-gates.md +79 -0
- package/skills/peaks-qa/references/requirement-boundary-recheck.md +9 -0
- package/skills/peaks-qa/references/test-case-generation.md +27 -0
- package/skills/peaks-qa/references/test-report-output.md +14 -0
- package/skills/peaks-rd/SKILL.md +85 -732
- package/skills/peaks-rd/references/artifact-and-standards-output.md +9 -0
- package/skills/peaks-rd/references/artifact-per-request.md +20 -0
- package/skills/peaks-rd/references/browser-self-test-contracts.md +29 -0
- package/skills/peaks-rd/references/codegraph-project-analysis.md +5 -0
- package/skills/peaks-rd/references/compact-handoff.md +3 -0
- package/skills/peaks-rd/references/external-references.md +11 -0
- package/skills/peaks-rd/references/frontend-project-generation.md +11 -0
- package/skills/peaks-rd/references/library-version-awareness.md +30 -0
- package/skills/peaks-rd/references/mandatory-perf-baseline.md +40 -0
- package/skills/peaks-rd/references/mandatory-tech-doc.md +18 -0
- package/skills/peaks-rd/references/matt-pocock-integration.md +11 -0
- package/skills/peaks-rd/references/mock-data-placement.md +40 -0
- package/skills/peaks-rd/references/parallel-review-fanout.md +81 -0
- package/skills/peaks-rd/references/rd-context-governance.md +36 -0
- package/skills/peaks-rd/references/rd-gstack-integration.md +16 -0
- package/skills/peaks-rd/references/rd-runbook.md +125 -0
- package/skills/peaks-rd/references/rd-standards-preflight.md +8 -0
- package/skills/peaks-rd/references/rd-sub-agent-dispatch.md +39 -0
- package/skills/peaks-rd/references/rd-transition-gates.md +148 -0
- package/skills/peaks-rd/references/skill-presence-and-title.md +22 -0
- package/skills/peaks-solo/SKILL.md +87 -786
- package/skills/peaks-solo/references/anchoring-and-session-info.md +25 -0
- package/skills/peaks-solo/references/boundaries.md +21 -0
- package/skills/peaks-solo/references/codegraph-orchestration.md +5 -0
- package/skills/peaks-solo/references/completion-handoff.md +16 -0
- package/skills/peaks-solo/references/context-governance.md +51 -0
- package/skills/peaks-solo/references/external-references.md +17 -0
- package/skills/peaks-solo/references/frontend-only-mode.md +87 -0
- package/skills/peaks-solo/references/gstack-integration.md +7 -0
- package/skills/peaks-solo/references/local-artifact-workspace.md +79 -0
- package/skills/peaks-solo/references/micro-cycle.md +68 -0
- package/skills/peaks-solo/references/mode-selection.md +21 -0
- package/skills/peaks-solo/references/openspec-workflow.md +43 -0
- package/skills/peaks-solo/references/project-memory-loading.md +17 -0
- package/skills/peaks-solo/references/project-scan-checklist.md +136 -0
- package/skills/peaks-solo/references/quality-gate-cheatsheet.md +13 -0
- package/skills/peaks-solo/references/resume-detection.md +63 -0
- package/skills/peaks-solo/references/runbook.md +1 -1
- package/skills/peaks-solo/references/skill-presence-and-title.md +31 -0
- package/skills/peaks-solo/references/standards-preflight.md +23 -0
- package/skills/peaks-solo/references/sub-agent-dispatch.md +46 -0
- package/skills/peaks-solo/references/swarm-dispatch-contract.md +56 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Step 0 — Anchor the workflow
|
|
2
|
+
|
|
3
|
+
> Body of `### Peaks-Cli Step 0: Anchor the workflow`. The instant Peaks-Cli Solo is invoked, **before** the mode-selection question, before any analysis, and before you decide whether the request "needs" the full pipeline, you MUST run these two commands and see their output:
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
# Session ID is auto-generated when omitted; the command returns it in the JSON output.
|
|
7
|
+
# Do NOT pass --session-id manually — the CLI is the single source of truth for the
|
|
8
|
+
# project session binding. To look up the active session id from a skill / sub-agent,
|
|
9
|
+
# use `peaks session info --active --json` (read-only, no side effects). To avoid
|
|
10
|
+
# the "two sessions in .peaks/" confusion that bites Solo, always omit --session-id
|
|
11
|
+
# here and let the CLI auto-generate.
|
|
12
|
+
peaks workspace init --project <repo> --json
|
|
13
|
+
peaks skill presence:set peaks-solo --project <repo> --gate startup
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
> `<repo>` is the **git project root** (the directory containing `.git`). In a monorepo / single-repo-multi-package layout, this is the repo root, NOT a sub-package — `.peaks/` lives at the repo root so every package shares one workspace. If unsure, run `git rev-parse --show-toplevel` and use that path. Never let `.peaks/` land inside a sub-package directory.
|
|
17
|
+
|
|
18
|
+
**There is no request too lightweight to skip this.** "分析下这个项目", "看一下代码", "分析项目", "解释一下架构", a one-line question — all of them still create the workspace and set presence first. The workspace is cheap; a missing `.peaks/` is the #1 reported failure.
|
|
19
|
+
|
|
20
|
+
**Anti-bail-out rule (BLOCKING):** You MUST NOT exit the peaks-solo workflow, hand control back, or produce a final answer before Step 0 has run. If you catch yourself thinking "this is just analysis, I don't need the workflow" — STOP. Run Step 0, set presence, then continue. A pure-analysis request runs the **lightweight analysis branch** (project scan + standards dry-run + handoff with a Standards-increment section), but it still anchors the workspace and keeps presence active. Declining to anchor is a workflow violation.
|
|
21
|
+
|
|
22
|
+
**Session conflict resolution (read once, internalise):** If `peaks workspace init` returns `code: "CONFLICTING_SESSION"` with a body like
|
|
23
|
+
`{"existingSessionId":"<Y>","requestedSessionId":"<X>"}`, the project is already bound to a different in-flight session `<Y>` (the one you or a prior run was working on). The fix is **NOT** to pass `--allow-session-rebind` to clobber `<Y>` — that destroys an active session's data. Instead: finish or abandon `<Y>` first (use `peaks session list --json` to see what it is, then `peaks session finish --id <Y>` or `peaks session abandon --id <Y>` — see your session command's help for the exact verbs). Only after `<Y>` is closed should you re-run `peaks workspace init`. The same rule applies to `peaks workspace init --session-id "<manually-forged>"` — do not pre-forge session ids; the CLI's auto-generated value is the binding.
|
|
24
|
+
|
|
25
|
+
`presence:set` accepts no `--mode` here on purpose — mode is unknown until Step 1. It is re-run with the selected mode in Step 2. Setting presence early guarantees the status header/line shows `peaks-solo` from the very first turn even if the user never reaches mode selection.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Boundaries
|
|
2
|
+
|
|
3
|
+
> Body of `## Boundaries`. Peaks-Cli Solo may:
|
|
4
|
+
|
|
5
|
+
- identify scenarios such as refactor, bugfix, QA hardening, release validation, and incident response;
|
|
6
|
+
- recommend Solo, Assisted, Swarm, or Strict profiles;
|
|
7
|
+
- coordinate Peaks-Cli role skills through artifacts;
|
|
8
|
+
- coordinate project memory extraction from stable skill artifact sections;
|
|
9
|
+
- request user confirmation at risk and commit boundaries;
|
|
10
|
+
- read CLI doctor/profile/artifact reports.
|
|
11
|
+
|
|
12
|
+
Peaks-Cli Solo must not silently:
|
|
13
|
+
|
|
14
|
+
- install hooks;
|
|
15
|
+
- create agents;
|
|
16
|
+
- enable MCP servers;
|
|
17
|
+
- modify Claude settings;
|
|
18
|
+
- create GitHub repositories;
|
|
19
|
+
- bypass role-skill artifacts.
|
|
20
|
+
|
|
21
|
+
Use the Peaks-Cli CLI for runtime side effects.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Codegraph orchestration context
|
|
2
|
+
|
|
3
|
+
> Body of `## Codegraph orchestration context`. Solo treats `peaks codegraph affected --project <path> <changed-files...> --json` as an optional project-analysis enhancement that informs the role handoff between PRD, RD, and QA. The output is untrusted supporting evidence — Solo must not treat codegraph output as approval for scope, design, or QA verdict.
|
|
4
|
+
|
|
5
|
+
Do not run upstream installer flows, mutate agent settings, or commit `.codegraph/` artifacts into git. Peaks-Cli gates remain authoritative; codegraph context is a hint, never a substitute for role-skill output.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Completion handoff
|
|
2
|
+
|
|
3
|
+
> Body of `## Peaks-Cli Completion handoff` + `### Workflow completion (no auto-exit)`.
|
|
4
|
+
|
|
5
|
+
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.
|
|
6
|
+
|
|
7
|
+
Use Peaks-Cli 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.
|
|
8
|
+
|
|
9
|
+
## Workflow completion (no auto-exit)
|
|
10
|
+
|
|
11
|
+
Do NOT call `peaks skill presence:clear --project <repo>` at workflow end. The presence file and header remain active so the user stays inside the workflow context. The user can continue with follow-up requirements naturally — no need to re-invoke `/peaks-solo`. The header continues to display the active skill and current gate.
|
|
12
|
+
|
|
13
|
+
Before ending, extract durable memories from this session:
|
|
14
|
+
```bash
|
|
15
|
+
peaks project memories:extract --session-id <session-id> --project <repo> --json
|
|
16
|
+
```
|
|
@@ -142,3 +142,54 @@ PROTOCOL (mandatory):
|
|
|
142
142
|
|
|
143
143
|
- AC-38..AC-43 (G7) + AC-44..AC-46 (G7.7) + AC-47..AC-49 (G8) + AC-50..AC-65 (G9)
|
|
144
144
|
- See PRD §Acceptance criteria.
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
### G7 — sub-agent context minimal-occupation (metadata-only + 按需 Read)
|
|
149
|
+
|
|
150
|
+
> Body of `### G7`. Sub-agent artifacts (rd/tech-doc.md, qa/test-cases/<rid>.md, ui/design-draft.md) MUST NOT be inlined into dispatch records and fed back to the main LLM during reduce.
|
|
151
|
+
|
|
152
|
+
- Sub-agent writes artifact to disk at a known path (path convention: `.peaks/_sub_agents/<sessionId>/artifacts/<rid>-<role>-<idx>.<ext>`).
|
|
153
|
+
- Sub-agent calls `peaks sub-agent dispatch --write-artifact <path>` (or via dispatch CLI flag). The CLI computes sha256 + size + writes `ArtifactMeta` to record.
|
|
154
|
+
- Main LLM reduces the batch and sees ONLY the metadata view (~200 chars per sub-agent, vs ~1MB if content were inlined) — a 3000-5000× reduction.
|
|
155
|
+
- Main LLM decides whether to `Read <path>` for full content (LLM tool call, NOT via peaks CLI).
|
|
156
|
+
|
|
157
|
+
Main LLM view format (G7.4.e):
|
|
158
|
+
```
|
|
159
|
+
[peaks-solo] batch 3/3 done in 47.3s
|
|
160
|
+
- rd → .peaks/_sub_agents/2026-06-06-session-5b1095/artifacts/003-rd-001.md (12KB, sha256:abc123) summary: "wrote RD tech-doc with 4 sub-roles"
|
|
161
|
+
- qa-business → .../artifacts/003-qa-business-001.md (8KB, sha256:def456) summary: "wrote 12 API test cases"
|
|
162
|
+
- qa-perf → .../artifacts/003-qa-perf-001.md (5KB, sha256:ghi789) summary: "p95 latency target ≤ 200ms"
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### G7.7 — headroom-ai integration (opt-in compression)
|
|
166
|
+
|
|
167
|
+
> Body of `### G7.7`. If a sub-agent prompt is too large even after G7 metadata-only (e.g. 1MB artifact description, 5MB mid-prompt analysis), use `--use-headroom`:
|
|
168
|
+
- Default `false` (G7 remains default).
|
|
169
|
+
- Modes: `balanced` (default) | `aggressive` | `conservative`.
|
|
170
|
+
- Failure: `HEADROOM_UNAVAILABLE` warning + G7 metadata-only fallback (NOT blocking).
|
|
171
|
+
|
|
172
|
+
### G8 — cross sub-agent shared channel (dispatcher-mediated indirect signal)
|
|
173
|
+
|
|
174
|
+
> Body of `### G8`. Sub-agent A's completion **immediately** writes a shared entry; sub-agent B (still in flight) can read shared entries from sibling sub-agents. **This is NOT peer-to-peer messaging.** The dispatcher stores, the sub-agents read/write; A and B never directly talk.
|
|
175
|
+
|
|
176
|
+
- Path: `.peaks/_sub_agents/<sessionId>/shared/<batchId>.json`.
|
|
177
|
+
- Two new CLI atoms (NO new top-level CLI): `peaks sub-agent share` + `peaks sub-agent shared-read`.
|
|
178
|
+
- RL-23 strong constraint: when sub-agent calls `peaks sub-agent heartbeat --status done`, it MUST also call `peaks sub-agent share --key "<role>.completed" --value <artifact-meta>`.
|
|
179
|
+
|
|
180
|
+
### G9 — forced compression gate (CLI 兜底 + hook double-guard)
|
|
181
|
+
|
|
182
|
+
> Body of `### G9`. Threshold table (256K default context capacity):
|
|
183
|
+
|
|
184
|
+
| Threshold | Prompt size | Behavior |
|
|
185
|
+
|---|---|---|
|
|
186
|
+
| 50% (early warn) | ≥ 128KB | Soft warning, suggest `--use-headroom` |
|
|
187
|
+
| **75% (user red line)** | ≥ 192KB | Soft warn + `warnings: ["CONTEXT_NEAR_LIMIT"]` |
|
|
188
|
+
| **80% (hard reject)** | ≥ 204KB | Hard reject `code: "PROMPT_TOO_LARGE"`; `--force` allowed at CLI |
|
|
189
|
+
| 90% (emergency) | ≥ 230KB | Hard reject + `contextWarning: 'high'` |
|
|
190
|
+
|
|
191
|
+
Two layers:
|
|
192
|
+
- **CLI 兜底** — `peaks sub-agent dispatch` validates prompt size; `--force` allowed.
|
|
193
|
+
- **PreToolUse hook** — `peaks sub-agent-dispatch-guard` re-validates; **NO `--force`** at hook layer (RL-30 strict).
|
|
194
|
+
|
|
195
|
+
The sub-agent prompt template (G8.6 + G9 self-check) is in `references/context-governance.md`.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# External references and lifecycle
|
|
2
|
+
|
|
3
|
+
> Body of `## Peaks-Cli External references and lifecycle`.
|
|
4
|
+
|
|
5
|
+
**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.
|
|
6
|
+
|
|
7
|
+
Solo treats `peaks codegraph affected --project <path> <changed-files...> --json` as an optional project-analysis enhancement that informs the role handoff between PRD, RD, and QA. The output is untrusted supporting evidence — Solo must not treat codegraph output as approval for scope, design, or QA verdict.
|
|
8
|
+
|
|
9
|
+
Do not run upstream installer flows, mutate agent settings, or commit `.codegraph/` artifacts into git. Peaks-Cli gates remain authoritative; codegraph context is a hint, never a substitute for role-skill output.
|
|
10
|
+
|
|
11
|
+
**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 via `peaks capabilities` before naming, references only (no execute/install/persist), Peaks-Cli CLI for all side effects. Do not execute upstream installers, do not install upstream resources, do not persist sensitive examples — Peaks-Cli gates remain authoritative. External skills inform, they do not approve.
|
|
12
|
+
|
|
13
|
+
**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.
|
|
14
|
+
|
|
15
|
+
**MCP lifecycle**: `list → plan → apply --yes → call → rollback`. `apply` backs up settings and refuses non-peaks entries unless `--claim` is passed.
|
|
16
|
+
|
|
17
|
+
Detailed rules: `references/external-skill-invocation.md`, `references/openspec-mcp-workflow.md`, `references/workflow.md`, `references/existing-system-extraction.md`. For an informational mapping of peaks artefact paths to the A2A (Agent2Agent) protocol's Task / Artifact / Part / Message / AgentCard vocabulary (no A2A implementation, just a shared naming layer), see `references/a2a-artifact-mapping.md`.
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Peaks-Cli Frontend-only development mode
|
|
2
|
+
|
|
3
|
+
> Extracted from `skills/peaks-solo/SKILL.md` on 2026-06-09 (slice 019 — slim skill files to references) to keep SKILL.md under the 800-line cap from `common/coding-style.md`. The content below is the verbatim Frontend-only development mode section that was previously inline; nothing was paraphrased, just relocated.
|
|
4
|
+
|
|
5
|
+
When the project has no live backend (no swagger.json, no API server), Solo must activate frontend-only mode.
|
|
6
|
+
|
|
7
|
+
### Mode determination (deterministic — CLI is the source of truth)
|
|
8
|
+
|
|
9
|
+
The CLI decision is authoritative. Read `frontendOnly` and `frontendOnlyReason` directly from the `peaks scan archetype --json` output and copy both into `project-scan.md` under `## Project mode`. Do NOT re-derive the decision from user phrasing.
|
|
10
|
+
|
|
11
|
+
User-stated intent is **only** consulted when it conflicts with the CLI result. The two conflict cases:
|
|
12
|
+
|
|
13
|
+
- **CLI says `frontendOnly=false` but the user says "前端项目 / 没有后端 / 先 mock 数据"**: STOP and `AskUserQuestion` to confirm whether to override the scan (the repo probably contains a backend folder the user wants to ignore). Record the override decision and reason in `project-scan.md`.
|
|
14
|
+
- **CLI says `frontendOnly=true` but the user says "需要做后端 / 加 API"**: STOP and `AskUserQuestion` to confirm whether the request actually targets the missing backend (the user may be confused about repo scope, or there is a separate backend repo Solo should switch to).
|
|
15
|
+
|
|
16
|
+
When there is no conflict, do not ask — the CLI value wins and the workflow proceeds.
|
|
17
|
+
|
|
18
|
+
### Mock data strategy selection
|
|
19
|
+
|
|
20
|
+
Solo records the chosen mock strategy in `.peaks/_runtime/<sessionId>/rd/tech-doc.md` under a `## Mock Data Strategy` section. The choice depends on the project scan results:
|
|
21
|
+
|
|
22
|
+
| Project data-fetching pattern | Recommended mock approach | Rationale |
|
|
23
|
+
|---|---|---|
|
|
24
|
+
| Umi + `umi-request` / `@umijs/plugins` request | Umi mock directory (`mock/*.ts`) | Built-in, zero-config, auto-reload on file change |
|
|
25
|
+
| `@tanstack/react-query` + custom fetcher | Service-layer mock with `Promise.resolve()` stubs in the service file | Keeps query hooks unchanged; swap fetcher target later |
|
|
26
|
+
| `ahooks` `useRequest` + service functions | Service-layer mock: replace HTTP call with `Promise.resolve(mockData)` | Matches existing service-function pattern |
|
|
27
|
+
| MSW (Mock Service Worker) already configured | Add new handlers to existing MSW setup | Consistent with project convention |
|
|
28
|
+
| No existing pattern (greenfield) | Service-layer mock with a `mock/` directory and typed fixture files | Clean separation, easy to delete later |
|
|
29
|
+
| Existing `src/services/*` but no fetcher abstraction | Inline mock inside the service file; preserve the function signature | Keeps existing call-sites unchanged |
|
|
30
|
+
| Mixed data-fetching styles (e.g. react-query + raw fetch in legacy files) | Match the style of the most recently added code in the same module | Avoid introducing a third style |
|
|
31
|
+
| Cannot decide from scan alone | STOP and `AskUserQuestion` | Asking once beats picking differently on every run |
|
|
32
|
+
|
|
33
|
+
**Mock data rules:**
|
|
34
|
+
|
|
35
|
+
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.
|
|
36
|
+
2. Mock data should be realistic (not `"test"`, `"foo"`, `123`) — use plausible Chinese/English content that resembles production data.
|
|
37
|
+
3. Each mock must export its TypeScript interface so RD implementation and QA test-cases can import the same types.
|
|
38
|
+
4. Mark every mock file with a header comment: `// MOCK: Replace with real API call when swagger.json is available`.
|
|
39
|
+
5. Before producing any mock file, register the plan in `.peaks/_runtime/<sessionId>/rd/mock-plan.md` with: chosen strategy (from the table above), planned file paths, and a one-line rationale per file. This file is the source of truth for mock locations across runs — RD must read it before writing code, QA must read it before writing test cases.
|
|
40
|
+
|
|
41
|
+
### API contract placeholder pattern
|
|
42
|
+
|
|
43
|
+
When no swagger.json exists, RD defines API contracts as TypeScript interfaces with a mock-then-real service layer:
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
src/services/types/<feature>-api.types.ts ← API request/response interfaces
|
|
47
|
+
src/services/<feature>-service.ts ← Service functions (mock → real)
|
|
48
|
+
mock/<feature>-mock.ts ← Mock data satisfying interfaces
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Each service function returns a typed mock response marked with `// MOCK: Replace with real API call when swagger.json is available`.
|
|
52
|
+
|
|
53
|
+
### Mock-to-real migration path
|
|
54
|
+
|
|
55
|
+
When swagger.json becomes available later, the migration follows this sequence:
|
|
56
|
+
|
|
57
|
+
1. Generate typed API client from swagger.json (e.g. via `openapi-typescript` or manual mapping).
|
|
58
|
+
2. Replace mock imports with generated API calls, one service file at a time.
|
|
59
|
+
3. Remove corresponding mock files.
|
|
60
|
+
4. Run QA regression to verify the real API responses match the mock interface contracts.
|
|
61
|
+
|
|
62
|
+
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.
|
|
63
|
+
|
|
64
|
+
### Feishu document access fallback
|
|
65
|
+
|
|
66
|
+
When the PRD source is a Feishu/Lark document that requires authentication:
|
|
67
|
+
|
|
68
|
+
1. **Primary path**: Playwright MCP headed browser → user completes login → Solo reads document content via `browser_snapshot`.
|
|
69
|
+
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.
|
|
70
|
+
3. **Fallback B (user provides export)**: User drops a `.md` or `.pdf` export into `.peaks/_runtime/<sessionId>/prd/source/`. Solo reads and processes it.
|
|
71
|
+
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.
|
|
72
|
+
|
|
73
|
+
Never silently fall back to unauthenticated `fetch` or `WebFetch` for authenticated documents.
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
### Frontend-only trigger pre-flight
|
|
78
|
+
|
|
79
|
+
> Body of `### Frontend-only trigger pre-flight`. Before computing the swarm plan, Solo runs the keyword scan deterministically:
|
|
80
|
+
|
|
81
|
+
1. Read `.peaks/_runtime/<sessionId>/prd/requests/<rid>.md` body.
|
|
82
|
+
2. Lowercase + strip markdown; check regex `\b(页面|组件|表单|弹窗|表格|样式|布局|交互|UI|UX|page|component|form|modal|table|styling|layout|interaction|frontend|前端)\b`.
|
|
83
|
+
3. If match count ≥ 1 → `frontendKeywordHit=true`.
|
|
84
|
+
4. If `frontendOnly` (from project-scan) is `true` and no keyword hit → UI joins anyway (frontend-only project, even non-visual changes may need visual sanity for regressions).
|
|
85
|
+
5. If `frontendOnly` is `false` and no keyword hit → UI skipped.
|
|
86
|
+
|
|
87
|
+
Solo records the pre-flight result in `sc/swarm-plan.json` so the audit trail shows why UI was or was not included.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Peaks-Cli GStack integration
|
|
2
|
+
|
|
3
|
+
> Body of `## Peaks-Cli GStack integration`.
|
|
4
|
+
|
|
5
|
+
Map gstack stages to Peaks-Cli role artifacts; preserve Peaks-Cli confirmation gates. Do not delegate orchestration to gstack commands.
|
|
6
|
+
|
|
7
|
+
For frontend workflows, RD and QA must use Playwright MCP for real browser E2E. The consuming LLM detects the MCP from its own tool list: any Playwright MCP entry in the LLM tool list means the MCP is installed; absent means the user needs to install (`claude mcp add playwright -- npx @playwright/mcp@latest` in Claude Code; other IDEs have their own MCP install path). The LLM invokes the tool directly (browser_navigate / browser_click / browser_snapshot / browser_take_screenshot / browser_console_messages / browser_network_requests / browser_close) by name — there is no peaks-cli indirection. 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`.
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Local intermediate artifact workspace
|
|
2
|
+
|
|
3
|
+
> Body of `## Peaks-Cli Local intermediate artifact workspace` plus all sub-sections (workspace initialization gate, root pollution prohibition, git and sync policy).
|
|
4
|
+
|
|
5
|
+
## Workspace initialization gate
|
|
6
|
+
|
|
7
|
+
The workspace is created in Step 0 (Startup sequence) as a mandatory first action — before any analysis, role handoff, or artifact write, and regardless of how lightweight the request is. Session IDs are now **auto-generated** with the format `YYYY-MM-DD-session-<6位hex>` (e.g. `2026-05-26-session-a3f8b1`). The user does not provide a session ID — the system creates and persists it in `.peaks/_runtime/session.json` (the canonical home as of slice `2026-06-05-peaks-runtime-layer`; the legacy `.peaks/.session.json` is read-only back-compat for one minor release).
|
|
8
|
+
|
|
9
|
+
When `peaks workspace init` is run without `--session-id`, it automatically generates a new session ID using today's date and a random hex suffix. If a valid session binding exists at `.peaks/_runtime/session.json` (the canonical home, slice 2026-06-05-peaks-runtime-layer; the legacy `.peaks/.session.json` is read-only back-compat for one minor release), the existing session is reused. To read the active session id from a skill or sub-agent, use the `peaks session info --active --json` primitive — never `cat` the on-disk file directly (the path is internal).
|
|
10
|
+
|
|
11
|
+
**Existing old-session cleanup**: If `.peaks/` contains numeric-only or generic session directories from prior runs (e.g. `2026-05-25-auth-system`), 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.
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
peaks workspace init --project <repo> --json
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
The workspace initialization creates this structure under `.peaks/`:
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
# Canonical home for all per-project ephemeral state (active-skill
|
|
21
|
+
# marker, session binding, sop-state). All writes go here; reads also
|
|
22
|
+
# tolerate the legacy paths (`.peaks/.active-skill.json`,
|
|
23
|
+
# `.peaks/.session.json` — read-only back-compat for one minor release,
|
|
24
|
+
# `.peaks/sop-state/`) for one minor release so a fresh upgrade does
|
|
25
|
+
# not break in-flight workflows. Older trees are auto-migrated by
|
|
26
|
+
# `peaks workspace reconcile --apply`. Skills and sub-agents MUST
|
|
27
|
+
# NOT `cat` any of these files directly — use `peaks session info
|
|
28
|
+
# --active --json` (and the matching read-only primitives for the
|
|
29
|
+
# other two) to discover session-id / active-skill / sop-state.
|
|
30
|
+
.peaks/_runtime/
|
|
31
|
+
├── active-skill.json # orchestrator presence marker (peaks-solo / -rd / -qa / -ui / -sc / -sop / -txt)
|
|
32
|
+
├── session.json # project → session binding (the only single-session source of truth)
|
|
33
|
+
└── sop-state/ # current phase + history; definitions live globally in ~/.peaks
|
|
34
|
+
|
|
35
|
+
# Per-slice artifact dirs (auto-generated, one per session). Files
|
|
36
|
+
# inside ARE tracked by the 提交中间产物 convention.
|
|
37
|
+
.peaks/_runtime/<sessionId>/
|
|
38
|
+
prd/source/ # PRD source documents (Feishu exports, pasted content)
|
|
39
|
+
prd/requests/ # PRD request artifacts (goals, non-goals, acceptance, frontend delta)
|
|
40
|
+
ui/requests/ # UI request artifacts (visual direction, taste reports)
|
|
41
|
+
rd/requests/ # RD request artifacts (slice specs, coverage, CR findings)
|
|
42
|
+
rd/project-scan.md # Project scan (session-scoped singleton, generated once per session)
|
|
43
|
+
qa/test-cases/ # QA test cases
|
|
44
|
+
qa/test-reports/ # QA test reports (regression matrices, browser evidence)
|
|
45
|
+
qa/requests/ # QA request artifacts
|
|
46
|
+
sc/ # SC artifacts (change-control, impact, retention, boundary)
|
|
47
|
+
txt/ # TXT artifacts (handoff capsules, lessons, memory extraction)
|
|
48
|
+
system/ # Existing-system extraction output (visual tokens, conventions)
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Files written into these directories during the workflow (not pre-created — they appear as their step runs):
|
|
52
|
+
|
|
53
|
+
- `rd/project-scan.md` (Solo step 0.6)
|
|
54
|
+
- `rd/tech-doc.md` (feature/refactor planning; required by `rd → implemented` gate)
|
|
55
|
+
- `rd/bug-analysis.md` (bugfix planning; required by `rd → implemented` gate for `--type bugfix`)
|
|
56
|
+
- `rd/code-review.md`, `rd/security-review.md` (required by `rd → qa-handoff` gate for feature/bugfix/refactor; security-review only for config)
|
|
57
|
+
- `rd/mock-plan.md` (frontend-only mode)
|
|
58
|
+
- `ui/design-draft.md` (UI step)
|
|
59
|
+
- `system/existing-system.md` (Solo step 0.7; legacy projects only)
|
|
60
|
+
- `qa/test-cases/<rid>.md`, `qa/test-reports/<rid>.md`, `qa/security-findings.md`, `qa/performance-findings.md` (gated per `--type`)
|
|
61
|
+
|
|
62
|
+
## Root pollution prohibition (CRITICAL)
|
|
63
|
+
|
|
64
|
+
**NEVER write Peaks-Cli intermediate artifacts to the project root directory.** Specifically prohibited at root level:
|
|
65
|
+
|
|
66
|
+
- PRD snapshots, document extracts, or requirement notes (`feishu-doc-*.md`, `*-snapshot.md`, etc.)
|
|
67
|
+
- RD tech docs, scan reports, slice specs, or architecture notes
|
|
68
|
+
- QA screenshots, browser evidence, test reports, or validation logs (`.png`, `.jpg`)
|
|
69
|
+
- QA test helper files, mock servers, or fixture scripts (`qa-server.js`, etc.)
|
|
70
|
+
- UI design drafts, taste reports, or visual direction notes
|
|
71
|
+
- TXT handoff capsules or lesson files
|
|
72
|
+
|
|
73
|
+
Legitimate source files (e.g. `jest-setup.ts`, `tailwind.config.js`) belong at root — do not move them.
|
|
74
|
+
|
|
75
|
+
If you are about to Write/Edit an intermediate artifact in the project root, STOP. Create the `.peaks/_runtime/<sessionId>/` workspace first and write to the correct role subdirectory. If existing root-level artifacts from a prior run are discovered, move them into `.peaks/_runtime/<sessionId>/` and note the migration in the TXT handoff.
|
|
76
|
+
|
|
77
|
+
## Git and sync policy
|
|
78
|
+
|
|
79
|
+
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.
|
|
@@ -155,3 +155,71 @@ verdict=return-to-rd → RD 修 (new slice 内部走 micro-cycle)
|
|
|
155
155
|
- peaks-qa 接管 = 边界 + `verdict != pass` 时的下一轮
|
|
156
156
|
|
|
157
157
|
完整流程见 SKILL.md。
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
# Mandatory RD QA repair loop (AUTO-PROCEED)
|
|
162
|
+
|
|
163
|
+
> Body of `## Peaks-Cli Mandatory RD QA repair loop`.
|
|
164
|
+
|
|
165
|
+
> **CLI gate enforcement**: `peaks request transition` now refuses to move RD/QA to gated states when required artifacts are missing. The required files depend on `--type` chosen at `peaks request init` (default `feature`):
|
|
166
|
+
>
|
|
167
|
+
> - `feature` / `refactor`: full gates (tech-doc, code-review, security-review, test-cases, test-report, security-findings, performance-findings)
|
|
168
|
+
> - `bugfix`: lighter planning (`bug-analysis.md` instead of `tech-doc.md`); still requires code-review + security-review + regression test-cases + security-findings; performance-findings optional unless the bug is performance-related
|
|
169
|
+
> - `config`: only security-review (RD) and security-findings (QA)
|
|
170
|
+
> - `docs` / `chore`: no gates
|
|
171
|
+
>
|
|
172
|
+
> When PRD lands, classify the request type before running `peaks request init` for every role — pass `--type <type>` so the artifact records it and downstream transitions enforce the right gates. Misclassifying a feature as `docs` to skip gates is a workflow violation. If a transition fails with `code: PREREQUISITES_MISSING`, the response lists every missing path — produce them, then re-transition. For one-off exceptions, the escape hatch `--allow-incomplete --reason "<text>"` records the bypass in the artifact transition note.
|
|
173
|
+
|
|
174
|
+
After `peaks-rd` finishes any implementation, repair, or code-output slice, Peaks-Cli 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.
|
|
175
|
+
|
|
176
|
+
**How Solo invokes another role (mechanism, not metaphor):**
|
|
177
|
+
|
|
178
|
+
Solo is itself a skill running in the current session. There are **two distinct mechanisms** in this skill, and they MUST NOT be confused:
|
|
179
|
+
|
|
180
|
+
1. **Swarm fan-out (planning side, after PRD confirmed)** — uses `peaks sub-agent dispatch <role>` to launch real concurrent sub-agents. The CLI returns a per-IDE tool-call descriptor that the LLM executes in its environment. See "Peaks-Cli Swarm parallel phase" above for the full contract. Sub-agents do NOT call Skill(...) back into the role; they execute the role's instructions inline from the prompt.
|
|
181
|
+
2. **Sequential handoff (execution side, RD↔QA repair loop)** — Solo is the only loop, and after RD or QA finishes (whether as a sub-agent or directly), Solo drives the next step from the orchestrator seat. Do NOT use the `Skill` tool to "reactivate" peaks-rd or peaks-qa in the main loop; doing so is the v1.x anti-pattern that masqueraded as "calling the role" but actually just re-prompted the same session. From v1.3 onward, the main loop drives roles via the CLI gate (`peaks request transition`) and reads back artefacts (`peaks request show ... --json`); the actual RD/QA work is either done inline by Solo (when Solo has just been re-invoked by the user) or by a Task sub-agent (in swarm mode).
|
|
182
|
+
|
|
183
|
+
After RD completes (whether inline or sub-agent), Solo does not stop — it must advance to QA. There is no "RD done, ask the user" state in full-auto mode. The only valid stops are: (a) QA verdict=pass, (b) repair cap hit, (c) explicit user cancel.
|
|
184
|
+
|
|
185
|
+
**RD's internal reviews are already parallelized.** When RD finishes implementation, it issues a 3-way sub-agent fan-out (code-review + security-review + perf-baseline, see `skills/peaks-rd/SKILL.md` "Parallel review fan-out") and waits for all to return before transitioning to `qa-handoff`. Solo does NOT need to track three separate RD-side sub-runs; the RD role owns the fan-out lifecycle end-to-end. Solo's presence restoration after the swarm converges is the only coordination point.
|
|
186
|
+
|
|
187
|
+
**Presence restoration after RD/QA work returns (MANDATORY):** In v1.x, role skills called `peaks skill presence:set <role>` internally and stomped on `.peaks/.active-skill.json`. From v1.3 onward, sub-agents in the Swarm path are forbidden from calling `peaks skill presence:set` (see "Sub-agent dispatch" in each role's SKILL.md), so the main loop's presence file is preserved across the fan-out window by construction. The one place Solo still has to actively restore presence is **once after the fan-out returns** (gate=swarm-converged) and again **after each RD↔QA repair iteration** (gate=repair-cycle-<N>). Use the same command from Step 2 with the current mode and the gate that has just advanced:
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
peaks skill presence:set peaks-solo --project <repo> --mode <mode> --gate <current-gate>
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
This keeps the CLAUDE.md status header accurate (`Peaks-Cli Skill: peaks-solo`) instead of showing a stale role name. Use the current mode and gate values; the gate may have advanced since startup. Skipping this step causes the header to display the last-known gate permanently.
|
|
194
|
+
|
|
195
|
+
**Full-auto auto-proceed rule**: In the `full-auto` profile, when RD transitions to `qa-handoff`, Solo immediately drives QA — by launching a `peaks sub-agent dispatch qa` sub-agent carrying the `peaks-qa` body (swarm path), then executing the returned toolCall, or by running QA inline in the main loop (assisted/strict path). 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 `--type` is `docs` or `chore` (no acceptance surface).
|
|
196
|
+
|
|
197
|
+
A QA report with any failing, blocked, missing, or unverified acceptance item is not a pass.
|
|
198
|
+
|
|
199
|
+
**How Solo routes QA findings back to RD (mechanism, not metaphor):**
|
|
200
|
+
|
|
201
|
+
When `peaks-qa` returns `verdict=return-to-rd`, Solo does NOT manually rewrite RD artifacts. Instead it follows this exact sequence:
|
|
202
|
+
|
|
203
|
+
1. Read the QA verdict and findings via `peaks request show <rid> --role qa --project <repo> --json`. The findings live in the QA artifact body (failing acceptance items, evidence paths, severity).
|
|
204
|
+
2. Transition the RD artifact back from `qa-handoff` to a working state and record the QA verdict in the transition note:
|
|
205
|
+
```bash
|
|
206
|
+
peaks request transition <rid> --role rd --state spec-locked \
|
|
207
|
+
--reason "QA return-to-rd cycle <N>: <one-line summary of failing items; full findings in qa/test-reports/<rid>.md>" \
|
|
208
|
+
--project <repo> --json
|
|
209
|
+
```
|
|
210
|
+
`spec-locked` is the canonical "needs more RD work" state. The reason is mandatory in repair cycles so the artifact history shows the loop.
|
|
211
|
+
3. Re-launch `peaks-rd` work. Two paths, mode-driven:
|
|
212
|
+
- **Swarm / full-auto**: launch a fresh `peaks sub-agent dispatch rd` sub-agent (then execute the returned toolCall) with the same `peaks-rd` body used in the Swarm phase, plus the QA findings path so it can read the failure list. Solo restores presence after the sub-agent returns.
|
|
213
|
+
- **Assisted / strict / inline-fallback**: Solo executes the RD repair steps directly in the main loop, since there is no concurrent fan-out to coordinate.
|
|
214
|
+
In both paths, pass the QA findings path so the repair sees what failed.
|
|
215
|
+
4. peaks-rd fixes the reported issues only (red-line scope: do not modify unrelated surfaces), regenerates code-review and security-review evidence if changes touched reviewed surfaces, then transitions `rd → implemented → qa-handoff` again.
|
|
216
|
+
5. Solo re-runs QA (sub-agent Task in swarm/full-auto, inline in assisted/strict) with the same `<request-id>`. QA re-runs gates against the new diff.
|
|
217
|
+
6. Repeat steps 1-5 until QA returns `verdict=pass`, or the cap below fires.
|
|
218
|
+
**After each repair iteration** (after peaks-rd and peaks-qa both return), Solo MUST restore presence:
|
|
219
|
+
```bash
|
|
220
|
+
peaks skill presence:set peaks-solo --project <repo> --mode <mode> --gate repair-cycle-<N>
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
**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.
|
|
224
|
+
|
|
225
|
+
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.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Step 1 — Mode selection
|
|
2
|
+
|
|
3
|
+
> Body of `### Peaks-Cli Step 1`. After Step 0 has anchored the workspace and presence, when the user invokes Peaks-Cli Solo without explicitly naming an execution profile, use `AskUserQuestion` to pick the profile. Present the recommended full-auto path as the first/default option with a practical description for each:
|
|
4
|
+
|
|
5
|
+
1. **Full auto (Recommended)** — Peaks-Cli handles planning, role coordination, validation, and compact handoff end-to-end while preserving required confirmation gates for risky or shared-state actions.
|
|
6
|
+
2. **Assisted** — Peaks-Cli proposes plans, artifacts, and checks, then pauses for user decisions at major workflow boundaries.
|
|
7
|
+
3. **Swarm** — Peaks-Cli maximizes safe parallel role/worker execution for larger RD or QA workloads while keeping reducer validation and artifact boundaries explicit.
|
|
8
|
+
4. **Strict** — Peaks-Cli uses the most conservative gates: explicit confirmations, strict slice specs, coverage evidence, QA acceptance, and commit boundaries before continuing.
|
|
9
|
+
|
|
10
|
+
Map the user's selection to the `--mode` flag value (used by `peaks skill presence:set`; `presence:set --mode` accepts any string, so the name matches the user-facing label rather than overloading "solo" which is also the skill name):
|
|
11
|
+
|
|
12
|
+
| User selects | `--mode` value |
|
|
13
|
+
|---|---|
|
|
14
|
+
| Full auto | `full-auto` |
|
|
15
|
+
| Assisted | `assisted` |
|
|
16
|
+
| Swarm | `swarm` |
|
|
17
|
+
| Strict | `strict` |
|
|
18
|
+
|
|
19
|
+
> Note: `peaks workflow route --mode solo|team` is a **different** CLI dimension (solo developer vs team flow) and is unrelated to the profile choice here. Do not conflate them.
|
|
20
|
+
|
|
21
|
+
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.
|
|
@@ -36,3 +36,46 @@ If the consuming LLM needs an MCP server for docs lookup or research (e.g. Conte
|
|
|
36
36
|
## Boundary
|
|
37
37
|
|
|
38
38
|
Solo must not write `openspec/changes/**` or `~/.claude/settings.json` directly. Every mutation goes through the CLI commands above. The CLI returns stable envelopes; Solo captures them as artifact links rather than re-explaining their content in the handoff.
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
# Step 0.5 — OpenSpec first-run opt-in (conditional)
|
|
43
|
+
|
|
44
|
+
> Body of `### Peaks-Cli Step 0.5`. After the workspace is anchored, before project scan, Solo checks whether
|
|
45
|
+
the project already has an `openspec/` directory. The lifecycle
|
|
46
|
+
(`render → validate → show → to-rd → validate → archive`) only applies
|
|
47
|
+
when `openspec/` exists; without it, RD/QA/SC silently skip the
|
|
48
|
+
openspec-aware paths and you lose change-proposal tracking, commit
|
|
49
|
+
boundaries from `tasks.md`, and the historical archive.
|
|
50
|
+
|
|
51
|
+
To make that opt-in visible instead of silent, Solo runs:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
# 1. Detect whether the project already has openspec/.
|
|
55
|
+
ls <repo>/openspec/changes 2>&1
|
|
56
|
+
# 2. If absent, ask the user once — only on the first Solo run in this
|
|
57
|
+
# project. The decision is sticky: write it to .peaks/.peaks-openspec-opt-in.json
|
|
58
|
+
# so subsequent Solo invocations do not re-ask.
|
|
59
|
+
test -f <repo>/.peaks/.peaks-openspec-opt-in.json || \
|
|
60
|
+
echo "{\"enabled\": <bool>}" > <repo>/.peaks/.peaks-openspec-opt-in.json
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
**AskUserQuestion** (only when `openspec/` is absent and the opt-in
|
|
64
|
+
file is missing):
|
|
65
|
+
|
|
66
|
+
| Option | What it does |
|
|
67
|
+
|---|---|
|
|
68
|
+
| Enable OpenSpec for this project (Recommended) | Run `peaks openspec init --project <repo> --apply`. After that, every Solo run uses the change-proposal lifecycle for the same project. |
|
|
69
|
+
| Skip for now | Do nothing. Solo proceeds without openspec; the question is re-asked on the next first-run detection. |
|
|
70
|
+
| Never ask again for this project | Write `{enabled: false, sticky: true}`. Solo stops asking. The user can re-enable later by removing `.peaks/.peaks-openspec-opt-in.json` and re-running. |
|
|
71
|
+
|
|
72
|
+
The first option is the recommended default because it gives Solo the
|
|
73
|
+
full change-proposal lifecycle (proposal / tasks / design / specs
|
|
74
|
+
deltas, archive on ship, commit boundaries from `tasks.md`). It costs
|
|
75
|
+
only a single scaffolded directory and pays back the first time the
|
|
76
|
+
project needs a real review trail.
|
|
77
|
+
|
|
78
|
+
If the user picks "Enable", the only required follow-up is to make
|
|
79
|
+
sure `openspec/changes/` is added to git (it is part of the project
|
|
80
|
+
repo, not a tool-managed artefact). Solo does not run `git add` for
|
|
81
|
+
the user; that is the user's commit boundary.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Step 2.3 — Load project memory
|
|
2
|
+
|
|
3
|
+
> Body of `### Peaks-Cli Step 2.3`. Before planning any work, read the project's persistent memory — durable memories that survive across sessions:
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
peaks project memories --project <repo> --json
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
This returns durable memories from `.peaks/memory`, grouped by kind:
|
|
10
|
+
- **module** — code areas touched, with risk and rationale captured by past sessions
|
|
11
|
+
- **decision** — architectural choices, why they were made, what they affect
|
|
12
|
+
- **convention** — discovered project patterns (code style, naming, tooling)
|
|
13
|
+
- **rule** / **reference** / **project** — standing constraints, external pointers, and project context
|
|
14
|
+
|
|
15
|
+
Filter with `--kind <decision|convention|module|rule|reference|project|lesson>` when you only need one slice. Use this to understand what exists, what was decided, and what to avoid re-litigating. Memories are LLM-authored at approved checkpoints via `peaks memory extract`. The `lesson` kind is for LLM-discovered runtime lessons (e.g. "this project's antv6 Drawer uses `size` not `width`"); write them as `<!-- peaks-memory:start kind=lesson -->` blocks in the RD handoff or TXT handoff.
|
|
16
|
+
|
|
17
|
+
`.peaks/PROJECT.md` is a human-readable session timeline only — do NOT use it for LLM context.
|