peaks-loop 3.0.0 → 3.0.1
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 +3 -3
- package/CHANGELOG.md +57 -57
- package/README-en.md +2 -2
- package/README.md +2 -2
- package/agents/karpathy-reviewer.md +2 -2
- package/dist/src/cli/commands/agent-commands.js +3 -3
- package/dist/src/cli/commands/audit-commands.d.ts +1 -1
- package/dist/src/cli/commands/audit-commands.js +6 -6
- package/dist/src/cli/commands/classify-classify-commands.js +1 -1
- package/dist/src/cli/commands/code-review-commands.d.ts +3 -3
- package/dist/src/cli/commands/code-review-commands.js +5 -5
- package/dist/src/cli/commands/compact-command.d.ts +21 -0
- package/dist/src/cli/commands/compact-command.js +252 -0
- package/dist/src/cli/commands/context-commands.d.ts +1 -1
- package/dist/src/cli/commands/context-commands.js +1 -1
- package/dist/src/cli/commands/contract-commands.d.ts +1 -1
- package/dist/src/cli/commands/core/session-command.js +17 -7
- package/dist/src/cli/commands/core/skill-command.js +1 -1
- package/dist/src/cli/commands/feedback-commands.js +1 -1
- package/dist/src/cli/commands/hook-handle.d.ts +1 -1
- package/dist/src/cli/commands/hook-handle.js +1 -1
- package/dist/src/cli/commands/legacy-commands.d.ts +1 -1
- package/dist/src/cli/commands/legacy-commands.js +2 -2
- package/dist/src/cli/commands/log-commands.js +2 -2
- package/dist/src/cli/commands/loop-commands.d.ts +1 -1
- package/dist/src/cli/commands/loop-commands.js +1 -1
- package/dist/src/cli/commands/loop-eval-commands.d.ts +1 -1
- package/dist/src/cli/commands/loop-eval-commands.js +1 -1
- package/dist/src/cli/commands/playwright-commands.d.ts +1 -1
- package/dist/src/cli/commands/playwright-commands.js +2 -2
- package/dist/src/cli/commands/request-commands.js +40 -1
- package/dist/src/cli/commands/role-commands.js +1 -1
- package/dist/src/cli/commands/slice-commands.js +5 -5
- package/dist/src/cli/commands/upgrade-commands.d.ts +1 -1
- package/dist/src/cli/commands/upgrade-commands.js +6 -6
- package/dist/src/cli/commands/workspace/init-command.js +2 -2
- package/dist/src/cli/program.js +10 -1
- package/dist/src/services/agent/ecc-agent-service.js +5 -5
- package/dist/src/services/audit/artifact-writer.d.ts +1 -1
- package/dist/src/services/audit/artifact-writer.js +1 -1
- package/dist/src/services/audit/decision-writer.d.ts +1 -1
- package/dist/src/services/audit/decision-writer.js +1 -1
- package/dist/src/services/audit/enforcers/lint-output-style.js +5 -5
- package/dist/src/services/audit/enforcers/mock-placement.d.ts +1 -1
- package/dist/src/services/audit/enforcers/mock-placement.js +1 -1
- package/dist/src/services/audit/enforcers/no-root-pollution.js +1 -1
- package/dist/src/services/audit/red-line-catalog-p2-a.js +2 -2
- package/dist/src/services/audit/red-line-catalog-p2-b.js +2 -2
- package/dist/src/services/audit/static-service.d.ts +1 -1
- package/dist/src/services/audit/static-service.js +5 -5
- package/dist/src/services/audit/types.d.ts +1 -1
- package/dist/src/services/audit/types.js +1 -1
- package/dist/src/services/audit-independent/perf-audit-service.js +1 -1
- package/dist/src/services/audit-independent/security-audit-service.js +1 -1
- package/dist/src/services/classify/classify-service.d.ts +1 -1
- package/dist/src/services/classify/classify-service.js +1 -1
- package/dist/src/services/classify/classify-types.d.ts +1 -1
- package/dist/src/services/classify/classify-types.js +1 -1
- package/dist/src/services/code-review/ecc-bridge.d.ts +2 -2
- package/dist/src/services/code-review/ecc-bridge.js +2 -2
- package/dist/src/services/code-review/ocr-service.d.ts +9 -9
- package/dist/src/services/code-review/ocr-service.js +16 -16
- package/dist/src/services/compact/decision-tables.d.ts +66 -0
- package/dist/src/services/compact/decision-tables.js +127 -0
- package/dist/src/services/compact/request-transition-hook.d.ts +20 -0
- package/dist/src/services/compact/request-transition-hook.js +110 -0
- package/dist/src/services/compact/suggest-service.d.ts +74 -0
- package/dist/src/services/compact/suggest-service.js +203 -0
- package/dist/src/services/config/config-migration.js +1 -1
- package/dist/src/services/config/config-safety.d.ts +1 -1
- package/dist/src/services/config/config-safety.js +1 -1
- package/dist/src/services/config/config-service.d.ts +1 -1
- package/dist/src/services/config/config-service.js +1 -1
- package/dist/src/services/context/auto-compact-dispatcher.js +4 -4
- package/dist/src/services/context/auto-compact-types.d.ts +6 -6
- package/dist/src/services/context/auto-compact-types.js +5 -5
- package/dist/src/services/dispatch/sub-agent-dispatcher.js +1 -1
- package/dist/src/services/dispatch/test-tool-detection.d.ts +1 -1
- package/dist/src/services/dispatch/test-tool-detection.js +1 -1
- package/dist/src/services/doctor/doctor-service.d.ts +1 -1
- package/dist/src/services/doctor/doctor-service.js +5 -5
- package/dist/src/services/hooks/presence-marker-detector.js +5 -5
- package/dist/src/services/ide/adapters/claude-code-adapter.d.ts +1 -1
- package/dist/src/services/ide/adapters/claude-code-adapter.js +2 -2
- package/dist/src/services/ide/adapters/codex-adapter.d.ts +2 -2
- package/dist/src/services/ide/adapters/codex-adapter.js +2 -2
- package/dist/src/services/ide/adapters/cursor-adapter.d.ts +2 -2
- package/dist/src/services/ide/adapters/cursor-adapter.js +2 -2
- package/dist/src/services/ide/adapters/hermes-adapter.d.ts +1 -1
- package/dist/src/services/ide/adapters/hermes-adapter.js +1 -1
- package/dist/src/services/ide/adapters/openclaw-adapter.d.ts +1 -1
- package/dist/src/services/ide/adapters/openclaw-adapter.js +1 -1
- package/dist/src/services/ide/adapters/trae-adapter.d.ts +1 -1
- package/dist/src/services/ide/adapters/trae-adapter.js +1 -1
- package/dist/src/services/ide/ide-types.d.ts +9 -9
- package/dist/src/services/legacy/legacy-detector.d.ts +1 -1
- package/dist/src/services/legacy/legacy-detector.js +1 -1
- package/dist/src/services/log/log-commands-service.d.ts +1 -1
- package/dist/src/services/log/log-commands-service.js +1 -1
- package/dist/src/services/log/logger.d.ts +3 -3
- package/dist/src/services/log/logger.js +3 -3
- package/dist/src/services/log/redact.d.ts +1 -1
- package/dist/src/services/log/redact.js +1 -1
- package/dist/src/services/loop/evaluator-dispatcher.d.ts +1 -1
- package/dist/src/services/loop/evaluator-dispatcher.js +16 -15
- package/dist/src/services/loop/monotonic-guard.js +35 -18
- package/dist/src/services/loop/monotonic-runner.d.ts +3 -0
- package/dist/src/services/loop/monotonic-runner.js +62 -28
- package/dist/src/services/loop/run-driver.js +45 -24
- package/dist/src/services/memory/llm-reranker.d.ts +1 -1
- package/dist/src/services/memory/llm-reranker.js +1 -1
- package/dist/src/services/mut/production-stryker.d.ts +0 -5
- package/dist/src/services/mut/production-stryker.js +19 -10
- package/dist/src/services/openspec/openspec-propose-from-doctor-service.d.ts +1 -1
- package/dist/src/services/openspec/openspec-propose-from-doctor-service.js +1 -1
- package/dist/src/services/perf/perf-baseline-service.d.ts +2 -2
- package/dist/src/services/perf/perf-baseline-service.js +2 -2
- package/dist/src/services/prd/handoff-auto-regen.js +1 -1
- package/dist/src/services/prd/project-scan-sediment.js +3 -3
- package/dist/src/services/prd/project-scan-types.d.ts +1 -1
- package/dist/src/services/preferences/preferences-types.d.ts +3 -3
- package/dist/src/services/preferences/preferences-types.js +2 -2
- package/dist/src/services/role/role-registry.d.ts +1 -1
- package/dist/src/services/role/role-registry.js +1 -1
- package/dist/src/services/sc/sc-service.js +3 -3
- package/dist/src/services/skill/resume-detector.js +2 -2
- package/dist/src/services/skills/sync-service.d.ts +3 -3
- package/dist/src/services/skills/sync-service.js +9 -9
- package/dist/src/services/slice/calibration-store.d.ts +1 -1
- package/dist/src/services/slice/calibration-store.js +1 -1
- package/dist/src/services/solo/auto-compact-orchestrator.d.ts +1 -1
- package/dist/src/services/solo/auto-compact-orchestrator.js +7 -7
- package/dist/src/services/solo/dag-orchestrator.js +1 -1
- package/dist/src/services/solo/mode-gate.d.ts +1 -1
- package/dist/src/services/solo/mode-gate.js +4 -4
- package/dist/src/services/solo/user-touchpoint-classifier.js +1 -1
- package/dist/src/services/standards/migrate-claude-rules-service.js +5 -5
- package/dist/src/services/standards/migrate-service.d.ts +3 -3
- package/dist/src/services/standards/migrate-service.js +5 -5
- package/dist/src/services/standards/project-standards-service.js +1 -1
- package/dist/src/services/upgrade/gitignore-migrate-service.d.ts +3 -3
- package/dist/src/services/upgrade/gitignore-migrate-service.js +4 -4
- package/dist/src/services/upgrade/upgrade-service.d.ts +1 -1
- package/dist/src/services/upgrade/upgrade-service.js +5 -5
- package/dist/src/services/verdict/envelopes.d.ts +1 -1
- package/dist/src/services/verdict/envelopes.js +1 -1
- package/dist/src/services/workflow/workflow-loader.js +1 -1
- package/dist/src/services/workspace/migrate-1-4-1-service.d.ts +1 -1
- package/dist/src/services/workspace/migrate-1-4-1-service.js +1 -1
- package/dist/src/services/workspace/migrate-types.d.ts +1 -1
- package/dist/src/services/workspace/migrate-types.js +1 -1
- package/dist/src/services/workspace/workspace-claude-settings-materializer.d.ts +2 -2
- package/dist/src/services/workspace/workspace-claude-settings-materializer.js +9 -9
- package/dist/src/services/workspace/workspace-service.d.ts +1 -1
- package/dist/src/services/workspace/workspace-service.js +1 -1
- package/dist/src/shared/path-safety.d.ts +1 -1
- package/dist/src/shared/path-safety.js +1 -1
- package/dist/src/shared/version.d.ts +1 -1
- package/dist/src/shared/version.js +1 -1
- package/output-styles/peaks-skill-swarm.md +33 -33
- package/package.json +5 -4
- package/schemas/decomposition-v1.json +1 -1
- package/schemas/decomposition-v2.json +1 -1
- package/schemas/replay-fixture.schema.json +1 -1
- package/schemas/reviewer-envelope.schema.json +1 -1
- package/scripts/install-skills.mjs +11 -11
- package/skills/peaks-audit/SKILL.md +2 -2
- package/skills/peaks-doctor/SKILL.md +4 -4
- package/skills/peaks-final-review/SKILL.md +2 -2
- package/skills/peaks-ide/SKILL.md +3 -3
- package/skills/peaks-perf-audit/SKILL.md +1 -1
- package/skills/peaks-prd/SKILL.md +14 -14
- package/skills/peaks-prd/references/workflow.md +1 -1
- package/skills/peaks-qa/SKILL.md +17 -17
- package/skills/peaks-qa/references/artifact-per-request.md +1 -1
- package/skills/peaks-qa/references/browser-validation-contracts.md +2 -2
- package/skills/peaks-qa/references/codegraph-regression-focus.md +1 -1
- package/skills/peaks-qa/references/external-capability-guidance.md +2 -2
- package/skills/peaks-qa/references/qa-fanout-contract.md +1 -1
- package/skills/peaks-qa/references/qa-gstack-integration.md +3 -3
- package/skills/peaks-qa/references/qa-local-artifacts.md +1 -1
- package/skills/peaks-qa/references/qa-matt-pocock-integration.md +1 -1
- package/skills/peaks-qa/references/qa-runbook.md +3 -3
- package/skills/peaks-qa/references/qa-skill-presence.md +1 -1
- package/skills/peaks-qa/references/qa-standards-preflight.md +2 -2
- package/skills/peaks-qa/references/qa-transition-gates.md +9 -9
- package/skills/peaks-qa/references/regression-gates.md +1 -1
- package/skills/peaks-rd/SKILL.md +13 -13
- package/skills/peaks-rd/references/artifact-and-standards-output.md +1 -1
- package/skills/peaks-rd/references/codegraph-project-analysis.md +1 -1
- package/skills/peaks-rd/references/external-references.md +3 -3
- package/skills/peaks-rd/references/karpathy-reviewer-prompt.md +1 -1
- package/skills/peaks-rd/references/mandatory-perf-baseline.md +1 -1
- package/skills/peaks-rd/references/matt-pocock-integration.md +2 -2
- package/skills/peaks-rd/references/ocr-integration.md +19 -19
- package/skills/peaks-rd/references/openspec-cli.md +2 -2
- package/skills/peaks-rd/references/rd-gstack-integration.md +5 -5
- package/skills/peaks-rd/references/rd-runbook.md +9 -9
- package/skills/peaks-rd/references/rd-standards-preflight.md +1 -1
- package/skills/peaks-rd/references/rd-transition-gates.md +13 -13
- package/skills/peaks-rd/references/skill-presence-and-title.md +1 -1
- package/skills/peaks-reviewer/SKILL.md +2 -2
- package/skills/peaks-sc/SKILL.md +9 -9
- package/skills/peaks-security-audit/SKILL.md +1 -1
- package/skills/peaks-slice-decompose/SKILL.md +2 -2
- package/skills/peaks-solo/SKILL.md +49 -49
- package/skills/peaks-solo/references/a2a-artifact-mapping.md +8 -8
- package/skills/peaks-solo/references/anchoring-and-session-info.md +3 -3
- package/skills/peaks-solo/references/boundaries.md +4 -4
- package/skills/peaks-solo/references/browser-workflow.md +2 -2
- package/skills/peaks-solo/references/codegraph-orchestration.md +1 -1
- package/skills/peaks-solo/references/completion-handoff.md +2 -2
- package/skills/peaks-solo/references/external-references.md +3 -3
- package/skills/peaks-solo/references/external-skill-invocation.md +2 -2
- package/skills/peaks-solo/references/frontend-only-mode.md +1 -1
- package/skills/peaks-solo/references/gstack-integration.md +4 -4
- package/skills/peaks-solo/references/local-artifact-workspace.md +2 -2
- package/skills/peaks-solo/references/micro-cycle.md +4 -4
- package/skills/peaks-solo/references/mode-selection.md +5 -5
- package/skills/peaks-solo/references/openspec-workflow.md +2 -2
- package/skills/peaks-solo/references/playwright-mcp-multi-terminal.md +1 -1
- package/skills/peaks-solo/references/project-memory-loading.md +1 -1
- package/skills/peaks-solo/references/project-scan-checklist.md +1 -1
- package/skills/peaks-solo/references/quality-gate-cheatsheet.md +1 -1
- package/skills/peaks-solo/references/resume-detection.md +1 -1
- package/skills/peaks-solo/references/runbook.md +20 -20
- package/skills/peaks-solo/references/skill-presence-and-title.md +2 -2
- package/skills/peaks-solo/references/standards-preflight.md +2 -2
- package/skills/peaks-solo/references/step-0-55-1x-detection.md +3 -3
- package/skills/peaks-solo/references/sub-agent-dispatch.md +3 -3
- package/skills/peaks-solo/references/swarm-dispatch-contract.md +3 -3
- package/skills/peaks-solo/references/workflow-gates-and-types.md +34 -34
- package/skills/peaks-solo-resume/SKILL.md +2 -2
- package/skills/peaks-solo-status/SKILL.md +4 -4
- package/skills/peaks-solo-test/SKILL.md +4 -4
- package/skills/peaks-sop/SKILL.md +5 -5
- package/skills/peaks-txt/SKILL.md +17 -17
- package/skills/peaks-ui/SKILL.md +17 -17
- package/skills/peaks-ui/references/workflow.md +1 -1
|
@@ -1,20 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Production Stryker invoker. Uses @stryker-mutator/core programmatic API.
|
|
3
|
+
* Note: this is a thin wrapper — actual Stryker invocation requires the
|
|
4
|
+
* Stryker config in `stryker.conf.js` to live at the project root.
|
|
5
|
+
*/
|
|
6
|
+
import { relative, isAbsolute } from 'node:path';
|
|
1
7
|
export function createProductionStrykerInvoker() {
|
|
2
|
-
return async ({ project, testFiles }) => {
|
|
8
|
+
return async ({ project, testFiles: _testFiles }) => {
|
|
3
9
|
// Lazy-load Stryker so unit tests don't need it installed.
|
|
4
10
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
5
11
|
const Stryker = (await import('@stryker-mutator/core')).Stryker;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
};
|
|
10
|
-
// Single cast derives from Stryker's actual constructor signature.
|
|
11
|
-
// Stryker 8's MutantResult extends our local StrykerMutant structurally.
|
|
12
|
-
const stryker = new Stryker(options);
|
|
12
|
+
// Mutation surface is owned by stryker.conf.js. testFiles is a runtime
|
|
13
|
+
// hint (consumed by the configured testRunner, not by Stryker's `mutate`
|
|
14
|
+
// field — `mutate` is source files to mutate, never test paths).
|
|
15
|
+
const stryker = new Stryker({});
|
|
13
16
|
const mutants = (await stryker.runMutationTest());
|
|
14
17
|
return normalize(mutants, project);
|
|
15
18
|
};
|
|
16
19
|
}
|
|
17
|
-
function normalize(mutants,
|
|
20
|
+
function normalize(mutants, project) {
|
|
18
21
|
let mutantsKilled = 0;
|
|
19
22
|
let mutantsSurvived = 0;
|
|
20
23
|
let mutantsTimeout = 0;
|
|
@@ -31,7 +34,13 @@ function normalize(mutants, _project) {
|
|
|
31
34
|
// empty (as v0 did) silently swallowed those followups in production.
|
|
32
35
|
const byFile = new Map();
|
|
33
36
|
for (const m of mutants) {
|
|
34
|
-
|
|
37
|
+
// Stryker 8 returns absolute paths in MutantResult.fileName. Strip the
|
|
38
|
+
// project root so byFile[].file is repo-relative (e.g. "src/services/loop/...").
|
|
39
|
+
// path.relative falls back to the absolute path when input is outside
|
|
40
|
+
// project, which is the safest failure mode.
|
|
41
|
+
const file = isAbsolute(m.fileName) && m.fileName.startsWith(project)
|
|
42
|
+
? relative(project, m.fileName)
|
|
43
|
+
: m.fileName;
|
|
35
44
|
let bucket = byFile.get(file);
|
|
36
45
|
if (!bucket) {
|
|
37
46
|
bucket = { killed: 0, survived: 0, survivedEntries: [] };
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Per L1+L2+L3 redesign §5.4: "CRITICAL → proposal 草稿生成". The doctor
|
|
6
6
|
* scans the project for issues; when a CRITICAL finding is surfaced,
|
|
7
|
-
* peaks-
|
|
7
|
+
* peaks-loop generates a draft `openspec/changes/<id>/proposal.md` so the
|
|
8
8
|
* LLM doesn't have to start from scratch.
|
|
9
9
|
*
|
|
10
10
|
* The draft proposal is INFORMATIONAL — it requires the LLM to review +
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Per L1+L2+L3 redesign §5.4: "CRITICAL → proposal 草稿生成". The doctor
|
|
6
6
|
* scans the project for issues; when a CRITICAL finding is surfaced,
|
|
7
|
-
* peaks-
|
|
7
|
+
* peaks-loop generates a draft `openspec/changes/<id>/proposal.md` so the
|
|
8
8
|
* LLM doesn't have to start from scratch.
|
|
9
9
|
*
|
|
10
10
|
* The draft proposal is INFORMATIONAL — it requires the LLM to review +
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* `.peaks/_runtime/<sid>/rd/perf-baseline.md` so QA Gate A4 has a known-good
|
|
17
17
|
* reference to diff against. The CLI itself only writes the scaffold
|
|
18
18
|
* and records the path; the actual measurement is a project-local
|
|
19
|
-
* concern that lives in the README, not in peaks-
|
|
19
|
+
* concern that lives in the README, not in peaks-loop.
|
|
20
20
|
*
|
|
21
21
|
* The four-grounds check (per the skill-primary-CLI-auxiliary dev
|
|
22
22
|
* preference):
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
* NOT add a lint gate here.
|
|
34
34
|
*
|
|
35
35
|
* Net: CLI is justified. The destructive --apply default is dry-run,
|
|
36
|
-
* matching the rest of peaks-
|
|
36
|
+
* matching the rest of peaks-loop's scaffolding pattern.
|
|
37
37
|
*/
|
|
38
38
|
export type PerfBaselineInitOptions = {
|
|
39
39
|
projectRoot: string;
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* `.peaks/_runtime/<sid>/rd/perf-baseline.md` so QA Gate A4 has a known-good
|
|
17
17
|
* reference to diff against. The CLI itself only writes the scaffold
|
|
18
18
|
* and records the path; the actual measurement is a project-local
|
|
19
|
-
* concern that lives in the README, not in peaks-
|
|
19
|
+
* concern that lives in the README, not in peaks-loop.
|
|
20
20
|
*
|
|
21
21
|
* The four-grounds check (per the skill-primary-CLI-auxiliary dev
|
|
22
22
|
* preference):
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
* NOT add a lint gate here.
|
|
34
34
|
*
|
|
35
35
|
* Net: CLI is justified. The destructive --apply default is dry-run,
|
|
36
|
-
* matching the rest of peaks-
|
|
36
|
+
* matching the rest of peaks-loop's scaffolding pattern.
|
|
37
37
|
*/
|
|
38
38
|
import { mkdir, writeFile } from 'node:fs/promises';
|
|
39
39
|
import { existsSync } from 'node:fs';
|
|
@@ -41,7 +41,7 @@ export async function autoRegenPrdHandoff(opts) {
|
|
|
41
41
|
const sha256 = sha256OfBody(body);
|
|
42
42
|
// v2.13.3 AC-4 — align with `AUDIT_REQUIRES_HANDOFF` prereq which
|
|
43
43
|
// pins `mustContain: ['schemaVersion: 2', 'sha256:']`. The previous
|
|
44
|
-
// field name `handoffHash` made peaks-
|
|
44
|
+
// field name `handoffHash` made peaks-loop write a handoff that the
|
|
45
45
|
// own prereq resolver would reject with "missing section(s): sha256:".
|
|
46
46
|
// Primary field is now `sha256`; `handoffHash` is kept as a literal
|
|
47
47
|
// alias for back-compat with any consumer (UI / external scripts)
|
|
@@ -307,9 +307,9 @@ function splitTableRow(row) {
|
|
|
307
307
|
}
|
|
308
308
|
function renderFreshAuditPatternBody(args) {
|
|
309
309
|
const titleByKind = {
|
|
310
|
-
'security-audit': 'Security Audit Template (peaks-
|
|
311
|
-
'perf-audit': 'Performance Audit Template (peaks-
|
|
312
|
-
'audit-output-schema': 'Audit Output Schema (peaks-
|
|
310
|
+
'security-audit': 'Security Audit Template (peaks-loop v2.12.0)',
|
|
311
|
+
'perf-audit': 'Performance Audit Template (peaks-loop v2.12.0)',
|
|
312
|
+
'audit-output-schema': 'Audit Output Schema (peaks-loop v2.12.0)'
|
|
313
313
|
};
|
|
314
314
|
const appliesToByKind = {
|
|
315
315
|
'security-audit': 'peaks-security-audit skill',
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
*/
|
|
20
20
|
/** Tech-stack snapshot. `language` / `packageManager` are closed
|
|
21
21
|
* unions (Karpathy §2 — no string sprawl); `runtime` / `buildTool`
|
|
22
|
-
* are free-form (peaks-
|
|
22
|
+
* are free-form (peaks-loop does not constrain them). */
|
|
23
23
|
export interface ProjectScanTechStack {
|
|
24
24
|
readonly language: 'typescript';
|
|
25
25
|
readonly packageManager: 'pnpm';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* peaks-
|
|
2
|
+
* peaks-loop 2.0 project-local preferences schema.
|
|
3
3
|
* Per spec §8.4 — per-project state lives in `.peaks/preferences.json`,
|
|
4
4
|
* NOT in `~/.peaks/config.json` (which is slim global).
|
|
5
5
|
*
|
|
6
|
-
* Spec reference: docs/superpowers/specs/2026-06-11-peaks-
|
|
6
|
+
* Spec reference: docs/superpowers/specs/2026-06-11-peaks-loop-l1-l2-l3-redesign.md §8.4
|
|
7
7
|
*/
|
|
8
8
|
export declare const PREFERENCES_SCHEMA_VERSION = "2.0.0";
|
|
9
9
|
/**
|
|
@@ -110,7 +110,7 @@ export interface ProjectPreferences {
|
|
|
110
110
|
*
|
|
111
111
|
* When true, `peaks audit static` spawns `npx ecc-agentshield scan --json`
|
|
112
112
|
* and merges its findings into the audit report. When false (default),
|
|
113
|
-
* the audit runs peaks-
|
|
113
|
+
* the audit runs peaks-loop-only and the subprocess is never spawned.
|
|
114
114
|
*
|
|
115
115
|
* The preference is independent of whether ECC is installed — i.e.
|
|
116
116
|
* `agentShieldEnabled: true` with ECC missing surfaces a soft
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* peaks-
|
|
2
|
+
* peaks-loop 2.0 project-local preferences schema.
|
|
3
3
|
* Per spec §8.4 — per-project state lives in `.peaks/preferences.json`,
|
|
4
4
|
* NOT in `~/.peaks/config.json` (which is slim global).
|
|
5
5
|
*
|
|
6
|
-
* Spec reference: docs/superpowers/specs/2026-06-11-peaks-
|
|
6
|
+
* Spec reference: docs/superpowers/specs/2026-06-11-peaks-loop-l1-l2-l3-redesign.md §8.4
|
|
7
7
|
*/
|
|
8
8
|
export const PREFERENCES_SCHEMA_VERSION = '2.0.0';
|
|
9
9
|
export const FANOUT_MODES = ['fan-out'];
|
|
@@ -32,7 +32,7 @@ export declare function upsertRole(registry: RoleRegistry, role: Role): RoleRegi
|
|
|
32
32
|
export declare function grantPermission(registry: RoleRegistry, roleName: string, permission: string): RoleRegistry;
|
|
33
33
|
/** Check if a role has a permission. */
|
|
34
34
|
export declare function roleHasPermission(registry: RoleRegistry, roleName: string, permission: string): boolean;
|
|
35
|
-
/** Permission categories that align with the peaks-
|
|
35
|
+
/** Permission categories that align with the peaks-loop 12 Gaps memory. */
|
|
36
36
|
export declare const DEFAULT_PERMISSIONS: readonly string[];
|
|
37
37
|
/** Default role preset for a Senior FE on a 24h AI programmer team. */
|
|
38
38
|
export declare const DEFAULT_SENIOR_FE_ROLE: Role;
|
|
@@ -59,7 +59,7 @@ export function roleHasPermission(registry, roleName, permission) {
|
|
|
59
59
|
return false;
|
|
60
60
|
return role.permissions.includes(permission);
|
|
61
61
|
}
|
|
62
|
-
/** Permission categories that align with the peaks-
|
|
62
|
+
/** Permission categories that align with the peaks-loop 12 Gaps memory. */
|
|
63
63
|
export const DEFAULT_PERMISSIONS = [
|
|
64
64
|
'prd.write',
|
|
65
65
|
'prd.confirm',
|
|
@@ -23,7 +23,7 @@ const RETENTION_REQUIREMENTS = [
|
|
|
23
23
|
['txt', 'context-capsule.md']
|
|
24
24
|
];
|
|
25
25
|
/**
|
|
26
|
-
* "Modern" retention requirements for the current peaks-
|
|
26
|
+
* "Modern" retention requirements for the current peaks-loop artifact
|
|
27
27
|
* naming convention. The legacy `RETENTION_REQUIREMENTS` above assume
|
|
28
28
|
* older `refactor-goal.md` / `slice-spec.md` / `coverage-report.md` /
|
|
29
29
|
* `validation-report.md` / `change-impact.json` / `retention-boundary.md`
|
|
@@ -502,10 +502,10 @@ export function validateArtifactRetention(sliceId) {
|
|
|
502
502
|
// If the legacy check is short (i.e. we're missing a lot of legacy-named
|
|
503
503
|
// files) but the resolver landed on a real session, ALSO accept the
|
|
504
504
|
// modern set. The legacy set was designed for an older workflow naming
|
|
505
|
-
// and a freshly-minted session in the current peaks-
|
|
505
|
+
// and a freshly-minted session in the current peaks-loop flow will not
|
|
506
506
|
// have the legacy names. This keeps `peaks sc validate --slice-id <rid>`
|
|
507
507
|
// returning `valid: true` for slices that completed under the current
|
|
508
|
-
// peaks-
|
|
508
|
+
// peaks-loop convention.
|
|
509
509
|
if (missingArtifacts.length > 0 && resolvedPeaksSessionDir !== null) {
|
|
510
510
|
const modernMissing = modernRequirementRelativePaths(sliceId).filter((rel) => !resolvedPresent(...rel.split('/')));
|
|
511
511
|
if (modernMissing.length === 0) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Peaks-
|
|
2
|
+
* Peaks-Loop Solo Step 0.7 — Resume-mode detector.
|
|
3
3
|
*
|
|
4
4
|
* Mirrors the classification table in
|
|
5
|
-
* `skills/peaks-solo/SKILL.md` "Peaks-
|
|
5
|
+
* `skills/peaks-solo/SKILL.md` "Peaks-Loop Step 0.7: Detect unfinished work
|
|
6
6
|
* and offer resume". The function is a pure read of session artifacts;
|
|
7
7
|
* it performs no side effects and is safe to call from hooks, scripts,
|
|
8
8
|
* and skills.
|
|
@@ -47,10 +47,10 @@ interface InstallResult {
|
|
|
47
47
|
}
|
|
48
48
|
type InstallerFn = (opts: InstallBundledSkillsOptions) => InstallResult;
|
|
49
49
|
/**
|
|
50
|
-
* Resolve the path of `install-skills.mjs` inside the peaks-
|
|
50
|
+
* Resolve the path of `install-skills.mjs` inside the peaks-loop
|
|
51
51
|
* install root, walking up from `import.meta.url` until a
|
|
52
|
-
* `package.json` with `"name": "peaks-
|
|
53
|
-
* `null` when peaks-
|
|
52
|
+
* `package.json` with `"name": "peaks-loop"` is found. Returns
|
|
53
|
+
* `null` when peaks-loop is not on the import path or the script
|
|
54
54
|
* is absent (e.g. a partial install).
|
|
55
55
|
*/
|
|
56
56
|
export declare function resolvePeaksCliInstallerPath(): string | null;
|
|
@@ -9,13 +9,13 @@
|
|
|
9
9
|
* is `scripts/install-skills.mjs::installBundledSkills` (dynamically
|
|
10
10
|
* imported so this module does not require a build step).
|
|
11
11
|
*
|
|
12
|
-
* Slice 2.0.1-bug2-skill-sync-fallback: when peaks-
|
|
12
|
+
* Slice 2.0.1-bug2-skill-sync-fallback: when peaks-loop is
|
|
13
13
|
* installed from npm into a consumer project, that consumer's
|
|
14
14
|
* CWD does not contain `scripts/install-skills.mjs`. The previous
|
|
15
15
|
* hard-coded `join(process.cwd(), 'scripts', 'install-skills.mjs')`
|
|
16
16
|
* therefore threw `ERR_MODULE_NOT_FOUND` in every consumer run.
|
|
17
17
|
* The fix is a three-tier probe:
|
|
18
|
-
* 1. peaks-
|
|
18
|
+
* 1. peaks-loop's own install path (resolved from
|
|
19
19
|
* `import.meta.url` walking up to the package root, or
|
|
20
20
|
* from `process.argv[1]` for CJS-equivalent entrypoints),
|
|
21
21
|
* 2. the consumer CWD (`<cwd>/scripts/install-skills.mjs`),
|
|
@@ -62,7 +62,7 @@ function noopInstaller(_opts) {
|
|
|
62
62
|
return {
|
|
63
63
|
installed: [],
|
|
64
64
|
skipped: [
|
|
65
|
-
'install-skills.mjs not found in project; skill sync skipped — bundled skills are installed via peaks-
|
|
65
|
+
'install-skills.mjs not found in project; skill sync skipped — bundled skills are installed via peaks-loop postinstall',
|
|
66
66
|
],
|
|
67
67
|
};
|
|
68
68
|
}
|
|
@@ -79,10 +79,10 @@ const services = {
|
|
|
79
79
|
loadInstallerForTest,
|
|
80
80
|
};
|
|
81
81
|
/**
|
|
82
|
-
* Resolve the path of `install-skills.mjs` inside the peaks-
|
|
82
|
+
* Resolve the path of `install-skills.mjs` inside the peaks-loop
|
|
83
83
|
* install root, walking up from `import.meta.url` until a
|
|
84
|
-
* `package.json` with `"name": "peaks-
|
|
85
|
-
* `null` when peaks-
|
|
84
|
+
* `package.json` with `"name": "peaks-loop"` is found. Returns
|
|
85
|
+
* `null` when peaks-loop is not on the import path or the script
|
|
86
86
|
* is absent (e.g. a partial install).
|
|
87
87
|
*/
|
|
88
88
|
export function resolvePeaksCliInstallerPath() {
|
|
@@ -154,7 +154,7 @@ export async function loadInstallerForTest(scriptPath) {
|
|
|
154
154
|
}
|
|
155
155
|
/**
|
|
156
156
|
* Resolve and load the installer, memoizing the outcome.
|
|
157
|
-
* Three-tier probe (peaks-
|
|
157
|
+
* Three-tier probe (peaks-loop install path → CWD → no-op),
|
|
158
158
|
* with the "not found" outcome memoized as a sentinel so the
|
|
159
159
|
* warning is logged at most once per process.
|
|
160
160
|
*
|
|
@@ -171,7 +171,7 @@ async function loadInstaller() {
|
|
|
171
171
|
if (cachedInstaller !== null) {
|
|
172
172
|
return cachedInstaller;
|
|
173
173
|
}
|
|
174
|
-
// Tier 1: peaks-
|
|
174
|
+
// Tier 1: peaks-loop install path.
|
|
175
175
|
const peaksCliScript = services.resolvePeaksCliInstallerPath();
|
|
176
176
|
if (peaksCliScript !== null) {
|
|
177
177
|
const installer = await services.loadInstallerForTest(peaksCliScript);
|
|
@@ -191,7 +191,7 @@ async function loadInstaller() {
|
|
|
191
191
|
cachedInstaller = NO_INSTALLER_SENTINEL;
|
|
192
192
|
// eslint-disable-next-line no-console -- intentional user-visible signal
|
|
193
193
|
console.warn('peaks skill sync: install-skills.mjs not found in project; ' +
|
|
194
|
-
'skipping (bundled skills come from peaks-
|
|
194
|
+
'skipping (bundled skills come from peaks-loop postinstall).');
|
|
195
195
|
return noopInstaller;
|
|
196
196
|
}
|
|
197
197
|
/**
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* sample size >= 5 for a complexity bucket, switch to percentile-based
|
|
11
11
|
* estimate with confidence 'high'.
|
|
12
12
|
*
|
|
13
|
-
* v1 rationale: peaks-
|
|
13
|
+
* v1 rationale: peaks-loop itself has fewer than 5 completed refactor slices
|
|
14
14
|
* (per the design doc R3), so v1 cannot be calibrated yet. v1 ships the
|
|
15
15
|
* heuristic AND records every estimate to `.peaks/_runtime/<sid>/sc/
|
|
16
16
|
* slice-calibration/<rid>.json` so the next slice can use the prior data.
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* sample size >= 5 for a complexity bucket, switch to percentile-based
|
|
11
11
|
* estimate with confidence 'high'.
|
|
12
12
|
*
|
|
13
|
-
* v1 rationale: peaks-
|
|
13
|
+
* v1 rationale: peaks-loop itself has fewer than 5 completed refactor slices
|
|
14
14
|
* (per the design doc R3), so v1 cannot be calibrated yet. v1 ships the
|
|
15
15
|
* heuristic AND records every estimate to `.peaks/_runtime/<sid>/sc/
|
|
16
16
|
* slice-calibration/<rid>.json` so the next slice can use the prior data.
|
|
@@ -7,7 +7,7 @@ export interface AutoCompactInput {
|
|
|
7
7
|
readonly inFlightBatch?: InFlightBatchProbe | undefined;
|
|
8
8
|
/**
|
|
9
9
|
* Force execute even when ratio < threshold (test seam). In
|
|
10
|
-
* production this is always `false` — peaks-
|
|
10
|
+
* production this is always `false` — peaks-loop drives compact
|
|
11
11
|
* autonomously at 0.85+ with zero human / zero LLM intervention.
|
|
12
12
|
*/
|
|
13
13
|
readonly force?: boolean | undefined;
|
|
@@ -2,29 +2,29 @@
|
|
|
2
2
|
* Auto-compact orchestrator (v2.13.0 AC-2 + AC-3 + AC-4).
|
|
3
3
|
*
|
|
4
4
|
* Closes the loop between `peaks context now` (AC-1) and the IDE's
|
|
5
|
-
* native compact capability (AC-3). peaks-
|
|
5
|
+
* native compact capability (AC-3). peaks-loop is project-aware: it
|
|
6
6
|
* knows the current plan, open questions, recent decisions, in-flight
|
|
7
7
|
* batches, todo state, git status, and active skills. That context is
|
|
8
8
|
* strictly more valuable than what `/compact` can synthesize from raw
|
|
9
|
-
* conversation history — so peaks-
|
|
9
|
+
* conversation history — so peaks-loop drives the entire compaction:
|
|
10
10
|
*
|
|
11
11
|
* 1. Read current context % (via IDE adapter's `readContextPercent`).
|
|
12
|
-
* 2. If ratio ≥ 0.95 (RED LINE): synchronous gate — peaks-
|
|
12
|
+
* 2. If ratio ≥ 0.95 (RED LINE): synchronous gate — peaks-loop
|
|
13
13
|
* refuses sub-agent dispatch and forces IDE compact immediately.
|
|
14
14
|
* The LLM cannot opt out (compact red line — keeps the runner
|
|
15
15
|
* alive).
|
|
16
|
-
* 3. If 0.85 ≤ ratio < 0.95 (pre-compact zone): peaks-
|
|
16
|
+
* 3. If 0.85 ≤ ratio < 0.95 (pre-compact zone): peaks-loop prepares
|
|
17
17
|
* the convergence toolkit (checkpoint + auto-decisions log +
|
|
18
18
|
* IDE-dispatch handle) and surfaces it to the LLM. The LLM
|
|
19
19
|
* DECIDES when to fire `peaks solo auto-compact --execute`;
|
|
20
|
-
* peaks-
|
|
20
|
+
* peaks-loop does NOT auto-fire. The toolkit is ready so the
|
|
21
21
|
* LLM doesn't lose context to a last-second `/compact` panic.
|
|
22
22
|
* 4. If ratio < 0.85: skip — return a one-line info row.
|
|
23
23
|
*
|
|
24
24
|
* Why two tiers (vs. one): the LLM uses the 0.85–0.95 zone for
|
|
25
25
|
* intelligent convergence — wait for in-flight sub-agents, finish
|
|
26
26
|
* the current todo row, persist a checkpoint, then compact. At 0.95
|
|
27
|
-
* the window is gone; peaks-
|
|
27
|
+
* the window is gone; peaks-loop takes over synchronously. Net effect:
|
|
28
28
|
* the LLM-runner keeps working with context < 95% without human
|
|
29
29
|
* intervention.
|
|
30
30
|
*/
|
|
@@ -95,7 +95,7 @@ export function evaluateAutoCompactDecision(input) {
|
|
|
95
95
|
if (input.force) {
|
|
96
96
|
return { shouldCompact: true, reason: 'pre-compact', trigger };
|
|
97
97
|
}
|
|
98
|
-
// Default: peaks-
|
|
98
|
+
// Default: peaks-loop drives pre-compact autonomously.
|
|
99
99
|
return { shouldCompact: true, reason: 'pre-compact', trigger };
|
|
100
100
|
}
|
|
101
101
|
/**
|
|
@@ -105,7 +105,7 @@ export function buildDispatchSpec(dag, sliceId, contracts, defaultPrompt) {
|
|
|
105
105
|
'',
|
|
106
106
|
`[slice-dag-dispatcher MVP 1.2] execute slice "${sliceId}" (role=${node.role})${labelFragment}.`,
|
|
107
107
|
'',
|
|
108
|
-
'Scope: this is the 2.7.0 MVP dogfood of peaks-
|
|
108
|
+
'Scope: this is the 2.7.0 MVP dogfood of peaks-loop DAG-aware dispatch. You are one leaf in a multi-slice plan; the orchestrator has already validated the DAG, built a topological order, and injected your upstream contracts above.',
|
|
109
109
|
'',
|
|
110
110
|
'Handoff protocol (REQUIRED — orchestrator depends on this):',
|
|
111
111
|
' 1. Execute the slice to completion.',
|
|
@@ -144,7 +144,7 @@ export declare function formatAutoProceedLogLine(opts: {
|
|
|
144
144
|
* - `git-tag` → `git tag v2.15.0`, `git tag -a v2.15.0 -m ...`
|
|
145
145
|
* - `npm-publish` → `npm publish`, `npm publish --access public`
|
|
146
146
|
* - `npm-install-global` → `npm install -g <pkg>`, `npm i -g <pkg>`
|
|
147
|
-
* - `peaks-global-install`→ `npm install -g peaks-
|
|
147
|
+
* - `peaks-global-install`→ `npm install -g peaks-loop`, `pnpm add -g peaks-loop`
|
|
148
148
|
*
|
|
149
149
|
* These are coarse — false positives are fine (worst case: a
|
|
150
150
|
* non-actionable command gets paused for confirmation; the user
|
|
@@ -164,7 +164,7 @@ export function formatAutoProceedLogLine(opts) {
|
|
|
164
164
|
* - `git-tag` → `git tag v2.15.0`, `git tag -a v2.15.0 -m ...`
|
|
165
165
|
* - `npm-publish` → `npm publish`, `npm publish --access public`
|
|
166
166
|
* - `npm-install-global` → `npm install -g <pkg>`, `npm i -g <pkg>`
|
|
167
|
-
* - `peaks-global-install`→ `npm install -g peaks-
|
|
167
|
+
* - `peaks-global-install`→ `npm install -g peaks-loop`, `pnpm add -g peaks-loop`
|
|
168
168
|
*
|
|
169
169
|
* These are coarse — false positives are fine (worst case: a
|
|
170
170
|
* non-actionable command gets paused for confirmation; the user
|
|
@@ -176,7 +176,7 @@ export const COMMIT_BOUNDARY_PATTERNS = {
|
|
|
176
176
|
'git-tag': /\bgit\s+tag\b/,
|
|
177
177
|
'npm-publish': /\bnpm\s+(publish|pub)\b/,
|
|
178
178
|
'npm-install-global': /\bnpm\s+(install|i|add)\s+(-g|--global)\b/,
|
|
179
|
-
'peaks-global-install': /\b(peaks-
|
|
179
|
+
'peaks-global-install': /\b(peaks-loop)\b/
|
|
180
180
|
};
|
|
181
181
|
/**
|
|
182
182
|
* v2.15.0 slice 002 AC-4: detect whether a Bash command matches any
|
|
@@ -190,8 +190,8 @@ export function detectCommitBoundaryAction(command) {
|
|
|
190
190
|
if (typeof command !== 'string' || command.length === 0)
|
|
191
191
|
return null;
|
|
192
192
|
// Order matters: peaks-global-install is the most specific
|
|
193
|
-
// (matches only the peaks-
|
|
194
|
-
// `npm install -g peaks-
|
|
193
|
+
// (matches only the peaks-loop package name). Test that FIRST so
|
|
194
|
+
// `npm install -g peaks-loop` is attributed correctly. Then
|
|
195
195
|
// git-push, git-tag, npm-publish, npm-install-global.
|
|
196
196
|
if (COMMIT_BOUNDARY_PATTERNS['peaks-global-install'].test(command)) {
|
|
197
197
|
return 'peaks-global-install';
|
|
@@ -141,5 +141,5 @@ export const COMMIT_BOUNDARY_ACTIONS_LIST = [
|
|
|
141
141
|
{ id: 'git-tag', description: 'git tag v2.15.0 / git tag -a ...' },
|
|
142
142
|
{ id: 'npm-publish', description: 'npm publish / npm pub' },
|
|
143
143
|
{ id: 'npm-install-global', description: 'npm install -g / npm i -g / npm add -g' },
|
|
144
|
-
{ id: 'peaks-global-install', description: 'peaks-
|
|
144
|
+
{ id: 'peaks-global-install', description: 'peaks-loop 全局安装 / npm install -g peaks-loop' }
|
|
145
145
|
];
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* peaks standards migrate — .claude/rules/ tree thinning.
|
|
3
3
|
* Slice: 2026-06-12-standards-migrate-claude-rules.
|
|
4
4
|
*
|
|
5
|
-
* The 1.x peaks-
|
|
5
|
+
* The 1.x peaks-loop install copied a thick .claude/rules
|
|
6
6
|
* tree (skill-first / CLI-auxiliary / dogfood / commit-trailer
|
|
7
7
|
* rules) into consumer projects. In 2.0, the canonical rules
|
|
8
8
|
* live at .peaks/standards/ and every markdown file under
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
*/
|
|
24
24
|
import { existsSync, mkdirSync, readdirSync, readFileSync, statSync, writeFileSync } from 'node:fs';
|
|
25
25
|
import { join } from 'node:path';
|
|
26
|
-
const POINTER_TEXT = (canonicalPath) => `# Canonical peaks-
|
|
26
|
+
const POINTER_TEXT = (canonicalPath) => `# Canonical peaks-loop 2.0 rules live at: ${canonicalPath}\n# This file is a 2-line pointer. Edit the canonical file instead.\n`;
|
|
27
27
|
function timestampSlug() {
|
|
28
28
|
return new Date().toISOString().replace(/[:.]/g, '-');
|
|
29
29
|
}
|
|
@@ -47,13 +47,13 @@ function isAlreadyPointer(filePath) {
|
|
|
47
47
|
return false;
|
|
48
48
|
try {
|
|
49
49
|
const body = readFileSync(filePath, 'utf8');
|
|
50
|
-
return body.includes('Canonical peaks-
|
|
50
|
+
return body.includes('Canonical peaks-loop 2.0 rules live at:');
|
|
51
51
|
}
|
|
52
52
|
catch {
|
|
53
53
|
return false;
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
-
const CANONICAL_2_0_DEV_PREFERENCE = `# Peaks-
|
|
56
|
+
const CANONICAL_2_0_DEV_PREFERENCE = `# Peaks-Loop dev preference (2.0 canonical)
|
|
57
57
|
|
|
58
58
|
> Project-local preference, captured from the 1.x install + re-rendered with the 2.0 vocabulary.
|
|
59
59
|
> Scope: applies to every iteration, adjustment, fix, or tweak on this project.
|
|
@@ -61,7 +61,7 @@ const CANONICAL_2_0_DEV_PREFERENCE = `# Peaks-Cli dev preference (2.0 canonical)
|
|
|
61
61
|
|
|
62
62
|
## Rule 1 — Skill-first, CLI-auxiliary
|
|
63
63
|
|
|
64
|
-
When designing or modifying a peaks-
|
|
64
|
+
When designing or modifying a peaks-loop feature, default to the **skill-first** design. CLI commands are **invoked by the skill prompt** when they are the right primitive: a side effect that must be atomic, a gate that must be machine-enforced, a probe that needs structured JSON, or a backstop that prevents the LLM from skipping a step. Behaviour only an LLM in a skill prompt would use lives **in the relevant skill's SKILL.md**, not as a new CLI command. See \`.claude/rules/common/dev-preference.md\` for the decision template.
|
|
65
65
|
|
|
66
66
|
## Rule 2 — Dogfood on every adjustment
|
|
67
67
|
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
* 2. required the LLM to invoke `peaks skill heartbeat:touch` and
|
|
9
9
|
* `peaks skill presence:clear` on every turn;
|
|
10
10
|
* 3. ended with an `External reference: https://github.com/affaan-m/...`
|
|
11
|
-
* line that was peaks-
|
|
11
|
+
* line that was peaks-loop-internal, not consumer-facing.
|
|
12
12
|
*
|
|
13
|
-
* The replacement text matches the post-slice-025 peaks-
|
|
13
|
+
* The replacement text matches the post-slice-025 peaks-loop repo's own
|
|
14
14
|
* `CLAUDE.md`: route the LLM through `peaks skill presence --json` and
|
|
15
15
|
* render a compact status header when a valid skill is active. This
|
|
16
16
|
* service is the deterministic in-place rewriter that brings existing
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
* - File missing → `file: null`, no throw.
|
|
28
28
|
* - Legacy block not present → `foundOldBlock: false`, no write.
|
|
29
29
|
*/
|
|
30
|
-
export declare const NEW_TEMPLATE_TEXT = "Active Peaks-
|
|
30
|
+
export declare const NEW_TEMPLATE_TEXT = "Active Peaks-Loop skill presence: at the start of every response, run `peaks skill presence --json` to read the active skill marker. The CLI handles canonical-path resolution (`.peaks/_runtime/active-skill.json` with back-compat fallback to `.peaks/.active-skill.json`); do not read those files directly. When the response includes a valid skill name, display the compact status header: `Peaks-Loop Skill: <skill> | Peaks-Loop Gate: <gate> | Next: <one short action>`. Display the header on every turn while the CLI returns an active skill; omit when the CLI returns no active skill.";
|
|
31
31
|
export type MigrateStandardsInput = {
|
|
32
32
|
project: string;
|
|
33
33
|
apply?: boolean;
|
|
@@ -10,9 +10,9 @@ import { isAbsolute, resolve } from 'node:path';
|
|
|
10
10
|
* 2. required the LLM to invoke `peaks skill heartbeat:touch` and
|
|
11
11
|
* `peaks skill presence:clear` on every turn;
|
|
12
12
|
* 3. ended with an `External reference: https://github.com/affaan-m/...`
|
|
13
|
-
* line that was peaks-
|
|
13
|
+
* line that was peaks-loop-internal, not consumer-facing.
|
|
14
14
|
*
|
|
15
|
-
* The replacement text matches the post-slice-025 peaks-
|
|
15
|
+
* The replacement text matches the post-slice-025 peaks-loop repo's own
|
|
16
16
|
* `CLAUDE.md`: route the LLM through `peaks skill presence --json` and
|
|
17
17
|
* render a compact status header when a valid skill is active. This
|
|
18
18
|
* service is the deterministic in-place rewriter that brings existing
|
|
@@ -29,8 +29,8 @@ import { isAbsolute, resolve } from 'node:path';
|
|
|
29
29
|
* - File missing → `file: null`, no throw.
|
|
30
30
|
* - Legacy block not present → `foundOldBlock: false`, no write.
|
|
31
31
|
*/
|
|
32
|
-
export const NEW_TEMPLATE_TEXT = 'Active Peaks-
|
|
33
|
-
const LEGACY_BLOCK_OPENER_LINE = 'Peaks-
|
|
32
|
+
export const NEW_TEMPLATE_TEXT = 'Active Peaks-Loop skill presence: at the start of every response, run `peaks skill presence --json` to read the active skill marker. The CLI handles canonical-path resolution (`.peaks/_runtime/active-skill.json` with back-compat fallback to `.peaks/.active-skill.json`); do not read those files directly. When the response includes a valid skill name, display the compact status header: `Peaks-Loop Skill: <skill> | Peaks-Loop Gate: <gate> | Next: <one short action>`. Display the header on every turn while the CLI returns an active skill; omit when the CLI returns no active skill.';
|
|
33
|
+
const LEGACY_BLOCK_OPENER_LINE = 'Peaks-Loop 心跳检测 (heartbeat check)';
|
|
34
34
|
const LEGACY_BLOCK_CLOSER = 'External reference: https://github.com/affaan-m/everything-claude-code';
|
|
35
35
|
const LEGACY_MARKER_FALLBACK = 'Do NOT skip step 3-5. The CLI heartbeat:touch command';
|
|
36
36
|
const FORBIDDEN_LEGACY_STRINGS = [
|
|
@@ -152,7 +152,7 @@ export function migrateStandards(input) {
|
|
|
152
152
|
applied: false,
|
|
153
153
|
before: { lines: original.split('\n').length },
|
|
154
154
|
after: null,
|
|
155
|
-
nextActions: ['CLAUDE.md has no peaks-
|
|
155
|
+
nextActions: ['CLAUDE.md has no peaks-loop block; nothing to migrate']
|
|
156
156
|
},
|
|
157
157
|
warnings: []
|
|
158
158
|
};
|
|
@@ -159,7 +159,7 @@ function renderClaudeMd(language, ctx) {
|
|
|
159
159
|
'- Read `.claude/rules/common/security.md` before touching filesystem, user input, external calls, auth, or secrets.',
|
|
160
160
|
`- Read .claude/rules/${language}/coding-style.md for language-specific standards when applicable.`,
|
|
161
161
|
'',
|
|
162
|
-
'Active Peaks-
|
|
162
|
+
'Active Peaks-Loop skill presence: at the start of every response, run `peaks skill presence --json` to read the active skill marker. The CLI handles canonical-path resolution (`.peaks/_runtime/active-skill.json` with back-compat fallback to `.peaks/.active-skill.json`); do not read those files directly. When the response includes a valid skill name, display the compact status header: `Peaks-Loop Skill: <skill> | Peaks-Loop Gate: <gate> | Next: <one short action>`. Display the header on every turn while the CLI returns an active skill; omit when the CLI returns no active skill.'
|
|
163
163
|
].join('\n');
|
|
164
164
|
const stack = renderProjectStackSection(ctx);
|
|
165
165
|
return stack === '' ? head : `${head}\n${stack}`;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The 2.0 canonical ignore block. Mirrors the same paths
|
|
3
|
-
* peaks-
|
|
4
|
-
* (the peaks-
|
|
3
|
+
* peaks-loop's own .gitignore uses; kept in lockstep manually
|
|
4
|
+
* (the peaks-loop root .gitignore is the source of truth).
|
|
5
5
|
*
|
|
6
6
|
* Sentinel: every emitted line carries the marker comment so
|
|
7
7
|
* the migration can detect "already-migrated" and stay
|
|
8
8
|
* idempotent.
|
|
9
9
|
*/
|
|
10
|
-
export declare const PEAKS_2_0_BLOCK_SENTINEL = "# peaks-
|
|
10
|
+
export declare const PEAKS_2_0_BLOCK_SENTINEL = "# peaks-loop 2.0 canonical ignore block \u2014 managed by `peaks upgrade --to 2.0`";
|
|
11
11
|
export declare const CANONICAL_2_0_PEAKS_BLOCK: string;
|
|
12
12
|
/**
|
|
13
13
|
* Returns true when `line` is a wholesale ignore of the entire
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
*
|
|
31
31
|
* Idempotent: re-running on a migrated .gitignore is a no-op.
|
|
32
32
|
*
|
|
33
|
-
* Spec reference: docs/superpowers/specs/2026-06-11-peaks-
|
|
33
|
+
* Spec reference: docs/superpowers/specs/2026-06-11-peaks-loop-l1-l2-l3-redesign.md §8.4
|
|
34
34
|
* (per-project state in .peaks/preferences.json, durable
|
|
35
35
|
* memories in .peaks/memory/*.md).
|
|
36
36
|
*/
|
|
@@ -38,14 +38,14 @@ import { existsSync, readFileSync, writeFileSync } from 'node:fs';
|
|
|
38
38
|
import { join } from 'node:path';
|
|
39
39
|
/**
|
|
40
40
|
* The 2.0 canonical ignore block. Mirrors the same paths
|
|
41
|
-
* peaks-
|
|
42
|
-
* (the peaks-
|
|
41
|
+
* peaks-loop's own .gitignore uses; kept in lockstep manually
|
|
42
|
+
* (the peaks-loop root .gitignore is the source of truth).
|
|
43
43
|
*
|
|
44
44
|
* Sentinel: every emitted line carries the marker comment so
|
|
45
45
|
* the migration can detect "already-migrated" and stay
|
|
46
46
|
* idempotent.
|
|
47
47
|
*/
|
|
48
|
-
export const PEAKS_2_0_BLOCK_SENTINEL = '# peaks-
|
|
48
|
+
export const PEAKS_2_0_BLOCK_SENTINEL = '# peaks-loop 2.0 canonical ignore block — managed by `peaks upgrade --to 2.0`';
|
|
49
49
|
export const CANONICAL_2_0_PEAKS_BLOCK = [
|
|
50
50
|
PEAKS_2_0_BLOCK_SENTINEL,
|
|
51
51
|
'.peaks/_runtime/',
|
|
@@ -2,7 +2,7 @@ export interface UpgradeInput {
|
|
|
2
2
|
readonly projectRoot: string;
|
|
3
3
|
/**
|
|
4
4
|
* When true, the umbrella is being invoked from the
|
|
5
|
-
* `npm i -g peaks-
|
|
5
|
+
* `npm i -g peaks-loop` postinstall. Suppresses the
|
|
6
6
|
* interactive prompts and accepts soft-fail on any
|
|
7
7
|
* sub-step.
|
|
8
8
|
*/
|