peaks-loop 4.1.23 → 4.1.25

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 (66) hide show
  1. package/.claude-plugin/marketplace.json +12 -2
  2. package/CHANGELOG.md +188 -0
  3. package/dist/cli/commands/code-auto-compact-command.js +19 -1
  4. package/dist/cli/commands/code-gate-step-08-command.js +103 -105
  5. package/dist/cli/commands/code-gate-step-08-remedy.d.ts +10 -2
  6. package/dist/cli/commands/code-gate-step-08-remedy.js +11 -3
  7. package/dist/cli/commands/gate-commands-enforce.d.ts +14 -8
  8. package/dist/cli/commands/gate-commands-enforce.js +31 -24
  9. package/dist/cli/commands/observability-commands-session-row.d.ts +48 -0
  10. package/dist/cli/commands/observability-commands-session-row.js +201 -0
  11. package/dist/cli/commands/observability-commands.js +2 -0
  12. package/dist/services/artifacts/prerequisite-path-census.d.ts +8 -3
  13. package/dist/services/artifacts/prerequisite-path-census.js +30 -9
  14. package/dist/services/artifacts/prerequisite-path-resolver.js +32 -2
  15. package/dist/services/hooks/output.d.ts +35 -1
  16. package/dist/services/hooks/output.js +39 -1
  17. package/dist/services/observability/aggregation.js +2 -1
  18. package/dist/services/observability/hotspot-shared.d.ts +7 -12
  19. package/dist/services/observability/hotspot-shared.js +18 -13
  20. package/dist/services/observability/near-miss-difference.js +4 -1
  21. package/dist/services/observability/near-miss.js +9 -2
  22. package/dist/services/observability/owner-skill-map.js +23 -3
  23. package/dist/services/observability/repair-cycle-metric.js +6 -3
  24. package/dist/services/skills/presence-role.js +9 -2
  25. package/dist/services/standards/loop-engineering-readiness-lint.d.ts +15 -1
  26. package/dist/services/standards/loop-engineering-readiness-lint.js +27 -9
  27. package/dist/shared/incrementing-number.d.ts +57 -0
  28. package/dist/shared/incrementing-number.js +13 -0
  29. package/dist/skills/peaks-maker/index.js +43 -30
  30. package/output-styles/peaks-skill-swarm.md +2 -2
  31. package/package.json +7 -6
  32. package/scripts/install-skills-bundles.mjs +6 -1
  33. package/scripts/install-skills.mjs +10 -1
  34. package/skills/bee/peaks-perf-audit/SKILL.md +1 -1
  35. package/skills/bee/peaks-prd/SKILL.md +1 -1
  36. package/skills/bee/peaks-qa/SKILL.md +1 -1
  37. package/skills/bee/peaks-rd/SKILL.md +1 -1
  38. package/skills/bee/peaks-reviewer/SKILL.md +1 -1
  39. package/skills/bee/peaks-sc/SKILL.md +1 -1
  40. package/skills/bee/peaks-security-audit/SKILL.md +1 -1
  41. package/skills/bee/peaks-txt/SKILL.md +1 -1
  42. package/skills/bee/peaks-ui/SKILL.md +1 -1
  43. package/skills/peaks-audit/SKILL.md +1 -1
  44. package/skills/peaks-code/SKILL.md +1 -1
  45. package/skills/peaks-content/SKILL.md +1 -1
  46. package/skills/peaks-doctor/SKILL.md +1 -1
  47. package/skills/peaks-final-review/SKILL.md +1 -1
  48. package/skills/peaks-ide/SKILL.md +1 -1
  49. package/skills/peaks-issue-fix-orchestrator/SKILL.md +1 -1
  50. package/skills/peaks-maker/SKILL.md +125 -0
  51. package/skills/peaks-mut/SKILL.md +297 -0
  52. package/skills/peaks-race-code/SKILL.md +1 -1
  53. package/skills/peaks-resume/SKILL.md +1 -1
  54. package/skills/peaks-slice-decompose/SKILL.md +1 -1
  55. package/skills/peaks-solo/SKILL.md +1 -1
  56. package/skills/peaks-sop/SKILL.md +1 -1
  57. package/skills/peaks-status/SKILL.md +1 -1
  58. package/skills/peaks-test/SKILL.md +1 -1
  59. package/skills/bee/peaks-prd/test-prompts.json +0 -12
  60. package/skills/bee/peaks-qa/test-prompts.json +0 -12
  61. package/skills/bee/peaks-rd/test-prompts.json +0 -12
  62. package/skills/bee/peaks-txt/test-prompts.json +0 -12
  63. package/skills/bee/peaks-ui/test-prompts.json +0 -12
  64. package/skills/peaks-code/test-prompts.json +0 -12
  65. package/skills/peaks-doctor/test_prompts.json +0 -17
  66. package/skills/peaks-sop/test-prompts.json +0 -17
@@ -12,7 +12,7 @@ metadata:
12
12
  - schema: .peaks/project-scan/audit-output-schema.md
13
13
  ---
14
14
 
15
- <!-- peaks:loop-hygiene — HAND-MAINTAINED block, NOT generated; byte-identical in every SKILL.md, enforced by tests/unit/skills/loop-hygiene-block.test.ts. Edit one, edit all 23. -->
15
+ <!-- peaks:loop-hygiene — HAND-MAINTAINED block, NOT generated; byte-identical in every SKILL.md, enforced by tests/unit/skills/loop-hygiene-block.test.ts. Edit one, edit all 25. -->
16
16
 
17
17
  ## Loop hygiene (every turn — MANDATORY)
18
18
 
@@ -8,7 +8,7 @@ description: |
8
8
  visibility: internal
9
9
  ---
10
10
 
11
- <!-- peaks:loop-hygiene — HAND-MAINTAINED block, NOT generated; byte-identical in every SKILL.md, enforced by tests/unit/skills/loop-hygiene-block.test.ts. Edit one, edit all 23. -->
11
+ <!-- peaks:loop-hygiene — HAND-MAINTAINED block, NOT generated; byte-identical in every SKILL.md, enforced by tests/unit/skills/loop-hygiene-block.test.ts. Edit one, edit all 25. -->
12
12
 
13
13
  ## Loop hygiene (every turn — MANDATORY)
14
14
 
@@ -8,7 +8,7 @@ description: |
8
8
  visibility: internal
9
9
  ---
10
10
 
11
- <!-- peaks:loop-hygiene — HAND-MAINTAINED block, NOT generated; byte-identical in every SKILL.md, enforced by tests/unit/skills/loop-hygiene-block.test.ts. Edit one, edit all 23. -->
11
+ <!-- peaks:loop-hygiene — HAND-MAINTAINED block, NOT generated; byte-identical in every SKILL.md, enforced by tests/unit/skills/loop-hygiene-block.test.ts. Edit one, edit all 25. -->
12
12
 
13
13
  ## Loop hygiene (every turn — MANDATORY)
14
14
 
@@ -3,7 +3,7 @@ name: peaks-audit
3
3
  description: Gate autonomous LLM work on a 6-dimension audit + user-accepted goal. Use IMMEDIATELY after a need is expressed, BEFORE any PRD/RD/QA work starts.
4
4
  ---
5
5
 
6
- <!-- peaks:loop-hygiene — HAND-MAINTAINED block, NOT generated; byte-identical in every SKILL.md, enforced by tests/unit/skills/loop-hygiene-block.test.ts. Edit one, edit all 23. -->
6
+ <!-- peaks:loop-hygiene — HAND-MAINTAINED block, NOT generated; byte-identical in every SKILL.md, enforced by tests/unit/skills/loop-hygiene-block.test.ts. Edit one, edit all 25. -->
7
7
 
8
8
  ## Loop hygiene (every turn — MANDATORY)
9
9
 
@@ -3,7 +3,7 @@ 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 — HAND-MAINTAINED block, NOT generated; byte-identical in every SKILL.md, enforced by tests/unit/skills/loop-hygiene-block.test.ts. Edit one, edit all 23. -->
6
+ <!-- peaks:loop-hygiene — HAND-MAINTAINED block, NOT generated; byte-identical in every SKILL.md, enforced by tests/unit/skills/loop-hygiene-block.test.ts. Edit one, edit all 25. -->
7
7
 
8
8
  ## Loop hygiene (every turn — MANDATORY)
9
9
 
@@ -3,7 +3,7 @@ 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 — HAND-MAINTAINED block, NOT generated; byte-identical in every SKILL.md, enforced by tests/unit/skills/loop-hygiene-block.test.ts. Edit one, edit all 23. -->
6
+ <!-- peaks:loop-hygiene — HAND-MAINTAINED block, NOT generated; byte-identical in every SKILL.md, enforced by tests/unit/skills/loop-hygiene-block.test.ts. Edit one, edit all 25. -->
7
7
 
8
8
  ## Loop hygiene (every turn — MANDATORY)
9
9
 
@@ -4,7 +4,7 @@ description: Orchestrate peaks-loop's L3 doctor (peaks audit + peaks doctor + pe
4
4
  visibility: internal
5
5
  ---
6
6
 
7
- <!-- peaks:loop-hygiene — HAND-MAINTAINED block, NOT generated; byte-identical in every SKILL.md, enforced by tests/unit/skills/loop-hygiene-block.test.ts. Edit one, edit all 23. -->
7
+ <!-- peaks:loop-hygiene — HAND-MAINTAINED block, NOT generated; byte-identical in every SKILL.md, enforced by tests/unit/skills/loop-hygiene-block.test.ts. Edit one, edit all 25. -->
8
8
 
9
9
  ## Loop hygiene (every turn — MANDATORY)
10
10
 
@@ -3,7 +3,7 @@ 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 — HAND-MAINTAINED block, NOT generated; byte-identical in every SKILL.md, enforced by tests/unit/skills/loop-hygiene-block.test.ts. Edit one, edit all 23. -->
6
+ <!-- peaks:loop-hygiene — HAND-MAINTAINED block, NOT generated; byte-identical in every SKILL.md, enforced by tests/unit/skills/loop-hygiene-block.test.ts. Edit one, edit all 25. -->
7
7
 
8
8
  ## Loop hygiene (every turn — MANDATORY)
9
9
 
@@ -4,7 +4,7 @@ description: Orchestrate peaks-loop's IDE-aware behavior (hooks + statusline + h
4
4
  visibility: internal
5
5
  ---
6
6
 
7
- <!-- peaks:loop-hygiene — HAND-MAINTAINED block, NOT generated; byte-identical in every SKILL.md, enforced by tests/unit/skills/loop-hygiene-block.test.ts. Edit one, edit all 23. -->
7
+ <!-- peaks:loop-hygiene — HAND-MAINTAINED block, NOT generated; byte-identical in every SKILL.md, enforced by tests/unit/skills/loop-hygiene-block.test.ts. Edit one, edit all 25. -->
8
8
 
9
9
  ## Loop hygiene (every turn — MANDATORY)
10
10
 
@@ -3,7 +3,7 @@ name: peaks-issue-fix-orchestrator
3
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 — HAND-MAINTAINED block, NOT generated; byte-identical in every SKILL.md, enforced by tests/unit/skills/loop-hygiene-block.test.ts. Edit one, edit all 23. -->
6
+ <!-- peaks:loop-hygiene — HAND-MAINTAINED block, NOT generated; byte-identical in every SKILL.md, enforced by tests/unit/skills/loop-hygiene-block.test.ts. Edit one, edit all 25. -->
7
7
 
8
8
  ## Loop hygiene (every turn — MANDATORY)
9
9
 
@@ -0,0 +1,125 @@
1
+ ---
2
+ name: peaks-maker
3
+ description: |
4
+ Sediment and SkillHub author. Use when the user describes — in natural language — intent to (a) capture a workflow as a reusable skill, (b) refine or clone an existing bee, (c) export / import a skill bundle, (d) retain a release for the local SkillHub, or (e) dispose a previous release. Intent-based, never keyword-based: "调一下", "改改", "下次复用" all map to the same concrete `peaks skill sediment …` verb. User never types CLI; peaks-maker runs it on the user's behalf.
5
+ ---
6
+
7
+ <!-- peaks:loop-hygiene — HAND-MAINTAINED block, NOT generated; byte-identical in every SKILL.md, enforced by tests/unit/skills/loop-hygiene-block.test.ts. Edit one, edit all 25. -->
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 Role: <role> | Peaks-Loop Gate: <gate> | Peaks-Loop Context: <ratio%> (<zone>) | Next: <one short action>`.
13
+ Every turn, not only the first — it is how the user knows which skill is driving.
14
+ `Role` and `Context` are machine facts: copy them from `peaks skill presence --json`
15
+ (`data.role`, `data.context.ratioPct`, `data.context.action`) — never invent them.
16
+
17
+ **Context is this skill's own business.** Run `peaks skill presence --json` every turn and
18
+ read its `context` block. When `action` is `auto-fire`, `pre-compact`, or `red-line`,
19
+ run `peaks code auto-compact --project .` **yourself**, then continue. Tell the user the
20
+ ratio in one line if it helps, but never hand them the compaction step: asking the user to
21
+ run `/compact` is the regression the zero-pause contract forbids. This holds in **every
22
+ mode** — standard *and* 24h. The mode moves the threshold, never the obligation.
23
+
24
+ **Read before you edit.** Read a file before your first `Edit` / `Write` / `MultiEdit` on
25
+ it — the normal way to work here — for every path outside `.peaks/**` (source, tests, docs,
26
+ config); `.peaks/**` writes are exempt.
27
+
28
+ **Expect one denial per file anyway — and do NOT pre-empt it.** A `PreToolUse` gate (ECC's
29
+ "Fact-Forcing Gate") denies the FIRST edit a session makes to any given path, once, by
30
+ design. Reading does NOT prevent it: the gate keys on the path's first touch, not on whether
31
+ you read it. **Do not recite its four questions before every edit** — it asks when it wants
32
+ them, and reciting unprompted burns a round-trip per file for nothing. Answer only when a
33
+ denial actually arrives.
34
+
35
+ **When one does arrive:** a denial is not a failure and the tool is not broken — your edit
36
+ was NOT applied. State the facts it asks for (importers, affected API, data schemas if any,
37
+ the user's verbatim instruction), then retry the SAME operation. The retry is allowed. Do not
38
+ switch tools, do not give up, do not retry blindly. One more thing worth knowing: an idle gap
39
+ of ~30 minutes clears the gate's "already passed" list, so a file you cleared earlier can be
40
+ denied again after a long pause. That is the gate resetting, not you regressing.
41
+ <!-- /peaks:loop-hygiene -->
42
+
43
+ # Peaks-Maker
44
+
45
+ peaks-maker is the user-facing skill that turns natural-language intent into `peaks skill sediment …` CLI calls. It is always-loaded. It is the only entry that writes the pool and the local SkillHub.
46
+
47
+ ## What peaks-maker does
48
+
49
+ 1. Reads the user's intent (NL — never a CLI verb list).
50
+ 2. Disambiguates only when genuinely ambiguous (via `AskUserQuestion` multi-choice).
51
+ 3. Runs the right `peaks skill sediment …` subcommand on the user's behalf.
52
+ 4. Reports back in NL.
53
+
54
+ ## What peaks-maker must NOT do
55
+
56
+ - Never require the user to type a CLI verb, JSON, or path.
57
+ - Never bypass `AskUserQuestion` for genuine ambiguity.
58
+ - Never write to `.system/` (the soft-protection guard refuses).
59
+ - Never run `sqlite3` directly against `~/.peaks/skills/state.db` — only via the `peaks skill sediment …` surface.
60
+ - Never auto-promote. Always ask the user in NL.
61
+ - Never invent a CLI verb. The fixed set is `add-segment`, `add-bee`, `refine-bee`, `clone-bee`, `promote`, `retire`, `dispose`, `releases`, `release-show`, `release-diff`, `export`, `import`, `gc-blobs`, `list`, `show`, `search`, `recent`, `rebuild-index`. The blessed 18 are defined in `src/services/standards/loop-engineering-readiness-lint.ts`. Adding/removing verbs requires updating that allowlist and the CLI surface together.
62
+
63
+ ## Loop Engineering role
64
+
65
+ peaks-loop's first-class product is the user's **Loop Engineering** —
66
+ the user's reusable method systems, not the user's ad-hoc workflows.
67
+ peaks-maker participates in Loop Engineering as three coordinated
68
+ roles, replacing the older "bee sediment gatekeeper" framing
69
+ (spec §7.5 / §10 RL-8):
70
+
71
+ 1. **Loop crystallizer.** Reads a completed run's evidence (brief,
72
+ trace pointers, evaluator verdicts) and drives the user through a
73
+ single `AskUserQuestion` choice among
74
+ `create_new_loop | update_existing_loop | trace_only`. The LLM
75
+ then invokes `peaks asset crystallize` on the user's behalf. The
76
+ crystallization prompt is gated to completed-task evidence only
77
+ (RL-2 — Post-run crystallization).
78
+ 2. **Bee creator.** Writes the executable body that runs the loop
79
+ (main bee + supporting bees) using `peaks skill sediment add-bee`
80
+ and `peaks skill sediment refine-bee`. Bees are created or
81
+ updated only in the same transaction as their owning loop
82
+ (RL-3 — Loop + Bee dual-asset).
83
+ 3. **Evolution gatekeeper.** Honors the Darwin-style ratchet
84
+ (RL-4 / RL-5 / RL-6) when the user wants to evolve a loop or
85
+ bee: enforces a single editable asset, a single optimization
86
+ dimension, an independent-context evaluator (≠ author), and a
87
+ regression skeptic. Promotion requires the user to confirm in
88
+ natural language; LLM runs `peaks evolution propose / evaluate /
89
+ mark-keep / revert` on the user's behalf.
90
+
91
+ ### Reference
92
+
93
+ - The shared karpathy-engineered red lines that govern every
94
+ Loop-Engineering-participating peaks-* skill live at
95
+ `.peaks/standards/loop-engineering-guidelines.md`. peaks-maker
96
+ imports that file (not a copy) and is bound by RL-0..RL-9.
97
+ - The post-run crystallization prompt is surfaced by
98
+ `peaks asset crystallize` (M5 umbrella verb; spec §7.4).
99
+ - The Darwin-style ratchet is enforced by
100
+ `peaks evolution propose / evaluate / mark-keep / revert`
101
+ (M4 ratchet CLI surface; spec §6).
102
+
103
+ ### Readiness gate
104
+
105
+ Any new peaks-* skill that participates in Loop Engineering must
106
+ pass the readiness lint:
107
+
108
+ ```text
109
+ peaks skill lint --category loop-engineering-readiness --path <skill-dir>
110
+ ```
111
+
112
+ The lint asserts three things (see
113
+ `src/services/standards/loop-engineering-readiness-lint.ts`):
114
+
115
+ 1. the SKILL.md references
116
+ `.peaks/standards/loop-engineering-guidelines.md`;
117
+ 2. the SKILL.md does not introduce a CLI verb the user is meant to
118
+ type (only LLM-coordinated verbs from the sediment / asset /
119
+ evolution surface are allowed; RL-1);
120
+ 3. the SKILL.md does not introduce a JSON / manifest
121
+ hand-authoring surface (RL-1).
122
+
123
+ peaks-maker itself passes this lint today; the linter is what stops
124
+ a future peaks-* skill from regressing the two-forms-only / NL-only
125
+ rule at the textual layer.
@@ -0,0 +1,297 @@
1
+ ---
2
+ name: peaks-mut
3
+ description: Mutation testing + assertion validity scan for Peaks. Use when a workflow needs to catch test fake-green (coverage looks fine but tests do not actually exercise behavior). Runs Stryker mutants and a 5-pattern weak-assertion AST scan, then emits a hashable MUT.sig report that chains to TACT.sig.
4
+ ---
5
+
6
+ <!-- peaks:loop-hygiene — HAND-MAINTAINED block, NOT generated; byte-identical in every SKILL.md, enforced by tests/unit/skills/loop-hygiene-block.test.ts. Edit one, edit all 25. -->
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 Role: <role> | Peaks-Loop Gate: <gate> | Peaks-Loop Context: <ratio%> (<zone>) | Next: <one short action>`.
12
+ Every turn, not only the first — it is how the user knows which skill is driving.
13
+ `Role` and `Context` are machine facts: copy them from `peaks skill presence --json`
14
+ (`data.role`, `data.context.ratioPct`, `data.context.action`) — never invent them.
15
+
16
+ **Context is this skill's own business.** Run `peaks skill presence --json` every turn and
17
+ read its `context` block. When `action` is `auto-fire`, `pre-compact`, or `red-line`,
18
+ run `peaks code auto-compact --project .` **yourself**, then continue. Tell the user the
19
+ ratio in one line if it helps, but never hand them the compaction step: asking the user to
20
+ run `/compact` is the regression the zero-pause contract forbids. This holds in **every
21
+ mode** — standard *and* 24h. The mode moves the threshold, never the obligation.
22
+
23
+ **Read before you edit.** Read a file before your first `Edit` / `Write` / `MultiEdit` on
24
+ it — the normal way to work here — for every path outside `.peaks/**` (source, tests, docs,
25
+ config); `.peaks/**` writes are exempt.
26
+
27
+ **Expect one denial per file anyway — and do NOT pre-empt it.** A `PreToolUse` gate (ECC's
28
+ "Fact-Forcing Gate") denies the FIRST edit a session makes to any given path, once, by
29
+ design. Reading does NOT prevent it: the gate keys on the path's first touch, not on whether
30
+ you read it. **Do not recite its four questions before every edit** — it asks when it wants
31
+ them, and reciting unprompted burns a round-trip per file for nothing. Answer only when a
32
+ denial actually arrives.
33
+
34
+ **When one does arrive:** a denial is not a failure and the tool is not broken — your edit
35
+ was NOT applied. State the facts it asks for (importers, affected API, data schemas if any,
36
+ the user's verbatim instruction), then retry the SAME operation. The retry is allowed. Do not
37
+ switch tools, do not give up, do not retry blindly. One more thing worth knowing: an idle gap
38
+ of ~30 minutes clears the gate's "already passed" list, so a file you cleared earlier can be
39
+ denied again after a long pause. That is the gate resetting, not you regressing.
40
+ <!-- /peaks:loop-hygiene -->
41
+
42
+ ## Single-axis naming convention
43
+
44
+ > **Read once at the top of this file; the rest of the skill is written against it.**
45
+
46
+ The `.peaks/` workspace has a **single scope axis** — **session-id** (ephemeral state at `.peaks/_runtime/<sessionId>/...`) — with a nested **sub-agent axis** under `.peaks/_sub_agents/<sessionId>/...`. The peaks-loop change-id axis was removed in slice `2026-06-29-change-id-root-removal`: a date-stamped / change-id-style directory must never sit at the top level of `.peaks/` (it belongs under `.peaks/_runtime/<sessionId>/`), and `tests/unit/workspace/top-level-change-id-guard.test.ts` refuses one. Use `<sessionId>` for runtime paths (NEVER a bare `<sid>` path; the CLI's own help text spells the flag placeholder `<sid>`). CLI axis mapping: session-id → `peaks session *`; sub-agent → `peaks sub-agent *`; request-scoped artifacts → `peaks request *`. Normative by documentation only — the guard that once asserted (a) zero bare `<sid>`, (b) an axis label on every runtime path, and (c) this callout's presence was deleted in `457b9a87`. Comply by convention.
47
+
48
+ # Peaks-Loop Mut
49
+
50
+ Catches **test fake-green** — the failure mode where coverage numbers look fine but tests do not actually exercise behavior (PRD §1.1(二) / §4.2 验收审计 / §7 阶段二).
51
+
52
+ ## Skill presence (MANDATORY first action)
53
+
54
+ Before any analysis or tool call, immediately run:
55
+
56
+ ```bash
57
+ peaks skill presence:set peaks-mut --project <repo> --mode <mode> --gate startup
58
+ ```
59
+
60
+ **When invoked as a sub-agent (peaks-code swarm):** do NOT call `peaks skill presence:set` (Code owns the active-skill marker) and do NOT spawn your own session. Use the parent's sid — resolve it with `peaks session info --active` (the on-disk `.peaks/_runtime/session.json` path is internal and must NOT be read directly) or pass `--session-id <parent-sid>` to any session-creating CLI.
61
+
62
+ On the first presence:set in a project, ensure the out-of-band status bar is installed so the user can see at a glance that Peaks is orchestrating — it renders the active skill in Claude Code's terminal status line, independent of model output:
63
+
64
+ ```bash
65
+ peaks statusline install --project <repo> # idempotent; skips if already installed
66
+ ```
67
+
68
+ Read persistent project memory via CLI (durable, LLM-authored memories):
69
+
70
+ ```bash
71
+ peaks project memories --project <repo> --json
72
+ ```
73
+
74
+ This returns durable memories from `.peaks/memory` — decisions, conventions, modules, and rules captured in past sessions. Filter with `--kind <project|decision|convention|rule|reference|feedback|module|lesson|bug|investigation|technical-pattern|project-rule|design|handoff|session-handoff|project-todo|publish-closure|project-closure|slice-closure|slice-pilot-findings|sediment>`. (`.peaks/PROJECT.md` is a human-readable session timeline only.)
75
+ Then display: `Peaks-Loop Skill: peaks-mut | Peaks-Loop Role: <role> | Peaks-Loop Gate: startup | Peaks-Loop Context: <ratio%> (<zone>) | Next: <one short action>`. Update with `peaks skill presence:set peaks-mut --project <repo> --mode <mode> --gate <gate>` when gates change. When the role's work ends, run `peaks skill presence:clear --project <repo>`.
76
+
77
+ ## What peaks-mut actually does
78
+
79
+ Two independent signals feed a single report:
80
+
81
+ 1. **Mutation testing** — Stryker mutates source code under test. Existing tests must KILL each mutant. A low kill rate means tests accept behaviour changes that should fail them. Default tool: `stryker`. Schema reserves `mutmut` and `go-mutesting` for future slices.
82
+ 2. **Weak-assertion scan** — regex/AST scan over test files for 5 patterns that do not pin a value: `toBeDefined`, `toBeTruthy`, `toEqual-self`, `expect-anything`, `toBe-self`. Each hit is a `WeakExample` (file + line + code).
83
+
84
+ Both signals are combined into `MutReportJson` (version `1.0`) with MUT.sig = `sha256` of canonicalised content, chained to the upstream TACT.sig via the `inputSig` field. H6 (CLI裁决, not LLM): `thresholds.passed` and `followups[]` are computed by the CLI; the LLM only consumes them.
85
+
86
+ ## When to use
87
+
88
+ peaks-code or peaks-rd dispatches peaks-mut after peaks-rd/战术 (TACT.sig exists). The flow:
89
+
90
+ 1. peaks-mut takes the test files and the sources under test as explicit inputs (`--test-files`, `--mutate`); there is no `--audience` view to consume.
91
+ 2. Stryker mutates test-target source code; existing tests must kill the mutants.
92
+ 3. AssertScanner finds 5 weak-assertion patterns: `toBeDefined`, `toBeTruthy`, `toEqual-self`, `expect-anything`, `toBe-self`.
93
+ 4. Outputs `mut-report.json` with `MUT.sig` chained to `TACT.sig` (inputSig field).
94
+ 5. peaks-qa reads the mut report during validation — `peaks verdict aggregate` reads `mut/mut-report.json`, and the contract treats its absence as a warning rather than a gate failure.
95
+
96
+ ## Thresholds (default)
97
+
98
+ | Metric | Default | Severity of the emitted followup | Override |
99
+ | ---------------------- | ------- | ----------------------------------------------------------- | -------- |
100
+ | `mutationKillRateMin` | `0.80` | `soft` — the followup carries `issue: low_kill_rate` | none |
101
+ | `weakAssertionRateMax` | `0.05` | `hard` — the followup carries `issue: high_weak_assertions` | none |
102
+
103
+ A breach sets `thresholds.passed = false`. There is **no** override channel: `buildMutReport` takes the thresholds as an input, falls back to `DEFAULT_THRESHOLDS`, and the CLI never overrides them — so the two defaults above are the only numbers that can apply. `passed` is the sole gate for `process.exitCode` from `peaks mut run` (`1` when it is `false`).
104
+
105
+ ## CLI
106
+
107
+ ```
108
+ peaks mut run # full audit (Stryker + assertion scan + report)
109
+ peaks mut mutants # Stryker only; stub-assertions report
110
+ peaks mut asserts # AST scan only; empty-mutation report
111
+ peaks mut report # re-read a previously-written mut-report.json
112
+ ```
113
+
114
+ All artifact-producing subcommands require `--session-id <sid>` (one-axis envelope: the artifact is keyed by the session id). `--change-id` is **never** accepted on the `peaks mut` parser — plan 1 followup hotfix (commit `81f00ce`) forbids it.
115
+
116
+ | Subcommand | Flags | What it writes | Exit code |
117
+ | ---------- | ------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
118
+ | `run` | `--project <path> --test-files <files...> [--mutate <patterns...>] --input-sig <hex> --session-id <sid> --out <path> [--json]` | full `MutReportJson` (mutation + assertions + followups) | `1` if `thresholds.passed === false` |
119
+ | `mutants` | `--project <path> --test-files <files...> [--mutate <patterns...>] --input-sig <hex> --session-id <sid> --out <path> [--json]` | full `MutReportJson` with empty assertions | `1` if `thresholds.passed === false` |
120
+ | `asserts` | `--project <path> --test-files <files...> --input-sig <hex> --session-id <sid> --out <path> [--json]` | full `MutReportJson` with empty mutation | `1` if `thresholds.passed === false` |
121
+ | `report` | `--in <path> --session-id <sid> [--json]` | nothing on disk — re-emits a one-line summary | `1` if input report's `thresholds.passed === false`; `2` on invalid JSON or schema failure |
122
+
123
+ In the **Flags** column a bare flag is **required** and a flag in `[...]` is **optional**. `peaks mut asserts` has no `--mutate`: it never runs Stryker.
124
+
125
+ MEASURED: `peaks mut asserts` writes an **empty** mutation block, so its `mutation.killRate` is `0` — below `mutationKillRateMin` — and `thresholds.passed` is therefore always `false`, i.e. the exit code is `1` even when the assertion scan finds nothing weak. Read `assertions.weakRate` for the assertion verdict, not the exit code.
126
+
127
+ `--json` emits `{ ok, sha256, passed, path }` (run/mutants/asserts) or a structured summary object (report). Without `--json`, plain text is written to stdout. Failures from JSON parse / Zod validation go to stderr with `INVALID_JSON` / `INVALID` prefix.
128
+
129
+ ### Mutation scope and the Stryker configuration
130
+
131
+ `--mutate <patterns...>` is the **mutation scope**: source patterns, relative to `--project`. It is optional on the parser but required in practice — without it the runner falls back to a project-root `stryker.conf.js`, and with neither the run is refused with the named code `MUT_MUTATE_PATTERN_REQUIRED`.
132
+
133
+ The Stryker configuration is **built programmatically** by the CLI (`peaks-loop-mut` → `buildStrykerOptions`): the test runner, the timing, the coverage mode and the mutation scope all come from the flags. A project-root `stryker.conf.js` is **optional** — a backwards-compatible fallback for projects that already ship one. When one exists, the CLI's own options win over it (Stryker deep-merges the CLI options over the config file).
134
+
135
+ Named error codes the mut family can emit:
136
+
137
+ | Code | Meaning |
138
+ | ----------------------------- | ----------------------------------------------------------------------------- |
139
+ | `MUT_MUTATE_PATTERN_REQUIRED` | no `--mutate` scope and no project-root `stryker.conf.js` to fall back to |
140
+ | `MUT_NO_MUTANTS` | the run produced 0 mutants — a configuration error, not a passing measurement |
141
+ | `MUT_TOOLCHAIN_UNAVAILABLE` | the `@stryker-mutator/vitest-runner` plugin could not be resolved |
142
+ | `MUT_FAILED` | the fallback for a failure that carries no named code of its own |
143
+
144
+ A failure envelope is written to stderr and the exit code is non-zero (`1`).
145
+
146
+ ### The two root scripts
147
+
148
+ The repository ships two ready-to-run scripts:
149
+
150
+ | Script | Command | Placeholders |
151
+ | --------------- | -------------------------------------------------------------- | ------------------------------------------------------- |
152
+ | `pnpm mut:run` | `peaks mut run` over the four `stryker.conf.js` mutate targets | `--input-sig` and `--session-id` are PLACEHOLDER values |
153
+ | `pnpm mut:scan` | `peaks mut asserts` — the assertion scan only, no Stryker | same |
154
+
155
+ The `--input-sig` PLACEHOLDER is 64 zeros — it is **not** a real TACT.sig. Take the real one from `peaks tact read --artifact .peaks/_runtime/<sessionId>/rd/impl.json --project <repo> --json | jq -r '.sha256'` and replace it, and replace the `--session-id` PLACEHOLDER with the session id you are working in. The reports land under `.peaks/_runtime/<sessionId>/mut/`, which is gitignored: a `mut-report.json` is session-scoped ephemeral state and must never be committed.
156
+
157
+ ## Report shape (link to types)
158
+
159
+ `MutReportJson` is the canonical artifact, validated by `MutReportSchema` (Zod). Source of truth: `packages/peaks-loop-mut/src/services/mut/types.ts`. Top-level fields:
160
+
161
+ ```ts
162
+ interface MutReportJson {
163
+ readonly version: '1.0';
164
+ readonly sha256: string; // MUT.sig — sha256 of canonicalised content
165
+ readonly generatedAt: string; // ISO 8601 — excluded from the sha256 digest
166
+ readonly inputSig: string; // TACT.sig (64-hex) — chain anchor
167
+ readonly mutation: MutationReport;
168
+ readonly assertions: AssertionsReport;
169
+ readonly thresholds: ThresholdsConfig; // includes `passed: boolean`
170
+ readonly followups: ReadonlyArray<Followup>;
171
+ }
172
+ ```
173
+
174
+ `MutationReport` carries `tool`, `mutantsTotal`, `mutantsKilled`, `mutantsSurvived`, `mutantsTimeout`, `killRate` (0..1), and `byFile[]` with per-file kill rate + `survived[]` of `{ line, mutation, survivedBecause }`. `AssertionsReport` carries `totalAssertions`, `weakAssertions`, `weakRate` (0..1), and `weakPatterns[]` of `{ pattern, count, examples[] }` (examples are capped at file+line+code per WeakPatternSchema). `Followup` has `{ file, issue, severity, suggestion }` where `issue ∈ {low_kill_rate, high_weak_assertions}` and `severity ∈ {soft, hard}`.
175
+
176
+ The MUT.sig digest is **deterministic**: object keys are sorted recursively, `generatedAt` and `sha256` are excluded before hashing, so re-running peaks-mut on unchanged inputs always produces the same sig (good for `peaks-qa` regression detection).
177
+
178
+ ## One-axis envelope invariant
179
+
180
+ peaks-mut writes the report to the path given by `--out` (the CLI creates the parent directory; it does **not** enforce a `.peaks/_runtime/<sessionId>/` prefix — put the report there yourself). It never reads from `.peaks/_sub_agents/...`, and it never accepts `--change-id`. This invariant matches peaks-qa / peaks-context and keeps the chain MUT.sig → TACT.sig → PRD sig auditable in one place.
181
+
182
+ ## Independent context (防合谋)
183
+
184
+ peaks-mut's inputs are the test files and the sources under test — the CLI takes them as `--test-files` and `--mutate` and reads nothing else (PRD §4.2 防合谋). The strategy / implementation artifacts (`strategy.md`, `impl.json`) are not part of any mut input, so peaks-mut cannot be biased by peaks-rd's design intent when judging test quality. peaks-qa applies the same isolation when it consumes MUT.sig.
185
+
186
+ ## Karpathy guidelines
187
+
188
+ All 4 guidelines injected (same as peaks-rd). The two relevant ones here:
189
+
190
+ - **Truthfulness about completion** — peaks-mut MUST NOT report `thresholds.passed = true` if the assertion scan was skipped (e.g. `peaks mut mutants` was run instead of `peaks mut run`). The CLI sets the value from real measurements; the LLM only reads it.
191
+ - **No silent swallowing** — peaks-mut MUST NOT silently swallow assertion violations. Every `WeakExample` is preserved in the report (capped per pattern), every `Followup.suggestion` is concrete, and the CLI exit code reflects `thresholds.passed`.
192
+
193
+ ## Default runbook
194
+
195
+ ```bash
196
+ # 0. Confirm mut's own runbook integrity
197
+ peaks skill runbook peaks-mut --json
198
+ peaks skill presence:set peaks-mut --project <repo> # show persistent skill presence every turn
199
+
200
+ # 1. Produce the upstream chain (STRAT.sig → TACT.sig) if it does not exist yet.
201
+ # Both write commands are one-axis: --session-id is required and every
202
+ # --out must live under .peaks/_runtime/<sid>/.
203
+ peaks strat write \
204
+ --project <repo> \
205
+ --session-id <sid> \
206
+ --out .peaks/_runtime/<sid>/rd/strategy.md \
207
+ --goal <text> \
208
+ --root-cause <text> \
209
+ --impact <paths...> \
210
+ --design <text> \
211
+ --json
212
+ # Writes strategy.md (ending with `STRAT.sig: <64-hex>`) plus its JSON
213
+ # sibling .peaks/_runtime/<sid>/rd/strategy.md.json.
214
+
215
+ peaks tact write \
216
+ --project <repo> \
217
+ --session-id <sid> \
218
+ --strategy .peaks/_runtime/<sid>/rd/strategy.md.json \
219
+ --out .peaks/_runtime/<sid>/rd/impl.json \
220
+ --changed-files <paths...> \
221
+ --json
222
+ # Verifies the strategy JSON's recomputed sha256, runs the AST gate, then
223
+ # writes impl.json with inputSig = STRAT.sig. An AST violation refuses and
224
+ # writes nothing. `--ast-context '<json>'` supplies { deps, docSummaries };
225
+ # omitted means the documented empty context (no API-name violations).
226
+
227
+ # 2. Get the upstream TACT.sig (the chain anchor for MUT.sig)
228
+ peaks tact read --artifact .peaks/_runtime/<sid>/rd/impl.json --project <repo> --json | jq -r '.sha256'
229
+
230
+ # 3. Inventory the test files. There is NO CLI command that lists them
231
+ # (`peaks context` has only layer / status / check, and no --audience
232
+ # option), and `--test-files` takes explicit paths relative to --project.
233
+ # List the test files that import the sources under test.
234
+
235
+ # 4. Run the full audit
236
+ peaks mut run \
237
+ --project <repo> \
238
+ --test-files <files...> \
239
+ --mutate <patterns...> \
240
+ --input-sig <tact.sig> \
241
+ --session-id <sid> \
242
+ --out .peaks/_runtime/<sid>/mut/mut-report.json \
243
+ --json
244
+
245
+ # 5. Inspect the report (optional, for human readers)
246
+ peaks mut report \
247
+ --in .peaks/_runtime/<sid>/mut/mut-report.json \
248
+ --session-id <sid>
249
+
250
+ # 6. Sub-runs when the slice is small or partial (e.g. CI)
251
+ peaks mut mutants --project <repo> --test-files <files...> --mutate <patterns...> --input-sig <tact.sig> --session-id <sid> --out <path> --json
252
+ peaks mut asserts --project <repo> --test-files <files...> --input-sig <tact.sig> --session-id <sid> --out <path> --json
253
+
254
+ # 7. Clean up
255
+ peaks skill presence:clear --project <repo>
256
+ ```
257
+
258
+ ### Transition verification gates (MANDATORY — run the command, see the output)
259
+
260
+ You cannot declare peaks-mut complete from memory. Each gate below is a command you **MUST run** and whose output you **MUST see** before proceeding.
261
+
262
+ **Peaks-Loop Gate A — After `peaks mut run`:**
263
+
264
+ ```bash
265
+ ls .peaks/_runtime/<session-id>/mut/mut-report.json
266
+ # Expected: a single mut-report.json file. Missing → STOP, the CLI failed.
267
+ ```
268
+
269
+ **Peaks-Loop Gate B — Before handing off to peaks-qa (MUT.sig chain is valid):**
270
+
271
+ ```bash
272
+ # The report's inputSig MUST equal the upstream TACT.sig.
273
+ jq -r '.inputSig' .peaks/_runtime/<session-id>/mut/mut-report.json
274
+ # Expected: a 64-char lowercase hex string matching peaks tact read's sha256.
275
+ # Mismatch → STOP, the chain is broken — re-run peaks mut run with the right --input-sig.
276
+
277
+ # The report's own sha256 MUST be a 64-char lowercase hex.
278
+ jq -r '.sha256' .peaks/_runtime/<session-id>/mut/mut-report.json
279
+ # Expected: 64-char hex. Mismatch → STOP, the CLI wrote garbage.
280
+ ```
281
+
282
+ **Peaks-Loop Gate C — Threshold verdict (when a human or CI checks `passed`):**
283
+
284
+ ```bash
285
+ jq -r '.thresholds.passed' .peaks/_runtime/<session-id>/mut/mut-report.json
286
+ # Expected: `true` (pass) or `false` (fail). When false, the CLI exited with code 1.
287
+ ```
288
+
289
+ ## Boundaries
290
+
291
+ - Do not write tests, do not modify source under test, do not pick mutation strategies. peaks-mut only **measures** the test suite and **reports** the verdict.
292
+ - Do not commit mut-report.json to source control; it is session-scoped ephemeral state.
293
+ - Do not bypass thresholds via the LLM: if `peaks mut run` exits `1`, surface the failure to peaks-qa and the user — do not retry with a relaxed config unless they explicitly ask.
294
+ - Do not run Stryker outside `peaks mut run | mutants`; the runner requires the injected `invokeStryker`, and the Stryker configuration is built programmatically from the flags. A project-root `stryker.conf.js` is an optional backwards-compatible fallback, not a requirement.
295
+ - Do not call `peaks mut report` against a report whose `inputSig` does not match the current TACT.sig — that is a stale report, not authoritative.
296
+
297
+ Reference: `packages/peaks-loop-mut/src/services/mut/` for the service-layer code (`types.ts`, `assert-scanner.ts`, `mut-runner.ts`, `thresholds.ts`, `report-builder.ts`, `stryker-options.ts`, `production-stryker.ts`).
@@ -3,7 +3,7 @@ name: peaks-race-code
3
3
  description: Fast lane for code work — this window edits source directly, with no sub-agents and no paperwork. Use it when a code task is small enough that opening a second context window is the whole cost, i.e. trivial and everyday small features and bug fixes whose diff you can hold in your head. Not for a task that touches one of the risk surfaces the fast-lane norm names (`../peaks-code/references/fast-lane-norm.md`), and not for work that needs a durable audit trail — those belong to peaks-code; read the norm before you decide. Triggers on "/peaks-race-code", "peaks race", "race this", "fast lane", "直接改,别走全流程".
4
4
  ---
5
5
 
6
- <!-- peaks:loop-hygiene — HAND-MAINTAINED block, NOT generated; byte-identical in every SKILL.md, enforced by tests/unit/skills/loop-hygiene-block.test.ts. Edit one, edit all 23. -->
6
+ <!-- peaks:loop-hygiene — HAND-MAINTAINED block, NOT generated; byte-identical in every SKILL.md, enforced by tests/unit/skills/loop-hygiene-block.test.ts. Edit one, edit all 25. -->
7
7
 
8
8
  ## Loop hygiene (every turn — MANDATORY)
9
9
 
@@ -3,7 +3,7 @@ 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 — HAND-MAINTAINED block, NOT generated; byte-identical in every SKILL.md, enforced by tests/unit/skills/loop-hygiene-block.test.ts. Edit one, edit all 23. -->
6
+ <!-- peaks:loop-hygiene — HAND-MAINTAINED block, NOT generated; byte-identical in every SKILL.md, enforced by tests/unit/skills/loop-hygiene-block.test.ts. Edit one, edit all 25. -->
7
7
 
8
8
  ## Loop hygiene (every turn — MANDATORY)
9
9
 
@@ -3,7 +3,7 @@ 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 — HAND-MAINTAINED block, NOT generated; byte-identical in every SKILL.md, enforced by tests/unit/skills/loop-hygiene-block.test.ts. Edit one, edit all 23. -->
6
+ <!-- peaks:loop-hygiene — HAND-MAINTAINED block, NOT generated; byte-identical in every SKILL.md, enforced by tests/unit/skills/loop-hygiene-block.test.ts. Edit one, edit all 25. -->
7
7
 
8
8
  ## Loop hygiene (every turn — MANDATORY)
9
9
 
@@ -14,7 +14,7 @@ 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 — HAND-MAINTAINED block, NOT generated; byte-identical in every SKILL.md, enforced by tests/unit/skills/loop-hygiene-block.test.ts. Edit one, edit all 23. -->
17
+ <!-- peaks:loop-hygiene — HAND-MAINTAINED block, NOT generated; byte-identical in every SKILL.md, enforced by tests/unit/skills/loop-hygiene-block.test.ts. Edit one, edit all 25. -->
18
18
 
19
19
  ## Loop hygiene (every turn — MANDATORY)
20
20
 
@@ -3,7 +3,7 @@ name: peaks-sop
3
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 — HAND-MAINTAINED block, NOT generated; byte-identical in every SKILL.md, enforced by tests/unit/skills/loop-hygiene-block.test.ts. Edit one, edit all 23. -->
6
+ <!-- peaks:loop-hygiene — HAND-MAINTAINED block, NOT generated; byte-identical in every SKILL.md, enforced by tests/unit/skills/loop-hygiene-block.test.ts. Edit one, edit all 25. -->
7
7
 
8
8
  ## Loop hygiene (every turn — MANDATORY)
9
9
 
@@ -3,7 +3,7 @@ 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 — HAND-MAINTAINED block, NOT generated; byte-identical in every SKILL.md, enforced by tests/unit/skills/loop-hygiene-block.test.ts. Edit one, edit all 23. -->
6
+ <!-- peaks:loop-hygiene — HAND-MAINTAINED block, NOT generated; byte-identical in every SKILL.md, enforced by tests/unit/skills/loop-hygiene-block.test.ts. Edit one, edit all 25. -->
7
7
 
8
8
  ## Loop hygiene (every turn — MANDATORY)
9
9
 
@@ -3,7 +3,7 @@ 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 — HAND-MAINTAINED block, NOT generated; byte-identical in every SKILL.md, enforced by tests/unit/skills/loop-hygiene-block.test.ts. Edit one, edit all 23. -->
6
+ <!-- peaks:loop-hygiene — HAND-MAINTAINED block, NOT generated; byte-identical in every SKILL.md, enforced by tests/unit/skills/loop-hygiene-block.test.ts. Edit one, edit all 25. -->
7
7
 
8
8
  ## Loop hygiene (every turn — MANDATORY)
9
9
 
@@ -1,12 +0,0 @@
1
- [
2
- {
3
- "id": 1,
4
- "prompt": "Feishu 文档 https://example.feishu.cn/wiki/PRODUCT_DOC_ID 是产品文档,需要登录。目标是 /Users/yuanyuan/Desktop/work/platform-rag-web 前端项目,请从文档提取可以交给 RD 实现、QA 复测的前端改动点。",
5
- "expected": "先校验文档 URL 使用 https 且属于批准的 Feishu/Lark tenant 域名,再使用 headed gstack/browse/dist/browse 打开有头浏览器访问,遇到登录时等待用户完成并回复确认后再继续;登录后只提取产品实现逻辑、页面/路由/组件/状态/API contract/mock 假设/验收标准/联调问题,输出 .peaks/_runtime/<session-id>/prd/ 下的脱敏实现型 PRD handoff;不得保留登录 URL、cookie、headers、tokens、storage state、browser traces、raw browser/network state 或 PII/SSO/MFA 截图/日志。"
6
- },
7
- {
8
- "id": 2,
9
- "prompt": "产品文档业务背景很多,但用户明确只要落实到前端开发和 QA 验收,不要长篇业务叙述。当前没有 swagger.json,需要先 mock。",
10
- "expected": "压缩业务背景,只输出待联调态 frontend delta、mock/API contract、后续 swagger 替换清单、QA 浏览器验收路径和阻塞问题。"
11
- }
12
- ]