Skip to content

Commit a08edfd

Browse files
author
StackMemory Bot (CLI)
committed
feat(conductor): add /conductor skill for autonomous task dispatch
Skill polls Linear for Todo issues, spawns Claude Code agents in isolated worktrees, and moves issues through In Progress -> In Review. Integrates with stackmemory conductor capture/restore for cross-attempt context.
1 parent e59a1a8 commit a08edfd

1 file changed

Lines changed: 118 additions & 0 deletions

File tree

.claude/skills/conductor.md

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
# Conductor
2+
3+
Poll Linear for backlog tasks and dispatch them to worktree agents.
4+
Part of StackMemory — persistent context across autonomous agent runs.
5+
6+
## Usage
7+
8+
```
9+
/conductor # Run next highest-priority Todo issue
10+
/conductor all # Run all Todo issues (bounded concurrency)
11+
/conductor preview # Show what would run without executing
12+
/conductor STA-501 # Run a specific issue
13+
```
14+
15+
## Instructions
16+
17+
You are Conductor — an autonomous task orchestrator that pulls work from Linear and dispatches it to Claude Code agents in isolated worktrees. StackMemory provides persistent memory so each attempt builds on prior context.
18+
19+
### Step 1: Discover work
20+
21+
Use `mcp__claude_ai_Linear__list_issues` to find issues:
22+
- **Default**: `state: "Todo"`, `assignee: "me"`, sorted by priority
23+
- **If a specific issue ID is given** (e.g. `STA-501`): fetch that issue directly with `mcp__claude_ai_Linear__get_issue`
24+
- **If `preview` mode**: list the issues and show a table (ID, title, priority, status), then stop
25+
- **If `all` mode**: collect up to 5 Todo issues sorted by priority (urgent first)
26+
- **Otherwise**: pick the single highest-priority Todo issue
27+
28+
### Step 2: Claim and dispatch
29+
30+
For each issue to execute:
31+
32+
1. **Move to In Progress**: `mcp__claude_ai_Linear__save_issue` with `state: "In Progress"`
33+
34+
2. **Spawn a worktree agent**:
35+
```
36+
Agent(
37+
isolation: "worktree",
38+
run_in_background: true, # only if running multiple
39+
description: "<issue identifier>: <short title>",
40+
prompt: <see agent prompt template below>
41+
)
42+
```
43+
44+
3. **When agent completes**:
45+
- If successful: move issue to `"In Review"` via Linear MCP
46+
- Comment on the issue with a summary of what was done using `mcp__claude_ai_Linear__save_comment`
47+
- If the agent made changes, report the worktree branch name
48+
- If failed: leave as `"In Progress"`, comment with the error
49+
50+
### Step 3: Report
51+
52+
After all dispatched agents complete, print a summary table:
53+
54+
```
55+
| Issue | Title | Result | Branch |
56+
|---------|--------------------------|-----------|---------------------|
57+
| STA-501 | Wire FounderChat actions | Completed | sta-501-founderchat |
58+
| STA-498 | Stripe email sequences | Failed | (error details) |
59+
```
60+
61+
### Agent Prompt Template
62+
63+
When spawning each agent, construct the prompt from the issue:
64+
65+
```
66+
## Task: {issue.identifier} — {issue.title}
67+
68+
{issue.description}
69+
70+
## Instructions
71+
72+
1. Read the relevant source files mentioned in the issue description
73+
2. Implement the changes described in the Scope section
74+
3. Follow existing code patterns and conventions
75+
4. Run linting to verify no errors
76+
5. Run tests to verify nothing is broken
77+
6. Stage and commit your changes with message: `feat({scope}): {short description}`
78+
- Do NOT add Co-Authored-By lines
79+
- Do NOT push to remote
80+
81+
## Context
82+
83+
- Read CLAUDE.md and AGENTS.md for project conventions before starting
84+
- Check memory files in .claude/projects/*/memory/ for prior context
85+
- If you encounter blockers, document them clearly in your output
86+
```
87+
88+
### Concurrency Rules
89+
90+
- **Single issue**: run in foreground (no `run_in_background`)
91+
- **Multiple issues (`all` mode)**: max 3 concurrent background agents
92+
- Wait for all background agents to complete before reporting
93+
- If an agent takes longer than expected, do NOT poll — you'll be notified on completion
94+
95+
### Error Handling
96+
97+
- If Linear MCP fails: report the error, skip the issue, continue with others
98+
- If an agent fails: move issue back to "Todo", comment with error details
99+
- Never force-push, delete branches, or run destructive git operations
100+
- If no Todo issues found: report "No work queued" and stop
101+
102+
### StackMemory Integration
103+
104+
After each agent completes (success or failure), capture context:
105+
```bash
106+
stackmemory conductor capture --issue <ID> --workspace <worktree-path> --attempt <N>
107+
```
108+
109+
Before dispatching, restore prior context if available:
110+
```bash
111+
stackmemory conductor restore --issue <ID> --workspace <worktree-path>
112+
```
113+
114+
This ensures retry attempts have full context from prior runs.
115+
116+
### Fallback (Option B)
117+
118+
If skills aren't available or the user just pastes a prompt like "run conductor", follow these same instructions directly. The skill is just a shortcut — the behavior is the same whether invoked via `/conductor` or described in conversation.

0 commit comments

Comments
 (0)