@copilot-swarm/core 0.0.0 → 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +229 -0
- package/package.json +6 -6
package/README.md
ADDED
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
# @copilot-swarm/core
|
|
2
|
+
|
|
3
|
+
Multi-agent orchestrator for GitHub Copilot — coordinates PM, designer, engineer, reviewer, and tester agents through a declarative pipeline.
|
|
4
|
+
|
|
5
|
+
## Why?
|
|
6
|
+
|
|
7
|
+
Modern AI coding assistants work well for individual tasks, but complex features benefit from a structured multi-agent approach. Copilot Swarm mimics a high-performing engineering team: a PM writes specs, reviewers challenge them, an engineer implements, a code reviewer gates quality, and a QA tester validates — all coordinated automatically with self-correcting review loops.
|
|
8
|
+
|
|
9
|
+
## Quick Start
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
# Run directly — no install required
|
|
13
|
+
npx @copilot-swarm/core "Add a dark mode toggle"
|
|
14
|
+
|
|
15
|
+
# Or install globally for the short `swarm` command
|
|
16
|
+
npm install -g @copilot-swarm/core
|
|
17
|
+
swarm "Add a dark mode toggle"
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
> **Prerequisite:** An active [GitHub Copilot](https://github.com/features/copilot) subscription and the [GitHub CLI](https://cli.github.com/) (`gh`) authenticated on your machine.
|
|
21
|
+
|
|
22
|
+
## CLI Reference
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
Usage: swarm [command] [options] "<prompt>"
|
|
26
|
+
|
|
27
|
+
Commands:
|
|
28
|
+
run Run the full orchestration pipeline (default)
|
|
29
|
+
plan Interactive planning mode — clarify requirements before running
|
|
30
|
+
|
|
31
|
+
Options:
|
|
32
|
+
-v, --verbose Enable verbose streaming output
|
|
33
|
+
-p, --plan <file> Use a plan file as input (reads the refined requirements section)
|
|
34
|
+
-h, --help Show this help message
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Examples
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
# Basic run
|
|
41
|
+
swarm "Fix the login bug on the settings page"
|
|
42
|
+
|
|
43
|
+
# Verbose output (streams agent deltas, tool calls, intent updates)
|
|
44
|
+
swarm -v "Add user avatar upload"
|
|
45
|
+
|
|
46
|
+
# Plan first, run later
|
|
47
|
+
swarm plan "Redesign the notification system"
|
|
48
|
+
swarm --plan doc/plan-latest.md
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
The prompt can also be passed via the `ISSUE_BODY` environment variable. CLI arguments take precedence.
|
|
52
|
+
|
|
53
|
+
## Planning Mode
|
|
54
|
+
|
|
55
|
+
Use `swarm plan` to interactively refine vague requirements before running the full pipeline:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
swarm plan "Add a dark mode toggle"
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Two phases run in sequence:
|
|
62
|
+
|
|
63
|
+
1. **Requirements Clarification** — A PM agent asks targeted questions to fill gaps in the requirements. Answer interactively in the terminal. Press Enter to skip a round.
|
|
64
|
+
2. **Technical Analysis** — An engineering agent analyzes the codebase and reports complexity, affected files, risks, and a suggested approach.
|
|
65
|
+
|
|
66
|
+
Output:
|
|
67
|
+
|
|
68
|
+
- `doc/plan-<timestamp>.md` — Timestamped plan (never overwritten)
|
|
69
|
+
- `doc/plan-latest.md` — Copy of the most recent plan
|
|
70
|
+
|
|
71
|
+
Then feed the plan into the full pipeline:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
swarm --plan doc/plan-latest.md
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Pipeline
|
|
78
|
+
|
|
79
|
+
The default pipeline runs five phases:
|
|
80
|
+
|
|
81
|
+
| Phase | What happens |
|
|
82
|
+
|---|---|
|
|
83
|
+
| **Spec** | PM drafts a specification, reviewed by a creative reviewer and a technical architect (up to 3 iterations each) |
|
|
84
|
+
| **Decompose** | PM splits the spec into 2–3 independent tasks, marking frontend tasks with `[FRONTEND]` |
|
|
85
|
+
| **Design** | *(conditional)* If frontend tasks exist, a designer creates a UI/UX spec, reviewed by a design reviewer |
|
|
86
|
+
| **Implement** | Each task runs in parallel: engineer implements → code reviewer gates quality → QA validates against spec |
|
|
87
|
+
| **Cross-model review** | *(conditional)* A different AI model reviews all output, catching model-specific blind spots |
|
|
88
|
+
|
|
89
|
+
### Built-in Agents
|
|
90
|
+
|
|
91
|
+
| Agent | Role |
|
|
92
|
+
|---|---|
|
|
93
|
+
| `pm` | Analyzes requirements, writes specs, decomposes tasks |
|
|
94
|
+
| `pm-reviewer` | Challenges the PM's spec for completeness |
|
|
95
|
+
| `spec-reviewer` | Validates technical feasibility |
|
|
96
|
+
| `designer` | Creates UI/UX specifications for frontend tasks |
|
|
97
|
+
| `design-reviewer` | Reviews designs for usability and accessibility |
|
|
98
|
+
| `engineer` | Implements code based on specs and designs |
|
|
99
|
+
| `code-reviewer` | Security and quality gate |
|
|
100
|
+
| `tester` | QA validation against acceptance criteria |
|
|
101
|
+
| `cross-model` | Independent review using a different AI model |
|
|
102
|
+
|
|
103
|
+
## Configuration
|
|
104
|
+
|
|
105
|
+
Drop a `swarm.config.yaml` in your repo root to customize the pipeline. If not present, the built-in default is used.
|
|
106
|
+
|
|
107
|
+
```yaml
|
|
108
|
+
primaryModel: claude-opus-4-6-fast
|
|
109
|
+
reviewModel: gpt-5.2-codex
|
|
110
|
+
|
|
111
|
+
agents:
|
|
112
|
+
pm: builtin:pm
|
|
113
|
+
engineer: .github/agents/engineer.md # Custom instructions
|
|
114
|
+
security: .github/agents/security.md # New agent
|
|
115
|
+
code-reviewer: builtin:eng-code-reviewer
|
|
116
|
+
|
|
117
|
+
pipeline:
|
|
118
|
+
- phase: spec
|
|
119
|
+
agent: pm
|
|
120
|
+
reviews:
|
|
121
|
+
- agent: pm-reviewer
|
|
122
|
+
maxIterations: 3
|
|
123
|
+
approvalKeyword: APPROVED
|
|
124
|
+
|
|
125
|
+
- phase: decompose
|
|
126
|
+
agent: pm
|
|
127
|
+
frontendMarker: "[FRONTEND]"
|
|
128
|
+
|
|
129
|
+
# No design phase — backend-only project
|
|
130
|
+
|
|
131
|
+
- phase: implement
|
|
132
|
+
parallel: true
|
|
133
|
+
agent: engineer
|
|
134
|
+
reviews:
|
|
135
|
+
- agent: code-reviewer
|
|
136
|
+
maxIterations: 3
|
|
137
|
+
approvalKeyword: APPROVED
|
|
138
|
+
- agent: security
|
|
139
|
+
maxIterations: 2
|
|
140
|
+
approvalKeyword: APPROVED
|
|
141
|
+
qa:
|
|
142
|
+
agent: tester
|
|
143
|
+
maxIterations: 8
|
|
144
|
+
approvalKeyword: ALL_PASSED
|
|
145
|
+
|
|
146
|
+
- phase: cross-model-review
|
|
147
|
+
condition: differentReviewModel
|
|
148
|
+
agent: cross-model
|
|
149
|
+
fixAgent: engineer
|
|
150
|
+
maxIterations: 3
|
|
151
|
+
approvalKeyword: APPROVED
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### Agent Resolution
|
|
155
|
+
|
|
156
|
+
| Format | Resolution |
|
|
157
|
+
|---|---|
|
|
158
|
+
| `builtin:<name>` | Loads from the package's built-in agent definitions |
|
|
159
|
+
| `path/to/file.md` | Loads from the repository root |
|
|
160
|
+
| *(fallback)* | Looks for `<AGENTS_DIR>/<name>.md` |
|
|
161
|
+
|
|
162
|
+
## Environment Variables
|
|
163
|
+
|
|
164
|
+
| Variable | Default | Description |
|
|
165
|
+
|---|---|---|
|
|
166
|
+
| `ISSUE_BODY` | — | Task description (alternative to CLI prompt) |
|
|
167
|
+
| `VERBOSE` | `false` | Enable verbose streaming output |
|
|
168
|
+
| `AGENTS_DIR` | `.github/agents` | Directory for agent instruction files |
|
|
169
|
+
| `DOC_DIR` | `doc` | Output directory for summaries |
|
|
170
|
+
| `SESSION_TIMEOUT_MS` | `300000` | Timeout per agent session (ms) |
|
|
171
|
+
| `MAX_RETRIES` | `2` | Retry attempts for failed agent responses |
|
|
172
|
+
| `SUMMARY_FILE_NAME` | `swarm-summary.md` | Final summary filename |
|
|
173
|
+
| `PRIMARY_MODEL` | `claude-opus-4-6-fast` | AI model for primary agents (overrides YAML) |
|
|
174
|
+
| `REVIEW_MODEL` | `gpt-5.2-codex` | AI model for cross-model review (overrides YAML) |
|
|
175
|
+
|
|
176
|
+
## GitHub Actions
|
|
177
|
+
|
|
178
|
+
Trigger the swarm from GitHub Issues by adding a workflow to your repo:
|
|
179
|
+
|
|
180
|
+
```yaml
|
|
181
|
+
# .github/workflows/swarm-trigger.yml
|
|
182
|
+
name: Run Copilot Swarm
|
|
183
|
+
on:
|
|
184
|
+
issues:
|
|
185
|
+
types: [labeled]
|
|
186
|
+
|
|
187
|
+
jobs:
|
|
188
|
+
swarm:
|
|
189
|
+
if: contains(fromJson('["run-swarm","run-swarm-verbose"]'), github.event.label.name)
|
|
190
|
+
runs-on: ubuntu-latest
|
|
191
|
+
timeout-minutes: 120
|
|
192
|
+
permissions:
|
|
193
|
+
contents: write
|
|
194
|
+
issues: write
|
|
195
|
+
pull-requests: write
|
|
196
|
+
steps:
|
|
197
|
+
- uses: actions/checkout@v4
|
|
198
|
+
- uses: actions/setup-node@v4
|
|
199
|
+
with: { node-version: "22" }
|
|
200
|
+
- uses: mvkaran/setup-copilot-cli@v1
|
|
201
|
+
with: { token: "${{ secrets.COPILOT_CLI_TOKEN }}" }
|
|
202
|
+
- run: npx @copilot-swarm/core "${{ github.event.issue.body }}"
|
|
203
|
+
env:
|
|
204
|
+
GITHUB_TOKEN: ${{ secrets.COPILOT_CLI_TOKEN }}
|
|
205
|
+
VERBOSE: ${{ github.event.label.name == 'run-swarm-verbose' }}
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
Label an issue with `run-swarm` or `run-swarm-verbose` to trigger it.
|
|
209
|
+
|
|
210
|
+
## Output
|
|
211
|
+
|
|
212
|
+
The orchestrator writes these files to the configured `DOC_DIR`:
|
|
213
|
+
|
|
214
|
+
| File | Description |
|
|
215
|
+
|---|---|
|
|
216
|
+
| `<agent-name>.md` | Per-role summary with timestamp |
|
|
217
|
+
| `engineer-stream-N.md` | Per-task engineering output |
|
|
218
|
+
| `cross-model-review.md` | Cross-model review results (if applicable) |
|
|
219
|
+
| `swarm-summary.md` | Final summary with all stream results |
|
|
220
|
+
|
|
221
|
+
## Requirements
|
|
222
|
+
|
|
223
|
+
- **Node.js** ≥ 22
|
|
224
|
+
- **GitHub Copilot** — active subscription
|
|
225
|
+
- **GitHub CLI** (`gh`) — authenticated
|
|
226
|
+
|
|
227
|
+
## License
|
|
228
|
+
|
|
229
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@copilot-swarm/core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.1",
|
|
4
4
|
"description": "Multi-agent orchestrator for GitHub Copilot — coordinates PM, designer, engineer, reviewer, and tester agents through a declarative pipeline",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -30,15 +30,15 @@
|
|
|
30
30
|
"engines": {
|
|
31
31
|
"node": ">=22"
|
|
32
32
|
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@github/copilot-sdk": "latest",
|
|
35
|
+
"yaml": "^2.8.2"
|
|
36
|
+
},
|
|
33
37
|
"scripts": {
|
|
34
38
|
"start": "tsx src/index.ts",
|
|
35
39
|
"build": "tsc",
|
|
36
40
|
"typecheck": "tsc --noEmit",
|
|
37
41
|
"check": "biome check src/",
|
|
38
42
|
"test": "vitest run"
|
|
39
|
-
},
|
|
40
|
-
"dependencies": {
|
|
41
|
-
"@github/copilot-sdk": "latest",
|
|
42
|
-
"yaml": "^2.8.2"
|
|
43
43
|
}
|
|
44
|
-
}
|
|
44
|
+
}
|