Skip to content

fix(compound): prevent subagents from writing intermediary files#150

Merged
kieranklaassen merged 2 commits intoEveryInc:mainfrom
tmchow:fix/compound-command-intermediary-files
Feb 8, 2026
Merged

fix(compound): prevent subagents from writing intermediary files#150
kieranklaassen merged 2 commits intoEveryInc:mainfrom
tmchow:fix/compound-command-intermediary-files

Conversation

@tmchow
Copy link
Contributor

@tmchow tmchow commented Feb 5, 2026

Summary

The /workflows:compound command was inconsistently creating intermediary files during the research phase instead of having subagents return text data to the orchestrator.

Problem

When executing /workflows:compound, sometimes subagents would write files like context-analysis.md, solution-draft.md during research, cluttering the repo with artifacts that should never exist. Other times it worked correctly.

Root Cause

  • The original command listed all 6 subagents as "(Parallel)" including the Documentation Writer
  • There was no explicit instruction preventing research subagents from writing files
  • The Documentation Writer couldn't actually run in parallel—it needs research results first

Changes

  • Add <critical_requirement> block explicitly forbidding subagent file writes
  • Restructure into clear two-phase orchestration:
    • Phase 1: Parallel research (subagents return text data)
    • Phase 2: Sequential assembly (orchestrator writes single file)
    • Phase 3: Optional parallel enhancement agents
  • Remove Documentation Writer as a subagent (orchestrator handles this in Phase 2)
  • Add "Common Mistakes to Avoid" table for quick reference
  • Update success output to reflect new structure

Testing

Run /workflows:compound after solving a problem and verify:

  • No intermediary files created during research
  • Only one file written: docs/solutions/[category]/[filename].md
  • Phase 1 subagents complete before Phase 2 starts

The /workflows:compound command was inconsistently creating intermediary
files during research phase instead of having subagents return text data
to the orchestrator.

Changes:
- Add <critical_requirement> block explicitly forbidding subagent file writes
- Restructure into clear two-phase orchestration (research → assembly)
- Remove Documentation Writer as parallel subagent (was incorrectly parallel)
- Add Phase 3 for optional enhancement agents with proper sequencing
- Add Common Mistakes table for quick reference
- Update success output to reflect new structure
@kieranklaassen kieranklaassen added the bug Something isn't working label Feb 8, 2026
Copy link
Collaborator

@kieranklaassen kieranklaassen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TY

Copy link
Collaborator

@kieranklaassen kieranklaassen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TY @tmchow! This needs a quick rebase on main to resolve a small conflict (one line in the Context Analyzer section). After that it's good to merge.

@kieranklaassen kieranklaassen merged commit 04ee7e4 into EveryInc:main Feb 8, 2026
1 check passed
kprimdal added a commit to primux-dk/laravel-compound-engineering that referenced this pull request Feb 9, 2026
Restructure from flat parallel strategy to two-phase orchestration
to prevent subagents from writing intermediary files during research.

Based on EveryInc#150

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants