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,29 @@
1
+ # 01-input CONTEXT.md
2
+
3
+ ## Purpose
4
+ Collect, validate, and normalize workflow inputs.
5
+
6
+ ## Inputs
7
+ - Raw user input and source artifacts
8
+ - Intake constraints and acceptance boundaries
9
+
10
+ ## Outputs
11
+ - Validated input package ready for processing
12
+ - Input assumptions and constraints summary
13
+ - Markdown workflow artifacts only (no product source code)
14
+
15
+ ## Dependencies
16
+ - None (entry stage)
17
+
18
+ ## Required Evidence
19
+ - Update 00-meta/execution-log.md when 01-input is complete
20
+ - Link the markdown artifacts produced in this stage
21
+
22
+ ## Completion Criteria
23
+ - Inputs are validated and normalized
24
+ - Required fields are present
25
+ - Handoff package is complete
26
+ - Stage artifacts remain markdown-first and workflow-scoped
27
+
28
+ ## Handoff
29
+ - Hand off validated package to 02-process
@@ -0,0 +1,29 @@
1
+ # 02-process CONTEXT.md
2
+
3
+ ## Purpose
4
+ Transform validated inputs into structured working outputs.
5
+
6
+ ## Inputs
7
+ - Validated package from 01-input
8
+ - Processing requirements and quality constraints
9
+
10
+ ## Outputs
11
+ - Processed artifacts ready for final delivery
12
+ - Decision log for key transformations
13
+ - Markdown workflow artifacts only (no product source code)
14
+
15
+ ## Dependencies
16
+ - 01-input
17
+
18
+ ## Required Evidence
19
+ - Update 00-meta/execution-log.md when 02-process is complete
20
+ - Link the markdown artifacts produced in this stage
21
+
22
+ ## Completion Criteria
23
+ - Required transformations are complete
24
+ - Output structure is consistent and reviewable
25
+ - Handoff package is ready for output stage
26
+ - Stage artifacts remain markdown-first and workflow-scoped
27
+
28
+ ## Handoff
29
+ - Hand off processed artifacts to 03-output
@@ -0,0 +1,29 @@
1
+ # 03-output CONTEXT.md
2
+
3
+ ## Purpose
4
+ Assemble, finalize, and deliver workflow outputs.
5
+
6
+ ## Inputs
7
+ - Processed artifacts from 02-process
8
+ - Delivery requirements and formatting rules
9
+
10
+ ## Outputs
11
+ - Final deliverable package
12
+ - Delivery notes and validation summary
13
+ - Markdown workflow artifacts only (no product source code)
14
+
15
+ ## Dependencies
16
+ - 02-process
17
+
18
+ ## Required Evidence
19
+ - Update 00-meta/execution-log.md when 03-output is complete
20
+ - Link the markdown artifacts produced in this stage
21
+
22
+ ## Completion Criteria
23
+ - Final outputs satisfy delivery requirements
24
+ - Validation summary is complete
25
+ - Artifacts are ready for handoff to user
26
+ - Stage artifacts remain markdown-first and workflow-scoped
27
+
28
+ ## Handoff
29
+ - Final output stage: deliver package and close the workflow loop
@@ -0,0 +1,14 @@
1
+ # Workspace README
2
+
3
+ This is an example workspace built using ICM methodology.
4
+
5
+ ## Structure
6
+ - 00-meta: Metadata and configuration
7
+ - 01-input: Input collection
8
+ - 02-process: Processing logic
9
+ - 03-output: Output generation
10
+
11
+ ## Usage
12
+ Load SYSTEM.md first, then use CONTEXT.md to route to the appropriate workspace section.
13
+ Keep stage outputs as markdown workflow artifacts rather than product source code.
14
+ Update 00-meta/execution-log.md as each stage is completed to preserve sequential execution.
@@ -0,0 +1,312 @@
1
+ ---
2
+ name: workspace-maxxing
3
+ description: "Autonomously creates, validates, and improves ICM-compliant workspaces using batched parallel sub-agents. Use when user asks to 'build a workspace', 'create a workflow', 'automate a process', 'improve this workspace', 'validate this workspace', 'iterate on this workspace', or 'run test cases'."
4
+ ---
5
+
6
+ # Workspace-Maxxing Skill
7
+
8
+ ## Overview
9
+
10
+ Autonomous workflow system that creates, validates, and improves ICM-compliant workspaces through phased execution, batched parallel sub-agent iteration, and condition-driven improvement loops.
11
+
12
+ ## When to Use
13
+
14
+ - User asks to build, create, or automate a workflow
15
+ - User asks to improve, validate, or iterate on an existing workspace
16
+ - User asks for workspace architecture or structure design
17
+ - User asks to assess or install tools for a workspace
18
+ - User asks to run test cases against a workspace
19
+
20
+ ## When Not to Use
21
+
22
+ - Simple file creation or editing (use direct file operations)
23
+ - Questions about ICM methodology (answer directly)
24
+ - Non-workspace tasks (check for other applicable skills first)
25
+
26
+ ## The Iron Law
27
+
28
+ NO BUILD WITHOUT PLAN
29
+ NO PLAN WITHOUT RESEARCH
30
+ NO IMPROVEMENT WITHOUT VALIDATION
31
+ NO COMPLETION CLAIM WITHOUT VERIFICATION
32
+ NO PRODUCT IMPLEMENTATION INSIDE WORKSPACE BUILDING MODE
33
+ NO STAGE SKIPPING ACROSS NUMBERED WORKFLOW FOLDERS
34
+
35
+ ## Scope Guardrails
36
+
37
+ - This skill builds an ICM workflow workspace, not the end-product application.
38
+ - Keep outputs as file-structured markdown workflow artifacts in numbered stage folders.
39
+ - Do not generate backend/frontend/runtime code for the target domain while running this skill.
40
+ - If a user asks for product implementation details, capture them as workflow requirements and continue building the workspace structure.
41
+
42
+ ## Sequential Enforcement
43
+
44
+ - Follow numbered stage folders in strict order; do not jump ahead.
45
+ - Use 00-meta/execution-log.md as the source of truth for stage completion state.
46
+ - A later stage is blocked until the previous stage is checked complete with evidence notes.
47
+
48
+ ## Hybrid Flow
49
+
50
+ ```
51
+ Phase 1: RESEARCH (dispatch research sub-skill)
52
+ ->
53
+ Phase 2: ARCHITECTURE (dispatch architecture sub-skill)
54
+ ->
55
+ Phase 3: BUILD (use scaffold.ts script)
56
+ ->
57
+ Phase 4: VALIDATE (dispatch validation sub-skill)
58
+ ->
59
+ Phase 5: AUTONOMOUS ITERATION (use orchestrator.ts)
60
+ - Generate test cases
61
+ - Split into batches
62
+ - Dispatch workers in parallel per batch
63
+ - Validate batch results
64
+ - If score < threshold and failing test cases exist -> dispatch fixer sub-agents -> re-validate
65
+ - If score < threshold and no actionable failing test cases exist -> failed/escalated outcome
66
+ - Next batch or complete
67
+ ->
68
+ Phase 6: DELIVER
69
+ ```
70
+
71
+ ## Autonomous Iteration Workflow
72
+
73
+ The orchestrator manages batched parallel sub-agent execution:
74
+
75
+ ```bash
76
+ node scripts/orchestrator.ts --workspace ./workspace --batch-size 3 --score-threshold 85 --subagent-runner "<your-runner-command>"
77
+ ```
78
+
79
+ **Flow:**
80
+ 1. Generate test cases from workspace stages
81
+ 2. Split into batches (default 3 per batch)
82
+ 3. Dispatch worker sub-agents in parallel for each batch (external runner mode)
83
+ 4. Validate batch outputs with benchmark scoring
84
+ 5. If batch score < threshold and failing test cases exist -> dispatch fixer sub-agents -> re-validate (max 3 retries)
85
+ 6. If score remains < threshold and no actionable failing test cases exist -> mark batch failed/escalated
86
+ 7. Move to next batch or write summary
87
+
88
+ **Options:**
89
+ - `--batch-size <n>` - Test cases per batch (default: 3)
90
+ - `--score-threshold <n>` - Minimum batch score to pass (default: 85)
91
+ - `--max-fix-retries <n>` - Max fix attempts per batch (default: 3)
92
+ - `--worker-timeout <s>` - Worker timeout in seconds (default: 300)
93
+ - `--subagent-runner <command>` - External command template used to execute worker/fixer sub-agents; supports placeholders `{skill}`, `{workspace}`, `{batchId}`, `{testCaseId}`
94
+
95
+ ## Sub-Agent Iteration Contract
96
+
97
+ - True sub-agent mode requires `--subagent-runner` (or `WORKSPACE_MAXXING_SUBAGENT_RUNNER`) so worker/fixer test cases execute outside the orchestrator process.
98
+ - Worker/fixer execution MUST fail fast when no runner command is configured.
99
+ - Batch artifacts must include generated test cases, per-test-case reports, and summary evidence under `.agents/iteration/`.
100
+
101
+ ## Sub-Agent Runner Contract
102
+
103
+ - Worker/fixer loops are external-runner-only in strict mode.
104
+ - The runner command template must support placeholders: `{skill}`, `{workspace}`, `{batchId}`, `{testCaseId}`.
105
+ - Expected runner output is JSON with `{skill, status, timestamp, findings, recommendations, metrics, nextSkill}`.
106
+ - Non-JSON runner output is treated as a runner contract failure for worker/fixer execution.
107
+ - Use telemetry artifacts under `.agents/iteration/runs/` to diagnose command/rendering or payload issues.
108
+
109
+ ## Sub-Skill Dispatch
110
+
111
+ | Condition | Sub-Skill | Command |
112
+ |-----------|-----------|---------|
113
+ | Starting new workflow | `research` | `node scripts/dispatch.ts --skill research --workspace ./workspace` |
114
+ | After research complete | `architecture` | `node scripts/dispatch.ts --skill architecture --workspace ./workspace` |
115
+ | After architecture approved | (use scaffold.ts) | `node scripts/scaffold.ts --name "<name>" --stages "<stages>" --output ./workspace` |
116
+ | After building | `validation` | `node scripts/dispatch.ts --skill validation --workspace ./workspace` |
117
+ | Running autonomous iteration | (use orchestrator.ts) | `node scripts/orchestrator.ts --workspace ./workspace --subagent-runner "<runner>"` |
118
+ | Worker execution | `worker` | `node scripts/dispatch.ts --skill worker --workspace ./workspace --batch-id <N> --runner-command "<runner {skill} {workspace} {batchId} {testCaseId}>"` |
119
+ | Fix loop | `fixer` | `node scripts/dispatch.ts --skill fixer --workspace ./workspace --batch-id <N> --runner-command "<runner {skill} {workspace} {batchId} {testCaseId}>"` |
120
+ | Manual condition loop only (not orchestrator batch loop): score < 85 due to prompt quality | `prompt-engineering` | `node scripts/dispatch.ts --skill prompt-engineering --workspace ./workspace` |
121
+ | Manual condition loop only (not orchestrator batch loop): no tests exist | `testing` | `node scripts/dispatch.ts --skill testing --workspace ./workspace` |
122
+ | Manual condition loop only (not orchestrator batch loop): score plateaued across full runs | `iteration` | `node scripts/dispatch.ts --skill iteration --workspace ./workspace` |
123
+ | Manual condition loop only (not orchestrator batch loop): tools missing | `tooling` | `node scripts/dispatch.ts --skill tooling --workspace ./workspace` |
124
+
125
+ ## Available Scripts
126
+
127
+ ### orchestrator.ts - Autonomous Batch Iteration
128
+
129
+ Runs the full batched parallel sub-agent workflow.
130
+
131
+ ```bash
132
+ node scripts/orchestrator.ts --workspace ./workspace --batch-size 3 --score-threshold 85 --subagent-runner "<runner>"
133
+ ```
134
+
135
+ ### scaffold.ts - Generate ICM Workspace
136
+
137
+ Creates a complete ICM workspace structure from a plan.
138
+
139
+ ```bash
140
+ node scripts/scaffold.ts --name "research" --stages "01-research,02-analysis,03-report" --output ./workspace
141
+ ```
142
+
143
+ ### validate.ts - Check ICM Compliance
144
+
145
+ Validates a workspace against ICM rules.
146
+
147
+ ```bash
148
+ node scripts/validate.ts --workspace ./workspace
149
+ ```
150
+
151
+ ### install-tool.ts - Install Packages
152
+
153
+ Installs a tool and updates the workspace inventory.
154
+
155
+ ```bash
156
+ node scripts/install-tool.ts --tool "pdf-lib" --manager npm --workspace ./workspace
157
+ ```
158
+
159
+ ### iterate.ts - Single-Workspace Iteration (legacy)
160
+
161
+ Runs a 3-pass improvement loop. Use orchestrator.ts for batched parallel iteration.
162
+
163
+ ```bash
164
+ node scripts/iterate.ts --workspace ./workspace --max-retries 3
165
+ ```
166
+
167
+ ### generate-tests.ts - Generate Test Cases
168
+
169
+ Creates test cases for each stage (sample, edge-case, empty).
170
+
171
+ ```bash
172
+ node scripts/generate-tests.ts --workspace ./workspace --output ./tests.json
173
+ ```
174
+
175
+ ### benchmark.ts - Weighted Benchmark Scoring
176
+
177
+ Runs weighted benchmark scoring on a workspace.
178
+
179
+ ```bash
180
+ node scripts/benchmark.ts --workspace ./workspace
181
+ ```
182
+
183
+ ### dispatch.ts - Sub-Skill Dispatcher
184
+
185
+ Loads and executes sub-skill workflows. Supports parallel dispatch.
186
+
187
+ ```bash
188
+ node scripts/dispatch.ts --skill <name> --workspace ./workspace [--batch-id <N>] [--parallel --invocations <path>]
189
+ ```
190
+
191
+ ## Anti-Rationalization Table
192
+
193
+ | Thought | Reality |
194
+ |---------|---------|
195
+ | "This workspace looks good enough" | Good enough is the enemy of excellent. Run validation. |
196
+ | "I'll skip research and go straight to building" | Building without research produces generic, non-optimal workspaces. |
197
+ | "The user didn't ask for tests" | Autonomous workflows require self-verification. Tests are mandatory. |
198
+ | "I'll fix this later" | Later never comes. Fix it now or escalate. |
199
+ | "This sub-skill doesn't apply here" | If there's a 1% chance it applies, dispatch it. |
200
+ | "The score is fine" | Fine is not good. Target >= 85. |
201
+ | "I already validated this" | Validation is a snapshot. Re-validate after every change. |
202
+ | "I'll do all phases at once" | Phases exist for a reason. Complete each before moving to the next. |
203
+
204
+ ## Integration
205
+
206
+ - Sub-skills live in `skills/` directory, loaded via dispatch.ts
207
+ - Shared references in `references/` directory (anti-patterns, reporting-format, iron-laws)
208
+ - All sub-skills return structured JSON reports
209
+ - Orchestrator manages batch lifecycle with fix loops
210
+ - Condition loop continues until score >= 85 AND all validations pass
211
+ - Escalate to human if stuck after 3 iteration attempts
212
+
213
+ ## ICM Rules
214
+ - Canonical sources: each fact lives in exactly one file
215
+ - One-way dependencies only: A -> B, never B -> A
216
+ - Selective loading: route to sections, not whole files
217
+ - Numbered folders for workflow stages
218
+
219
+ ## Output Format
220
+ - workspace/ - the built markdown-first workflow workspace
221
+ - .agents/skills/<workspace-name>/ - installable skill
222
+ - USAGE.md - how to use this workspace in future sessions
223
+ - .agents/iteration/summary.json - autonomous iteration results
224
+
225
+ ## Creating Workspaces with Invokable Agents
226
+
227
+ The workspace-maxxing skill can now create both the workspace folder structure AND an invokable agent that can be called with `@` in the workspace.
228
+
229
+ ### CLI Commands
230
+
231
+ ```bash
232
+ # Create workspace WITH agent (default)
233
+ npx workspace-maxxing --create-workspace --workspace-name "Daily Digest" --stages "01-input,02-process,03-output"
234
+
235
+ # Create workspace WITHOUT agent (backward compatible)
236
+ npx workspace-maxxing --create-workspace --workspace-name "My Workflow" --no-agent
237
+
238
+ # Custom agent name
239
+ npx workspace-maxxing --create-workspace --workspace-name "AI News" --agent-name "@news-agent"
240
+
241
+ # Custom iteration settings
242
+ npx workspace-maxxing --create-workspace --workspace-name "My Workflow" --threshold 90 --max-iterations 5
243
+ ```
244
+
245
+ ### Options
246
+
247
+ | Option | Default | Description |
248
+ |--------|---------|-------------|
249
+ | `--create-workspace` | - | Enable workspace creation mode |
250
+ | `--workspace-name` | "My Workspace" | Name of the workspace |
251
+ | `--stages` | "01-input,02-process,03-output" | Comma-separated stage names |
252
+ | `--agent-name` | auto-generated (@workspace-name) | Custom agent name |
253
+ | `--no-agent` | false | Create workspace without agent |
254
+ | `--threshold` | 85 | Robustness threshold for agent iteration |
255
+ | `--max-iterations` | 3 | Max improvement cycles |
256
+
257
+ ### What Gets Created
258
+
259
+ When you run with `--create-workspace`:
260
+
261
+ 1. **ICM Workspace** - Folder structure with SYSTEM.md, CONTEXT.md, stage folders
262
+ 2. **Invokable Agent** - Stored in `.agents/skills/@<name>/`
263
+ 3. **Self-Improvement** - Agent runs through iteration loop until robustness >= threshold
264
+
265
+ ### Agent Structure
266
+
267
+ ```
268
+ workspace/
269
+ ├── .agents/
270
+ │ └── skills/
271
+ │ └── @<name>/ # The invokable agent
272
+ │ ├── SKILL.md
273
+ │ ├── config.json
274
+ │ ├── prompts/
275
+ │ │ ├── system.md
276
+ │ │ └── tasks/
277
+ │ ├── tools/
278
+ │ └── tests/
279
+ ├── 01-input/
280
+ ├── 02-process/
281
+ ├── 03-output/
282
+ ├── SYSTEM.md
283
+ └── CONTEXT.md
284
+ ```
285
+
286
+ ### Invoking the Agent
287
+
288
+ After workspace is created, use `@` followed by the agent name:
289
+
290
+ - **OpenCode**: `@daily-digest`
291
+ - **Claude Code**: Via `.claude/skills/` directory
292
+ - **Copilot**: Via `.github/copilot-instructions/`
293
+ - **Gemini**: Via `.gemini/skills/` directory
294
+
295
+ ### Agent Self-Improvement
296
+
297
+ When the agent is created, it runs through an iteration loop:
298
+
299
+ 1. **Generate test cases** - Edge cases, empty states, varied inputs
300
+ 2. **Validate** - Check agent handles each case properly
301
+ 3. **Score** - Compute robustness score (0-100)
302
+ 4. **Improve** - If score < threshold, update prompts to fix issues
303
+ 5. **Repeat** - Until score >= threshold or max iterations reached
304
+
305
+ This ensures the delivered agent is robust for real-world use.
306
+
307
+ ### Backward Compatibility
308
+
309
+ Existing workspace-maxxing behavior is unchanged:
310
+ - `--opencode`, `--claude`, `--copilot`, `--gemini` still install the skill
311
+ - Using `--no-agent` creates workspace-only (no agent)
312
+ - Default behavior (without `--no-agent`) includes agent creation
@@ -0,0 +1,171 @@
1
+ import * as fs from 'fs';
2
+ import * as path from 'path';
3
+
4
+ export interface StageBenchmark {
5
+ name: string;
6
+ raw: number;
7
+ weight: number;
8
+ weighted: number;
9
+ }
10
+
11
+ export interface BenchmarkResult {
12
+ workspace: string;
13
+ agent: string;
14
+ timestamp: string;
15
+ rawScore: number;
16
+ weightedScore: number;
17
+ stages: StageBenchmark[];
18
+ fixSuggestions: string[];
19
+ improvementPotential: boolean;
20
+ }
21
+
22
+ const STAGE_WEIGHTS: Record<string, number> = {
23
+ '01-ideation': 1.5,
24
+ '02-research': 1.3,
25
+ '03-architecture': 1.2,
26
+ };
27
+
28
+ const DEFAULT_WEIGHT = 1.0;
29
+ const MAX_RAW_SCORE = 45;
30
+
31
+ export function calculateBenchmark(workspacePath: string): BenchmarkResult {
32
+ const ws = path.resolve(workspacePath);
33
+ const stageFolders = getNumberedFolders(ws);
34
+
35
+ const stages: StageBenchmark[] = [];
36
+ let totalWeighted = 0;
37
+ let totalWeight = 0;
38
+
39
+ for (const folder of stageFolders) {
40
+ const weight = STAGE_WEIGHTS[folder] ?? DEFAULT_WEIGHT;
41
+ const raw = calculateStageRawScore(ws, folder);
42
+ const weighted = (raw / MAX_RAW_SCORE) * 100 * weight;
43
+
44
+ stages.push({ name: folder, raw, weight, weighted });
45
+ totalWeighted += weighted;
46
+ totalWeight += weight;
47
+ }
48
+
49
+ const weightedScore = totalWeight > 0 ? totalWeighted / totalWeight : 0;
50
+ const rawScore = stages.reduce((sum, s) => sum + s.raw, 0);
51
+
52
+ const fixSuggestions = stages
53
+ .filter((s) => s.raw < MAX_RAW_SCORE)
54
+ .map((s) => `Improve ${s.name}: current score ${s.raw}/${MAX_RAW_SCORE}`);
55
+
56
+ return {
57
+ workspace: path.basename(ws),
58
+ agent: 'unknown',
59
+ timestamp: new Date().toISOString(),
60
+ rawScore,
61
+ weightedScore: Math.min(Math.round(weightedScore), 100),
62
+ stages,
63
+ fixSuggestions,
64
+ improvementPotential: stages.some((s) => s.raw < MAX_RAW_SCORE),
65
+ };
66
+ }
67
+
68
+ export function formatBenchmarkTable(data: BenchmarkResult): string {
69
+ const lines: string[] = [];
70
+
71
+ lines.push(`\nBenchmark Report: ${data.workspace}`);
72
+ lines.push(`Agent: ${data.agent} | Timestamp: ${data.timestamp}`);
73
+ lines.push('');
74
+ lines.push(
75
+ padRight('Stage', 20) +
76
+ padRight('Raw', 8) +
77
+ padRight('Weight', 10) +
78
+ padRight('Weighted', 12)
79
+ );
80
+ lines.push('-'.repeat(50));
81
+
82
+ for (const stage of data.stages) {
83
+ lines.push(
84
+ padRight(stage.name, 20) +
85
+ padRight(String(stage.raw), 8) +
86
+ padRight(stage.weight.toFixed(1) + 'x', 10) +
87
+ padRight(stage.weighted.toFixed(1), 12)
88
+ );
89
+ }
90
+
91
+ lines.push('-'.repeat(50));
92
+ lines.push(
93
+ padRight('TOTAL', 20) +
94
+ padRight(String(data.rawScore), 8) +
95
+ padRight('', 10) +
96
+ padRight(data.weightedScore.toFixed(1), 12)
97
+ );
98
+ lines.push('');
99
+
100
+ if (data.fixSuggestions.length > 0) {
101
+ lines.push('Suggestions:');
102
+ for (const suggestion of data.fixSuggestions) {
103
+ lines.push(` - ${suggestion}`);
104
+ }
105
+ lines.push('');
106
+ }
107
+
108
+ return lines.join('\n');
109
+ }
110
+
111
+ export function saveBenchmarkReport(workspacePath: string, data: BenchmarkResult): string {
112
+ const reportDir = path.join(workspacePath, '.workspace-benchmarks');
113
+ fs.mkdirSync(reportDir, { recursive: true });
114
+
115
+ const filename = `${data.workspace}-${data.timestamp.replace(/[:.]/g, '-')}.json`;
116
+ const filePath = path.join(reportDir, filename);
117
+
118
+ fs.writeFileSync(filePath, JSON.stringify(data, null, 2), 'utf-8');
119
+ return filePath;
120
+ }
121
+
122
+ function calculateStageRawScore(ws: string, folder: string): number {
123
+ const stageContextPath = path.join(ws, folder, 'CONTEXT.md');
124
+ let score = 0;
125
+
126
+ if (fs.existsSync(stageContextPath)) {
127
+ const content = fs.readFileSync(stageContextPath, 'utf-8');
128
+ if (content.toLowerCase().includes('purpose') || content.toLowerCase().includes('## purpose')) score += 4;
129
+ if (content.toLowerCase().includes('input')) score += 4;
130
+ if (content.toLowerCase().includes('output')) score += 4;
131
+ if (content.toLowerCase().includes('dependenc')) score += 3;
132
+ if (content.toLowerCase().includes('## success criteria') || content.toLowerCase().includes('success criteria')) score += 5;
133
+ if (content.toLowerCase().includes('## approach') || content.toLowerCase().includes('approach')) score += 5;
134
+ if (content.toLowerCase().includes('## risks') || content.toLowerCase().includes('risks')) score += 5;
135
+ if (content.toLowerCase().includes('## timeline') || content.toLowerCase().includes('timeline')) score += 5;
136
+ if (content.toLowerCase().includes('## resources') || content.toLowerCase().includes('resources')) score += 5;
137
+ if (content.toLowerCase().includes('## validation') || content.toLowerCase().includes('validation')) score += 5;
138
+ }
139
+
140
+ return Math.min(score, MAX_RAW_SCORE);
141
+ }
142
+
143
+ function getNumberedFolders(workspacePath: string): string[] {
144
+ if (!fs.existsSync(workspacePath)) return [];
145
+ const entries = fs.readdirSync(workspacePath, { withFileTypes: true });
146
+ return entries
147
+ .filter((e) => e.isDirectory() && /^\d{2}-/.test(e.name) && e.name !== '00-meta')
148
+ .map((e) => e.name);
149
+ }
150
+
151
+ function padRight(str: string, length: number): string {
152
+ return str.padEnd(length);
153
+ }
154
+
155
+ if (require.main === module) {
156
+ const args = process.argv.slice(2);
157
+ const parseArg = (flag: string): string | undefined => {
158
+ const idx = args.indexOf(flag);
159
+ return idx !== -1 ? args[idx + 1] : undefined;
160
+ };
161
+
162
+ const workspace = parseArg('--workspace');
163
+
164
+ if (!workspace) {
165
+ console.error('Usage: node benchmark.ts --workspace <path>');
166
+ process.exit(1);
167
+ }
168
+
169
+ const result = calculateBenchmark(workspace);
170
+ console.log(formatBenchmarkTable(result));
171
+ }