workspace-maxxing 0.1.0
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/.agents/skills/workspace-maxxing/.workspace-templates/CONTEXT.md +44 -0
- package/.agents/skills/workspace-maxxing/.workspace-templates/SYSTEM.md +44 -0
- package/.agents/skills/workspace-maxxing/.workspace-templates/references/anti-patterns.md +16 -0
- package/.agents/skills/workspace-maxxing/.workspace-templates/references/iron-laws.md +26 -0
- package/.agents/skills/workspace-maxxing/.workspace-templates/references/reporting-format.md +52 -0
- package/.agents/skills/workspace-maxxing/.workspace-templates/scripts/benchmark.ts +171 -0
- package/.agents/skills/workspace-maxxing/.workspace-templates/scripts/dispatch.ts +473 -0
- package/.agents/skills/workspace-maxxing/.workspace-templates/scripts/generate-tests.ts +158 -0
- package/.agents/skills/workspace-maxxing/.workspace-templates/scripts/install-tool.ts +82 -0
- package/.agents/skills/workspace-maxxing/.workspace-templates/scripts/iterate.ts +265 -0
- package/.agents/skills/workspace-maxxing/.workspace-templates/scripts/orchestrator.ts +539 -0
- package/.agents/skills/workspace-maxxing/.workspace-templates/scripts/scaffold.ts +282 -0
- package/.agents/skills/workspace-maxxing/.workspace-templates/scripts/validate.ts +452 -0
- package/.agents/skills/workspace-maxxing/.workspace-templates/skills/architecture/SKILL.md +95 -0
- package/.agents/skills/workspace-maxxing/.workspace-templates/skills/fixer/SKILL.md +109 -0
- package/.agents/skills/workspace-maxxing/.workspace-templates/skills/iteration/SKILL.md +89 -0
- package/.agents/skills/workspace-maxxing/.workspace-templates/skills/prompt-engineering/SKILL.md +87 -0
- package/.agents/skills/workspace-maxxing/.workspace-templates/skills/research/SKILL.md +94 -0
- package/.agents/skills/workspace-maxxing/.workspace-templates/skills/testing/SKILL.md +89 -0
- package/.agents/skills/workspace-maxxing/.workspace-templates/skills/tooling/SKILL.md +87 -0
- package/.agents/skills/workspace-maxxing/.workspace-templates/skills/validation/SKILL.md +103 -0
- package/.agents/skills/workspace-maxxing/.workspace-templates/skills/worker/SKILL.md +79 -0
- package/.agents/skills/workspace-maxxing/.workspace-templates/workspace/00-meta/CONTEXT.md +6 -0
- package/.agents/skills/workspace-maxxing/.workspace-templates/workspace/00-meta/execution-log.md +27 -0
- package/.agents/skills/workspace-maxxing/.workspace-templates/workspace/01-input/CONTEXT.md +29 -0
- package/.agents/skills/workspace-maxxing/.workspace-templates/workspace/02-process/CONTEXT.md +29 -0
- package/.agents/skills/workspace-maxxing/.workspace-templates/workspace/03-output/CONTEXT.md +29 -0
- package/.agents/skills/workspace-maxxing/.workspace-templates/workspace/README.md +14 -0
- package/.agents/skills/workspace-maxxing/SKILL.md +312 -0
- package/.agents/skills/workspace-maxxing/scripts/benchmark.ts +171 -0
- package/.agents/skills/workspace-maxxing/scripts/dispatch.ts +473 -0
- package/.agents/skills/workspace-maxxing/scripts/generate-tests.ts +158 -0
- package/.agents/skills/workspace-maxxing/scripts/install-tool.ts +82 -0
- package/.agents/skills/workspace-maxxing/scripts/iterate.ts +265 -0
- package/.agents/skills/workspace-maxxing/scripts/orchestrator.ts +539 -0
- package/.agents/skills/workspace-maxxing/scripts/scaffold.ts +282 -0
- package/.agents/skills/workspace-maxxing/scripts/validate.ts +452 -0
- package/README.md +144 -0
- package/dist/agent-creator.d.ts +9 -0
- package/dist/agent-creator.d.ts.map +1 -0
- package/dist/agent-creator.js +199 -0
- package/dist/agent-creator.js.map +1 -0
- package/dist/agent-iterator.d.ts +38 -0
- package/dist/agent-iterator.d.ts.map +1 -0
- package/dist/agent-iterator.js +327 -0
- package/dist/agent-iterator.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +197 -0
- package/dist/index.js.map +1 -0
- package/dist/install.d.ts +18 -0
- package/dist/install.d.ts.map +1 -0
- package/dist/install.js +117 -0
- package/dist/install.js.map +1 -0
- package/dist/platforms/claude.d.ts +7 -0
- package/dist/platforms/claude.d.ts.map +1 -0
- package/dist/platforms/claude.js +70 -0
- package/dist/platforms/claude.js.map +1 -0
- package/dist/platforms/copilot.d.ts +7 -0
- package/dist/platforms/copilot.d.ts.map +1 -0
- package/dist/platforms/copilot.js +75 -0
- package/dist/platforms/copilot.js.map +1 -0
- package/dist/platforms/gemini.d.ts +7 -0
- package/dist/platforms/gemini.d.ts.map +1 -0
- package/dist/platforms/gemini.js +81 -0
- package/dist/platforms/gemini.js.map +1 -0
- package/dist/platforms/index.d.ts +8 -0
- package/dist/platforms/index.d.ts.map +1 -0
- package/dist/platforms/index.js +41 -0
- package/dist/platforms/index.js.map +1 -0
- package/dist/platforms/opencode.d.ts +7 -0
- package/dist/platforms/opencode.d.ts.map +1 -0
- package/dist/platforms/opencode.js +70 -0
- package/dist/platforms/opencode.js.map +1 -0
- package/dist/scripts/benchmark.d.ts +20 -0
- package/dist/scripts/benchmark.d.ts.map +1 -0
- package/dist/scripts/benchmark.js +170 -0
- package/dist/scripts/benchmark.js.map +1 -0
- package/dist/scripts/dispatch.d.ts +32 -0
- package/dist/scripts/dispatch.d.ts.map +1 -0
- package/dist/scripts/dispatch.js +386 -0
- package/dist/scripts/dispatch.js.map +1 -0
- package/dist/scripts/generate-tests.d.ts +11 -0
- package/dist/scripts/generate-tests.d.ts.map +1 -0
- package/dist/scripts/generate-tests.js +118 -0
- package/dist/scripts/generate-tests.js.map +1 -0
- package/dist/scripts/install-tool.d.ts +8 -0
- package/dist/scripts/install-tool.d.ts.map +1 -0
- package/dist/scripts/install-tool.js +98 -0
- package/dist/scripts/install-tool.js.map +1 -0
- package/dist/scripts/iterate.d.ts +44 -0
- package/dist/scripts/iterate.d.ts.map +1 -0
- package/dist/scripts/iterate.js +260 -0
- package/dist/scripts/iterate.js.map +1 -0
- package/dist/scripts/orchestrator.d.ts +40 -0
- package/dist/scripts/orchestrator.d.ts.map +1 -0
- package/dist/scripts/orchestrator.js +378 -0
- package/dist/scripts/orchestrator.js.map +1 -0
- package/dist/scripts/scaffold.d.ts +8 -0
- package/dist/scripts/scaffold.d.ts.map +1 -0
- package/dist/scripts/scaffold.js +279 -0
- package/dist/scripts/scaffold.js.map +1 -0
- package/dist/scripts/validate.d.ts +11 -0
- package/dist/scripts/validate.d.ts.map +1 -0
- package/dist/scripts/validate.js +472 -0
- package/dist/scripts/validate.js.map +1 -0
- package/docs/superpowers/plans/2026-04-07-autonomous-iteration-plan.md +1123 -0
- package/docs/superpowers/plans/2026-04-07-autonomous-iteration-sub-agent-batches.md +1923 -0
- package/docs/superpowers/plans/2026-04-07-autonomous-workflow-sub-skill-plan.md +1505 -0
- package/docs/superpowers/plans/2026-04-07-benchmarking-multi-agent-plan.md +854 -0
- package/docs/superpowers/plans/2026-04-07-workspace-builder-logic-plan.md +1426 -0
- package/docs/superpowers/plans/2026-04-07-workspace-maxxing-plan.md +1299 -0
- package/docs/superpowers/plans/2026-04-08-session-294c-subagent-invocation-plan.md +320 -0
- package/docs/superpowers/plans/2026-04-08-workflow-prompt-hardening-plan.md +1025 -0
- package/docs/superpowers/plans/2026-04-12-workspace-agent-creation-plan.md +992 -0
- package/docs/superpowers/specs/2026-04-07-autonomous-iteration-design.md +214 -0
- package/docs/superpowers/specs/2026-04-07-autonomous-iteration-sub-agent-batches-design.md +188 -0
- package/docs/superpowers/specs/2026-04-07-autonomous-workflow-sub-skill-design.md +137 -0
- package/docs/superpowers/specs/2026-04-07-benchmarking-multi-agent-design.md +105 -0
- package/docs/superpowers/specs/2026-04-07-workspace-builder-logic-design.md +179 -0
- package/docs/superpowers/specs/2026-04-07-workspace-maxxing-design.md +227 -0
- package/docs/superpowers/specs/2026-04-08-session-294c-subagent-invocation-design.md +265 -0
- package/docs/superpowers/specs/2026-04-08-workflow-prompt-hardening-design.md +146 -0
- package/docs/superpowers/specs/2026-04-12-workspace-agent-creation-design.md +239 -0
- package/jest.config.js +8 -0
- package/package.json +32 -0
- package/src/agent-creator.ts +180 -0
- package/src/agent-iterator.ts +397 -0
- package/src/index.ts +189 -0
- package/src/install.ts +105 -0
- package/src/platforms/claude.ts +40 -0
- package/src/platforms/copilot.ts +50 -0
- package/src/platforms/gemini.ts +55 -0
- package/src/platforms/index.ts +45 -0
- package/src/platforms/opencode.ts +41 -0
- package/src/scripts/benchmark.ts +171 -0
- package/src/scripts/dispatch.ts +473 -0
- package/src/scripts/generate-tests.ts +112 -0
- package/src/scripts/install-tool.ts +82 -0
- package/src/scripts/iterate.ts +271 -0
- package/src/scripts/orchestrator.ts +539 -0
- package/src/scripts/scaffold.ts +282 -0
- package/src/scripts/validate.ts +516 -0
- package/templates/.workspace-templates/CONTEXT.md +44 -0
- package/templates/.workspace-templates/SYSTEM.md +44 -0
- package/templates/.workspace-templates/references/anti-patterns.md +16 -0
- package/templates/.workspace-templates/references/iron-laws.md +26 -0
- package/templates/.workspace-templates/references/reporting-format.md +52 -0
- package/templates/.workspace-templates/scripts/benchmark.ts +171 -0
- package/templates/.workspace-templates/scripts/dispatch.ts +473 -0
- package/templates/.workspace-templates/scripts/generate-tests.ts +158 -0
- package/templates/.workspace-templates/scripts/install-tool.ts +82 -0
- package/templates/.workspace-templates/scripts/iterate.ts +265 -0
- package/templates/.workspace-templates/scripts/orchestrator.ts +539 -0
- package/templates/.workspace-templates/scripts/scaffold.ts +282 -0
- package/templates/.workspace-templates/scripts/validate.ts +452 -0
- package/templates/.workspace-templates/skills/architecture/SKILL.md +95 -0
- package/templates/.workspace-templates/skills/fixer/SKILL.md +109 -0
- package/templates/.workspace-templates/skills/iteration/SKILL.md +89 -0
- package/templates/.workspace-templates/skills/prompt-engineering/SKILL.md +87 -0
- package/templates/.workspace-templates/skills/research/SKILL.md +94 -0
- package/templates/.workspace-templates/skills/testing/SKILL.md +89 -0
- package/templates/.workspace-templates/skills/tooling/SKILL.md +87 -0
- package/templates/.workspace-templates/skills/validation/SKILL.md +103 -0
- package/templates/.workspace-templates/skills/worker/SKILL.md +79 -0
- package/templates/.workspace-templates/workspace/00-meta/CONTEXT.md +6 -0
- package/templates/.workspace-templates/workspace/00-meta/execution-log.md +27 -0
- package/templates/.workspace-templates/workspace/01-input/CONTEXT.md +29 -0
- package/templates/.workspace-templates/workspace/02-process/CONTEXT.md +29 -0
- package/templates/.workspace-templates/workspace/03-output/CONTEXT.md +29 -0
- package/templates/.workspace-templates/workspace/README.md +14 -0
- package/templates/SKILL.md +347 -0
- package/tests/benchmark.test.ts +158 -0
- package/tests/cli.test.ts +109 -0
- package/tests/dispatch-parallel.test.ts +124 -0
- package/tests/dispatch.test.ts +218 -0
- package/tests/fixer-skill.test.ts +203 -0
- package/tests/generate-tests.test.ts +101 -0
- package/tests/install-tool.test.ts +141 -0
- package/tests/install.test.ts +144 -0
- package/tests/integration.test.ts +324 -0
- package/tests/iterate.test.ts +219 -0
- package/tests/orchestrator.test.ts +710 -0
- package/tests/scaffold.test.ts +238 -0
- package/tests/templates-enhanced.test.ts +208 -0
- package/tests/templates.test.ts +219 -0
- package/tests/validate.test.ts +421 -0
- package/tests/validation-enhanced.test.ts +303 -0
- package/tests/worker-skill.test.ts +88 -0
- package/tsconfig.json +19 -0
- package/workspace/00-meta/CONTEXT.md +3 -0
- package/workspace/00-meta/execution-log.md +17 -0
- package/workspace/00-meta/tools.md +11 -0
- package/workspace/01-input/CONTEXT.md +27 -0
- package/workspace/CONTEXT.md +35 -0
- package/workspace/README.md +14 -0
- package/workspace/SYSTEM.md +36 -0
- package/workspace-maxxing-0.1.0.tgz +0 -0
|
@@ -0,0 +1,516 @@
|
|
|
1
|
+
import * as fs from 'fs';
|
|
2
|
+
import * as path from 'path';
|
|
3
|
+
|
|
4
|
+
export interface CheckResult {
|
|
5
|
+
name: string;
|
|
6
|
+
passed: boolean;
|
|
7
|
+
message: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface ValidationResult {
|
|
11
|
+
passed: boolean;
|
|
12
|
+
checks: CheckResult[];
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const REQUIRED_SYSTEM_HEADINGS = [
|
|
16
|
+
'## Role',
|
|
17
|
+
'## Folder Map',
|
|
18
|
+
'## Workflow Rules',
|
|
19
|
+
'## Scope Guardrails',
|
|
20
|
+
'## Sequential Execution Protocol',
|
|
21
|
+
'## Stage Boundaries',
|
|
22
|
+
'## Tooling Policy',
|
|
23
|
+
];
|
|
24
|
+
|
|
25
|
+
const REQUIRED_ROOT_CONTEXT_HEADINGS = [
|
|
26
|
+
'## How to Use This File',
|
|
27
|
+
'## Task Routing',
|
|
28
|
+
'## Loading Order',
|
|
29
|
+
'## Scope Guardrails',
|
|
30
|
+
'## Sequential Routing Contract',
|
|
31
|
+
'## Stage Handoff Routing',
|
|
32
|
+
'## Escalation',
|
|
33
|
+
];
|
|
34
|
+
|
|
35
|
+
const REQUIRED_STAGE_CONTEXT_HEADINGS = [
|
|
36
|
+
'## Purpose',
|
|
37
|
+
'## Inputs',
|
|
38
|
+
'## Outputs',
|
|
39
|
+
'## Dependencies',
|
|
40
|
+
'## Required Evidence',
|
|
41
|
+
'## Completion Criteria',
|
|
42
|
+
'## Handoff',
|
|
43
|
+
];
|
|
44
|
+
|
|
45
|
+
const DISALLOWED_STAGE_SOURCE_EXTENSIONS = new Set([
|
|
46
|
+
'.ts',
|
|
47
|
+
'.tsx',
|
|
48
|
+
'.js',
|
|
49
|
+
'.jsx',
|
|
50
|
+
'.py',
|
|
51
|
+
'.java',
|
|
52
|
+
'.go',
|
|
53
|
+
'.rs',
|
|
54
|
+
'.cs',
|
|
55
|
+
'.cpp',
|
|
56
|
+
'.c',
|
|
57
|
+
'.rb',
|
|
58
|
+
'.php',
|
|
59
|
+
'.swift',
|
|
60
|
+
'.kt',
|
|
61
|
+
'.scala',
|
|
62
|
+
]);
|
|
63
|
+
|
|
64
|
+
export function validateWorkspace(workspacePath: string): ValidationResult {
|
|
65
|
+
const ws = path.resolve(workspacePath);
|
|
66
|
+
const checks: CheckResult[] = [];
|
|
67
|
+
const numberedFolders = getNumberedStageFolders(ws);
|
|
68
|
+
|
|
69
|
+
const systemMdPath = path.join(ws, 'SYSTEM.md');
|
|
70
|
+
const systemExists = fs.existsSync(systemMdPath);
|
|
71
|
+
checks.push({
|
|
72
|
+
name: 'SYSTEM.md exists',
|
|
73
|
+
passed: systemExists,
|
|
74
|
+
message: systemExists ? 'Found' : 'Missing',
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
if (systemExists) {
|
|
78
|
+
const systemContent = fs.readFileSync(systemMdPath, 'utf-8');
|
|
79
|
+
const hasFolderMap = systemContent.toLowerCase().includes('folder map');
|
|
80
|
+
checks.push({
|
|
81
|
+
name: 'SYSTEM.md contains folder map',
|
|
82
|
+
passed: hasFolderMap,
|
|
83
|
+
message: hasFolderMap ? 'Found' : 'Missing "folder map" reference',
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
addRequiredHeadingChecks('SYSTEM.md', systemContent, REQUIRED_SYSTEM_HEADINGS, checks);
|
|
87
|
+
} else {
|
|
88
|
+
checks.push({
|
|
89
|
+
name: 'SYSTEM.md contains folder map',
|
|
90
|
+
passed: false,
|
|
91
|
+
message: 'Cannot check — SYSTEM.md missing',
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
for (const heading of REQUIRED_SYSTEM_HEADINGS) {
|
|
95
|
+
checks.push({
|
|
96
|
+
name: `SYSTEM.md contains ${heading}`,
|
|
97
|
+
passed: false,
|
|
98
|
+
message: `Cannot check - SYSTEM.md missing`,
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const contextMdPath = path.join(ws, 'CONTEXT.md');
|
|
104
|
+
const contextExists = fs.existsSync(contextMdPath);
|
|
105
|
+
checks.push({
|
|
106
|
+
name: 'CONTEXT.md exists at root',
|
|
107
|
+
passed: contextExists,
|
|
108
|
+
message: contextExists ? 'Found' : 'Missing',
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
if (contextExists) {
|
|
112
|
+
const contextContent = fs.readFileSync(contextMdPath, 'utf-8');
|
|
113
|
+
addRequiredHeadingChecks('CONTEXT.md', contextContent, REQUIRED_ROOT_CONTEXT_HEADINGS, checks);
|
|
114
|
+
|
|
115
|
+
const allReferenced = numberedFolders.every((folder) => contextContent.includes(`${folder}/CONTEXT.md`));
|
|
116
|
+
checks.push({
|
|
117
|
+
name: 'Root routing references all numbered stages',
|
|
118
|
+
passed: allReferenced,
|
|
119
|
+
message: allReferenced ? 'All numbered stages are routed' : 'Missing one or more numbered stage routes',
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
const enforcesSelectiveLoading =
|
|
123
|
+
/## Loading Order/i.test(contextContent)
|
|
124
|
+
&& /SYSTEM\.md/i.test(contextContent)
|
|
125
|
+
&& /Only the task files needed/i.test(contextContent);
|
|
126
|
+
|
|
127
|
+
checks.push({
|
|
128
|
+
name: 'Root loading order enforces selective loading',
|
|
129
|
+
passed: enforcesSelectiveLoading,
|
|
130
|
+
message: enforcesSelectiveLoading
|
|
131
|
+
? 'Selective loading guidance found'
|
|
132
|
+
: 'Loading order lacks selective-loading guidance',
|
|
133
|
+
});
|
|
134
|
+
} else {
|
|
135
|
+
for (const heading of REQUIRED_ROOT_CONTEXT_HEADINGS) {
|
|
136
|
+
checks.push({
|
|
137
|
+
name: `CONTEXT.md contains ${heading}`,
|
|
138
|
+
passed: false,
|
|
139
|
+
message: 'Cannot check - CONTEXT.md missing',
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
checks.push({
|
|
144
|
+
name: 'Root routing references all numbered stages',
|
|
145
|
+
passed: false,
|
|
146
|
+
message: 'Cannot check - CONTEXT.md missing',
|
|
147
|
+
});
|
|
148
|
+
checks.push({
|
|
149
|
+
name: 'Root loading order enforces selective loading',
|
|
150
|
+
passed: false,
|
|
151
|
+
message: 'Cannot check - CONTEXT.md missing',
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
const executionLogPath = path.join(ws, '00-meta', 'execution-log.md');
|
|
156
|
+
const executionLogExists = fs.existsSync(executionLogPath);
|
|
157
|
+
checks.push({
|
|
158
|
+
name: '00-meta/execution-log.md exists',
|
|
159
|
+
passed: executionLogExists,
|
|
160
|
+
message: executionLogExists ? 'Found' : 'Missing',
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
if (executionLogExists) {
|
|
164
|
+
const executionLogContent = fs.readFileSync(executionLogPath, 'utf-8');
|
|
165
|
+
const hasStageChecklistHeading = /## Stage Checklist/i.test(executionLogContent);
|
|
166
|
+
checks.push({
|
|
167
|
+
name: 'Execution log contains stage checklist heading',
|
|
168
|
+
passed: hasStageChecklistHeading,
|
|
169
|
+
message: hasStageChecklistHeading ? 'Found' : 'Missing "## Stage Checklist" heading',
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
const hasAllStageChecklistEntries = numberedFolders.every((folder) => {
|
|
173
|
+
const pattern = new RegExp(`^\\s*-\\s*\\[[ xX]\\]\\s+${escapeRegExp(folder)}\\s*$`, 'm');
|
|
174
|
+
return pattern.test(executionLogContent);
|
|
175
|
+
});
|
|
176
|
+
checks.push({
|
|
177
|
+
name: 'Execution log references all numbered stages',
|
|
178
|
+
passed: hasAllStageChecklistEntries,
|
|
179
|
+
message: hasAllStageChecklistEntries
|
|
180
|
+
? 'All numbered stages are present in checklist'
|
|
181
|
+
: 'Missing one or more numbered stage checklist entries',
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
const sequentialOrderValid = hasAllStageChecklistEntries
|
|
185
|
+
? isExecutionChecklistSequential(executionLogContent, numberedFolders)
|
|
186
|
+
: false;
|
|
187
|
+
checks.push({
|
|
188
|
+
name: 'Execution log stage completion order is sequential',
|
|
189
|
+
passed: sequentialOrderValid,
|
|
190
|
+
message: sequentialOrderValid
|
|
191
|
+
? 'Stage completion order is sequential'
|
|
192
|
+
: 'Found later stage marked complete before earlier stage',
|
|
193
|
+
});
|
|
194
|
+
} else {
|
|
195
|
+
checks.push({
|
|
196
|
+
name: 'Execution log contains stage checklist heading',
|
|
197
|
+
passed: false,
|
|
198
|
+
message: 'Cannot check - execution log missing',
|
|
199
|
+
});
|
|
200
|
+
checks.push({
|
|
201
|
+
name: 'Execution log references all numbered stages',
|
|
202
|
+
passed: false,
|
|
203
|
+
message: 'Cannot check - execution log missing',
|
|
204
|
+
});
|
|
205
|
+
checks.push({
|
|
206
|
+
name: 'Execution log stage completion order is sequential',
|
|
207
|
+
passed: false,
|
|
208
|
+
message: 'Cannot check - execution log missing',
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
for (const folder of numberedFolders) {
|
|
213
|
+
const contextPath = path.join(ws, folder, 'CONTEXT.md');
|
|
214
|
+
const exists = fs.existsSync(contextPath);
|
|
215
|
+
checks.push({
|
|
216
|
+
name: `${folder}/CONTEXT.md exists`,
|
|
217
|
+
passed: exists,
|
|
218
|
+
message: exists ? 'Found' : 'Missing',
|
|
219
|
+
});
|
|
220
|
+
|
|
221
|
+
if (exists) {
|
|
222
|
+
const content = fs.readFileSync(contextPath, 'utf-8');
|
|
223
|
+
const notEmpty = content.trim().length > 0;
|
|
224
|
+
checks.push({
|
|
225
|
+
name: `${folder}/CONTEXT.md is not empty`,
|
|
226
|
+
passed: notEmpty,
|
|
227
|
+
message: notEmpty ? `${content.trim().length} chars` : 'File is empty',
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
addRequiredHeadingChecks(`${folder}/CONTEXT.md`, content, REQUIRED_STAGE_CONTEXT_HEADINGS, checks);
|
|
231
|
+
|
|
232
|
+
const deps = extractStageRefs(extractDependenciesSection(content));
|
|
233
|
+
const currentNum = parseInt(folder.slice(0, 2), 10);
|
|
234
|
+
const pointsToLaterStage = deps.some((dep) => parseInt(dep.slice(0, 2), 10) > currentNum);
|
|
235
|
+
|
|
236
|
+
checks.push({
|
|
237
|
+
name: `${folder} dependencies do not point to later stages`,
|
|
238
|
+
passed: !pointsToLaterStage,
|
|
239
|
+
message: !pointsToLaterStage ? 'Dependency direction valid' : 'Found dependency on later-numbered stage',
|
|
240
|
+
});
|
|
241
|
+
} else {
|
|
242
|
+
for (const heading of REQUIRED_STAGE_CONTEXT_HEADINGS) {
|
|
243
|
+
checks.push({
|
|
244
|
+
name: `${folder}/CONTEXT.md contains ${heading}`,
|
|
245
|
+
passed: false,
|
|
246
|
+
message: 'Cannot check - CONTEXT.md missing',
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
checks.push({
|
|
251
|
+
name: `${folder} dependencies do not point to later stages`,
|
|
252
|
+
passed: false,
|
|
253
|
+
message: 'Cannot check - CONTEXT.md missing',
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
const disallowedFiles = findDisallowedStageSourceFiles(path.join(ws, folder));
|
|
258
|
+
checks.push({
|
|
259
|
+
name: `${folder} contains no product source code files`,
|
|
260
|
+
passed: disallowedFiles.length === 0,
|
|
261
|
+
message: disallowedFiles.length === 0
|
|
262
|
+
? 'Only workflow documentation artifacts found'
|
|
263
|
+
: `Found source files: ${disallowedFiles.join(', ')}`,
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
const allFiles = getAllMarkdownFiles(ws);
|
|
268
|
+
const duplicateCheck = checkDuplicateContent(allFiles);
|
|
269
|
+
checks.push(duplicateCheck);
|
|
270
|
+
|
|
271
|
+
// Agent-driven test-case enforcement (default)
|
|
272
|
+
const agentDrivenRequired = true;
|
|
273
|
+
|
|
274
|
+
checks.push({
|
|
275
|
+
name: 'Agent-driven test-case mode enforced',
|
|
276
|
+
passed: true,
|
|
277
|
+
message: 'Agent-driven mode is the default; validator requires .agents/iteration/test-cases.json',
|
|
278
|
+
});
|
|
279
|
+
|
|
280
|
+
if (agentDrivenRequired) {
|
|
281
|
+
const testCasesPath = path.join(ws, '.agents', 'iteration', 'test-cases.json');
|
|
282
|
+
const readyMarker = path.join(ws, '.agents', 'iteration', '.test-cases-ready');
|
|
283
|
+
|
|
284
|
+
const testCasesExists = fs.existsSync(testCasesPath);
|
|
285
|
+
checks.push({
|
|
286
|
+
name: '.agents/iteration/test-cases.json exists',
|
|
287
|
+
passed: testCasesExists,
|
|
288
|
+
message: testCasesExists ? 'Found' : 'Missing agent-generated test-cases file',
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
if (testCasesExists) {
|
|
292
|
+
try {
|
|
293
|
+
const raw = fs.readFileSync(testCasesPath, 'utf-8');
|
|
294
|
+
const parsed = JSON.parse(raw);
|
|
295
|
+
const isArray = Array.isArray(parsed);
|
|
296
|
+
checks.push({
|
|
297
|
+
name: 'test-cases.json is a JSON array',
|
|
298
|
+
passed: isArray,
|
|
299
|
+
message: isArray ? `Contains ${parsed.length} case(s)` : 'Not an array',
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
if (isArray) {
|
|
303
|
+
const missingFields: string[] = [];
|
|
304
|
+
for (let i = 0; i < Math.min(parsed.length, 5); i++) {
|
|
305
|
+
const tc = parsed[i];
|
|
306
|
+
if (!tc || typeof tc !== 'object' || !tc.id || !tc.input || !tc.expected) {
|
|
307
|
+
missingFields.push(`item[${i}]`);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
checks.push({
|
|
312
|
+
name: 'test-cases.json items have minimal fields',
|
|
313
|
+
passed: missingFields.length === 0,
|
|
314
|
+
message: missingFields.length === 0 ? 'Sample items valid' : `Missing fields in ${missingFields.join(', ')}`,
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
} catch (e) {
|
|
318
|
+
const emsg = (e && (e as any).message) ? (e as any).message : String(e);
|
|
319
|
+
checks.push({
|
|
320
|
+
name: 'test-cases.json parseable JSON',
|
|
321
|
+
passed: false,
|
|
322
|
+
message: `JSON parse error: ${emsg}`,
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
const readyExists = fs.existsSync(readyMarker);
|
|
328
|
+
checks.push({
|
|
329
|
+
name: '.agents/iteration/.test-cases-ready exists',
|
|
330
|
+
passed: readyExists,
|
|
331
|
+
message: readyExists ? 'Found' : 'Missing readiness marker file',
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
const passed = checks.every((c) => c.passed);
|
|
336
|
+
|
|
337
|
+
console.log(`\nValidation: ${ws}`);
|
|
338
|
+
console.log('='.repeat(50));
|
|
339
|
+
for (const check of checks) {
|
|
340
|
+
const icon = check.passed ? '✓' : '✗';
|
|
341
|
+
console.log(` ${icon} ${check.name}: ${check.message}`);
|
|
342
|
+
}
|
|
343
|
+
console.log('='.repeat(50));
|
|
344
|
+
console.log(passed ? '✓ All checks passed' : '✗ Some checks failed');
|
|
345
|
+
|
|
346
|
+
return { passed, checks };
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
function getAllMarkdownFiles(dir: string): string[] {
|
|
350
|
+
const results: string[] = [];
|
|
351
|
+
const entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
352
|
+
|
|
353
|
+
for (const entry of entries) {
|
|
354
|
+
const fullPath = path.join(dir, entry.name);
|
|
355
|
+
if (entry.isDirectory()) {
|
|
356
|
+
results.push(...getAllMarkdownFiles(fullPath));
|
|
357
|
+
} else if (entry.name.endsWith('.md')) {
|
|
358
|
+
results.push(fullPath);
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
return results;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
function escapeRegExp(value: string): string {
|
|
366
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
function hasHeading(content: string, heading: string): boolean {
|
|
370
|
+
return new RegExp(`^${escapeRegExp(heading)}\\s*$`, 'im').test(content);
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
function addRequiredHeadingChecks(
|
|
374
|
+
fileLabel: string,
|
|
375
|
+
content: string,
|
|
376
|
+
headings: string[],
|
|
377
|
+
checks: CheckResult[],
|
|
378
|
+
): void {
|
|
379
|
+
for (const heading of headings) {
|
|
380
|
+
const found = hasHeading(content, heading);
|
|
381
|
+
checks.push({
|
|
382
|
+
name: `${fileLabel} contains ${heading}`,
|
|
383
|
+
passed: found,
|
|
384
|
+
message: found ? 'Found' : `Missing ${heading}`,
|
|
385
|
+
});
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
function checkDuplicateContent(files: string[]): CheckResult {
|
|
390
|
+
const MIN_DUPLICATE_LENGTH = 50;
|
|
391
|
+
const duplicates: string[] = [];
|
|
392
|
+
|
|
393
|
+
for (let i = 0; i < files.length; i++) {
|
|
394
|
+
for (let j = i + 1; j < files.length; j++) {
|
|
395
|
+
const contentA = fs.readFileSync(files[i], 'utf-8');
|
|
396
|
+
const contentB = fs.readFileSync(files[j], 'utf-8');
|
|
397
|
+
|
|
398
|
+
const linesA = contentA.split('\n');
|
|
399
|
+
const linesB = contentB.split('\n');
|
|
400
|
+
|
|
401
|
+
for (const lineA of linesA) {
|
|
402
|
+
const trimmed = lineA.trim();
|
|
403
|
+
if (trimmed.length > MIN_DUPLICATE_LENGTH) {
|
|
404
|
+
for (const lineB of linesB) {
|
|
405
|
+
if (lineB.trim() === trimmed) {
|
|
406
|
+
duplicates.push(trimmed.substring(0, 60) + '...');
|
|
407
|
+
break;
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
if (duplicates.length > 0) {
|
|
416
|
+
return {
|
|
417
|
+
name: 'No duplicate content across files',
|
|
418
|
+
passed: false,
|
|
419
|
+
message: `Found ${duplicates.length} duplicate text block(s)`,
|
|
420
|
+
};
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
return {
|
|
424
|
+
name: 'No duplicate content across files',
|
|
425
|
+
passed: true,
|
|
426
|
+
message: 'No duplicates found',
|
|
427
|
+
};
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
function getNumberedStageFolders(workspacePath: string): string[] {
|
|
431
|
+
const entries = fs.readdirSync(workspacePath, { withFileTypes: true });
|
|
432
|
+
return entries
|
|
433
|
+
.filter((entry) => entry.isDirectory() && /^\d{2}-/.test(entry.name) && entry.name !== '00-meta')
|
|
434
|
+
.map((entry) => entry.name);
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
function extractDependenciesSection(content: string): string {
|
|
438
|
+
const match = content.match(/## Dependencies\s*([\s\S]*?)(?=\n##\s|$)/i);
|
|
439
|
+
return match ? match[1] : '';
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
function extractStageRefs(content: string): string[] {
|
|
443
|
+
const refs = new Set<string>();
|
|
444
|
+
const regex = /(\d{2}-[A-Za-z0-9-_]+)/g;
|
|
445
|
+
let match: RegExpExecArray | null;
|
|
446
|
+
|
|
447
|
+
while ((match = regex.exec(content)) !== null) {
|
|
448
|
+
refs.add(match[1]);
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
return Array.from(refs);
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
function isExecutionChecklistSequential(content: string, stages: string[]): boolean {
|
|
455
|
+
let foundUncheckedStage = false;
|
|
456
|
+
|
|
457
|
+
for (const stage of stages) {
|
|
458
|
+
const pattern = new RegExp(`^\\s*-\\s*\\[([ xX])\\]\\s+${escapeRegExp(stage)}\\s*$`, 'm');
|
|
459
|
+
const match = content.match(pattern);
|
|
460
|
+
if (!match) {
|
|
461
|
+
return false;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
const isChecked = match[1].toLowerCase() === 'x';
|
|
465
|
+
if (!isChecked) {
|
|
466
|
+
foundUncheckedStage = true;
|
|
467
|
+
continue;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
if (foundUncheckedStage) {
|
|
471
|
+
return false;
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
return true;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
function findDisallowedStageSourceFiles(stageDir: string): string[] {
|
|
479
|
+
const disallowed: string[] = [];
|
|
480
|
+
|
|
481
|
+
const walk = (currentDir: string): void => {
|
|
482
|
+
const entries = fs.readdirSync(currentDir, { withFileTypes: true });
|
|
483
|
+
|
|
484
|
+
for (const entry of entries) {
|
|
485
|
+
const fullPath = path.join(currentDir, entry.name);
|
|
486
|
+
|
|
487
|
+
if (entry.isDirectory()) {
|
|
488
|
+
walk(fullPath);
|
|
489
|
+
continue;
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
const ext = path.extname(entry.name).toLowerCase();
|
|
493
|
+
if (DISALLOWED_STAGE_SOURCE_EXTENSIONS.has(ext)) {
|
|
494
|
+
disallowed.push(path.relative(stageDir, fullPath).replace(/\\/g, '/'));
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
};
|
|
498
|
+
|
|
499
|
+
walk(stageDir);
|
|
500
|
+
|
|
501
|
+
return disallowed;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
if (require.main === module) {
|
|
505
|
+
const args = process.argv.slice(2);
|
|
506
|
+
const workspaceIdx = args.indexOf('--workspace');
|
|
507
|
+
const workspace = workspaceIdx !== -1 ? args[workspaceIdx + 1] : undefined;
|
|
508
|
+
|
|
509
|
+
if (!workspace) {
|
|
510
|
+
console.error('Usage: node validate.ts --workspace <path>');
|
|
511
|
+
process.exit(1);
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
const result = validateWorkspace(workspace);
|
|
515
|
+
process.exit(result.passed ? 0 : 1);
|
|
516
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Routing Table
|
|
2
|
+
|
|
3
|
+
## How to Use This File
|
|
4
|
+
|
|
5
|
+
Map each task to the smallest required context and avoid loading unrelated files.
|
|
6
|
+
|
|
7
|
+
## Task Routing
|
|
8
|
+
|
|
9
|
+
| When you need to... | Go to | Load |
|
|
10
|
+
|---------------------|-------|------|
|
|
11
|
+
| Understand workspace constraints | SYSTEM.md | Always loaded first |
|
|
12
|
+
| Gather or validate inputs | 01-input/CONTEXT.md | Input stage contract |
|
|
13
|
+
| Analyze, process, or draft | 02-process/CONTEXT.md | Processing stage contract |
|
|
14
|
+
| Finalize and deliver outputs | 03-output/CONTEXT.md | Output stage contract |
|
|
15
|
+
| Check available tools | 00-meta/tools.md | Tool inventory |
|
|
16
|
+
|
|
17
|
+
## Loading Order
|
|
18
|
+
|
|
19
|
+
1. SYSTEM.md (always)
|
|
20
|
+
2. This root CONTEXT.md
|
|
21
|
+
3. One relevant stage CONTEXT.md
|
|
22
|
+
4. Only the task files needed for that stage
|
|
23
|
+
|
|
24
|
+
## Scope Guardrails
|
|
25
|
+
|
|
26
|
+
- Route domain goals into workflow design stages and markdown deliverables.
|
|
27
|
+
- Do not scaffold backend, frontend, or runtime product repositories from this routing file.
|
|
28
|
+
- Keep artifacts file-structured and markdown-first across numbered workflow folders.
|
|
29
|
+
|
|
30
|
+
## Sequential Routing Contract
|
|
31
|
+
|
|
32
|
+
- Route to the earliest incomplete stage listed in 00-meta/execution-log.md.
|
|
33
|
+
- Do not skip forward to later stages while earlier stages remain incomplete.
|
|
34
|
+
- Append handoff notes after each completed stage before advancing.
|
|
35
|
+
|
|
36
|
+
## Stage Handoff Routing
|
|
37
|
+
|
|
38
|
+
- 01-input -> 02-process when input completion criteria are met
|
|
39
|
+
- 02-process -> 03-output when processing completion criteria are met
|
|
40
|
+
- 03-output -> delivery and closure
|
|
41
|
+
|
|
42
|
+
## Escalation
|
|
43
|
+
|
|
44
|
+
Escalate when required sections are missing, routing is ambiguous, or dependencies conflict with stage order.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# System - Workspace Root
|
|
2
|
+
|
|
3
|
+
## Role
|
|
4
|
+
You are an AI assistant operating inside this workspace. Follow stage contracts, route tasks through stage contexts, and keep information canonical.
|
|
5
|
+
|
|
6
|
+
## Folder Map
|
|
7
|
+
|
|
8
|
+
| Folder | Purpose |
|
|
9
|
+
|--------|---------|
|
|
10
|
+
| 00-meta/ | Workspace configuration, tool inventory, session notes |
|
|
11
|
+
| 01-input/ | Source materials, intake, and validation |
|
|
12
|
+
| 02-process/ | Analysis, transformation, and drafting |
|
|
13
|
+
| 03-output/ | Final deliverables and publication artifacts |
|
|
14
|
+
|
|
15
|
+
## Workflow Rules
|
|
16
|
+
|
|
17
|
+
1. Read this file first every session.
|
|
18
|
+
2. Read root `CONTEXT.md` before loading stage files.
|
|
19
|
+
3. Load only the stage context and task files required for the current step.
|
|
20
|
+
4. Keep one canonical source for each fact; do not duplicate content across stages.
|
|
21
|
+
|
|
22
|
+
## Scope Guardrails
|
|
23
|
+
|
|
24
|
+
- Build workflow documentation, not product implementation code.
|
|
25
|
+
- Keep stage outputs markdown-first (plans, checklists, prompts, routing notes).
|
|
26
|
+
- If the user asks for product code, convert that into workflow requirements and stay inside ICM workspace scope.
|
|
27
|
+
|
|
28
|
+
## Sequential Execution Protocol
|
|
29
|
+
|
|
30
|
+
1. Complete stages in ascending numeric order.
|
|
31
|
+
2. Record each completed stage in 00-meta/execution-log.md before routing onward.
|
|
32
|
+
3. Do not generate final output until all prior stages are marked complete.
|
|
33
|
+
|
|
34
|
+
## Stage Boundaries
|
|
35
|
+
|
|
36
|
+
- Execute stages in order unless explicit handoff says otherwise.
|
|
37
|
+
- One-way dependencies only: upstream -> downstream.
|
|
38
|
+
- Downstream stages may reference upstream outputs, never reverse.
|
|
39
|
+
|
|
40
|
+
## Tooling Policy
|
|
41
|
+
|
|
42
|
+
- Tool inventory is tracked in `00-meta/tools.md`.
|
|
43
|
+
- Check inventory before proposing installs.
|
|
44
|
+
- Record approved tool changes in `00-meta/tools.md`.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Anti-Patterns & Rationalization Prevention
|
|
2
|
+
|
|
3
|
+
Common rationalizations agents use to skip steps, with reality checks.
|
|
4
|
+
|
|
5
|
+
| Thought | Reality |
|
|
6
|
+
|---------|---------|
|
|
7
|
+
| "This workspace looks good enough" | Good enough is the enemy of excellent. Run validation. |
|
|
8
|
+
| "I'll skip research and go straight to building" | Building without research produces generic, non-optimal workspaces. |
|
|
9
|
+
| "The user didn't ask for tests" | Autonomous workflows require self-verification. Tests are mandatory. |
|
|
10
|
+
| "I'll fix this later" | Later never comes. Fix it now or escalate. |
|
|
11
|
+
| "This sub-skill doesn't apply here" | If there's a 1% chance it applies, dispatch it. |
|
|
12
|
+
| "The score is fine" | Fine is not good. Target > 85. |
|
|
13
|
+
| "I already validated this" | Validation is a snapshot. Re-validate after every change. |
|
|
14
|
+
| "This prompt update is cosmetic" | Prompt quality directly impacts agent behavior. No cosmetic-only changes. |
|
|
15
|
+
| "I'll do all phases at once" | Phases exist for a reason. Complete each before moving to the next. |
|
|
16
|
+
| "The user will review anyway" | Autonomous means autonomous. Deliver quality without requiring human review. |
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Iron Laws
|
|
2
|
+
|
|
3
|
+
These rules are absolute. No exceptions. No rationalizations.
|
|
4
|
+
|
|
5
|
+
## The Iron Laws of Workspace Building
|
|
6
|
+
|
|
7
|
+
1. **NO BUILD WITHOUT PLAN** — Every workspace must have an approved architecture plan before scaffold.ts runs.
|
|
8
|
+
|
|
9
|
+
2. **NO PLAN WITHOUT RESEARCH** — Architecture decisions must be informed by pattern research and context gathering.
|
|
10
|
+
|
|
11
|
+
3. **NO IMPROVEMENT WITHOUT VALIDATION** — Never claim a workspace improved without running validate.ts before and after.
|
|
12
|
+
|
|
13
|
+
4. **NO COMPLETION CLAIM WITHOUT VERIFICATION** — Run the full test suite and validation checks before declaring delivery.
|
|
14
|
+
|
|
15
|
+
5. **NO SKIPPING PHASES** — The hybrid flow exists for a reason. Complete each phase before moving to the next.
|
|
16
|
+
|
|
17
|
+
6. **NO SILENT FAILURES** — If a sub-skill fails, report it. Do not continue as if nothing happened.
|
|
18
|
+
|
|
19
|
+
## Enforcement
|
|
20
|
+
|
|
21
|
+
Before any action, ask: "Which iron law does this touch?" If the answer is "none," you're probably about to break one.
|
|
22
|
+
|
|
23
|
+
Violation of any iron law requires immediate escalation to the human with:
|
|
24
|
+
- Which law was violated
|
|
25
|
+
- Why it was violated
|
|
26
|
+
- Proposed fix
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Sub-Skill Report Format
|
|
2
|
+
|
|
3
|
+
All sub-skills return a structured JSON report. Use this exact format.
|
|
4
|
+
|
|
5
|
+
## Report Structure
|
|
6
|
+
|
|
7
|
+
```json
|
|
8
|
+
{
|
|
9
|
+
"skill": "<skill-name>",
|
|
10
|
+
"status": "passed|failed|escalated",
|
|
11
|
+
"timestamp": "<ISO-8601 timestamp>",
|
|
12
|
+
"findings": [
|
|
13
|
+
"<specific finding 1>",
|
|
14
|
+
"<specific finding 2>"
|
|
15
|
+
],
|
|
16
|
+
"recommendations": [
|
|
17
|
+
"<actionable recommendation 1>",
|
|
18
|
+
"<actionable recommendation 2>"
|
|
19
|
+
],
|
|
20
|
+
"metrics": {
|
|
21
|
+
"<metric-name>": <value>,
|
|
22
|
+
"score": <0-100>,
|
|
23
|
+
"itemsChecked": <number>,
|
|
24
|
+
"itemsPassed": <number>
|
|
25
|
+
},
|
|
26
|
+
"nextSkill": "<next-skill-name>|none"
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Field Descriptions
|
|
31
|
+
|
|
32
|
+
- `skill`: Name of the sub-skill that generated this report
|
|
33
|
+
- `status`: One of "passed", "failed", or "escalated"
|
|
34
|
+
- `passed`: All checks passed, no critical issues
|
|
35
|
+
- `failed`: One or more checks failed, actionable items exist
|
|
36
|
+
- `escalated`: Cannot proceed, requires human intervention
|
|
37
|
+
- `timestamp`: ISO-8601 timestamp of report generation
|
|
38
|
+
- `findings`: Array of specific observations (both positive and negative)
|
|
39
|
+
- `recommendations`: Array of actionable next steps
|
|
40
|
+
- `metrics`: Quantitative measurements from the sub-skill
|
|
41
|
+
- `score`: 0-100 quality score
|
|
42
|
+
- `itemsChecked`: Total items evaluated
|
|
43
|
+
- `itemsPassed`: Items that passed evaluation
|
|
44
|
+
- `nextSkill`: Suggested next sub-skill to dispatch, or "none" if workflow is complete
|
|
45
|
+
|
|
46
|
+
## Usage
|
|
47
|
+
|
|
48
|
+
Print the report as JSON to stdout when the sub-skill completes:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
echo '{"skill":"validation","status":"passed",...}'
|
|
52
|
+
```
|