peaks-loop 4.0.0-beta → 4.0.0-beta.2
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/CHANGELOG.md +105 -87
- package/README-en.md +1 -1
- package/README.md +1 -1
- package/dist/src/cli/commands/{solo-commands.d.ts → code-commands.d.ts} +24 -24
- package/dist/src/cli/commands/{solo-commands.js → code-commands.js} +78 -78
- package/dist/src/cli/commands/core/skill-command.js +1 -1
- package/dist/src/cli/commands/dispatch-from-dag.js +1 -1
- package/dist/src/cli/commands/hook-handle.js +7 -7
- package/dist/src/cli/commands/job-commands.js +2 -2
- package/dist/src/cli/commands/session-auto-compact-hook-command.js +2 -2
- package/dist/src/cli/commands/sub-agent-shared.d.ts +1 -1
- package/dist/src/cli/commands/user-touchpoint-commands.d.ts +4 -4
- package/dist/src/cli/commands/user-touchpoint-commands.js +14 -14
- package/dist/src/cli/commands/workflow-commands.js +22 -22
- package/dist/src/cli/program.js +6 -6
- package/dist/src/services/artifacts/repair-cycle-service.js +1 -1
- package/dist/src/services/audit/enforcers/active-skill-resolver.d.ts +1 -1
- package/dist/src/services/audit/enforcers/active-skill-resolver.js +1 -1
- package/dist/src/services/audit/enforcers/{solo-code-ban.d.ts → code-ban.d.ts} +6 -6
- package/dist/src/services/audit/enforcers/{solo-code-ban.js → code-ban.js} +6 -6
- package/dist/src/services/audit/red-line-catalog.d.ts +2 -2
- package/dist/src/services/audit/red-line-catalog.js +5 -5
- package/dist/src/services/audit/types.d.ts +2 -2
- package/dist/src/services/{solo → code}/auto-compact-orchestrator.d.ts +1 -1
- package/dist/src/services/{solo → code}/auto-compact-orchestrator.js +3 -3
- package/dist/src/services/{solo → code}/dag-orchestrator.d.ts +1 -1
- package/dist/src/services/{solo → code}/dag-orchestrator.js +1 -1
- package/dist/src/services/{solo → code}/emit-handoff.d.ts +1 -1
- package/dist/src/services/{solo → code}/emit-handoff.js +1 -1
- package/dist/src/services/{solo → code}/job-shape-decision.d.ts +1 -1
- package/dist/src/services/{solo → code}/job-shape-decision.js +5 -5
- package/dist/src/services/{solo → code}/mode-gate.d.ts +9 -9
- package/dist/src/services/{solo → code}/mode-gate.js +5 -5
- package/dist/src/services/{solo → code}/post-compact-detector.d.ts +3 -3
- package/dist/src/services/{solo → code}/post-compact-detector.js +4 -4
- package/dist/src/services/{solo → code}/step-08-gate.d.ts +4 -4
- package/dist/src/services/{solo → code}/step-08-gate.js +4 -4
- package/dist/src/services/{solo → code}/user-touchpoint-classifier.d.ts +1 -1
- package/dist/src/services/{solo → code}/user-touchpoint-classifier.js +1 -1
- package/dist/src/services/context/auto-compact-dispatcher.d.ts +2 -2
- package/dist/src/services/context/auto-compact-dispatcher.js +2 -2
- package/dist/src/services/context/auto-compact-types.d.ts +1 -1
- package/dist/src/services/dispatch/slice-dag.d.ts +2 -2
- 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/feedback/feedback-promotion-service.js +2 -2
- package/dist/src/services/job/job-progress-store.d.ts +1 -1
- package/dist/src/services/job/job-progress-store.js +1 -1
- package/dist/src/services/preferences/preferences-service.d.ts +1 -1
- package/dist/src/services/preferences/preferences-types.d.ts +1 -1
- package/dist/src/services/rd/standards-diagnostic.d.ts +1 -1
- package/dist/src/services/rd/standards-diagnostic.js +2 -2
- package/dist/src/services/recommendations/capability-seed-items.js +1 -1
- package/dist/src/services/recommendations/capability-seed-mappings.js +1 -1
- package/dist/src/services/recommendations/recommendation-service.js +1 -1
- package/dist/src/services/refactor/refactor-service.d.ts +1 -1
- package/dist/src/services/signal/cancel-handler.js +3 -3
- package/dist/src/services/skill/resume-detector.js +1 -1
- package/dist/src/services/skills/skill-presence-service.d.ts +1 -1
- package/dist/src/services/upgrade/1x-detector-service.js +1 -1
- package/dist/src/services/workflow/pipeline-verify-service.d.ts +1 -1
- package/dist/src/services/workflow/pipeline-verify-service.js +3 -3
- package/dist/src/services/workflow/workflow-autonomous-service.d.ts +3 -3
- package/dist/src/services/workflow/workflow-autonomous-service.js +2 -2
- package/dist/src/services/workflow/workflow-router-service.d.ts +6 -6
- package/dist/src/services/workflow/workflow-router-service.js +33 -33
- package/dist/src/services/workspace/claude-settings-template.d.ts +1 -1
- package/dist/src/services/workspace/claude-settings-template.js +5 -5
- package/dist/src/shared/version.d.ts +1 -1
- package/dist/src/shared/version.js +1 -1
- package/output-styles/peaks-skill-swarm.md +3 -3
- package/package.json +1 -1
- package/skills/bee/peaks-qa/SKILL.md +1 -1
- package/skills/bee/peaks-qa/references/artifact-per-request.md +3 -3
- package/skills/bee/peaks-qa/references/qa-sub-agent-dispatch.md +6 -6
- package/skills/bee/peaks-rd/references/rd-fanout-contracts.md +1 -1
- package/skills/bee/peaks-rd/references/rd-runbook.md +1 -1
- package/skills/bee/peaks-rd/references/rd-sub-agent-dispatch.md +11 -11
- package/skills/bee/peaks-rd/references/rd-transition-gates.md +1 -1
- package/skills/bee/peaks-sc/SKILL.md +1 -1
- package/skills/bee/peaks-txt/SKILL.md +3 -3
- package/skills/bee/peaks-ui/SKILL.md +8 -8
- package/skills/peaks-code/SKILL.md +21 -21
- package/skills/peaks-code/references/anchoring-and-session-info.md +2 -2
- package/skills/peaks-code/references/artifact-contracts.md +1 -1
- package/skills/peaks-code/references/boundaries.md +3 -3
- package/skills/peaks-code/references/codegraph-orchestration.md +1 -1
- package/skills/peaks-code/references/dag-orchestrator.md +7 -7
- package/skills/peaks-code/references/external-references.md +2 -2
- package/skills/peaks-code/references/fanout-mandatory.md +3 -3
- package/skills/peaks-code/references/fast-mode.md +2 -2
- package/skills/peaks-code/references/frontend-only-mode.md +9 -9
- package/skills/peaks-code/references/job-loop.md +1 -1
- package/skills/peaks-code/references/local-artifact-workspace.md +2 -2
- package/skills/peaks-code/references/micro-cycle.md +14 -14
- package/skills/peaks-code/references/mode-selection-with-stale-presence.md +5 -5
- package/skills/peaks-code/references/mode-selection.md +3 -3
- package/skills/peaks-code/references/openspec-workflow.md +16 -16
- package/skills/peaks-code/references/periodic-checkpoint.md +4 -4
- package/skills/peaks-code/references/quality-gate-cheatsheet.md +1 -1
- package/skills/peaks-code/references/refactor-mode.md +1 -1
- package/skills/peaks-code/references/runbook.md +15 -15
- package/skills/peaks-code/references/step-0-55-1x-detection.md +1 -1
- package/skills/peaks-code/references/step-0-8-gate.md +11 -11
- package/skills/peaks-code/references/sub-agent-dispatch.md +8 -8
- package/skills/peaks-code/references/swarm-dispatch-contract.md +17 -17
- package/skills/peaks-code/references/workflow-gates-and-types.md +2 -2
- package/skills/peaks-code/references/workflow.md +5 -5
- package/skills/peaks-resume/SKILL.md +2 -2
- package/skills/peaks-status/SKILL.md +2 -2
- package/skills/peaks-test/SKILL.md +2 -2
- /package/dist/src/services/{solo → code}/batch-heartbeat-poller.d.ts +0 -0
- /package/dist/src/services/{solo → code}/batch-heartbeat-poller.js +0 -0
- /package/dist/src/services/{solo → code}/status-line-renderer.d.ts +0 -0
- /package/dist/src/services/{solo → code}/status-line-renderer.js +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { CapabilityItemType } from '../recommendations/recommendation-types.js';
|
|
2
2
|
import type { ModelProviderConfig, WorkspaceConfig } from '../config/config-types.js';
|
|
3
3
|
import { type RdPlanResult } from '../rd/rd-service.js';
|
|
4
|
-
import { type
|
|
4
|
+
import { type CodeMode, type WorkflowMode, type WorkflowRouterPlan } from './workflow-router-service.js';
|
|
5
5
|
export { getResumeRequiredArtifacts, getResumeArtifactsStatus, createResumePlan } from './workflow-autonomous-resume-helpers.js';
|
|
6
6
|
export type CapabilitySurface = 'skill' | 'mcp' | 'plugin' | 'expert';
|
|
7
7
|
export type CapabilityPurpose = 'code-review' | 'security-review' | 'coding-standards' | 'docs-lookup' | 'browser-validation' | 'browser-debug' | 'design-context' | 'design-source' | 'code-search' | 'database-inspection' | 'browser-agent' | 'worker-guidance' | 'memory' | 'context-management' | 'ui-components' | 'spec-workflow' | 'repo-intelligence' | 'openspec' | 'workflow-methodology' | 'workflow-reference' | 'workflow-guidance' | 'product-guidance' | 'design-reference' | 'ui-reference' | 'engineering-guidance' | 'typescript-guidance' | 'quality-guidance' | 'skill-pack' | 'external-skill' | 'design-critique' | 'design-guidance' | 'cloud-skill-pack';
|
|
@@ -20,7 +20,7 @@ export type CapabilityCandidate = {
|
|
|
20
20
|
};
|
|
21
21
|
export type AutonomousWorkflowRequest = {
|
|
22
22
|
readonly mode: WorkflowMode;
|
|
23
|
-
readonly
|
|
23
|
+
readonly codeMode?: CodeMode;
|
|
24
24
|
readonly sessionId: string;
|
|
25
25
|
readonly goal: string;
|
|
26
26
|
readonly maxWorkers?: number;
|
|
@@ -68,7 +68,7 @@ export type AutonomousStoragePlan = {
|
|
|
68
68
|
};
|
|
69
69
|
export type AutonomousMvpPackage = {
|
|
70
70
|
readonly mode: WorkflowMode;
|
|
71
|
-
readonly
|
|
71
|
+
readonly codeMode: CodeMode | undefined;
|
|
72
72
|
readonly executionMode: 'preview';
|
|
73
73
|
readonly dryRun: true;
|
|
74
74
|
readonly routePolicy: WorkflowRouterPlan['routePolicy'];
|
|
@@ -205,7 +205,7 @@ function createCapabilityPlan(request) {
|
|
|
205
205
|
function createMvpPackage(request, routePlan, rdPlan, capabilityPlan, ready) {
|
|
206
206
|
return {
|
|
207
207
|
mode: request.mode,
|
|
208
|
-
|
|
208
|
+
codeMode: routePlan.codeMode,
|
|
209
209
|
executionMode: 'preview',
|
|
210
210
|
dryRun: true,
|
|
211
211
|
routePolicy: routePlan.routePolicy,
|
|
@@ -240,7 +240,7 @@ export function createAutonomousWorkflowPlan(request) {
|
|
|
240
240
|
const available = hasArtifactWorkspace(request, artifactWorkspacePath);
|
|
241
241
|
const routePlan = createWorkflowRouterPlan({
|
|
242
242
|
mode: request.mode,
|
|
243
|
-
...(request.
|
|
243
|
+
...(request.codeMode !== undefined ? { codeMode: request.codeMode } : {}),
|
|
244
244
|
sessionId: request.sessionId,
|
|
245
245
|
goal,
|
|
246
246
|
maxWorkers,
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { type ModelProviderConfig, type WorkspaceConfig } from '../config/config-types.js';
|
|
2
2
|
import { type RdPlanResult } from '../rd/rd-service.js';
|
|
3
3
|
import { type TechPlanResult, type TechStatus } from '../tech/tech-service.js';
|
|
4
|
-
export type WorkflowMode = '
|
|
5
|
-
export type
|
|
4
|
+
export type WorkflowMode = 'code' | 'team';
|
|
5
|
+
export type CodeMode = 'full-auto' | 'guided' | 'rnd';
|
|
6
6
|
export type ModelTier = 'top-tier' | 'mid-tier';
|
|
7
7
|
export type ModelRole = 'strongest' | 'execution';
|
|
8
|
-
export type WorkflowRoutePolicy = '
|
|
8
|
+
export type WorkflowRoutePolicy = 'code-broad-multi-model' | 'team-rd-limited-multi-model';
|
|
9
9
|
export type WorkflowStepStage = 'product-direction' | 'design-direction' | 'tech-direction' | 'tech-review' | 'rd-planning' | 'coding-execution' | 'unit-test-execution' | 'quality-review';
|
|
10
10
|
export type WorkflowStepOwner = 'peaks-code' | 'peaks-rd' | 'peaks-tech' | 'human';
|
|
11
11
|
export type WorkflowRouterRequest = {
|
|
12
12
|
sessionId: string;
|
|
13
13
|
goal: string;
|
|
14
14
|
mode: WorkflowMode;
|
|
15
|
-
|
|
15
|
+
codeMode?: CodeMode;
|
|
16
16
|
maxWorkers?: number;
|
|
17
17
|
dryRun: true;
|
|
18
18
|
artifactWorkspacePath?: string;
|
|
@@ -64,7 +64,7 @@ export type WorkflowRouterPlan = {
|
|
|
64
64
|
readonly sessionId: string;
|
|
65
65
|
readonly goal: string;
|
|
66
66
|
readonly mode: WorkflowMode;
|
|
67
|
-
readonly
|
|
67
|
+
readonly codeMode?: CodeMode;
|
|
68
68
|
readonly executionMode: 'autonomous';
|
|
69
69
|
readonly decisionProfile: string;
|
|
70
70
|
readonly dryRun: true;
|
|
@@ -81,5 +81,5 @@ export type WorkflowRouterPlan = {
|
|
|
81
81
|
readonly constraints: readonly string[];
|
|
82
82
|
};
|
|
83
83
|
export declare function isWorkflowMode(mode: string): mode is WorkflowMode;
|
|
84
|
-
export declare function
|
|
84
|
+
export declare function isCodeMode(value: string): value is CodeMode;
|
|
85
85
|
export declare function createWorkflowRouterPlan(request: WorkflowRouterRequest): WorkflowRouterPlan;
|
|
@@ -18,7 +18,7 @@ const EXECUTION_STAGES = ['coding-execution', 'unit-test-execution'];
|
|
|
18
18
|
const GUIDED_DECISION_STAGES = ['product-direction', 'design-direction'];
|
|
19
19
|
const GOVERNED_DECISION_STAGES = ['product-direction', 'design-direction', 'tech-direction', 'tech-review'];
|
|
20
20
|
export function isWorkflowMode(mode) {
|
|
21
|
-
return mode === '
|
|
21
|
+
return mode === 'code' || mode === 'team';
|
|
22
22
|
}
|
|
23
23
|
function assertSupportedMode(mode) {
|
|
24
24
|
if (!isWorkflowMode(mode)) {
|
|
@@ -32,9 +32,9 @@ function normalizeGoal(goal) {
|
|
|
32
32
|
}
|
|
33
33
|
return normalized;
|
|
34
34
|
}
|
|
35
|
-
function
|
|
36
|
-
if (mode !== '
|
|
37
|
-
throw new Error('
|
|
35
|
+
function assertCodeModeAllowed(mode, codeMode) {
|
|
36
|
+
if (mode !== 'code' && codeMode !== undefined) {
|
|
37
|
+
throw new Error('codeMode requires code workflow mode');
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
function step(input, executionModelId) {
|
|
@@ -48,29 +48,29 @@ function step(input, executionModelId) {
|
|
|
48
48
|
writesArtifacts: false
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
|
-
export function
|
|
51
|
+
export function isCodeMode(value) {
|
|
52
52
|
return value === 'full-auto' || value === 'guided' || value === 'rnd';
|
|
53
53
|
}
|
|
54
|
-
function getDecisionProfileSummary(mode,
|
|
54
|
+
function getDecisionProfileSummary(mode, codeMode) {
|
|
55
55
|
if (mode === 'team') {
|
|
56
56
|
return 'Team mode keeps product and design governance on a human-controlled path while RD execution follows recommended defaults.';
|
|
57
57
|
}
|
|
58
|
-
if (
|
|
58
|
+
if (codeMode === 'guided') {
|
|
59
59
|
return 'Guided mode keeps the user in the decision loop for the early recommended defaults, while later execution remains bounded by the routing plan.';
|
|
60
60
|
}
|
|
61
|
-
if (
|
|
61
|
+
if (codeMode === 'rnd') {
|
|
62
62
|
return 'R&D mode asks for technical confirmation up front, then applies recommended defaults for implementation, testing, review, and safety checks.';
|
|
63
63
|
}
|
|
64
64
|
return 'Full-auto mode applies recommended defaults for product, design, and tech decisions, then runs the engineering pipeline end to end under routing gates.';
|
|
65
65
|
}
|
|
66
|
-
function annotateSteps(steps,
|
|
67
|
-
const decisionStages =
|
|
66
|
+
function annotateSteps(steps, codeMode) {
|
|
67
|
+
const decisionStages = codeMode === 'guided'
|
|
68
68
|
? GUIDED_DECISION_STAGES
|
|
69
69
|
: GOVERNED_DECISION_STAGES;
|
|
70
70
|
return steps.map((currentStep) => {
|
|
71
71
|
const isDecisionStage = decisionStages.includes(currentStep.stage);
|
|
72
72
|
const reasonPrefix = isDecisionStage
|
|
73
|
-
? `[${
|
|
73
|
+
? `[${codeMode}] decision stage`
|
|
74
74
|
: '[routed] execution stage';
|
|
75
75
|
return {
|
|
76
76
|
...currentStep,
|
|
@@ -80,18 +80,18 @@ function annotateSteps(steps, soloMode) {
|
|
|
80
80
|
}
|
|
81
81
|
function createSoloSteps(executionModelId) {
|
|
82
82
|
return [
|
|
83
|
-
step({ id: '
|
|
84
|
-
step({ id: '
|
|
85
|
-
step({ id: '
|
|
86
|
-
step({ id: '
|
|
87
|
-
step({ id: '
|
|
88
|
-
step({ id: '
|
|
89
|
-
step({ id: '
|
|
90
|
-
step({ id: '
|
|
83
|
+
step({ id: 'code-product-direction', stage: 'product-direction', owner: 'peaks-code', modelTier: 'top-tier', reason: 'Product direction needs strong judgment before execution work is delegated.', dependsOn: [] }, executionModelId),
|
|
84
|
+
step({ id: 'code-design-direction', stage: 'design-direction', owner: 'peaks-code', modelTier: 'top-tier', reason: 'Design direction uses the recommended default before cheaper implementation work.', dependsOn: ['code-product-direction'] }, executionModelId),
|
|
85
|
+
step({ id: 'code-tech-direction', stage: 'tech-direction', owner: 'peaks-tech', modelTier: 'top-tier', reason: 'Technical boundaries and approval gates use the recommended default with high-confidence planning.', dependsOn: ['code-design-direction'] }, executionModelId),
|
|
86
|
+
step({ id: 'code-tech-review', stage: 'tech-review', owner: 'peaks-tech', modelTier: 'top-tier', reason: 'Tech artifacts and gate decisions require strong review and a recommended default path.', dependsOn: ['code-tech-direction'] }, executionModelId),
|
|
87
|
+
step({ id: 'code-rd-planning', stage: 'rd-planning', owner: 'peaks-rd', modelTier: 'top-tier', reason: 'RD task decomposition and acceptance criteria use the recommended default before execution delegation.', dependsOn: ['code-tech-review'] }, executionModelId),
|
|
88
|
+
step({ id: 'code-coding-execution', stage: 'coding-execution', owner: 'peaks-rd', modelTier: executionModelId === STRONGEST_MODEL_ID ? 'top-tier' : 'mid-tier', reason: `Coding and routine refactoring must use the configured execution worker model ${executionModelId}.`, dependsOn: ['code-rd-planning'] }, executionModelId),
|
|
89
|
+
step({ id: 'code-unit-test-execution', stage: 'unit-test-execution', owner: 'peaks-rd', modelTier: executionModelId === STRONGEST_MODEL_ID ? 'top-tier' : 'mid-tier', reason: `Unit test authoring and focused test runs must use the configured execution worker model ${executionModelId}.`, dependsOn: ['code-coding-execution'] }, executionModelId),
|
|
90
|
+
step({ id: 'code-quality-review', stage: 'quality-review', owner: 'peaks-code', modelTier: 'top-tier', reason: 'Reducer and final quality gates need strong synthesis and risk review.', dependsOn: ['code-unit-test-execution'] }, executionModelId)
|
|
91
91
|
];
|
|
92
92
|
}
|
|
93
|
-
function createSoloStepsForMode(
|
|
94
|
-
return annotateSteps(createSoloSteps(executionModelId),
|
|
93
|
+
function createSoloStepsForMode(codeMode, executionModelId) {
|
|
94
|
+
return annotateSteps(createSoloSteps(executionModelId), codeMode);
|
|
95
95
|
}
|
|
96
96
|
function createTeamSteps(executionModelId) {
|
|
97
97
|
return [
|
|
@@ -150,21 +150,21 @@ function createModeStatus(economyMode, swarmMode, executionModelId, executionMod
|
|
|
150
150
|
summary: `${economySummary} ${swarmSummary}`
|
|
151
151
|
};
|
|
152
152
|
}
|
|
153
|
-
function
|
|
154
|
-
if (mode !== '
|
|
153
|
+
function getCodeMode(mode, codeMode) {
|
|
154
|
+
if (mode !== 'code') {
|
|
155
155
|
return undefined;
|
|
156
156
|
}
|
|
157
|
-
if (
|
|
157
|
+
if (codeMode === undefined) {
|
|
158
158
|
return 'full-auto';
|
|
159
159
|
}
|
|
160
|
-
if (!
|
|
161
|
-
throw new Error('Unsupported
|
|
160
|
+
if (!isCodeMode(codeMode)) {
|
|
161
|
+
throw new Error('Unsupported code mode');
|
|
162
162
|
}
|
|
163
|
-
return
|
|
163
|
+
return codeMode;
|
|
164
164
|
}
|
|
165
165
|
export function createWorkflowRouterPlan(request) {
|
|
166
166
|
assertSupportedMode(request.mode);
|
|
167
|
-
|
|
167
|
+
assertCodeModeAllowed(request.mode, request.codeMode);
|
|
168
168
|
// Slice 2026-06-29-change-id-root-removal: change-id is metadata-only;
|
|
169
169
|
// no structural validation gate fires here.
|
|
170
170
|
const goal = normalizeGoal(request.goal);
|
|
@@ -185,8 +185,8 @@ export function createWorkflowRouterPlan(request) {
|
|
|
185
185
|
const effectiveProviders = request.config?.providers ?? { minimax: { model: 'minimax-2.7' } };
|
|
186
186
|
const executionModelId = economyMode !== false ? getConfiguredExecutionModelId(effectiveProviders) : STRONGEST_MODEL_ID;
|
|
187
187
|
const modeStatus = createModeStatus(economyMode, swarmMode, executionModelId, economyMode ? 'config.providers' : 'planner-reviewer-strongest-model');
|
|
188
|
-
const
|
|
189
|
-
const decisionProfile = getDecisionProfileSummary(request.mode,
|
|
188
|
+
const codeMode = getCodeMode(request.mode, request.codeMode);
|
|
189
|
+
const decisionProfile = getDecisionProfileSummary(request.mode, codeMode);
|
|
190
190
|
const artifactWorkspacePath = request.artifactWorkspacePath ?? (request.workspace ? getLocalArtifactPath(request.workspace) : undefined);
|
|
191
191
|
const sharedWorkspaceOptions = {
|
|
192
192
|
...(artifactWorkspacePath ? { artifactWorkspacePath } : {}),
|
|
@@ -195,7 +195,7 @@ export function createWorkflowRouterPlan(request) {
|
|
|
195
195
|
const techStatus = getTechStatus({ sessionId: request.sessionId, ...sharedWorkspaceOptions });
|
|
196
196
|
const techPlan = createTechPlan({ sessionId: request.sessionId, goal, swarm: swarmMode, dryRun: true, ...sharedWorkspaceOptions });
|
|
197
197
|
const rdPlan = createRdSwarmPlan({ skill: 'rd', sessionId: request.sessionId, goal, maxWorkers, swarmMode, executionModelId, dryRun: true, ...sharedWorkspaceOptions });
|
|
198
|
-
const steps =
|
|
198
|
+
const steps = codeMode ? createSoloStepsForMode(codeMode, executionModelId) : createTeamSteps(executionModelId);
|
|
199
199
|
const blockedReasons = uniqueStrings([
|
|
200
200
|
...techStatus.blockedReasons,
|
|
201
201
|
...getTechPlanBlockedReasons(techPlan),
|
|
@@ -208,11 +208,11 @@ export function createWorkflowRouterPlan(request) {
|
|
|
208
208
|
sessionId: request.sessionId,
|
|
209
209
|
goal,
|
|
210
210
|
mode: request.mode,
|
|
211
|
-
...(
|
|
211
|
+
...(codeMode ? { codeMode } : {}),
|
|
212
212
|
executionMode: 'autonomous',
|
|
213
213
|
decisionProfile,
|
|
214
214
|
dryRun: true,
|
|
215
|
-
routePolicy: request.mode === '
|
|
215
|
+
routePolicy: request.mode === 'code' ? 'code-broad-multi-model' : 'team-rd-limited-multi-model',
|
|
216
216
|
modelRouting: createModelRouting(steps, executionModelId),
|
|
217
217
|
modelAssignments: createModelAssignments(steps),
|
|
218
218
|
modeStatus,
|
|
@@ -51,7 +51,7 @@ export declare const CLAUDE_SETTINGS_LOCAL_FILENAME = ".claude/settings.local.js
|
|
|
51
51
|
* bypass is the only emit. Bash enforcement is owned by
|
|
52
52
|
* `peaks gate enforce` in `settings.json`.
|
|
53
53
|
* 1.3.0 — added the v3.1.2 `Bash` PreToolUse matcher that runs
|
|
54
|
-
* `peaks
|
|
54
|
+
* `peaks code gate-step-08 --project .` (Step 0.8 mechanical
|
|
55
55
|
* gate). The existing Write|Edit|MultiEdit matcher is
|
|
56
56
|
* preserved. The new matcher's exit code is the load-bearing
|
|
57
57
|
* signal: 0 = allow, 2 = block (with stderr BLOCKED reason).
|
|
@@ -51,7 +51,7 @@ export const CLAUDE_SETTINGS_LOCAL_FILENAME = '.claude/settings.local.json';
|
|
|
51
51
|
* bypass is the only emit. Bash enforcement is owned by
|
|
52
52
|
* `peaks gate enforce` in `settings.json`.
|
|
53
53
|
* 1.3.0 — added the v3.1.2 `Bash` PreToolUse matcher that runs
|
|
54
|
-
* `peaks
|
|
54
|
+
* `peaks code gate-step-08 --project .` (Step 0.8 mechanical
|
|
55
55
|
* gate). The existing Write|Edit|MultiEdit matcher is
|
|
56
56
|
* preserved. The new matcher's exit code is the load-bearing
|
|
57
57
|
* signal: 0 = allow, 2 = block (with stderr BLOCKED reason).
|
|
@@ -216,7 +216,7 @@ export function buildClaudeSettingsLocalJson() {
|
|
|
216
216
|
},
|
|
217
217
|
{
|
|
218
218
|
// v3.1.2 Step 0.8 — Mechanical PreToolUse gate. Runs
|
|
219
|
-
// `peaks
|
|
219
|
+
// `peaks code gate-step-08 --project .` before every Bash
|
|
220
220
|
// tool call. Exit 0 = allow (with structured stdout
|
|
221
221
|
// describing the decision + optional `Next: slice #N+1 of
|
|
222
222
|
// M (<currentSlice>)` line when progress.json exists). Exit
|
|
@@ -235,7 +235,7 @@ export function buildClaudeSettingsLocalJson() {
|
|
|
235
235
|
};
|
|
236
236
|
}
|
|
237
237
|
/**
|
|
238
|
-
* v3.1.2: build the Bash matcher command that runs `peaks
|
|
238
|
+
* v3.1.2: build the Bash matcher command that runs `peaks code
|
|
239
239
|
* gate-step-08`. We invoke the CLI directly (not via `node -e "..."`)
|
|
240
240
|
* because the CLI is the only legitimate source of the structured
|
|
241
241
|
* decision + Next: slice context. Exit code is the load-bearing
|
|
@@ -246,9 +246,9 @@ export function buildClaudeSettingsLocalJson() {
|
|
|
246
246
|
*/
|
|
247
247
|
function buildBashGateStep08Command() {
|
|
248
248
|
// The hook receives the tool call on stdin. We ignore stdin and
|
|
249
|
-
// delegate entirely to `peaks
|
|
249
|
+
// delegate entirely to `peaks code gate-step-08`, which reads
|
|
250
250
|
// .peaks/_runtime/<sessionId>/job-shape.json and last-prompt.txt.
|
|
251
251
|
// `${CLAUDE_PROJECT_DIR}` resolves to the consumer project's root
|
|
252
252
|
// (Claude Code's standard convention).
|
|
253
|
-
return 'peaks
|
|
253
|
+
return 'peaks code gate-step-08 --project "${CLAUDE_PROJECT_DIR}"';
|
|
254
254
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const CLI_VERSION = "4.0.0-beta";
|
|
1
|
+
export declare const CLI_VERSION = "4.0.0-beta.2";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const CLI_VERSION = "4.0.0-beta";
|
|
1
|
+
export const CLI_VERSION = "4.0.0-beta.2";
|
|
@@ -4,7 +4,7 @@ description: Peaks 专用输出风格:仅在 peaks skills 工作流中用东
|
|
|
4
4
|
keep-coding-instructions: true
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
This output style is self-gated. Apply the sections below only when the current task explicitly invokes or continues a Peaks-Loop skill workflow, including `/peaks-*`, `skills/peaks-*`, Peaks-Loop PRD/RD/QA/UI/SC/TXT/
|
|
7
|
+
This output style is self-gated. Apply the sections below only when the current task explicitly invokes or continues a Peaks-Loop skill workflow, including `/peaks-*`, `skills/peaks-*`, Peaks-Loop PRD/RD/QA/UI/SC/TXT/Code work, or edits to this repository's `skills/` directory. For unrelated tasks, preserve the default Claude Code behavior and keep responses concise.
|
|
8
8
|
|
|
9
9
|
## Peaks-Loop response contract
|
|
10
10
|
|
|
@@ -14,7 +14,7 @@ When active, make the skill transition visually obvious with a light Northeaster
|
|
|
14
14
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
15
15
|
Peaks-Loop Skill Active: <skill-name> — 整活开工,但不整虚的
|
|
16
16
|
Peaks-Loop Role Chain: <PRD → RD → QA → SC, or single role>
|
|
17
|
-
Peaks-Loop Mode: <
|
|
17
|
+
Peaks-Loop Mode: <Code | Assisted | Swarm | Strict | Economy>
|
|
18
18
|
Peaks-Loop Current Gate: <confirmation | dry-run | coverage | QA | commit boundary | handoff>
|
|
19
19
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
20
20
|
```
|
|
@@ -54,7 +54,7 @@ Peaks-Loop Skill: <skill-name> | Peaks-Loop Gate: <current gate> | Next: <one sh
|
|
|
54
54
|
Structure active Peaks-Loop responses around:
|
|
55
55
|
|
|
56
56
|
1. **Peaks-Loop Role** — name the active Peaks-Loop role or role chain, for example PRD → RD → QA → SC.
|
|
57
|
-
2. **Peaks-Loop Mode** — state whether the workflow is
|
|
57
|
+
2. **Peaks-Loop Mode** — state whether the workflow is Code, Assisted, Swarm, Strict, or Economy.
|
|
58
58
|
3. **Peaks-Loop Current Gate** — show the current required gate: product confirmation, RD dry-run, coverage, QA acceptance, commit boundary, or handoff.
|
|
59
59
|
4. **Action** — describe the immediate next action in one short sentence before tool use.
|
|
60
60
|
5. **Peaks-Loop Evidence** — end with only the evidence that matters: commands, artifacts, changed files, blockers, and next action.
|
package/package.json
CHANGED
|
@@ -56,7 +56,7 @@ The canonical scope dir for this request is provided as `envelope.data.scopeDir`
|
|
|
56
56
|
|
|
57
57
|
## Sub-agent dispatch (when launched by peaks-code swarm)
|
|
58
58
|
|
|
59
|
-
When this skill is launched as a sub-agent via `peaks sub-agent dispatch <role>` (then the LLM executes the returned toolCall) from `peaks-code`, the following sections of THIS skill are **suspended** for the sub-agent run: Session id, Skill presence, Workspace initialization, Mode selection, Statusline install. The sub-agent must NOT call `peaks request init` (
|
|
59
|
+
When this skill is launched as a sub-agent via `peaks sub-agent dispatch <role>` (then the LLM executes the returned toolCall) from `peaks-code`, the following sections of THIS skill are **suspended** for the sub-agent run: Session id, Skill presence, Workspace initialization, Mode selection, Statusline install. The sub-agent must NOT call `peaks request init` (Code already initialised the slot), and must write `.peaks/_runtime/<sessionId>/qa/test-cases/<rid>.md` with test cases that link to PRD acceptance items. Return only a compact JSON envelope.
|
|
60
60
|
|
|
61
61
|
> **v2.15.0+ 校准:** 每个 slice 完成,user 必介入做**业务审阅**(4-5 项业务/产品清单:业务流程 / 需求覆盖 / 边界 case / UI 装配 / 能合入下版吗),**不是技术审阅**。业务审过 → 进 final;业务不通过 → 返工。详见 `.peaks/memory/peaks-loop-slice-review-and-qa-perspective.md`。
|
|
62
62
|
|
|
@@ -9,12 +9,12 @@ The three files for any QA invocation land under the active session's `qa/` work
|
|
|
9
9
|
| # | File | Path | Reader | Content |
|
|
10
10
|
|---|------|------|--------|---------|
|
|
11
11
|
| 1 | Test cases | `.peaks/_runtime/<session-id>/qa/test-cases/<request-id>.md` | RD (before impl), QA | Generated test scenarios with status |
|
|
12
|
-
| 2 | Test report | `.peaks/_runtime/<session-id>/qa/test-reports/<request-id>.md` | QA, SC,
|
|
13
|
-
| 3 | Request artifact | `.peaks/_runtime/<session-id>/qa/requests/<request-id>.md` |
|
|
12
|
+
| 2 | Test report | `.peaks/_runtime/<session-id>/qa/test-reports/<request-id>.md` | QA, SC, Code | Summary, coverage%, security, perf, risks |
|
|
13
|
+
| 3 | Request artifact | `.peaks/_runtime/<session-id>/qa/requests/<request-id>.md` | Code, RD↔QA loop | Verdict, boundary check, links to #1 and #2 |
|
|
14
14
|
|
|
15
15
|
## Required content
|
|
16
16
|
|
|
17
|
-
The request artifact is the **verdict carrier** — it must include: QA verdict (`pass` / `return-to-rd` / `blocked`), the red-line audit outcome, links to the test-cases and test-report, the boundary check (acceptance items covered, gaps), and any cross-skill handoff notes for
|
|
17
|
+
The request artifact is the **verdict carrier** — it must include: QA verdict (`pass` / `return-to-rd` / `blocked`), the red-line audit outcome, links to the test-cases and test-report, the boundary check (acceptance items covered, gaps), and any cross-skill handoff notes for Code. The test cases file enumerates every scenario with status; the test report summarises execution and links the security / performance / regression companion files.
|
|
18
18
|
|
|
19
19
|
## Rules
|
|
20
20
|
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
> Body of `## Sub-agent dispatch`. When this skill is launched as a sub-agent via `peaks sub-agent dispatch <role>` (then the LLM executes the returned toolCall) from `peaks-code`, the following sections of THIS skill are **suspended** for the sub-agent run:
|
|
4
4
|
|
|
5
5
|
- **Session id** — use the parent's sid (read `.peaks/_runtime/session.json` or pass `--session-id <parent-sid>` to any session-creating CLI). Do NOT spawn your own session. The new `peaks session info --active` reads the canonical binding for you.
|
|
6
|
-
- **Skill presence (MANDATORY first action)** — do NOT call `peaks skill presence:set peaks-qa`. The sub-agent must not overwrite `.peaks/.active-skill.json`; the main
|
|
7
|
-
- **Workspace initialization** —
|
|
8
|
-
- **Mode selection** —
|
|
9
|
-
- **Statusline install** — already done by
|
|
6
|
+
- **Skill presence (MANDATORY first action)** — do NOT call `peaks skill presence:set peaks-qa`. The sub-agent must not overwrite `.peaks/.active-skill.json`; the main Code loop owns that file. If you need to mark your own state, write a marker file at `.peaks/_runtime/<sessionId>/system/sub-agent-qa.json` and only that.
|
|
7
|
+
- **Workspace initialization** — Code has already run `peaks workspace init` before fan-out. Do not re-run it.
|
|
8
|
+
- **Mode selection** — Code has already chosen the mode.
|
|
9
|
+
- **Statusline install** — already done by Code at session startup.
|
|
10
10
|
|
|
11
11
|
What the sub-agent **MUST** still do:
|
|
12
12
|
|
|
13
|
-
0. **Do NOT call `peaks request init`** —
|
|
13
|
+
0. **Do NOT call `peaks request init`** — Code has already initialised the request artefact slot in the main loop before fan-out. The sub-agent reads it via `peaks request show <rid> --role qa --project <repo> --json` if it needs to.
|
|
14
14
|
2. `peaks request show <rid> --role prd --project <repo> --json` (and `--role rd`, `--role ui` if UI is in the swarm plan).
|
|
15
15
|
3. Standards preflight (dry-run only).
|
|
16
16
|
4. Write `.peaks/_runtime/<sessionId>/qa/test-cases/<rid>.md` with test cases that link to PRD acceptance items.
|
|
@@ -30,7 +30,7 @@ What the sub-agent **MUST** still do:
|
|
|
30
30
|
**Hard prohibitions** (sub-agent context):
|
|
31
31
|
|
|
32
32
|
- Do NOT call `Skill(skill="...")`.
|
|
33
|
-
- Do NOT call `peaks skill presence:set` —
|
|
33
|
+
- Do NOT call `peaks skill presence:set` — Code owns the active-skill file.
|
|
34
34
|
- Do NOT run the actual test suite, do NOT execute security/perf tools, do NOT open a browser — those are the **QA validation** phase, not the Swarm planning phase.
|
|
35
35
|
- Do NOT commit, push, install hooks, or apply settings.json mutations.
|
|
36
36
|
- Do NOT ask the user interactive questions. If you need clarification, return `{"status":"blocked","blockedReason":"<text>"}`.
|
|
@@ -73,7 +73,7 @@ end of implementation, RD fires 3 sub-agents in parallel via
|
|
|
73
73
|
conversation context. They MUST NOT mutate parent settings
|
|
74
74
|
(`peaks skill presence:set`, hooks install, `.claude/settings.json`).
|
|
75
75
|
- Sub-agents MUST NOT call `peaks workflow verify-pipeline` — that is
|
|
76
|
-
|
|
76
|
+
Code's responsibility.
|
|
77
77
|
- Sub-agents MUST NOT modify the request artifact body — they only
|
|
78
78
|
write their respective review artifact.
|
|
79
79
|
- Sub-agents MUST NOT install or persist external material (no
|
|
@@ -28,7 +28,7 @@ peaks understand show --project <repo> --json # when UA artifac
|
|
|
28
28
|
peaks codegraph context --project <repo> "<task>"
|
|
29
29
|
peaks codegraph affected --project <repo> <changed-files...> --json
|
|
30
30
|
|
|
31
|
-
# 4.1 read project-scan from
|
|
31
|
+
# 4.1 read project-scan from Code's pre-RD scan — BLOCKING if missing
|
|
32
32
|
# **STOP if .peaks/_runtime/<sessionId>/rd/project-scan.md does not exist.**
|
|
33
33
|
# **Do not write any code, do not plan any implementation, do not pass go.**
|
|
34
34
|
# **Create the project-scan first, then proceed.**
|
|
@@ -37,21 +37,21 @@
|
|
|
37
37
|
> design — if either changes, update the other.
|
|
38
38
|
|
|
39
39
|
- **Session id** — use the parent's sid (read `.peaks/_runtime/session.json` or pass `--session-id <parent-sid>` to any session-creating CLI). Do NOT spawn your own session. The new `peaks session info --active` reads the canonical binding for you.
|
|
40
|
-
- **Skill presence (MANDATORY first action)** — do NOT call `peaks skill presence:set peaks-rd`. The sub-agent must not overwrite `.peaks/.active-skill.json`; the main
|
|
41
|
-
- **Workspace initialization** —
|
|
42
|
-
- **Mode selection** —
|
|
43
|
-
- **Statusline install** — already done by
|
|
40
|
+
- **Skill presence (MANDATORY first action)** — do NOT call `peaks skill presence:set peaks-rd`. The sub-agent must not overwrite `.peaks/.active-skill.json`; the main Code loop owns that file. If you need to mark your own state, write a marker file at `.peaks/_runtime/<sessionId>/system/sub-agent-rd.json` and only that.
|
|
41
|
+
- **Workspace initialization** — Code has already run `peaks workspace init` before fan-out. Do not re-run it.
|
|
42
|
+
- **Mode selection** — Code has already chosen the mode. Read it from the prompt arguments (or from `.peaks/.active-skill.json` if you can, but do not write it).
|
|
43
|
+
- **Statusline install** — already done by Code at session startup; do not re-run.
|
|
44
44
|
|
|
45
45
|
What the sub-agent **MUST** still do, from this skill's contract:
|
|
46
46
|
|
|
47
|
-
0. **Do NOT call `peaks request init`** —
|
|
47
|
+
0. **Do NOT call `peaks request init`** — Code has already initialised the request artefact slot in the main loop before fan-out (the runbook has the exact `peaks request init --role rd --id <rid> --project <repo> --apply --type <type> --json` call). The sub-agent reads the slot via `peaks request show <rid> --role rd --project <repo> --json` if it needs to. Note: `peaks request init` is **dry-run by default**. Pass `--apply` to actually create the artifact.
|
|
48
48
|
2. `peaks request show <rid> --role prd --project <repo> --json` (and `--role ui` if UI is in the swarm plan).
|
|
49
|
-
3. Standards preflight (dry-run only;
|
|
50
|
-
4. Project-scan read; create `rd/project-scan.md` only if
|
|
49
|
+
3. Standards preflight (dry-run only; Code owns the apply step).
|
|
50
|
+
4. Project-scan read; create `rd/project-scan.md` only if Code flagged it missing in the dispatch prompt.
|
|
51
51
|
5. Write the planning artefact: `rd/requests/<rid>.md` (feature/refactor, per the `artifact-per-request.md` contract) or `rd/bug-analysis.md` (bugfix). If `--type` is `config|docs|chore`, **no planning artefact is required** — return immediately with `{"role":"rd-planning","status":"skipped","reason":"type=<type>"}`.
|
|
52
52
|
|
|
53
53
|
> **v2.11.0 change (Group A):** `rd/tech-doc.md` is removed. The per-slice planning record is the per-request artefact at `rd/requests/<rid>.md`; the slice's source-of-truth architecture is the immutable peaks-prd handoff at `prd/handoff.md` (verify handoff hash = `<dispatched value>` before reading).
|
|
54
|
-
6. Return only a compact JSON envelope —
|
|
54
|
+
6. Return only a compact JSON envelope — Code will run the convergence gate (`ls` checks):
|
|
55
55
|
|
|
56
56
|
```json
|
|
57
57
|
{
|
|
@@ -67,12 +67,12 @@ What the sub-agent **MUST** still do, from this skill's contract:
|
|
|
67
67
|
**Hard prohibitions** (sub-agent context, in addition to general red lines):
|
|
68
68
|
|
|
69
69
|
- Do NOT call `Skill(skill="...")` from inside the sub-agent — that defeats the fan-out.
|
|
70
|
-
- Do NOT call `peaks skill presence:set` —
|
|
70
|
+
- Do NOT call `peaks skill presence:set` — Code owns the active-skill file.
|
|
71
71
|
- Do NOT commit, push, install hooks, or apply settings.json mutations.
|
|
72
|
-
- Do NOT ask the user interactive questions. If you need clarification, return `{"status":"blocked","blockedReason":"<text>"}` and let
|
|
72
|
+
- Do NOT ask the user interactive questions. If you need clarification, return `{"status":"blocked","blockedReason":"<text>"}` and let Code handle the user message.
|
|
73
73
|
- Do NOT modify code (the Swarm phase is planning only; code edits happen in the RD implementation phase, which is a separate sub-agent or inline run after Gate B).
|
|
74
74
|
|
|
75
|
-
After returning,
|
|
75
|
+
After returning, Code re-checks Gate B (`ls .peaks/_runtime/<sessionId>/rd/requests/<rid>.md` etc.) and proceeds to RD implementation, which is a different sub-agent or inline run.
|
|
76
76
|
|
|
77
77
|
## Test Tool Detection (mandatory)
|
|
78
78
|
|
|
@@ -104,7 +104,7 @@ peaks scan request-type-sanity --project <repo> --type <type> --json
|
|
|
104
104
|
peaks request repair-status <rid> --project <repo> --session-id <session-id> --json
|
|
105
105
|
# Expected: atCap=false. exit 0.
|
|
106
106
|
# atCap=true → BLOCKED. Three repair cycles already attempted; emit a blocked TXT
|
|
107
|
-
# handoff via
|
|
107
|
+
# handoff via Code rather than entering a fourth cycle.
|
|
108
108
|
```
|
|
109
109
|
|
|
110
110
|
**Peaks-Loop Gate B8 — Diff stays inside the declared red-line scope:**
|
|
@@ -61,7 +61,7 @@ Every SC invocation must write a change-control record at `.peaks/_runtime/<sess
|
|
|
61
61
|
- validation result (`peaks sc validate` output);
|
|
62
62
|
- boundary record (`peaks sc boundary` output).
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
Code reads this record before declaring the workflow complete.
|
|
65
65
|
|
|
66
66
|
## Refactor role
|
|
67
67
|
|
|
@@ -21,7 +21,7 @@ Before any analysis or tool call, immediately run:
|
|
|
21
21
|
peaks skill presence:set peaks-txt --project <repo> --mode <mode> --gate startup
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
-
**When invoked as a sub-agent (peaks-code swarm):** do NOT call `peaks skill presence:set` (
|
|
24
|
+
**When invoked as a sub-agent (peaks-code swarm):** do NOT call `peaks skill presence:set` (Code owns the active-skill marker) and do NOT spawn your own session. Use the parent's sid — 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.
|
|
25
25
|
|
|
26
26
|
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:
|
|
27
27
|
|
|
@@ -68,7 +68,7 @@ When used alone or when a workflow needs portable artifacts that must survive se
|
|
|
68
68
|
|
|
69
69
|
```markdown
|
|
70
70
|
## Handoff: <request-id>
|
|
71
|
-
- **Mode:**
|
|
71
|
+
- **Mode:** code | assisted | swarm | strict
|
|
72
72
|
- **Status:** complete | blocked | return-to-rd
|
|
73
73
|
- **Artifacts:**
|
|
74
74
|
- PRD: .peaks/_runtime/<sessionId>/prd/requests/<rid>.md
|
|
@@ -114,7 +114,7 @@ Each entry should include:
|
|
|
114
114
|
- lesson or rule;
|
|
115
115
|
- why it exists;
|
|
116
116
|
- affected skills;
|
|
117
|
-
- how future PRD/RD/UI/QA/SC/
|
|
117
|
+
- how future PRD/RD/UI/QA/SC/Code workflows should apply it;
|
|
118
118
|
- whether it is stable enough for `.peaks/memory` extraction.
|
|
119
119
|
|
|
120
120
|
## Project memory guidance
|
|
@@ -37,14 +37,14 @@ UI inherits `peaks-qa`'s hard-block contract: `AskUserQuestion` with three optio
|
|
|
37
37
|
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:
|
|
38
38
|
|
|
39
39
|
- **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.
|
|
40
|
-
- **Skill presence** — do NOT call `peaks skill presence:set peaks-ui`;
|
|
41
|
-
- **Workspace initialization** —
|
|
42
|
-
- **Mode selection** —
|
|
43
|
-
- **Statusline install** — done by
|
|
40
|
+
- **Skill presence** — do NOT call `peaks skill presence:set peaks-ui`; Code owns `.peaks/.active-skill.json`. Marker file at `.peaks/_runtime/<session-id>/system/sub-agent-ui.json` only.
|
|
41
|
+
- **Workspace initialization** — Code ran `peaks workspace init` before fan-out; do not re-run.
|
|
42
|
+
- **Mode selection** — Code chose the mode.
|
|
43
|
+
- **Statusline install** — done by Code at startup.
|
|
44
44
|
|
|
45
45
|
What the sub-agent **MUST** still do:
|
|
46
46
|
|
|
47
|
-
1. **Do NOT call `peaks request init`** —
|
|
47
|
+
1. **Do NOT call `peaks request init`** — Code already initialised the slot. Read via `peaks request show <rid> --role ui --project <repo> --json` if needed.
|
|
48
48
|
2. Read PRD scope via `peaks request show <rid> --role prd --project <repo> --json`.
|
|
49
49
|
3. Read `rd/project-scan.md` for component library / CSS framework / design-system context.
|
|
50
50
|
4. Run the prototype fidelity check (Figma / PRD visuals / headed browser).
|
|
@@ -65,13 +65,13 @@ What the sub-agent **MUST** still do:
|
|
|
65
65
|
**Hard prohibitions** (sub-agent context):
|
|
66
66
|
|
|
67
67
|
- Do NOT call `Skill(skill="...")`.
|
|
68
|
-
- Do NOT call `peaks skill presence:set` —
|
|
68
|
+
- Do NOT call `peaks skill presence:set` — Code owns active-skill.
|
|
69
69
|
- Do NOT modify application code. UI is design-direction only.
|
|
70
|
-
- Do NOT install MCP servers. If Playwright MCP is missing and headed browser is required, return `{"status":"blocked","blockedReason":"playwright-mcp-unavailable"}` for
|
|
70
|
+
- 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.)
|
|
71
71
|
- Do NOT commit, push, install hooks, or apply settings.json mutations.
|
|
72
72
|
- Do NOT ask user questions; return `{"status":"blocked","blockedReason":"<text>"}` if blocked.
|
|
73
73
|
|
|
74
|
-
If the request does not affect user-visible behavior (no frontend keyword hit, `frontendOnly=false`), the swarm plan should not include UI at all —
|
|
74
|
+
If the request does not affect user-visible behavior (no frontend keyword hit, `frontendOnly=false`), the swarm plan should not include UI at all — Code will not launch this sub-agent. But if it does launch you and you determine the work is non-visual, return `{"status":"skipped","reason":"non-frontend-request"}` so Code can record the misfire.
|
|
75
75
|
|
|
76
76
|
## Skill presence (MANDATORY first action — main-loop context only)
|
|
77
77
|
|