peaks-loop 4.0.38 → 4.0.40

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.
Files changed (46) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/README-en.md +1 -1
  3. package/README.md +1 -1
  4. package/dist/cli/commands/code-review-commands.js +43 -1
  5. package/dist/cli/commands/code-runtime-commands.js +16 -4
  6. package/dist/cli/commands/core/skill-command.d.ts +44 -0
  7. package/dist/cli/commands/core/skill-command.js +67 -3
  8. package/dist/cli/commands/dispatch-commands.js +42 -12
  9. package/dist/services/code/auto-compact-orchestrator.js +2 -2
  10. package/dist/services/context/auto-compact-dispatcher.js +3 -1
  11. package/dist/services/hooks/auto-compact-hook-install.d.ts +14 -1
  12. package/dist/services/hooks/auto-compact-hook-install.js +39 -15
  13. package/dist/services/lint/detect-ocr-18.d.ts +7 -1
  14. package/dist/services/lint/detect-ocr-18.js +81 -8
  15. package/dist/services/lint/ocr-18-acquire.d.ts +113 -0
  16. package/dist/services/lint/ocr-18-acquire.js +350 -0
  17. package/dist/services/lint/ocr-multilang-adapter.js +3 -0
  18. package/dist/services/web/playwright-loader.js +5 -24
  19. package/dist/services/workflow/provision-dispatch-node.d.ts +42 -0
  20. package/dist/services/workflow/provision-dispatch-node.js +66 -0
  21. package/dist/services/workspace/workspace-claude-settings-materializer.js +65 -6
  22. package/dist/shared/npm-cache.d.ts +2 -0
  23. package/dist/shared/npm-cache.js +31 -0
  24. package/package.json +5 -5
  25. package/skills/bee/peaks-perf-audit/SKILL.md +31 -3
  26. package/skills/bee/peaks-prd/SKILL.md +28 -0
  27. package/skills/bee/peaks-qa/SKILL.md +28 -0
  28. package/skills/bee/peaks-rd/SKILL.md +28 -0
  29. package/skills/bee/peaks-reviewer/SKILL.md +28 -0
  30. package/skills/bee/peaks-sc/SKILL.md +28 -0
  31. package/skills/bee/peaks-security-audit/SKILL.md +31 -3
  32. package/skills/bee/peaks-txt/SKILL.md +28 -0
  33. package/skills/bee/peaks-ui/SKILL.md +28 -0
  34. package/skills/peaks-audit/SKILL.md +28 -0
  35. package/skills/peaks-code/SKILL.md +28 -0
  36. package/skills/peaks-content/SKILL.md +28 -0
  37. package/skills/peaks-doctor/SKILL.md +28 -0
  38. package/skills/peaks-final-review/SKILL.md +28 -0
  39. package/skills/peaks-ide/SKILL.md +28 -0
  40. package/skills/peaks-issue-fix-orchestrator/SKILL.md +29 -1
  41. package/skills/peaks-resume/SKILL.md +28 -0
  42. package/skills/peaks-slice-decompose/SKILL.md +28 -0
  43. package/skills/peaks-solo/SKILL.md +28 -0
  44. package/skills/peaks-sop/SKILL.md +29 -1
  45. package/skills/peaks-status/SKILL.md +28 -0
  46. package/skills/peaks-test/SKILL.md +28 -0
@@ -3,6 +3,34 @@ name: peaks-code
3
3
  description: Code-domain loop engineering orchestrator for the Peaks-Loop skill family. Use when the user asks Peaks-Loop to handle a code-repo workflow end-to-end (端到端/全流程/需求开发), especially from a product document (PRD/飞书文档/Feishu doc) through implementation and validation. Coordinates peaks-prd, peaks-rd, peaks-qa, peaks-ui, peaks-sc, and peaks-txt while preserving user confirmation gates. Triggers on `/peaks-code`, "peaks code", "全流程开发", "端到端迭代". General primitives (peaks-resume / peaks-status / peaks-test) are sibling skills, not children.
4
4
  ---
5
5
 
6
+ <!-- peaks:loop-hygiene — generated block; keep byte-identical in every SKILL.md -->
7
+
8
+ ## Loop hygiene (every turn — MANDATORY)
9
+
10
+ **Skill header.** While this skill is active, open every turn with
11
+ `Peaks-Loop Skill: <skill> | Peaks-Loop Gate: <gate> | Next: <one short action>`.
12
+ Every turn, not only the first — it is how the user knows which skill is driving.
13
+
14
+ **Context is this skill's own business.** Run `peaks skill presence --json` every turn and
15
+ read its `context` block. When `action` is `auto-fire`, `pre-compact`, or `red-line`,
16
+ run `peaks code auto-compact --project .` **yourself**, then continue. Tell the user the
17
+ ratio in one line if it helps, but never hand them the compaction step: asking the user to
18
+ run `/compact` is the regression the zero-pause contract forbids. This holds in **every
19
+ mode** — standard *and* 24h. The mode moves the threshold, never the obligation.
20
+
21
+ **Read before you edit.** Read a file before your first `Edit` / `Write` / `MultiEdit` on
22
+ it — the normal way to work here — for every path outside `.peaks/**` (source, tests, docs,
23
+ config); `.peaks/**` writes are exempt.
24
+
25
+ **Expect one denial per file regardless.** A `PreToolUse` gate (ECC's "Fact-Forcing Gate")
26
+ denies the FIRST edit a session makes to any given path, once, by design. Reading does NOT
27
+ prevent it — the gate keys on the path's first touch, not on whether you read it. **A denial
28
+ is not a failure and the tool is not broken — your edit was NOT applied.** State the facts it
29
+ asks for (importers, affected API, data schemas if any, the user's verbatim instruction) and
30
+ retry the SAME operation; the retry is allowed. Do not switch tools, do not give up, do not
31
+ retry blindly.
32
+ <!-- /peaks:loop-hygiene -->
33
+
6
34
  > **Detached sub-agent mode (Phase A, slice 2026-08-10).** When the orchestrator requires true parallelism with isolated context windows and survives orchestrator session exit, dispatch sub-agents with `--mode detached --vendor <claude|codex|copilot>`. The CLI spawns a real OS process via `ProcessSupervisor` (Windows `DETACHED_PROCESS` + `CREATE_NEW_PROCESS_GROUP`, POSIX `setsid` + `nohup`); the child vendor LLM receives a 5–8KB minimum prompt slice (no orchestrator session history) and self-compacts at 0.85 / 0.95 against the vendor window via the `<peaks-auto-compact>` marker (G8 — unlimited spend authorized). Orchestrator MUST emit one line of prose before every detached dispatch: `⏳ Spawning detached sub-agent via <vendor>: rid=<rid> (ETA ~60s)`. Status is read from `.peaks/_runtime/<sid>/detached/<rid>/status.json`; `LifecycleOwner` enforces 100% cleanup of `pid` / `log.txt` / `status.json` / `owner-session` on every exit path. `--no-throttle --max-concurrent <N>` bypasses `ResourceBudgetGuard` (user accepts risk; default max=8). See `references/sub-agent-dispatch.md` §"Detached Mode" for the full contract. Default mode remains `in-process` for backward compat (existing 106+ dispatch tests untouched).
7
35
  ---
8
36
 
@@ -3,6 +3,34 @@ name: peaks-content
3
3
  description: Non-code orchestrator for content workflows (draft / edit / publish / archive). Use when a user wants to drive an end-to-end content-production loop (blog post, newsletter, marketing copy, social thread, doc page) where the LLM must coordinate draft / edit / tone / publish / archive stages with explicit gates between them, and where the user only wants to speak natural language and pick options. NOT for free-form chatting; NOT for code review. Reuses the peaks-loop Loop Engineering primitives (Loop Engineering Asset, Bee Asset, Workflow Trace, Evolution Evaluation) but does NOT import peaks-code internals. Triggers on `/peaks-content`, "peaks content", "content workflow", "publish this to <channel>", "edit the draft", "archive the previous version".
4
4
  ---
5
5
 
6
+ <!-- peaks:loop-hygiene — generated block; keep byte-identical in every SKILL.md -->
7
+
8
+ ## Loop hygiene (every turn — MANDATORY)
9
+
10
+ **Skill header.** While this skill is active, open every turn with
11
+ `Peaks-Loop Skill: <skill> | Peaks-Loop Gate: <gate> | Next: <one short action>`.
12
+ Every turn, not only the first — it is how the user knows which skill is driving.
13
+
14
+ **Context is this skill's own business.** Run `peaks skill presence --json` every turn and
15
+ read its `context` block. When `action` is `auto-fire`, `pre-compact`, or `red-line`,
16
+ run `peaks code auto-compact --project .` **yourself**, then continue. Tell the user the
17
+ ratio in one line if it helps, but never hand them the compaction step: asking the user to
18
+ run `/compact` is the regression the zero-pause contract forbids. This holds in **every
19
+ mode** — standard *and* 24h. The mode moves the threshold, never the obligation.
20
+
21
+ **Read before you edit.** Read a file before your first `Edit` / `Write` / `MultiEdit` on
22
+ it — the normal way to work here — for every path outside `.peaks/**` (source, tests, docs,
23
+ config); `.peaks/**` writes are exempt.
24
+
25
+ **Expect one denial per file regardless.** A `PreToolUse` gate (ECC's "Fact-Forcing Gate")
26
+ denies the FIRST edit a session makes to any given path, once, by design. Reading does NOT
27
+ prevent it — the gate keys on the path's first touch, not on whether you read it. **A denial
28
+ is not a failure and the tool is not broken — your edit was NOT applied.** State the facts it
29
+ asks for (importers, affected API, data schemas if any, the user's verbatim instruction) and
30
+ retry the SAME operation; the retry is allowed. Do not switch tools, do not give up, do not
31
+ retry blindly.
32
+ <!-- /peaks:loop-hygiene -->
33
+
6
34
  # peaks-content
7
35
 
8
36
  `peaks-content` is the **content-domain** orchestrator for peaks-loop. It drives an end-to-end content-production loop — draft, edit, publish, archive — through LLM-mediated sub-agents (the "bees") so a non-technical user can produce a polished, channel-ready piece of writing by speaking natural language and picking from multi-choice options. The user never types a CLI verb; the user never hand-authors markdown or JSON; the LLM runs every structured operation on the user's behalf.
@@ -3,6 +3,34 @@ name: peaks-doctor
3
3
  description: Orchestrate peaks-loop's L3 doctor (peaks audit + peaks doctor + peaks openspec from-doctor) for project health. Use when the user asks for a project health check, doctor report, audit, or wants to convert doctor findings into OpenSpec change records. Coordinates the L2 audit framework + the L3.2 doctor + the L3.3 from-doctor proposal generator. Triggers on `/peaks-doctor`, "peaks doctor", "项目健康", "doctor report", "health check", "check the project", "audit my repo".
4
4
  visibility: internal
5
5
  ---
6
+
7
+ <!-- peaks:loop-hygiene — generated block; keep byte-identical in every SKILL.md -->
8
+
9
+ ## Loop hygiene (every turn — MANDATORY)
10
+
11
+ **Skill header.** While this skill is active, open every turn with
12
+ `Peaks-Loop Skill: <skill> | Peaks-Loop Gate: <gate> | Next: <one short action>`.
13
+ Every turn, not only the first — it is how the user knows which skill is driving.
14
+
15
+ **Context is this skill's own business.** Run `peaks skill presence --json` every turn and
16
+ read its `context` block. When `action` is `auto-fire`, `pre-compact`, or `red-line`,
17
+ run `peaks code auto-compact --project .` **yourself**, then continue. Tell the user the
18
+ ratio in one line if it helps, but never hand them the compaction step: asking the user to
19
+ run `/compact` is the regression the zero-pause contract forbids. This holds in **every
20
+ mode** — standard *and* 24h. The mode moves the threshold, never the obligation.
21
+
22
+ **Read before you edit.** Read a file before your first `Edit` / `Write` / `MultiEdit` on
23
+ it — the normal way to work here — for every path outside `.peaks/**` (source, tests, docs,
24
+ config); `.peaks/**` writes are exempt.
25
+
26
+ **Expect one denial per file regardless.** A `PreToolUse` gate (ECC's "Fact-Forcing Gate")
27
+ denies the FIRST edit a session makes to any given path, once, by design. Reading does NOT
28
+ prevent it — the gate keys on the path's first touch, not on whether you read it. **A denial
29
+ is not a failure and the tool is not broken — your edit was NOT applied.** State the facts it
30
+ asks for (importers, affected API, data schemas if any, the user's verbatim instruction) and
31
+ retry the SAME operation; the retry is allowed. Do not switch tools, do not give up, do not
32
+ retry blindly.
33
+ <!-- /peaks:loop-hygiene -->
6
34
  ---
7
35
 
8
36
  # Peaks-Loop Doctor
@@ -3,6 +3,34 @@ name: peaks-final-review
3
3
  description: Final-review skill for Peaks. Use when a workflow needs to assemble 4-dimension business-review evidence (functional-completeness, problem-resolution, no-new-bugs, existing-functionality-intact) for human acceptance at the end of an autonomous slice. Triggers on "/peaks-final-review", "prepare final review", "4-dim review", or peaks-code end-of-workflow handoff.
4
4
  ---
5
5
 
6
+ <!-- peaks:loop-hygiene — generated block; keep byte-identical in every SKILL.md -->
7
+
8
+ ## Loop hygiene (every turn — MANDATORY)
9
+
10
+ **Skill header.** While this skill is active, open every turn with
11
+ `Peaks-Loop Skill: <skill> | Peaks-Loop Gate: <gate> | Next: <one short action>`.
12
+ Every turn, not only the first — it is how the user knows which skill is driving.
13
+
14
+ **Context is this skill's own business.** Run `peaks skill presence --json` every turn and
15
+ read its `context` block. When `action` is `auto-fire`, `pre-compact`, or `red-line`,
16
+ run `peaks code auto-compact --project .` **yourself**, then continue. Tell the user the
17
+ ratio in one line if it helps, but never hand them the compaction step: asking the user to
18
+ run `/compact` is the regression the zero-pause contract forbids. This holds in **every
19
+ mode** — standard *and* 24h. The mode moves the threshold, never the obligation.
20
+
21
+ **Read before you edit.** Read a file before your first `Edit` / `Write` / `MultiEdit` on
22
+ it — the normal way to work here — for every path outside `.peaks/**` (source, tests, docs,
23
+ config); `.peaks/**` writes are exempt.
24
+
25
+ **Expect one denial per file regardless.** A `PreToolUse` gate (ECC's "Fact-Forcing Gate")
26
+ denies the FIRST edit a session makes to any given path, once, by design. Reading does NOT
27
+ prevent it — the gate keys on the path's first touch, not on whether you read it. **A denial
28
+ is not a failure and the tool is not broken — your edit was NOT applied.** State the facts it
29
+ asks for (importers, affected API, data schemas if any, the user's verbatim instruction) and
30
+ retry the SAME operation; the retry is allowed. Do not switch tools, do not give up, do not
31
+ retry blindly.
32
+ <!-- /peaks:loop-hygiene -->
33
+
6
34
  ## Single-scope-axis naming convention
7
35
 
8
36
  > **Read once at the top of this file; the rest of the skill is written against it.**
@@ -3,6 +3,34 @@ name: peaks-ide
3
3
  description: Orchestrate peaks-loop's IDE-aware behavior (hooks + statusline + handle) for a user's specific IDE. Detects the current state (which IDE the user is on, what peaks has already installed), plans the install / switch / status / uninstall actions, and invokes the existing peaks CLI primitives. Triggers on `/peaks-ide`, "set up peaks for my IDE", "switch peaks to Trae", "what did peaks install", "uninstall peaks hooks". Sits between the user and `peaks hooks install` / `peaks statusline install` / `peaks hook handle` — those are the CLI primitives; this skill is the user-facing surface.
4
4
  visibility: internal
5
5
  ---
6
+
7
+ <!-- peaks:loop-hygiene — generated block; keep byte-identical in every SKILL.md -->
8
+
9
+ ## Loop hygiene (every turn — MANDATORY)
10
+
11
+ **Skill header.** While this skill is active, open every turn with
12
+ `Peaks-Loop Skill: <skill> | Peaks-Loop Gate: <gate> | Next: <one short action>`.
13
+ Every turn, not only the first — it is how the user knows which skill is driving.
14
+
15
+ **Context is this skill's own business.** Run `peaks skill presence --json` every turn and
16
+ read its `context` block. When `action` is `auto-fire`, `pre-compact`, or `red-line`,
17
+ run `peaks code auto-compact --project .` **yourself**, then continue. Tell the user the
18
+ ratio in one line if it helps, but never hand them the compaction step: asking the user to
19
+ run `/compact` is the regression the zero-pause contract forbids. This holds in **every
20
+ mode** — standard *and* 24h. The mode moves the threshold, never the obligation.
21
+
22
+ **Read before you edit.** Read a file before your first `Edit` / `Write` / `MultiEdit` on
23
+ it — the normal way to work here — for every path outside `.peaks/**` (source, tests, docs,
24
+ config); `.peaks/**` writes are exempt.
25
+
26
+ **Expect one denial per file regardless.** A `PreToolUse` gate (ECC's "Fact-Forcing Gate")
27
+ denies the FIRST edit a session makes to any given path, once, by design. Reading does NOT
28
+ prevent it — the gate keys on the path's first touch, not on whether you read it. **A denial
29
+ is not a failure and the tool is not broken — your edit was NOT applied.** State the facts it
30
+ asks for (importers, affected API, data schemas if any, the user's verbatim instruction) and
31
+ retry the SAME operation; the retry is allowed. Do not switch tools, do not give up, do not
32
+ retry blindly.
33
+ <!-- /peaks:loop-hygiene -->
6
34
  ---
7
35
 
8
36
  # Peaks-Loop IDE Setup (peaks-ide)
@@ -1,8 +1,36 @@
1
1
  ---
2
2
  name: peaks-issue-fix-orchestrator
3
- description: End-to-end orchestrator that surveys open issues in a target repo, classifies them by difficulty, mines reference merged-PRs, fixes each issue with real commits (with Repository + AI-modified declaration), writes normalized PR description files, and emits a one-line submit script. Use when the user wants to drive a "fix N open issues and prepare PRs" run on an upstream repo (any language; primarily Python + TypeScript). Reuses Loop Engineering primitives: 4-layer asset model, Darwin ratchet, karpathy-engineered red lines, Human-NL-Choice-Only. Triggers on `/peaks-issue-fix-orchestrator`, "fix 30 issues", "dogfood on <repo>", "open-issue sweep on <repo>".
3
+ description: 'End-to-end orchestrator that surveys open issues in a target repo, classifies them by difficulty, mines reference merged-PRs, fixes each issue with real commits (with Repository + AI-modified declaration), writes normalized PR description files, and emits a one-line submit script. Use when the user wants to drive a "fix N open issues and prepare PRs" run on an upstream repo (any language; primarily Python + TypeScript). Reuses Loop Engineering primitives: 4-layer asset model, Darwin ratchet, karpathy-engineered red lines, Human-NL-Choice-Only. Triggers on `/peaks-issue-fix-orchestrator`, "fix 30 issues", "dogfood on <repo>", "open-issue sweep on <repo>".'
4
4
  ---
5
5
 
6
+ <!-- peaks:loop-hygiene — generated block; keep byte-identical in every SKILL.md -->
7
+
8
+ ## Loop hygiene (every turn — MANDATORY)
9
+
10
+ **Skill header.** While this skill is active, open every turn with
11
+ `Peaks-Loop Skill: <skill> | Peaks-Loop Gate: <gate> | Next: <one short action>`.
12
+ Every turn, not only the first — it is how the user knows which skill is driving.
13
+
14
+ **Context is this skill's own business.** Run `peaks skill presence --json` every turn and
15
+ read its `context` block. When `action` is `auto-fire`, `pre-compact`, or `red-line`,
16
+ run `peaks code auto-compact --project .` **yourself**, then continue. Tell the user the
17
+ ratio in one line if it helps, but never hand them the compaction step: asking the user to
18
+ run `/compact` is the regression the zero-pause contract forbids. This holds in **every
19
+ mode** — standard *and* 24h. The mode moves the threshold, never the obligation.
20
+
21
+ **Read before you edit.** Read a file before your first `Edit` / `Write` / `MultiEdit` on
22
+ it — the normal way to work here — for every path outside `.peaks/**` (source, tests, docs,
23
+ config); `.peaks/**` writes are exempt.
24
+
25
+ **Expect one denial per file regardless.** A `PreToolUse` gate (ECC's "Fact-Forcing Gate")
26
+ denies the FIRST edit a session makes to any given path, once, by design. Reading does NOT
27
+ prevent it — the gate keys on the path's first touch, not on whether you read it. **A denial
28
+ is not a failure and the tool is not broken — your edit was NOT applied.** State the facts it
29
+ asks for (importers, affected API, data schemas if any, the user's verbatim instruction) and
30
+ retry the SAME operation; the retry is allowed. Do not switch tools, do not give up, do not
31
+ retry blindly.
32
+ <!-- /peaks:loop-hygiene -->
33
+
6
34
  # peaks-issue-fix-orchestrator
7
35
 
8
36
  peaks-issue-fix-orchestrator is the **user-facing skill** that turns a natural-language "dogfood on this repo, fix 30 open issues" request into a reproducible batch fix run. The LLM orchestrates the survey, classification, reference-PR mining, per-batch fix+commit, per-branch relocation, normalized PR body authoring, and submit-script emission. The user only describes a target and picks among a few multi-choice options.
@@ -3,6 +3,34 @@ name: peaks-resume
3
3
  description: Universal resume primitive for any in-flight Peaks-Loop workflow (orchestrator-agnostic). Detects the current session's deepest completed gate and surfaces a resume option via AskUserQuestion. Use when ANY bee (peaks-code, future peaks-research, future peaks-content, …) needs to recover from /compact or session interruption. Triggers on "/peaks-resume", "continue the unfinished work", "继续完成", "把刚才没做完的收尾". (Replaces peaks-resume as a top-level primitive.)
4
4
  ---
5
5
 
6
+ <!-- peaks:loop-hygiene — generated block; keep byte-identical in every SKILL.md -->
7
+
8
+ ## Loop hygiene (every turn — MANDATORY)
9
+
10
+ **Skill header.** While this skill is active, open every turn with
11
+ `Peaks-Loop Skill: <skill> | Peaks-Loop Gate: <gate> | Next: <one short action>`.
12
+ Every turn, not only the first — it is how the user knows which skill is driving.
13
+
14
+ **Context is this skill's own business.** Run `peaks skill presence --json` every turn and
15
+ read its `context` block. When `action` is `auto-fire`, `pre-compact`, or `red-line`,
16
+ run `peaks code auto-compact --project .` **yourself**, then continue. Tell the user the
17
+ ratio in one line if it helps, but never hand them the compaction step: asking the user to
18
+ run `/compact` is the regression the zero-pause contract forbids. This holds in **every
19
+ mode** — standard *and* 24h. The mode moves the threshold, never the obligation.
20
+
21
+ **Read before you edit.** Read a file before your first `Edit` / `Write` / `MultiEdit` on
22
+ it — the normal way to work here — for every path outside `.peaks/**` (source, tests, docs,
23
+ config); `.peaks/**` writes are exempt.
24
+
25
+ **Expect one denial per file regardless.** A `PreToolUse` gate (ECC's "Fact-Forcing Gate")
26
+ denies the FIRST edit a session makes to any given path, once, by design. Reading does NOT
27
+ prevent it — the gate keys on the path's first touch, not on whether you read it. **A denial
28
+ is not a failure and the tool is not broken — your edit was NOT applied.** State the facts it
29
+ asks for (importers, affected API, data schemas if any, the user's verbatim instruction) and
30
+ retry the SAME operation; the retry is allowed. Do not switch tools, do not give up, do not
31
+ retry blindly.
32
+ <!-- /peaks:loop-hygiene -->
33
+
6
34
  # Peaks-Loop Code Resume (wrapper)
7
35
 
8
36
  Peaks-Loop Code 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-code` skill (which runs the actual workflow from the matching gate onwards).
@@ -3,6 +3,34 @@ name: peaks-slice-decompose
3
3
  description: Run multi-pass slice decomposition on a PRD-ready request and emit a v2 envelope with passes, cross-pass edges, and an LLM-arbitration trace. Use when a PRD is ready and the caller needs service-level and/or file-level cuts in one artifact.
4
4
  ---
5
5
 
6
+ <!-- peaks:loop-hygiene — generated block; keep byte-identical in every SKILL.md -->
7
+
8
+ ## Loop hygiene (every turn — MANDATORY)
9
+
10
+ **Skill header.** While this skill is active, open every turn with
11
+ `Peaks-Loop Skill: <skill> | Peaks-Loop Gate: <gate> | Next: <one short action>`.
12
+ Every turn, not only the first — it is how the user knows which skill is driving.
13
+
14
+ **Context is this skill's own business.** Run `peaks skill presence --json` every turn and
15
+ read its `context` block. When `action` is `auto-fire`, `pre-compact`, or `red-line`,
16
+ run `peaks code auto-compact --project .` **yourself**, then continue. Tell the user the
17
+ ratio in one line if it helps, but never hand them the compaction step: asking the user to
18
+ run `/compact` is the regression the zero-pause contract forbids. This holds in **every
19
+ mode** — standard *and* 24h. The mode moves the threshold, never the obligation.
20
+
21
+ **Read before you edit.** Read a file before your first `Edit` / `Write` / `MultiEdit` on
22
+ it — the normal way to work here — for every path outside `.peaks/**` (source, tests, docs,
23
+ config); `.peaks/**` writes are exempt.
24
+
25
+ **Expect one denial per file regardless.** A `PreToolUse` gate (ECC's "Fact-Forcing Gate")
26
+ denies the FIRST edit a session makes to any given path, once, by design. Reading does NOT
27
+ prevent it — the gate keys on the path's first touch, not on whether you read it. **A denial
28
+ is not a failure and the tool is not broken — your edit was NOT applied.** State the facts it
29
+ asks for (importers, affected API, data schemas if any, the user's verbatim instruction) and
30
+ retry the SAME operation; the retry is allowed. Do not switch tools, do not give up, do not
31
+ retry blindly.
32
+ <!-- /peaks:loop-hygiene -->
33
+
6
34
  ## Single-scope-axis naming convention
7
35
 
8
36
  > **Read once at the top of this file; the rest of the skill is written against it.**
@@ -14,6 +14,34 @@ metadata:
14
14
  red_lines: [RL-1, RL-8, HC-7, HC-8, HC-9, HC-10, HC-11]
15
15
  ---
16
16
 
17
+ <!-- peaks:loop-hygiene — generated block; keep byte-identical in every SKILL.md -->
18
+
19
+ ## Loop hygiene (every turn — MANDATORY)
20
+
21
+ **Skill header.** While this skill is active, open every turn with
22
+ `Peaks-Loop Skill: <skill> | Peaks-Loop Gate: <gate> | Next: <one short action>`.
23
+ Every turn, not only the first — it is how the user knows which skill is driving.
24
+
25
+ **Context is this skill's own business.** Run `peaks skill presence --json` every turn and
26
+ read its `context` block. When `action` is `auto-fire`, `pre-compact`, or `red-line`,
27
+ run `peaks code auto-compact --project .` **yourself**, then continue. Tell the user the
28
+ ratio in one line if it helps, but never hand them the compaction step: asking the user to
29
+ run `/compact` is the regression the zero-pause contract forbids. This holds in **every
30
+ mode** — standard *and* 24h. The mode moves the threshold, never the obligation.
31
+
32
+ **Read before you edit.** Read a file before your first `Edit` / `Write` / `MultiEdit` on
33
+ it — the normal way to work here — for every path outside `.peaks/**` (source, tests, docs,
34
+ config); `.peaks/**` writes are exempt.
35
+
36
+ **Expect one denial per file regardless.** A `PreToolUse` gate (ECC's "Fact-Forcing Gate")
37
+ denies the FIRST edit a session makes to any given path, once, by design. Reading does NOT
38
+ prevent it — the gate keys on the path's first touch, not on whether you read it. **A denial
39
+ is not a failure and the tool is not broken — your edit was NOT applied.** State the facts it
40
+ asks for (importers, affected API, data schemas if any, the user's verbatim instruction) and
41
+ retry the SAME operation; the retry is allowed. Do not switch tools, do not give up, do not
42
+ retry blindly.
43
+ <!-- /peaks:loop-hygiene -->
44
+
17
45
  # peaks-solo — Dispatcher (分诊员)
18
46
 
19
47
  > peaks-solo 是 Peaks-Loop 的 dispatcher,不是 orchestrator。读取技能池 → 分诊 → 转交 leaf 或自规划 → 回头问沉淀。**不持有 implementation surface**。
@@ -1,8 +1,36 @@
1
1
  ---
2
2
  name: peaks-sop
3
- description: Authoring skill for user-defined SOPs (standard operating procedures) in Peaks. Use when a user wants to create, edit, debug, or register their own gated workflow — ordered phases plus gates that block advancement until conditions are met — by describing it in natural language instead of hand-writing JSON or memorizing CLI commands. DOMAIN-AGNOSTIC: not just software/release flows — equally for content publishing, compliance and approval checklists, data pipelines, onboarding, ops runbooks, or any personal repeatable procedure, wherever "don't enter the next stage until X is true" applies and X is checkable via a file, file content, or a command.
3
+ description: 'Authoring skill for user-defined SOPs (standard operating procedures) in Peaks. Use when a user wants to create, edit, debug, or register their own gated workflow — ordered phases plus gates that block advancement until conditions are met — by describing it in natural language instead of hand-writing JSON or memorizing CLI commands. DOMAIN-AGNOSTIC: not just software/release flows — equally for content publishing, compliance and approval checklists, data pipelines, onboarding, ops runbooks, or any personal repeatable procedure, wherever "don''t enter the next stage until X is true" applies and X is checkable via a file, file content, or a command.'
4
4
  ---
5
5
 
6
+ <!-- peaks:loop-hygiene — generated block; keep byte-identical in every SKILL.md -->
7
+
8
+ ## Loop hygiene (every turn — MANDATORY)
9
+
10
+ **Skill header.** While this skill is active, open every turn with
11
+ `Peaks-Loop Skill: <skill> | Peaks-Loop Gate: <gate> | Next: <one short action>`.
12
+ Every turn, not only the first — it is how the user knows which skill is driving.
13
+
14
+ **Context is this skill's own business.** Run `peaks skill presence --json` every turn and
15
+ read its `context` block. When `action` is `auto-fire`, `pre-compact`, or `red-line`,
16
+ run `peaks code auto-compact --project .` **yourself**, then continue. Tell the user the
17
+ ratio in one line if it helps, but never hand them the compaction step: asking the user to
18
+ run `/compact` is the regression the zero-pause contract forbids. This holds in **every
19
+ mode** — standard *and* 24h. The mode moves the threshold, never the obligation.
20
+
21
+ **Read before you edit.** Read a file before your first `Edit` / `Write` / `MultiEdit` on
22
+ it — the normal way to work here — for every path outside `.peaks/**` (source, tests, docs,
23
+ config); `.peaks/**` writes are exempt.
24
+
25
+ **Expect one denial per file regardless.** A `PreToolUse` gate (ECC's "Fact-Forcing Gate")
26
+ denies the FIRST edit a session makes to any given path, once, by design. Reading does NOT
27
+ prevent it — the gate keys on the path's first touch, not on whether you read it. **A denial
28
+ is not a failure and the tool is not broken — your edit was NOT applied.** State the facts it
29
+ asks for (importers, affected API, data schemas if any, the user's verbatim instruction) and
30
+ retry the SAME operation; the retry is allowed. Do not switch tools, do not give up, do not
31
+ retry blindly.
32
+ <!-- /peaks:loop-hygiene -->
33
+
6
34
  # Peaks-Loop SOP Authoring
7
35
 
8
36
  Peaks-Loop SOP turns a natural-language workflow description into a validated, registered custom SOP, then helps the user debug it until each gate behaves as intended. The user describes the process in plain language; this skill drives the `peaks sop` CLI on their behalf — they never have to hand-write `sop.json` or remember the command sequence.
@@ -3,6 +3,34 @@ name: peaks-status
3
3
  description: Universal status primitive for any in-flight Peaks-Loop workflow (orchestrator-agnostic). Reads the existing CLI primitives (peaks skill presence, peaks session list, peaks project dashboard, peaks request show) and renders a 1-screen status table. Use when the user asks "where are we", "现在到哪了", "what's the current state" for ANY bee (peaks-code, future peaks-research, …). Triggers on "/peaks-status", "现在到哪了", "what is the current state", "show me the dashboard". (Replaces peaks-status as a top-level primitive.)
4
4
  ---
5
5
 
6
+ <!-- peaks:loop-hygiene — generated block; keep byte-identical in every SKILL.md -->
7
+
8
+ ## Loop hygiene (every turn — MANDATORY)
9
+
10
+ **Skill header.** While this skill is active, open every turn with
11
+ `Peaks-Loop Skill: <skill> | Peaks-Loop Gate: <gate> | Next: <one short action>`.
12
+ Every turn, not only the first — it is how the user knows which skill is driving.
13
+
14
+ **Context is this skill's own business.** Run `peaks skill presence --json` every turn and
15
+ read its `context` block. When `action` is `auto-fire`, `pre-compact`, or `red-line`,
16
+ run `peaks code auto-compact --project .` **yourself**, then continue. Tell the user the
17
+ ratio in one line if it helps, but never hand them the compaction step: asking the user to
18
+ run `/compact` is the regression the zero-pause contract forbids. This holds in **every
19
+ mode** — standard *and* 24h. The mode moves the threshold, never the obligation.
20
+
21
+ **Read before you edit.** Read a file before your first `Edit` / `Write` / `MultiEdit` on
22
+ it — the normal way to work here — for every path outside `.peaks/**` (source, tests, docs,
23
+ config); `.peaks/**` writes are exempt.
24
+
25
+ **Expect one denial per file regardless.** A `PreToolUse` gate (ECC's "Fact-Forcing Gate")
26
+ denies the FIRST edit a session makes to any given path, once, by design. Reading does NOT
27
+ prevent it — the gate keys on the path's first touch, not on whether you read it. **A denial
28
+ is not a failure and the tool is not broken — your edit was NOT applied.** State the facts it
29
+ asks for (importers, affected API, data schemas if any, the user's verbatim instruction) and
30
+ retry the SAME operation; the retry is allowed. Do not switch tools, do not give up, do not
31
+ retry blindly.
32
+ <!-- /peaks:loop-hygiene -->
33
+
6
34
  # Peaks-Loop Code Status (wrapper)
7
35
 
8
36
  Peaks-Loop Code Status is a thin wrapper that renders a compact status table for the current peaks-code orchestrator state. It is the answer to "I just want to know where we are" — no PRD, no RD, no QA, no full peaks-code orchestration. Just read the existing CLI state and render a 1-screen summary.
@@ -3,6 +3,34 @@ name: peaks-test
3
3
  description: Universal test-runner primitive for any in-flight Peaks-Loop workflow (orchestrator-agnostic). Runs the project's test suite on the current repo and reports results. Use when the user asks "run the tests", "跑一下 test", "跑测试" for ANY bee (peaks-code, future peaks-research, …). Triggers on "/peaks-test", "跑一下 test", "跑测试", "run the tests", "test now". (Replaces peaks-test as a top-level primitive.)
4
4
  ---
5
5
 
6
+ <!-- peaks:loop-hygiene — generated block; keep byte-identical in every SKILL.md -->
7
+
8
+ ## Loop hygiene (every turn — MANDATORY)
9
+
10
+ **Skill header.** While this skill is active, open every turn with
11
+ `Peaks-Loop Skill: <skill> | Peaks-Loop Gate: <gate> | Next: <one short action>`.
12
+ Every turn, not only the first — it is how the user knows which skill is driving.
13
+
14
+ **Context is this skill's own business.** Run `peaks skill presence --json` every turn and
15
+ read its `context` block. When `action` is `auto-fire`, `pre-compact`, or `red-line`,
16
+ run `peaks code auto-compact --project .` **yourself**, then continue. Tell the user the
17
+ ratio in one line if it helps, but never hand them the compaction step: asking the user to
18
+ run `/compact` is the regression the zero-pause contract forbids. This holds in **every
19
+ mode** — standard *and* 24h. The mode moves the threshold, never the obligation.
20
+
21
+ **Read before you edit.** Read a file before your first `Edit` / `Write` / `MultiEdit` on
22
+ it — the normal way to work here — for every path outside `.peaks/**` (source, tests, docs,
23
+ config); `.peaks/**` writes are exempt.
24
+
25
+ **Expect one denial per file regardless.** A `PreToolUse` gate (ECC's "Fact-Forcing Gate")
26
+ denies the FIRST edit a session makes to any given path, once, by design. Reading does NOT
27
+ prevent it — the gate keys on the path's first touch, not on whether you read it. **A denial
28
+ is not a failure and the tool is not broken — your edit was NOT applied.** State the facts it
29
+ asks for (importers, affected API, data schemas if any, the user's verbatim instruction) and
30
+ retry the SAME operation; the retry is allowed. Do not switch tools, do not give up, do not
31
+ retry blindly.
32
+ <!-- /peaks:loop-hygiene -->
33
+
6
34
  # Peaks-Loop Code Test (wrapper)
7
35
 
8
36
  Peaks-Loop Code 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-code orchestration. Just `pnpm vitest run` and a compact summary.