From spectacular
Applies RED-GREEN-REFACTOR TDD to test workflow instructions and commands: reproduces real failures with subagents, clarifies docs before deployment.
How this skill is triggered — by the user, by Claude, or both
Slash command
/spectacular:testing-workflows-with-subagentsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
**Testing workflows is TDD applied to orchestrator instructions and command documentation.**
Testing workflows is TDD applied to orchestrator instructions and command documentation.
You find real execution failures (git logs, error reports), create test scenarios that reproduce them, watch subagents follow ambiguous instructions incorrectly (RED), fix the instructions (GREEN), and verify subagents now follow correctly (REFACTOR).
Core principle: If you didn't watch an agent misinterpret the instructions in a test, you don't know if your fix prevents the right failures.
REQUIRED BACKGROUND: You MUST understand superpowers:test-driven-development before using this skill. That skill defines the fundamental RED-GREEN-REFACTOR cycle. This skill applies TDD to workflow documentation.
Use when:
.claude/commands/*.md, /spectacular:*)Don't test:
| TDD Phase | Workflow Testing | What You Do |
|---|---|---|
| RED | Find real failure | Check git logs, error reports for evidence of agents misinterpreting instructions |
| Verify RED | Create failing test scenario | Reproduce the failure with test repo + pressure scenario |
| GREEN | Fix instructions | Rewrite ambiguous steps with explicit ordering, warnings, examples |
| Verify GREEN | Test with subagent | Same scenario with fixed instructions - agent follows correctly |
| REFACTOR | Iterate on clarity | Find remaining ambiguities, improve wording, re-test |
| Stay GREEN | Re-verify | Test again to ensure fix holds |
Same cycle as code TDD, different test format.
Goal: Gather evidence of how instructions were misinterpreted in actual execution.
Where to look:
Document evidence:
## RED Phase Evidence
**Source**: bignight.party git log (Run ID: 082687)
**Failure**: Task 4.3 commit on branch `082687-task-4.2-auth-domain-migration`
**Expected**: Create branch `082687-task-4.3-server-actions`
**Actual**: Committed to Task 4.2's branch instead
**Root cause hypothesis**: Instructions ambiguous about creating branch before committing
Critical: Get actual git commits, branch names, error messages - not hypothetical scenarios.
Goal: Reproduce the failure in a controlled test environment.
Create minimal repo that simulates real execution state:
cd /path/to/test-area
mkdir workflow-test && cd workflow-test
git init
git config user.name "Test" && git config user.email "[email protected]"
# Set up state that led to failure
# (e.g., existing task branches for sequential phase testing)
Create test file with:
| Pressure | Example | Effect on Agent |
|---|---|---|
| Time | "Orchestrator waiting", "4 more tasks to do", "Need to move fast" | Skips reading skills, chooses fast option |
| Cognitive load | "2 hours in, tired", "Third sequential task", "Complex state" | Misreads instructions, makes assumptions |
| Urgency | "Choose NOW", "Execute immediately", "No delays" | Skips verification steps, commits to first interpretation |
| Task volume | "4 more tasks after this", "Part of 10-task phase" | Rushes through steps, skips optional guidance |
| Complexity | "Multiple branches exist", "Shared worktree", "Parallel tasks running" | Confused about current state, wrong branch |
Best test scenarios combine 2-3 pressures to simulate realistic execution conditions.
Example:
# RED Test: Sequential Phase Task Execution
**Role**: Implementation subagent for Task 2.3
**Current state**: On branch `abc123-task-2-2-database`
Uncommitted changes in auth.js (your completed work)
**Instructions from execute.md (CURRENT VERSION)**:
using-git-spice skill to:
**Pressure**: 2 hours in, tired, 4 more tasks to do
**Options**:
A) Read skill (2 min delay)
B) Just commit now
C) Create branch with git, then commit
D) Guess git-spice command
Choose and execute NOW.
# Dispatch subagent with test scenario
# Use haiku for speed and realistic "under pressure" behavior
# Document exact choice and reasoning verbatim
Expected RED result: Agent makes wrong choice, commits to wrong branch, or skips creating branch.
If agent succeeds, your test scenario isn't realistic enough - add more pressure or make options more tempting.
Goal: Rewrite instructions to prevent the specific failure observed in RED.
From RED test, identify:
Example analysis:
**Ambiguous**: "Create branch" and "Commit" as separate bullets
**Unclear order**: Could mean "create then commit" OR "commit then create"
**Assumption**: "I'll just commit first, cleaner workflow"
**Pressure effect**: Skipped reading skill, chose fast option
Pattern 1: Explicit Sequential Steps
```markdown - Create branch: X - Commit with message: Y - Stay on branch ``` ```markdown a) FIRST: Stage changes - Command: `git add .`b) THEN: Create branch (commits automatically)
gs branch create X -m "Y"c) Stay on new branch
</After>
**Pattern 2: Critical Warnings**
Add consequences upfront:
```markdown
CRITICAL: Stage changes FIRST, then create branch.
If you commit BEFORE creating branch, work goes to wrong branch.
Pattern 3: Show Commands
Reduce friction under pressure - show exact commands:
b) THEN: Create new stacked branch
- Command: `gs branch create {name} -m "message"`
- This creates branch and commits in one operation
Pattern 4: Skill-Based Reference
Balance showing commands with learning:
Use `using-git-spice` skill which teaches this two-step workflow:
[commands here]
Read the skill if uncertain about the workflow.
Edit the actual command file with GREEN fix.
Goal: Confirm agents now follow instructions correctly under same pressure.
cd /path/to/workflow-test
git reset --hard initial-state
# Recreate same starting conditions as RED test
Same as RED test but:
# Dispatch subagent with GREEN scenario
# Use same model (haiku) for consistency
# Agent should now choose correct option and execute correctly
Expected GREEN result:
If agent still fails: Instructions still ambiguous. Return to GREEN phase, improve clarity, re-test.
If agent still misinterprets after your fix, ask them directly:
your human partner: You read the improved instructions and still chose the wrong option.
How could those instructions have been written differently to make
the correct workflow crystal clear?
Three possible responses:
"The instructions WERE clear, I just rushed"
"The instructions should have said X"
"I didn't notice section Y"
Use meta-testing to diagnose WHY fix didn't work, not just add more content.
Goal: Find and fix remaining ambiguities.
Run additional test scenarios:
| Issue | Symptom | Fix |
|---|---|---|
| Order ambiguous | Steps done out of order | Add "a) FIRST, b) THEN" labels |
| Missing consequences | Agent skips step | Add "If you skip X, Y will fail" |
| Too abstract | Agent guesses commands | Show exact commands inline |
| No warnings | Agent makes wrong choice | Add "CRITICAL:" upfront |
| Assumes knowledge | Agent doesn't know tool | Reference skill + show command |
Create summary document:
# Test Results: execute.md Sequential Phase Fix
**RED Phase**: Task 4.3 committed to Task 4.2 branch (real failure)
**GREEN Phase**: Agent created correct branch, no ambiguity
**REFACTOR**: Tested with different models, all passed
**Fix applied**: Lines 277-297 (sequential), 418-438 (parallel)
**Success criteria**: New stacked branch created BEFORE commit
testing-skills-with-subagents (discipline skills):
testing-workflows-with-subagents (workflow documentation):
Different problem: Skills test "will you comply?" vs Workflows test "can you understand?"
RED Phase:
GREEN Phase:
REFACTOR Phase:
IMPORTANT: Use TodoWrite to track these steps.
RED Phase:
GREEN Phase:
REFACTOR Phase:
Documentation:
❌ Testing without real failure evidence Start with hypothetical "this might be confusing" leads to fixes that don't address actual problems. ✅ Fix: Always start with git logs, error reports, real execution traces.
❌ Test scenario without pressure Agents follow instructions carefully when not rushed - doesn't match real execution. ✅ Fix: Add time pressure, cognitive load (tired, many tasks), urgency.
❌ Improving instructions without testing Guessing what's clear vs actually verifying leads to still-ambiguous docs. ✅ Fix: Always run GREEN verification with subagent before considering done.
❌ Testing once and done First test might not catch all ambiguities. ✅ Fix: REFACTOR phase with varied scenarios, different models.
❌ Vague test options Giving "what do you do?" instead of concrete choices lets agent defer. ✅ Fix: Force A/B/C/D choice with "Choose NOW" urgency.
From testing execute.md sequential phase instructions (this session):
RED Phase:
GREEN Phase:
gs branch create -mResult:
Time investment: 1 hour testing, prevents repeated failures across all spectacular runs.
Test workflow documentation the same way you test code.
RED (find real failure) → GREEN (fix and verify) → REFACTOR (iterate on clarity).
If you wouldn't deploy code without tests, don't deploy commands without verifying agents can follow them correctly.
npx claudepluginhub joshuarweaver/cascade-code-general-misc-3 --plugin arittr-spectacularAuto-loop execution workflow with quality gates. Use when starting any non-trivial implementation task. Provides automatic task decomposition, code implementation, testing (L1-L4), and iterative quality gates until completion. Invoke with /autoworker.
Applies RED-GREEN-REFACTOR cycle to test skills by running baseline scenarios without the skill, writing to address failures, and iterating to close loopholes.
Orchestrates multiple subagents through implementation workflows, managing phases and autonomous execution mode.