pi-superteam 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/CHANGELOG.md +37 -0
- package/CONTRIBUTING.md +83 -0
- package/LICENSE +21 -0
- package/README.md +360 -0
- package/agents/architect.md +45 -0
- package/agents/implementer.md +40 -0
- package/agents/performance-reviewer.md +51 -0
- package/agents/quality-reviewer.md +53 -0
- package/agents/scout.md +24 -0
- package/agents/security-reviewer.md +52 -0
- package/agents/spec-reviewer.md +46 -0
- package/docs/guides/agents.md +200 -0
- package/docs/guides/configuration.md +164 -0
- package/docs/guides/rules.md +91 -0
- package/docs/guides/sdd-workflow.md +173 -0
- package/docs/guides/tdd-guard.md +144 -0
- package/package.json +53 -0
- package/prompts/implement.md +9 -0
- package/prompts/review-parallel.md +11 -0
- package/prompts/scout.md +8 -0
- package/prompts/sdd.md +9 -0
- package/rules/no-impl-before-spec.md +17 -0
- package/rules/test-first.md +11 -0
- package/rules/yagni.md +11 -0
- package/skills/acceptance-test-driven-development/SKILL.md +60 -0
- package/skills/brainstorming/SKILL.md +49 -0
- package/skills/subagent-driven-development/SKILL.md +86 -0
- package/skills/test-driven-development/SKILL.md +97 -0
- package/skills/writing-plans/SKILL.md +65 -0
- package/src/config.ts +181 -0
- package/src/dispatch.ts +567 -0
- package/src/index.ts +721 -0
- package/src/review-parser.ts +212 -0
- package/src/rules/engine.ts +215 -0
- package/src/workflow/sdd.ts +379 -0
- package/src/workflow/state.ts +422 -0
- package/src/workflow/tdd-guard.ts +516 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.0 (2026-02-06)
|
|
4
|
+
|
|
5
|
+
Initial release.
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
- **Multi-Agent Dispatch** — `team` tool with single, parallel, and chain modes
|
|
10
|
+
- 7 built-in agents: scout, implementer, spec-reviewer, quality-reviewer, security-reviewer, performance-reviewer, architect
|
|
11
|
+
- Custom agent support via markdown profiles
|
|
12
|
+
- Deterministic subprocess isolation
|
|
13
|
+
|
|
14
|
+
- **TDD/ATDD Guard** — mechanical enforcement of test-driven development
|
|
15
|
+
- Blocks impl writes without test file + test run
|
|
16
|
+
- Bash heuristic catches shell file mutations
|
|
17
|
+
- ATDD mode with acceptance test awareness
|
|
18
|
+
- Configurable file mapping strategies
|
|
19
|
+
|
|
20
|
+
- **SDD Orchestration** — automated implement → review → fix loops
|
|
21
|
+
- Plan parsing from `superteam-tasks` fenced blocks or headings
|
|
22
|
+
- Structured reviewer output parsing (`ReviewFindings` JSON)
|
|
23
|
+
- Fix loops with specific findings passed to implementer
|
|
24
|
+
- Escalation to human on failure
|
|
25
|
+
|
|
26
|
+
- **Context-Aware Rules** — TTSR-like rule injection
|
|
27
|
+
- 3 built-in rules: test-first, YAGNI, no-impl-before-spec
|
|
28
|
+
- Custom rules with regex triggers and frequency control
|
|
29
|
+
|
|
30
|
+
- **Cost Tracking** — session-level budget management
|
|
31
|
+
- Warning threshold and hard limit
|
|
32
|
+
- Mid-stream abort on hard limit
|
|
33
|
+
- Per-dispatch and cumulative tracking
|
|
34
|
+
|
|
35
|
+
- **5 Skills** — TDD, ATDD, SDD, writing-plans, brainstorming
|
|
36
|
+
- **4 Prompt Templates** — /sdd, /review-parallel, /scout, /implement
|
|
37
|
+
- **Branch-aware persistence** — workflow state tracked per session branch
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Contributing to pi-superteam
|
|
2
|
+
|
|
3
|
+
Thanks for your interest in contributing! Here's how to get started.
|
|
4
|
+
|
|
5
|
+
## Development Setup
|
|
6
|
+
|
|
7
|
+
1. Clone the repo:
|
|
8
|
+
```bash
|
|
9
|
+
git clone https://github.com/coctostan/pi-superteam.git
|
|
10
|
+
cd pi-superteam
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
2. Run with pi in development mode:
|
|
14
|
+
```bash
|
|
15
|
+
pi -e ./src/index.ts
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
No build step needed — pi loads TypeScript directly.
|
|
19
|
+
|
|
20
|
+
3. Test your changes:
|
|
21
|
+
```bash
|
|
22
|
+
# Quick smoke test
|
|
23
|
+
pi -e ./src/index.ts -p --mode text "Use the team tool to dispatch scout to count files in src/"
|
|
24
|
+
|
|
25
|
+
# Test TDD guard
|
|
26
|
+
cd /tmp && mkdir test-project && cd test-project
|
|
27
|
+
echo '{"tddMode":"tdd"}' > .superteam.json
|
|
28
|
+
pi -e /path/to/superteam/src/index.ts
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Project Structure
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
src/
|
|
35
|
+
index.ts ← Extension entry point (thin — delegates everything)
|
|
36
|
+
config.ts ← Config discovery and defaults
|
|
37
|
+
dispatch.ts ← Agent subprocess management
|
|
38
|
+
review-parser.ts ← Structured JSON extraction
|
|
39
|
+
rules/engine.ts ← Context-aware rule injection
|
|
40
|
+
workflow/state.ts ← Plan tracking and persistence
|
|
41
|
+
workflow/tdd-guard.ts ← TDD enforcement
|
|
42
|
+
workflow/sdd.ts ← SDD orchestration loop
|
|
43
|
+
|
|
44
|
+
agents/ ← Agent profiles (markdown)
|
|
45
|
+
skills/ ← Methodology skills (markdown)
|
|
46
|
+
rules/ ← Context rules (markdown)
|
|
47
|
+
prompts/ ← Prompt templates (markdown)
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Design Principles
|
|
51
|
+
|
|
52
|
+
1. **`src/index.ts` is a thin composition root** — no business logic, only wiring
|
|
53
|
+
2. **Graceful degradation** — missing models, unavailable tools, flaky SDD all degrade gracefully
|
|
54
|
+
3. **JSON-serializable state** — no Maps, Sets, or classes in persisted state
|
|
55
|
+
4. **Deterministic subprocesses** — agents run in full isolation with explicit add-backs
|
|
56
|
+
5. **Every piece is independently useful** — TDD guard, team tool, rules engine, SDD all work alone
|
|
57
|
+
|
|
58
|
+
## Adding an Agent
|
|
59
|
+
|
|
60
|
+
1. Create `agents/your-agent.md` with frontmatter
|
|
61
|
+
2. Test: `pi -e ./src/index.ts -p "Use team to dispatch your-agent to do something"`
|
|
62
|
+
3. If it's a reviewer, include the `ReviewFindings` JSON contract in the system prompt
|
|
63
|
+
|
|
64
|
+
## Adding a Rule
|
|
65
|
+
|
|
66
|
+
1. Create `rules/your-rule.md` with trigger regex
|
|
67
|
+
2. Test: start pi with the extension, trigger the pattern, verify rule fires
|
|
68
|
+
|
|
69
|
+
## Adding a Skill
|
|
70
|
+
|
|
71
|
+
1. Create `skills/your-skill/SKILL.md`
|
|
72
|
+
2. Follow pi's [skill format](https://github.com/badlogic/pi-mono/blob/main/packages/coding-agent/docs/skills.md)
|
|
73
|
+
|
|
74
|
+
## Pull Requests
|
|
75
|
+
|
|
76
|
+
- Keep changes focused — one feature or fix per PR
|
|
77
|
+
- Test manually via pi (automated tests coming)
|
|
78
|
+
- Update relevant docs if behavior changes
|
|
79
|
+
- Follow existing code style
|
|
80
|
+
|
|
81
|
+
## License
|
|
82
|
+
|
|
83
|
+
By contributing, you agree that your contributions will be licensed under the MIT License.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 coctostan
|
|
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.
|
package/README.md
ADDED
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<h1 align="center">🦸 pi-superteam</h1>
|
|
3
|
+
<p align="center">
|
|
4
|
+
Multi-agent orchestration · TDD enforcement · Iterative review cycles · Context-aware rules
|
|
5
|
+
<br/>
|
|
6
|
+
<em>A <a href="https://github.com/badlogic/pi">pi</a> extension package that makes your AI write better code.</em>
|
|
7
|
+
</p>
|
|
8
|
+
</p>
|
|
9
|
+
|
|
10
|
+
<p align="center">
|
|
11
|
+
<a href="#installation">Install</a> ·
|
|
12
|
+
<a href="#quick-start">Quick Start</a> ·
|
|
13
|
+
<a href="#features">Features</a> ·
|
|
14
|
+
<a href="#agents">Agents</a> ·
|
|
15
|
+
<a href="#configuration">Config</a> ·
|
|
16
|
+
<a href="docs/guides/">Docs</a>
|
|
17
|
+
</p>
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## What is this?
|
|
22
|
+
|
|
23
|
+
**pi-superteam** turns your pi agent into a development team. Instead of one AI doing everything, you get specialized agents — a scout that explores code, an implementer that writes tests first, reviewers that catch bugs — all coordinated automatically.
|
|
24
|
+
|
|
25
|
+
It also makes your AI follow TDD whether it wants to or not. Try to write code without a test? **Blocked.** Try to rationalize skipping tests? A rule fires and says "no." The three-layer defense (mechanical guard + context rules + methodology skills) makes test-first the path of least resistance.
|
|
26
|
+
|
|
27
|
+
## Installation
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
pi install npm:pi-superteam
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
**Try without installing:**
|
|
34
|
+
```bash
|
|
35
|
+
pi -e npm:pi-superteam
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
**Development mode:**
|
|
39
|
+
```bash
|
|
40
|
+
git clone https://github.com/coctostan/pi-superteam.git
|
|
41
|
+
pi -e ./pi-superteam/src/index.ts
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Quick Start
|
|
45
|
+
|
|
46
|
+
### Dispatch agents directly
|
|
47
|
+
|
|
48
|
+
Ask pi to use the `team` tool. It'll show up automatically:
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
> Have the scout agent find all authentication-related code in this project
|
|
52
|
+
|
|
53
|
+
> Use team in parallel mode — send security-reviewer and quality-reviewer
|
|
54
|
+
to analyze src/auth/
|
|
55
|
+
|
|
56
|
+
> Chain: scout maps the database layer, then architect reviews the structure
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Enable TDD enforcement
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
/tdd tdd
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Now try writing code without a test:
|
|
66
|
+
```
|
|
67
|
+
> Write src/utils.ts with a helper function
|
|
68
|
+
|
|
69
|
+
🚫 TDD: Create a test file first. Expected: src/utils.test.ts
|
|
70
|
+
Write a failing test, run it, then implement.
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
The AI learns fast. After one block, it writes tests first on its own.
|
|
74
|
+
|
|
75
|
+
### Run an automated SDD workflow
|
|
76
|
+
|
|
77
|
+
Create a plan:
|
|
78
|
+
```markdown
|
|
79
|
+
# Feature: Rate Limiting
|
|
80
|
+
|
|
81
|
+
\`\`\`superteam-tasks
|
|
82
|
+
- title: Token bucket implementation
|
|
83
|
+
description: Implement token bucket rate limiter with configurable rate and burst
|
|
84
|
+
files: [src/rate-limiter.ts]
|
|
85
|
+
- title: Middleware integration
|
|
86
|
+
description: Express middleware that applies rate limiting per IP
|
|
87
|
+
files: [src/middleware/rate-limit.ts]
|
|
88
|
+
\`\`\`
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Then:
|
|
92
|
+
```
|
|
93
|
+
/sdd load plan.md
|
|
94
|
+
/sdd run
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Superteam dispatches the implementer (with TDD enforcement), runs spec + quality reviews, fixes issues automatically, and advances to the next task.
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## Features
|
|
102
|
+
|
|
103
|
+
### 🤖 Multi-Agent Dispatch
|
|
104
|
+
|
|
105
|
+
The `team` tool dispatches specialized agents in isolated subprocesses. Each gets its own context window, model, and tools — no cross-contamination.
|
|
106
|
+
|
|
107
|
+
**Three dispatch modes:**
|
|
108
|
+
|
|
109
|
+
| Mode | Usage | Description |
|
|
110
|
+
|------|-------|-------------|
|
|
111
|
+
| **Single** | `agent` + `task` | One agent, one task |
|
|
112
|
+
| **Parallel** | `tasks: [{agent, task}, ...]` | Up to 8 concurrent agents |
|
|
113
|
+
| **Chain** | `chain: [{agent, task}, ...]` | Sequential, `{previous}` passes context |
|
|
114
|
+
|
|
115
|
+
```
|
|
116
|
+
# Single — scout explores
|
|
117
|
+
Dispatch scout to find all files that handle payment processing
|
|
118
|
+
|
|
119
|
+
# Parallel — multiple reviewers at once
|
|
120
|
+
Run security-reviewer and performance-reviewer in parallel on src/api/
|
|
121
|
+
|
|
122
|
+
# Chain — scout feeds implementer
|
|
123
|
+
Chain: scout finds the auth module, then implementer adds rate limiting.
|
|
124
|
+
Use {previous} to pass scout's findings.
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### 🧪 TDD Guard
|
|
128
|
+
|
|
129
|
+
Hard enforcement at the tool level. The guard intercepts every `write`, `edit`, and `bash` call:
|
|
130
|
+
|
|
131
|
+
```
|
|
132
|
+
write(src/foo.ts) → Test file exists? → Tests run? → ✅ ALLOW
|
|
133
|
+
↓ No ↓ No
|
|
134
|
+
🚫 "Create test first" 🚫 "Run tests first"
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
**Three-layer defense:**
|
|
138
|
+
|
|
139
|
+
| Layer | What | When |
|
|
140
|
+
|-------|------|------|
|
|
141
|
+
| **Rules** | Injects "write tests first" into context | Agent *thinks* about skipping tests |
|
|
142
|
+
| **Guard** | Blocks the `write`/`edit` tool call | Agent *tries* to skip tests |
|
|
143
|
+
| **Skills** | Teaches RED→GREEN→REFACTOR | Agent *doesn't know* the methodology |
|
|
144
|
+
|
|
145
|
+
**ATDD mode** adds acceptance test awareness — warns when writing unit tests without an acceptance test to frame the feature.
|
|
146
|
+
|
|
147
|
+
### 🔄 SDD Orchestration
|
|
148
|
+
|
|
149
|
+
Automated implement → review → fix loops:
|
|
150
|
+
|
|
151
|
+
```
|
|
152
|
+
/sdd load plan.md Load tasks from a plan file
|
|
153
|
+
/sdd run Execute current task through the pipeline
|
|
154
|
+
/sdd status View progress across all tasks
|
|
155
|
+
/sdd next Advance to next task
|
|
156
|
+
/sdd reset Start over
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
**Pipeline per task:**
|
|
160
|
+
1. 🔨 **Implement** — dispatches implementer with TDD enforcement
|
|
161
|
+
2. 📋 **Spec review** — verifies implementation matches requirements
|
|
162
|
+
3. ✨ **Quality review** — checks code quality and test quality
|
|
163
|
+
4. 🔒 **Security review** — scans for vulnerabilities (optional, parallel)
|
|
164
|
+
5. ⚡ **Performance review** — identifies bottlenecks (optional, parallel)
|
|
165
|
+
6. 🔧 **Fix loop** — on failure, re-dispatches implementer with specific findings
|
|
166
|
+
7. 🚨 **Escalation** — after max retries, asks you for help
|
|
167
|
+
|
|
168
|
+
Reviews return structured JSON — no LLM needed to interpret results:
|
|
169
|
+
````
|
|
170
|
+
```superteam-json
|
|
171
|
+
{
|
|
172
|
+
"passed": false,
|
|
173
|
+
"findings": [{ "severity": "high", "file": "src/auth.ts", "line": 42, "issue": "..." }],
|
|
174
|
+
"mustFix": ["src/auth.ts:42"],
|
|
175
|
+
"summary": "Missing input validation on login endpoint"
|
|
176
|
+
}
|
|
177
|
+
```
|
|
178
|
+
````
|
|
179
|
+
|
|
180
|
+
### 📏 Context-Aware Rules
|
|
181
|
+
|
|
182
|
+
TTSR-inspired rule injection. When the AI's output matches a trigger pattern, corrective guidance is injected into the next turn's context.
|
|
183
|
+
|
|
184
|
+
**Built-in rules:**
|
|
185
|
+
|
|
186
|
+
| Rule | Triggers on | Action |
|
|
187
|
+
|------|------------|--------|
|
|
188
|
+
| `test-first` | "simple enough to skip tests" | Fires once: "Write tests first. No exceptions." |
|
|
189
|
+
| `yagni` | "might need later", "future-proof" | Cooldown: "Implement only what's needed now." |
|
|
190
|
+
| `no-impl-before-spec` | "let me just implement" | Per-turn: "Stop. Write the test first." |
|
|
191
|
+
|
|
192
|
+
**Create your own:**
|
|
193
|
+
```markdown
|
|
194
|
+
---
|
|
195
|
+
name: no-any
|
|
196
|
+
trigger: ": any\\b|as any\\b"
|
|
197
|
+
priority: medium
|
|
198
|
+
frequency: per-turn
|
|
199
|
+
---
|
|
200
|
+
Do NOT use `any` type. Use proper TypeScript types, generics, or `unknown`.
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### 💰 Cost Tracking
|
|
204
|
+
|
|
205
|
+
Session-level budget with mid-stream enforcement:
|
|
206
|
+
|
|
207
|
+
```
|
|
208
|
+
/team # Shows cumulative session cost
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
```json
|
|
212
|
+
{
|
|
213
|
+
"costs": {
|
|
214
|
+
"warnAtUsd": 5.0, // Notification at $5
|
|
215
|
+
"hardLimitUsd": 20.0 // Hard block + subprocess kill at $20
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
## Agents
|
|
223
|
+
|
|
224
|
+
| Agent | Purpose | Tools | Model |
|
|
225
|
+
|-------|---------|-------|-------|
|
|
226
|
+
| 🔍 `scout` | Fast codebase recon | read, grep, find, ls, bash | haiku |
|
|
227
|
+
| 🔨 `implementer` | TDD implementation | all (+ TDD guard) | sonnet |
|
|
228
|
+
| 📋 `spec-reviewer` | Spec compliance check | read-only | sonnet |
|
|
229
|
+
| ✨ `quality-reviewer` | Code + test quality | read-only | sonnet |
|
|
230
|
+
| 🔒 `security-reviewer` | Vulnerability scanning | read-only | sonnet |
|
|
231
|
+
| ⚡ `performance-reviewer` | Bottleneck detection | read-only | sonnet |
|
|
232
|
+
| 🏗️ `architect` | Design + structure review | read-only | sonnet |
|
|
233
|
+
|
|
234
|
+
**Custom agents** — drop a `.md` file in `~/.pi/agent/agents/`:
|
|
235
|
+
|
|
236
|
+
```markdown
|
|
237
|
+
---
|
|
238
|
+
name: api-reviewer
|
|
239
|
+
description: REST API design review
|
|
240
|
+
tools: read,grep,find,ls
|
|
241
|
+
model: claude-sonnet-4-5
|
|
242
|
+
---
|
|
243
|
+
Review REST API design for consistency, proper HTTP methods, status codes,
|
|
244
|
+
pagination, error format, and versioning strategy.
|
|
245
|
+
|
|
246
|
+
End with a ```superteam-json block.
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
See the [Agent Guide](docs/guides/agents.md) for details.
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
253
|
+
## Commands
|
|
254
|
+
|
|
255
|
+
| Command | Description |
|
|
256
|
+
|---------|-------------|
|
|
257
|
+
| `/team` | List agents and session cost |
|
|
258
|
+
| `/tdd [off\|tdd\|atdd]` | Toggle TDD enforcement mode |
|
|
259
|
+
| `/tdd allow-bash-write once <reason>` | One-time bash write escape hatch |
|
|
260
|
+
| `/sdd load <file>` | Load a plan file |
|
|
261
|
+
| `/sdd run` | Run SDD for current task |
|
|
262
|
+
| `/sdd status` | Show task progress |
|
|
263
|
+
| `/sdd next` | Advance to next task |
|
|
264
|
+
| `/sdd reset` | Reset SDD state |
|
|
265
|
+
|
|
266
|
+
## Prompt Templates
|
|
267
|
+
|
|
268
|
+
| Template | Description |
|
|
269
|
+
|----------|-------------|
|
|
270
|
+
| `/sdd <plan.md>` | Start SDD for a plan |
|
|
271
|
+
| `/review-parallel <target>` | Parallel spec + quality review |
|
|
272
|
+
| `/scout <area>` | Scout a codebase area |
|
|
273
|
+
| `/implement <feature>` | Chain: scout → implementer |
|
|
274
|
+
|
|
275
|
+
---
|
|
276
|
+
|
|
277
|
+
## Configuration
|
|
278
|
+
|
|
279
|
+
Create `.superteam.json` in your project root. All settings are optional — defaults are sensible.
|
|
280
|
+
|
|
281
|
+
```json
|
|
282
|
+
{
|
|
283
|
+
"configVersion": 1,
|
|
284
|
+
"tddMode": "tdd",
|
|
285
|
+
"testFilePatterns": ["*.test.ts", "*.spec.ts"],
|
|
286
|
+
"testCommands": ["npm test", "npx vitest"],
|
|
287
|
+
"exemptPaths": ["*.d.ts", "*.config.*"],
|
|
288
|
+
"agents": {
|
|
289
|
+
"scoutModel": "claude-haiku-4-5",
|
|
290
|
+
"modelOverrides": {
|
|
291
|
+
"implementer": "claude-opus-4-6"
|
|
292
|
+
}
|
|
293
|
+
},
|
|
294
|
+
"costs": {
|
|
295
|
+
"warnAtUsd": 10.0,
|
|
296
|
+
"hardLimitUsd": 50.0
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
See the [Configuration Guide](docs/guides/configuration.md) for the full reference.
|
|
302
|
+
|
|
303
|
+
---
|
|
304
|
+
|
|
305
|
+
## Architecture
|
|
306
|
+
|
|
307
|
+
```
|
|
308
|
+
pi-superteam/
|
|
309
|
+
│
|
|
310
|
+
├── src/ TypeScript extension source
|
|
311
|
+
│ ├── index.ts Entry point (thin composition root)
|
|
312
|
+
│ ├── config.ts Config discovery + defaults
|
|
313
|
+
│ ├── dispatch.ts Agent subprocess management
|
|
314
|
+
│ ├── review-parser.ts Structured JSON extraction
|
|
315
|
+
│ ├── rules/engine.ts Context-aware rule injection
|
|
316
|
+
│ └── workflow/
|
|
317
|
+
│ ├── state.ts Plan tracking + persistence
|
|
318
|
+
│ ├── tdd-guard.ts TDD enforcement
|
|
319
|
+
│ └── sdd.ts SDD orchestration loop
|
|
320
|
+
│
|
|
321
|
+
├── agents/ Agent profiles (7 built-in)
|
|
322
|
+
├── skills/ Methodology skills (5)
|
|
323
|
+
├── rules/ Context rules (3)
|
|
324
|
+
├── prompts/ Prompt templates (4)
|
|
325
|
+
└── docs/guides/ Documentation
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
**Design principles:**
|
|
329
|
+
- `index.ts` is a thin composition root — no business logic
|
|
330
|
+
- Every piece works independently (TDD guard without SDD, team tool without TDD, rules without either)
|
|
331
|
+
- Graceful degradation — missing models, unavailable tools, broken config all handled
|
|
332
|
+
- JSON-serializable state — no Maps or Sets, persistence via `pi.appendEntry()`
|
|
333
|
+
- Deterministic subprocesses — full isolation with explicit add-backs
|
|
334
|
+
|
|
335
|
+
---
|
|
336
|
+
|
|
337
|
+
## Documentation
|
|
338
|
+
|
|
339
|
+
| Guide | Description |
|
|
340
|
+
|-------|-------------|
|
|
341
|
+
| [Agents](docs/guides/agents.md) | Built-in agents, custom agents, model config, subprocess isolation |
|
|
342
|
+
| [TDD Guard](docs/guides/tdd-guard.md) | Enforcement mechanics, file mapping, modes, escape hatches |
|
|
343
|
+
| [SDD Workflow](docs/guides/sdd-workflow.md) | Plan format, review pipeline, fix loops, escalation |
|
|
344
|
+
| [Configuration](docs/guides/configuration.md) | Full `.superteam.json` reference |
|
|
345
|
+
| [Rules](docs/guides/rules.md) | How rules work, built-in rules, creating custom rules |
|
|
346
|
+
| [Contributing](CONTRIBUTING.md) | Development setup, project structure, PR guidelines |
|
|
347
|
+
| [Changelog](CHANGELOG.md) | Release notes |
|
|
348
|
+
|
|
349
|
+
---
|
|
350
|
+
|
|
351
|
+
## Credits
|
|
352
|
+
|
|
353
|
+
- TDD/SDD methodology adapted from [obra/superpowers](https://github.com/obra/superpowers) (MIT)
|
|
354
|
+
- TTSR concept inspired by [can1357/oh-my-pi](https://github.com/can1357/oh-my-pi) (MIT)
|
|
355
|
+
- Agent dispatch patterns from pi's built-in [subagent example](https://github.com/badlogic/pi-mono)
|
|
356
|
+
- LSP integration via [lsp-pi](https://www.npmjs.com/package/lsp-pi) (MIT, optional)
|
|
357
|
+
|
|
358
|
+
## License
|
|
359
|
+
|
|
360
|
+
MIT — see [LICENSE](LICENSE)
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: architect
|
|
3
|
+
description: Architecture review for design patterns, modularity, and system structure
|
|
4
|
+
tools: read,grep,find,ls
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Architecture Reviewer
|
|
8
|
+
|
|
9
|
+
You are a software architect reviewing code for structural quality, modularity, and design patterns.
|
|
10
|
+
|
|
11
|
+
## Instructions
|
|
12
|
+
|
|
13
|
+
1. Read the codebase structure and changed files
|
|
14
|
+
2. Assess module boundaries and separation of concerns
|
|
15
|
+
3. Check dependency direction (dependencies should point inward)
|
|
16
|
+
4. Evaluate API design and interface contracts
|
|
17
|
+
5. Consider maintainability and extensibility
|
|
18
|
+
|
|
19
|
+
## Output Format
|
|
20
|
+
|
|
21
|
+
You MUST end your response with a structured JSON block:
|
|
22
|
+
|
|
23
|
+
```superteam-json
|
|
24
|
+
{
|
|
25
|
+
"passed": true,
|
|
26
|
+
"findings": [
|
|
27
|
+
{
|
|
28
|
+
"severity": "medium",
|
|
29
|
+
"file": "src/index.ts",
|
|
30
|
+
"issue": "Business logic mixed with routing — violates separation of concerns",
|
|
31
|
+
"suggestion": "Extract business logic into a service module"
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
"mustFix": [],
|
|
35
|
+
"summary": "Good overall structure. Minor separation of concerns issue."
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## What to Check
|
|
40
|
+
- **Module boundaries**: Clear responsibilities, minimal coupling
|
|
41
|
+
- **Dependency direction**: No circular dependencies, proper layering
|
|
42
|
+
- **API design**: Consistent interfaces, proper abstractions
|
|
43
|
+
- **Error boundaries**: Errors handled at appropriate levels
|
|
44
|
+
- **Configuration**: No hardcoded values, proper config management
|
|
45
|
+
- **Extensibility**: Easy to add features without modifying existing code
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: implementer
|
|
3
|
+
description: TDD implementation — write failing tests first, then minimal implementation
|
|
4
|
+
tools: read,bash,edit,write,grep,find,ls
|
|
5
|
+
---
|
|
6
|
+
You are implementing a specific task using strict Test-Driven Development (TDD).
|
|
7
|
+
|
|
8
|
+
## TDD Process (mandatory)
|
|
9
|
+
|
|
10
|
+
1. **RED** — Write a failing test first. Run it. Verify it fails for the right reason.
|
|
11
|
+
2. **GREEN** — Write the minimal implementation to make the test pass. Run tests. Verify they pass.
|
|
12
|
+
3. **REFACTOR** — Clean up the code while keeping tests green. Run tests after each change.
|
|
13
|
+
4. **COMMIT** — Make a descriptive commit with the changes.
|
|
14
|
+
|
|
15
|
+
## Rules
|
|
16
|
+
|
|
17
|
+
- NEVER write implementation code before a failing test exists
|
|
18
|
+
- NEVER write more code than needed to pass the current test
|
|
19
|
+
- ALWAYS run tests after writing them to verify they fail
|
|
20
|
+
- ALWAYS run tests after implementation to verify they pass
|
|
21
|
+
- ALWAYS run tests after refactoring to verify nothing broke
|
|
22
|
+
- If you're tempted to skip a test because the code is "simple" — write the test anyway
|
|
23
|
+
- If you realize you need a helper/utility, write a test for it first
|
|
24
|
+
|
|
25
|
+
## Output
|
|
26
|
+
|
|
27
|
+
When complete, summarize:
|
|
28
|
+
- Files created/modified
|
|
29
|
+
- Tests written and their status (all should pass)
|
|
30
|
+
- Key implementation decisions
|
|
31
|
+
- Any concerns or follow-up items
|
|
32
|
+
|
|
33
|
+
## Self-Review Checklist
|
|
34
|
+
|
|
35
|
+
Before reporting completion, verify:
|
|
36
|
+
- [ ] All tests pass
|
|
37
|
+
- [ ] No unnecessary code beyond what tests require
|
|
38
|
+
- [ ] Error cases are tested
|
|
39
|
+
- [ ] Code is clean and well-named
|
|
40
|
+
- [ ] No TODO/FIXME left unaddressed
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: performance-reviewer
|
|
3
|
+
description: Performance review for bottlenecks, memory issues, and scalability
|
|
4
|
+
tools: read,grep,find,ls
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Performance Reviewer
|
|
8
|
+
|
|
9
|
+
You are a performance-focused code reviewer. You look for bottlenecks, memory issues, and scalability concerns.
|
|
10
|
+
|
|
11
|
+
## Instructions
|
|
12
|
+
|
|
13
|
+
1. Read ALL changed files
|
|
14
|
+
2. Identify hot paths and computational complexity
|
|
15
|
+
3. Check for memory leaks, unbounded growth, unnecessary allocations
|
|
16
|
+
4. Assess I/O patterns: N+1 queries, missing batching, unnecessary serialization
|
|
17
|
+
5. Check for blocking operations in async code paths
|
|
18
|
+
|
|
19
|
+
## Output Format
|
|
20
|
+
|
|
21
|
+
You MUST end your response with a structured JSON block:
|
|
22
|
+
|
|
23
|
+
```superteam-json
|
|
24
|
+
{
|
|
25
|
+
"passed": true,
|
|
26
|
+
"findings": [
|
|
27
|
+
{
|
|
28
|
+
"severity": "medium",
|
|
29
|
+
"file": "src/data.ts",
|
|
30
|
+
"line": 55,
|
|
31
|
+
"issue": "N+1 query pattern: fetching related records in a loop",
|
|
32
|
+
"suggestion": "Batch the related records query using IN clause"
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"mustFix": [],
|
|
36
|
+
"summary": "Minor N+1 query pattern. No critical performance issues."
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## What to Check
|
|
41
|
+
- **Complexity**: O(n²) or worse in hot paths
|
|
42
|
+
- **Memory**: Unbounded arrays/maps, missing cleanup, large object retention
|
|
43
|
+
- **I/O**: N+1 queries, missing connection pooling, synchronous I/O in async context
|
|
44
|
+
- **Concurrency**: Missing parallelization opportunities, unnecessary serialization
|
|
45
|
+
- **Caching**: Missing obvious cache opportunities, cache invalidation issues
|
|
46
|
+
|
|
47
|
+
## Severity Guide
|
|
48
|
+
- **critical**: Performance issue causing system failure at normal load
|
|
49
|
+
- **high**: Significant degradation under expected load
|
|
50
|
+
- **medium**: Suboptimal but functional, noticeable at scale
|
|
51
|
+
- **low**: Micro-optimization opportunity
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: quality-reviewer
|
|
3
|
+
description: Review code quality, test quality, and engineering practices
|
|
4
|
+
tools: read,grep,find,ls
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Code Quality Reviewer
|
|
8
|
+
|
|
9
|
+
You are a senior code quality reviewer focused on engineering excellence.
|
|
10
|
+
|
|
11
|
+
## Instructions
|
|
12
|
+
|
|
13
|
+
1. Read ALL changed files thoroughly
|
|
14
|
+
2. Assess code quality: naming, structure, DRY, error handling, complexity
|
|
15
|
+
3. Assess test quality: real behavior tests (not mock-heavy), edge cases, assertions
|
|
16
|
+
4. Check for anti-patterns, unnecessary complexity, missing error handling
|
|
17
|
+
5. Verify the code is production-ready
|
|
18
|
+
|
|
19
|
+
## Output Format
|
|
20
|
+
|
|
21
|
+
You MUST end your response with a structured JSON block:
|
|
22
|
+
|
|
23
|
+
```superteam-json
|
|
24
|
+
{
|
|
25
|
+
"passed": true,
|
|
26
|
+
"findings": [
|
|
27
|
+
{
|
|
28
|
+
"severity": "low",
|
|
29
|
+
"file": "src/utils.ts",
|
|
30
|
+
"line": 15,
|
|
31
|
+
"issue": "Function name 'processData' is too generic",
|
|
32
|
+
"suggestion": "Rename to 'parseUserInput' to better describe its purpose"
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"mustFix": [],
|
|
36
|
+
"summary": "Code quality is good. Minor naming suggestion."
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## What to Check
|
|
41
|
+
- **Naming**: Clear, descriptive, consistent conventions
|
|
42
|
+
- **DRY**: No unnecessary duplication (but don't over-abstract)
|
|
43
|
+
- **Error handling**: All failure modes handled, meaningful error messages
|
|
44
|
+
- **Complexity**: Functions under ~30 lines, cyclomatic complexity reasonable
|
|
45
|
+
- **Test quality**: Tests verify behavior, not implementation details
|
|
46
|
+
- **Edge cases**: Null, empty, boundary conditions tested
|
|
47
|
+
- **Type safety**: No unnecessary `any`, proper TypeScript usage
|
|
48
|
+
|
|
49
|
+
## Severity Guide
|
|
50
|
+
- **critical**: Security vulnerability, data loss risk, race condition
|
|
51
|
+
- **high**: Missing error handling, untested critical path, memory leak
|
|
52
|
+
- **medium**: DRY violation, unclear naming, missing edge case test
|
|
53
|
+
- **low**: Style preference, minor naming improvement
|