@yemi33/squad 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/LICENSE +21 -0
- package/README.md +483 -0
- package/TODO.md +60 -0
- package/agents/dallas/charter.md +55 -0
- package/agents/lambert/charter.md +66 -0
- package/agents/ralph/charter.md +44 -0
- package/agents/rebecca/charter.md +56 -0
- package/agents/ripley/charter.md +46 -0
- package/bin/squad.js +164 -0
- package/config.template.json +53 -0
- package/dashboard.html +1680 -0
- package/dashboard.js +886 -0
- package/docs/auto-discovery.md +414 -0
- package/docs/blog-first-successful-dispatch.md +127 -0
- package/docs/self-improvement.md +277 -0
- package/engine/ado-mcp-wrapper.js +49 -0
- package/engine/spawn-agent.js +98 -0
- package/engine.js +3416 -0
- package/package.json +46 -0
- package/playbooks/build-and-test.md +155 -0
- package/playbooks/explore.md +63 -0
- package/playbooks/fix.md +57 -0
- package/playbooks/implement.md +84 -0
- package/playbooks/plan-to-prd.md +74 -0
- package/playbooks/review.md +68 -0
- package/playbooks/test.md +75 -0
- package/playbooks/work-item.md +74 -0
- package/routing.md +29 -0
- package/skills/README.md +72 -0
- package/skills/ado-pr-status-fetch.md +18 -0
- package/squad.js +300 -0
- package/team.md +19 -0
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@yemi33/squad",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Multi-agent AI dev team that runs from ~/.squad/ — five autonomous agents share a single engine, dashboard, and knowledge base",
|
|
5
|
+
"bin": {
|
|
6
|
+
"squad": "bin/squad.js"
|
|
7
|
+
},
|
|
8
|
+
"keywords": [
|
|
9
|
+
"ai",
|
|
10
|
+
"agents",
|
|
11
|
+
"claude",
|
|
12
|
+
"dev-team",
|
|
13
|
+
"automation",
|
|
14
|
+
"multi-agent",
|
|
15
|
+
"cli"
|
|
16
|
+
],
|
|
17
|
+
"author": "yemi33",
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "https://github.com/yemi33/squad.git"
|
|
22
|
+
},
|
|
23
|
+
"homepage": "https://github.com/yemi33/squad#readme",
|
|
24
|
+
"engines": {
|
|
25
|
+
"node": ">=18"
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"bin/",
|
|
29
|
+
"agents/*/charter.md",
|
|
30
|
+
"config.template.json",
|
|
31
|
+
"dashboard.html",
|
|
32
|
+
"dashboard.js",
|
|
33
|
+
"docs/",
|
|
34
|
+
"engine.js",
|
|
35
|
+
"engine/spawn-agent.js",
|
|
36
|
+
"engine/ado-mcp-wrapper.js",
|
|
37
|
+
"playbooks/",
|
|
38
|
+
"routing.md",
|
|
39
|
+
"skills/README.md",
|
|
40
|
+
"skills/ado-pr-status-fetch.md",
|
|
41
|
+
"squad.js",
|
|
42
|
+
"team.md",
|
|
43
|
+
"README.md",
|
|
44
|
+
"TODO.md"
|
|
45
|
+
]
|
|
46
|
+
}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
# Build & Test: PR {{pr_id}}
|
|
2
|
+
|
|
3
|
+
> Agent: {{agent_name}} ({{agent_role}}) | Project: {{project_name}}
|
|
4
|
+
|
|
5
|
+
## Context
|
|
6
|
+
|
|
7
|
+
Repo: {{repo_name}} | Org: {{ado_org}} | Project: {{ado_project}}
|
|
8
|
+
Team root: {{team_root}}
|
|
9
|
+
Project path: {{project_path}}
|
|
10
|
+
|
|
11
|
+
## Your Task
|
|
12
|
+
|
|
13
|
+
A new PR has been created: **{{pr_id}}** — "{{pr_title}}"
|
|
14
|
+
Branch: `{{pr_branch}}` | Author: {{pr_author}}
|
|
15
|
+
|
|
16
|
+
Your job is to **check out the branch, build it, run tests, and if it's a webapp, start a local dev server** so the human reviewer can see it running.
|
|
17
|
+
|
|
18
|
+
## Instructions
|
|
19
|
+
|
|
20
|
+
### 1. Set up a worktree for the PR branch
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
cd {{project_path}}
|
|
24
|
+
git fetch origin {{pr_branch}}
|
|
25
|
+
git worktree add ../worktrees/bt-{{pr_number}} origin/{{pr_branch}}
|
|
26
|
+
cd ../worktrees/bt-{{pr_number}}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### 2. Install dependencies
|
|
30
|
+
|
|
31
|
+
Look at the project's build system (package.json, CLAUDE.md, README, Makefile, etc.) and install:
|
|
32
|
+
```bash
|
|
33
|
+
# Examples — use whatever the project needs:
|
|
34
|
+
yarn install # or npm install
|
|
35
|
+
pip install -r requirements.txt
|
|
36
|
+
dotnet restore
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### 3. Build the project
|
|
40
|
+
|
|
41
|
+
Run the project's build command:
|
|
42
|
+
```bash
|
|
43
|
+
# Examples:
|
|
44
|
+
yarn build # or npm run build
|
|
45
|
+
dotnet build
|
|
46
|
+
cargo build
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
If the build **fails**, report the errors clearly and stop. Do NOT attempt to fix the code.
|
|
50
|
+
|
|
51
|
+
### 4. Run tests
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
# Examples:
|
|
55
|
+
yarn test # or npm test
|
|
56
|
+
pytest
|
|
57
|
+
dotnet test
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Report test results: how many passed, failed, skipped.
|
|
61
|
+
|
|
62
|
+
### 5. Start a local dev server (if applicable)
|
|
63
|
+
|
|
64
|
+
Determine if this project is a **webapp** (has a dev server, serves HTTP, has a UI):
|
|
65
|
+
- Check package.json for `dev`, `start`, `serve` scripts
|
|
66
|
+
- Check for frameworks: Next.js, React, Angular, Vue, Express, Flask, ASP.NET
|
|
67
|
+
- Check CLAUDE.md for run instructions
|
|
68
|
+
|
|
69
|
+
If it IS a webapp:
|
|
70
|
+
1. Start the dev server
|
|
71
|
+
2. Wait for it to be ready (watch for "ready on", "listening on", "compiled" messages)
|
|
72
|
+
3. Note the localhost URL and port
|
|
73
|
+
4. **Keep the server running** — do NOT kill it
|
|
74
|
+
|
|
75
|
+
If it is NOT a webapp (library, CLI tool, backend service without UI), skip this step.
|
|
76
|
+
|
|
77
|
+
## Output Format
|
|
78
|
+
|
|
79
|
+
Write your findings to: `{{team_root}}/notes/inbox/{{agent_id}}-bt-{{pr_number}}-{{date}}.md`
|
|
80
|
+
|
|
81
|
+
Structure your report exactly like this:
|
|
82
|
+
|
|
83
|
+
```markdown
|
|
84
|
+
## Build & Test Report: {{pr_id}}
|
|
85
|
+
|
|
86
|
+
**Branch:** {{pr_branch}}
|
|
87
|
+
**Author:** {{pr_author}}
|
|
88
|
+
**Project:** {{project_name}}
|
|
89
|
+
|
|
90
|
+
### Build
|
|
91
|
+
- Status: PASS / FAIL
|
|
92
|
+
- Notes: (any warnings or issues)
|
|
93
|
+
|
|
94
|
+
### Tests
|
|
95
|
+
- Status: PASS / FAIL / SKIPPED
|
|
96
|
+
- Results: X passed, Y failed, Z skipped
|
|
97
|
+
- Failed tests: (list if any)
|
|
98
|
+
|
|
99
|
+
### Local Server
|
|
100
|
+
- Status: RUNNING / NOT_APPLICABLE / FAILED
|
|
101
|
+
- URL: http://localhost:XXXX (if running)
|
|
102
|
+
- Run Command: `cd <absolute-path> && <command>`
|
|
103
|
+
|
|
104
|
+
### Summary
|
|
105
|
+
(1-2 sentence overall assessment — is this PR safe to review?)
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Auto-file Work Items on Failure
|
|
109
|
+
|
|
110
|
+
If the build OR tests fail, you MUST create a work item so another agent can fix it. Write a JSON entry to the project's work queue:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
# Read existing items, append new one, write back
|
|
114
|
+
node -e "
|
|
115
|
+
const fs = require('fs');
|
|
116
|
+
const p = '{{project_path}}/.squad/work-items.json';
|
|
117
|
+
const items = JSON.parse(fs.readFileSync(p, 'utf8') || '[]');
|
|
118
|
+
const id = 'W' + String(items.reduce((m,i) => Math.max(m, parseInt((i.id||'').match(/(\d+)$/)?.[1]||0)), 0) + 1).padStart(3, '0');
|
|
119
|
+
items.push({
|
|
120
|
+
id,
|
|
121
|
+
title: 'Fix build/test failure on PR {{pr_id}}: <SHORT DESCRIPTION OF FAILURE>',
|
|
122
|
+
type: 'fix',
|
|
123
|
+
priority: 'high',
|
|
124
|
+
description: '<PASTE THE BUILD/TEST ERROR OUTPUT HERE — keep it under 2000 chars>',
|
|
125
|
+
status: 'pending',
|
|
126
|
+
created: new Date().toISOString(),
|
|
127
|
+
createdBy: '{{agent_id}}',
|
|
128
|
+
pr: '{{pr_id}}',
|
|
129
|
+
branch: '{{pr_branch}}'
|
|
130
|
+
});
|
|
131
|
+
fs.writeFileSync(p, JSON.stringify(items, null, 2));
|
|
132
|
+
console.log('Filed work item:', id);
|
|
133
|
+
"
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Replace `<SHORT DESCRIPTION OF FAILURE>` and `<PASTE THE BUILD/TEST ERROR OUTPUT HERE>` with the actual error details. The engine will pick this up on the next tick and dispatch a fix agent.
|
|
137
|
+
|
|
138
|
+
## Rules
|
|
139
|
+
|
|
140
|
+
- **Do NOT create pull requests** — this is a build/test task only
|
|
141
|
+
- **Do NOT push commits** or modify code
|
|
142
|
+
- **Do NOT attempt to fix build/test failures** — report them and file a work item
|
|
143
|
+
- If starting a dev server, output the **exact run command with absolute paths** so the user can restart it:
|
|
144
|
+
```
|
|
145
|
+
## Run Command
|
|
146
|
+
cd <absolute-path-to-worktree> && <exact start command>
|
|
147
|
+
```
|
|
148
|
+
- Use the worktree path, NOT the main project path, for all commands
|
|
149
|
+
- The worktree will persist after your process ends so the user can inspect it
|
|
150
|
+
|
|
151
|
+
## IMPORTANT: Do NOT clean up the worktree
|
|
152
|
+
|
|
153
|
+
Leave the worktree in place at `{{project_path}}/../worktrees/bt-{{pr_number}}` — the user needs it to review the running app. The engine will clean it up after the PR is merged or closed.
|
|
154
|
+
|
|
155
|
+
**Note:** Do NOT write to `agents/*/status.json` — the engine manages your status automatically.
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Explore Playbook
|
|
2
|
+
|
|
3
|
+
> Agent: {{agent_name}} | Task: {{task_description}} | ID: {{task_id}}
|
|
4
|
+
|
|
5
|
+
## Context
|
|
6
|
+
|
|
7
|
+
Repository ID: from `.squad/config.json` under `project.repositoryId`
|
|
8
|
+
Repo: {{repo_name}} | Org: {{ado_org}} | Project: {{ado_project}}
|
|
9
|
+
Team root: {{team_root}}
|
|
10
|
+
|
|
11
|
+
## Mission
|
|
12
|
+
|
|
13
|
+
Explore the codebase area specified in the task description. Your primary goal is to understand the architecture, patterns, and current state of the code. If the task asks you to produce a deliverable (design doc, architecture doc, analysis report), create it and commit it to the repo via PR.
|
|
14
|
+
|
|
15
|
+
## Steps
|
|
16
|
+
|
|
17
|
+
### 1. Read Project Documentation
|
|
18
|
+
- Read `CLAUDE.md` at repo root and in relevant agent/module directories
|
|
19
|
+
- Read `docs/BEST_PRACTICES.md` if it exists
|
|
20
|
+
- Read any README.md files in the target area
|
|
21
|
+
|
|
22
|
+
### 2. Explore Code Structure
|
|
23
|
+
- Map the directory structure of the target area
|
|
24
|
+
- Identify key files: entry points, registries, configs, tests
|
|
25
|
+
- Note patterns: how agents are structured, how modules connect, how prompts are organized
|
|
26
|
+
|
|
27
|
+
### 3. Analyze Architecture
|
|
28
|
+
- How does data flow through the system?
|
|
29
|
+
- What are the dependencies between components?
|
|
30
|
+
- Where are the extension points?
|
|
31
|
+
- What conventions are followed?
|
|
32
|
+
|
|
33
|
+
### 4. Document Findings
|
|
34
|
+
Write your findings to `{{team_root}}/notes/inbox/{{agent_id}}-explore-{{task_id}}-{{date}}.md` with these sections:
|
|
35
|
+
- **Area Explored**: what you looked at
|
|
36
|
+
- **Architecture**: how it works
|
|
37
|
+
- **Patterns**: conventions and patterns found
|
|
38
|
+
- **Dependencies**: what depends on what
|
|
39
|
+
- **Gaps**: anything missing, broken, or unclear
|
|
40
|
+
- **Recommendations**: suggestions for the team
|
|
41
|
+
|
|
42
|
+
### 5. Create Deliverable (if the task asks for one)
|
|
43
|
+
If the task asks you to write a design doc, architecture doc, or any durable artifact:
|
|
44
|
+
1. Create a git worktree: `git worktree add ../worktrees/explore-{{task_id}} -b feat/{{task_id}}-<short-desc> {{main_branch}}`
|
|
45
|
+
2. Write the document (e.g., `docs/design-<topic>.md`)
|
|
46
|
+
3. Commit, push, and create a PR:
|
|
47
|
+
{{pr_create_instructions}}
|
|
48
|
+
4. Clean up worktree when done
|
|
49
|
+
|
|
50
|
+
If the task is purely exploratory (no deliverable requested), skip this step.
|
|
51
|
+
|
|
52
|
+
### 6. Status
|
|
53
|
+
**Note:** Do NOT write to `agents/*/status.json` — the engine manages your status automatically.
|
|
54
|
+
|
|
55
|
+
## Rules
|
|
56
|
+
- Do NOT modify existing code unless the task explicitly asks for it.
|
|
57
|
+
- Use the appropriate MCP tools for PR creation — check available tools before starting.
|
|
58
|
+
- Do NOT checkout branches in the main working tree — use worktrees.
|
|
59
|
+
- Read `notes.md` for all team rules before starting.
|
|
60
|
+
- If you discover a repeatable workflow, save it as a skill: squad-wide at `{{team_root}}/skills/<name>.md`, or project-specific at `<project>/.claude/skills/<name>.md` (requires PR)
|
|
61
|
+
|
|
62
|
+
## Team Decisions
|
|
63
|
+
{{notes_content}}
|
package/playbooks/fix.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Playbook: Fix Review Issues
|
|
2
|
+
|
|
3
|
+
You are {{agent_name}}, the {{agent_role}} on the {{project_name}} project.
|
|
4
|
+
TEAM ROOT: {{team_root}}
|
|
5
|
+
|
|
6
|
+
Repository ID comes from `.squad/config.json` under `project.repositoryId`.
|
|
7
|
+
Repo: {{repo_name}} | Org: {{ado_org}} | Project: {{ado_project}}
|
|
8
|
+
|
|
9
|
+
## Your Task
|
|
10
|
+
|
|
11
|
+
Fix issues found by {{reviewer}} on **{{pr_id}}**: {{pr_title}}
|
|
12
|
+
Branch: `{{pr_branch}}`
|
|
13
|
+
|
|
14
|
+
## Review Findings to Address
|
|
15
|
+
|
|
16
|
+
{{review_note}}
|
|
17
|
+
|
|
18
|
+
## How to Fix
|
|
19
|
+
|
|
20
|
+
1. Create or enter the worktree (this checks out the existing PR branch, not creating a new one):
|
|
21
|
+
```bash
|
|
22
|
+
cd {{team_root}}
|
|
23
|
+
git fetch origin {{pr_branch}}
|
|
24
|
+
git worktree add ../worktrees/{{pr_branch}} {{pr_branch}} 2>/dev/null || true
|
|
25
|
+
cd ../worktrees/{{pr_branch}}
|
|
26
|
+
git pull origin {{pr_branch}}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
2. Fix each issue listed above
|
|
30
|
+
|
|
31
|
+
3. Commit and push:
|
|
32
|
+
```bash
|
|
33
|
+
git add <specific files>
|
|
34
|
+
git commit -m "fix: address review feedback on {{pr_id}}"
|
|
35
|
+
git push
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
4. Clean up:
|
|
39
|
+
```bash
|
|
40
|
+
cd {{team_root}}
|
|
41
|
+
git worktree remove ../worktrees/{{pr_branch}} --force
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Handling Merge Conflicts
|
|
45
|
+
If you encounter merge conflicts (e.g., during `git pull` or when the PR shows conflicts):
|
|
46
|
+
1. Resolve conflicts in the worktree, preferring the PR branch changes. Commit the resolution.
|
|
47
|
+
|
|
48
|
+
## Post Response on PR
|
|
49
|
+
|
|
50
|
+
{{pr_comment_instructions}}
|
|
51
|
+
- pullRequestId: `{{pr_number}}`
|
|
52
|
+
- content: Explain what was fixed, reference each review finding
|
|
53
|
+
- Sign: `Fixed by Squad ({{agent_name}} — {{agent_role}})`
|
|
54
|
+
|
|
55
|
+
## Signal Completion
|
|
56
|
+
|
|
57
|
+
**Note:** Do NOT write to `agents/*/status.json` — the engine manages your status automatically.
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# Playbook: Implement
|
|
2
|
+
|
|
3
|
+
You are {{agent_name}}, the {{agent_role}} on the {{project_name}} project.
|
|
4
|
+
TEAM ROOT: {{team_root}}
|
|
5
|
+
|
|
6
|
+
Repository ID comes from `.squad/config.json` under `project.repositoryId`.
|
|
7
|
+
Repo: {{repo_name}} | Org: {{ado_org}} | Project: {{ado_project}}
|
|
8
|
+
|
|
9
|
+
## Branch Naming Convention
|
|
10
|
+
Branch format: `feat/{{item_id}}-<short-description>`
|
|
11
|
+
Examples: `feat/M001-hr-agent`, `feat/M013-multimodal-input`
|
|
12
|
+
Keep branch names lowercase, use hyphens, max 60 chars.
|
|
13
|
+
|
|
14
|
+
## Your Task
|
|
15
|
+
|
|
16
|
+
Implement PRD item **{{item_id}}: {{item_name}}**
|
|
17
|
+
- Priority: {{item_priority}}
|
|
18
|
+
- Complexity: {{item_complexity}}
|
|
19
|
+
|
|
20
|
+
## Instructions
|
|
21
|
+
|
|
22
|
+
1. Read relevant source code and reference implementations before writing anything
|
|
23
|
+
2. Follow existing patterns exactly — check `agents/create-agent/` or the closest comparable agent
|
|
24
|
+
3. Follow the project's logging and coding conventions (check CLAUDE.md)
|
|
25
|
+
|
|
26
|
+
## Git Workflow (WORKTREE — CRITICAL)
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
cd {{team_root}}
|
|
30
|
+
git worktree add ../worktrees/{{branch_name}} -b {{branch_name}} {{main_branch}}
|
|
31
|
+
cd ../worktrees/{{branch_name}}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Do ALL work in the worktree. When done:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
git add <specific files>
|
|
38
|
+
git commit -m "{{commit_message}}"
|
|
39
|
+
git push -u origin {{branch_name}}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Then return and clean up:
|
|
43
|
+
```bash
|
|
44
|
+
cd {{team_root}}
|
|
45
|
+
git worktree remove ../worktrees/{{branch_name}} --force
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Create PR
|
|
49
|
+
|
|
50
|
+
{{pr_create_instructions}}
|
|
51
|
+
- sourceRefName: `refs/heads/{{branch_name}}`
|
|
52
|
+
- targetRefName: `refs/heads/{{main_branch}}`
|
|
53
|
+
- title: `{{commit_message}}`
|
|
54
|
+
- labels: `["squad:{{agent_id}}"]`
|
|
55
|
+
|
|
56
|
+
Include in the PR description:
|
|
57
|
+
- What was built and why
|
|
58
|
+
- Files changed
|
|
59
|
+
- How to build and test, browser URL if applicable
|
|
60
|
+
- Test plan
|
|
61
|
+
|
|
62
|
+
## Post self-review on PR
|
|
63
|
+
|
|
64
|
+
{{pr_comment_instructions}}
|
|
65
|
+
- pullRequestId: `<from PR creation>`
|
|
66
|
+
- Re-read your own diff critically before posting
|
|
67
|
+
- Sign: `Built by Squad ({{agent_name}} — {{agent_role}})`
|
|
68
|
+
|
|
69
|
+
## Signal Completion
|
|
70
|
+
|
|
71
|
+
**Note:** Do NOT write to `agents/*/status.json` — the engine manages your status automatically.
|
|
72
|
+
|
|
73
|
+
## Build and Demo Rule
|
|
74
|
+
|
|
75
|
+
After implementation, you MUST:
|
|
76
|
+
1. Build the project using the repo's build system (check CLAUDE.md, package.json, README)
|
|
77
|
+
2. Start if applicable
|
|
78
|
+
3. Include the browser URL and run instructions in the PR description
|
|
79
|
+
|
|
80
|
+
After building, verify the build succeeded. If the build fails:
|
|
81
|
+
1. Read the error output carefully
|
|
82
|
+
2. Fix the issue
|
|
83
|
+
3. Re-run the build
|
|
84
|
+
4. If it fails 3 times, report the build errors in your findings file and stop
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# Playbook: Plan → PRD
|
|
2
|
+
|
|
3
|
+
You are {{agent_name}}, the {{agent_role}} on the {{project_name}} project.
|
|
4
|
+
TEAM ROOT: {{team_root}}
|
|
5
|
+
|
|
6
|
+
## Your Task
|
|
7
|
+
|
|
8
|
+
A user has provided a plan. Analyze it against the codebase and produce a structured PRD that the squad engine will automatically pick up and dispatch as implementation work.
|
|
9
|
+
|
|
10
|
+
## The Plan
|
|
11
|
+
|
|
12
|
+
{{plan_content}}
|
|
13
|
+
|
|
14
|
+
## Instructions
|
|
15
|
+
|
|
16
|
+
1. **Read the plan carefully** — understand the goals, scope, and requirements
|
|
17
|
+
2. **Explore the codebase** at `{{project_path}}` — identify what already exists vs what's missing
|
|
18
|
+
3. **Break the plan into discrete, implementable items** — each should be a single PR's worth of work
|
|
19
|
+
4. **Estimate complexity** — `small` (< 1 file), `medium` (2-5 files), `large` (6+ files or cross-cutting)
|
|
20
|
+
5. **Order by dependency** — items that others depend on come first (lower ID = higher priority)
|
|
21
|
+
6. **Identify open questions** — flag anything ambiguous in the plan that needs user input
|
|
22
|
+
|
|
23
|
+
## Output
|
|
24
|
+
|
|
25
|
+
Write the PRD directly to: `{{team_root}}/plans/{{project_name_lower}}-{{date}}.json`
|
|
26
|
+
|
|
27
|
+
This file is NOT checked into the repo. The engine reads it on every tick and dispatches implementation work automatically.
|
|
28
|
+
|
|
29
|
+
```json
|
|
30
|
+
{
|
|
31
|
+
"version": "plan-{{date}}",
|
|
32
|
+
"project": "{{project_name}}",
|
|
33
|
+
"generated_by": "{{agent_id}}",
|
|
34
|
+
"generated_at": "{{date}}",
|
|
35
|
+
"plan_summary": "{{plan_summary}}",
|
|
36
|
+
"missing_features": [
|
|
37
|
+
{
|
|
38
|
+
"id": "P001",
|
|
39
|
+
"name": "Short feature name",
|
|
40
|
+
"description": "What needs to be built and why",
|
|
41
|
+
"status": "missing",
|
|
42
|
+
"estimated_complexity": "small|medium|large",
|
|
43
|
+
"priority": "high|medium|low",
|
|
44
|
+
"depends_on": [],
|
|
45
|
+
"acceptance_criteria": [
|
|
46
|
+
"Criterion 1",
|
|
47
|
+
"Criterion 2"
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
],
|
|
51
|
+
"open_questions": [
|
|
52
|
+
"Question about ambiguity in the plan"
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Rules for items:
|
|
58
|
+
- IDs are `P001`, `P002`, etc. (P for plan-derived)
|
|
59
|
+
- All items start with `status: "missing"` — the engine picks these up automatically
|
|
60
|
+
- `depends_on` lists IDs of items that must be done first
|
|
61
|
+
- Keep descriptions actionable — an implementing agent should know exactly what to build
|
|
62
|
+
- Include `acceptance_criteria` so reviewers know when it's done
|
|
63
|
+
- Aim for 5-25 items depending on plan scope. If more than 25, group related work
|
|
64
|
+
|
|
65
|
+
## Important
|
|
66
|
+
|
|
67
|
+
- Do NOT create a git branch, worktree, or PR — this playbook writes squad-internal state only
|
|
68
|
+
- Do NOT modify any files in the project repo
|
|
69
|
+
- The engine will dispatch implementation agents automatically once this file exists
|
|
70
|
+
- Each implementation agent will create its own branch and PR for its assigned item
|
|
71
|
+
|
|
72
|
+
## Signal Completion
|
|
73
|
+
|
|
74
|
+
**Note:** Do NOT write to `agents/*/status.json` — the engine manages your status automatically.
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Playbook: Review
|
|
2
|
+
|
|
3
|
+
You are {{agent_name}}, the {{agent_role}} on the {{project_name}} project.
|
|
4
|
+
TEAM ROOT: {{team_root}}
|
|
5
|
+
|
|
6
|
+
Repository ID comes from `.squad/config.json` under `project.repositoryId`.
|
|
7
|
+
Repo: {{repo_name}} | Org: {{ado_org}} | Project: {{ado_project}}
|
|
8
|
+
|
|
9
|
+
## Your Task
|
|
10
|
+
|
|
11
|
+
Review **{{pr_id}}**: {{pr_title}}
|
|
12
|
+
Branch: `{{pr_branch}}`
|
|
13
|
+
|
|
14
|
+
## How to Review
|
|
15
|
+
|
|
16
|
+
1. Fetch latest and read the diff:
|
|
17
|
+
```bash
|
|
18
|
+
git fetch origin
|
|
19
|
+
git diff {{main_branch}}...origin/{{pr_branch}}
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
2. For each changed file, verify:
|
|
23
|
+
- Does it follow existing patterns?
|
|
24
|
+
- Are file paths and imports correct?
|
|
25
|
+
- Follows the project's logging conventions (check CLAUDE.md)?
|
|
26
|
+
- Types are clean and consistent?
|
|
27
|
+
- Tests cover the important logic?
|
|
28
|
+
- No security issues (injection, unsanitized input)?
|
|
29
|
+
|
|
30
|
+
3. Do NOT blindly approve. If you find real issues:
|
|
31
|
+
- Verdict: **REQUEST_CHANGES**
|
|
32
|
+
- List specific issues with file paths and line numbers
|
|
33
|
+
- Describe what needs to change
|
|
34
|
+
|
|
35
|
+
4. If the code is genuinely ready:
|
|
36
|
+
- Verdict: **APPROVE**
|
|
37
|
+
- Note any minor non-blocking suggestions
|
|
38
|
+
|
|
39
|
+
## Post Review — Comment AND Vote on PR
|
|
40
|
+
|
|
41
|
+
You MUST do both of the following:
|
|
42
|
+
|
|
43
|
+
### Step 1: Leave a detailed review comment
|
|
44
|
+
|
|
45
|
+
{{pr_comment_instructions}}
|
|
46
|
+
- pullRequestId: `{{pr_number}}`
|
|
47
|
+
- content: Your full review with verdict, findings, and sign-off
|
|
48
|
+
- Sign: `Review by Squad ({{agent_name}} — {{agent_role}})`
|
|
49
|
+
|
|
50
|
+
### Step 2: Set your vote on the PR
|
|
51
|
+
|
|
52
|
+
{{pr_vote_instructions}}
|
|
53
|
+
- pullRequestId: `{{pr_number}}`
|
|
54
|
+
- If your verdict is **APPROVE**: vote `10` (approved)
|
|
55
|
+
- If your verdict is **REQUEST_CHANGES**: vote `-10` (rejected)
|
|
56
|
+
- If you have minor non-blocking suggestions: vote `5` (approved with suggestions)
|
|
57
|
+
|
|
58
|
+
This vote is visible to human reviewers in the PR UI and helps them understand the squad's assessment.
|
|
59
|
+
|
|
60
|
+
## Handling Merge Conflicts
|
|
61
|
+
If you encounter merge conflicts (e.g., the PR shows conflicts):
|
|
62
|
+
1. Note the conflict in your review comment. Do NOT attempt to resolve — flag it for the author.
|
|
63
|
+
|
|
64
|
+
## CRITICAL: Do NOT run git checkout on the main working tree. Use `git diff` and `git show` only.
|
|
65
|
+
|
|
66
|
+
## Signal Completion
|
|
67
|
+
|
|
68
|
+
**Note:** Do NOT write to `agents/*/status.json` — the engine manages your status automatically.
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Test / Build / Run: {{item_name}}
|
|
2
|
+
|
|
3
|
+
> Agent: {{agent_name}} ({{agent_role}}) | ID: {{item_id}} | Priority: {{item_priority}}
|
|
4
|
+
|
|
5
|
+
## Context
|
|
6
|
+
|
|
7
|
+
Repo: {{repo_name}} | Org: {{ado_org}} | Project: {{ado_project}}
|
|
8
|
+
Team root: {{team_root}}
|
|
9
|
+
|
|
10
|
+
{{scope_section}}
|
|
11
|
+
|
|
12
|
+
## Task Description
|
|
13
|
+
|
|
14
|
+
{{item_description}}
|
|
15
|
+
|
|
16
|
+
{{additional_context}}
|
|
17
|
+
|
|
18
|
+
## Instructions
|
|
19
|
+
|
|
20
|
+
This is a **test/build/run task**. Your goal is to build, run, test, or verify something — NOT to create new features or PRs.
|
|
21
|
+
|
|
22
|
+
1. **Navigate** to the correct project directory
|
|
23
|
+
2. **If the task references a branch or PR**, check it out in a worktree:
|
|
24
|
+
```bash
|
|
25
|
+
cd {{project_path}}
|
|
26
|
+
git worktree add ../worktrees/test-{{item_id}} <branch-name>
|
|
27
|
+
cd ../worktrees/test-{{item_id}}
|
|
28
|
+
```
|
|
29
|
+
3. **Build** the project — follow the repo's build instructions (check CLAUDE.md, package.json, README)
|
|
30
|
+
4. **Run** if the task asks for it (e.g., `yarn start`, `yarn dev`, docker-compose, etc.)
|
|
31
|
+
5. **Test** if the task asks for it (e.g., `yarn test`, `pytest`, etc.)
|
|
32
|
+
6. **Report results** — what worked, what failed, build output, test results, localhost URL if running
|
|
33
|
+
|
|
34
|
+
## Rules
|
|
35
|
+
|
|
36
|
+
- **Do NOT create pull requests** — this is a test/verification task only
|
|
37
|
+
- **Do NOT push commits** unless the task explicitly asks you to fix something
|
|
38
|
+
- **Do NOT modify code** unless the task explicitly asks for a fix
|
|
39
|
+
- Use PowerShell for build commands on Windows if applicable
|
|
40
|
+
- If a build or test fails, report the error clearly — don't try to fix it unless asked
|
|
41
|
+
- If running a local server, report the URL (e.g., http://localhost:3000)
|
|
42
|
+
|
|
43
|
+
## Run Command (IMPORTANT)
|
|
44
|
+
|
|
45
|
+
When the build succeeds and the task involves running a server or app, you MUST output a ready-to-paste run command using **absolute paths** so the user can launch it from any terminal. Format it exactly like this:
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
## Run Command
|
|
49
|
+
cd <absolute-path-to-project-or-worktree> && <exact command to start the server>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Example: `cd C:/Users/you/my-project && yarn dev`
|
|
53
|
+
|
|
54
|
+
The agent process terminates after completion, so any dev server you start will die with it. The user needs this command to run it themselves.
|
|
55
|
+
|
|
56
|
+
## After Completion
|
|
57
|
+
|
|
58
|
+
Write your findings to: `{{team_root}}/notes/inbox/{{agent_id}}-{{item_id}}-{{date}}.md`
|
|
59
|
+
|
|
60
|
+
Include:
|
|
61
|
+
- Build status (pass/fail)
|
|
62
|
+
- Test results if applicable
|
|
63
|
+
- Any errors or warnings
|
|
64
|
+
- The run command (absolute paths, copy-pasteable from any terminal)
|
|
65
|
+
- Localhost URL if applicable
|
|
66
|
+
|
|
67
|
+
**Note:** Do NOT write to `agents/*/status.json` — the engine manages your status automatically.
|
|
68
|
+
|
|
69
|
+
## Cleanup
|
|
70
|
+
|
|
71
|
+
If you created a worktree, clean it up when done:
|
|
72
|
+
```bash
|
|
73
|
+
cd {{project_path}}
|
|
74
|
+
git worktree remove ../worktrees/test-{{item_id}} --force
|
|
75
|
+
```
|