codeswarm 0.1.0
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/.codeswarm/skills/prd_template.md +98 -0
- package/AGENT_TIPS.md +206 -0
- package/BROWSER_TESTING.md +177 -0
- package/COORDINATOR.md +151 -0
- package/LICENSE +21 -0
- package/README.md +253 -0
- package/TASK_PROTOCOL.md +111 -0
- package/WORKFLOWS.md +174 -0
- package/bin/codeswarm.js +15 -0
- package/config.yaml +55 -0
- package/coordinator.sh +1762 -0
- package/dashboard/package-lock.json +1036 -0
- package/dashboard/package.json +14 -0
- package/dashboard/public/index.html +758 -0
- package/dashboard/server.js +444 -0
- package/docs/prd-example.md +90 -0
- package/docs/prd-template.md +45 -0
- package/orchestrate.sh +467 -0
- package/package.json +62 -0
- package/playwright.config.ts +19 -0
- package/setup.sh +142 -0
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# PRD Generator Skill
|
|
2
|
+
|
|
3
|
+
Generate a structured Product Requirements Document (PRD) for autonomous agent execution.
|
|
4
|
+
|
|
5
|
+
## Goal
|
|
6
|
+
Create a PRD that breaks work into small, dependency-ordered user stories with verifiable acceptance criteria.
|
|
7
|
+
|
|
8
|
+
## PRD Format
|
|
9
|
+
|
|
10
|
+
Write the PRD using this exact structure:
|
|
11
|
+
|
|
12
|
+
```markdown
|
|
13
|
+
# PRD: <Project Title>
|
|
14
|
+
|
|
15
|
+
## Overview
|
|
16
|
+
<2-3 sentence description of the feature and what problem it solves>
|
|
17
|
+
|
|
18
|
+
## Tech Stack
|
|
19
|
+
<language, framework, database — from project analysis>
|
|
20
|
+
|
|
21
|
+
## User Stories
|
|
22
|
+
|
|
23
|
+
### US-001: <Title> [priority: 1]
|
|
24
|
+
**Description:** As a <user>, I want <feature> so that <benefit>.
|
|
25
|
+
**Files:** `path/to/file1`, `path/to/file2`
|
|
26
|
+
**Acceptance Criteria:**
|
|
27
|
+
- [ ] <specific, testable criterion>
|
|
28
|
+
- [ ] <specific, testable criterion>
|
|
29
|
+
- [ ] Build passes (e.g. `mvn compile`, `npm run build`)
|
|
30
|
+
**Dependencies:** none
|
|
31
|
+
**Notes:** <patterns to follow, gotchas>
|
|
32
|
+
|
|
33
|
+
### US-002: <Title> [priority: 2]
|
|
34
|
+
...
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Story Sizing Rules
|
|
38
|
+
|
|
39
|
+
Each user story MUST be completable by one agent in ~10 minutes (one context window).
|
|
40
|
+
|
|
41
|
+
### Right-sized:
|
|
42
|
+
- Add a database column and migration
|
|
43
|
+
- Add a UI component to an existing page
|
|
44
|
+
- Update a service method with new logic
|
|
45
|
+
- Add a filter/dropdown to a list
|
|
46
|
+
- Create a single REST endpoint
|
|
47
|
+
|
|
48
|
+
### Too big — split these:
|
|
49
|
+
- "Build the entire dashboard" → Split: schema, queries, UI, filters
|
|
50
|
+
- "Add authentication" → Split: schema, middleware, login UI, session
|
|
51
|
+
- "Refactor the API" → Split: one story per endpoint
|
|
52
|
+
|
|
53
|
+
**Rule of thumb:** If you cannot describe the change in 2-3 sentences, it's too big.
|
|
54
|
+
|
|
55
|
+
## Story Ordering
|
|
56
|
+
|
|
57
|
+
Stories execute in priority order. Earlier stories must NOT depend on later ones.
|
|
58
|
+
|
|
59
|
+
**Correct Order:**
|
|
60
|
+
1. Schema/database changes (migrations, tables)
|
|
61
|
+
2. Domain entities/models
|
|
62
|
+
3. Service layer / business logic
|
|
63
|
+
4. REST controllers / API endpoints
|
|
64
|
+
5. UI components that use the backend
|
|
65
|
+
6. Integration / summary views
|
|
66
|
+
|
|
67
|
+
## Acceptance Criteria Rules
|
|
68
|
+
|
|
69
|
+
Each criterion must be verifiable — something an agent can CHECK.
|
|
70
|
+
|
|
71
|
+
### Good (verifiable):
|
|
72
|
+
- "Add `status` column to tasks table with default 'PENDING'"
|
|
73
|
+
- "GET /api/tasks returns 200 with JSON array"
|
|
74
|
+
- "Filter dropdown has options: All, Active, Completed"
|
|
75
|
+
- "Build passes (`mvn compile` / `npm run build`)"
|
|
76
|
+
|
|
77
|
+
### Bad (vague):
|
|
78
|
+
- "Works correctly"
|
|
79
|
+
- "Good UX"
|
|
80
|
+
- "Handles edge cases"
|
|
81
|
+
|
|
82
|
+
### Always include as the last criterion:
|
|
83
|
+
- `Build passes` (e.g. `mvn compile`, `npm run build`, `tsc --noEmit`)
|
|
84
|
+
|
|
85
|
+
### For UI stories, also include:
|
|
86
|
+
- `Verify in browser` (visual confirmation via screenshot or dev tools)
|
|
87
|
+
|
|
88
|
+
## Before Saving
|
|
89
|
+
|
|
90
|
+
Verify:
|
|
91
|
+
- [ ] Read existing code first to understand patterns and conventions
|
|
92
|
+
- [ ] Each story is completable in one iteration (~10 min)
|
|
93
|
+
- [ ] Stories ordered by dependency (schema → entities → services → controllers → UI)
|
|
94
|
+
- [ ] Every story has "Build passes" in acceptance criteria
|
|
95
|
+
- [ ] Acceptance criteria are specific and verifiable
|
|
96
|
+
- [ ] No story depends on a later story
|
|
97
|
+
- [ ] File paths are specific (name files, classes, methods)
|
|
98
|
+
- [ ] Referenced existing implementations as patterns to follow
|
package/AGENT_TIPS.md
ADDED
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
# Agent Tips & Configuration
|
|
2
|
+
|
|
3
|
+
## Claude Code
|
|
4
|
+
|
|
5
|
+
### Key Flags
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
claude -p "prompt" # Headless mode (print & exit)
|
|
9
|
+
claude --model opus # Use Claude Opus
|
|
10
|
+
claude --model sonnet # Use Claude Sonnet (faster/cheaper)
|
|
11
|
+
claude --permission-mode plan # Read-only mode (no edits)
|
|
12
|
+
claude --permission-mode auto_edit # Auto-approve edits (no prompts)
|
|
13
|
+
claude --chrome # Enable Chrome browser control
|
|
14
|
+
claude --agents '{"name": {...}}' # Define custom subagents
|
|
15
|
+
claude --add-dir /other/project # Add additional directories
|
|
16
|
+
claude --mcp-config mcp.json # Load MCP servers
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Claude Agent Teams (Experimental)
|
|
20
|
+
|
|
21
|
+
Define a team of specialized subagents:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
claude --agents '{
|
|
25
|
+
"architect": {
|
|
26
|
+
"description": "Designs system architecture",
|
|
27
|
+
"prompt": "You analyze requirements and design scalable architectures",
|
|
28
|
+
"model": "opus"
|
|
29
|
+
},
|
|
30
|
+
"implementer": {
|
|
31
|
+
"description": "Implements code changes",
|
|
32
|
+
"prompt": "You write clean, tested code following team conventions",
|
|
33
|
+
"model": "sonnet"
|
|
34
|
+
},
|
|
35
|
+
"qa": {
|
|
36
|
+
"description": "Tests and validates changes",
|
|
37
|
+
"prompt": "You test code for bugs, edge cases, and regressions",
|
|
38
|
+
"model": "sonnet"
|
|
39
|
+
}
|
|
40
|
+
}'
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Or via `.claude/agents/` markdown files:
|
|
44
|
+
|
|
45
|
+
```markdown
|
|
46
|
+
---
|
|
47
|
+
name: architect
|
|
48
|
+
description: Designs system architecture
|
|
49
|
+
model: opus
|
|
50
|
+
allowedTools:
|
|
51
|
+
- Read
|
|
52
|
+
- Bash(find:*, grep:*, cat:*, tree:*)
|
|
53
|
+
---
|
|
54
|
+
You are an expert software architect. Analyze requirements and produce
|
|
55
|
+
detailed implementation plans with file paths, interfaces, and data models.
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Best Practices
|
|
59
|
+
|
|
60
|
+
- Use `opus` for planning (better reasoning, slower)
|
|
61
|
+
- Use `sonnet` for execution (fast, good at code generation)
|
|
62
|
+
- Use `--permission-mode plan` for reviewers (prevents accidental edits)
|
|
63
|
+
- Use `--add-dir` to give access to multiple related projects
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Gemini CLI
|
|
68
|
+
|
|
69
|
+
### Key Flags
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
gemini -p "prompt" # Headless mode (prompt & exit)
|
|
73
|
+
gemini --model gemini-2.5-pro # Specify model
|
|
74
|
+
gemini --approval-mode yolo # Auto-approve everything
|
|
75
|
+
gemini --approval-mode auto_edit # Auto-approve edits only
|
|
76
|
+
gemini --approval-mode plan # Read-only mode
|
|
77
|
+
gemini -y # YOLO mode (same as approval-mode yolo)
|
|
78
|
+
gemini --include-directories /other/project # Add extra dirs
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Configuration Files
|
|
82
|
+
|
|
83
|
+
- `~/.gemini/settings.json` — Global settings and MCP servers
|
|
84
|
+
- `.gemini/settings.json` — Project-level settings
|
|
85
|
+
- `.gemini/AGENTS.md` — Custom agent instructions
|
|
86
|
+
|
|
87
|
+
### Project-Level Agent Instructions
|
|
88
|
+
|
|
89
|
+
Create `.gemini/AGENTS.md` in your project:
|
|
90
|
+
|
|
91
|
+
```markdown
|
|
92
|
+
# Project Agent Instructions
|
|
93
|
+
|
|
94
|
+
## Architecture
|
|
95
|
+
- This is a Spring Boot microservice using Hexagonal Architecture
|
|
96
|
+
- Entities go in domain/, services in application/, REST controllers in adapter/web/
|
|
97
|
+
|
|
98
|
+
## Code Conventions
|
|
99
|
+
- Use Lombok @Data for DTOs
|
|
100
|
+
- Use constructor injection
|
|
101
|
+
- All endpoints return ResultDTO
|
|
102
|
+
- Follow existing naming patterns
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Best Practices
|
|
106
|
+
|
|
107
|
+
- Gemini is excellent at file editing — ideal as executor
|
|
108
|
+
- Use `--approval-mode auto_edit` for automated execution
|
|
109
|
+
- YOLO mode (`-y`) is useful for fully automated pipelines
|
|
110
|
+
- Use `--include-directories` for multi-project tasks
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## Codex CLI
|
|
115
|
+
|
|
116
|
+
### Key Flags
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
codex exec "prompt" # Non-interactive execution
|
|
120
|
+
codex review # Code review mode
|
|
121
|
+
codex exec --sandbox read-only "prompt" # Read-only sandbox
|
|
122
|
+
codex -m o3 "prompt" # Use specific model
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Configuration
|
|
126
|
+
|
|
127
|
+
`~/.codex/config.toml`:
|
|
128
|
+
|
|
129
|
+
```toml
|
|
130
|
+
model = "o4-mini"
|
|
131
|
+
|
|
132
|
+
[sandbox_permissions]
|
|
133
|
+
disk-full-read-access = true
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Code Review
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
# Review uncommitted changes
|
|
140
|
+
codex review
|
|
141
|
+
|
|
142
|
+
# Review with specific focus
|
|
143
|
+
codex exec --sandbox read-only "Review the git diff for security issues, \
|
|
144
|
+
performance problems, and adherence to SOLID principles. \
|
|
145
|
+
Output a structured markdown report."
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### Best Practices
|
|
149
|
+
|
|
150
|
+
- Codex excels at code review with `--sandbox read-only`
|
|
151
|
+
- Use `codex review` for the built-in review workflow
|
|
152
|
+
- Use `o3` or `o4-mini` models for reasoning-heavy reviews
|
|
153
|
+
- The sandbox prevents accidental modifications during review
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## Windsurf
|
|
158
|
+
|
|
159
|
+
### Integration with Orchestrator
|
|
160
|
+
|
|
161
|
+
Windsurf (Cascade) can read the `.codeswarm/` directory:
|
|
162
|
+
|
|
163
|
+
1. Open your project in Windsurf
|
|
164
|
+
2. Ask Cascade: *"Read `.codeswarm/plan.md` and implement the changes"*
|
|
165
|
+
3. Or: *"Read `.codeswarm/review.md` and fix the issues mentioned"*
|
|
166
|
+
|
|
167
|
+
### When to Use Windsurf
|
|
168
|
+
|
|
169
|
+
- Complex refactoring that benefits from IDE context
|
|
170
|
+
- Debugging with breakpoints and step-through
|
|
171
|
+
- Visual feedback during development
|
|
172
|
+
- When you want an interactive conversation about the plan
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## Antigravity
|
|
177
|
+
|
|
178
|
+
### Integration with Orchestrator
|
|
179
|
+
|
|
180
|
+
Antigravity has built-in browser capabilities:
|
|
181
|
+
|
|
182
|
+
1. Open your project in Antigravity
|
|
183
|
+
2. Ask: *"Read `.codeswarm/plan.md` and implement changes"*
|
|
184
|
+
3. For browser testing: *"Open http://localhost:4200 in the browser, login, and verify the dashboard"*
|
|
185
|
+
4. Design tasks: Use Pencil MCP for design-to-code workflows
|
|
186
|
+
|
|
187
|
+
### When to Use Antigravity
|
|
188
|
+
|
|
189
|
+
- Tasks involving UI design or visual prototyping
|
|
190
|
+
- Browser-based verification with built-in browser tools
|
|
191
|
+
- When you need Pencil MCP for design work
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
## Choosing the Right Agent
|
|
196
|
+
|
|
197
|
+
| Task Type | Recommended | Why |
|
|
198
|
+
|-----------|-------------|-----|
|
|
199
|
+
| Architecture planning | Claude (Opus) | Best reasoning and analysis |
|
|
200
|
+
| Code implementation | Gemini CLI | Fast, great at file editing |
|
|
201
|
+
| Code review | Codex CLI | Built-in review mode, sandbox |
|
|
202
|
+
| Complex debugging | Windsurf | IDE debugging tools |
|
|
203
|
+
| Frontend/Design | Antigravity | Browser + Pencil MCP |
|
|
204
|
+
| Quick prototyping | Gemini (YOLO) | Fastest iteration |
|
|
205
|
+
| Security audit | Codex (read-only) | Sandboxed analysis |
|
|
206
|
+
| Multi-repo tasks | Claude | Best at cross-project reasoning |
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
# 🌐 Browser Testing Guide
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Frontend testing is handled via **Playwright MCP** — a Model Context Protocol server that gives AI agents control over a real browser (Chrome/Chromium). Agents can navigate, click, type, take screenshots, and report results.
|
|
6
|
+
|
|
7
|
+
## Setup
|
|
8
|
+
|
|
9
|
+
### 1. Install Playwright
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
# From the agentic project root
|
|
13
|
+
cd /Users/msk/IdeaProjects/agentic
|
|
14
|
+
npm init -y
|
|
15
|
+
npm install playwright @playwright/test
|
|
16
|
+
npx playwright install chromium
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### 2. Install Playwright MCP Server
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npm install -g @anthropic/mcp-server-playwright
|
|
23
|
+
# or use npx
|
|
24
|
+
npx @anthropic/mcp-server-playwright
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### 3. Configure MCP for Claude Code
|
|
28
|
+
|
|
29
|
+
Create or update `~/.claude/mcp.json`:
|
|
30
|
+
|
|
31
|
+
```json
|
|
32
|
+
{
|
|
33
|
+
"mcpServers": {
|
|
34
|
+
"playwright": {
|
|
35
|
+
"command": "npx",
|
|
36
|
+
"args": ["@anthropic/mcp-server-playwright"],
|
|
37
|
+
"env": {
|
|
38
|
+
"PLAYWRIGHT_HEADLESS": "true"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### 4. Configure MCP for Gemini CLI
|
|
46
|
+
|
|
47
|
+
Create or update `~/.gemini/settings.json`:
|
|
48
|
+
|
|
49
|
+
```json
|
|
50
|
+
{
|
|
51
|
+
"mcpServers": {
|
|
52
|
+
"playwright": {
|
|
53
|
+
"command": "npx",
|
|
54
|
+
"args": ["@anthropic/mcp-server-playwright"]
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### 5. Configure MCP for Codex CLI
|
|
61
|
+
|
|
62
|
+
Create or update `~/.codex/config.toml` or provide via `--mcp-config`:
|
|
63
|
+
|
|
64
|
+
```toml
|
|
65
|
+
[mcp_servers.playwright]
|
|
66
|
+
command = "npx"
|
|
67
|
+
args = ["@anthropic/mcp-server-playwright"]
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Usage
|
|
71
|
+
|
|
72
|
+
### Via Orchestrator
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
./orchestrate.sh \
|
|
76
|
+
--project ~/IdeaProjects/derin-ui-manager \
|
|
77
|
+
--task "Verify login page and dashboard navigation" \
|
|
78
|
+
--browser-test \
|
|
79
|
+
--test-url "http://localhost:4200"
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Direct Agent Testing
|
|
83
|
+
|
|
84
|
+
#### Claude Code (with Chrome integration)
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
# Claude Code has a built-in --chrome flag for browser control
|
|
88
|
+
claude -p "Navigate to http://localhost:4200, login with admin/admin, \
|
|
89
|
+
go to the Dashboard page, take a screenshot, then go to Settings, \
|
|
90
|
+
take another screenshot. Report any visual issues." \
|
|
91
|
+
--chrome
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
#### Claude Code (with Playwright MCP)
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
claude -p "Use the Playwright MCP tools to: \
|
|
98
|
+
1. Open http://localhost:4200 \
|
|
99
|
+
2. Fill in username 'admin' and password 'admin' \
|
|
100
|
+
3. Click the Login button \
|
|
101
|
+
4. Wait for the dashboard to load \
|
|
102
|
+
5. Take a screenshot named 'dashboard.png' \
|
|
103
|
+
6. Click on each sidebar menu item \
|
|
104
|
+
7. Take a screenshot of each page \
|
|
105
|
+
8. Report your findings"
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
#### Gemini CLI (with Playwright MCP)
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
gemini -p "Use Playwright to test http://localhost:4200: \
|
|
112
|
+
login with admin/admin, navigate to all main pages, \
|
|
113
|
+
take screenshots, verify no console errors, report issues."
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Writing Custom Test Scripts
|
|
117
|
+
|
|
118
|
+
For repeatable tests, create Playwright test files:
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
mkdir -p /Users/msk/IdeaProjects/agentic/tests
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Example: Login & Navigate Test
|
|
125
|
+
|
|
126
|
+
Create `tests/login-navigate.spec.ts`:
|
|
127
|
+
|
|
128
|
+
```typescript
|
|
129
|
+
import { test, expect } from '@playwright/test';
|
|
130
|
+
|
|
131
|
+
test.describe('Login and Navigation', () => {
|
|
132
|
+
test('should login and navigate dashboard', async ({ page }) => {
|
|
133
|
+
// Navigate to login
|
|
134
|
+
await page.goto('http://localhost:4200');
|
|
135
|
+
await page.screenshot({ path: '.agentic/screenshots/01-login-page.png' });
|
|
136
|
+
|
|
137
|
+
// Fill credentials
|
|
138
|
+
await page.fill('input[name="username"]', 'admin');
|
|
139
|
+
await page.fill('input[name="password"]', 'admin');
|
|
140
|
+
await page.click('button[type="submit"]');
|
|
141
|
+
|
|
142
|
+
// Wait for dashboard
|
|
143
|
+
await page.waitForURL('**/dashboard**');
|
|
144
|
+
await page.screenshot({ path: '.agentic/screenshots/02-dashboard.png' });
|
|
145
|
+
|
|
146
|
+
// Navigate sidebar items
|
|
147
|
+
const menuItems = await page.locator('nav a').all();
|
|
148
|
+
for (let i = 0; i < menuItems.length; i++) {
|
|
149
|
+
await menuItems[i].click();
|
|
150
|
+
await page.waitForLoadState('networkidle');
|
|
151
|
+
await page.screenshot({
|
|
152
|
+
path: `.agentic/screenshots/03-page-${i}.png`
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### Running Tests
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
npx playwright test tests/login-navigate.spec.ts --reporter=html
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
## Screenshot Reports
|
|
166
|
+
|
|
167
|
+
Screenshots are saved to `<project>/.agentic/screenshots/`. The orchestrator generates a markdown report referencing these screenshots.
|
|
168
|
+
|
|
169
|
+
## Troubleshooting
|
|
170
|
+
|
|
171
|
+
| Issue | Solution |
|
|
172
|
+
|-------|----------|
|
|
173
|
+
| Browser won't launch | Run `npx playwright install chromium` |
|
|
174
|
+
| MCP server not found | `npm install -g @anthropic/mcp-server-playwright` |
|
|
175
|
+
| Login fails | Check credentials in `config.yaml` |
|
|
176
|
+
| Timeout errors | Increase `timeout_ms` in `config.yaml` |
|
|
177
|
+
| Port in use | Make sure dev server is running on the expected port |
|
package/COORDINATOR.md
ADDED
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
# Autonomous Multi-Agent Coordinator
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Unlike the basic `orchestrate.sh` (sequential pipeline), `coordinator.sh` runs agents in an **autonomous feedback loop** where they communicate, delegate tasks, and iterate until the work is approved.
|
|
6
|
+
|
|
7
|
+
## Flow
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
┌─────────────┐
|
|
11
|
+
┌─────│ PLANNER │─────┐
|
|
12
|
+
│ └─────────────┘ │
|
|
13
|
+
│ │ plan.md │
|
|
14
|
+
│ ▼ │
|
|
15
|
+
│ ┌─────────────┐ │
|
|
16
|
+
replan │ │ EXECUTOR │ │ re-consult on
|
|
17
|
+
request │ └─────────────┘ │ major issues
|
|
18
|
+
│ │ code changes │
|
|
19
|
+
│ ▼ │
|
|
20
|
+
│ ┌─────────────┐ │
|
|
21
|
+
│ │ REVIEWER │─────┘
|
|
22
|
+
│ └──────┬──────┘
|
|
23
|
+
│ │
|
|
24
|
+
│ ┌──────┴──────┐
|
|
25
|
+
│ │ │
|
|
26
|
+
▼ APPROVED NEEDS_CHANGES
|
|
27
|
+
DONE ✓ │
|
|
28
|
+
│ feedback
|
|
29
|
+
▼
|
|
30
|
+
┌─────────────┐
|
|
31
|
+
│ EXECUTOR │ ← fixes issues
|
|
32
|
+
└──────┬──────┘
|
|
33
|
+
│
|
|
34
|
+
▼
|
|
35
|
+
┌─────────────┐
|
|
36
|
+
│ REVIEWER │ ← re-checks
|
|
37
|
+
└──────┬──────┘
|
|
38
|
+
│
|
|
39
|
+
APPROVED or loop again
|
|
40
|
+
(max N iterations)
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Key Features
|
|
44
|
+
|
|
45
|
+
### 1. Message Bus
|
|
46
|
+
All agents communicate through a file-based message bus at `<project>/.agentic/bus/`. Every message is a timestamped markdown file that any agent can read.
|
|
47
|
+
|
|
48
|
+
### 2. Feedback Loop
|
|
49
|
+
When the reviewer says `NEEDS_CHANGES`, the executor automatically gets the feedback and tries again. No human intervention needed.
|
|
50
|
+
|
|
51
|
+
### 3. Planner Re-consultation
|
|
52
|
+
If the reviewer flags `BLOCKER`, `ARCHITECTURE`, or `FUNDAMENTAL` issues, the coordinator automatically re-consults the planner to update the plan before the executor tries again.
|
|
53
|
+
|
|
54
|
+
### 4. Session History
|
|
55
|
+
All messages, prompts, and outputs are saved to `<project>/.codeswarm/sessions/<session_id>/`, creating a full audit trail.
|
|
56
|
+
|
|
57
|
+
### 5. Configurable Iterations
|
|
58
|
+
Set `--max-iterations` to control how many execute→review cycles are allowed (default: 5).
|
|
59
|
+
|
|
60
|
+
## Usage
|
|
61
|
+
|
|
62
|
+
### Basic
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
./coordinator.sh \
|
|
66
|
+
--project ~/IdeaProjects/blue-flow \
|
|
67
|
+
--task "Add leave approval notification endpoint"
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Custom Agents & Models
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
./coordinator.sh \
|
|
74
|
+
--project ~/IdeaProjects/blue-flow \
|
|
75
|
+
--task "Implement İşe Başlayan Personel Girişi process" \
|
|
76
|
+
--planner codex --planner-model gpt-5.3 \
|
|
77
|
+
--executor claude --executor-model opus \
|
|
78
|
+
--reviewer gemini \
|
|
79
|
+
--context "İşe Başlayan Personel Girişi.xml" \
|
|
80
|
+
--max-iterations 5
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### With Context Files
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
./coordinator.sh \
|
|
87
|
+
--project ~/IdeaProjects/blue-flow \
|
|
88
|
+
--task "Implement the leave process from XML" \
|
|
89
|
+
--context "IdariPersonelIzinSureci.xml,src/main/java/com/app/blue/domain/Leave.java"
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Verbose Mode
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
./coordinator.sh \
|
|
96
|
+
--project ~/IdeaProjects/blue-flow \
|
|
97
|
+
--task "Fix bug in process engine" \
|
|
98
|
+
--verbose
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Dry Run (see commands without executing)
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
./coordinator.sh \
|
|
105
|
+
--project ~/IdeaProjects/blue-flow \
|
|
106
|
+
--task "Test task" \
|
|
107
|
+
--dry-run
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## Session Artifacts
|
|
111
|
+
|
|
112
|
+
After a run, you'll find:
|
|
113
|
+
|
|
114
|
+
```
|
|
115
|
+
<project>/.agentic/
|
|
116
|
+
├── plan.md # Current plan
|
|
117
|
+
├── execution.log # Latest executor output
|
|
118
|
+
├── review.md # Latest review
|
|
119
|
+
├── report-<timestamp>.md # Final summary report
|
|
120
|
+
└── sessions/session_<timestamp>/
|
|
121
|
+
├── coordinator.log # Full coordinator log
|
|
122
|
+
├── msg_001_planner_to_executor.md
|
|
123
|
+
├── msg_002_executor_to_reviewer.md
|
|
124
|
+
├── msg_003_reviewer_to_executor.md # Feedback
|
|
125
|
+
├── msg_004_executor_to_reviewer.md # Re-implementation
|
|
126
|
+
├── msg_005_reviewer_to_executor.md # APPROVED!
|
|
127
|
+
├── prompt_codex_iter1.md # Exact prompts sent
|
|
128
|
+
├── output_codex_iter1.md # Exact outputs received
|
|
129
|
+
├── output_claude_iter1.md
|
|
130
|
+
├── output_gemini_iter1.md
|
|
131
|
+
└── ...
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## CLI Reference
|
|
135
|
+
|
|
136
|
+
| Flag | Description | Default |
|
|
137
|
+
|------|-------------|---------|
|
|
138
|
+
| `--project` | Target project directory | required |
|
|
139
|
+
| `--task` | Task description | required |
|
|
140
|
+
| `--planner` | Agent for planning | codex |
|
|
141
|
+
| `--executor` | Agent for execution | claude |
|
|
142
|
+
| `--reviewer` | Agent for review | gemini |
|
|
143
|
+
| `--planner-model` | Model for planner | (default) |
|
|
144
|
+
| `--executor-model` | Model for executor | (default) |
|
|
145
|
+
| `--reviewer-model` | Model for reviewer | (default) |
|
|
146
|
+
| `--context` | Comma-separated context files | none |
|
|
147
|
+
| `--max-iterations` | Max execute→review cycles | 5 |
|
|
148
|
+
| `--verbose` | Show full agent output | false |
|
|
149
|
+
| `--dry-run` | Print commands only | false |
|
|
150
|
+
|
|
151
|
+
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 mskutlu
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|