fix(team-skills): enable true parallel execution with --agent-name mechanism

Previously, parallel tasks assigned to the same role (e.g., multiple
EXPLORE-* tasks with owner: 'explorer') executed serially because only
one agent instance existed per role name. This adds conditional parallel
agent spawning with instance-specific names (explorer-1, explorer-2) and
--agent-name arg for role task discovery filtering.

Affected skills: team-ultra-analyze, team-quality-assurance,
team-brainstorm, team-issue. Single-task modes preserve backward
compatibility with original agent names.
This commit is contained in:
catlog22
2026-02-23 22:42:53 +08:00
parent 02a203c6b2
commit 1efe2f469e
16 changed files with 373 additions and 87 deletions

View File

@@ -61,10 +61,14 @@
### Phase 1: Task Discovery
```javascript
// Parse agent name from --agent-name arg (for parallel instances) or default to 'analyst'
const agentNameMatch = args.match(/--agent-name[=\s]+([\w-]+)/)
const agentName = agentNameMatch ? agentNameMatch[1] : 'analyst'
const tasks = TaskList()
const myTasks = tasks.filter(t =>
t.subject.startsWith('ANALYZE-') &&
t.owner === 'analyst' &&
t.owner === agentName &&
t.status === 'pending' &&
t.blockedBy.length === 0
)
@@ -269,7 +273,7 @@ TaskUpdate({ taskId: task.id, status: 'completed' })
// Check for next task
const nextTasks = TaskList().filter(t =>
t.subject.startsWith('ANALYZE-') &&
t.owner === 'analyst' &&
t.owner === agentName &&
t.status === 'pending' &&
t.blockedBy.length === 0
)