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,265 @@
|
|
|
1
|
+
import * as fs from 'fs';
|
|
2
|
+
import * as path from 'path';
|
|
3
|
+
import { validateWorkspace } from './validate';
|
|
4
|
+
|
|
5
|
+
export interface IterateOptions {
|
|
6
|
+
maxRetries?: number;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface ValidatePassResult {
|
|
10
|
+
status: 'passed' | 'failed' | 'escalated';
|
|
11
|
+
retries: number;
|
|
12
|
+
failures?: string[];
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface ScorePassResult {
|
|
16
|
+
score: number;
|
|
17
|
+
improvements: string[];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface ChecklistResult {
|
|
21
|
+
items: number;
|
|
22
|
+
passed: number;
|
|
23
|
+
failed: number;
|
|
24
|
+
details: { name: string; passed: boolean }[];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface IterateResult {
|
|
28
|
+
passes: {
|
|
29
|
+
validate: ValidatePassResult;
|
|
30
|
+
score: ScorePassResult;
|
|
31
|
+
checklist: ChecklistResult;
|
|
32
|
+
};
|
|
33
|
+
escalate: boolean;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface ScoreBreakdown {
|
|
37
|
+
system: number;
|
|
38
|
+
context: number;
|
|
39
|
+
stages: number;
|
|
40
|
+
tools: number;
|
|
41
|
+
total: number;
|
|
42
|
+
improvements: string[];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function iterateWorkspace(
|
|
46
|
+
workspacePath: string,
|
|
47
|
+
options: IterateOptions = {},
|
|
48
|
+
): IterateResult {
|
|
49
|
+
const { maxRetries = 3 } = options;
|
|
50
|
+
const ws = path.resolve(workspacePath);
|
|
51
|
+
|
|
52
|
+
const validateResult = runValidatePass(ws, maxRetries);
|
|
53
|
+
const scoreResult = runScorePass(ws);
|
|
54
|
+
const checklistResult = runChecklist(ws);
|
|
55
|
+
|
|
56
|
+
const result: IterateResult = {
|
|
57
|
+
passes: {
|
|
58
|
+
validate: validateResult,
|
|
59
|
+
score: scoreResult,
|
|
60
|
+
checklist: checklistResult,
|
|
61
|
+
},
|
|
62
|
+
escalate: validateResult.status === 'escalated',
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
console.log(JSON.stringify(result, null, 2));
|
|
66
|
+
|
|
67
|
+
return result;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function runValidatePass(ws: string, maxRetries: number): ValidatePassResult {
|
|
71
|
+
let retries = 0;
|
|
72
|
+
|
|
73
|
+
for (let i = 0; i < maxRetries; i++) {
|
|
74
|
+
const result = validateWorkspace(ws);
|
|
75
|
+
|
|
76
|
+
if (result.passed) {
|
|
77
|
+
return { status: 'passed', retries: i };
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
retries = i + 1;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const lastResult = validateWorkspace(ws);
|
|
84
|
+
const failures = lastResult.checks.filter((c) => !c.passed).map((c) => `${c.name}: ${c.message}`);
|
|
85
|
+
|
|
86
|
+
return {
|
|
87
|
+
status: 'escalated',
|
|
88
|
+
retries,
|
|
89
|
+
failures,
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function runScorePass(ws: string): ScorePassResult {
|
|
94
|
+
const score = scoreWorkspace(ws);
|
|
95
|
+
return {
|
|
96
|
+
score: score.total,
|
|
97
|
+
improvements: score.improvements,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export function scoreWorkspace(workspacePath: string): ScoreBreakdown {
|
|
102
|
+
const ws = path.resolve(workspacePath);
|
|
103
|
+
const improvements: string[] = [];
|
|
104
|
+
let system = 0;
|
|
105
|
+
let context = 0;
|
|
106
|
+
let stages = 0;
|
|
107
|
+
let tools = 0;
|
|
108
|
+
|
|
109
|
+
const systemMdPath = path.join(ws, 'SYSTEM.md');
|
|
110
|
+
if (fs.existsSync(systemMdPath)) {
|
|
111
|
+
const content = fs.readFileSync(systemMdPath, 'utf-8');
|
|
112
|
+
if (content.toLowerCase().includes('## role') || content.toLowerCase().includes('role')) system += 7;
|
|
113
|
+
else improvements.push('SYSTEM.md missing Role section');
|
|
114
|
+
if (content.toLowerCase().includes('folder map')) system += 7;
|
|
115
|
+
else improvements.push('SYSTEM.md missing Folder Map');
|
|
116
|
+
if (content.toLowerCase().includes('## rules') || content.toLowerCase().includes('rule')) system += 6;
|
|
117
|
+
else improvements.push('SYSTEM.md missing Rules section');
|
|
118
|
+
} else {
|
|
119
|
+
improvements.push('SYSTEM.md missing entirely');
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const contextMdPath = path.join(ws, 'CONTEXT.md');
|
|
123
|
+
if (fs.existsSync(contextMdPath)) {
|
|
124
|
+
const content = fs.readFileSync(contextMdPath, 'utf-8');
|
|
125
|
+
if (content.toLowerCase().includes('routing table')) context += 10;
|
|
126
|
+
else improvements.push('CONTEXT.md missing Routing Table');
|
|
127
|
+
const numberedFolders = getNumberedFolders(ws);
|
|
128
|
+
const allReferenced = numberedFolders.every((f) => content.includes(f));
|
|
129
|
+
if (allReferenced && numberedFolders.length > 0) context += 10;
|
|
130
|
+
else if (numberedFolders.length > 0) improvements.push('CONTEXT.md does not reference all stages');
|
|
131
|
+
} else {
|
|
132
|
+
improvements.push('CONTEXT.md missing entirely');
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
const stageFolders = getNumberedFolders(ws);
|
|
136
|
+
let stageScore = 0;
|
|
137
|
+
for (const folder of stageFolders) {
|
|
138
|
+
const stageContextPath = path.join(ws, folder, 'CONTEXT.md');
|
|
139
|
+
let folderScore = 0;
|
|
140
|
+
if (fs.existsSync(stageContextPath)) {
|
|
141
|
+
const content = fs.readFileSync(stageContextPath, 'utf-8');
|
|
142
|
+
if (content.toLowerCase().includes('purpose') || content.toLowerCase().includes('## purpose')) folderScore += 4;
|
|
143
|
+
else improvements.push(`${folder}/CONTEXT.md missing Purpose`);
|
|
144
|
+
if (content.toLowerCase().includes('input')) folderScore += 4;
|
|
145
|
+
else improvements.push(`${folder}/CONTEXT.md missing Inputs`);
|
|
146
|
+
if (content.toLowerCase().includes('output')) folderScore += 4;
|
|
147
|
+
else improvements.push(`${folder}/CONTEXT.md missing Outputs`);
|
|
148
|
+
if (content.toLowerCase().includes('dependenc')) folderScore += 3;
|
|
149
|
+
else improvements.push(`${folder}/CONTEXT.md missing Dependencies`);
|
|
150
|
+
} else {
|
|
151
|
+
improvements.push(`${folder}/CONTEXT.md missing`);
|
|
152
|
+
}
|
|
153
|
+
stageScore += folderScore;
|
|
154
|
+
}
|
|
155
|
+
stages = Math.min(stageScore, 45);
|
|
156
|
+
|
|
157
|
+
const toolsMdPath = path.join(ws, '00-meta', 'tools.md');
|
|
158
|
+
if (fs.existsSync(toolsMdPath)) {
|
|
159
|
+
const content = fs.readFileSync(toolsMdPath, 'utf-8');
|
|
160
|
+
if (content.trim().length > 20) tools += 15;
|
|
161
|
+
else {
|
|
162
|
+
tools += 5;
|
|
163
|
+
improvements.push('tools.md exists but has minimal content');
|
|
164
|
+
}
|
|
165
|
+
} else {
|
|
166
|
+
improvements.push('tools.md missing');
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
return {
|
|
170
|
+
system,
|
|
171
|
+
context,
|
|
172
|
+
stages,
|
|
173
|
+
tools,
|
|
174
|
+
total: system + context + stages + tools,
|
|
175
|
+
improvements,
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export function runChecklist(workspacePath: string): ChecklistResult {
|
|
180
|
+
const ws = path.resolve(workspacePath);
|
|
181
|
+
const details: { name: string; passed: boolean }[] = [];
|
|
182
|
+
|
|
183
|
+
const stageFolders = getNumberedFolders(ws);
|
|
184
|
+
|
|
185
|
+
for (const folder of stageFolders) {
|
|
186
|
+
const contextPath = path.join(ws, folder, 'CONTEXT.md');
|
|
187
|
+
if (fs.existsSync(contextPath)) {
|
|
188
|
+
const content = fs.readFileSync(contextPath, 'utf-8');
|
|
189
|
+
details.push({
|
|
190
|
+
name: `${folder} has inputs defined`,
|
|
191
|
+
passed: content.toLowerCase().includes('input'),
|
|
192
|
+
});
|
|
193
|
+
details.push({
|
|
194
|
+
name: `${folder} has outputs defined`,
|
|
195
|
+
passed: content.toLowerCase().includes('output'),
|
|
196
|
+
});
|
|
197
|
+
details.push({
|
|
198
|
+
name: `${folder} has dependencies defined`,
|
|
199
|
+
passed: content.toLowerCase().includes('dependenc'),
|
|
200
|
+
});
|
|
201
|
+
} else {
|
|
202
|
+
details.push({ name: `${folder} has CONTEXT.md`, passed: false });
|
|
203
|
+
details.push({ name: `${folder} has inputs defined`, passed: false });
|
|
204
|
+
details.push({ name: `${folder} has outputs defined`, passed: false });
|
|
205
|
+
details.push({ name: `${folder} has dependencies defined`, passed: false });
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
const contextMdPath = path.join(ws, 'CONTEXT.md');
|
|
210
|
+
if (fs.existsSync(contextMdPath)) {
|
|
211
|
+
const content = fs.readFileSync(contextMdPath, 'utf-8');
|
|
212
|
+
const allReferenced = stageFolders.every((f) => content.includes(f));
|
|
213
|
+
details.push({
|
|
214
|
+
name: 'Routing table references all numbered folders',
|
|
215
|
+
passed: allReferenced,
|
|
216
|
+
});
|
|
217
|
+
} else {
|
|
218
|
+
details.push({
|
|
219
|
+
name: 'Routing table references all numbered folders',
|
|
220
|
+
passed: false,
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
const readmePath = path.join(ws, 'README.md');
|
|
225
|
+
details.push({
|
|
226
|
+
name: 'README.md exists and has usage instructions',
|
|
227
|
+
passed: fs.existsSync(readmePath) && fs.readFileSync(readmePath, 'utf-8').trim().length > 0,
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
const passed = details.filter((d) => d.passed).length;
|
|
231
|
+
const failed = details.filter((d) => !d.passed).length;
|
|
232
|
+
|
|
233
|
+
return {
|
|
234
|
+
items: details.length,
|
|
235
|
+
passed,
|
|
236
|
+
failed,
|
|
237
|
+
details,
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
function getNumberedFolders(workspacePath: string): string[] {
|
|
242
|
+
const entries = fs.readdirSync(workspacePath, { withFileTypes: true });
|
|
243
|
+
return entries
|
|
244
|
+
.filter((e) => e.isDirectory() && /^\d{2}-/.test(e.name) && e.name !== '00-meta')
|
|
245
|
+
.map((e) => e.name);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
if (require.main === module) {
|
|
249
|
+
const args = process.argv.slice(2);
|
|
250
|
+
const parseArg = (flag: string): string | undefined => {
|
|
251
|
+
const idx = args.indexOf(flag);
|
|
252
|
+
return idx !== -1 ? args[idx + 1] : undefined;
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
const workspace = parseArg('--workspace');
|
|
256
|
+
const maxRetriesStr = parseArg('--max-retries');
|
|
257
|
+
const maxRetries = maxRetriesStr ? parseInt(maxRetriesStr, 10) : 3;
|
|
258
|
+
|
|
259
|
+
if (!workspace) {
|
|
260
|
+
console.error('Usage: node iterate.ts --workspace <path> [--max-retries <n>]');
|
|
261
|
+
process.exit(1);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
iterateWorkspace(workspace, { maxRetries });
|
|
265
|
+
}
|