peaks-loop 4.1.17 → 4.1.19
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 +2 -2
- package/CHANGELOG.md +269 -0
- package/README-en.md +6 -0
- package/README.md +5 -0
- package/contracts/test-style-contract.md +14 -5
- package/dist/cli/commands/audit-red-lines-runners.js +6 -1
- package/dist/cli/commands/best-practice-scan-collision.d.ts +42 -0
- package/dist/cli/commands/best-practice-scan-collision.js +115 -0
- package/dist/cli/commands/best-practice-scan-command.d.ts +5 -0
- package/dist/cli/commands/best-practice-scan-command.js +9 -18
- package/dist/cli/commands/best-practice-scan-helpers.d.ts +12 -6
- package/dist/cli/commands/best-practice-scan-helpers.js +37 -17
- package/dist/cli/commands/code-auto-compact-command.js +71 -40
- package/dist/cli/commands/code-auto-compact-deferral.d.ts +34 -0
- package/dist/cli/commands/code-auto-compact-deferral.js +59 -0
- package/dist/cli/commands/code-gate-command.d.ts +4 -4
- package/dist/cli/commands/code-gate-command.js +4 -4
- package/dist/cli/commands/core/skill-generated-config-notice.d.ts +5 -0
- package/dist/cli/commands/core/skill-generated-config-notice.js +42 -8
- package/dist/cli/commands/core/skill-presence-commands.js +42 -74
- package/dist/cli/commands/core/skill-presence-set-command.d.ts +11 -0
- package/dist/cli/commands/core/skill-presence-set-command.js +175 -0
- package/dist/cli/commands/core/skill-registry-commands.js +32 -0
- package/dist/cli/commands/core/skill-store-report.d.ts +8 -0
- package/dist/cli/commands/core/skill-store-report.js +79 -0
- package/dist/cli/commands/core/standards-init-command.js +44 -8
- package/dist/cli/commands/core/standards-migrate-command.js +5 -4
- package/dist/cli/commands/dispatch-dag-runners.d.ts +1 -0
- package/dist/cli/commands/dispatch-dag-runners.js +11 -1
- package/dist/cli/commands/dispatch-detached-branch.js +19 -1
- package/dist/cli/commands/dispatch-prompt-composition.js +7 -2
- package/dist/cli/commands/dispatch-scratch-path-block.d.ts +73 -0
- package/dist/cli/commands/dispatch-scratch-path-block.js +131 -0
- package/dist/cli/commands/hooks-commands.js +36 -7
- package/dist/cli/commands/hooks-uninstall-command.js +5 -5
- package/dist/cli/commands/mut-commands-helpers.d.ts +72 -5
- package/dist/cli/commands/mut-commands-helpers.js +197 -4
- package/dist/cli/commands/mut-commands.d.ts +9 -1
- package/dist/cli/commands/mut-commands.js +82 -154
- package/dist/cli/commands/preferences-commands.js +27 -2
- package/dist/cli/commands/scan-scope-helpers.js +2 -2
- package/dist/services/24h-mode/auto-engage.d.ts +11 -3
- package/dist/services/24h-mode/auto-engage.js +14 -6
- package/dist/services/artifacts/artifact-templates.js +10 -0
- package/dist/services/artifacts/backcompat-acceptance.d.ts +8 -1
- package/dist/services/artifacts/backcompat-acceptance.js +8 -7
- package/dist/services/artifacts/rd-transition-gates.d.ts +32 -5
- package/dist/services/artifacts/rd-transition-gates.js +96 -19
- package/dist/services/artifacts/request-artifact-service.js +6 -6
- package/dist/services/audit/enforcers/lint-output-style.js +14 -2
- package/dist/services/audit/enforcers/root-scratch-artifacts.d.ts +46 -0
- package/dist/services/audit/enforcers/root-scratch-artifacts.js +97 -0
- package/dist/services/audit/static-service.js +4 -4
- package/dist/services/code/auto-compact-history.d.ts +6 -1
- package/dist/services/code/auto-compact-history.js +6 -1
- package/dist/services/code/auto-compact-modes.d.ts +60 -14
- package/dist/services/code/auto-compact-modes.js +75 -20
- package/dist/services/code/auto-compact-orchestrator.js +7 -5
- package/dist/services/code/auto-compact-profile.d.ts +23 -0
- package/dist/services/code/auto-compact-profile.js +51 -0
- package/dist/services/code/auto-compact-run-types.d.ts +8 -4
- package/dist/services/compact-history/compact-history-service.d.ts +6 -1
- package/dist/services/compact-history/compact-history-service.js +5 -1
- package/dist/services/context/auto-compact-types.d.ts +7 -5
- package/dist/services/dispatch/dispatch-ledger-reader.d.ts +13 -0
- package/dist/services/dispatch/dispatch-ledger-reader.js +164 -0
- package/dist/services/doctor/doctor-service/checks/canonical-store-version.d.ts +57 -0
- package/dist/services/doctor/doctor-service/checks/canonical-store-version.js +190 -0
- package/dist/services/doctor/doctor-service/checks/l3-runtime-root-census.d.ts +37 -0
- package/dist/services/doctor/doctor-service/checks/l3-runtime-root-census.js +100 -0
- package/dist/services/doctor/doctor-service/checks/skill-reference-parity.d.ts +11 -3
- package/dist/services/doctor/doctor-service/checks/skill-reference-parity.js +48 -29
- package/dist/services/doctor/doctor-service/plugin-registry.js +4 -0
- package/dist/services/doctor/doctor-service/types.d.ts +12 -0
- package/dist/services/hooks/hook-payload-cwd.d.ts +11 -4
- package/dist/services/hooks/hook-payload-cwd.js +11 -4
- package/dist/services/hooks/pre-tool-code-gate.d.ts +4 -4
- package/dist/services/hooks/pre-tool-code-gate.js +4 -4
- package/dist/services/hooks/presence-marker-detector.d.ts +3 -0
- package/dist/services/hooks/presence-marker-detector.js +21 -19
- package/dist/services/ide/adapters/claude-code-adapter.js +6 -8
- package/dist/services/ide/adapters/codex-adapter.js +23 -7
- package/dist/services/ide/adapters/cursor-adapter.js +23 -7
- package/dist/services/mode/mode-status-service.d.ts +26 -27
- package/dist/services/mode/mode-status-service.js +36 -60
- package/dist/services/preferences/preferences-types.d.ts +30 -0
- package/dist/services/preferences/preferences-types.js +13 -0
- package/dist/services/scan/acceptance-coverage-service.d.ts +14 -11
- package/dist/services/scan/acceptance-coverage-service.js +157 -52
- package/dist/services/scan/rid-change-claims.d.ts +15 -0
- package/dist/services/scan/rid-change-claims.js +116 -0
- package/dist/services/session/getSessionDir.d.ts +13 -0
- package/dist/services/session/getSessionDir.js +7 -1
- package/dist/services/skills/hooks-settings-types.d.ts +17 -21
- package/dist/services/skills/presence-caller-id.d.ts +51 -0
- package/dist/services/skills/presence-caller-id.js +43 -0
- package/dist/services/skills/presence-gate.d.ts +65 -0
- package/dist/services/skills/presence-gate.js +113 -0
- package/dist/services/skills/presence-lease-resolver.d.ts +63 -0
- package/dist/services/skills/presence-lease-resolver.js +114 -0
- package/dist/services/skills/presence-lease-selection.d.ts +91 -0
- package/dist/services/skills/presence-lease-selection.js +135 -0
- package/dist/services/skills/presence-lease-service.d.ts +3 -11
- package/dist/services/skills/presence-lease-service.js +34 -87
- package/dist/services/skills/presence-lease-store.d.ts +33 -0
- package/dist/services/skills/presence-lease-store.js +94 -0
- package/dist/services/skills/presence-lease-types.d.ts +31 -0
- package/dist/services/skills/presence-lease-types.js +27 -0
- package/dist/services/skills/presence-role.d.ts +35 -0
- package/dist/services/skills/presence-role.js +72 -0
- package/dist/services/skills/skill-presence-service.d.ts +39 -9
- package/dist/services/skills/skill-presence-service.js +143 -174
- package/dist/services/skills/skill-presence-write.d.ts +60 -0
- package/dist/services/skills/skill-presence-write.js +74 -0
- package/dist/services/skills/skill-statusline-service.js +7 -7
- package/dist/services/skills/sync-service-support.d.ts +27 -0
- package/dist/services/skills/sync-service.js +1 -0
- package/dist/services/standards/ide-aware-standards-service.d.ts +35 -23
- package/dist/services/standards/ide-aware-standards-service.js +45 -20
- package/dist/services/standards/migrate-claude-rules-service.d.ts +6 -0
- package/dist/services/standards/migrate-claude-rules-service.js +18 -0
- package/dist/services/standards/migrate-service.d.ts +1 -1
- package/dist/services/standards/migrate-service.js +27 -7
- package/dist/services/standards/project-scripts.d.ts +25 -0
- package/dist/services/standards/project-scripts.js +116 -0
- package/dist/services/standards/project-standards-service.d.ts +23 -15
- package/dist/services/standards/project-standards-service.js +176 -243
- package/dist/services/standards/standards-constitution.d.ts +89 -0
- package/dist/services/standards/standards-constitution.js +199 -0
- package/dist/services/standards/standards-files.d.ts +37 -0
- package/dist/services/standards/standards-files.js +138 -0
- package/dist/services/standards/standards-pointer.d.ts +73 -0
- package/dist/services/standards/standards-pointer.js +98 -0
- package/dist/services/standards/standards-render-agents.d.ts +34 -0
- package/dist/services/standards/standards-render-agents.js +149 -0
- package/dist/services/standards/standards-render-common.d.ts +38 -1
- package/dist/services/standards/standards-render-common.js +44 -7
- package/dist/services/standards/standards-render.d.ts +1 -3
- package/dist/services/standards/standards-render.js +6 -87
- package/dist/services/workflow/workflow-graph-ensure.d.ts +77 -0
- package/dist/services/workflow/workflow-graph-ensure.js +97 -0
- package/dist/services/workflow/workflow-inflight-probe.d.ts +68 -31
- package/dist/services/workflow/workflow-inflight-probe.js +163 -75
- package/dist/services/workflow/workflow-presence-lifecycle.js +21 -6
- package/dist/services/workspace/generated-artifacts-content.d.ts +46 -0
- package/dist/services/workspace/generated-artifacts-content.js +167 -0
- package/dist/services/workspace/generated-artifacts-stamp.d.ts +36 -13
- package/dist/services/workspace/generated-artifacts-stamp.js +37 -15
- package/dist/services/workspace/runtime-layout.d.ts +64 -0
- package/dist/services/workspace/runtime-layout.js +62 -0
- package/output-styles/peaks-skill-swarm.md +18 -2
- package/package.json +10 -9
- package/schemas/doctor-report.schema.json +1 -1
- package/scripts/canonical-store-fs.mjs +112 -0
- package/scripts/canonical-store-link.mjs +13 -22
- package/scripts/canonical-store-marker.mjs +241 -0
- package/scripts/canonical-store.mjs +119 -141
- package/scripts/install-skills-bundles.mjs +56 -13
- package/scripts/install-skills-fs.mjs +73 -0
- package/scripts/install-skills-output-styles.mjs +8 -2
- package/scripts/install-skills-report.mjs +19 -0
- package/scripts/install-skills.mjs +9 -0
- package/skills/bee/peaks-perf-audit/SKILL.md +3 -1
- package/skills/bee/peaks-prd/SKILL.md +5 -3
- package/skills/bee/peaks-qa/SKILL.md +4 -2
- package/skills/bee/peaks-qa/references/qa-skill-presence.md +1 -1
- package/skills/bee/peaks-qa/references/qa-standards-preflight.md +3 -1
- package/skills/bee/peaks-qa/references/qa-sub-agent-dispatch.md +2 -2
- package/skills/bee/peaks-rd/SKILL.md +4 -2
- package/skills/bee/peaks-rd/references/artifact-and-standards-output.md +1 -1
- package/skills/bee/peaks-rd/references/rd-runbook.md +11 -2
- package/skills/bee/peaks-rd/references/rd-standards-preflight.md +3 -1
- package/skills/bee/peaks-rd/references/rd-sub-agent-dispatch.md +24 -5
- package/skills/bee/peaks-rd/references/rd-transition-gates.md +49 -5
- package/skills/bee/peaks-rd/references/skill-presence-and-title.md +1 -1
- package/skills/bee/peaks-reviewer/SKILL.md +3 -1
- package/skills/bee/peaks-sc/SKILL.md +4 -2
- package/skills/bee/peaks-security-audit/SKILL.md +3 -1
- package/skills/bee/peaks-txt/SKILL.md +5 -3
- package/skills/bee/peaks-ui/SKILL.md +6 -4
- package/skills/peaks-audit/SKILL.md +3 -1
- package/skills/peaks-code/SKILL.md +4 -2
- package/skills/peaks-code/references/a2a-artifact-mapping.md +3 -3
- package/skills/peaks-code/references/completion-handoff.md +1 -1
- package/skills/peaks-code/references/local-artifact-workspace.md +10 -11
- package/skills/peaks-code/references/micro-cycle.md +2 -2
- package/skills/peaks-code/references/mode-selection-with-stale-presence.md +3 -3
- package/skills/peaks-code/references/runbook.md +4 -4
- package/skills/peaks-code/references/skill-presence-and-title.md +4 -2
- package/skills/peaks-code/references/standards-preflight.md +7 -6
- package/skills/peaks-code/references/sub-agent-dispatch.md +1 -1
- package/skills/peaks-code/references/swarm-dispatch-contract.md +5 -5
- package/skills/peaks-code/references/workflow-gates-and-types.md +37 -11
- package/skills/peaks-content/SKILL.md +3 -1
- package/skills/peaks-doctor/SKILL.md +3 -1
- package/skills/peaks-final-review/SKILL.md +3 -1
- package/skills/peaks-ide/SKILL.md +3 -1
- package/skills/peaks-issue-fix-orchestrator/SKILL.md +5 -3
- package/skills/peaks-race-code/SKILL.md +9 -4
- package/skills/peaks-resume/SKILL.md +3 -1
- package/skills/peaks-slice-decompose/SKILL.md +3 -1
- package/skills/peaks-solo/SKILL.md +3 -1
- package/skills/peaks-sop/SKILL.md +4 -2
- package/skills/peaks-status/SKILL.md +3 -1
- package/skills/peaks-test/SKILL.md +3 -1
|
@@ -13,8 +13,10 @@ visibility: internal
|
|
|
13
13
|
## Loop hygiene (every turn — MANDATORY)
|
|
14
14
|
|
|
15
15
|
**Skill header.** While this skill is active, open every turn with
|
|
16
|
-
`Peaks-Loop Skill: <skill> | Peaks-Loop Gate: <gate> | Next: <one short action>`.
|
|
16
|
+
`Peaks-Loop Skill: <skill> | Peaks-Loop Role: <role> | Peaks-Loop Gate: <gate> | Peaks-Loop Context: <ratio%> (<zone>) | Next: <one short action>`.
|
|
17
17
|
Every turn, not only the first — it is how the user knows which skill is driving.
|
|
18
|
+
`Role` and `Context` are machine facts: copy them from `peaks skill presence --json`
|
|
19
|
+
(`data.role`, `data.context.ratioPct`, `data.context.action`) — never invent them.
|
|
18
20
|
|
|
19
21
|
**Context is this skill's own business.** Run `peaks skill presence --json` every turn and
|
|
20
22
|
read its `context` block. When `action` is `auto-fire`, `pre-compact`, or `red-line`,
|
|
@@ -76,7 +78,7 @@ peaks project memories --project <repo> --json
|
|
|
76
78
|
```
|
|
77
79
|
|
|
78
80
|
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.)
|
|
79
|
-
Then display: `Peaks-Loop Skill: peaks-sc | Peaks-Loop Gate: startup | Next: <one short action>`. Update with `peaks skill presence:set peaks-sc --project <repo> --mode <mode> --gate <gate>` when gates change. When the role's work ends, run `peaks skill presence:clear --project <repo>`.
|
|
81
|
+
Then display: `Peaks-Loop Skill: peaks-sc | Peaks-Loop Role: <role> | Peaks-Loop Gate: startup | Peaks-Loop Context: <ratio%> (<zone>) | Next: <one short action>`. `Role` and `Context` are machine facts: copy them from `peaks skill presence --json` (`data.role`, `data.context.ratioPct`, `data.context.action`) — never invent them. Update with `peaks skill presence:set peaks-sc --project <repo> --mode <mode> --gate <gate>` when gates change. When the role's work ends, run `peaks skill presence:clear --project <repo>`.
|
|
80
82
|
|
|
81
83
|
## Responsibilities
|
|
82
84
|
|
|
@@ -17,8 +17,10 @@ metadata:
|
|
|
17
17
|
## Loop hygiene (every turn — MANDATORY)
|
|
18
18
|
|
|
19
19
|
**Skill header.** While this skill is active, open every turn with
|
|
20
|
-
`Peaks-Loop Skill: <skill> | Peaks-Loop Gate: <gate> | Next: <one short action>`.
|
|
20
|
+
`Peaks-Loop Skill: <skill> | Peaks-Loop Role: <role> | Peaks-Loop Gate: <gate> | Peaks-Loop Context: <ratio%> (<zone>) | Next: <one short action>`.
|
|
21
21
|
Every turn, not only the first — it is how the user knows which skill is driving.
|
|
22
|
+
`Role` and `Context` are machine facts: copy them from `peaks skill presence --json`
|
|
23
|
+
(`data.role`, `data.context.ratioPct`, `data.context.action`) — never invent them.
|
|
22
24
|
|
|
23
25
|
**Context is this skill's own business.** Run `peaks skill presence --json` every turn and
|
|
24
26
|
read its `context` block. When `action` is `auto-fire`, `pre-compact`, or `red-line`,
|
|
@@ -13,8 +13,10 @@ visibility: internal
|
|
|
13
13
|
## Loop hygiene (every turn — MANDATORY)
|
|
14
14
|
|
|
15
15
|
**Skill header.** While this skill is active, open every turn with
|
|
16
|
-
`Peaks-Loop Skill: <skill> | Peaks-Loop Gate: <gate> | Next: <one short action>`.
|
|
16
|
+
`Peaks-Loop Skill: <skill> | Peaks-Loop Role: <role> | Peaks-Loop Gate: <gate> | Peaks-Loop Context: <ratio%> (<zone>) | Next: <one short action>`.
|
|
17
17
|
Every turn, not only the first — it is how the user knows which skill is driving.
|
|
18
|
+
`Role` and `Context` are machine facts: copy them from `peaks skill presence --json`
|
|
19
|
+
(`data.role`, `data.context.ratioPct`, `data.context.action`) — never invent them.
|
|
18
20
|
|
|
19
21
|
**Context is this skill's own business.** Run `peaks skill presence --json` every turn and
|
|
20
22
|
read its `context` block. When `action` is `auto-fire`, `pre-compact`, or `red-line`,
|
|
@@ -55,7 +57,7 @@ Before any analysis or tool call, immediately run:
|
|
|
55
57
|
peaks skill presence:set peaks-txt --project <repo> --mode <mode> --gate startup
|
|
56
58
|
```
|
|
57
59
|
|
|
58
|
-
**When invoked as a sub-agent (peaks-code swarm):** do NOT call `peaks skill presence:set` (Code owns the
|
|
60
|
+
**When invoked as a sub-agent (peaks-code swarm):** do NOT call `peaks skill presence:set` (Code owns the presence lease) and do NOT spawn your own session. Use the parent's sid — read `.peaks/_runtime/session.json` or pass `--session-id <parent-sid>` to any session-creating CLI. The new `peaks session info --active` reads the canonical binding for you.
|
|
59
61
|
|
|
60
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:
|
|
61
63
|
|
|
@@ -70,7 +72,7 @@ peaks project memories --project <repo> --json
|
|
|
70
72
|
```
|
|
71
73
|
|
|
72
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.)
|
|
73
|
-
Then display: `Peaks-Loop Skill: peaks-txt | Peaks-Loop Gate: startup | Next: <one short action>`. Update with `peaks skill presence:set peaks-txt --project <repo> --mode <mode> --gate <gate>` when gates change. When the role's work ends, run `peaks skill presence:clear --project <repo>`.
|
|
75
|
+
Then display: `Peaks-Loop Skill: peaks-txt | Peaks-Loop Role: <role> | Peaks-Loop Gate: startup | Peaks-Loop Context: <ratio%> (<zone>) | Next: <one short action>`. `Role` and `Context` are machine facts: copy them from `peaks skill presence --json` (`data.role`, `data.context.ratioPct`, `data.context.action`) — never invent them. Update with `peaks skill presence:set peaks-txt --project <repo> --mode <mode> --gate <gate>` when gates change. When the role's work ends, run `peaks skill presence:clear --project <repo>`.
|
|
74
76
|
|
|
75
77
|
## Responsibilities
|
|
76
78
|
|
|
@@ -13,8 +13,10 @@ visibility: internal
|
|
|
13
13
|
## Loop hygiene (every turn — MANDATORY)
|
|
14
14
|
|
|
15
15
|
**Skill header.** While this skill is active, open every turn with
|
|
16
|
-
`Peaks-Loop Skill: <skill> | Peaks-Loop Gate: <gate> | Next: <one short action>`.
|
|
16
|
+
`Peaks-Loop Skill: <skill> | Peaks-Loop Role: <role> | Peaks-Loop Gate: <gate> | Peaks-Loop Context: <ratio%> (<zone>) | Next: <one short action>`.
|
|
17
17
|
Every turn, not only the first — it is how the user knows which skill is driving.
|
|
18
|
+
`Role` and `Context` are machine facts: copy them from `peaks skill presence --json`
|
|
19
|
+
(`data.role`, `data.context.ratioPct`, `data.context.action`) — never invent them.
|
|
18
20
|
|
|
19
21
|
**Context is this skill's own business.** Run `peaks skill presence --json` every turn and
|
|
20
22
|
read its `context` block. When `action` is `auto-fire`, `pre-compact`, or `red-line`,
|
|
@@ -71,7 +73,7 @@ UI inherits `peaks-qa`'s hard-block contract: `AskUserQuestion` with three optio
|
|
|
71
73
|
When this skill is launched as a sub-agent via `peaks sub-agent dispatch <role>` from `peaks-code`, these sections are **suspended** for the sub-agent run:
|
|
72
74
|
|
|
73
75
|
- **Session id** — use parent's sid (`.peaks/_runtime/session.json` or `--session-id <parent-sid>`). Do NOT spawn your own session; `peaks session info --active` reads the canonical binding.
|
|
74
|
-
- **Skill presence** — do NOT call `peaks skill presence:set peaks-ui`; Code owns `.peaks
|
|
76
|
+
- **Skill presence** — do NOT call `peaks skill presence:set peaks-ui`; Code owns the presence lease (`.peaks/_runtime/<session-id>/leases/presence-*.json`). Marker file at `.peaks/_runtime/<session-id>/system/sub-agent-ui.json` only.
|
|
75
77
|
- **Workspace initialization** — Code ran `peaks workspace init` before fan-out; do not re-run.
|
|
76
78
|
- **Mode selection** — Code chose the mode.
|
|
77
79
|
- **Statusline install** — done by Code at startup.
|
|
@@ -99,7 +101,7 @@ What the sub-agent **MUST** still do:
|
|
|
99
101
|
**Hard prohibitions** (sub-agent context):
|
|
100
102
|
|
|
101
103
|
- Do NOT call `Skill(skill="...")`.
|
|
102
|
-
- Do NOT call `peaks skill presence:set` — Code owns
|
|
104
|
+
- Do NOT call `peaks skill presence:set` — Code owns the presence lease.
|
|
103
105
|
- Do NOT modify application code. UI is design-direction only.
|
|
104
106
|
- Do NOT install MCP servers. If Playwright MCP is missing and headed browser is required, return `{"status":"blocked","blockedReason":"playwright-mcp-unavailable"}` for Code escalation. (peaks-loop no longer manages MCP install — user runs `claude mcp add playwright -- npx @playwright/mcp@latest` in Claude Code.)
|
|
105
107
|
- Do NOT commit, push, install hooks, or apply settings.json mutations.
|
|
@@ -122,7 +124,7 @@ peaks statusline install --project <repo> # idempotent; skips if already insta
|
|
|
122
124
|
```
|
|
123
125
|
|
|
124
126
|
Read durable project memory via `peaks project memories --project <repo> --json` (decisions / conventions / modules / rules). Filter with `--kind`. (`.peaks/PROJECT.md` is a human-readable timeline only.)
|
|
125
|
-
Then display: `Peaks-Loop Skill: peaks-ui | Peaks-Loop Gate: startup | Next: <one short action>`. Update with `peaks skill presence:set peaks-ui --project <repo> --mode <mode> --gate <gate>` when gates change. When the role's work ends, run `peaks skill presence:clear --project <repo>`.
|
|
127
|
+
Then display: `Peaks-Loop Skill: peaks-ui | Peaks-Loop Role: <role> | Peaks-Loop Gate: startup | Peaks-Loop Context: <ratio%> (<zone>) | Next: <one short action>`. `Role` and `Context` are machine facts: copy them from `peaks skill presence --json` (`data.role`, `data.context.ratioPct`, `data.context.action`) — never invent them. Update with `peaks skill presence:set peaks-ui --project <repo> --mode <mode> --gate <gate>` when gates change. When the role's work ends, run `peaks skill presence:clear --project <repo>`.
|
|
126
128
|
|
|
127
129
|
## Responsibilities
|
|
128
130
|
|
|
@@ -8,8 +8,10 @@ description: Gate autonomous LLM work on a 6-dimension audit + user-accepted goa
|
|
|
8
8
|
## Loop hygiene (every turn — MANDATORY)
|
|
9
9
|
|
|
10
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>`.
|
|
11
|
+
`Peaks-Loop Skill: <skill> | Peaks-Loop Role: <role> | Peaks-Loop Gate: <gate> | Peaks-Loop Context: <ratio%> (<zone>) | Next: <one short action>`.
|
|
12
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.
|
|
13
15
|
|
|
14
16
|
**Context is this skill's own business.** Run `peaks skill presence --json` every turn and
|
|
15
17
|
read its `context` block. When `action` is `auto-fire`, `pre-compact`, or `red-line`,
|
|
@@ -8,8 +8,10 @@ description: Code-domain loop engineering orchestrator for the Peaks-Loop skill
|
|
|
8
8
|
## Loop hygiene (every turn — MANDATORY)
|
|
9
9
|
|
|
10
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>`.
|
|
11
|
+
`Peaks-Loop Skill: <skill> | Peaks-Loop Role: <role> | Peaks-Loop Gate: <gate> | Peaks-Loop Context: <ratio%> (<zone>) | Next: <one short action>`.
|
|
12
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.
|
|
13
15
|
|
|
14
16
|
**Context is this skill's own business.** Run `peaks skill presence --json` every turn and
|
|
15
17
|
read its `context` block. When `action` is `auto-fire`, `pre-compact`, or `red-line`,
|
|
@@ -114,7 +116,7 @@ Two-layer enforcement — do NOT try to bypass either:
|
|
|
114
116
|
```
|
|
115
117
|
For source-code changes (mentioning `src/`, `tests/unit/`, `tests/integration/`, `config/`, `bin/`, `scripts/`) the probe MUST return `canDoInSession: false` with `blockers: ["requires-sub-agent-dispatch"]`. The probe does NOT block non-source slices (memory sediment, docs, SKILL.md updates).
|
|
116
118
|
|
|
117
|
-
2. **Tool-level guard — `
|
|
119
|
+
2. **Tool-level guard — `peaks code-gate`** (PreToolUse hook). When the orchestrator reaches for `Edit`/`Write`/`MultiEdit` against a hard-blocked path family, the hook exits 2 with stderr `PEAKS_CODE_PROHIBITED_DIRECT_EDIT: <file>... use 'peaks sub-agent dispatch rd'`. The hook is vendor-neutral — it inspects only the standard `{tool, input}` JSON contract, never env vars. **The rule lives in ONE implementation**: `src/services/hooks/pre-tool-code-gate.ts`, with the path arithmetic in `gate-path-normalize.ts` and the payload's own directory in `hook-payload-cwd.ts`. The shell sibling `src/services/hooks/pre-tool-code-gate.sh` is a **thin wrapper** that execs `peaks code-gate`; it carries a second copy of the rule **only** for a machine where no Node CLI is reachable, and that fallback **refuses rather than guessing** when it cannot place the file.
|
|
118
120
|
|
|
119
121
|
### If you catch yourself reaching for Edit/Write on `src/**`
|
|
120
122
|
|
|
@@ -18,10 +18,10 @@ The mapping below uses peaks's own paths verbatim. Each row also notes where pea
|
|
|
18
18
|
|
|
19
19
|
| A2A concept | peaks artefact | Path (under `.peaks/_runtime/<session-id>/`) | Notes |
|
|
20
20
|
|---|---|---|---|
|
|
21
|
-
| **AgentCard** (capability advertisement) | `peaks-skill-output-style` +
|
|
21
|
+
| **AgentCard** (capability advertisement) | `peaks-skill-output-style` + the presence lease | `.peaks/_runtime/<sid>/leases/presence-*.json`, `.peaks/_runtime/session.json` | peaks is a *local* tool, not a service. The "card" is the presence lease (read it with `peaks skill presence --json`) plus a peek at `.peaks/PROJECT.md` for human-readable history. There is no `/.well-known/agent-card.json` endpoint. |
|
|
22
22
|
| **Task** (stateful unit of work) | `peaks request` state machine for a single `<rid>` | `.peaks/_runtime/<sid>/{prd,rd,qa,ui,sc}/requests/<rid>.md` (the request artefact); `.peaks/_runtime/<sid>/<role>/session.json` (per-session metadata) | peaks's task lifecycle is `prd:confirmed-by-user → handed-off`, then per role `draft → spec-locked → implemented → qa-handoff`, then `qa:running → verdict-issued`. The full state graph is enforced by `peaks request transition`. A2A's Task object is JSON; peaks's task is **a set of files with a `state` field per role**. |
|
|
23
23
|
| **Artifact** (immutable output) | `rd/tech-doc.md`, `rd/code-review-<rid>.md`, `audit/security-<rid>.md`, `qa/test-cases/<rid>.md`, `qa/test-reports/<rid>.md`, `qa/security-findings.md`, `qa/performance-findings.md`, `sc/handoff.md` | as listed | peaks's artefacts are *append-once*, not strictly immutable: a `qa/test-reports/<rid>.md` may be re-emitted on repair cycles. The convention is "newest write wins; the file at the end of the workflow is the truth", which is close enough to A2A's immutable-Artifact semantics for translation purposes. |
|
|
24
|
-
| **Message** (non-artifact communication) | `peaks skill presence` heartbeat + transition `--reason` notes | `.peaks
|
|
24
|
+
| **Message** (non-artifact communication) | `peaks skill presence` heartbeat + transition `--reason` notes | the presence lease (`.peaks/_runtime/<sid>/leases/presence-*.json`, `lastHeartbeat`), transition notes in `.peaks/_runtime/<sid>/<role>/requests/<rid>.md` | peaks does **not** separate Messages from Artifacts at the storage layer; a "message" is anything that is not the artefact body (the `<!-- peaks-memory:start -->` markers, the `state` field, the `--reason` text on a transition). Treat these as inline metadata of the artefact, not as separate objects. |
|
|
25
25
|
| **Part** (atomic content unit) | Markdown sections within an artefact, frontmatter fields | inline within the artefact | peaks's Artifacts are single Markdown files, so the "Part" concept maps to a heading or a frontmatter field. A `Part`'s `kind` in A2A terms is `text` (the prose), `file` (a `<!-- peaks-memory:start -->` block as a structured chunk), or `data` (the frontmatter). A2A's `form` / `iframe` / video `Part` kinds are not produced by peaks. |
|
|
26
26
|
|
|
27
27
|
## 3. Field-level mapping (A2A Part ↔ peaks frontmatter)
|
|
@@ -96,7 +96,7 @@ A consumer wanting to render a single "feature" object in A2A terms picks the `t
|
|
|
96
96
|
|
|
97
97
|
To keep the mapping honest, peaks-loop **does not** currently provide the following A2A primitives, and consumers should not expect them:
|
|
98
98
|
|
|
99
|
-
- A2A **AgentCard** served over HTTP at `/.well-known/agent-card.json`. peaks-loop is a local CLI; its "card" is the
|
|
99
|
+
- A2A **AgentCard** served over HTTP at `/.well-known/agent-card.json`. peaks-loop is a local CLI; its "card" is the presence lease (`peaks skill presence --json`) plus `peaks skill doctor --json`.
|
|
100
100
|
- A2A **streaming** responses (SSE / WebSocket). peaks commands are synchronous and return a single JSON envelope.
|
|
101
101
|
- A2A **identity / auth** (OAuth, OIDC, mTLS). peaks assumes local-machine trust.
|
|
102
102
|
- A2A **cross-vendor discovery**. peaks has no A2A registry entry; MCP-compatible capabilities are discovered by the LLM via its own tool list (the LLM checks for `mcp__<server>__*` entries in its own function schema) and reported back to the user. Slice #016 retired the `peaks mcp *` indirection layer.
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
After final validation, refresh project-local standards via `peaks standards init/update` (never hand-write). Merge scan-backed changes incrementally; preserve hand-maintained content unless user confirms deletion.
|
|
6
6
|
|
|
7
|
-
Use Peaks-Loop TXT for the compact handoff capsule: mode, validated decisions, artifact paths, standards deltas (`CLAUDE.md` and `.claude/rules/**`
|
|
7
|
+
Use Peaks-Loop TXT for the compact handoff capsule: mode, validated decisions, artifact paths, standards deltas (the `AGENTS.md` body, the optional `CLAUDE.md` pointer, and the rules-tree file statuses under `.peaks/standards/**` or `.claude/rules/**`), open questions, next action. Do not restate the full workflow log.
|
|
8
8
|
|
|
9
9
|
## Workflow completion (no auto-exit)
|
|
10
10
|
|
|
@@ -17,24 +17,23 @@ peaks workspace init --project <repo> --json
|
|
|
17
17
|
The workspace initialization creates this structure under `.peaks/`:
|
|
18
18
|
|
|
19
19
|
```
|
|
20
|
-
# Canonical home for all per-project ephemeral state (
|
|
21
|
-
#
|
|
22
|
-
#
|
|
23
|
-
# `.peaks
|
|
24
|
-
#
|
|
25
|
-
#
|
|
26
|
-
# `
|
|
27
|
-
#
|
|
28
|
-
#
|
|
29
|
-
# other two) to discover session-id / active-skill / sop-state.
|
|
20
|
+
# Canonical home for all per-project ephemeral state (presence leases,
|
|
21
|
+
# session binding, sop-state). All writes go here; reads also tolerate
|
|
22
|
+
# the legacy paths (`.peaks/.session.json` — read-only back-compat for
|
|
23
|
+
# one minor release, `.peaks/sop-state/`) so a fresh upgrade does not
|
|
24
|
+
# break in-flight workflows. Older trees are auto-migrated by
|
|
25
|
+
# `peaks workspace reconcile --apply`. Skills and sub-agents MUST NOT
|
|
26
|
+
# `cat` any of these files directly — use `peaks session info --active
|
|
27
|
+
# --json` (and `peaks skill presence --json` for the presence lease) to
|
|
28
|
+
# discover session-id / presence / sop-state.
|
|
30
29
|
.peaks/_runtime/
|
|
31
|
-
├── active-skill.json # orchestrator presence marker (peaks-code / -rd / -qa / -ui / -sc / -sop / -txt)
|
|
32
30
|
├── session.json # project → session binding (the only single-session source of truth)
|
|
33
31
|
└── sop-state/ # current phase + history; definitions live globally in ~/.peaks
|
|
34
32
|
|
|
35
33
|
# Per-slice artifact dirs (auto-generated, one per session). Files
|
|
36
34
|
# inside ARE tracked by the 提交中间产物 convention.
|
|
37
35
|
.peaks/_runtime/<sessionId>/
|
|
36
|
+
leases/ # presence leases (presence-<callerId>-<workflowId>.json) — read with `peaks skill presence --json`
|
|
38
37
|
prd/source/ # PRD source documents (Feishu exports, pasted content)
|
|
39
38
|
prd/requests/ # PRD request artifacts (goals, non-goals, acceptance, frontend delta)
|
|
40
39
|
ui/requests/ # UI request artifacts (visual direction, taste reports)
|
|
@@ -196,13 +196,13 @@ After RD completes (whether inline or sub-agent), Code does not stop — it must
|
|
|
196
196
|
|
|
197
197
|
**RD's internal reviews are already parallelized.** When RD finishes implementation, it issues a 3-way sub-agent fan-out (code-review + security-review + perf-baseline, see `skills/bee/peaks-rd/SKILL.md` "Parallel review fan-out") and waits for all to return before transitioning to `qa-handoff`. Code does NOT need to track three separate RD-side sub-runs; the RD role owns the fan-out lifecycle end-to-end. Code's presence restoration after the swarm converges is the only coordination point.
|
|
198
198
|
|
|
199
|
-
**Presence restoration after RD/QA work returns (MANDATORY):** In v1.x, role skills called `peaks skill presence:set <role>` internally and stomped on
|
|
199
|
+
**Presence restoration after RD/QA work returns (MANDATORY):** In v1.x, role skills called `peaks skill presence:set <role>` internally and stomped on the main loop's presence lease. From v1.3 onward, sub-agents in the Swarm path are forbidden from calling `peaks skill presence:set` (see "Sub-agent dispatch" in each role's SKILL.md), so the main loop's presence lease is preserved across the fan-out window by construction. The one place Code still has to actively restore presence is **once after the fan-out returns** (gate=swarm-converged) and again **after each RD↔QA repair iteration** (gate=repair-cycle-<N>). Use the same command from Step 2 with the current mode and the gate that has just advanced:
|
|
200
200
|
|
|
201
201
|
```bash
|
|
202
202
|
peaks skill presence:set peaks-code --project <repo> --mode <mode> --gate <current-gate>
|
|
203
203
|
```
|
|
204
204
|
|
|
205
|
-
This keeps the CLAUDE.md status header accurate (`Peaks-Loop Skill: peaks-code
|
|
205
|
+
This keeps the CLAUDE.md status header accurate (`Peaks-Loop Skill: peaks-code | Peaks-Loop Role: <role> | Peaks-Loop Gate: <gate> | Peaks-Loop Context: <ratio%> (<zone>) | Next: <one short action>`) instead of showing a stale role name. `Role` and `Context` are machine facts: copy them from `peaks skill presence --json` (`data.role`, `data.context.ratioPct`, `data.context.action`) — never invent them. Use the current mode and gate values; the gate may have advanced since startup. Skipping this step causes the header to display the last-known gate permanently.
|
|
206
206
|
|
|
207
207
|
**Full-auto auto-proceed rule**: In the `full-auto` profile, when RD transitions to `qa-handoff`, Code immediately drives QA — by launching a `peaks sub-agent dispatch qa` sub-agent carrying the `peaks-qa` body (swarm path), then executing the returned toolCall, or by running QA inline in the main loop (assisted/strict path). Do not pause, do not ask the user, do not summarize RD results as if they were final. The only valid reason to skip QA is when `--type` is `docs` or `chore` (no acceptance surface).
|
|
208
208
|
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
Defect A (from PRD-002, 2026-06-28 session 88b27d):
|
|
10
10
|
|
|
11
11
|
1. session A runs in `full-auto` → `peaks skill presence:set peaks-code --mode full-auto --gate startup` stamps
|
|
12
|
-
`.peaks/_runtime/
|
|
12
|
+
the presence lease (`.peaks/_runtime/<sid>/leases/presence-*.json`) with `outerSessionId=outer-A`.
|
|
13
13
|
2. session A closes (Claude window quit).
|
|
14
14
|
3. session B opens (a new Claude window, `outerSessionId=outer-B`).
|
|
15
|
-
4. `peaks skill presence:get --project <path>` still returns `mode=full-auto` because the
|
|
15
|
+
4. `peaks skill presence:get --project <path>` still returns `mode=full-auto` because the lease is on disk.
|
|
16
16
|
5. peaks-code Step 1 reads the presence, sees `mode=full-auto`, **skips** AskUserQuestion.
|
|
17
17
|
6. The user never picked `full-auto` for THIS session — the mode was sticky from the previous one.
|
|
18
18
|
|
|
@@ -119,6 +119,6 @@ peaks skill presence:set peaks-code --mode full-auto --gate startup
|
|
|
119
119
|
|
|
120
120
|
## ACL — what NOT to do
|
|
121
121
|
|
|
122
|
-
- **NEVER** skip Step 1 just because
|
|
122
|
+
- **NEVER** skip Step 1 just because `peaks skill presence --json` shows a `mode` field. Run `presence:check-stale` first.
|
|
123
123
|
- **NEVER** call `peaks skill presence:clear` from peaks-code to "fix" a stale mode. The auto-clear path is `peaks workspace init`'s job; manual clears destroy user-explicit mode choices that may belong to another live outer session.
|
|
124
124
|
- **NEVER** set the presence `mode` field from inside a sub-agent (peaks-rd, peaks-qa, etc.). Sub-agents may read presence to honour the user's chosen mode but the write authority for Step 1 belongs to the peaks-code driver.
|
|
@@ -37,10 +37,10 @@ peaks scan existing-system --project <repo> --json
|
|
|
37
37
|
|
|
38
38
|
# 1. Peaks-Loop Standards preflight + apply
|
|
39
39
|
# Run dry-run first to inspect deltas, then APPLY. In full-auto and 24h modes,
|
|
40
|
-
# --apply is the default — Standards files (
|
|
41
|
-
#
|
|
42
|
-
#
|
|
43
|
-
# between dry-run and apply (AskUserQuestion → re-run with --confirm; no terminal prompt).
|
|
40
|
+
# --apply is the default — Standards files (AGENTS.md body, optional CLAUDE.md pointer,
|
|
41
|
+
# rules tree under .peaks/standards/** or .claude/rules/**) live INSIDE the target
|
|
42
|
+
# project and are required for downstream skill preflight, so producing them is part of
|
|
43
|
+
# completing the workflow. Assisted/Strict modes pause for [CONFIRM] between dry-run and apply (AskUserQuestion → re-run with --confirm; no terminal prompt).
|
|
44
44
|
peaks standards init --project <repo> --dry-run --json
|
|
45
45
|
# or: peaks standards update --project <repo> --dry-run --json
|
|
46
46
|
peaks standards init --project <repo> --apply --json
|
|
@@ -16,9 +16,11 @@ On the first presence:set in a project, ensure the out-of-band status bar is ins
|
|
|
16
16
|
peaks statusline install --project <repo> # idempotent; skips if already installed
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
Then display the compact status header: `Peaks-Loop Skill: peaks-code | Peaks-Loop Gate: startup | Next: <one short action>`. Display this header on EVERY turn while the skill is active.
|
|
19
|
+
Then display the compact status header: `Peaks-Loop Skill: peaks-code | Peaks-Loop Role: <role> | Peaks-Loop Gate: startup | Peaks-Loop Context: <ratio%> (<zone>) | Next: <one short action>`. `Role` and `Context` are machine facts: copy them from `peaks skill presence --json` (`data.role`, `data.context.ratioPct`, `data.context.action`) — never invent them. Display this header on EVERY turn while the skill is active.
|
|
20
20
|
|
|
21
|
-
Update with `peaks skill presence:set peaks-code --project <repo> --mode <mode> --gate <gate>` when gates change. The presence
|
|
21
|
+
Update with `peaks skill presence:set peaks-code --project <repo> --mode <mode> --gate <gate>` when gates change. The presence lease persists across the full workflow lifecycle — it lives at `.peaks/_runtime/<session-id>/leases/presence-*.json` (the canonical path; the project-level `active-skill.json` single-slot files were removed in 4.0.11) — clear is owned by workflow terminalize; follow-up workflows re-claim via new workflow init.
|
|
22
|
+
|
|
23
|
+
Read the live presence back with `peaks skill presence --json`. It reports the active skill, its mode and its gate, and it resolves the lease across the session trees of the project — when the bound tree holds no lease, another tree's live lease is reported instead. Add `--check-stale` to learn WHY nothing is active (`presenceInactive.reason`: `no-leases`, `all-terminal`, `all-stale`, `terminal-and-stale`).
|
|
22
24
|
|
|
23
25
|
## Step 2.5a — Set session title
|
|
24
26
|
|
|
@@ -5,18 +5,19 @@
|
|
|
5
5
|
- `peaks standards init --project <path> --dry-run`
|
|
6
6
|
- `peaks standards update --project <path> --dry-run`
|
|
7
7
|
|
|
8
|
-
Use `standards init` for first-time creation and `standards update` for existing `
|
|
8
|
+
Use `standards init` for first-time creation and `standards update` for the existing **body** file (`AGENTS.md`) append/review behavior. The bundle the CLI writes has three parts: the **body** `AGENTS.md` (always written), the **pointer** `CLAUDE.md` (written only when the IDE profile needs it — a profile that reads `AGENTS.md` directly, e.g. `--ide codex`, writes no pointer), and the **rules tree** under `.peaks/standards/**` (2.0 canonical layout) or `.claude/rules/**` (legacy 1.x project that still carries a thick `.claude/rules/` tree). In `full-auto` and `24h` profiles, `--apply` runs automatically after `--dry-run` succeeds — these files live inside the target project, are required for downstream skill preflight, and producing them is part of finishing the workflow (Peaks-Loop Gate G enforces this). `assisted` and `strict` profiles pause for explicit user confirmation between dry-run and apply.
|
|
9
9
|
|
|
10
|
-
**CRITICAL — Standards must reflect the project scan.** When generating or updating
|
|
10
|
+
**CRITICAL — Standards must reflect the project scan.** When generating or updating the standards bundle, the content must reference concrete findings from `.peaks/project-scan/project-scan.md`: the detected component library (e.g. "This project uses antd 5.x"), CSS solution (e.g. "Uses Less via Umi"), build tool, state management, and routing. Those findings belong in the rules-tree files under the project's rules root (`.peaks/standards/**` for the 2.0 layout, `.claude/rules/**` for a legacy 1.x project); the body file `AGENTS.md` carries the command list and points at those files, and `CLAUDE.md` is only the `@AGENTS.md` pointer. Never emit a generic template that says "read <rules-root>/..." without naming the actual project stack. If the project-scan has not been run yet, run it before standards init/update.
|
|
11
11
|
|
|
12
|
-
**Legacy projects additionally** — when archetype ∈ {legacy-frontend, legacy-fullstack, frontend-monorepo}, the
|
|
12
|
+
**Legacy projects additionally** — when archetype ∈ {legacy-frontend, legacy-fullstack, frontend-monorepo}, the standards content MUST extract concrete naming, directory, service-layer, and hooks conventions from `.peaks/_runtime/<sessionId>/system/existing-system.md` and record them as hard constraints for new code. It must also list the `## Legacy constraints` from `project-scan.md` (class components, moment, enzyme, etc.) and instruct that new code in the same module preserves those patterns unless PRD explicitly authorizes modernization. A standards bundle for a legacy project that contains only generic rule pointers without naming the actual conventions is a blocking violation — regenerate it.
|
|
13
13
|
|
|
14
14
|
Do not hand-write standards file mutations inside the skill.
|
|
15
15
|
|
|
16
|
-
For project-analysis requests such as "分析项目" / "分析下这个项目", Step 0 still applies: the workspace is initialized and `peaks-code` presence is set before any analysis output. These requests run the lightweight analysis branch (project scan + standards dry-run) rather than the full RD/QA pipeline, but they never skip workspace anchoring or exit the workflow. The handoff must include an explicit **Standards increment** section. Report the current
|
|
16
|
+
For project-analysis requests such as "分析项目" / "分析下这个项目", Step 0 still applies: the workspace is initialized and `peaks-code` presence is set before any analysis output. These requests run the lightweight analysis branch (project scan + standards dry-run) rather than the full RD/QA pipeline, but they never skip workspace anchoring or exit the workflow. The handoff must include an explicit **Standards increment** section. Report the current standards status from the dry-run output as incremental deltas, not just a generic preflight note:
|
|
17
17
|
|
|
18
|
-
-
|
|
19
|
-
-
|
|
18
|
+
- the body file (`AGENTS.md`): whether it is missing, existing, planned, skipped, appended, or review-only;
|
|
19
|
+
- the pointer file (`CLAUDE.md`), only when the IDE profile writes one — its absence is not a delta;
|
|
20
|
+
- which rules-tree files are planned, existing, or skipped, under whichever root the project uses (`.peaks/standards/**` for the 2.0 layout, `.claude/rules/**` for a legacy 1.x project) — the rules tree is presence-only in both commands; `appended` / `review` are body-file states;
|
|
20
21
|
- whether writes were applied or intentionally left as dry-run because authorization or scope was absent;
|
|
21
22
|
- the exact next action if standards should be applied later.
|
|
22
23
|
|
|
@@ -418,7 +418,7 @@ The role's required artefact paths (also see peaks-ui/rd/qa SKILL.md and `swarm-
|
|
|
418
418
|
**Hard prohibitions on sub-agents** (also passed in each dispatch prompt):
|
|
419
419
|
|
|
420
420
|
- Do NOT call `Skill(skill="...")` — sub-agents must not recursively activate skills, that defeats the fan-out.
|
|
421
|
-
- Do NOT call `peaks skill presence:set` — only the main Code loop owns
|
|
421
|
+
- Do NOT call `peaks skill presence:set` — only the main Code loop owns the presence lease. Sub-agents write to a per-agent marker file `.peaks/_runtime/<sessionId>/system/sub-agent-<role>.json` if they need to record state, but never the main presence lease.
|
|
422
422
|
- Do NOT open interactive user prompts. If a sub-agent needs clarification, it must return a `blocked` verdict in its return string and let Code handle the user message.
|
|
423
423
|
- Do NOT commit, push, install hooks, or apply settings.json mutations. Only Code holds those permissions.
|
|
424
424
|
- **Reinforced (2026-06-28 incident):** an RD sub-agent silently auto-committed its own diff during a fix-callerid-leak dispatch (commit `bff4dff`). The orchestrator caught the unauthorized commit on the next turn but the user had to manually re-approve. **Every dispatch prompt MUST copy the verbatim block below into its `--prompt` argument** so the sub-agent sees the rule with full weight:
|
|
@@ -37,7 +37,7 @@ Return a compact JSON envelope — do not write prose.
|
|
|
37
37
|
|
|
38
38
|
## Hard prohibitions
|
|
39
39
|
- Do NOT call Skill(skill="..."). You are the role.
|
|
40
|
-
- Do NOT call `peaks skill presence:set` — the main loop owns .
|
|
40
|
+
- Do NOT call `peaks skill presence:set` — the main loop owns the presence lease.
|
|
41
41
|
If you need to record state, write to .peaks/_runtime/<session-id>/system/sub-agent-<role>.json.
|
|
42
42
|
- Do NOT commit, push, install hooks, or apply settings.json mutations.
|
|
43
43
|
- Do NOT ask the user interactive questions. If you need clarification, return
|
|
@@ -45,7 +45,7 @@ Return a compact JSON envelope — do not write prose.
|
|
|
45
45
|
|
|
46
46
|
## Runtime arguments (provided by Code)
|
|
47
47
|
- project: <repo> (git repo root, NOT a sub-package)
|
|
48
|
-
- session-id: <sid> (from
|
|
48
|
+
- session-id: <sid> (from `peaks session info --active --json`; the on-disk binding is .peaks/_runtime/session.json)
|
|
49
49
|
- request-id: <rid> (PRD id)
|
|
50
50
|
- type: <type> (feature | bugfix | refactor | config | docs | chore)
|
|
51
51
|
- mode: <mode> (full-auto | assisted | strict | 24h)
|
|
@@ -182,9 +182,9 @@ After all sub-agent dispatch calls return and the LLM has invoked the toolCalls,
|
|
|
182
182
|
|
|
183
183
|
## 5. Presence restoration (single-shot)
|
|
184
184
|
|
|
185
|
-
Sub-agents are explicitly forbidden from calling `peaks skill presence:set`. That means
|
|
185
|
+
Sub-agents are explicitly forbidden from calling `peaks skill presence:set`. That means the presence lease does not move during the fan-out. Code sets it to `gate=swarm-fan-out` before fan-out and to `gate=swarm-converged` once after all Tasks return. The status header (the `Peaks-Loop Skill: peaks-code | Peaks-Loop Role: <role> | Peaks-Loop Gate: <gate> | Peaks-Loop Context: <ratio%> (<zone>) | Next: <one short action>` line) therefore reads consistently across the fan-out window. `Role` and `Context` are machine facts: copy them from `peaks skill presence --json` (`data.role`, `data.context.ratioPct`, `data.context.action`) — never invent them.
|
|
186
186
|
|
|
187
|
-
If a sub-agent is misbehaving and writes
|
|
187
|
+
If a sub-agent is misbehaving and writes its own presence lease anyway, the next Code presence-set (after fan-out) overwrites it — the bug self-heals on the next gate advance, but the swarm-phase display may be off. The hard prohibition is there to prevent this; Code should still treat the lease as a single-writer resource.
|
|
188
188
|
|
|
189
189
|
## 6. Why not a `peaks-swarm` skill?
|
|
190
190
|
|
|
@@ -237,7 +237,7 @@ Sub-agent presence in this list = Code launched a Task for it. Absence = the rol
|
|
|
237
237
|
| `assisted` | `AskUserQuestion` with three options: (a) Full — UI + RD(planning) + QA(test-cases); (b) Backend-only — RD(planning) + QA(test-cases); (c) Sequential — run RD first, then QA, skip UI | Use the user's choice as the plan |
|
|
238
238
|
| `strict` | Same as `assisted` (the question is informational; strict still enforces confirmation gates later) | Same as `assisted` |
|
|
239
239
|
|
|
240
|
-
In all modes, **the plan must be written to `sc/swarm-plan.json` before any Task call.** Code updates
|
|
240
|
+
In all modes, **the plan must be written to `sc/swarm-plan.json` before any Task call.** Code updates the presence lease to `gate=swarm-fan-out` at this point.
|
|
241
241
|
|
|
242
242
|
### Degradation when swarm roles fail or are absent
|
|
243
243
|
|
|
@@ -148,7 +148,7 @@ ls .peaks/_runtime/<sessionId>/qa/requests/<rid>.md
|
|
|
148
148
|
find .peaks/_runtime/<sessionId>/ -type f | sort
|
|
149
149
|
# Verify: files from gates A-D all appear in this list.
|
|
150
150
|
# Any mandatory file missing → NOT complete. Do not emit TXT.
|
|
151
|
-
# Peaks-Loop Gate G (
|
|
151
|
+
# Peaks-Loop Gate G (standards bundle — AGENTS.md body + rules tree) must ALSO pass before TXT is emitted.
|
|
152
152
|
```
|
|
153
153
|
|
|
154
154
|
**Peaks-Loop Gate F — Root pollution check (BLOCKING before completion):**
|
|
@@ -170,18 +170,44 @@ find . -maxdepth 1 -name "*.png" -o -name "*.jpg" -o -name "qa-*.js" -o -name "m
|
|
|
170
170
|
|
|
171
171
|
**Peaks-Loop Gate G — Project standards present (BLOCKING before workflow completion):**
|
|
172
172
|
```bash
|
|
173
|
-
# After `peaks standards init/update --apply`, verify the files actually landed
|
|
174
|
-
#
|
|
175
|
-
|
|
176
|
-
#
|
|
177
|
-
|
|
173
|
+
# After `peaks standards init/update --apply`, verify the files actually landed.
|
|
174
|
+
# The file set is decided by the CLI — never hard-code a rules path here:
|
|
175
|
+
peaks standards init --project <repo> --dry-run --json
|
|
176
|
+
# → data.plannedWrites[] = [{ relativePath, status }, ...]
|
|
177
|
+
# init reports TWO states: planned (absent → will be created) | existing (present on
|
|
178
|
+
# disk — init does not compare content, so a stale file still reads 'existing').
|
|
179
|
+
# The four-state view of the body file comes from
|
|
180
|
+
# `peaks standards update --project <repo> --dry-run --json`:
|
|
181
|
+
# planned | appended (managed block missing) | existing
|
|
182
|
+
# (managed block matches) | review (managed block differs → a human decides; that
|
|
183
|
+
# command exits 1 with code STANDARDS_UPDATE_REVIEW_REQUIRED). The four states cover
|
|
184
|
+
# AGENTS.md and, when the IDE profile writes one, CLAUDE.md; rules-tree files are
|
|
185
|
+
# planned | existing in both commands.
|
|
186
|
+
# → data.skippedFiles[] = the entries already present on disk
|
|
187
|
+
#
|
|
188
|
+
# The bundle has three parts, and only the first has a fixed name:
|
|
189
|
+
# BODY = AGENTS.md — always written, in every layout.
|
|
190
|
+
# POINTER = CLAUDE.md — written ONLY when the IDE profile needs it; a profile that reads
|
|
191
|
+
# AGENTS.md directly (e.g. `--ide codex`) writes no pointer at all, so its ABSENCE
|
|
192
|
+
# from plannedWrites is NOT a failure and must not be reported as BLOCKED.
|
|
193
|
+
# RULES = the rules tree under .peaks/standards/** (2.0 canonical layout) or
|
|
194
|
+
# .claude/rules/** (legacy 1.x project still carrying a thick .claude/rules/ tree).
|
|
195
|
+
# The relativePaths in plannedWrites tell you which one this project uses.
|
|
196
|
+
#
|
|
197
|
+
# Verify the body landed:
|
|
198
|
+
ls <repo>/AGENTS.md
|
|
178
199
|
# "No such file" → BLOCKED. Run `peaks standards init --project <repo> --apply --json`
|
|
179
200
|
# (first time) or `peaks standards update --project <repo> --apply --json` (existing).
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
#
|
|
184
|
-
#
|
|
201
|
+
#
|
|
202
|
+
# Judge the result from the JSON, not from a hard-coded path list:
|
|
203
|
+
# BLOCKED when plannedWrites is empty, or when any entry has status 'planned'
|
|
204
|
+
# (that required standards file is absent).
|
|
205
|
+
# PASS otherwise. `init` never reports 'appended' / 'review' — when the update
|
|
206
|
+
# dry-run does, report each one as a follow-up:
|
|
207
|
+
# 'appended' → `peaks standards update --project <repo> --apply` adds the managed block;
|
|
208
|
+
# 'review' → the managed block differs; a human decides (see `peaks standards update`).
|
|
209
|
+
#
|
|
210
|
+
# Any 'planned' entry → BLOCKED. Re-run standards init/update with --apply and re-verify.
|
|
185
211
|
# Skipping Peaks-Loop Gate G (e.g. because the user did not explicitly authorize writes) is
|
|
186
212
|
# only acceptable in `assisted`/`strict` modes where the user actively declined; in
|
|
187
213
|
# `full-auto`/`24h` the absence of these files is a workflow violation.
|
|
@@ -8,8 +8,10 @@ description: Non-code orchestrator for content workflows (draft / edit / publish
|
|
|
8
8
|
## Loop hygiene (every turn — MANDATORY)
|
|
9
9
|
|
|
10
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>`.
|
|
11
|
+
`Peaks-Loop Skill: <skill> | Peaks-Loop Role: <role> | Peaks-Loop Gate: <gate> | Peaks-Loop Context: <ratio%> (<zone>) | Next: <one short action>`.
|
|
12
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.
|
|
13
15
|
|
|
14
16
|
**Context is this skill's own business.** Run `peaks skill presence --json` every turn and
|
|
15
17
|
read its `context` block. When `action` is `auto-fire`, `pre-compact`, or `red-line`,
|
|
@@ -9,8 +9,10 @@ visibility: internal
|
|
|
9
9
|
## Loop hygiene (every turn — MANDATORY)
|
|
10
10
|
|
|
11
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>`.
|
|
12
|
+
`Peaks-Loop Skill: <skill> | Peaks-Loop Role: <role> | Peaks-Loop Gate: <gate> | Peaks-Loop Context: <ratio%> (<zone>) | Next: <one short action>`.
|
|
13
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.
|
|
14
16
|
|
|
15
17
|
**Context is this skill's own business.** Run `peaks skill presence --json` every turn and
|
|
16
18
|
read its `context` block. When `action` is `auto-fire`, `pre-compact`, or `red-line`,
|
|
@@ -8,8 +8,10 @@ description: Final-review skill for Peaks. Use when a workflow needs to assemble
|
|
|
8
8
|
## Loop hygiene (every turn — MANDATORY)
|
|
9
9
|
|
|
10
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>`.
|
|
11
|
+
`Peaks-Loop Skill: <skill> | Peaks-Loop Role: <role> | Peaks-Loop Gate: <gate> | Peaks-Loop Context: <ratio%> (<zone>) | Next: <one short action>`.
|
|
12
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.
|
|
13
15
|
|
|
14
16
|
**Context is this skill's own business.** Run `peaks skill presence --json` every turn and
|
|
15
17
|
read its `context` block. When `action` is `auto-fire`, `pre-compact`, or `red-line`,
|
|
@@ -9,8 +9,10 @@ visibility: internal
|
|
|
9
9
|
## Loop hygiene (every turn — MANDATORY)
|
|
10
10
|
|
|
11
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>`.
|
|
12
|
+
`Peaks-Loop Skill: <skill> | Peaks-Loop Role: <role> | Peaks-Loop Gate: <gate> | Peaks-Loop Context: <ratio%> (<zone>) | Next: <one short action>`.
|
|
13
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.
|
|
14
16
|
|
|
15
17
|
**Context is this skill's own business.** Run `peaks skill presence --json` every turn and
|
|
16
18
|
read its `context` block. When `action` is `auto-fire`, `pre-compact`, or `red-line`,
|
|
@@ -8,8 +8,10 @@ description: 'End-to-end orchestrator that surveys open issues in a target repo,
|
|
|
8
8
|
## Loop hygiene (every turn — MANDATORY)
|
|
9
9
|
|
|
10
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>`.
|
|
11
|
+
`Peaks-Loop Skill: <skill> | Peaks-Loop Role: <role> | Peaks-Loop Gate: <gate> | Peaks-Loop Context: <ratio%> (<zone>) | Next: <one short action>`.
|
|
12
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.
|
|
13
15
|
|
|
14
16
|
**Context is this skill's own business.** Run `peaks skill presence --json` every turn and
|
|
15
17
|
read its `context` block. When `action` is `auto-fire`, `pre-compact`, or `red-line`,
|
|
@@ -131,7 +133,7 @@ Closes #<NNNNN>
|
|
|
131
133
|
```
|
|
132
134
|
|
|
133
135
|
- **Author identity** = local gitconfig `user.name` / `user.email`. Must NOT be overridden to an AI name.
|
|
134
|
-
- **No** `Co-Authored-By: Claude / Anthropic / MiniMax` trailer —
|
|
136
|
+
- **No** `Co-Authored-By: Claude / Anthropic / MiniMax` trailer — AGENTS.md red rule (the repo's root constitution file; `CLAUDE.md` is only the `@AGENTS.md` pointer).
|
|
135
137
|
- Tests: if the touched area has a test, run it before commit; if not, add one. Capture test output in the per-issue PR body.
|
|
136
138
|
|
|
137
139
|
### 6. Relocate commits to per-issue branches
|
|
@@ -304,7 +306,7 @@ What this skill MUST NOT do:
|
|
|
304
306
|
- **Edit upstream history** (no interactive rebase, no `git filter-branch`, no commit signing on someone else's behalf).
|
|
305
307
|
- **Write to security-critical paths** (OAuth, secrets, agent loop, model router, prompt cache — see RL-2).
|
|
306
308
|
- **Change the user identity** in git (no `git config user.name "Claude"`, no `git -c user.email=...` override).
|
|
307
|
-
- **Add `Co-Authored-By: <AI>` trailers** —
|
|
309
|
+
- **Add `Co-Authored-By: <AI>` trailers** — AGENTS.md red rule (the repo's root constitution file; `CLAUDE.md` is only the `@AGENTS.md` pointer).
|
|
308
310
|
- **Hand-author JSON or SKILL.md on the user's behalf** when the user is just describing a target.
|
|
309
311
|
- **Create a `loop_release` / `bee_release` / `crystallization_event`** in peaks-loop's own SkillHub (this is a non-crystallizing orchestrator; see "Loop Engineering role").
|
|
310
312
|
|
|
@@ -8,8 +8,10 @@ description: Fast lane for code work — this window edits source directly, with
|
|
|
8
8
|
## Loop hygiene (every turn — MANDATORY)
|
|
9
9
|
|
|
10
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>`.
|
|
11
|
+
`Peaks-Loop Skill: <skill> | Peaks-Loop Role: <role> | Peaks-Loop Gate: <gate> | Peaks-Loop Context: <ratio%> (<zone>) | Next: <one short action>`.
|
|
12
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.
|
|
13
15
|
|
|
14
16
|
**Context is this skill's own business.** Run `peaks skill presence --json` every turn and
|
|
15
17
|
read its `context` block. When `action` is `auto-fire`, `pre-compact`, or `red-line`,
|
|
@@ -102,9 +104,12 @@ as the terms of the deal, not as caveats:
|
|
|
102
104
|
--scope global` also copies `src/services/hooks/pre-tool-code-gate.sh` into the IDE's
|
|
103
105
|
skills directory; a project-scope install copies nothing. Nothing wires that copy up —
|
|
104
106
|
every hook entry the installer writes is a `peaks …` command, and no settings template
|
|
105
|
-
invokes a `.sh`, so it lies inert until a harness is pointed at it by hand. If one is: it
|
|
106
|
-
|
|
107
|
-
|
|
107
|
+
invokes a `.sh`, so it lies inert until a harness is pointed at it by hand. If one is: it is a
|
|
108
|
+
**thin wrapper** that execs `peaks code-gate` — so where a Node CLI is reachable it takes the
|
|
109
|
+
driver input and honours the fast lane exactly as the command does, and it refuses rather than
|
|
110
|
+
guessing when it cannot place the file. Only a machine with **no** Node CLI reachable reaches
|
|
111
|
+
its **no-CLI fallback**, which denies the hard-blocked families unconditionally, refused even in
|
|
112
|
+
this lane, and its refusal will not mention this file. That asymmetry is known and
|
|
108
113
|
left conservative on purpose — assigning it is not this skill's job, and teaching the shell
|
|
109
114
|
gate about lanes is not yours.
|
|
110
115
|
|
|
@@ -8,8 +8,10 @@ description: Universal resume primitive for any in-flight Peaks-Loop workflow (o
|
|
|
8
8
|
## Loop hygiene (every turn — MANDATORY)
|
|
9
9
|
|
|
10
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>`.
|
|
11
|
+
`Peaks-Loop Skill: <skill> | Peaks-Loop Role: <role> | Peaks-Loop Gate: <gate> | Peaks-Loop Context: <ratio%> (<zone>) | Next: <one short action>`.
|
|
12
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.
|
|
13
15
|
|
|
14
16
|
**Context is this skill's own business.** Run `peaks skill presence --json` every turn and
|
|
15
17
|
read its `context` block. When `action` is `auto-fire`, `pre-compact`, or `red-line`,
|