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.
- package/README.md +89 -388
- 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 +8 -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 +18 -25
- 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/src/commands/update.js
CHANGED
|
@@ -16,7 +16,7 @@ const BOLD = '\x1b[1m';
|
|
|
16
16
|
const RESET = '\x1b[0m';
|
|
17
17
|
|
|
18
18
|
const GITHUB_REPO = 'raunakkathuria/buildwright';
|
|
19
|
-
const UPDATE_DIRS = ['commands', 'agents', '
|
|
19
|
+
const UPDATE_DIRS = ['commands', 'agents', 'steering'];
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* Download a URL following redirects. Returns a Buffer.
|
|
@@ -62,26 +62,6 @@ async function downloadAndExtract() {
|
|
|
62
62
|
return { tmpDir, extractedRoot };
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
/**
|
|
66
|
-
* Copy files from src to dest, but only files that exist in src.
|
|
67
|
-
* Files in dest that have no counterpart in src are left untouched.
|
|
68
|
-
*/
|
|
69
|
-
function copyUpstreamOnly(src, dest) {
|
|
70
|
-
for (const entry of fs.readdirSync(src)) {
|
|
71
|
-
const srcEntry = path.join(src, entry);
|
|
72
|
-
const destEntry = path.join(dest, entry);
|
|
73
|
-
const stat = fs.statSync(srcEntry);
|
|
74
|
-
if (stat.isDirectory()) {
|
|
75
|
-
fs.mkdirSync(destEntry, { recursive: true });
|
|
76
|
-
copyUpstreamOnly(srcEntry, destEntry);
|
|
77
|
-
} else {
|
|
78
|
-
if (!fs.existsSync(destEntry)) {
|
|
79
|
-
fs.copyFileSync(srcEntry, destEntry); // only new files
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
65
|
async function update() {
|
|
86
66
|
const cwd = process.cwd();
|
|
87
67
|
|
|
@@ -93,7 +73,7 @@ async function update() {
|
|
|
93
73
|
|
|
94
74
|
console.log(`${BOLD}Updating Buildwright in ${cwd}...${RESET}\n`);
|
|
95
75
|
console.log(`Updating: ${UPDATE_DIRS.map(d => `.buildwright/${d}/`).join(', ')}`);
|
|
96
|
-
console.log(`Preserving:
|
|
76
|
+
console.log(`Preserving: project-created steering files such as tech.md and product.md\n`);
|
|
97
77
|
|
|
98
78
|
let tmpDir;
|
|
99
79
|
try {
|
|
@@ -106,8 +86,8 @@ async function update() {
|
|
|
106
86
|
throw new Error('Downloaded archive is missing .buildwright/ directory');
|
|
107
87
|
}
|
|
108
88
|
|
|
109
|
-
//
|
|
110
|
-
//
|
|
89
|
+
// This version is not backward compatible with the older command model.
|
|
90
|
+
// Update only adds current files; users should re-run init for a clean tree.
|
|
111
91
|
for (const dir of UPDATE_DIRS) {
|
|
112
92
|
const src = path.join(srcBuildwright, dir);
|
|
113
93
|
const dest = path.join(cwd, '.buildwright', dir);
|
|
@@ -115,10 +95,9 @@ async function update() {
|
|
|
115
95
|
console.log(` ${YELLOW}Skipping ${dir}/ (not found in latest release)${RESET}`);
|
|
116
96
|
continue;
|
|
117
97
|
}
|
|
118
|
-
console.log(` Updating .buildwright/${dir}
|
|
98
|
+
console.log(` Updating .buildwright/${dir}/`);
|
|
119
99
|
fs.mkdirSync(dest, { recursive: true });
|
|
120
|
-
|
|
121
|
-
copyUpstreamOnly(src, dest);
|
|
100
|
+
copyDir(src, dest, { skipExisting: dir === 'steering' });
|
|
122
101
|
}
|
|
123
102
|
|
|
124
103
|
// Also add CLAUDE.md if it doesn't already exist locally
|
|
@@ -140,8 +119,8 @@ async function update() {
|
|
|
140
119
|
|
|
141
120
|
console.log('');
|
|
142
121
|
console.log(`${GREEN}${BOLD}Update complete!${RESET}`);
|
|
143
|
-
console.log('commands, agents, and
|
|
144
|
-
console.log('Your custom files
|
|
122
|
+
console.log('commands, agents, and default steering: new files added. Existing files unchanged.');
|
|
123
|
+
console.log('Your custom files are unchanged.\n');
|
|
145
124
|
|
|
146
125
|
} catch (err) {
|
|
147
126
|
console.error(`\nUpdate failed: ${err.message}`);
|
|
@@ -1,53 +1,9 @@
|
|
|
1
1
|
# Agent Personas
|
|
2
2
|
|
|
3
|
-
This directory contains reusable
|
|
3
|
+
This directory contains reusable review personas. They are prompt instructions,
|
|
4
|
+
not separate runtimes.
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
|
8
|
-
|
|
9
|
-
| Architect | `architect.md` | `/bw-claw` | Decomposes cross-domain work, defines interfaces, coordinates claws |
|
|
10
|
-
| Staff Engineer | `staff-engineer.md` | `/bw-new-feature`, `/bw-ship` | Confidence scoring (>=80), HIGH SIGNAL criteria, false-positive exclusions |
|
|
11
|
-
| Security Engineer | `security-engineer.md` | `/bw-ship` | Confidence scoring (>=0.8), exploit scenarios, hard exclusions |
|
|
12
|
-
|
|
13
|
-
## Claw Architecture
|
|
14
|
-
|
|
15
|
-
For domain-specialist agents (claws), see `.buildwright/claws/`.
|
|
16
|
-
|
|
17
|
-
The Architect agent coordinates claws:
|
|
18
|
-
```
|
|
19
|
-
Architect (Brain)
|
|
20
|
-
|
|
|
21
|
-
+---------+---------+
|
|
22
|
-
| | |
|
|
23
|
-
UI Claw API Claw DB Claw
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
## Adding New Agents
|
|
27
|
-
|
|
28
|
-
1. Create a new file: `[role-name].md`
|
|
29
|
-
2. Define:
|
|
30
|
-
- Mindset and expertise
|
|
31
|
-
- What they look for
|
|
32
|
-
- Output format
|
|
33
|
-
- Rules/guidelines
|
|
34
|
-
3. Reference in commands via: `Read and adopt persona from .buildwright/agents/[role-name].md`
|
|
35
|
-
|
|
36
|
-
## Planned Agents (Future)
|
|
37
|
-
|
|
38
|
-
| Agent | Purpose |
|
|
39
|
-
|-------|---------|
|
|
40
|
-
| QA Engineer | Test coverage review, edge case identification |
|
|
41
|
-
| Performance Engineer | Performance review, bottleneck identification |
|
|
42
|
-
| DevOps Engineer | Infrastructure review, deployment concerns |
|
|
43
|
-
| Database Engineer | Schema review, query optimization |
|
|
44
|
-
| UX Engineer | API design review, developer experience |
|
|
45
|
-
| Technical Writer | Documentation quality |
|
|
46
|
-
|
|
47
|
-
## Agent Design Principles
|
|
48
|
-
|
|
49
|
-
1. **Specific expertise** — Each agent has a focused domain
|
|
50
|
-
2. **Consistent output** — Predictable format for parsing/automation
|
|
51
|
-
3. **Actionable feedback** — Problems come with solutions
|
|
52
|
-
4. **Severity levels** — Distinguish blocking from advisory
|
|
53
|
-
5. **Context-aware** — Adapt to project type and risk level
|
|
6
|
+
| Agent | File | Used By | Purpose |
|
|
7
|
+
|-------|------|---------|---------|
|
|
8
|
+
| Staff Engineer | `staff-engineer.md` | `/bw-work`, `/bw-ship` | Spec and code review with confidence scoring and high-signal findings |
|
|
9
|
+
| Security Engineer | `security-engineer.md` | `/bw-work`, `/bw-ship` | OWASP Top 10, secrets, auth, injection, dependency review |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: bw-analyse
|
|
3
|
-
description: Analyse the codebase and write structured docs to .buildwright/codebase/.
|
|
3
|
+
description: Analyse the codebase and write structured docs to .buildwright/codebase/. Creates or updates tech.md with discovered stack and commands.
|
|
4
4
|
allowed-tools:
|
|
5
5
|
- Read
|
|
6
6
|
- Bash
|
|
@@ -12,16 +12,16 @@ allowed-tools:
|
|
|
12
12
|
|
|
13
13
|
<objective>
|
|
14
14
|
Analyse the existing codebase and produce structured reference documents in
|
|
15
|
-
`.buildwright/codebase/`. Then update `.buildwright/steering/tech.md`
|
|
16
|
-
|
|
15
|
+
`.buildwright/codebase/`. Then create or update `.buildwright/steering/tech.md`
|
|
16
|
+
with real project context so future sessions do not rely on detection.
|
|
17
17
|
</objective>
|
|
18
18
|
|
|
19
19
|
<when_to_use>
|
|
20
20
|
Run /bw-analyse when:
|
|
21
21
|
- Starting on an unfamiliar or brownfield codebase
|
|
22
22
|
- .buildwright/codebase/ is missing or stale
|
|
23
|
-
- tech.md
|
|
24
|
-
- Before
|
|
23
|
+
- `.buildwright/steering/tech.md` is missing or stale
|
|
24
|
+
- Before `/bw-work` on an unfamiliar existing project
|
|
25
25
|
|
|
26
26
|
Skip when:
|
|
27
27
|
- Greenfield project with no code yet
|
|
@@ -54,13 +54,12 @@ Skip when:
|
|
|
54
54
|
- Find large files (potential complexity)
|
|
55
55
|
- Note missing tests, security gaps, fragile areas
|
|
56
56
|
- Write `.buildwright/codebase/CONCERNS.md`
|
|
57
|
-
7.
|
|
58
|
-
-
|
|
59
|
-
-
|
|
60
|
-
-
|
|
61
|
-
-
|
|
62
|
-
-
|
|
63
|
-
- Leave ## Project Commands unchanged if already populated; populate if still a placeholder.
|
|
57
|
+
7. Create or update `.buildwright/steering/tech.md` with real content:
|
|
58
|
+
- Stack: discovered languages, runtime, frameworks.
|
|
59
|
+
- Project Commands: typecheck, lint, test, build, and dev commands where available.
|
|
60
|
+
- System layout: 3-5 line summary.
|
|
61
|
+
- Code Patterns: top 3 patterns from CONVENTIONS.md.
|
|
62
|
+
- Dependencies: key packages and their purpose.
|
|
64
63
|
8. Run `scripts/sync-agents.sh` to propagate codebase docs to all tool directories
|
|
65
64
|
9. Commit: `chore: add codebase analysis to .buildwright/codebase/`
|
|
66
65
|
10. Report: list 4 docs with line counts, summarise key findings, suggest next step
|
|
@@ -80,7 +79,7 @@ Note their existence only. Never quote their contents.
|
|
|
80
79
|
|
|
81
80
|
<success_criteria>
|
|
82
81
|
- [ ] .buildwright/codebase/ contains STACK.md, ARCHITECTURE.md, CONVENTIONS.md, CONCERNS.md
|
|
83
|
-
- [ ] tech.md
|
|
82
|
+
- [ ] tech.md exists with real stack and command content
|
|
84
83
|
- [ ] No secrets or credentials in any written file
|
|
85
84
|
- [ ] Changes committed
|
|
86
85
|
</success_criteria>
|
|
@@ -22,8 +22,7 @@ Examples:
|
|
|
22
22
|
- "Produce a static analysis report for this codebase"
|
|
23
23
|
|
|
24
24
|
**Contrast with other commands:**
|
|
25
|
-
- `/bw-
|
|
26
|
-
- `/bw-quick` — implement immediately (no planning doc)
|
|
25
|
+
- `/bw-work` — research + implement + verify + review
|
|
27
26
|
- `/bw-analyse` — analyse this project's own codebase for Buildwright context
|
|
28
27
|
- `/bw-plan` — research a question, write a deliverable, stop there
|
|
29
28
|
|
|
@@ -43,7 +42,7 @@ Examples:
|
|
|
43
42
|
**Structured task file:**
|
|
44
43
|
```
|
|
45
44
|
/bw-plan tasks/flutter-perf-review.md
|
|
46
|
-
/bw-plan
|
|
45
|
+
/bw-plan docs/plans/architecture-review.md
|
|
47
46
|
```
|
|
48
47
|
|
|
49
48
|
---
|
|
@@ -79,7 +78,11 @@ sensible defaults and proceed. Note any assumptions in the deliverable.
|
|
|
79
78
|
|
|
80
79
|
## Phase 3 — Research
|
|
81
80
|
|
|
82
|
-
|
|
81
|
+
Recursively discover and read all `.md` files under `.buildwright/steering/`.
|
|
82
|
+
Read `philosophy.md` first when present because it defines the engineering
|
|
83
|
+
principles that should shape recommendations.
|
|
84
|
+
|
|
85
|
+
**Then, check for pre-analysed codebase docs:**
|
|
83
86
|
|
|
84
87
|
If `.buildwright/codebase/` exists (generated by `/bw-analyse`), read it before scanning files:
|
|
85
88
|
- `STACK.md` — confirmed tech stack for context
|
|
@@ -41,8 +41,10 @@ This command runs the full quality pipeline before shipping.
|
|
|
41
41
|
|
|
42
42
|
## Step 1: Verify (Quick Checks) — Retry up to 2x
|
|
43
43
|
|
|
44
|
-
Before verifying, confirm
|
|
45
|
-
|
|
44
|
+
Before verifying, confirm documentation reflects the changes being shipped.
|
|
45
|
+
Update affected README, docs, command text, API docs, examples, or CHANGELOG.
|
|
46
|
+
If no docs need updating, record why in the final report. Documentation is part
|
|
47
|
+
of done.
|
|
46
48
|
|
|
47
49
|
Run quick verification checks:
|
|
48
50
|
|
|
@@ -227,6 +229,7 @@ If `gh` is not available, provide the PR creation URL.
|
|
|
227
229
|
║ ✅ Verify: PASSED ║
|
|
228
230
|
║ ✅ Security: PASSED ║
|
|
229
231
|
║ ✅ Review: APPROVED ║
|
|
232
|
+
║ ✅ Docs: UPDATED / NOT APPLICABLE ║
|
|
230
233
|
║ ✅ Release: SHIPPED ║
|
|
231
234
|
║ ║
|
|
232
235
|
╠═══════════════════════════════════════════════════════════════╣
|
|
@@ -9,10 +9,10 @@ Running quick verification...
|
|
|
9
9
|
|
|
10
10
|
Follow the Tech Discovery Protocol (see Command Discovery in CLAUDE.md):
|
|
11
11
|
|
|
12
|
-
1. Read `.buildwright/steering/tech.md` — if "Project Commands" has real commands, use them.
|
|
12
|
+
1. Read `.buildwright/steering/tech.md` if it exists — if "Project Commands" has real commands, use them.
|
|
13
13
|
2. Otherwise auto-detect from project files: `package.json`, `Cargo.toml`, `go.mod`, `pyproject.toml`, `Makefile`, etc.
|
|
14
14
|
3. Derive typecheck, lint, test, build commands. Mark as SKIP if a stack has no equivalent.
|
|
15
|
-
4. Write discovered commands to
|
|
15
|
+
4. Write discovered commands to `.buildwright/steering/tech.md` for future runs.
|
|
16
16
|
|
|
17
17
|
---
|
|
18
18
|
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bw-work
|
|
3
|
+
description: Implement bug fixes, refactors, and features with research, Red-Green-Refactor, docs, verification, security review, and code review
|
|
4
|
+
arguments:
|
|
5
|
+
- name: task
|
|
6
|
+
description: What to build, fix, or refactor
|
|
7
|
+
required: true
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# /bw-work
|
|
11
|
+
|
|
12
|
+
Use this for implementation work: bug fixes, refactors, small changes, and new
|
|
13
|
+
features. The command chooses the lightest workflow that still protects quality.
|
|
14
|
+
|
|
15
|
+
## Core Loop
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
Understand -> Research -> Plan if needed -> Red -> Green -> Refactor -> Docs -> Verify -> Security -> Review -> Commit/Ship
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Always recursively discover and read all `.md` files under
|
|
22
|
+
`.buildwright/steering/`. Read `philosophy.md` first when present because it is
|
|
23
|
+
the default baseline. Also recursively read `.buildwright/codebase/*.md` if
|
|
24
|
+
that directory exists.
|
|
25
|
+
|
|
26
|
+
## Phase 1: Understand
|
|
27
|
+
|
|
28
|
+
Parse `$ARGUMENTS.task` and identify:
|
|
29
|
+
- Work type: bug fix, feature, refactor, config/docs change
|
|
30
|
+
- Project state: greenfield or brownfield
|
|
31
|
+
- Scope: small/bounded or larger/unclear
|
|
32
|
+
- User-facing impact and documentation likely affected
|
|
33
|
+
|
|
34
|
+
If no project files exist, ask for product vision and constraints. Create
|
|
35
|
+
`.buildwright/steering/product.md` from the answer and create `tech.md` after
|
|
36
|
+
the stack and commands are chosen.
|
|
37
|
+
|
|
38
|
+
## Phase 2: Command Discovery
|
|
39
|
+
|
|
40
|
+
If `.buildwright/steering/tech.md` exists and has real commands, use them.
|
|
41
|
+
Otherwise auto-detect from project files:
|
|
42
|
+
|
|
43
|
+
- `package.json` -> npm/pnpm/yarn/bun scripts
|
|
44
|
+
- `Cargo.toml` -> cargo
|
|
45
|
+
- `go.mod` -> go
|
|
46
|
+
- `pyproject.toml`, `setup.py`, `requirements.txt` -> Python tooling
|
|
47
|
+
- `Makefile` -> make targets
|
|
48
|
+
|
|
49
|
+
Derive typecheck, lint, test, build, and dev commands. Mark unavailable gates as
|
|
50
|
+
`SKIP`. Write a real `.buildwright/steering/tech.md` so future runs reuse the
|
|
51
|
+
discovery result. If detection is ambiguous, ask for the missing commands.
|
|
52
|
+
|
|
53
|
+
## Phase 3: Research
|
|
54
|
+
|
|
55
|
+
For small, clear tasks, do lightweight research in context:
|
|
56
|
+
- Read only directly relevant source files and tests
|
|
57
|
+
- Reuse existing functions, types, and patterns
|
|
58
|
+
- Check `.buildwright/codebase/CONVENTIONS.md` if present
|
|
59
|
+
|
|
60
|
+
For larger or unclear work, write:
|
|
61
|
+
- `docs/specs/[feature]/research.md`
|
|
62
|
+
- `docs/specs/[feature]/spec.md`
|
|
63
|
+
|
|
64
|
+
The spec must include scope, approach, risks, test strategy, documentation
|
|
65
|
+
impact, and implementation milestones. In interactive mode
|
|
66
|
+
(`BUILDWRIGHT_AUTO_APPROVE=false`), stop for approval before implementation.
|
|
67
|
+
|
|
68
|
+
Cross-domain work still uses a normal spec and implementation plan. Do not use
|
|
69
|
+
legacy multi-agent terminology or domain-specialist personas.
|
|
70
|
+
|
|
71
|
+
## Phase 4: Implement with TDD
|
|
72
|
+
|
|
73
|
+
For every bug fix, behavior change, or feature milestone:
|
|
74
|
+
|
|
75
|
+
### Red
|
|
76
|
+
|
|
77
|
+
Write or update a failing test that describes the bug or expected behavior. Run
|
|
78
|
+
the focused test and confirm it fails for the right reason.
|
|
79
|
+
|
|
80
|
+
### Green
|
|
81
|
+
|
|
82
|
+
Make the smallest implementation that passes the test. Follow existing
|
|
83
|
+
patterns, reuse existing utilities, and avoid speculative abstractions.
|
|
84
|
+
|
|
85
|
+
### Refactor
|
|
86
|
+
|
|
87
|
+
Improve names, structure, duplication, and design while tests stay green. Keep
|
|
88
|
+
the scope tied to the current requirement.
|
|
89
|
+
|
|
90
|
+
## Phase 5: Documentation Check
|
|
91
|
+
|
|
92
|
+
Documentation is part of done. Before verification, update every affected
|
|
93
|
+
user-facing artifact:
|
|
94
|
+
- README or setup docs
|
|
95
|
+
- docs/ guides or API reference
|
|
96
|
+
- command/help text
|
|
97
|
+
- examples
|
|
98
|
+
- CHANGELOG, if the project uses one
|
|
99
|
+
|
|
100
|
+
If no documentation update is needed, record the reason in the final report.
|
|
101
|
+
|
|
102
|
+
## Phase 6: Verify
|
|
103
|
+
|
|
104
|
+
Run the discovered gates:
|
|
105
|
+
1. Typecheck
|
|
106
|
+
2. Lint
|
|
107
|
+
3. Test
|
|
108
|
+
4. Build
|
|
109
|
+
|
|
110
|
+
Skip only gates that are genuinely unavailable for the stack. If a required
|
|
111
|
+
gate fails, fix and retry up to `BUILDWRIGHT_AGENT_RETRIES` times, default 2.
|
|
112
|
+
|
|
113
|
+
## Phase 7: Security Review
|
|
114
|
+
|
|
115
|
+
Adopt `.buildwright/agents/security-engineer.md`. Review the changed diff for:
|
|
116
|
+
- Secrets
|
|
117
|
+
- Dependency vulnerabilities, if tooling exists
|
|
118
|
+
- Input validation and authorization
|
|
119
|
+
- OWASP Top 10 risks
|
|
120
|
+
- Financial-code risks, especially floating point for currency
|
|
121
|
+
|
|
122
|
+
Stop on critical vulnerabilities.
|
|
123
|
+
|
|
124
|
+
## Phase 8: Code Review
|
|
125
|
+
|
|
126
|
+
Adopt `.buildwright/agents/staff-engineer.md`. Review the changed diff for:
|
|
127
|
+
- Logic errors and missed edge cases
|
|
128
|
+
- Error handling
|
|
129
|
+
- Pattern fit and unnecessary complexity
|
|
130
|
+
- Missing tests
|
|
131
|
+
- Missing documentation updates
|
|
132
|
+
|
|
133
|
+
Fix blocking issues before committing.
|
|
134
|
+
|
|
135
|
+
## Phase 9: Commit or Ship
|
|
136
|
+
|
|
137
|
+
Use atomic conventional commits and stage only files changed for this work.
|
|
138
|
+
|
|
139
|
+
For small local work, commit and report the result. For PR-ready work, run
|
|
140
|
+
`/bw-ship` after verification, security, and review have passed.
|
|
141
|
+
|
|
142
|
+
## Final Report
|
|
143
|
+
|
|
144
|
+
Report:
|
|
145
|
+
- Task and work type
|
|
146
|
+
- Files changed
|
|
147
|
+
- Tests and gates run
|
|
148
|
+
- Documentation updated, or why not applicable
|
|
149
|
+
- Commit hash or PR URL if created
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Philosophy
|
|
2
|
+
|
|
3
|
+
Buildwright is a lightweight engineering discipline layer. It is not a
|
|
4
|
+
multi-agent framework.
|
|
5
|
+
|
|
6
|
+
## Principles
|
|
7
|
+
|
|
8
|
+
- **KISS:** Prefer the simplest readable solution that solves the current need.
|
|
9
|
+
- **YAGNI:** Do not add speculative features, extension points, or abstractions.
|
|
10
|
+
- **DRY:** Search for existing functions, types, utilities, and docs before
|
|
11
|
+
creating new ones.
|
|
12
|
+
- **Boring technology:** Prefer proven tools and project-local patterns.
|
|
13
|
+
- **Fail fast:** Validate inputs at boundaries and surface clear errors.
|
|
14
|
+
- **No premature optimization:** Make it correct first; optimize with evidence.
|
|
15
|
+
|
|
16
|
+
## TDD
|
|
17
|
+
|
|
18
|
+
Use Red -> Green -> Refactor for behavior changes.
|
|
19
|
+
|
|
20
|
+
- **Red:** Write a failing test that reproduces the bug or describes expected
|
|
21
|
+
behavior.
|
|
22
|
+
- **Green:** Write the smallest implementation that passes.
|
|
23
|
+
- **Refactor:** Improve names, structure, duplication, and design while tests
|
|
24
|
+
stay green.
|
|
25
|
+
|
|
26
|
+
## Documentation Is Part of Done
|
|
27
|
+
|
|
28
|
+
Every feature, bug fix, behavior change, command change, config change, or
|
|
29
|
+
public workflow change must check documentation before verification.
|
|
30
|
+
|
|
31
|
+
Update affected docs in the same work item: README, docs, command text,
|
|
32
|
+
examples, API docs, changelog, or generated user-facing docs. If no docs need
|
|
33
|
+
updating, state why in the final report.
|
|
34
|
+
|
|
35
|
+
## Financial Code
|
|
36
|
+
|
|
37
|
+
Use Decimal, BigDecimal, integer minor units, or the project-approved money
|
|
38
|
+
type for currency and trading calculations. Never use floating point for money.
|
|
39
|
+
|
|
40
|
+
## Code Standards
|
|
41
|
+
|
|
42
|
+
- Follow existing patterns exactly.
|
|
43
|
+
- Keep files focused and readable.
|
|
44
|
+
- Validate user input.
|
|
45
|
+
- Avoid type-system escape hatches unless the project already requires them.
|
package/templates/BUILDWRIGHT.md
CHANGED
|
@@ -19,13 +19,11 @@ claude
|
|
|
19
19
|
|
|
20
20
|
| Command | Purpose |
|
|
21
21
|
|---------|---------|
|
|
22
|
-
| `/bw-
|
|
23
|
-
| `/bw-
|
|
24
|
-
| `/bw-claw` | Cross-domain features: Architect decomposes → claws execute per domain → integrate → ship |
|
|
22
|
+
| `/bw-plan` | Think/research only; no code changes |
|
|
23
|
+
| `/bw-work` | Implement bug fixes, refactors, and features |
|
|
25
24
|
| `/bw-ship` | Quality gates + release: verify → security → review → push → PR |
|
|
26
25
|
| `/bw-verify` | Quick checks: typecheck, lint, test, build |
|
|
27
26
|
| `/bw-analyse` | Analyse existing codebase → write structured docs to `.buildwright/codebase/` → update tech.md |
|
|
28
|
-
| `/bw-help` | Show available commands |
|
|
29
27
|
|
|
30
28
|
## Environment Variables
|
|
31
29
|
|
|
@@ -96,4 +94,3 @@ Only Critical/High findings block the pipeline. Medium and Low findings are repo
|
|
|
96
94
|
|-------|------|---------|
|
|
97
95
|
| Staff Engineer | `.buildwright/agents/staff-engineer.md` | Spec & code review, confidence scoring (≥80) |
|
|
98
96
|
| Security Engineer | `.buildwright/agents/security-engineer.md` | Security review, exploit scenarios, hard exclusions |
|
|
99
|
-
| Architect | `.buildwright/agents/architect.md` | Claw Architecture — decomposes cross-domain features |
|