buildwright 0.0.3 → 0.0.5
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/package.json +1 -1
- package/src/commands/init.js +8 -4
- package/src/commands/update.js +33 -11
- package/src/utils/copy-files.js +7 -1
- package/templates/.buildwright +1 -0
- package/templates/.env.example +1 -0
- package/templates/.github +1 -0
- package/templates/BUILDWRIGHT.md +1 -99
- package/templates/CLAUDE.md +1 -150
- package/templates/Makefile +1 -82
- package/templates/docs +1 -0
- package/templates/scripts +1 -0
- package/templates/.buildwright/agents/README.md +0 -53
- package/templates/.buildwright/agents/architect.md +0 -143
- package/templates/.buildwright/agents/security-engineer.md +0 -193
- package/templates/.buildwright/agents/staff-engineer.md +0 -134
- 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-analyse.md +0 -82
- package/templates/.buildwright/commands/bw-claw.md +0 -332
- package/templates/.buildwright/commands/bw-help.md +0 -85
- package/templates/.buildwright/commands/bw-new-feature.md +0 -504
- package/templates/.buildwright/commands/bw-quick.md +0 -245
- package/templates/.buildwright/commands/bw-ship.md +0 -288
- package/templates/.buildwright/commands/bw-verify.md +0 -108
- 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 -150
- package/templates/docs/requirements/TEMPLATE.md +0 -33
- package/templates/env.example +0 -11
- package/templates/scripts/bump-version.sh +0 -37
- package/templates/scripts/hooks/post-checkout +0 -24
- package/templates/scripts/hooks/post-merge +0 -14
- package/templates/scripts/hooks/pre-commit +0 -14
- package/templates/scripts/install-hooks.sh +0 -35
- package/templates/scripts/sync-agents.sh +0 -294
- package/templates/scripts/validate-skill.sh +0 -156
|
@@ -1,245 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: bw-quick
|
|
3
|
-
description: Fast path for ad-hoc tasks (bug fixes, small features, config changes) without full planning
|
|
4
|
-
arguments:
|
|
5
|
-
- name: task
|
|
6
|
-
description: What to do (inline description)
|
|
7
|
-
required: true
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
## Quick Mode
|
|
11
|
-
|
|
12
|
-
Fast path for ad-hoc tasks that don't need full planning.
|
|
13
|
-
|
|
14
|
-
**Use for:**
|
|
15
|
-
- Bug fixes
|
|
16
|
-
- Small features (< 2 hours)
|
|
17
|
-
- Config changes
|
|
18
|
-
- One-off tasks
|
|
19
|
-
- Refactors with clear scope
|
|
20
|
-
|
|
21
|
-
**Don't use for:**
|
|
22
|
-
- New features with unclear scope
|
|
23
|
-
- Changes touching multiple systems
|
|
24
|
-
- Anything needing architectural decisions
|
|
25
|
-
|
|
26
|
-
```
|
|
27
|
-
┌─────────────────────────────────────────────────────────────┐
|
|
28
|
-
│ QUICK MODE │
|
|
29
|
-
├─────────────────────────────────────────────────────────────┤
|
|
30
|
-
│ 1. Understand task │
|
|
31
|
-
│ 2. Quick research (relevant files only) │
|
|
32
|
-
│ 3. Implement with TDD │
|
|
33
|
-
│ 4. Verify (typecheck, lint, test, build) │
|
|
34
|
-
│ 5. Commit │
|
|
35
|
-
└─────────────────────────────────────────────────────────────┘
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
---
|
|
39
|
-
|
|
40
|
-
## Step 1: Understand Task
|
|
41
|
-
|
|
42
|
-
**First, run Tech Discovery Protocol** (Command Discovery in CLAUDE.md) to determine the project's
|
|
43
|
-
test, lint, typecheck, and build commands. Cache the result for subsequent steps.
|
|
44
|
-
|
|
45
|
-
If no project files are found (greenfield — no `package.json`, `Cargo.toml`, `go.mod`, etc.),
|
|
46
|
-
ask for the product vision before proceeding. Quick tasks on a blank project need context.
|
|
47
|
-
|
|
48
|
-
Parse: $ARGUMENTS.task
|
|
49
|
-
|
|
50
|
-
Identify:
|
|
51
|
-
- What needs to change
|
|
52
|
-
- Why (bug, feature, refactor)
|
|
53
|
-
- Expected outcome
|
|
54
|
-
- Scope boundaries
|
|
55
|
-
|
|
56
|
-
If scope is unclear or large, recommend:
|
|
57
|
-
```
|
|
58
|
-
This task seems complex. Consider using /bw-new-feature instead for:
|
|
59
|
-
• Proper research phase
|
|
60
|
-
• Technical specification
|
|
61
|
-
• Staff Engineer review
|
|
62
|
-
|
|
63
|
-
Continue with /bw-quick anyway? (say "continue" or use /bw-new-feature)
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
---
|
|
67
|
-
|
|
68
|
-
## Step 2: Quick Research
|
|
69
|
-
|
|
70
|
-
**Lightweight research - only what's needed for this task.**
|
|
71
|
-
|
|
72
|
-
```bash
|
|
73
|
-
# Find directly relevant files
|
|
74
|
-
grep -r "[relevant terms]" --include="*.ts" --include="*.tsx" -l .
|
|
75
|
-
|
|
76
|
-
# Read the specific files that will change
|
|
77
|
-
cat [files to modify]
|
|
78
|
-
|
|
79
|
-
# Check for existing tests
|
|
80
|
-
find . -name "*.test.*" -o -name "*.spec.*" | xargs grep -l "[relevant terms]"
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
Understand:
|
|
84
|
-
- Current implementation
|
|
85
|
-
- Patterns used in these files
|
|
86
|
-
- Related tests
|
|
87
|
-
|
|
88
|
-
**Do NOT write a research document. Keep it in context.**
|
|
89
|
-
|
|
90
|
-
---
|
|
91
|
-
|
|
92
|
-
## Step 3: Implement with TDD
|
|
93
|
-
|
|
94
|
-
### 3.1 Write/Update Tests First
|
|
95
|
-
|
|
96
|
-
If bug fix:
|
|
97
|
-
```bash
|
|
98
|
-
# Write a failing test that reproduces the bug
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
If feature:
|
|
102
|
-
```bash
|
|
103
|
-
# Write tests for the expected behavior
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
Commit: `test: add test for [task]`
|
|
107
|
-
|
|
108
|
-
### 3.2 Implement
|
|
109
|
-
|
|
110
|
-
- Fix the bug / add the feature
|
|
111
|
-
- Follow existing patterns in the file
|
|
112
|
-
- Minimal changes only
|
|
113
|
-
- KISS, YAGNI
|
|
114
|
-
|
|
115
|
-
### 3.3 Update Docs (if applicable)
|
|
116
|
-
|
|
117
|
-
If this task changed anything user-facing, state which doc files need updating
|
|
118
|
-
then update them (README.md, docs/, CHANGELOG.md). Skip for internal-only changes.
|
|
119
|
-
|
|
120
|
-
### 3.4 Verify (with retry)
|
|
121
|
-
|
|
122
|
-
```bash
|
|
123
|
-
# Run project's verification commands
|
|
124
|
-
[typecheck]
|
|
125
|
-
[lint]
|
|
126
|
-
[test]
|
|
127
|
-
[build]
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
- If fails → Fix and retry (up to BUILDWRIGHT_AGENT_RETRIES attempts, default 2)
|
|
131
|
-
- If same error repeats → Not making progress — handle failure (see below)
|
|
132
|
-
- If still failing after retries → Handle failure:
|
|
133
|
-
- **Autonomous** (`BUILDWRIGHT_AUTO_APPROVE=true`, default): Commit completed work, push branch, exit(1). No PR for quick tasks.
|
|
134
|
-
- **Interactive** (`BUILDWRIGHT_AUTO_APPROVE=false`): STOP and report blocker.
|
|
135
|
-
|
|
136
|
-
### 3.5 Commit
|
|
137
|
-
|
|
138
|
-
```bash
|
|
139
|
-
git add [changed files]
|
|
140
|
-
git commit -m "[type]([scope]): [description]"
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
Commit types:
|
|
144
|
-
- `fix:` for bug fixes
|
|
145
|
-
- `feat:` for small features
|
|
146
|
-
- `refactor:` for refactors
|
|
147
|
-
- `chore:` for config/maintenance
|
|
148
|
-
|
|
149
|
-
---
|
|
150
|
-
|
|
151
|
-
## Step 4: Report
|
|
152
|
-
|
|
153
|
-
```
|
|
154
|
-
╔═══════════════════════════════════════════════════════════════╗
|
|
155
|
-
║ QUICK TASK COMPLETE ║
|
|
156
|
-
╠═══════════════════════════════════════════════════════════════╣
|
|
157
|
-
║ ║
|
|
158
|
-
║ Task: [description] ║
|
|
159
|
-
║ Type: [bug fix / feature / refactor / chore] ║
|
|
160
|
-
║ ║
|
|
161
|
-
║ Changes: ║
|
|
162
|
-
║ • [file1]: [what changed] ║
|
|
163
|
-
║ • [file2]: [what changed] ║
|
|
164
|
-
║ ║
|
|
165
|
-
║ Verification: ║
|
|
166
|
-
║ ✅ Type Check ║
|
|
167
|
-
║ ✅ Lint ║
|
|
168
|
-
║ ✅ Tests ║
|
|
169
|
-
║ ✅ Build ║
|
|
170
|
-
║ ║
|
|
171
|
-
║ Commit: [hash] [message] ║
|
|
172
|
-
║ ║
|
|
173
|
-
╠═══════════════════════════════════════════════════════════════╣
|
|
174
|
-
║ ║
|
|
175
|
-
║ Ready to push? Run: git push ║
|
|
176
|
-
║ Or run /bw-ship for full security + code review ║
|
|
177
|
-
║ ║
|
|
178
|
-
╚═══════════════════════════════════════════════════════════════╝
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
---
|
|
182
|
-
|
|
183
|
-
## When to Escalate
|
|
184
|
-
|
|
185
|
-
If during implementation you discover:
|
|
186
|
-
- Task is larger than expected
|
|
187
|
-
- Changes needed in multiple systems
|
|
188
|
-
- Architectural decisions required
|
|
189
|
-
- Unclear requirements
|
|
190
|
-
|
|
191
|
-
**STOP and recommend:**
|
|
192
|
-
|
|
193
|
-
```
|
|
194
|
-
╔═══════════════════════════════════════════════════════════════╗
|
|
195
|
-
║ SCOPE ESCALATION ║
|
|
196
|
-
╠═══════════════════════════════════════════════════════════════╣
|
|
197
|
-
║ ║
|
|
198
|
-
║ This task is more complex than expected: ║
|
|
199
|
-
║ • [Reason 1] ║
|
|
200
|
-
║ • [Reason 2] ║
|
|
201
|
-
║ ║
|
|
202
|
-
║ Recommendation: Use /bw-new-feature for proper planning ║
|
|
203
|
-
║ ║
|
|
204
|
-
║ /bw-new-feature "[task description with discovered context]" ║
|
|
205
|
-
║ ║
|
|
206
|
-
╚═══════════════════════════════════════════════════════════════╝
|
|
207
|
-
```
|
|
208
|
-
|
|
209
|
-
---
|
|
210
|
-
|
|
211
|
-
## Examples
|
|
212
|
-
|
|
213
|
-
### Bug Fix
|
|
214
|
-
```
|
|
215
|
-
/bw-quick "Fix login timeout - session expires after 5 minutes instead of 30"
|
|
216
|
-
```
|
|
217
|
-
|
|
218
|
-
### Small Feature
|
|
219
|
-
```
|
|
220
|
-
/bw-quick "Add loading spinner to the submit button"
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
### Config Change
|
|
224
|
-
```
|
|
225
|
-
/bw-quick "Increase rate limit from 100 to 500 requests per minute"
|
|
226
|
-
```
|
|
227
|
-
|
|
228
|
-
### Refactor
|
|
229
|
-
```
|
|
230
|
-
/bw-quick "Extract the validation logic from UserForm into a separate hook"
|
|
231
|
-
```
|
|
232
|
-
|
|
233
|
-
---
|
|
234
|
-
|
|
235
|
-
## Difference from /bw-new-feature
|
|
236
|
-
|
|
237
|
-
| Aspect | /bw-quick | /bw-new-feature |
|
|
238
|
-
|--------|--------|--------------|
|
|
239
|
-
| Research | Quick (in-context) | Full (research.md) |
|
|
240
|
-
| Spec | None | Full spec.md |
|
|
241
|
-
| Staff Engineer Review | None | Spec + Code |
|
|
242
|
-
| Security Review | Optional (via /bw-ship) | Required |
|
|
243
|
-
| Estimated Time | < 2 hours | Any |
|
|
244
|
-
| Scope | Clear, bounded | Any |
|
|
245
|
-
| Commits | 1-2 | Per milestone |
|
|
@@ -1,288 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: bw-ship
|
|
3
|
-
description: Run full quality pipeline (verify → security → review) then commit, push, and create PR. Fails fast if any step fails.
|
|
4
|
-
arguments:
|
|
5
|
-
- name: message
|
|
6
|
-
description: Commit message (conventional format). Required if there are uncommitted changes.
|
|
7
|
-
required: false
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
## Ship Pipeline
|
|
11
|
-
|
|
12
|
-
This command runs the full quality pipeline before shipping.
|
|
13
|
-
|
|
14
|
-
```
|
|
15
|
-
┌─────────────────────────────────────────────────────────────┐
|
|
16
|
-
│ SHIP PIPELINE │
|
|
17
|
-
├─────────────────────────────────────────────────────────────┤
|
|
18
|
-
│ │
|
|
19
|
-
│ 1. VERIFY (quick checks) ← Retry up to 2x │
|
|
20
|
-
│ └─ typecheck → lint → test → build │
|
|
21
|
-
│ │ │
|
|
22
|
-
│ ▼ PASS? Continue : Retry/STOP │
|
|
23
|
-
│ │
|
|
24
|
-
│ 2. SECURITY (OWASP + SAST) ← No retry │
|
|
25
|
-
│ └─ dependencies → secrets → OWASP scan │
|
|
26
|
-
│ │ │
|
|
27
|
-
│ ▼ PASS? Continue : STOP │
|
|
28
|
-
│ │
|
|
29
|
-
│ 3. REVIEW (Staff Engineer) ← No retry │
|
|
30
|
-
│ └─ logic → errors → patterns → quality │
|
|
31
|
-
│ │ │
|
|
32
|
-
│ ▼ PASS? Continue : STOP │
|
|
33
|
-
│ │
|
|
34
|
-
│ 4. RELEASE │
|
|
35
|
-
│ └─ commit → push → create PR │
|
|
36
|
-
│ │
|
|
37
|
-
└─────────────────────────────────────────────────────────────┘
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
---
|
|
41
|
-
|
|
42
|
-
## Step 1: Verify (Quick Checks) — Retry up to 2x
|
|
43
|
-
|
|
44
|
-
Before verifying, confirm that README.md, docs/, and CHANGELOG.md reflect the
|
|
45
|
-
changes being shipped. Update any that are out of date.
|
|
46
|
-
|
|
47
|
-
Run quick verification checks:
|
|
48
|
-
|
|
49
|
-
```bash
|
|
50
|
-
# Discover and run project commands
|
|
51
|
-
# Type check
|
|
52
|
-
# Lint
|
|
53
|
-
# Test
|
|
54
|
-
# Build
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
**If fails → Fix and retry (up to BUILDWRIGHT_AGENT_RETRIES attempts, default 2).**
|
|
58
|
-
**If same error repeats → Not making progress — handle failure (see below).**
|
|
59
|
-
**If still failing after retries → Handle failure:**
|
|
60
|
-
|
|
61
|
-
- **Autonomous** (`BUILDWRIGHT_AUTO_APPROVE=true`, default): Commit completed work, push branch, create PR with failure summary (see BUILDWRIGHT.md template), exit(1).
|
|
62
|
-
- **Interactive** (`BUILDWRIGHT_AUTO_APPROVE=false`): STOP and report blocker to human.
|
|
63
|
-
|
|
64
|
-
```
|
|
65
|
-
╔═══════════════════════════════════════════════════════════════╗
|
|
66
|
-
║ STEP 1: VERIFY ║
|
|
67
|
-
╠═══════════════════════════════════════════════════════════════╣
|
|
68
|
-
║ Type Check: ✅/❌ ║
|
|
69
|
-
║ Lint: ✅/❌ ║
|
|
70
|
-
║ Tests: ✅/❌ ║
|
|
71
|
-
║ Build: ✅/❌ ║
|
|
72
|
-
╠═══════════════════════════════════════════════════════════════╣
|
|
73
|
-
║ Attempt: [1/2/3] ║
|
|
74
|
-
║ Status: PASS / RETRY / FAIL ║
|
|
75
|
-
╚═══════════════════════════════════════════════════════════════╝
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
If FAIL after retries:
|
|
79
|
-
- **Autonomous**: Commit + push + create failed PR (using BUILDWRIGHT.md template) + exit(1).
|
|
80
|
-
- **Interactive**: Report specific errors and STOP.
|
|
81
|
-
|
|
82
|
-
---
|
|
83
|
-
|
|
84
|
-
## Step 2: Security Review — No retry (needs human judgment)
|
|
85
|
-
|
|
86
|
-
Adopt Security Engineer persona from `.buildwright/agents/security-engineer.md`.
|
|
87
|
-
|
|
88
|
-
### 2.1 Determine Scope
|
|
89
|
-
```bash
|
|
90
|
-
git diff --name-only main...HEAD
|
|
91
|
-
# Or if no main branch:
|
|
92
|
-
git diff --name-only HEAD
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
### 2.2 Automated Scans
|
|
96
|
-
Run tools from the Security Engineer persona's "Tools to Use" section:
|
|
97
|
-
- Dependency vulnerabilities (`npm audit` / `cargo audit` / etc.) — skip gracefully if unavailable
|
|
98
|
-
- Secrets detection (pattern scan for API keys, passwords, tokens, private keys)
|
|
99
|
-
- SAST (`semgrep --config p/owasp-top-ten .` if available)
|
|
100
|
-
|
|
101
|
-
```bash
|
|
102
|
-
# Skip gracefully if tools are unavailable
|
|
103
|
-
[DISCOVERED_AUDIT_COMMAND] 2>/dev/null || echo "Dependency audit not available for this stack"
|
|
104
|
-
semgrep --config p/owasp-top-ten . 2>/dev/null || echo "semgrep not available"
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
Where DISCOVERED_AUDIT_COMMAND is the stack-appropriate audit tool, e.g.:
|
|
108
|
-
`npm audit` | `cargo audit` | `pip-audit` | `bundle audit` | `go list -m -json all | nancy sleuth`
|
|
109
|
-
|
|
110
|
-
### 2.3 Manual Review (Phased)
|
|
111
|
-
|
|
112
|
-
**Phase A — Repository Context:** Understand existing security posture — frameworks, middleware, auth patterns, trust boundaries.
|
|
113
|
-
|
|
114
|
-
**Phase B — Comparative Analysis:** Does new code follow established security patterns? Does it bypass or weaken existing controls?
|
|
115
|
-
|
|
116
|
-
**Phase C — Vulnerability Assessment:** Check changed code against OWASP Top 10 (A01-A10) using the full checklist from the Security Engineer persona.
|
|
117
|
-
|
|
118
|
-
**If CRITICAL vulnerabilities found → No retry. Handle failure:**
|
|
119
|
-
|
|
120
|
-
- **Autonomous** (`BUILDWRIGHT_AUTO_APPROVE=true`, default): Commit completed work, push branch, create PR with failure summary (see BUILDWRIGHT.md template), exit(1).
|
|
121
|
-
- **Interactive** (`BUILDWRIGHT_AUTO_APPROVE=false`): STOP immediately. Security issues require human judgment.
|
|
122
|
-
|
|
123
|
-
```
|
|
124
|
-
╔═══════════════════════════════════════════════════════════════╗
|
|
125
|
-
║ STEP 2: SECURITY ║
|
|
126
|
-
╠═══════════════════════════════════════════════════════════════╣
|
|
127
|
-
║ Dependencies: ✅/❌ ([N] vulnerabilities) ║
|
|
128
|
-
║ Secrets: ✅/❌ ([N] found) ║
|
|
129
|
-
║ OWASP Scan: ✅/❌ ([N] issues) ║
|
|
130
|
-
╠═══════════════════════════════════════════════════════════════╣
|
|
131
|
-
║ Status: SECURE / CRITICAL VULNERABILITIES ║
|
|
132
|
-
╚═══════════════════════════════════════════════════════════════╝
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
If CRITICAL VULNERABILITIES:
|
|
136
|
-
- **Autonomous**: Commit + push + create failed PR (using BUILDWRIGHT.md template) + exit(1).
|
|
137
|
-
- **Interactive**: Report specific issues and STOP.
|
|
138
|
-
|
|
139
|
-
---
|
|
140
|
-
|
|
141
|
-
## Step 3: Code Review — No retry (architectural decisions)
|
|
142
|
-
|
|
143
|
-
Adopt Staff Engineer persona from `.buildwright/agents/staff-engineer.md`.
|
|
144
|
-
|
|
145
|
-
### 3.1 Determine Scope
|
|
146
|
-
```bash
|
|
147
|
-
git diff main...HEAD
|
|
148
|
-
# Or if no main branch:
|
|
149
|
-
git diff HEAD
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
### 3.2 Phased Review
|
|
153
|
-
|
|
154
|
-
**Phase A — Repository Context:** Understand existing patterns, conventions, error handling, and testing approaches.
|
|
155
|
-
|
|
156
|
-
**Phase B — Comparative Analysis:** Does new code follow established patterns? Does it bypass or weaken existing controls?
|
|
157
|
-
|
|
158
|
-
**Phase C — Issue Assessment:** Review changes for real issues. For each: verify it's real, confirm it was INTRODUCED by these changes, assign confidence (only report ≥ 80).
|
|
159
|
-
|
|
160
|
-
Assess against categories from the Staff Engineer persona's "In Code" checklist.
|
|
161
|
-
|
|
162
|
-
**⚠️ APPROVED WITH COMMENTS** → Proceed to release. Fix recommendations if straightforward, otherwise note for follow-up.
|
|
163
|
-
**❌ CHANGES REQUESTED** → No retry. Handle failure:
|
|
164
|
-
|
|
165
|
-
- **Autonomous** (`BUILDWRIGHT_AUTO_APPROVE=true`, default): Commit completed work, push branch, create PR with failure summary (see BUILDWRIGHT.md template), exit(1).
|
|
166
|
-
- **Interactive** (`BUILDWRIGHT_AUTO_APPROVE=false`): STOP immediately. Code review issues often involve architectural decisions that need human input.
|
|
167
|
-
|
|
168
|
-
```
|
|
169
|
-
╔═══════════════════════════════════════════════════════════════╗
|
|
170
|
-
║ STEP 3: CODE REVIEW ║
|
|
171
|
-
╠═══════════════════════════════════════════════════════════════╣
|
|
172
|
-
║ Logic: ✅/❌ ║
|
|
173
|
-
║ Error Handling:✅/❌ ║
|
|
174
|
-
║ Performance: ✅/❌ ║
|
|
175
|
-
║ Maintainability:✅/❌ ║
|
|
176
|
-
╠═══════════════════════════════════════════════════════════════╣
|
|
177
|
-
║ Status: APPROVED / CHANGES REQUESTED ║
|
|
178
|
-
╚═══════════════════════════════════════════════════════════════╝
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
If CHANGES REQUESTED:
|
|
182
|
-
- **Autonomous**: Commit + push + create failed PR (using BUILDWRIGHT.md template) + exit(1).
|
|
183
|
-
- **Interactive**: Report specific issues and STOP.
|
|
184
|
-
|
|
185
|
-
---
|
|
186
|
-
|
|
187
|
-
## Step 4: Release
|
|
188
|
-
|
|
189
|
-
All checks passed. Now ship:
|
|
190
|
-
|
|
191
|
-
### 4.1 Stage Changes
|
|
192
|
-
```bash
|
|
193
|
-
git add [specific files you changed] # NEVER git add -A
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
### 4.2 Commit
|
|
197
|
-
```bash
|
|
198
|
-
# Use provided message or generate from changes
|
|
199
|
-
git commit -m "$ARGUMENTS.message"
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
If no message provided and there are changes, generate a conventional commit message based on the changes.
|
|
203
|
-
|
|
204
|
-
### 4.3 Push
|
|
205
|
-
```bash
|
|
206
|
-
# Push to remote
|
|
207
|
-
git push origin HEAD
|
|
208
|
-
```
|
|
209
|
-
|
|
210
|
-
### 4.4 Create PR
|
|
211
|
-
```bash
|
|
212
|
-
# Create pull request
|
|
213
|
-
gh pr create --fill
|
|
214
|
-
```
|
|
215
|
-
|
|
216
|
-
If `gh` is not available, provide the PR creation URL.
|
|
217
|
-
|
|
218
|
-
---
|
|
219
|
-
|
|
220
|
-
## Final Report
|
|
221
|
-
|
|
222
|
-
```
|
|
223
|
-
╔═══════════════════════════════════════════════════════════════╗
|
|
224
|
-
║ SHIP COMPLETE ║
|
|
225
|
-
╠═══════════════════════════════════════════════════════════════╣
|
|
226
|
-
║ ║
|
|
227
|
-
║ ✅ Verify: PASSED ║
|
|
228
|
-
║ ✅ Security: PASSED ║
|
|
229
|
-
║ ✅ Review: APPROVED ║
|
|
230
|
-
║ ✅ Release: SHIPPED ║
|
|
231
|
-
║ ║
|
|
232
|
-
╠═══════════════════════════════════════════════════════════════╣
|
|
233
|
-
║ Commit: [commit hash] ║
|
|
234
|
-
║ Branch: [branch name] ║
|
|
235
|
-
║ PR: [PR URL] ║
|
|
236
|
-
╠═══════════════════════════════════════════════════════════════╣
|
|
237
|
-
║ ║
|
|
238
|
-
║ Quality gates will run in CI. ║
|
|
239
|
-
║ PR will auto-merge when all gates pass. ║
|
|
240
|
-
║ ║
|
|
241
|
-
╚═══════════════════════════════════════════════════════════════╝
|
|
242
|
-
```
|
|
243
|
-
|
|
244
|
-
---
|
|
245
|
-
|
|
246
|
-
## Failure Handling
|
|
247
|
-
|
|
248
|
-
### Interactive Mode (`BUILDWRIGHT_AUTO_APPROVE=false`)
|
|
249
|
-
|
|
250
|
-
STOP and show the blocker:
|
|
251
|
-
|
|
252
|
-
```
|
|
253
|
-
╔═══════════════════════════════════════════════════════════════╗
|
|
254
|
-
║ SHIP BLOCKED ║
|
|
255
|
-
╠═══════════════════════════════════════════════════════════════╣
|
|
256
|
-
║ ║
|
|
257
|
-
║ ❌ Failed at: [STEP NAME] ║
|
|
258
|
-
║ ║
|
|
259
|
-
║ Reason: ║
|
|
260
|
-
║ [Specific failure details] ║
|
|
261
|
-
║ ║
|
|
262
|
-
║ To fix: ║
|
|
263
|
-
║ [Actionable remediation steps] ║
|
|
264
|
-
║ ║
|
|
265
|
-
║ After fixing, run /bw-ship again. ║
|
|
266
|
-
║ ║
|
|
267
|
-
╚═══════════════════════════════════════════════════════════════╝
|
|
268
|
-
```
|
|
269
|
-
|
|
270
|
-
### Autonomous Mode (`BUILDWRIGHT_AUTO_APPROVE=true`, default)
|
|
271
|
-
|
|
272
|
-
Commit completed work, push, create PR with failure details, and exit(1):
|
|
273
|
-
|
|
274
|
-
1. Stage and commit all completed work to the feature branch
|
|
275
|
-
2. Push branch to remote
|
|
276
|
-
3. Create PR using the failure summary template from BUILDWRIGHT.md
|
|
277
|
-
4. Exit with non-zero code so CI/CD registers the failure
|
|
278
|
-
|
|
279
|
-
The PR title should be prefixed with `[FAILED]` and the body should follow the PR Failure Summary Template documented in BUILDWRIGHT.md.
|
|
280
|
-
|
|
281
|
-
---
|
|
282
|
-
|
|
283
|
-
## Multi-Agent Safety
|
|
284
|
-
|
|
285
|
-
- Only commit files you modified
|
|
286
|
-
- Never use `git stash`
|
|
287
|
-
- Pull before push if needed
|
|
288
|
-
- Use atomic commits
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: bw-verify
|
|
3
|
-
description: Run quick quality checks (typecheck, lint, test, build). For full checks including security and AI review, use /bw-ship.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
Running quick verification...
|
|
7
|
-
|
|
8
|
-
## 1. Discover Project Commands
|
|
9
|
-
|
|
10
|
-
Follow the Tech Discovery Protocol (see Command Discovery in CLAUDE.md):
|
|
11
|
-
|
|
12
|
-
1. Read `.buildwright/steering/tech.md` — if "Project Commands" has real commands, use them.
|
|
13
|
-
2. Otherwise auto-detect from project files: `package.json`, `Cargo.toml`, `go.mod`, `pyproject.toml`, `Makefile`, etc.
|
|
14
|
-
3. Derive typecheck, lint, test, build commands. Mark as SKIP if a stack has no equivalent.
|
|
15
|
-
4. Write discovered commands to `tech.md` for future runs.
|
|
16
|
-
|
|
17
|
-
---
|
|
18
|
-
|
|
19
|
-
## 2. Type Check
|
|
20
|
-
|
|
21
|
-
Run DISCOVERED_TYPECHECK.
|
|
22
|
-
|
|
23
|
-
Examples by runtime (use only what was discovered — do not hardcode):
|
|
24
|
-
- Node/TypeScript: `npx tsc --noEmit` or the project's typecheck script
|
|
25
|
-
- Rust: `cargo check`
|
|
26
|
-
- Go: `go build ./...`
|
|
27
|
-
- Python: `mypy .` or `pyright`
|
|
28
|
-
- Other: SKIP if no type checker exists for this stack
|
|
29
|
-
|
|
30
|
-
**Result:** PASS / FAIL / SKIP
|
|
31
|
-
**Details:** [error count and locations if failed]
|
|
32
|
-
|
|
33
|
-
---
|
|
34
|
-
|
|
35
|
-
## 3. Lint
|
|
36
|
-
|
|
37
|
-
Run DISCOVERED_LINT.
|
|
38
|
-
|
|
39
|
-
Examples by runtime (use only what was discovered):
|
|
40
|
-
- Node/TypeScript: project lint script or `npx eslint .`
|
|
41
|
-
- Rust: `cargo clippy -- -D warnings`
|
|
42
|
-
- Go: `golangci-lint run`
|
|
43
|
-
- Python: `ruff check .` or `flake8`
|
|
44
|
-
- Other: SKIP if no linter configured
|
|
45
|
-
|
|
46
|
-
**Result:** PASS / FAIL / SKIP
|
|
47
|
-
**Details:** [warning/error count]
|
|
48
|
-
|
|
49
|
-
---
|
|
50
|
-
|
|
51
|
-
## 4. Tests
|
|
52
|
-
|
|
53
|
-
Run DISCOVERED_TEST.
|
|
54
|
-
|
|
55
|
-
Examples by runtime (use only what was discovered):
|
|
56
|
-
- Node/TypeScript: project test script or `npx jest`
|
|
57
|
-
- Rust: `cargo test`
|
|
58
|
-
- Go: `go test ./...`
|
|
59
|
-
- Python: `pytest`
|
|
60
|
-
- Other: consult Makefile or CI workflow
|
|
61
|
-
|
|
62
|
-
**Result:** PASS / FAIL
|
|
63
|
-
**Details:** [test count, coverage % if available]
|
|
64
|
-
|
|
65
|
-
---
|
|
66
|
-
|
|
67
|
-
## 5. Build
|
|
68
|
-
|
|
69
|
-
Run DISCOVERED_BUILD.
|
|
70
|
-
|
|
71
|
-
Examples by runtime (use only what was discovered):
|
|
72
|
-
- Node/TypeScript: project build script
|
|
73
|
-
- Rust: `cargo build --release`
|
|
74
|
-
- Go: `go build ./...`
|
|
75
|
-
- Python: SKIP — no build step for interpreted scripts
|
|
76
|
-
- Other: SKIP if this stack has no build step
|
|
77
|
-
|
|
78
|
-
**Result:** PASS / FAIL / SKIP
|
|
79
|
-
**Details:** [any warnings]
|
|
80
|
-
|
|
81
|
-
---
|
|
82
|
-
|
|
83
|
-
## Summary
|
|
84
|
-
|
|
85
|
-
```
|
|
86
|
-
╔═══════════════════════════════════════════════════════════════╗
|
|
87
|
-
║ QUICK VERIFICATION ║
|
|
88
|
-
╠═══════════════════════════════════════════════════════════════╣
|
|
89
|
-
║ Stack detected: [runtime] ║
|
|
90
|
-
║ Commands used: [list of commands actually run] ║
|
|
91
|
-
╠═══════════════════════════════════════════════════════════════╣
|
|
92
|
-
║ Type Check: ✅ PASS / ❌ FAIL / ⏭ SKIP ║
|
|
93
|
-
║ Lint: ✅ PASS / ❌ FAIL / ⏭ SKIP ([N] warnings) ║
|
|
94
|
-
║ Tests: ✅ PASS / ❌ FAIL ([N] tests, [X]% coverage) ║
|
|
95
|
-
║ Build: ✅ PASS / ❌ FAIL / ⏭ SKIP ║
|
|
96
|
-
╠═══════════════════════════════════════════════════════════════╣
|
|
97
|
-
║ Status: PASS / BLOCKED ║
|
|
98
|
-
╚═══════════════════════════════════════════════════════════════╝
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
If BLOCKED: List specific failures with file:line references.
|
|
102
|
-
|
|
103
|
-
---
|
|
104
|
-
|
|
105
|
-
## Next Steps
|
|
106
|
-
|
|
107
|
-
- If PASS: Run `/bw-ship` for full quality pipeline (security + review + release)
|
|
108
|
-
- If BLOCKED: Fix issues and re-run `/bw-verify`
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
# Naming Conventions
|
|
2
|
-
|
|
3
|
-
Shared vocabulary across all agents and claws. When any agent adds a new field, endpoint, or concept, it MUST be registered here so all other agents derive their naming from this registry.
|
|
4
|
-
|
|
5
|
-
## Layer-Specific Naming Rules
|
|
6
|
-
|
|
7
|
-
| Layer | Convention | Example |
|
|
8
|
-
|-------|-----------|---------|
|
|
9
|
-
| Database columns | `snake_case` | `photo_url`, `created_at` |
|
|
10
|
-
| API (JSON keys) | `camelCase` | `photoUrl`, `createdAt` |
|
|
11
|
-
| UI (JavaScript) | `camelCase` | `photoUrl`, `createdAt` |
|
|
12
|
-
| CSS classes | `kebab-case` | `photo-upload`, `member-card` |
|
|
13
|
-
| URL paths | `kebab-case` | `/api/team-members/:id/photo` |
|
|
14
|
-
| Environment vars | `SCREAMING_SNAKE` | `BUILDWRIGHT_AUTO_APPROVE` |
|
|
15
|
-
| File names | `kebab-case` | `photo-upload.tsx`, `team-members.ts` |
|
|
16
|
-
|
|
17
|
-
## Canonical Field Registry
|
|
18
|
-
|
|
19
|
-
Register new fields here when they cross domain boundaries.
|
|
20
|
-
|
|
21
|
-
| Concept | Database | API (JSON) | UI (JS) | Notes |
|
|
22
|
-
|---------|----------|------------|---------|-------|
|
|
23
|
-
| — | `snake_case` | `camelCase` | `camelCase` | Convention |
|
|
24
|
-
<!-- Add new fields below this line -->
|
|
25
|
-
|
|
26
|
-
## Canonical Endpoint Registry
|
|
27
|
-
|
|
28
|
-
Register new endpoints here when they're defined by the Architect.
|
|
29
|
-
|
|
30
|
-
| Purpose | Method | Path | Request Body | Response Body |
|
|
31
|
-
|---------|--------|------|-------------|--------------|
|
|
32
|
-
<!-- Add new endpoints below this line -->
|
|
33
|
-
|
|
34
|
-
## Rules
|
|
35
|
-
|
|
36
|
-
1. **Architect registers first** — Before spawning claws, the Architect adds new fields/endpoints to this file
|
|
37
|
-
2. **Claws derive, never invent** — Each claw looks up naming from this registry, never creates its own
|
|
38
|
-
3. **One source of truth** — If a name isn't here, ask the Architect before proceeding
|
|
39
|
-
4. **No abbreviations** — Use `photo_url` not `pic_url`, `description` not `desc`
|
|
40
|
-
5. **Consistent pluralization** — Collections are plural (`members`), single items are singular (`member`)
|