Skip to content

Commit cdbff5f

Browse files
cursoragentjanhesters
authored andcommitted
feat(skills): add /aidd-parallel
Concurrent dispatch + delegation skill extracted from PR #168. Includes the delegate subcommand, prompt generation, evals, and epic.
1 parent 74b8229 commit cdbff5f

9 files changed

Lines changed: 244 additions & 0 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const add = (a, b) => a - b;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const greet = (name) => `Hello, ${name}`;
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import 'ai/skills/aidd-parallel/SKILL.md'
2+
3+
userPrompt = """
4+
Run /aidd-parallel --branch feature/utils with the following two tasks:
5+
6+
Task 1:
7+
File: ai-evals/aidd-parallel/fixtures/add.js, line 1
8+
"add() subtracts instead of adding — should use + not -"
9+
10+
Task 2:
11+
File: ai-evals/aidd-parallel/fixtures/greet.js, line 1
12+
"greet() should include an exclamation mark at the end of the greeting"
13+
14+
Generate delegation prompts for both tasks.
15+
"""
16+
17+
- Given two tasks and a branch, should generate a separate delegation prompt for each task
18+
- Given a generated prompt, should start with /aidd-fix
19+
- Given a generated prompt, should reference the correct branch feature/utils
20+
- Given a generated prompt, should instruct the sub-agent to commit and push to origin/feature/utils
21+
- Given a generated prompt, should be wrapped in a markdown codeblock

ai/commands/aidd-parallel.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
description: Generate /aidd-fix delegation prompts for a list of tasks and optionally dispatch them to sub-agents in dependency order
3+
---
4+
# 🔀 /aidd-parallel
5+
6+
Load and execute the skill at `ai/skills/aidd-parallel/SKILL.md`.
7+
8+
Constraints {
9+
Before beginning, read and respect the constraints in /aidd-please.
10+
}

ai/commands/index.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ Rank files by hotspot score to identify prime candidates for refactoring before
1616

1717
*No description available*
1818

19+
### 🔀 /aidd-parallel
20+
21+
**File:** `aidd-parallel.md`
22+
23+
Generate /aidd-fix delegation prompts for a list of tasks and optionally dispatch them to sub-agents in dependency order
24+
1925
### 📋 /aidd-requirements
2026

2127
**File:** `aidd-requirements.md`

ai/skills/aidd-parallel/README.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# aidd-parallel — Parallel Sub-Agent Delegation
2+
3+
`/aidd-parallel` generates focused `/aidd-fix` delegation prompts for a list
4+
of tasks and can dispatch them to sub-agents in dependency order.
5+
6+
## Usage
7+
8+
```
9+
/aidd-parallel [--branch <branch>] <tasks> — generate one /aidd-fix delegation prompt per task
10+
/aidd-parallel delegate — build file list + dep graph, sequence, and dispatch
11+
```
12+
13+
## Why parallel delegation matters
14+
15+
When a PR review or task breakdown produces multiple independent issues, fixing
16+
them sequentially in a single agent thread wastes time and dilutes attention.
17+
`/aidd-parallel` extracts the delegation pattern into a reusable skill so any
18+
workflow — PR review, task execution, epic delivery — can fan work out to
19+
focused sub-agents without reimplementing prompt generation logic.
20+
21+
## How it works
22+
23+
### Step 1 — Resolve the branch
24+
25+
If `--branch <branch>` is supplied, use that branch. If omitted, the current
26+
branch is detected automatically via `git rev-parse --abbrev-ref HEAD`.
27+
28+
### Step 2 — Generate delegation prompts
29+
30+
For each task, one `/aidd-fix` delegation prompt is produced. Every prompt:
31+
32+
- Starts with `/aidd-fix`
33+
- Contains only the context needed for that single task
34+
- Instructs the sub-agent to work directly on the target branch and commit and
35+
push to `origin/<branch>` — never to `main`, never to a new branch
36+
- Is wrapped in a fenced markdown codeblock; any nested codeblocks are indented
37+
one level to prevent them from breaking the outer fence
38+
39+
### Step 3 (delegate only) — Build the dependency graph
40+
41+
`/aidd-parallel delegate` first builds a list of files each task will change,
42+
then produces a Mermaid change dependency graph. The graph is used for
43+
sequencing only — it is not saved or committed.
44+
45+
### Step 4 (delegate only) — Dispatch in dependency order
46+
47+
Prompts are dispatched to sub-agent workers in the order determined by the
48+
dependency graph: tasks with no dependencies first, dependents after their
49+
prerequisites are complete.
50+
51+
Post-dispatch callbacks (e.g. resolving PR conversation threads) are the
52+
caller's responsibility.
53+
54+
## When to use `/aidd-parallel`
55+
56+
- A PR review has multiple independent issues that should be fixed in parallel
57+
- A task epic has been broken into independent sub-tasks suitable for parallel execution
58+
- Any workflow that needs to fan work out to multiple `/aidd-fix` sub-agents
59+
60+
## Constraints
61+
62+
- Each prompt must be wrapped in a markdown codeblock
63+
- Nested codeblocks inside a prompt must be indented to prevent breaking the outer fence
64+
- Sub-agents are always directed to the supplied branch — never to `main` or a new branch

ai/skills/aidd-parallel/SKILL.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
name: aidd-parallel
3+
description: >
4+
Generate /aidd-fix delegation prompts for a list of tasks and optionally dispatch
5+
them to sub-agents in dependency order.
6+
Use when fanning work out to parallel sub-agents, generating fix delegation prompts
7+
for multiple tasks, or coordinating multi-task execution across a shared branch.
8+
compatibility: Requires git available in the project.
9+
---
10+
11+
# 🔀 aidd-parallel
12+
13+
Act as a top-tier software engineering lead to generate focused `/aidd-fix`
14+
delegation prompts and coordinate parallel sub-agent execution.
15+
16+
Competencies {
17+
parallel task decomposition
18+
dependency graph analysis
19+
sub-agent delegation via /aidd-fix
20+
branch-targeted prompt generation
21+
}
22+
23+
Constraints {
24+
Put each delegation prompt in a markdown codeblock, indenting any nested codeblocks to prevent breaking the outer block
25+
Instruct each sub-agent to work directly on the supplied branch and commit and push to origin on that branch (not to main, not to their own branch)
26+
If --branch is omitted, use the current branch (git rev-parse --abbrev-ref HEAD)
27+
}
28+
29+
## Command: /aidd-parallel [--branch <branch>] <tasks>
30+
31+
generateDelegationPrompts(tasks, branch) => prompts {
32+
1. Resolve the branch: if --branch is supplied use it; otherwise run `git rev-parse --abbrev-ref HEAD`
33+
2. For each task, generate a focused `/aidd-fix` delegation prompt:
34+
- Start the prompt with `/aidd-fix`
35+
- Include only the context needed to address that single task
36+
- Instruct the sub-agent to work directly on `<branch>`, commit, and push to `origin/<branch>`
37+
- Do NOT instruct the sub-agent to create a new branch
38+
3. Wrap each prompt in a fenced markdown codeblock; indent any nested codeblocks by one level to prevent them from breaking the outer fence
39+
4. Output one codeblock per task
40+
}
41+
42+
## Command: /aidd-parallel delegate
43+
44+
delegate(tasks, branch) {
45+
1. Call generateDelegationPrompts to produce one prompt per task
46+
2. Build a list of files that each task will need to change
47+
3. Build a Mermaid change dependency graph from the file list
48+
- Nodes are files; edges represent "must be complete before" relationships
49+
- This graph is for sequencing reference only — do not save or commit it
50+
4. Use the dependency graph to determine dispatch order:
51+
- Tasks with no dependencies first
52+
- Dependent tasks after their prerequisites are complete
53+
5. Spawn one sub-agent worker per prompt in dependency order
54+
6. Post-dispatch callbacks (e.g. resolving PR threads) are the caller's responsibility
55+
}
56+
57+
Commands {
58+
/aidd-parallel [--branch <branch>] <tasks> - generate one /aidd-fix delegation prompt per task
59+
/aidd-parallel delegate [--branch <branch>] <tasks> - build file list + mermaid dep graph, sequence, and dispatch to sub-agents
60+
}

ai/skills/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
- aidd-log - Document completed epics in a structured changelog with emoji categorization. Use when the user asks to log changes, update the changelog, or after completing a significant feature or epic.
1515
- aidd-namespace - Ensures types and related functions are authored and consumed in a modular, discoverable, tree-shakeable pattern. Use when creating types, refactoring type folders, defining schemas, importing types, or when the user mentions type namespaces, constants, or Schema.ToType.
1616
- aidd-observe - Enforces Observe pattern best practices from @adobe/data/observe. Use when working with Observe, observables, reactive data flow, service Observe properties, or when the user asks about Observe.withMap, Observe.withFilter, Observe.fromConstant, Observe.fromProperties, or similar.
17+
- aidd-parallel - Generate /aidd-fix delegation prompts for a list of tasks and optionally dispatch them to sub-agents in dependency order. Use when fanning work out to parallel sub-agents, generating fix delegation prompts for multiple tasks, or coordinating multi-task execution across a shared branch.
1718
- aidd-please - General AI assistant for software development projects. Use when user says "please" or needs general assistance, logging, committing, and proofing tasks.
1819
- aidd-product-manager - Plan features, user stories, user journeys, and conduct product discovery. Use when building specifications, user journey maps, story maps, personas, or feature PRDs.
1920
- aidd-react - Enforces React component authoring best practices. Use when creating React components, binding components, presentations, useObservableValues, or when the user asks about React UI patterns, reactive binding, or action callbacks.

tasks/aidd-parallel-skill-epic.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# aidd-parallel Skill Epic
2+
3+
**Status**: 📋 PLANNED
4+
**Goal**: Extract parallel prompt generation and sub-agent dispatch into a shared `/aidd-parallel` skill, fix the constraint conflation in `/aidd-pr`, and make prompt generation independently unit-testable.
5+
6+
## Overview
7+
8+
The prompt generation and sub-agent dispatch logic in `/aidd-pr` is reusable across any skill that needs to fan work out to sub-agents (PR review, task execution, etc). Extracting it into `/aidd-parallel` gives us a clean unit-testable boundary, fixes the constraint conflation problem in `/aidd-pr` (orchestrator constraints mixed with sub-agent constraints), and makes `/aidd-pr` simpler.
9+
10+
---
11+
12+
## Create the aidd-parallel skill
13+
14+
Add `ai/skills/aidd-parallel/SKILL.md` following the AgentSkills specification.
15+
16+
**Requirements**:
17+
- Given the agent needs to discover the skill, its name and description should be in the frontmatter
18+
- Given the agent needs to discover what a skill does, the description should include a very brief description of functionality without delving into implementation details
19+
- Given the agent needs to discover when to use a skill, the description should include a very brief "Use when..." clause
20+
- Given a list of tasks, should generate one `/aidd-fix` delegation prompt per task
21+
- Given a delegation prompt, should start with `/aidd-fix`
22+
- Given a delegation prompt, should be wrapped in a markdown codeblock, with any nested codeblocks indented to prevent breaking the outer block
23+
- Given `--branch <branch>` is supplied, should instruct each sub-agent to work directly on `<branch>` and commit and push to origin on `<branch>`
24+
- Given `--branch` is omitted, should assume the current branch
25+
- Given `/aidd-parallel delegate`, should first create a list of files that will need to change and a mermaid change dependency graph (for sequencing reference only — do not save or commit)
26+
- Given `/aidd-parallel delegate`, should use the dependency graph to sequence the prompts before dispatching
27+
- Given `/aidd-parallel delegate`, should spawn one sub-agent worker per prompt in dependency order
28+
- Given post-dispatch callbacks are needed (e.g. resolving PR threads), should be the caller's responsibility
29+
30+
Constraints {
31+
put the prompt in a markdown codeblock, indenting any nested codeblocks to prevent breaking the outer block
32+
instruct the agent to work directly from the supplied branch and commit directly to the supplied branch (not from/to main, not to their own fix branch)
33+
}
34+
35+
Commands {
36+
/aidd-parallel [--branch <branch>] <tasks> - generate one /aidd-fix delegation prompt per task
37+
/aidd-parallel delegate - build file list + mermaid dep graph, sequence, and dispatch to sub-agents
38+
}
39+
40+
---
41+
42+
## Add the aidd-parallel command
43+
44+
Add `ai/commands/aidd-parallel.md` so the skill is invokable and discoverable.
45+
46+
**Requirements**:
47+
- Given the command file, should load and execute `ai/skills/aidd-parallel/SKILL.md`
48+
- Given the command file, should respect constraints from `/aidd-please`
49+
50+
---
51+
52+
## Update aidd-pr to use aidd-parallel
53+
54+
Remove the prompt generation and constraint logic from `/aidd-pr` that now belongs in `/aidd-parallel`.
55+
56+
**Requirements**:
57+
- Given remaining issues after triage, `/aidd-pr` should call `/aidd-parallel` to generate delegation prompts rather than generating them inline
58+
- Given the inner `Constraints` block in `/aidd-pr` (codeblock format, branch targeting), should be removed from `/aidd-pr` — it belongs in `/aidd-parallel`
59+
- Given `/aidd-pr delegate`, should call `/aidd-parallel delegate` and then resolve related PR conversation threads via the GitHub GraphQL API
60+
61+
---
62+
63+
## Add aidd-parallel eval
64+
65+
Add `ai-evals/aidd-parallel/` with a unit eval for prompt generation.
66+
67+
**Requirements**:
68+
- Given a list of tasks and a branch, the eval should assert one prompt is generated per task
69+
- Given a generated prompt, should assert it starts with `/aidd-fix`
70+
- Given a generated prompt, should assert it references the correct branch
71+
- Given a generated prompt, should assert it is wrapped in a markdown codeblock
72+
73+
---
74+
75+
## Update aidd-please discovery
76+
77+
Add `/aidd-parallel` to the Commands block in `ai/skills/aidd-please/SKILL.md`.
78+
79+
**Requirements**:
80+
- Given the aidd-please Commands block, should list `/aidd-parallel` so agents can discover it

0 commit comments

Comments
 (0)