buildwright 0.0.12 → 0.0.13

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.
Files changed (36) hide show
  1. package/README.md +89 -388
  2. package/bin/buildwright.js +1 -1
  3. package/package.json +2 -2
  4. package/src/commands/commands.js +3 -5
  5. package/src/commands/init.js +4 -4
  6. package/src/commands/update.js +8 -29
  7. package/templates/.buildwright/agents/README.md +6 -50
  8. package/templates/.buildwright/commands/bw-analyse.md +12 -13
  9. package/templates/.buildwright/commands/bw-plan.md +7 -4
  10. package/templates/.buildwright/commands/bw-ship.md +5 -2
  11. package/templates/.buildwright/commands/bw-verify.md +2 -2
  12. package/templates/.buildwright/commands/bw-work.md +149 -0
  13. package/templates/.buildwright/steering/philosophy.md +45 -0
  14. package/templates/BUILDWRIGHT.md +2 -5
  15. package/templates/CLAUDE.md +89 -126
  16. package/templates/Makefile +1 -1
  17. package/templates/scripts/sync-agents.sh +18 -25
  18. package/templates/scripts/validate-docs.sh +1 -4
  19. package/templates/.buildwright/agents/architect.md +0 -143
  20. package/templates/.buildwright/claws/README.md +0 -89
  21. package/templates/.buildwright/claws/TEMPLATE.md +0 -71
  22. package/templates/.buildwright/claws/backend.md +0 -114
  23. package/templates/.buildwright/claws/database.md +0 -120
  24. package/templates/.buildwright/claws/devops.md +0 -175
  25. package/templates/.buildwright/claws/frontend.md +0 -111
  26. package/templates/.buildwright/commands/bw-claw.md +0 -332
  27. package/templates/.buildwright/commands/bw-help.md +0 -88
  28. package/templates/.buildwright/commands/bw-new-feature.md +0 -539
  29. package/templates/.buildwright/commands/bw-quick.md +0 -336
  30. package/templates/.buildwright/steering/naming-conventions.md +0 -40
  31. package/templates/.buildwright/steering/product.md +0 -16
  32. package/templates/.buildwright/steering/quality-gates.md +0 -35
  33. package/templates/.buildwright/steering/tech.md +0 -27
  34. package/templates/.buildwright/tasks/TEMPLATE.md +0 -79
  35. package/templates/.github/workflows/quality-gates.yml +0 -135
  36. package/templates/docs/requirements/TEMPLATE.md +0 -33
@@ -1,332 +0,0 @@
1
- ---
2
- name: bw-claw
3
- description: Multi-agent feature development using the Claw Architecture — Architect decomposes work, specialized claws execute per domain
4
- arguments:
5
- - name: feature
6
- description: Feature description or path to requirements file
7
- required: true
8
- - name: claws
9
- description: Comma-separated list of claws to use (e.g., "frontend,backend,database"). Auto-detected if omitted.
10
- required: false
11
- ---
12
-
13
- ## Claw Architecture Pipeline
14
-
15
- ```
16
- ┌─────────────────────────────────────────────────────────────┐
17
- │ CLAW ARCHITECTURE │
18
- ├─────────────────────────────────────────────────────────────┤
19
- │ │
20
- │ 1. ANALYZE → Architect reads codebase structure │
21
- │ 2. DECOMPOSE → Break into domain-specific claw tasks │
22
- │ 3. CONTRACT → Define interfaces + naming conventions │
23
- │ 4. APPROVE → Human reviews decomposition plan │
24
- │ 5. EXECUTE → Each claw grabs its domain work │
25
- │ 6. INTEGRATE → Architect combines + verifies │
26
- │ 7. SHIP → Buildwright quality gates → PR │
27
- │ │
28
- │ 🧠 Architect (Brain) │
29
- │ │ │
30
- │ ┌─────────┼─────────┐ │
31
- │ │ │ │ │
32
- │ 🎨 UI ⚙️ API 🗄️ DB │
33
- │ Claw Claw Claw │
34
- │ │
35
- └─────────────────────────────────────────────────────────────┘
36
- ```
37
-
38
- ---
39
-
40
- ## Phase 1: Adopt Architect Persona
41
-
42
- Read and adopt the Architect persona from `.buildwright/agents/architect.md`.
43
-
44
- ---
45
-
46
- ## Phase 2: Analyze Project Structure
47
-
48
- Determine what domains exist in this project:
49
-
50
- ```bash
51
- # Detect project layers
52
- ls -d */ 2>/dev/null
53
- find . -maxdepth 2 -name "package.json" -o -name "Cargo.toml" -o -name "go.mod" -o -name "pyproject.toml" 2>/dev/null
54
- ```
55
-
56
- Map directories to domains:
57
-
58
- | Pattern | Domain | Claw |
59
- |---------|--------|------|
60
- | `ui/`, `frontend/`, `src/components/`, `app/` | Frontend | `.buildwright/claws/frontend.md` |
61
- | `api/`, `backend/`, `server/`, `src/routes/` | Backend | `.buildwright/claws/backend.md` |
62
- | `database/`, `db/`, `migrations/`, `prisma/` | Database | `.buildwright/claws/database.md` |
63
- | `gateway/`, `nginx/`, `proxy/` | Gateway | Custom claw needed |
64
- | `core/`, `domain/`, `services/` | Business Logic | Custom claw needed |
65
-
66
- If `$ARGUMENTS.claws` is provided, use those specific claws.
67
- Otherwise, auto-detect from project structure.
68
-
69
- ---
70
-
71
- ## Phase 3: Read Requirements
72
-
73
- If `$ARGUMENTS.feature` is a file path, read it.
74
- Otherwise, treat as inline description.
75
-
76
- Read steering documents:
77
- ```bash
78
- cat .buildwright/steering/product.md
79
- cat .buildwright/steering/tech.md
80
- cat .buildwright/steering/naming-conventions.md
81
- ```
82
-
83
- ---
84
-
85
- ## Phase 4: Decompose into Claw Tasks
86
-
87
- Following the Architect persona's decomposition process:
88
-
89
- ### 4.1 Identify Which Domains Are Affected
90
-
91
- Not every feature touches every domain. Determine the minimal set of claws needed.
92
-
93
- ### 4.2 Define Interface Contract
94
-
95
- Before any claw starts, define the contract:
96
-
97
- ```markdown
98
- ## Interface Contract: [Feature Name]
99
-
100
- ### New Fields
101
- | Concept | Database | API (JSON) | UI (JS) |
102
- |---------|----------|------------|---------|
103
- | [field] | [snake_case] | [camelCase] | [camelCase] |
104
-
105
- ### New Endpoints
106
- | Method | Path | Request | Response |
107
- |--------|------|---------|----------|
108
- | [verb] | [path] | [schema] | [schema] |
109
- ```
110
-
111
- ### 4.3 Update Naming Conventions
112
-
113
- Add new fields to `.buildwright/steering/naming-conventions.md`:
114
- - Register all new fields in the Canonical Field Registry
115
- - Register all new endpoints in the Canonical Endpoint Registry
116
-
117
- ### 4.4 Determine Execution Order
118
-
119
- ```
120
- PARALLEL: Claws with no dependencies → run simultaneously
121
- SEQUENTIAL: Claw B depends on Claw A → run A first
122
- MIXED: Some parallel, some sequential
123
- ```
124
-
125
- ### 4.5 Create Claw Task Descriptions
126
-
127
- For each claw, write a specific task:
128
-
129
- ```markdown
130
- ## Claw Task: [Domain] — [Feature]
131
-
132
- ### Context
133
- [What this claw needs to know]
134
-
135
- ### Interface Contract (relevant subset)
136
- [Fields, endpoints, types this claw uses]
137
-
138
- ### Specific Work
139
- 1. [Step 1]
140
- 2. [Step 2]
141
-
142
- ### Acceptance Criteria
143
- - [Criterion 1]
144
- - [Criterion 2]
145
- ```
146
-
147
- ---
148
-
149
- ## Phase 5: Present Decomposition Plan
150
-
151
- ```
152
- ═══════════════════════════════════════════════════════════════
153
- CLAW ARCHITECTURE PLAN
154
- ═══════════════════════════════════════════════════════════════
155
-
156
- Feature: [name]
157
- Claws: [list]
158
- Execution: [PARALLEL / SEQUENTIAL / MIXED]
159
-
160
- INTERFACE CONTRACT
161
- ──────────────────
162
- [fields table]
163
- [endpoints table]
164
-
165
- CLAW TASKS
166
- ──────────
167
- 🗄️ DB Claw: [summary] [parallel/depends on: X]
168
- ⚙️ API Claw: [summary] [parallel/depends on: DB]
169
- 🎨 UI Claw: [summary] [parallel/depends on: API]
170
-
171
- EXECUTION ORDER
172
- ───────────────
173
- [diagram]
174
-
175
- ═══════════════════════════════════════════════════════════════
176
-
177
- Reply "approved" to proceed.
178
- Reply with feedback to revise.
179
- ═══════════════════════════════════════════════════════════════
180
- ```
181
-
182
- **If BUILDWRIGHT_AUTO_APPROVE is not set to `false`:**
183
- - Commit the plan to `docs/specs/[feature]/claw-plan.md`
184
- - Proceed directly to execution
185
-
186
- **If BUILDWRIGHT_AUTO_APPROVE=false:**
187
- - STOP and wait for "approved"
188
-
189
- ---
190
-
191
- ## Phase 6: Execute Claw Tasks
192
-
193
- ### Single-Agent Mode (Default — Claude Code / OpenCode)
194
-
195
- Execute claws sequentially within a single agent session. For each claw:
196
-
197
- 1. **Load claw persona** — Read `.buildwright/claws/[domain].md`
198
- 2. **Scope context** — Read ONLY the claw's domain directories
199
- 3. **Execute** — Follow the claw's process (TDD, implement, verify)
200
- 4. **Record output** — Write claw report to `docs/specs/[feature]/claw-[domain].md`
201
- 5. **Return to Architect** — Load architect persona for next claw or integration
202
-
203
- ```
204
- ARCHITECT: Decompose → Plan
205
- └─ Switch to DB Claw persona
206
- └─ Execute DB work → Report
207
- └─ Switch to API Claw persona
208
- └─ Execute API work → Report
209
- └─ Switch to UI Claw persona
210
- └─ Execute UI work → Report
211
- ARCHITECT: Integrate → Ship
212
- ```
213
-
214
- ### Multi-Agent Mode (OpenClaw / Parallel Terminals)
215
-
216
- For true parallel execution, the Architect outputs instructions for spawning separate agents:
217
-
218
- ```bash
219
- # Claude Code — separate terminal sessions
220
- # Terminal 1: DB Claw
221
- claude "Read .buildwright/claws/database.md and execute: [DB task]"
222
-
223
- # Terminal 2: API Claw (after DB completes if sequential)
224
- claude "Read .buildwright/claws/backend.md and execute: [API task]"
225
-
226
- # Terminal 3: UI Claw
227
- claude "Read .buildwright/claws/frontend.md and execute: [UI task]"
228
- ```
229
-
230
- ```bash
231
- # OpenCode — separate agent sessions
232
- opencode agent run database "[DB task]"
233
- opencode agent run backend "[API task]"
234
- opencode agent run frontend "[UI task]"
235
- ```
236
-
237
- ```
238
- # OpenClaw — agent-to-agent messaging
239
- Send to @database: "[DB task]"
240
- Send to @backend: "[API task]"
241
- Send to @frontend: "[UI task]"
242
- ```
243
-
244
- Write task assignments to `docs/specs/[feature]/claw-tasks.md` for coordination.
245
-
246
- ---
247
-
248
- ## Phase 7: Integration (Architect Resumes)
249
-
250
- After all claws complete, the Architect:
251
-
252
- ### 7.1 Read All Claw Reports
253
- ```bash
254
- cat docs/specs/[feature]/claw-*.md
255
- ```
256
-
257
- ### 7.2 Verify Interface Compliance
258
- - Do the DB columns match the API expectations?
259
- - Do the API responses match the UI expectations?
260
- - Are naming conventions consistent?
261
-
262
- ### 7.3 Run Integration Verification
263
- ```bash
264
- # Full project verification
265
- /bw-verify
266
- ```
267
-
268
- ### 7.4 Fix Integration Issues
269
- If interfaces don't align:
270
- 1. Identify which claw's output is wrong
271
- 2. Fix the integration gap (minimal changes)
272
- 3. Re-verify
273
-
274
- ---
275
-
276
- ## Phase 8: Ship
277
-
278
- Run `/bw-ship` which chains: verify → security → review → release.
279
-
280
- ---
281
-
282
- ## Final Report
283
-
284
- ```
285
- ═══════════════════════════════════════════════════════════════
286
- CLAW ARCHITECTURE COMPLETE
287
- ═══════════════════════════════════════════════════════════════
288
-
289
- Feature: [name]
290
- Branch: feature/[name]
291
- PR: [URL]
292
-
293
- CLAWS EXECUTED
294
- ──────────────
295
- 🗄️ DB Claw: ✅ [summary of changes]
296
- ⚙️ API Claw: ✅ [summary of changes]
297
- 🎨 UI Claw: ✅ [summary of changes]
298
-
299
- INTEGRATION
300
- ───────────
301
- Interface compliance: ✅
302
- Naming conventions: ✅
303
- Integration tests: ✅
304
-
305
- QUALITY GATES
306
- ─────────────
307
- ✅ Verify (typecheck, lint, test, build)
308
- ✅ Security (OWASP, secrets, dependencies)
309
- ✅ Review (Staff Engineer)
310
- ✅ Shipped
311
-
312
- ARTIFACTS
313
- ─────────
314
- • Plan: docs/specs/[feature]/claw-plan.md
315
- • DB Report: docs/specs/[feature]/claw-database.md
316
- • API Report: docs/specs/[feature]/claw-backend.md
317
- • UI Report: docs/specs/[feature]/claw-frontend.md
318
-
319
- ═══════════════════════════════════════════════════════════════
320
- ```
321
-
322
- ---
323
-
324
- ## When NOT to Use /bw-claw
325
-
326
- Use standard `/bw-new-feature` or `/bw-quick` when:
327
- - Feature touches only one domain
328
- - Project has no clear domain separation (monolith)
329
- - Task is small (< 2 hours)
330
- - Changes don't cross layer boundaries
331
-
332
- The overhead of multi-agent coordination isn't worth it for simple tasks. Start with `/bw-quick` or `/bw-new-feature` and escalate to `/bw-claw` when you see cross-domain complexity.
@@ -1,88 +0,0 @@
1
- ---
2
- name: bw-help
3
- description: List all available Buildwright commands
4
- ---
5
-
6
- ## Buildwright Commands
7
-
8
- ```
9
- ╔═══════════════════════════════════════════════════════════════╗
10
- ║ BUILDWRIGHT COMMANDS ║
11
- ╚═══════════════════════════════════════════════════════════════╝
12
-
13
- WORKFLOW
14
- ────────
15
- /bw-new-feature <desc> Full pipeline: research → spec → approve → build → ship
16
- /bw-claw <feature> Multi-agent: architect decomposes → claws execute per domain
17
- /bw-quick <task> Fast path for bug fixes, small tasks, config changes
18
- /bw-ship Quality gates + release: verify → security → review → push → PR
19
- /bw-verify Quick checks: typecheck, lint, test, build
20
- /bw-analyse Analyse codebase: writes stack, architecture, conventions, concerns to .buildwright/codebase/
21
- /bw-plan <question> Research a question, produce a written deliverable — no implementation, no commits
22
- /bw-help Show this command list
23
-
24
- ╔═══════════════════════════════════════════════════════════════╗
25
- ║ QUICK REFERENCE ║
26
- ╚═══════════════════════════════════════════════════════════════╝
27
-
28
- NEW FEATURE (single domain):
29
- /bw-new-feature "Add user authentication"
30
- > [Agent researches, generates spec, validates]
31
- > approved
32
- > [Agent implements and ships]
33
-
34
- CROSS-DOMAIN FEATURE (multi-agent):
35
- /bw-claw "Add profile photo upload"
36
- > [Architect decomposes into claw tasks]
37
- > [DB Claw: migration, API Claw: endpoint, UI Claw: component]
38
- > [Architect integrates and ships]
39
-
40
- BUG FIX (fast path):
41
- /bw-quick "Fix the login timeout bug"
42
- > [Agent fixes, verifies, commits]
43
-
44
- SHIP EXISTING WORK:
45
- /bw-ship "feat(auth): add OAuth2 support"
46
- > [Agent runs verify → security → review → release]
47
-
48
- ╔═══════════════════════════════════════════════════════════════╗
49
- ║ WHEN TO USE WHAT ║
50
- ╚═══════════════════════════════════════════════════════════════╝
51
-
52
- Brownfield, need codebase context → /bw-analyse
53
- Question/analysis, no coding → /bw-plan
54
- Single domain, needs planning → /bw-new-feature
55
- Crosses multiple domains/layers → /bw-claw
56
- Small task, clear scope → /bw-quick
57
- Code ready, need quality gates → /bw-ship
58
- Quick check during development → /bw-verify
59
-
60
- ╔═══════════════════════════════════════════════════════════════╗
61
- ║ CLAW ARCHITECTURE ║
62
- ╚═══════════════════════════════════════════════════════════════╝
63
-
64
- 🧠 Architect (Brain)
65
-
66
- ┌─────────┼─────────┐
67
- │ │ │
68
- 🎨 UI ⚙️ API 🗄️ DB
69
- Claw Claw Claw
70
-
71
- Claws are domain-specialist agents in .buildwright/claws/
72
- Available: frontend.md, backend.md, database.md
73
- Add your own: copy .buildwright/claws/TEMPLATE.md
74
-
75
- ╔═══════════════════════════════════════════════════════════════╗
76
- ║ TIPS ║
77
- ╚═══════════════════════════════════════════════════════════════╝
78
-
79
- • Use /bw-plan for research, analysis, or planning without implementation
80
- • Use /bw-new-feature for anything that needs planning + implementation
81
- • Use /bw-claw when feature crosses domain boundaries
82
- • Use /bw-quick for clear, bounded tasks
83
- • Verify retries 2x automatically; security/review stops immediately
84
- • Say "approved" to proceed after spec/plan review
85
- • Say feedback to revise: "Break milestone 2 into smaller chunks"
86
-
87
- For more details, see BUILDWRIGHT.md
88
- ```