agentleFS
hmshbhmshb/autonomous-dev-squad/skills/dev-team-hybrid/SKILL.md

dev-team-hybrid

Skill1 starsChanged 7 months agoMITView on GitHub

Hybrid dev team — PM as teammate, main thread as dev-lead orchestrator. Avoids the Agent tool bug in teammate initialization.

  • Deletes or force-pushes
  • Commits and pushes

The file

Show its rules and text

We split this skill into the rules it gives an agent

29 rules. About 0 are common, 13 are distinctive, and 16 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈13

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 16

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run the dev team in hybrid mode: PM runs as an autonomous teammate managing the board, while the main thread acts as dev-lead …

    line 6
  2. Distinctive:

    Verify all required agent prompt files exist:

    line 22
  3. Distinctive:

    If ANY file is reported MISSING, stop immediately and output:

    line 34
  4. Distinctive:

    Do NOT proceed to Step 1 until all files are confirmed present.

    line 41
  5. Very specific:

    Create a team named "dev-team-hybrid".

    line 47
  6. Very specific:

    Run sleep 3 to let the team initialize.

    line 48
  7. Very specific:

    Read the full contents of .claude/agents/dev/pm-agent.md.

    line 49
  8. Distinctive:

    Wait for PM to send its initial board analysis with Ready tickets and a signal.

    line 74
  9. Very specific:

    If there's a frontend ticket → Read .claude/agents/dev/frontend.md

    line 100
  10. Very specific:

    If there's a backend ticket → Read .claude/agents/dev/backend.md

    line 101
  11. Distinctive:

    When they return, log:

    line 137
  12. Distinctive:

    If rebase fails with conflicts, spawn a new dev sub-agent in fix mode.

    line 157
  13. Very specific:

    Read .claude/agents/dev/test-agent.md.

    line 164
  14. Distinctive:

    When it returns, log:

    line 169
  15. Distinctive:

    PASS + frontend: MUST proceed to QA (Step 4c).

    line 176
  16. Distinctive:

    GATE CHECK: Before moving ANY frontend PR to Review, verify QA has run.

    line 183
  17. Very specific:

    Read .claude/agents/dev/qa-agent.md.

    line 189
  18. Very specific:

    Add moved tickets to tickets_to_review

    line 225
  19. Very specific:

    Add flagged tickets to tickets_flagged

    line 226
  20. Very specific:

    If zero tickets reached Review this cycle: increment stale_cycles

    line 227
  21. Very specific:

    If stale_cycles >= 2, go to Step 7 (final report) with reason "stuck".

    line 232
  22. Distinctive:

    Wait for PM's reply. Parse the signal:

    line 243
  23. Very specific:

    Wait for shutdown confirmation, then delete the team "dev-team-hybrid".

    line 257
  24. Distinctive:

    After max retries for a ticket:

    line 282
  25. Very specific:

    Add to tickets_flagged, skip this ticket, continue with others

    line 295
  26. Distinctive:

    ALL implementation work goes to sub-agents via the Agent tool

    line 303
  27. Very specific:

    All sub-agents MUST use subagent_type: "general-purpose"

    line 304
  28. Very specific:

    Always read agent prompt files (.claude/agents/dev/*.md) before spawning sub-agents

    line 305
  29. Distinctive:

    NEVER skip QA for frontend PRs

    line 308

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Run the dev team in hybrid mode: PM runs as an autonomous teammate managing the board, while the main thread acts as dev-lead (orchestrator), spawning dev/test/QA sub-agents directly. This avoids the known bug where teammates spawned with subagent_type: "general-purpose" don't receive Agent tool access.


Configuration (REQUIRED — replace before first run)

This skill uses placeholder tokens. See docs/setup.md at the repo root for instructions.


Step 0 — Preflight checks (MANDATORY)

Verify all required agent prompt files exist:

for f in \
  .claude/agents/dev/pm-agent.md \
  .claude/agents/dev/frontend.md \
  .claude/agents/dev/backend.md \
  .claude/agents/dev/test-agent.md \
  .claude/agents/dev/qa-agent.md; do
  [ -f "$f" ] && echo "OK: $f" || echo "MISSING: $f"
done

If ANY file is reported MISSING, stop immediately and output:

PREFLIGHT FAILED: The following required files are missing:
  - {list missing files}
Aborting. Fix the missing files and re-run the skill.

Do NOT proceed to Step 1 until all files are confirmed present.


Step 1 — Create team and spawn PM

  1. Create a team named "dev-team-hybrid".
  2. Run sleep 3 to let the team initialize.
  3. Read the full contents of .claude/agents/dev/pm-agent.md.
  4. Spawn PM as a teammate:
    • name: "pm"
    • team_name: "dev-team-hybrid"
    • subagent_type: "general-purpose"
    • mode: "bypassPermissions"
    • run_in_background: true
    • prompt: the FULL content of pm-agent.md, BUT replace all references to "dev-lead" with "team-lead" in the SendMessage targets (so PM messages the main thread instead of a dev-lead teammate). Add this instruction at the top of the prompt:
      IMPORTANT: You are in hybrid mode. Send all your messages to
      "team-lead" (the main thread) instead of "dev-lead".
      Wherever these instructions say SendMessage to "dev-lead",
      send to "team-lead" instead.
      Then append: BEGIN NOW: Run startup workflow.

The main thread does NOT go idle — it acts as dev-lead from here on.


Step 2 — Wait for PM's startup message

Wait for PM to send its initial board analysis with Ready tickets and a signal.

Parse the signal:

  • READY_TICKETS_AVAILABLE → proceed to Step 3
  • WAITING → go to Step 7 (final report)
  • PROJECT_COMPLETE → go to Step 7 (final report)
  • ALL_BLOCKED → go to Step 7 (final report)

Step 3 — Dev-lead loop: Spawn dev sub-agents

You (the main thread) now act as the team lead orchestrator. Initialize:

  • cycle_count = 1
  • retry_counts = {} (map of issue number → retry count)
  • stale_cycles = 0 (consecutive cycles with zero tickets reaching Review)
  • tickets_to_review = [] (cumulative list across all cycles)
  • tickets_flagged = [] (cumulative list across all cycles)
  • cycle_log = [] (for final report)

3a — Pull latest main

git checkout main && git pull origin main

3b — Read agent prompts

  • If there's a frontend ticket → Read .claude/agents/dev/frontend.md
  • If there's a backend ticket → Read .claude/agents/dev/backend.md

3c — Move tickets Ready → In Progress

For each ticket being picked up:

  1. Find its item ID:
    gh project item-list ${PROJECT_NUMBER} --owner ${OWNER} --format json --limit 100 | python -c "
    import json,sys
    for item in json.load(sys.stdin).get('items',[]):
        if item['content'].get('number') == {ISSUE_NUMBER}:
            print(item['id']); break"
  2. Move to In Progress:
    gh project item-edit --project-id ${PROJECT_ID} \
      --id {ITEM_ID} \
      --field-id ${STATUS_FIELD_ID} \
      --single-select-option-id ${STATUS_IN_PROGRESS}

3d — Spawn dev sub-agents

Log before spawning:

[Cycle {N}] SPAWNING frontend-dev for #{ISSUE} — worktree isolation
[Cycle {N}] SPAWNING backend-dev for #{ISSUE} — worktree isolation

Spawn dev sub-agents using the Agent tool:

  • subagent_type: "general-purpose"
  • isolation: "worktree"
  • mode: "bypassPermissions"
  • prompt: FULL content of frontend.md or backend.md + issue number + instruction to implement, test, create PR, and return the PR link

Spawn them IN PARALLEL (multiple Agent calls in one message).

When they return, log:

[Cycle {N}] RETURNED frontend-dev for #{ISSUE} — {DONE/BLOCKED} — PR #{PR_NUMBER}
[Cycle {N}] RETURNED backend-dev for #{ISSUE} — {DONE/BLOCKED} — PR #{PR_NUMBER}

Step 4 — Rebase and test

4a — Rebase each PR on main

[Cycle {N}] REBASING PR #{PR_NUMBER} on origin/main
gh pr checkout {PR_NUMBER}
git fetch origin main
git rebase origin/main
git push --force-with-lease

If rebase fails with conflicts, spawn a new dev sub-agent in fix mode.

4b — Spawn test sub-agent

[Cycle {N}] SPAWNING test-agent for PRs: #{PR1}, #{PR2}

Read .claude/agents/dev/test-agent.md. Spawn test sub-agent:

  • subagent_type: "general-purpose"
  • mode: "bypassPermissions"
  • prompt: FULL content of test-agent.md + PR numbers + issue numbers

When it returns, log:

[Cycle {N}] RETURNED test-agent — PR #{PR_NUMBER}: {PASS/FAIL}

For each PR:

  • PASS + backend: Mark as ready for Review (Step 5)
  • PASS + frontend: MUST proceed to QA (Step 4c). Do NOT skip.
  • FAIL: Increment retry_counts[issue]. If under 3: spawn new dev sub-agent in fix mode, then re-test. If at 3: flag ticket (see Retry limit section below).

4c — Spawn QA sub-agent (MANDATORY for frontend PRs)

GATE CHECK: Before moving ANY frontend PR to Review, verify QA has run.

[Cycle {N}] SPAWNING qa-agent for PR #{PR_NUMBER} (issue #{ISSUE})

Read .claude/agents/dev/qa-agent.md. Spawn QA sub-agent:

  • subagent_type: "general-purpose"
  • mode: "bypassPermissions"
  • prompt: FULL content of qa-agent.md + issue/PR numbers

When it returns, log:

[Cycle {N}] RETURNED qa-agent — PR #{PR_NUMBER}: {PASS/FAIL/BLOCKED}
  • PASS: Move to Review
  • FAIL: Increment retry count. If under 3: spawn dev fix, re-test, re-QA. If at 3: flag ticket.
  • BLOCKED (infra issue): Do NOT count as retry. Skip QA, move to Review.

Step 5 — Cycle complete

Move all passing tickets In Progress → Review on the project board:

gh project item-edit --project-id ${PROJECT_ID} \
  --id {ITEM_ID} \
  --field-id ${STATUS_FIELD_ID} \
  --single-select-option-id ${STATUS_REVIEW}

FRONTEND GATE: Double-check that every frontend ticket being moved to Review has a QA result (PASS or BLOCKED). If not, go back to Step 4c.

Log cycle summary:

[Cycle {N}] COMPLETE — Tickets to Review: #{ISSUE1}, #{ISSUE2} | Flagged: #{ISSUE3} | Retries: {count}

Update tracking:

  • Add moved tickets to tickets_to_review
  • Add flagged tickets to tickets_flagged
  • If zero tickets reached Review this cycle: increment stale_cycles
  • Otherwise: reset stale_cycles = 0
  • Append to cycle_log

Stale progress check

If stale_cycles >= 2, go to Step 7 (final report) with reason "stuck".


Step 6 — Call PM to refill Ready

Send a message to PM:

SendMessage to "pm": "refill — cycle complete, tickets moved to Review"

Wait for PM's reply. Parse the signal:

  • READY_TICKETS_AVAILABLE → increment cycle_count, go back to Step 3
  • WAITING → go to Step 7 (final report)
  • PROJECT_COMPLETE → go to Step 7 (final report)
  • ALL_BLOCKED → go to Step 7 (final report)

Step 7 — Shutdown and final report

  1. Shut down PM teammate:
    SendMessage to "pm": {"type": "shutdown_request", "reason": "Run complete"}
  2. Wait for shutdown confirmation, then delete the team "dev-team-hybrid".
  3. Output summary:
DEV TEAM RUN COMPLETE (hybrid mode)
Outcome: {completed | waiting | stuck | all_blocked | preflight-failed}
Cycles completed: {cycle_count}
Tickets moved to Review: {tickets_to_review or "none"}
Tickets flagged: {tickets_flagged or "none"}

Cycle Log:
| Cycle | Tickets | Sub-agents spawned | Results |
|-------|---------|-------------------|---------|
| 1     | #28     | frontend-dev, test-agent, qa-agent | Review |
| ...   | ...     | ... | ... |

Retry limits

  • Max 3 attempts per ticket for test failures
  • Max 3 attempts per ticket for QA failures
  • Track retry count per issue number throughout all cycles

After max retries for a ticket:

  1. Move ticket back to Ready:
    gh project item-edit --project-id ${PROJECT_ID} \
      --id {ITEM_ID} \
      --field-id ${STATUS_FIELD_ID} \
      --single-select-option-id ${STATUS_READY}
  2. Post comment on the issue:
    gh issue comment {ISSUE} --body "Blocked after 3 failed attempts — needs human review.
    Last failure: {error_summary}"
  3. Add to tickets_flagged, skip this ticket, continue with others

Rules

  • The main thread acts as dev-lead — it NEVER implements code, edits source files, runs tests, or creates PRs directly
  • ALL implementation work goes to sub-agents via the Agent tool
  • All sub-agents MUST use subagent_type: "general-purpose"
  • Always read agent prompt files (.claude/agents/dev/*.md) before spawning sub-agents
  • PM is the only teammate — it handles board analysis and Ready slot management
  • NEVER skip QA for frontend PRs

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.