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,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,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,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
|