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.
Files changed (198) hide show
  1. package/.agents/skills/workspace-maxxing/.workspace-templates/CONTEXT.md +44 -0
  2. package/.agents/skills/workspace-maxxing/.workspace-templates/SYSTEM.md +44 -0
  3. package/.agents/skills/workspace-maxxing/.workspace-templates/references/anti-patterns.md +16 -0
  4. package/.agents/skills/workspace-maxxing/.workspace-templates/references/iron-laws.md +26 -0
  5. package/.agents/skills/workspace-maxxing/.workspace-templates/references/reporting-format.md +52 -0
  6. package/.agents/skills/workspace-maxxing/.workspace-templates/scripts/benchmark.ts +171 -0
  7. package/.agents/skills/workspace-maxxing/.workspace-templates/scripts/dispatch.ts +473 -0
  8. package/.agents/skills/workspace-maxxing/.workspace-templates/scripts/generate-tests.ts +158 -0
  9. package/.agents/skills/workspace-maxxing/.workspace-templates/scripts/install-tool.ts +82 -0
  10. package/.agents/skills/workspace-maxxing/.workspace-templates/scripts/iterate.ts +265 -0
  11. package/.agents/skills/workspace-maxxing/.workspace-templates/scripts/orchestrator.ts +539 -0
  12. package/.agents/skills/workspace-maxxing/.workspace-templates/scripts/scaffold.ts +282 -0
  13. package/.agents/skills/workspace-maxxing/.workspace-templates/scripts/validate.ts +452 -0
  14. package/.agents/skills/workspace-maxxing/.workspace-templates/skills/architecture/SKILL.md +95 -0
  15. package/.agents/skills/workspace-maxxing/.workspace-templates/skills/fixer/SKILL.md +109 -0
  16. package/.agents/skills/workspace-maxxing/.workspace-templates/skills/iteration/SKILL.md +89 -0
  17. package/.agents/skills/workspace-maxxing/.workspace-templates/skills/prompt-engineering/SKILL.md +87 -0
  18. package/.agents/skills/workspace-maxxing/.workspace-templates/skills/research/SKILL.md +94 -0
  19. package/.agents/skills/workspace-maxxing/.workspace-templates/skills/testing/SKILL.md +89 -0
  20. package/.agents/skills/workspace-maxxing/.workspace-templates/skills/tooling/SKILL.md +87 -0
  21. package/.agents/skills/workspace-maxxing/.workspace-templates/skills/validation/SKILL.md +103 -0
  22. package/.agents/skills/workspace-maxxing/.workspace-templates/skills/worker/SKILL.md +79 -0
  23. package/.agents/skills/workspace-maxxing/.workspace-templates/workspace/00-meta/CONTEXT.md +6 -0
  24. package/.agents/skills/workspace-maxxing/.workspace-templates/workspace/00-meta/execution-log.md +27 -0
  25. package/.agents/skills/workspace-maxxing/.workspace-templates/workspace/01-input/CONTEXT.md +29 -0
  26. package/.agents/skills/workspace-maxxing/.workspace-templates/workspace/02-process/CONTEXT.md +29 -0
  27. package/.agents/skills/workspace-maxxing/.workspace-templates/workspace/03-output/CONTEXT.md +29 -0
  28. package/.agents/skills/workspace-maxxing/.workspace-templates/workspace/README.md +14 -0
  29. package/.agents/skills/workspace-maxxing/SKILL.md +312 -0
  30. package/.agents/skills/workspace-maxxing/scripts/benchmark.ts +171 -0
  31. package/.agents/skills/workspace-maxxing/scripts/dispatch.ts +473 -0
  32. package/.agents/skills/workspace-maxxing/scripts/generate-tests.ts +158 -0
  33. package/.agents/skills/workspace-maxxing/scripts/install-tool.ts +82 -0
  34. package/.agents/skills/workspace-maxxing/scripts/iterate.ts +265 -0
  35. package/.agents/skills/workspace-maxxing/scripts/orchestrator.ts +539 -0
  36. package/.agents/skills/workspace-maxxing/scripts/scaffold.ts +282 -0
  37. package/.agents/skills/workspace-maxxing/scripts/validate.ts +452 -0
  38. package/README.md +144 -0
  39. package/dist/agent-creator.d.ts +9 -0
  40. package/dist/agent-creator.d.ts.map +1 -0
  41. package/dist/agent-creator.js +199 -0
  42. package/dist/agent-creator.js.map +1 -0
  43. package/dist/agent-iterator.d.ts +38 -0
  44. package/dist/agent-iterator.d.ts.map +1 -0
  45. package/dist/agent-iterator.js +327 -0
  46. package/dist/agent-iterator.js.map +1 -0
  47. package/dist/index.d.ts +3 -0
  48. package/dist/index.d.ts.map +1 -0
  49. package/dist/index.js +197 -0
  50. package/dist/index.js.map +1 -0
  51. package/dist/install.d.ts +18 -0
  52. package/dist/install.d.ts.map +1 -0
  53. package/dist/install.js +117 -0
  54. package/dist/install.js.map +1 -0
  55. package/dist/platforms/claude.d.ts +7 -0
  56. package/dist/platforms/claude.d.ts.map +1 -0
  57. package/dist/platforms/claude.js +70 -0
  58. package/dist/platforms/claude.js.map +1 -0
  59. package/dist/platforms/copilot.d.ts +7 -0
  60. package/dist/platforms/copilot.d.ts.map +1 -0
  61. package/dist/platforms/copilot.js +75 -0
  62. package/dist/platforms/copilot.js.map +1 -0
  63. package/dist/platforms/gemini.d.ts +7 -0
  64. package/dist/platforms/gemini.d.ts.map +1 -0
  65. package/dist/platforms/gemini.js +81 -0
  66. package/dist/platforms/gemini.js.map +1 -0
  67. package/dist/platforms/index.d.ts +8 -0
  68. package/dist/platforms/index.d.ts.map +1 -0
  69. package/dist/platforms/index.js +41 -0
  70. package/dist/platforms/index.js.map +1 -0
  71. package/dist/platforms/opencode.d.ts +7 -0
  72. package/dist/platforms/opencode.d.ts.map +1 -0
  73. package/dist/platforms/opencode.js +70 -0
  74. package/dist/platforms/opencode.js.map +1 -0
  75. package/dist/scripts/benchmark.d.ts +20 -0
  76. package/dist/scripts/benchmark.d.ts.map +1 -0
  77. package/dist/scripts/benchmark.js +170 -0
  78. package/dist/scripts/benchmark.js.map +1 -0
  79. package/dist/scripts/dispatch.d.ts +32 -0
  80. package/dist/scripts/dispatch.d.ts.map +1 -0
  81. package/dist/scripts/dispatch.js +386 -0
  82. package/dist/scripts/dispatch.js.map +1 -0
  83. package/dist/scripts/generate-tests.d.ts +11 -0
  84. package/dist/scripts/generate-tests.d.ts.map +1 -0
  85. package/dist/scripts/generate-tests.js +118 -0
  86. package/dist/scripts/generate-tests.js.map +1 -0
  87. package/dist/scripts/install-tool.d.ts +8 -0
  88. package/dist/scripts/install-tool.d.ts.map +1 -0
  89. package/dist/scripts/install-tool.js +98 -0
  90. package/dist/scripts/install-tool.js.map +1 -0
  91. package/dist/scripts/iterate.d.ts +44 -0
  92. package/dist/scripts/iterate.d.ts.map +1 -0
  93. package/dist/scripts/iterate.js +260 -0
  94. package/dist/scripts/iterate.js.map +1 -0
  95. package/dist/scripts/orchestrator.d.ts +40 -0
  96. package/dist/scripts/orchestrator.d.ts.map +1 -0
  97. package/dist/scripts/orchestrator.js +378 -0
  98. package/dist/scripts/orchestrator.js.map +1 -0
  99. package/dist/scripts/scaffold.d.ts +8 -0
  100. package/dist/scripts/scaffold.d.ts.map +1 -0
  101. package/dist/scripts/scaffold.js +279 -0
  102. package/dist/scripts/scaffold.js.map +1 -0
  103. package/dist/scripts/validate.d.ts +11 -0
  104. package/dist/scripts/validate.d.ts.map +1 -0
  105. package/dist/scripts/validate.js +472 -0
  106. package/dist/scripts/validate.js.map +1 -0
  107. package/docs/superpowers/plans/2026-04-07-autonomous-iteration-plan.md +1123 -0
  108. package/docs/superpowers/plans/2026-04-07-autonomous-iteration-sub-agent-batches.md +1923 -0
  109. package/docs/superpowers/plans/2026-04-07-autonomous-workflow-sub-skill-plan.md +1505 -0
  110. package/docs/superpowers/plans/2026-04-07-benchmarking-multi-agent-plan.md +854 -0
  111. package/docs/superpowers/plans/2026-04-07-workspace-builder-logic-plan.md +1426 -0
  112. package/docs/superpowers/plans/2026-04-07-workspace-maxxing-plan.md +1299 -0
  113. package/docs/superpowers/plans/2026-04-08-session-294c-subagent-invocation-plan.md +320 -0
  114. package/docs/superpowers/plans/2026-04-08-workflow-prompt-hardening-plan.md +1025 -0
  115. package/docs/superpowers/plans/2026-04-12-workspace-agent-creation-plan.md +992 -0
  116. package/docs/superpowers/specs/2026-04-07-autonomous-iteration-design.md +214 -0
  117. package/docs/superpowers/specs/2026-04-07-autonomous-iteration-sub-agent-batches-design.md +188 -0
  118. package/docs/superpowers/specs/2026-04-07-autonomous-workflow-sub-skill-design.md +137 -0
  119. package/docs/superpowers/specs/2026-04-07-benchmarking-multi-agent-design.md +105 -0
  120. package/docs/superpowers/specs/2026-04-07-workspace-builder-logic-design.md +179 -0
  121. package/docs/superpowers/specs/2026-04-07-workspace-maxxing-design.md +227 -0
  122. package/docs/superpowers/specs/2026-04-08-session-294c-subagent-invocation-design.md +265 -0
  123. package/docs/superpowers/specs/2026-04-08-workflow-prompt-hardening-design.md +146 -0
  124. package/docs/superpowers/specs/2026-04-12-workspace-agent-creation-design.md +239 -0
  125. package/jest.config.js +8 -0
  126. package/package.json +32 -0
  127. package/src/agent-creator.ts +180 -0
  128. package/src/agent-iterator.ts +397 -0
  129. package/src/index.ts +189 -0
  130. package/src/install.ts +105 -0
  131. package/src/platforms/claude.ts +40 -0
  132. package/src/platforms/copilot.ts +50 -0
  133. package/src/platforms/gemini.ts +55 -0
  134. package/src/platforms/index.ts +45 -0
  135. package/src/platforms/opencode.ts +41 -0
  136. package/src/scripts/benchmark.ts +171 -0
  137. package/src/scripts/dispatch.ts +473 -0
  138. package/src/scripts/generate-tests.ts +112 -0
  139. package/src/scripts/install-tool.ts +82 -0
  140. package/src/scripts/iterate.ts +271 -0
  141. package/src/scripts/orchestrator.ts +539 -0
  142. package/src/scripts/scaffold.ts +282 -0
  143. package/src/scripts/validate.ts +516 -0
  144. package/templates/.workspace-templates/CONTEXT.md +44 -0
  145. package/templates/.workspace-templates/SYSTEM.md +44 -0
  146. package/templates/.workspace-templates/references/anti-patterns.md +16 -0
  147. package/templates/.workspace-templates/references/iron-laws.md +26 -0
  148. package/templates/.workspace-templates/references/reporting-format.md +52 -0
  149. package/templates/.workspace-templates/scripts/benchmark.ts +171 -0
  150. package/templates/.workspace-templates/scripts/dispatch.ts +473 -0
  151. package/templates/.workspace-templates/scripts/generate-tests.ts +158 -0
  152. package/templates/.workspace-templates/scripts/install-tool.ts +82 -0
  153. package/templates/.workspace-templates/scripts/iterate.ts +265 -0
  154. package/templates/.workspace-templates/scripts/orchestrator.ts +539 -0
  155. package/templates/.workspace-templates/scripts/scaffold.ts +282 -0
  156. package/templates/.workspace-templates/scripts/validate.ts +452 -0
  157. package/templates/.workspace-templates/skills/architecture/SKILL.md +95 -0
  158. package/templates/.workspace-templates/skills/fixer/SKILL.md +109 -0
  159. package/templates/.workspace-templates/skills/iteration/SKILL.md +89 -0
  160. package/templates/.workspace-templates/skills/prompt-engineering/SKILL.md +87 -0
  161. package/templates/.workspace-templates/skills/research/SKILL.md +94 -0
  162. package/templates/.workspace-templates/skills/testing/SKILL.md +89 -0
  163. package/templates/.workspace-templates/skills/tooling/SKILL.md +87 -0
  164. package/templates/.workspace-templates/skills/validation/SKILL.md +103 -0
  165. package/templates/.workspace-templates/skills/worker/SKILL.md +79 -0
  166. package/templates/.workspace-templates/workspace/00-meta/CONTEXT.md +6 -0
  167. package/templates/.workspace-templates/workspace/00-meta/execution-log.md +27 -0
  168. package/templates/.workspace-templates/workspace/01-input/CONTEXT.md +29 -0
  169. package/templates/.workspace-templates/workspace/02-process/CONTEXT.md +29 -0
  170. package/templates/.workspace-templates/workspace/03-output/CONTEXT.md +29 -0
  171. package/templates/.workspace-templates/workspace/README.md +14 -0
  172. package/templates/SKILL.md +347 -0
  173. package/tests/benchmark.test.ts +158 -0
  174. package/tests/cli.test.ts +109 -0
  175. package/tests/dispatch-parallel.test.ts +124 -0
  176. package/tests/dispatch.test.ts +218 -0
  177. package/tests/fixer-skill.test.ts +203 -0
  178. package/tests/generate-tests.test.ts +101 -0
  179. package/tests/install-tool.test.ts +141 -0
  180. package/tests/install.test.ts +144 -0
  181. package/tests/integration.test.ts +324 -0
  182. package/tests/iterate.test.ts +219 -0
  183. package/tests/orchestrator.test.ts +710 -0
  184. package/tests/scaffold.test.ts +238 -0
  185. package/tests/templates-enhanced.test.ts +208 -0
  186. package/tests/templates.test.ts +219 -0
  187. package/tests/validate.test.ts +421 -0
  188. package/tests/validation-enhanced.test.ts +303 -0
  189. package/tests/worker-skill.test.ts +88 -0
  190. package/tsconfig.json +19 -0
  191. package/workspace/00-meta/CONTEXT.md +3 -0
  192. package/workspace/00-meta/execution-log.md +17 -0
  193. package/workspace/00-meta/tools.md +11 -0
  194. package/workspace/01-input/CONTEXT.md +27 -0
  195. package/workspace/CONTEXT.md +35 -0
  196. package/workspace/README.md +14 -0
  197. package/workspace/SYSTEM.md +36 -0
  198. package/workspace-maxxing-0.1.0.tgz +0 -0
@@ -0,0 +1,271 @@
1
+ import * as fs from 'fs';
2
+ import * as path from 'path';
3
+ import { validateWorkspace } from './validate';
4
+ import { calculateBenchmark, BenchmarkResult } from './benchmark';
5
+
6
+ export interface IterateOptions {
7
+ maxRetries?: number;
8
+ agent?: string;
9
+ }
10
+
11
+ export interface ValidatePassResult {
12
+ status: 'passed' | 'failed' | 'escalated';
13
+ retries: number;
14
+ failures?: string[];
15
+ }
16
+
17
+ export interface ScorePassResult {
18
+ score: number;
19
+ improvements: string[];
20
+ }
21
+
22
+ export interface ChecklistResult {
23
+ items: number;
24
+ passed: number;
25
+ failed: number;
26
+ details: { name: string; passed: boolean }[];
27
+ }
28
+
29
+ export interface IterateResult {
30
+ passes: {
31
+ validate: ValidatePassResult;
32
+ score: ScorePassResult;
33
+ checklist: ChecklistResult;
34
+ };
35
+ benchmark?: BenchmarkResult;
36
+ escalate: boolean;
37
+ }
38
+
39
+ export interface ScoreBreakdown {
40
+ system: number;
41
+ context: number;
42
+ stages: number;
43
+ tools: number;
44
+ total: number;
45
+ improvements: string[];
46
+ }
47
+
48
+ export function iterateWorkspace(
49
+ workspacePath: string,
50
+ options: IterateOptions = {},
51
+ ): IterateResult {
52
+ const { maxRetries = 3, agent = 'unknown' } = options;
53
+ const ws = path.resolve(workspacePath);
54
+
55
+ const validateResult = runValidatePass(ws, maxRetries);
56
+ const scoreResult = runScorePass(ws);
57
+ const checklistResult = runChecklist(ws);
58
+ const benchmarkResult = calculateBenchmark(ws);
59
+ benchmarkResult.agent = agent;
60
+
61
+ const result: IterateResult = {
62
+ passes: {
63
+ validate: validateResult,
64
+ score: scoreResult,
65
+ checklist: checklistResult,
66
+ },
67
+ benchmark: benchmarkResult,
68
+ escalate: validateResult.status === 'escalated',
69
+ };
70
+
71
+ console.log(JSON.stringify(result, null, 2));
72
+
73
+ return result;
74
+ }
75
+
76
+ function runValidatePass(ws: string, maxRetries: number): ValidatePassResult {
77
+ let retries = 0;
78
+
79
+ for (let i = 0; i < maxRetries; i++) {
80
+ const result = validateWorkspace(ws);
81
+
82
+ if (result.passed) {
83
+ return { status: 'passed', retries: i };
84
+ }
85
+
86
+ retries = i + 1;
87
+ }
88
+
89
+ const lastResult = validateWorkspace(ws);
90
+ const failures = lastResult.checks.filter((c) => !c.passed).map((c) => `${c.name}: ${c.message}`);
91
+
92
+ return {
93
+ status: 'escalated',
94
+ retries,
95
+ failures,
96
+ };
97
+ }
98
+
99
+ function runScorePass(ws: string): ScorePassResult {
100
+ const score = scoreWorkspace(ws);
101
+ return {
102
+ score: score.total,
103
+ improvements: score.improvements,
104
+ };
105
+ }
106
+
107
+ export function scoreWorkspace(workspacePath: string): ScoreBreakdown {
108
+ const ws = path.resolve(workspacePath);
109
+ const improvements: string[] = [];
110
+ let system = 0;
111
+ let context = 0;
112
+ let stages = 0;
113
+ let tools = 0;
114
+
115
+ const systemMdPath = path.join(ws, 'SYSTEM.md');
116
+ if (fs.existsSync(systemMdPath)) {
117
+ const content = fs.readFileSync(systemMdPath, 'utf-8');
118
+ if (content.toLowerCase().includes('## role') || content.toLowerCase().includes('role')) system += 7;
119
+ else improvements.push('SYSTEM.md missing Role section');
120
+ if (content.toLowerCase().includes('folder map')) system += 7;
121
+ else improvements.push('SYSTEM.md missing Folder Map');
122
+ if (content.toLowerCase().includes('## rules') || content.toLowerCase().includes('rule')) system += 6;
123
+ else improvements.push('SYSTEM.md missing Rules section');
124
+ } else {
125
+ improvements.push('SYSTEM.md missing entirely');
126
+ }
127
+
128
+ const contextMdPath = path.join(ws, 'CONTEXT.md');
129
+ if (fs.existsSync(contextMdPath)) {
130
+ const content = fs.readFileSync(contextMdPath, 'utf-8');
131
+ if (content.toLowerCase().includes('routing table')) context += 10;
132
+ else improvements.push('CONTEXT.md missing Routing Table');
133
+ const numberedFolders = getNumberedFolders(ws);
134
+ const allReferenced = numberedFolders.every((f) => content.includes(f));
135
+ if (allReferenced && numberedFolders.length > 0) context += 10;
136
+ else if (numberedFolders.length > 0) improvements.push('CONTEXT.md does not reference all stages');
137
+ } else {
138
+ improvements.push('CONTEXT.md missing entirely');
139
+ }
140
+
141
+ const stageFolders = getNumberedFolders(ws);
142
+ let stageScore = 0;
143
+ for (const folder of stageFolders) {
144
+ const stageContextPath = path.join(ws, folder, 'CONTEXT.md');
145
+ let folderScore = 0;
146
+ if (fs.existsSync(stageContextPath)) {
147
+ const content = fs.readFileSync(stageContextPath, 'utf-8');
148
+ if (content.toLowerCase().includes('purpose') || content.toLowerCase().includes('## purpose')) folderScore += 4;
149
+ else improvements.push(`${folder}/CONTEXT.md missing Purpose`);
150
+ if (content.toLowerCase().includes('input')) folderScore += 4;
151
+ else improvements.push(`${folder}/CONTEXT.md missing Inputs`);
152
+ if (content.toLowerCase().includes('output')) folderScore += 4;
153
+ else improvements.push(`${folder}/CONTEXT.md missing Outputs`);
154
+ if (content.toLowerCase().includes('dependenc')) folderScore += 3;
155
+ else improvements.push(`${folder}/CONTEXT.md missing Dependencies`);
156
+ } else {
157
+ improvements.push(`${folder}/CONTEXT.md missing`);
158
+ }
159
+ stageScore += folderScore;
160
+ }
161
+ stages = Math.min(stageScore, 45);
162
+
163
+ const toolsMdPath = path.join(ws, '00-meta', 'tools.md');
164
+ if (fs.existsSync(toolsMdPath)) {
165
+ const content = fs.readFileSync(toolsMdPath, 'utf-8');
166
+ if (content.trim().length > 20) tools += 15;
167
+ else {
168
+ tools += 5;
169
+ improvements.push('tools.md exists but has minimal content');
170
+ }
171
+ } else {
172
+ improvements.push('tools.md missing');
173
+ }
174
+
175
+ return {
176
+ system,
177
+ context,
178
+ stages,
179
+ tools,
180
+ total: system + context + stages + tools,
181
+ improvements,
182
+ };
183
+ }
184
+
185
+ export function runChecklist(workspacePath: string): ChecklistResult {
186
+ const ws = path.resolve(workspacePath);
187
+ const details: { name: string; passed: boolean }[] = [];
188
+
189
+ const stageFolders = getNumberedFolders(ws);
190
+
191
+ for (const folder of stageFolders) {
192
+ const contextPath = path.join(ws, folder, 'CONTEXT.md');
193
+ if (fs.existsSync(contextPath)) {
194
+ const content = fs.readFileSync(contextPath, 'utf-8');
195
+ details.push({
196
+ name: `${folder} has inputs defined`,
197
+ passed: content.toLowerCase().includes('input'),
198
+ });
199
+ details.push({
200
+ name: `${folder} has outputs defined`,
201
+ passed: content.toLowerCase().includes('output'),
202
+ });
203
+ details.push({
204
+ name: `${folder} has dependencies defined`,
205
+ passed: content.toLowerCase().includes('dependenc'),
206
+ });
207
+ } else {
208
+ details.push({ name: `${folder} has CONTEXT.md`, passed: false });
209
+ details.push({ name: `${folder} has inputs defined`, passed: false });
210
+ details.push({ name: `${folder} has outputs defined`, passed: false });
211
+ details.push({ name: `${folder} has dependencies defined`, passed: false });
212
+ }
213
+ }
214
+
215
+ const contextMdPath = path.join(ws, 'CONTEXT.md');
216
+ if (fs.existsSync(contextMdPath)) {
217
+ const content = fs.readFileSync(contextMdPath, 'utf-8');
218
+ const allReferenced = stageFolders.every((f) => content.includes(f));
219
+ details.push({
220
+ name: 'Routing table references all numbered folders',
221
+ passed: allReferenced,
222
+ });
223
+ } else {
224
+ details.push({
225
+ name: 'Routing table references all numbered folders',
226
+ passed: false,
227
+ });
228
+ }
229
+
230
+ const readmePath = path.join(ws, 'README.md');
231
+ details.push({
232
+ name: 'README.md exists and has usage instructions',
233
+ passed: fs.existsSync(readmePath) && fs.readFileSync(readmePath, 'utf-8').trim().length > 0,
234
+ });
235
+
236
+ const passed = details.filter((d) => d.passed).length;
237
+ const failed = details.filter((d) => !d.passed).length;
238
+
239
+ return {
240
+ items: details.length,
241
+ passed,
242
+ failed,
243
+ details,
244
+ };
245
+ }
246
+
247
+ function getNumberedFolders(workspacePath: string): string[] {
248
+ const entries = fs.readdirSync(workspacePath, { withFileTypes: true });
249
+ return entries
250
+ .filter((e) => e.isDirectory() && /^\d{2}-/.test(e.name) && e.name !== '00-meta')
251
+ .map((e) => e.name);
252
+ }
253
+
254
+ if (require.main === module) {
255
+ const args = process.argv.slice(2);
256
+ const parseArg = (flag: string): string | undefined => {
257
+ const idx = args.indexOf(flag);
258
+ return idx !== -1 ? args[idx + 1] : undefined;
259
+ };
260
+
261
+ const workspace = parseArg('--workspace');
262
+ const maxRetriesStr = parseArg('--max-retries');
263
+ const maxRetries = maxRetriesStr ? parseInt(maxRetriesStr, 10) : 3;
264
+
265
+ if (!workspace) {
266
+ console.error('Usage: node iterate.ts --workspace <path> [--max-retries <n>]');
267
+ process.exit(1);
268
+ }
269
+
270
+ iterateWorkspace(workspace, { maxRetries });
271
+ }