Skip to main content

claude-workflow-tdd-harness

Reusable Node.js harness for unit-testing Claude Code Workflow scripts (the `Workflow` tool's `.js` files) with `node:test`. Use when: (1) you need to test a Workflow script's args contract / phase order / per-agent schema shape WITHOUT actually invoking the Workflow tool (which spawns real agents, costs tokens, is slow, and is only available in the parent session); (2) `node --test` rejects the file with `SyntaxError: Unexpected token 'export'` or `Illegal return statement` because the script uses top-level `await`, top-level `return`, and injected globals (`agent`, `phase`, `log`, `budget`, `parallel`, `pipeline`, `workflow`); (3) you want a per-label mock-agent dispatch pattern so each `agent()` call can return a different shape; (4) you want budget-gate / short-circuit / phase-order tests to land before any live Workflow call. Ships a ~110-line ESM harness (no deps) that strips `export const meta = {...}` via brace-counting, wraps the body in `AsyncFunction`, injects configurable mocks for all Workflow gl

Jump to install

Source facts

Repository
cajias/claude-skills
Last source activity
July 20, 2026 at 07:29
Detected SKILL.md language
English
Stars
0
Forks
0

Install options

The review-first prompt is selected by default. You can switch to a direct command or download a local copy.

Review the source files

Read SKILL.md and any companion files shown by SkillsMP before deciding whether to install.