peaks-loop 4.0.0-beta.4 → 4.0.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +5 -0
- package/CHANGELOG.md +16 -0
- package/README-en.md +4 -0
- package/README.md +4 -0
- package/dist/src/cli/commands/adapter-commands-s2a.d.ts +34 -0
- package/dist/src/cli/commands/adapter-commands-s2a.js +92 -0
- package/dist/src/cli/commands/core/skill-command.js +22 -0
- package/dist/src/cli/commands/polyrepo-commands.d.ts +37 -0
- package/dist/src/cli/commands/polyrepo-commands.js +155 -0
- package/dist/src/cli/commands/runtime-commands.d.ts +52 -0
- package/dist/src/cli/commands/runtime-commands.js +150 -0
- package/dist/src/cli/commands/skill-search-commands.d.ts +25 -0
- package/dist/src/cli/commands/skill-search-commands.js +68 -0
- package/dist/src/cli/program.js +16 -0
- package/dist/src/services/adapter/adapter-registry.d.ts +48 -0
- package/dist/src/services/adapter/adapter-registry.js +186 -0
- package/dist/src/services/context/context-schema.d.ts +6 -6
- package/dist/src/services/polyrepo/polyrepo-dispatcher.d.ts +34 -0
- package/dist/src/services/polyrepo/polyrepo-dispatcher.js +119 -0
- package/dist/src/services/polyrepo/polyrepo-scanner.d.ts +9 -0
- package/dist/src/services/polyrepo/polyrepo-scanner.js +94 -0
- package/dist/src/services/polyrepo/polyrepo-service.d.ts +34 -0
- package/dist/src/services/polyrepo/polyrepo-service.js +49 -0
- package/dist/src/services/polyrepo/polyrepo-types.d.ts +55 -0
- package/dist/src/services/polyrepo/polyrepo-types.js +1 -0
- package/dist/src/services/runtime/runtime-detector.d.ts +15 -0
- package/dist/src/services/runtime/runtime-detector.js +62 -0
- package/dist/src/services/runtime/runtime-service.d.ts +59 -0
- package/dist/src/services/runtime/runtime-service.js +51 -0
- package/dist/src/services/runtime/vendor-adapter.d.ts +59 -0
- package/dist/src/services/runtime/vendor-adapter.js +1 -0
- package/dist/src/services/runtime/vendors/claude-code.d.ts +7 -0
- package/dist/src/services/runtime/vendors/claude-code.js +39 -0
- package/dist/src/services/runtime/vendors/codex.d.ts +7 -0
- package/dist/src/services/runtime/vendors/codex.js +43 -0
- package/dist/src/services/runtime/vendors/copilot.d.ts +7 -0
- package/dist/src/services/runtime/vendors/copilot.js +40 -0
- package/dist/src/services/skill/skill-search-service.d.ts +88 -0
- package/dist/src/services/skill/skill-search-service.js +228 -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-code/SKILL.md +1 -8
- package/skills/peaks-code/references/external-references.md +1 -3
- package/skills/peaks-code/references/external-skill-invocation.md +1 -1
- package/skills/peaks-code/references/runbook.md +1 -3
- package/skills/peaks-code/references/step-0-55-1x-detection.md +2 -1
- package/skills/peaks-code/references/workflow-gates-and-types.md +1 -1
- package/skills/peaks-solo/SKILL.md +197 -0
- package/skills/peaks-solo/references/fallback-tool-inventory.md +46 -0
- package/skills/peaks-solo/references/sediment-prompt-template.md +62 -0
- package/skills/peaks-solo/references/triage-decision-table.md +31 -0
- package/skills/peaks-code/references/openspec-workflow.md +0 -81
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# peaks-solo — Triage Decision Table
|
|
2
|
+
|
|
3
|
+
> 关键词 → leaf skill 快速映射。peaks-solo 在 §3 triage 决策流里先扫本表做"启发式预判",再用 `peaks skill search --query "<NL>"` 做精确匹配。
|
|
4
|
+
> 匹配规则:case-insensitive substring(命中即行;同 NL 多行命中 → AskUserQuestion 多选)。
|
|
5
|
+
|
|
6
|
+
| keyword | → | leaf skill |
|
|
7
|
+
|---|---|---|
|
|
8
|
+
| code / 代码 / 改 bug / 写功能 / 全流程 / 端到端 / PR / 测试覆盖 / 改 src | → | /peaks-code |
|
|
9
|
+
| 文档 / article / blog / 内容 / 写稿 / 内容工作流 / 公众号 / 长文 | → | /peaks-content |
|
|
10
|
+
| 健康 / health / 体检 / audit / 报告 / doctor report / 项目诊断 | → | /peaks-doctor |
|
|
11
|
+
| issue / 修 issue / sweep / 批量修 / open issue 处理 | → | /peaks-issue-fix-orchestrator |
|
|
12
|
+
| SOP / 流程 / 工作流 / 审批 / 门禁 / 标准操作 | → | /peaks-sop |
|
|
13
|
+
| 性能 / perf / 慢 / 优化 / latency / 响应时间 | → | /peaks-perf-audit (or 自规划) |
|
|
14
|
+
| 安全 / security / 漏洞 / vulnerability / OWASP | → | /peaks-security-audit (or 自规划) |
|
|
15
|
+
| 状态 / status / 进度 / 现在到哪 / 当前在哪一步 | → | /peaks-status |
|
|
16
|
+
| 跑测试 / test / vitest / unit test | → | /peaks-test |
|
|
17
|
+
| 恢复 / resume / 继续 / 接上次 | → | /peaks-resume |
|
|
18
|
+
| 不知道 / 随便 / 帮我 / 你帮我决定 / 我想做点东西 | → | peaks-solo triage (this skill) |
|
|
19
|
+
| 切片 / slice / 拆解任务 / 大任务拆小 | → | /peaks-slice-decompose |
|
|
20
|
+
| 想法 / brain-storm / 创意 / 探索思路 | → | /peaks-ide |
|
|
21
|
+
| 最终审查 / final review / 验收 / 4-dim evidence | → | /peaks-final-review |
|
|
22
|
+
| 研究 / research / 信息查询 / GitHub trending / top 10 / 调查 | → | (no leaf) → 自规划(deep-search / WebSearch) |
|
|
23
|
+
| 一句话需求 / 一次性 / 单次性 | → | peaks-solo 自规划兜底 |
|
|
24
|
+
|
|
25
|
+
## 使用说明
|
|
26
|
+
|
|
27
|
+
1. **先扫表,再跑 search。** 表是 O(N) 的 substring 命中;跑 `peaks skill search` 是兜底。两者结果不一致时,以 search 为准(search 读的是 live frontmatter)。
|
|
28
|
+
2. **多行命中 → AskUserQuestion 多选,**模板见 SKILL.md §3.1。
|
|
29
|
+
3. **(e) "都不对" → 自规划兜底。** 走 SKILL.md §4。
|
|
30
|
+
4. **空表条目:** "研究 / 信息查询 / GitHub trending / top 10" 等一次性信息查询,**当前 skill 池没有专属 leaf**,peaks-solo 直接走自规划(deep-search / WebSearch)。
|
|
31
|
+
5. **本表是 opportunistic 表,**不是 exhaustive 表。S2/S3 后续可在 dogfood 中发现新关键词补行。
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
# OpenSpec Lifecycle for Peaks Code
|
|
2
|
-
|
|
3
|
-
Peaks Code orchestrates RD, QA, and SC. When the target repository uses OpenSpec, Code must drive the full lifecycle through the Peaks CLI so each role works against the same stable surface.
|
|
4
|
-
|
|
5
|
-
> **Slice #016 (2026-06-09)**: this document used to live at `openspec-mcp-workflow.md` and contained a section on the `peaks mcp *` lifecycle. The MCP subsystem was retired in slice #016; that section is gone. The OpenSpec lifecycle described below is unchanged.
|
|
6
|
-
|
|
7
|
-
## OpenSpec change lifecycle
|
|
8
|
-
|
|
9
|
-
```text
|
|
10
|
-
peaks openspec render → RD authors a change pack (dry-run, then --apply)
|
|
11
|
-
peaks openspec validate → Code gates RD output before slicing starts
|
|
12
|
-
peaks openspec show → any role reads parsed proposal/tasks state
|
|
13
|
-
peaks openspec to-rd → RD projects the pack into refactor slice input
|
|
14
|
-
SC projects it into commit boundary candidates
|
|
15
|
-
peaks openspec validate → QA gates the final state before sign-off
|
|
16
|
-
peaks openspec archive → Code moves the change under changes/archive/<id>/
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
Rules Code applies:
|
|
20
|
-
|
|
21
|
-
- `render --apply` is the only Peaks-managed way to write a change pack. Other roles must not hand-edit `openspec/changes/**`.
|
|
22
|
-
- `validate` is run twice per change in a refactor flow: once before slicing (RD entry gate) and once before archive (QA exit gate). Both must end with `data.valid === true`.
|
|
23
|
-
- `archive --apply` is the lifecycle terminator; Code only invokes it after QA acceptance and SC commit.
|
|
24
|
-
|
|
25
|
-
## Refactor workflow wiring
|
|
26
|
-
|
|
27
|
-
For `peaks-code refactor` runs against a repository with `openspec/`:
|
|
28
|
-
|
|
29
|
-
1. RD entry gate — `peaks openspec validate <id>` must pass and `peaks openspec to-rd <id>` must return `acceptance.length > 0`.
|
|
30
|
-
2. Each slice must reference one OpenSpec tasks section as its commit boundary (per `references/openspec-commit-boundaries.md` in peaks-sc).
|
|
31
|
-
3. QA exit gate — re-run `peaks openspec validate <id>` after implementation; record the result in the QA validation report.
|
|
32
|
-
4. Archive — `peaks openspec archive <id> --apply` only after QA passes the exit gate and SC closes the final commit.
|
|
33
|
-
|
|
34
|
-
If the consuming LLM needs an MCP server for docs lookup or research (e.g. Context7), it checks its own tool list for `mcp__<server>__*` and tells the user the install command if absent. peaks-loop is no longer in the install path; the LLM is the executor, the IDE is the dispatcher.
|
|
35
|
-
|
|
36
|
-
## Boundary
|
|
37
|
-
|
|
38
|
-
Code must not write `openspec/changes/**` or `~/.claude/settings.json` directly. Every mutation goes through the CLI commands above. The CLI returns stable envelopes; Code 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-Loop Step 0.5`. After the workspace is anchored, before project scan, Code 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, Code 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 Code run in this
|
|
57
|
-
# project. The decision is sticky: write it to .peaks/.peaks-openspec-opt-in.json
|
|
58
|
-
# so subsequent Code 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 Code run uses the change-proposal lifecycle for the same project. |
|
|
69
|
-
| Skip for now | Do nothing. Code 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}`. Code 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 Code 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). Code does not run `git add` for
|
|
81
|
-
the user; that is the user's commit boundary.
|