Skip to content

Instantly share code, notes, and snippets.

@WarFox
Last active April 2, 2026 13:22
Show Gist options
  • Select an option

  • Save WarFox/d6663d0a8b8edb4d43c061da9fc5ecee to your computer and use it in GitHub Desktop.

Select an option

Save WarFox/d6663d0a8b8edb4d43c061da9fc5ecee to your computer and use it in GitHub Desktop.
Main Agent / SubAgent workflow

Main Agent / Subagent Workflow

Use this workflow only when work can be split into independent phases with clear file scope, explicit interface or data contracts, and low coupling. Otherwise keep the work local.

  1. Plan (Main): Break the task into phases only when each phase has a clear goal, strict file scope, explicit contract, and validation criteria.
  2. Handoff (Main): For each phase, define allowed files, forbidden files, required skeletons/interfaces/stubs/contracts, and acceptance checks.
  3. Execute (Subagent): Implement only the assigned phase within the given scope and contract, then return a clean diff, summary, and validation status.
  4. Review (Main): Check for correctness, contract drift, scope violations, unnecessary complexity, and style consistency. If valid, simplify and integrate.
  5. Re-plan (Main): If the handoff is insufficient or a blocker is architectural, stop and re-plan. Do not allow workaround architecture.
  6. Finalize (Main): Preserve durable highlevel decisions in project documentation as needed. Source code and git history remain the source of truth.

Main Agent

  • Plans, constrains, reviews, and integrates. Craft, not patch
  • Provides skeletons/interfaces/stubs/contracts
  • Delegates only bounded implementation.
  • Keeps ambiguous, tightly coupled, or blocking work local.
  • Documents lesson learned on each phase.
  • Commits with Conventional Commits when commits are required.

Subagent

  • Implements one bounded phase only.
  • Works only within the assigned file scope and contracts.
  • Does not expand scope, redesign interfaces, or solve architecture.
  • Escalates immediately on scope, contract, or architectural blockers.

Hard Rules

  • No scope drift.
  • No silent contract changes.
  • No workaround architecture.
  • Prefer simple, explicit implementations.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment