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,303 @@
1
+ import * as fs from 'fs';
2
+ import * as path from 'path';
3
+
4
+ describe('enhanced validation sub-skill', () => {
5
+ const skillPath = path.join(
6
+ __dirname,
7
+ '..',
8
+ 'templates',
9
+ '.workspace-templates',
10
+ 'skills',
11
+ 'validation',
12
+ 'SKILL.md',
13
+ );
14
+
15
+ type FrontmatterValue = string | string[];
16
+ type ParsedFrontmatter = {
17
+ boundaryLength: number;
18
+ fields: Record<string, FrontmatterValue>;
19
+ };
20
+
21
+ const allowedNextSkills = ['fixer', 'orchestrator', 'none'] as const;
22
+
23
+ const escapeRegExp = (value: string): string => value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
24
+
25
+ const stripOuterQuotes = (value: string): string => value.trim().replace(/^['"]|['"]$/g, '').trim();
26
+
27
+ const parseInlineYamlArray = (value: string): string[] =>
28
+ value
29
+ .replace(/^\[/, '')
30
+ .replace(/\]$/, '')
31
+ .split(',')
32
+ .map((item) => stripOuterQuotes(item))
33
+ .filter((item) => item.length > 0);
34
+
35
+ const parseFrontmatter = (content: string): ParsedFrontmatter | null => {
36
+ const frontmatterMatch = content.match(/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);
37
+
38
+ if (!frontmatterMatch) {
39
+ return null;
40
+ }
41
+
42
+ const fields: Record<string, FrontmatterValue> = {};
43
+ const lines = frontmatterMatch[1].split(/\r?\n/);
44
+ let lineIndex = 0;
45
+
46
+ while (lineIndex < lines.length) {
47
+ const line = lines[lineIndex];
48
+ const keyValueMatch = line.match(/^([A-Za-z][A-Za-z0-9_-]*):\s*(.*)$/);
49
+
50
+ if (!keyValueMatch) {
51
+ lineIndex += 1;
52
+ continue;
53
+ }
54
+
55
+ const [, key, rawValue] = keyValueMatch;
56
+
57
+ if (key !== 'triggers') {
58
+ fields[key] = stripOuterQuotes(rawValue);
59
+ lineIndex += 1;
60
+ continue;
61
+ }
62
+
63
+ const inlineTriggers = rawValue.trim();
64
+
65
+ if (inlineTriggers.length > 0) {
66
+ fields[key] = /^\[.*\]$/.test(inlineTriggers)
67
+ ? parseInlineYamlArray(inlineTriggers)
68
+ : [stripOuterQuotes(inlineTriggers)];
69
+ lineIndex += 1;
70
+ continue;
71
+ }
72
+
73
+ const triggerItems: string[] = [];
74
+ lineIndex += 1;
75
+
76
+ while (lineIndex < lines.length) {
77
+ const candidateLine = lines[lineIndex];
78
+
79
+ if (!candidateLine.trim()) {
80
+ lineIndex += 1;
81
+ continue;
82
+ }
83
+
84
+ if (/^[A-Za-z][A-Za-z0-9_-]*:\s*/.test(candidateLine)) {
85
+ break;
86
+ }
87
+
88
+ const listItemMatch = candidateLine.match(/^\s*-\s+(.+?)\s*$/);
89
+
90
+ if (listItemMatch) {
91
+ triggerItems.push(stripOuterQuotes(listItemMatch[1]));
92
+ }
93
+
94
+ lineIndex += 1;
95
+ }
96
+
97
+ fields[key] = triggerItems;
98
+ }
99
+
100
+ return {
101
+ boundaryLength: frontmatterMatch[0].length,
102
+ fields,
103
+ };
104
+ };
105
+
106
+ const getSectionBody = (content: string, heading: string): string | null => {
107
+ const headingPattern = escapeRegExp(heading);
108
+ const sectionMatch = content.match(
109
+ new RegExp(`##\\s+${headingPattern}\\s*\\r?\\n([\\s\\S]*?)(?=\\r?\\n##\\s+|$)`, 'i'),
110
+ );
111
+
112
+ return sectionMatch ? sectionMatch[1] : null;
113
+ };
114
+
115
+ let content = '';
116
+ let parsedFrontmatter: ParsedFrontmatter | null = null;
117
+
118
+ beforeAll(() => {
119
+ if (fs.existsSync(skillPath)) {
120
+ content = fs.readFileSync(skillPath, 'utf-8');
121
+ parsedFrontmatter = parseFrontmatter(content);
122
+ }
123
+ });
124
+
125
+ it('exists', () => {
126
+ expect(fs.existsSync(skillPath)).toBe(true);
127
+ });
128
+
129
+ it('has YAML frontmatter at the top with required keys and triggers', () => {
130
+ expect(parsedFrontmatter).not.toBeNull();
131
+
132
+ if (!parsedFrontmatter) {
133
+ return;
134
+ }
135
+
136
+ expect(parsedFrontmatter.fields.name).toBe('validation');
137
+
138
+ const descriptionValue = parsedFrontmatter.fields.description;
139
+ expect(typeof descriptionValue).toBe('string');
140
+ expect(String(descriptionValue).trim()).not.toBe('');
141
+
142
+ const triggersValue = parsedFrontmatter.fields.triggers;
143
+ expect(Array.isArray(triggersValue)).toBe(true);
144
+
145
+ if (Array.isArray(triggersValue)) {
146
+ expect(triggersValue.length).toBeGreaterThan(0);
147
+ for (const trigger of triggersValue) {
148
+ expect(trigger.trim()).not.toBe('');
149
+ }
150
+ }
151
+
152
+ const firstHeadingIndex = content.search(/\r?\n##\s+/);
153
+ expect(firstHeadingIndex).toBeGreaterThan(parsedFrontmatter.boundaryLength - 1);
154
+
155
+ const betweenFrontmatterAndFirstHeading = content
156
+ .slice(parsedFrontmatter.boundaryLength, firstHeadingIndex)
157
+ .trim();
158
+ expect(betweenFrontmatterAndFirstHeading).toBe('');
159
+ });
160
+
161
+ it('has required enhanced sections', () => {
162
+ expect(content).toContain('## Overview');
163
+ expect(content).toContain('## When to Use');
164
+ expect(content).toContain('## When Not to Use');
165
+ expect(content).toContain('## The Iron Law');
166
+ expect(content).toContain('## The Process');
167
+ expect(content).toContain('## Batch-Level Validation');
168
+ expect(content).toContain('## Anti-Rationalization Table');
169
+ expect(content).toContain('## Sub-Skill Dispatch');
170
+ expect(content).toContain('## Report Format');
171
+ });
172
+
173
+ it('has the Task 7 validation Iron Law constraints', () => {
174
+ const ironLawSection = getSectionBody(content, 'The Iron Law');
175
+
176
+ expect(ironLawSection).not.toBeNull();
177
+
178
+ if (!ironLawSection) {
179
+ return;
180
+ }
181
+
182
+ expect(ironLawSection).toMatch(/NO\s+SCORE\s+INFLATION/i);
183
+ expect(ironLawSection).toMatch(/NO\s+SKIPPING\s+FAILURES/i);
184
+ expect(ironLawSection).toMatch(/NO\s+VALIDATING\s+WITHOUT\s+BENCHMARK/i);
185
+ expect(ironLawSection).toMatch(/NO\s+PASSING\s+WITHOUT\s+EVIDENCE/i);
186
+ });
187
+
188
+ it('has anti-rationalization guidance tied to scoring and validation discipline', () => {
189
+ const antiRationalizationSection = getSectionBody(content, 'Anti-Rationalization Table');
190
+
191
+ expect(antiRationalizationSection).not.toBeNull();
192
+
193
+ if (!antiRationalizationSection) {
194
+ return;
195
+ }
196
+
197
+ expect(antiRationalizationSection).toContain('| Thought | Reality |');
198
+ expect(antiRationalizationSection).toMatch(/round\s+up|score\s+inflation/i);
199
+ expect(antiRationalizationSection).toMatch(/one\s+failure\s+does\s+not\s+matter|every\s+failure\s+matters/i);
200
+ expect(antiRationalizationSection).toMatch(/re-?validate\s+after\s+every\s+change|re-?validate/i);
201
+ });
202
+
203
+ it('captures batch-level validation semantics and benchmark references', () => {
204
+ const processSection = getSectionBody(content, 'The Process');
205
+ const batchSection = getSectionBody(content, 'Batch-Level Validation');
206
+ const dispatchSection = getSectionBody(content, 'Sub-Skill Dispatch');
207
+
208
+ expect(processSection).not.toBeNull();
209
+ expect(batchSection).not.toBeNull();
210
+ expect(dispatchSection).not.toBeNull();
211
+
212
+ if (!processSection || !batchSection || !dispatchSection) {
213
+ return;
214
+ }
215
+
216
+ expect(processSection).toMatch(/validate\.ts/i);
217
+ expect(processSection).toMatch(/benchmark\.ts/i);
218
+ expect(processSection).toMatch(/batch-?report\.json/i);
219
+ expect(processSection).toMatch(/nextSkill[\s\S]*fixer[\s\S]*orchestrator[\s\S]*none/i);
220
+
221
+ expect(batchSection).toMatch(/\.agents\/iteration\/batch-<N>\//i);
222
+ expect(batchSection).toMatch(/report\.json/i);
223
+ expect(batchSection).toMatch(/per-?test-?case\s+pass\/?fail/i);
224
+ expect(batchSection).toMatch(/overall\s+batch\s+score/i);
225
+ expect(batchSection).toMatch(/score\s*<\s*threshold[\s\S]{0,80}fixer/i);
226
+
227
+ for (const nextSkill of allowedNextSkills) {
228
+ expect(dispatchSection).toMatch(new RegExp(`\\b${escapeRegExp(nextSkill)}\\b`, 'i'));
229
+ }
230
+ });
231
+
232
+ it('has a parseable report format JSON block with benchmark-linked fields', () => {
233
+ const reportJsonBlockMatch = content.match(/## Report Format[\s\S]*?```json\r?\n([\s\S]*?)\r?\n```/i);
234
+
235
+ expect(reportJsonBlockMatch).not.toBeNull();
236
+
237
+ if (!reportJsonBlockMatch) {
238
+ return;
239
+ }
240
+
241
+ const reportSample = JSON.parse(reportJsonBlockMatch[1]);
242
+
243
+ expect(reportSample).toEqual(
244
+ expect.objectContaining({
245
+ skill: 'validation',
246
+ status: expect.any(String),
247
+ timestamp: expect.any(String),
248
+ batchId: expect.any(Number),
249
+ findings: expect.any(Array),
250
+ fixSuggestions: expect.any(Array),
251
+ recommendations: expect.any(Array),
252
+ metrics: expect.any(Object),
253
+ nextSkill: expect.any(String),
254
+ }),
255
+ );
256
+
257
+ expect(reportSample.metrics).toEqual(
258
+ expect.objectContaining({
259
+ score: expect.any(Number),
260
+ benchmarkScore: expect.any(Number),
261
+ itemsChecked: expect.any(Number),
262
+ itemsPassed: expect.any(Number),
263
+ testCasesPassed: expect.any(Number),
264
+ testCasesFailed: expect.any(Number),
265
+ }),
266
+ );
267
+
268
+ const normalizedNextSkill = String(reportSample.nextSkill).trim().toLowerCase();
269
+ expect(
270
+ allowedNextSkills.includes(normalizedNextSkill as (typeof allowedNextSkills)[number]),
271
+ ).toBe(true);
272
+ });
273
+
274
+ it('keeps process report shape aligned with the report format fields', () => {
275
+ const processSection = getSectionBody(content, 'The Process');
276
+
277
+ expect(processSection).not.toBeNull();
278
+
279
+ if (!processSection) {
280
+ return;
281
+ }
282
+
283
+ expect(processSection).toMatch(/Write\s+batch-?report\.json/i);
284
+
285
+ const requiredFields = [
286
+ 'skill',
287
+ 'status',
288
+ 'timestamp',
289
+ 'batchId',
290
+ 'findings',
291
+ 'fixSuggestions',
292
+ 'recommendations',
293
+ 'metrics',
294
+ 'nextSkill',
295
+ ];
296
+
297
+ for (const field of requiredFields) {
298
+ expect(processSection).toMatch(new RegExp(`\\b${escapeRegExp(field)}\\b`, 'i'));
299
+ }
300
+
301
+ expect(processSection).toMatch(/nextSkill[\s\S]*fixer[\s\S]*orchestrator[\s\S]*none/i);
302
+ });
303
+ });
@@ -0,0 +1,88 @@
1
+ import * as fs from 'fs';
2
+ import * as path from 'path';
3
+
4
+ describe('worker sub-skill', () => {
5
+ const skillPath = path.join(__dirname, '..', 'templates', '.workspace-templates', 'skills', 'worker', 'SKILL.md');
6
+
7
+ it('exists', () => {
8
+ expect(fs.existsSync(skillPath)).toBe(true);
9
+ });
10
+
11
+ it('has YAML frontmatter at the top with required keys', () => {
12
+ const content = fs.readFileSync(skillPath, 'utf-8');
13
+ const frontmatterMatch = content.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n/);
14
+
15
+ expect(frontmatterMatch).not.toBeNull();
16
+
17
+ if (!frontmatterMatch) {
18
+ return;
19
+ }
20
+
21
+ const frontmatter = frontmatterMatch[1];
22
+
23
+ expect(frontmatter).toMatch(/^name:\s*worker\s*$/m);
24
+ expect(frontmatter).toMatch(/^description:\s*".+"\s*$/m);
25
+ expect(frontmatter).toMatch(/^triggers:\s*\[[^\]]+\]\s*$/m);
26
+
27
+ const firstHeadingIndex = content.indexOf('\n## ');
28
+ expect(firstHeadingIndex).toBeGreaterThan(frontmatterMatch[0].length - 1);
29
+
30
+ const betweenFrontmatterAndFirstHeading = content
31
+ .slice(frontmatterMatch[0].length, firstHeadingIndex)
32
+ .trim();
33
+ expect(betweenFrontmatterAndFirstHeading).toBe('');
34
+ });
35
+
36
+ it('has Iron Law section', () => {
37
+ const content = fs.readFileSync(skillPath, 'utf-8');
38
+ expect(content.toLowerCase()).toContain('the iron law');
39
+ });
40
+
41
+ it('has Anti-Rationalization Table', () => {
42
+ const content = fs.readFileSync(skillPath, 'utf-8');
43
+ expect(content).toContain('| Thought | Reality |');
44
+ });
45
+
46
+ it('has Report Format section with required worker report fields', () => {
47
+ const content = fs.readFileSync(skillPath, 'utf-8');
48
+ expect(content.toLowerCase()).toContain('report format');
49
+
50
+ const reportJsonBlockMatch = content.match(/## Report Format[\s\S]*?```json\r?\n([\s\S]*?)\r?\n```/i);
51
+ expect(reportJsonBlockMatch).not.toBeNull();
52
+
53
+ if (!reportJsonBlockMatch) {
54
+ return;
55
+ }
56
+
57
+ const reportSample = JSON.parse(reportJsonBlockMatch[1]);
58
+
59
+ expect(reportSample).toEqual(
60
+ expect.objectContaining({
61
+ skill: 'worker',
62
+ status: expect.any(String),
63
+ timestamp: expect.any(String),
64
+ testCaseId: expect.any(String),
65
+ batchId: expect.any(Number),
66
+ findings: expect.any(Array),
67
+ recommendations: expect.any(Array),
68
+ metrics: expect.any(Object),
69
+ nextSkill: 'validation',
70
+ }),
71
+ );
72
+
73
+ expect(reportSample.metrics).toEqual(
74
+ expect.objectContaining({
75
+ executionTimeMs: expect.any(Number),
76
+ outputLength: expect.any(Number),
77
+ }),
78
+ );
79
+ });
80
+
81
+ it('keeps Process report shape aligned with Report Format fields', () => {
82
+ const content = fs.readFileSync(skillPath, 'utf-8');
83
+
84
+ expect(content).toContain('Write report.json');
85
+ expect(content).toContain('{skill, status, timestamp, testCaseId, batchId, findings, recommendations, metrics, nextSkill}');
86
+ expect(content).not.toContain('{testCaseId, status, output, findings}');
87
+ });
88
+ });
package/tsconfig.json ADDED
@@ -0,0 +1,19 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "module": "commonjs",
5
+ "lib": ["ES2020"],
6
+ "outDir": "./dist",
7
+ "rootDir": "./src",
8
+ "strict": true,
9
+ "esModuleInterop": true,
10
+ "skipLibCheck": true,
11
+ "forceConsistentCasingInFileNames": true,
12
+ "resolveJsonModule": true,
13
+ "declaration": true,
14
+ "declarationMap": true,
15
+ "sourceMap": true
16
+ },
17
+ "include": ["src/**/*"],
18
+ "exclude": ["node_modules", "dist", "tests"]
19
+ }
@@ -0,0 +1,3 @@
1
+ # 00-meta Context
2
+
3
+ Metadata and tool inventory for the NoAgent Test workspace.
@@ -0,0 +1,17 @@
1
+ # Execution Log
2
+
3
+ ## Stage Checklist
4
+
5
+ - [ ] 01-input
6
+
7
+ ## Rules
8
+
9
+ 1. Mark a stage complete only after its completion criteria are satisfied.
10
+ 2. Stages must be checked in ascending numerical order.
11
+ 3. Every checked stage must have corresponding evidence notes.
12
+
13
+ ## Evidence Notes
14
+
15
+ ### 01-input
16
+ - Artifacts:
17
+ - Handoff Summary:
@@ -0,0 +1,11 @@
1
+ ## Tool Inventory
2
+
3
+ ## Installed Tools
4
+
5
+ | Tool | Version | Manager | Installed |
6
+ |------|---------|---------|-----------|
7
+ | — | — | — | — |
8
+
9
+ ## Pending Tools
10
+
11
+ List tools that are proposed but not yet approved.
@@ -0,0 +1,27 @@
1
+ # 01-input — Context
2
+
3
+ ## Purpose
4
+ This folder executes the 01-input stage of the NoAgent Test workflow.
5
+
6
+ ## Inputs
7
+ - Required data artifacts for 01-input
8
+ - Upstream context from previous stage when applicable
9
+
10
+ ## Outputs
11
+ - Stage-specific deliverables for downstream consumption
12
+ - Updated markdown artifacts needed by the next stage
13
+
14
+ ## Dependencies
15
+ - None (entry stage)
16
+
17
+ ## Required Evidence
18
+ - Update `00-meta/execution-log.md` to mark 01-input complete before handoff.
19
+ - Link or reference the markdown artifacts produced in this stage.
20
+
21
+ ## Completion Criteria
22
+ - Required outputs are produced and non-empty
23
+ - Outputs conform to stage purpose and markdown-first workflow format
24
+ - Handoff notes are updated for downstream stage
25
+
26
+ ## Handoff
27
+ - This is the terminal stage. Package and deliver final output.
@@ -0,0 +1,35 @@
1
+ # NoAgent Test — Context Router
2
+
3
+ ## How to Use This File
4
+ Use this file to route each task to the smallest required context scope.
5
+
6
+ ## Task Routing
7
+ This routing table maps task intent to the correct stage context.
8
+
9
+ | When you need to... | Load | Why |
10
+ |---------------------|------|-----|
11
+ | Understand workspace constraints | `SYSTEM.md` | Global rules and stage boundaries |
12
+ | Work in 01-input tasks | `01-input/CONTEXT.md` | Stage contract and required outputs |
13
+ | Check available tools | `00-meta/tools.md` | Tool inventory and approval status |
14
+
15
+ ## Loading Order
16
+ 1. `SYSTEM.md` (always)
17
+ 2. This root `CONTEXT.md`
18
+ 3. One relevant stage `CONTEXT.md`
19
+ 4. Only the task files needed for that stage
20
+
21
+ ## Scope Guardrails
22
+ - Route domain requests into workflow design steps and markdown deliverables.
23
+ - Do not scaffold backend, frontend, or runtime product source files from this router.
24
+ - Keep outputs file-structured and markdown-first across numbered workflow folders.
25
+
26
+ ## Sequential Routing Contract
27
+ - Route only to the earliest incomplete stage in `00-meta/execution-log.md`.
28
+ - Refuse jumps to later stages when earlier stages are not marked complete.
29
+ - Append handoff notes for each completed stage before routing onward.
30
+
31
+ ## Stage Handoff Routing
32
+ - `01-input` -> deliver final output and close loop
33
+
34
+ ## Escalation
35
+ Escalate when required sections are missing, dependencies are contradictory, or no valid stage route can satisfy the task.
@@ -0,0 +1,14 @@
1
+ # NoAgent Test Workspace
2
+
3
+ ## Structure
4
+
5
+ - `01-input/`
6
+ - `00-meta/`
7
+
8
+ ## Usage
9
+
10
+ 1. Follow the workflow stages in order
11
+ 2. Load CONTEXT.md files selectively — only what you need
12
+ 3. Update 00-meta/execution-log.md after each completed stage
13
+ 4. Keep outputs in stage folders as markdown workflow artifacts
14
+ 5. Run validate.ts to check ICM compliance
@@ -0,0 +1,36 @@
1
+ # NoAgent Test — System Prompt
2
+
3
+ ## Role
4
+ You are an AI assistant operating inside the NoAgent Test workspace. Follow stage boundaries and route tasks through stage-specific CONTEXT files.
5
+
6
+ ## Folder Map
7
+
8
+ | Stage | Folder | Purpose |
9
+ |------:|--------|---------|
10
+ | 1 | `01-input/` | Input collection and validation |
11
+ | meta | `00-meta/` | Workspace configuration, tool inventory, and session notes |
12
+
13
+ ## Workflow Rules
14
+ 1. Read `SYSTEM.md` first, then root `CONTEXT.md`.
15
+ 2. Load only one stage `CONTEXT.md` at a time unless handoff explicitly requires another stage.
16
+ 3. Keep information canonical; do not duplicate facts across files.
17
+ 4. Maintain one-way stage dependencies from earlier stage numbers to later stage numbers.
18
+
19
+ ## Scope Guardrails
20
+ - Build and maintain workflow documentation, not product implementation code.
21
+ - Keep stage outputs as markdown artifacts (plans, checklists, prompts, routing notes).
22
+ - If asked to build the product itself, capture that request as workflow requirements and stay in ICM workspace scope.
23
+
24
+ ## Sequential Execution Protocol
25
+ 1. Complete stages strictly in ascending numeric order.
26
+ 2. Record stage completion in `00-meta/execution-log.md` before moving to the next stage.
27
+ 3. Do not produce final deliverables until all prior stage checkboxes are complete.
28
+
29
+ ## Stage Boundaries
30
+ - Each numbered folder is an execution stage.
31
+ - A stage may consume upstream outputs but must not redefine upstream facts.
32
+ - Cross-stage jumps require explicit routing through root `CONTEXT.md`.
33
+
34
+ ## Tooling Policy
35
+ - Check `00-meta/tools.md` before proposing tool installation.
36
+ - Document approved tooling changes in `00-meta/tools.md`.
Binary file