buildwright 0.0.12 → 0.0.14
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 +98 -384
- package/bin/buildwright.js +1 -1
- package/package.json +2 -2
- package/src/commands/commands.js +3 -5
- package/src/commands/init.js +4 -4
- package/src/commands/update.js +83 -29
- package/templates/.buildwright/agents/README.md +6 -50
- package/templates/.buildwright/commands/bw-analyse.md +12 -13
- package/templates/.buildwright/commands/bw-plan.md +7 -4
- package/templates/.buildwright/commands/bw-ship.md +5 -2
- package/templates/.buildwright/commands/bw-verify.md +2 -2
- package/templates/.buildwright/commands/bw-work.md +149 -0
- package/templates/.buildwright/steering/philosophy.md +45 -0
- package/templates/BUILDWRIGHT.md +2 -5
- package/templates/CLAUDE.md +89 -126
- package/templates/Makefile +1 -1
- package/templates/scripts/sync-agents.sh +35 -31
- package/templates/scripts/validate-docs.sh +1 -4
- package/templates/.buildwright/agents/architect.md +0 -143
- package/templates/.buildwright/claws/README.md +0 -89
- package/templates/.buildwright/claws/TEMPLATE.md +0 -71
- package/templates/.buildwright/claws/backend.md +0 -114
- package/templates/.buildwright/claws/database.md +0 -120
- package/templates/.buildwright/claws/devops.md +0 -175
- package/templates/.buildwright/claws/frontend.md +0 -111
- package/templates/.buildwright/commands/bw-claw.md +0 -332
- package/templates/.buildwright/commands/bw-help.md +0 -88
- package/templates/.buildwright/commands/bw-new-feature.md +0 -539
- package/templates/.buildwright/commands/bw-quick.md +0 -336
- package/templates/.buildwright/steering/naming-conventions.md +0 -40
- package/templates/.buildwright/steering/product.md +0 -16
- package/templates/.buildwright/steering/quality-gates.md +0 -35
- package/templates/.buildwright/steering/tech.md +0 -27
- package/templates/.buildwright/tasks/TEMPLATE.md +0 -79
- package/templates/.github/workflows/quality-gates.yml +0 -135
- package/templates/docs/requirements/TEMPLATE.md +0 -33
package/README.md
CHANGED
|
@@ -1,439 +1,153 @@
|
|
|
1
1
|
# Buildwright
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
An agent-first autonomous development workflow where humans approve specifications and agents handle everything else — implementation, testing, security review, code review, and shipping.
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## The Flow
|
|
10
|
-
|
|
11
|
-
```mermaid
|
|
12
|
-
flowchart TD
|
|
13
|
-
A["/bw-new-feature"] --> B{Greenfield?}
|
|
14
|
-
B -- Yes --> C[Ask product vision<br>Derive tech stack from vision]
|
|
15
|
-
C --> D
|
|
16
|
-
B -- No --> D["1. RESEARCH<br>Deep-read codebase"]
|
|
17
|
-
D --> E["1.5. RESOLVE AMBIGUITIES<br>Auto-decide or ask user<br>(BUILDWRIGHT_AUTO_APPROVE)"]
|
|
18
|
-
E --> F["2. PLAN<br>Generate spec"]
|
|
19
|
-
F --> G["3. VALIDATE<br>Staff Engineer review (auto)"]
|
|
20
|
-
G --> H["4. APPROVE<br>Human or auto<br>(BUILDWRIGHT_AUTO_APPROVE)"]
|
|
21
|
-
H --> I["5. BUILD<br>TDD per milestone<br>→ verify after each"]
|
|
22
|
-
I --> J["6.5 UPDATE DOCS<br>README · CHANGELOG · docs/"]
|
|
23
|
-
J --> K["7. SHIP"]
|
|
24
|
-
K --> L[Verify]
|
|
25
|
-
L --> M[Security]
|
|
26
|
-
M --> N[Review]
|
|
27
|
-
N --> O["PR Ready ✓"]
|
|
28
|
-
|
|
29
|
-
P["/bw-quick"] --> Q[Quick research]
|
|
30
|
-
Q --> R[Implement TDD]
|
|
31
|
-
R --> S[Verify]
|
|
32
|
-
S --> U[Security]
|
|
33
|
-
U --> V[Code Review]
|
|
34
|
-
V --> W[Update Docs]
|
|
35
|
-
W --> T["Commit Ready ✓"]
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
> If anything fails → commit completed work, push, PR with failure report, exit(1). No orphaned branches.
|
|
39
|
-
|
|
40
|
-
---
|
|
3
|
+
Buildwright is a lightweight engineering discipline layer for agent-led
|
|
4
|
+
software work: understand, test, implement, document, verify, review, ship.
|
|
41
5
|
|
|
42
|
-
|
|
6
|
+
It is not a multi-agent framework. It keeps a small command surface and stores
|
|
7
|
+
only useful project context.
|
|
43
8
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
```
|
|
47
|
-
/bw-new-feature "Add product catalog with search"
|
|
9
|
+
## Commands
|
|
48
10
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
11
|
+
| Command | Purpose |
|
|
12
|
+
|---------|---------|
|
|
13
|
+
| `/bw-plan` | Think/research only; no code changes |
|
|
14
|
+
| `/bw-work` | Implement bug fixes, refactors, and features |
|
|
15
|
+
| `/bw-verify` | Run typecheck, lint, test, and build gates |
|
|
16
|
+
| `/bw-ship` | Security review, code review, push, and PR |
|
|
17
|
+
| `/bw-analyse` | Analyse a brownfield codebase and write context docs |
|
|
53
18
|
|
|
54
|
-
|
|
55
|
-
> [Derives and presents tech stack for approval]
|
|
19
|
+
## Workflow
|
|
56
20
|
|
|
57
|
-
|
|
58
|
-
───────────────────
|
|
59
|
-
[Stack derived from your product vision and constraints]
|
|
60
|
-
Chosen because: [2-3 sentences linking requirements to stack]
|
|
61
|
-
Alternatives considered: [brief list]
|
|
21
|
+
Use `/bw-work` for implementation:
|
|
62
22
|
|
|
63
|
-
|
|
64
|
-
|
|
23
|
+
```text
|
|
24
|
+
Understand -> Research -> Plan if needed -> Red -> Green -> Refactor -> Docs -> Verify -> Security -> Review -> Commit/Ship
|
|
65
25
|
```
|
|
66
26
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
27
|
+
Small tasks use lightweight research. Larger features produce
|
|
28
|
+
`docs/specs/[feature]/research.md` and `docs/specs/[feature]/spec.md`.
|
|
29
|
+
Cross-domain work uses a normal implementation plan; there is no separate
|
|
30
|
+
multi-agent architecture.
|
|
70
31
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
Want fully autonomous operation? Skip human approval entirely:
|
|
74
|
-
|
|
75
|
-
```bash
|
|
76
|
-
# Set environment variable
|
|
77
|
-
export BUILDWRIGHT_AUTO_APPROVE=true
|
|
32
|
+
TDD is explicit:
|
|
78
33
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
34
|
+
- Red: write a failing test for the bug or expected behavior.
|
|
35
|
+
- Green: make the smallest passing implementation.
|
|
36
|
+
- Refactor: improve structure while tests stay green.
|
|
82
37
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
- No approval wait — proceeds directly to build
|
|
87
|
-
- Full audit trail in version control
|
|
38
|
+
Documentation is part of done. Every user-facing change must update affected
|
|
39
|
+
README, docs, command text, API docs, examples, or changelog. If no docs apply,
|
|
40
|
+
the agent must say why.
|
|
88
41
|
|
|
89
|
-
|
|
90
|
-
docs(spec): add specification for user-auth
|
|
42
|
+
## Steering
|
|
91
43
|
|
|
92
|
-
|
|
93
|
-
- spec.md: implementation plan
|
|
94
|
-
- Validated by Staff Engineer agent
|
|
44
|
+
Buildwright installs one default steering file:
|
|
95
45
|
|
|
96
|
-
|
|
46
|
+
```text
|
|
47
|
+
.buildwright/steering/philosophy.md
|
|
97
48
|
```
|
|
98
49
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
- Running in CI/CD pipelines
|
|
102
|
-
- Batch processing multiple features
|
|
103
|
-
- You want to review specs via git history instead of real-time
|
|
104
|
-
|
|
105
|
-
---
|
|
50
|
+
That file contains KISS, YAGNI, DRY, boring technology, fail-fast, TDD,
|
|
51
|
+
documentation discipline, and financial-code rules.
|
|
106
52
|
|
|
107
|
-
|
|
53
|
+
Project-specific steering is created only when there is real content:
|
|
108
54
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
npm install -g buildwright
|
|
113
|
-
cd my-project && buildwright init
|
|
55
|
+
```text
|
|
56
|
+
.buildwright/steering/tech.md # created after stack/command discovery
|
|
57
|
+
.buildwright/steering/product.md # created for greenfield or explicit product context
|
|
114
58
|
```
|
|
115
59
|
|
|
116
|
-
|
|
60
|
+
`/bw-analyse` writes deeper brownfield context to:
|
|
117
61
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
# Customize steering docs
|
|
125
|
-
nano .buildwright/steering/product.md # Your product context
|
|
126
|
-
nano .buildwright/steering/tech.md # Your tech stack
|
|
127
|
-
|
|
128
|
-
# Start building
|
|
129
|
-
claude
|
|
130
|
-
> /bw-new-feature "Add user authentication with OAuth2"
|
|
62
|
+
```text
|
|
63
|
+
.buildwright/codebase/STACK.md
|
|
64
|
+
.buildwright/codebase/ARCHITECTURE.md
|
|
65
|
+
.buildwright/codebase/CONVENTIONS.md
|
|
66
|
+
.buildwright/codebase/CONCERNS.md
|
|
131
67
|
```
|
|
132
68
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
```bash
|
|
136
|
-
# After cloning the repo, generate tool-specific configs
|
|
137
|
-
make sync
|
|
69
|
+
## Install
|
|
138
70
|
|
|
139
|
-
|
|
140
|
-
# .claude/ (commands, agents, claws, steering — from .buildwright/)
|
|
141
|
-
# .opencode/ (commands, agents, claws, steering — from .buildwright/)
|
|
142
|
-
# .cursor/rules/ (commands, agents, claws, steering — from .buildwright/)
|
|
143
|
-
# AGENTS.md (from CLAUDE.md — for OpenCode compatibility)
|
|
71
|
+
### CLI
|
|
144
72
|
|
|
145
|
-
|
|
146
|
-
|
|
73
|
+
```bash
|
|
74
|
+
npm install -g buildwright
|
|
75
|
+
cd your-project
|
|
76
|
+
buildwright init
|
|
147
77
|
```
|
|
148
78
|
|
|
149
|
-
|
|
79
|
+
Then open your AI editor and run:
|
|
150
80
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
```bash
|
|
154
|
-
curl -sL https://raw.githubusercontent.com/raunakkathuria/buildwright/main/setup.sh | bash
|
|
155
|
-
make sync
|
|
81
|
+
```text
|
|
82
|
+
/bw-work "your task"
|
|
156
83
|
```
|
|
157
84
|
|
|
158
|
-
|
|
85
|
+
### Update
|
|
159
86
|
|
|
160
87
|
```bash
|
|
161
|
-
|
|
162
|
-
|
|
88
|
+
npm install -g buildwright@latest
|
|
89
|
+
cd your-project
|
|
90
|
+
buildwright update
|
|
163
91
|
```
|
|
164
92
|
|
|
165
|
-
|
|
93
|
+
`buildwright update` refreshes Buildwright commands, agents, default steering,
|
|
94
|
+
and Buildwright-owned support scripts. It also removes paths from the old
|
|
95
|
+
pre-`/bw-work` model so generated tool configs do not contain both old and new
|
|
96
|
+
workflows.
|
|
166
97
|
|
|
167
|
-
###
|
|
168
|
-
|
|
169
|
-
Same as above — run the setup script for the full workflow:
|
|
98
|
+
### From Source
|
|
170
99
|
|
|
171
100
|
```bash
|
|
172
|
-
|
|
101
|
+
git clone https://github.com/raunakkathuria/buildwright.git
|
|
102
|
+
cd buildwright
|
|
173
103
|
make sync
|
|
174
104
|
```
|
|
175
105
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
```bash
|
|
179
|
-
mkdir -p ~/.config/opencode/skills/buildwright
|
|
180
|
-
curl -s https://raw.githubusercontent.com/raunakkathuria/buildwright/main/SKILL.md > ~/.config/opencode/skills/buildwright/SKILL.md
|
|
181
|
-
```
|
|
182
|
-
|
|
183
|
-
> **Note:** The global skill install provides buildwright's workflow guidance via SKILL.md. The slash commands require the full project setup.
|
|
184
|
-
|
|
185
|
-
### For Cursor
|
|
106
|
+
## Project Layout
|
|
186
107
|
|
|
187
|
-
|
|
108
|
+
```text
|
|
109
|
+
.buildwright/
|
|
110
|
+
agents/
|
|
111
|
+
staff-engineer.md
|
|
112
|
+
security-engineer.md
|
|
113
|
+
commands/
|
|
114
|
+
bw-analyse.md
|
|
115
|
+
bw-plan.md
|
|
116
|
+
bw-ship.md
|
|
117
|
+
bw-verify.md
|
|
118
|
+
bw-work.md
|
|
119
|
+
steering/
|
|
120
|
+
philosophy.md
|
|
188
121
|
|
|
189
|
-
|
|
190
|
-
|
|
122
|
+
.claude/ # generated by make sync
|
|
123
|
+
.opencode/ # generated by make sync
|
|
124
|
+
.cursor/rules/ # generated by make sync
|
|
125
|
+
AGENTS.md # generated by make sync
|
|
126
|
+
skills/ # generated by make sync for Codex CLI
|
|
191
127
|
```
|
|
192
128
|
|
|
193
|
-
|
|
129
|
+
`.buildwright/` is canonical. Generated tool directories are gitignored.
|
|
194
130
|
|
|
195
|
-
|
|
131
|
+
## Development
|
|
196
132
|
|
|
197
|
-
|
|
133
|
+
After editing `.buildwright/`, run:
|
|
198
134
|
|
|
199
135
|
```bash
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
Or follow the detailed guide in [`.codex/INSTALL.md`](.codex/INSTALL.md).
|
|
205
|
-
|
|
206
|
-
Each `bw-*` command is available as a Codex skill. `AGENTS.md` (generated by `make sync`) is also read automatically by Codex at the project level.
|
|
207
|
-
|
|
208
|
-
---
|
|
209
|
-
|
|
210
|
-
## When to Use What
|
|
211
|
-
|
|
212
|
-
| Scenario | Approach | Why |
|
|
213
|
-
|----------|----------|-----|
|
|
214
|
-
| New feature, unclear scope | `/bw-new-feature` | Research prevents building the wrong thing |
|
|
215
|
-
| New feature, clear scope | `/bw-new-feature` | Spec creates audit trail + validation |
|
|
216
|
-
| Bug fix | `/bw-quick` | Fast path with full quality gates |
|
|
217
|
-
| Small task (< 2 hrs) | `/bw-quick` | Lightweight planning, full quality gates |
|
|
218
|
-
| Config change | `/bw-quick` | Quick path with security scan + code review |
|
|
219
|
-
| Refactor, clear scope | `/bw-quick` | You already know what to change |
|
|
220
|
-
| Refactor, unclear scope | `/bw-new-feature` | Research phase prevents breaking things |
|
|
221
|
-
| Unfamiliar / brownfield codebase | `/bw-analyse` | Generates stack, architecture, conventions, and concerns docs so every session starts with real context |
|
|
222
|
-
| Greenfield project | `/bw-new-feature` | Auto-generates steering docs + tech stack |
|
|
223
|
-
| Prototype / spike | Just code it | Ceremony kills exploration speed |
|
|
224
|
-
| One-off script | Just code it | No need for spec, review, or CI |
|
|
225
|
-
| Learning / experimenting | Just code it | Pipeline adds friction to discovery |
|
|
226
|
-
|
|
227
|
-
---
|
|
228
|
-
|
|
229
|
-
## Commands
|
|
230
|
-
|
|
231
|
-
| Command | Purpose |
|
|
232
|
-
|---------|---------|
|
|
233
|
-
| `/bw-analyse` | Analyse codebase: writes stack, architecture, conventions, concerns to `.buildwright/codebase/`, updates `tech.md` |
|
|
234
|
-
| `/bw-new-feature` | Full pipeline: research → spec → approve → build → ship |
|
|
235
|
-
| `/bw-claw` | Multi-agent: architect decomposes → claws execute per domain |
|
|
236
|
-
| `/bw-quick` | Fast path for bug fixes, small tasks |
|
|
237
|
-
| `/bw-plan` | Research a question, produce a written deliverable — no implementation, no commits |
|
|
238
|
-
| `/bw-ship` | Quality gates + release: verify → security → review → push → PR |
|
|
239
|
-
| `/bw-verify` | Quick checks: typecheck, lint, test, build |
|
|
240
|
-
| `/bw-help` | Show available commands |
|
|
241
|
-
|
|
242
|
-
---
|
|
243
|
-
|
|
244
|
-
## Agent Personas
|
|
245
|
-
|
|
246
|
-
Modular, extensible agent personas in `.buildwright/agents/`:
|
|
247
|
-
|
|
248
|
-
| Agent | File | Used By | Purpose |
|
|
249
|
-
|-------|------|---------|---------|
|
|
250
|
-
| Staff Engineer | `staff-engineer.md` | `/bw-new-feature`, `/bw-ship` | Spec & code review |
|
|
251
|
-
| Security Engineer | `bw-security-engineer.md` | `/bw-ship` | OWASP, SAST, security review |
|
|
252
|
-
|
|
253
|
-
### Adding New Agents
|
|
254
|
-
|
|
255
|
-
```bash
|
|
256
|
-
# Create new agent persona
|
|
257
|
-
cat > .buildwright/agents/qa-engineer.md << 'EOF'
|
|
258
|
-
# QA Engineer Agent
|
|
259
|
-
|
|
260
|
-
You are a QA Engineer specialized in test coverage...
|
|
261
|
-
|
|
262
|
-
## What You Look For
|
|
263
|
-
...
|
|
264
|
-
|
|
265
|
-
## Output Format
|
|
266
|
-
...
|
|
267
|
-
EOF
|
|
268
|
-
```
|
|
269
|
-
|
|
270
|
-
Then reference in commands:
|
|
271
|
-
```markdown
|
|
272
|
-
## Adopt Persona
|
|
273
|
-
Read and adopt persona from `.buildwright/agents/qa-engineer.md`
|
|
274
|
-
```
|
|
275
|
-
|
|
276
|
-
---
|
|
277
|
-
|
|
278
|
-
## Security Review
|
|
279
|
-
|
|
280
|
-
The security phase in `/bw-ship` covers:
|
|
281
|
-
|
|
282
|
-
| Category | Checks |
|
|
283
|
-
|----------|--------|
|
|
284
|
-
| **OWASP Top 10** | All 10 categories (A01-A10:2021) |
|
|
285
|
-
| **SAST** | Static analysis via Semgrep |
|
|
286
|
-
| **Secrets** | API keys, passwords, tokens, private keys |
|
|
287
|
-
| **Dependencies** | npm audit, cargo audit, pip-audit |
|
|
288
|
-
| **Financial** | No float for currency, transaction integrity, audit logging |
|
|
289
|
-
|
|
290
|
-
### Severity Triage
|
|
291
|
-
|
|
292
|
-
Findings are classified by severity to avoid blocking on low-risk items:
|
|
293
|
-
|
|
294
|
-
| Severity | Action | Example |
|
|
295
|
-
|----------|--------|---------|
|
|
296
|
-
| **Critical / High** | Block — must fix before merge | SQL injection, exposed secrets, auth bypass |
|
|
297
|
-
| **Medium** | Fix in this PR if feasible, otherwise track | Missing rate limiting, verbose error messages |
|
|
298
|
-
| **Low / Info** | Advisory — log and move on | Minor header hardening, informational findings |
|
|
299
|
-
|
|
300
|
-
---
|
|
301
|
-
|
|
302
|
-
## Project Structure
|
|
303
|
-
|
|
304
|
-
```
|
|
305
|
-
your-project/
|
|
306
|
-
├── CLAUDE.md # Agent instructions (committed)
|
|
307
|
-
├── BUILDWRIGHT.md # Human documentation (committed)
|
|
308
|
-
├── SKILL.md # Agent Skills standard (committed)
|
|
309
|
-
├── .buildwright/ # Canonical config (committed)
|
|
310
|
-
│ ├── agents/ # Reusable personas
|
|
311
|
-
│ │ ├── architect.md
|
|
312
|
-
│ │ ├── staff-engineer.md
|
|
313
|
-
│ │ └── security-engineer.md
|
|
314
|
-
│ ├── claws/ # Domain specialists
|
|
315
|
-
│ │ ├── frontend.md
|
|
316
|
-
│ │ ├── backend.md
|
|
317
|
-
│ │ ├── database.md
|
|
318
|
-
│ │ └── TEMPLATE.md
|
|
319
|
-
│ ├── codebase/ # Analysis docs (generated by /bw-analyse)
|
|
320
|
-
│ │ ├── STACK.md
|
|
321
|
-
│ │ ├── ARCHITECTURE.md
|
|
322
|
-
│ │ ├── CONVENTIONS.md
|
|
323
|
-
│ │ └── CONCERNS.md
|
|
324
|
-
│ ├── commands/ # Slash commands
|
|
325
|
-
│ │ ├── bw-analyse.md
|
|
326
|
-
│ │ ├── bw-claw.md
|
|
327
|
-
│ │ ├── bw-new-feature.md
|
|
328
|
-
│ │ ├── bw-plan.md
|
|
329
|
-
│ │ ├── bw-quick.md
|
|
330
|
-
│ │ ├── bw-ship.md
|
|
331
|
-
│ │ ├── bw-verify.md
|
|
332
|
-
│ │ └── bw-help.md
|
|
333
|
-
│ ├── steering/ # Project context
|
|
334
|
-
│ │ ├── product.md
|
|
335
|
-
│ │ ├── tech.md
|
|
336
|
-
│ │ ├── quality-gates.md
|
|
337
|
-
│ │ └── naming-conventions.md
|
|
338
|
-
│ └── tasks/
|
|
339
|
-
├── .claude/ # Generated by `make sync` (gitignored)
|
|
340
|
-
│ ├── settings.json # Claude Code permissions (committed)
|
|
341
|
-
│ └── agents/, claws/, commands/, steering/ (generated)
|
|
342
|
-
├── .opencode/ # Generated by `make sync` (gitignored)
|
|
343
|
-
├── .cursor/rules/ # Generated by `make sync` (gitignored)
|
|
344
|
-
├── AGENTS.md # Generated by `make sync` (gitignored)
|
|
345
|
-
├── scripts/
|
|
346
|
-
│ ├── sync-agents.sh # Sync .buildwright/ → .claude/ + .opencode/ + .cursor/rules/
|
|
347
|
-
│ ├── install-hooks.sh # Install git hooks (run via: make install-hooks)
|
|
348
|
-
│ ├── validate-skill.sh # Validate SKILL.md against agentskills.io
|
|
349
|
-
│ └── hooks/ # Git hooks source (committed, installed to .git/hooks/)
|
|
350
|
-
│ ├── pre-commit # Auto-sync when .buildwright/ files are staged
|
|
351
|
-
│ ├── post-merge # Auto-sync after git pull/merge
|
|
352
|
-
│ └── post-checkout # Auto-sync on branch switches
|
|
353
|
-
├── docs/
|
|
354
|
-
│ ├── requirements/
|
|
355
|
-
│ └── specs/
|
|
356
|
-
└── .github/
|
|
357
|
-
└── workflows/
|
|
358
|
-
└── quality-gates.yml
|
|
136
|
+
make sync
|
|
137
|
+
make sync-check
|
|
138
|
+
make validate
|
|
359
139
|
```
|
|
360
140
|
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
---
|
|
364
|
-
|
|
365
|
-
## Design Principles (Built-In)
|
|
366
|
-
|
|
367
|
-
Every spec and implementation follows:
|
|
368
|
-
|
|
369
|
-
| Principle | Meaning |
|
|
370
|
-
|-----------|---------|
|
|
371
|
-
| **KISS** | Keep It Simple — prefer simple over clever |
|
|
372
|
-
| **YAGNI** | You Aren't Gonna Need It — build only what's needed now, no speculative abstractions |
|
|
373
|
-
| **DRY** | Don't Repeat Yourself — reuse existing code, extract common logic |
|
|
374
|
-
| **No Premature Optimization** | Make it work first, optimize with data |
|
|
375
|
-
| **Boring Technology** | Proven tools over shiny new ones |
|
|
376
|
-
| **Fail Fast** | Validate early, error loudly |
|
|
377
|
-
|
|
378
|
-
---
|
|
379
|
-
|
|
380
|
-
## Extending the Workflow
|
|
381
|
-
|
|
382
|
-
### Add New Agent
|
|
383
|
-
|
|
384
|
-
1. Create `.buildwright/agents/[role].md`
|
|
385
|
-
2. Define mindset, checklist, output format
|
|
386
|
-
3. Reference in commands with `Adopt persona from...`
|
|
387
|
-
|
|
388
|
-
### Add New Command
|
|
389
|
-
|
|
390
|
-
1. Create `.buildwright/commands/[name].md`
|
|
391
|
-
2. Define arguments, phases, output format
|
|
392
|
-
3. Reference agents as needed
|
|
393
|
-
|
|
394
|
-
### Planned Agents (Future)
|
|
395
|
-
|
|
396
|
-
| Agent | Purpose |
|
|
397
|
-
|-------|---------|
|
|
398
|
-
| QA Engineer | Test coverage, edge cases |
|
|
399
|
-
| Performance Engineer | Bottleneck identification |
|
|
400
|
-
| DevOps Engineer | Infrastructure review |
|
|
401
|
-
| Database Engineer | Schema review, query optimization |
|
|
402
|
-
| UX Engineer | API design review |
|
|
403
|
-
|
|
404
|
-
---
|
|
405
|
-
|
|
406
|
-
## Customization
|
|
407
|
-
|
|
408
|
-
| File | Purpose | Edit Frequency |
|
|
409
|
-
|------|---------|----------------|
|
|
410
|
-
| `.buildwright/steering/product.md` | Product context | Per project |
|
|
411
|
-
| `.buildwright/steering/tech.md` | Tech stack & commands | Per project |
|
|
412
|
-
| `.buildwright/agents/*.md` | Agent personas | Rarely |
|
|
413
|
-
| `.buildwright/commands/*.md` | Slash commands | Rarely |
|
|
414
|
-
| `CLAUDE.md` | Learned patterns | As discovered |
|
|
415
|
-
|
|
416
|
-
---
|
|
417
|
-
|
|
418
|
-
## FAQ
|
|
419
|
-
|
|
420
|
-
### Do I need to review code?
|
|
421
|
-
No. `/bw-ship` handles security review and code review automatically using Staff Engineer and Security Engineer personas.
|
|
422
|
-
|
|
423
|
-
### What if a step fails?
|
|
424
|
-
- **Verify fails**: Retries up to 2x automatically.
|
|
425
|
-
- **Security/Review fails**: No retry — requires judgment.
|
|
426
|
-
- **Autonomous mode** (`BUILDWRIGHT_AUTO_APPROVE=true`): Commits completed work, pushes, creates PR with failure details, exits with error code.
|
|
427
|
-
- **Interactive mode** (`BUILDWRIGHT_AUTO_APPROVE=false`): STOP immediately — human fixes in-session.
|
|
428
|
-
|
|
429
|
-
### Can I skip security review?
|
|
430
|
-
No. Both `/bw-ship` and `/bw-quick` include mandatory security and code review steps. Use `/bw-verify` for quick checks during active development, before committing.
|
|
431
|
-
|
|
432
|
-
### How do I add project-specific rules?
|
|
433
|
-
Add to `CLAUDE.md` under "Learned Patterns" or create a new agent.
|
|
141
|
+
`make sync` regenerates tool-specific config, Codex skills, `AGENTS.md`, and the
|
|
142
|
+
CLI README.
|
|
434
143
|
|
|
435
|
-
|
|
144
|
+
## Configuration
|
|
436
145
|
|
|
437
|
-
|
|
146
|
+
| Variable | Default | Purpose |
|
|
147
|
+
|----------|---------|---------|
|
|
148
|
+
| `BUILDWRIGHT_AUTO_APPROVE` | `true` | Skip approval pauses and proceed autonomously |
|
|
149
|
+
| `BUILDWRIGHT_AGENT_RETRIES` | `2` | Verification retry count |
|
|
150
|
+
| `GITHUB_TOKEN` | unset | Used by `gh` when creating PRs |
|
|
438
151
|
|
|
439
|
-
|
|
152
|
+
Use a fine-grained GitHub token with contents and pull request permissions when
|
|
153
|
+
you want `/bw-ship` to push branches and create PRs.
|
package/bin/buildwright.js
CHANGED
|
@@ -25,7 +25,7 @@ program
|
|
|
25
25
|
|
|
26
26
|
program
|
|
27
27
|
.command('update')
|
|
28
|
-
.description('Update commands, agents, and
|
|
28
|
+
.description('Update commands, agents, and default steering from GitHub')
|
|
29
29
|
.action(async () => {
|
|
30
30
|
await update();
|
|
31
31
|
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "buildwright",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.0.14",
|
|
4
|
+
"description": "Lightweight engineering workflow for agent-led development.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": ">=18.0.0"
|
package/src/commands/commands.js
CHANGED
|
@@ -10,12 +10,10 @@ const DIM = '\x1b[2m';
|
|
|
10
10
|
|
|
11
11
|
const HARDCODED = [
|
|
12
12
|
{ name: 'bw-analyse', description: 'Analyse codebase: writes stack, architecture, conventions, concerns to .buildwright/codebase/' },
|
|
13
|
-
{ name: 'bw-claw', description: 'Multi-agent: architect decomposes → claws execute per domain' },
|
|
14
|
-
{ name: 'bw-new-feature', description: 'Full pipeline: research → spec → approve → build → ship' },
|
|
15
13
|
{ name: 'bw-plan', description: 'Research a question, produce a written deliverable — no implementation, no commits' },
|
|
16
|
-
{ name: 'bw-quick', description: 'Fast path for bug fixes, small tasks, config changes' },
|
|
17
14
|
{ name: 'bw-ship', description: 'Quality gates + release: verify → security → review → push → PR' },
|
|
18
15
|
{ name: 'bw-verify', description: 'Quick checks: typecheck, lint, test, build' },
|
|
16
|
+
{ name: 'bw-work', description: 'Implement bug fixes, refactors, and features' },
|
|
19
17
|
];
|
|
20
18
|
|
|
21
19
|
function parseFrontmatter(content) {
|
|
@@ -28,7 +26,7 @@ function parseFrontmatter(content) {
|
|
|
28
26
|
}
|
|
29
27
|
|
|
30
28
|
function loadFromDir(dir) {
|
|
31
|
-
const files = fs.readdirSync(dir).filter(f => f.startsWith('bw-') && f.endsWith('.md')
|
|
29
|
+
const files = fs.readdirSync(dir).filter(f => f.startsWith('bw-') && f.endsWith('.md'));
|
|
32
30
|
const entries = [];
|
|
33
31
|
for (const file of files) {
|
|
34
32
|
const content = fs.readFileSync(path.join(dir, file), 'utf8');
|
|
@@ -74,7 +72,7 @@ function commands() {
|
|
|
74
72
|
console.log(`${DIM}(Showing default commands. Run inside a Buildwright project to see project-specific commands.)${RESET}`);
|
|
75
73
|
console.log('');
|
|
76
74
|
}
|
|
77
|
-
console.log(`Run ${BOLD}buildwright help${RESET} for CLI setup commands.`);
|
|
75
|
+
console.log(`Run ${BOLD}buildwright --help${RESET} for CLI setup commands.`);
|
|
78
76
|
console.log('');
|
|
79
77
|
}
|
|
80
78
|
|
package/src/commands/init.js
CHANGED
|
@@ -26,7 +26,7 @@ function init() {
|
|
|
26
26
|
// 2. Check for existing installation
|
|
27
27
|
if (isBuildwrightInstalled(cwd)) {
|
|
28
28
|
console.log(`${YELLOW}Buildwright is already installed in this directory.${RESET}`);
|
|
29
|
-
console.log(`To update commands
|
|
29
|
+
console.log(`To update commands and agents to the latest version, run: ${BOLD}buildwright update${RESET}`);
|
|
30
30
|
process.exit(1);
|
|
31
31
|
}
|
|
32
32
|
|
|
@@ -83,9 +83,9 @@ function init() {
|
|
|
83
83
|
// 7. Success message
|
|
84
84
|
console.log(`${GREEN}${BOLD}Buildwright is ready!${RESET}\n`);
|
|
85
85
|
console.log('Next steps:');
|
|
86
|
-
console.log(` 1.
|
|
87
|
-
console.log(` 2.
|
|
88
|
-
console.log(` 3.
|
|
86
|
+
console.log(` 1. Run ${BOLD}/bw-analyse${RESET} first on unfamiliar brownfield projects`);
|
|
87
|
+
console.log(` 2. Open your AI editor and run ${BOLD}/bw-work "your task"${RESET}`);
|
|
88
|
+
console.log(` 3. Buildwright creates tech.md/product.md only when it has real project context\n`);
|
|
89
89
|
console.log(`For help: ${BOLD}buildwright --help${RESET}`);
|
|
90
90
|
}
|
|
91
91
|
|