buildwright 0.0.6 → 0.0.8

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "buildwright",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "description": "Agent-first autonomous development workflow. Ship code you don't read.",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -29,7 +29,10 @@ Skip when:
29
29
  </when_to_use>
30
30
 
31
31
  <process>
32
- 1. If `.buildwright/codebase/` already has files, ask: refresh or skip?
32
+ 1. Check `.buildwright/codebase/`:
33
+ - If empty or missing → proceed to Step 2.
34
+ - If it already has files AND `BUILDWRIGHT_AUTO_APPROVE=true` → refresh automatically (overwrite all docs), proceed to Step 2.
35
+ - If it already has files AND `BUILDWRIGHT_AUTO_APPROVE=false` → ask the user: "Codebase docs already exist. Refresh (overwrite) or skip?"
33
36
  2. Create `.buildwright/codebase/` if it does not exist
34
37
  3. Explore and write STACK.md
35
38
  - Read package.json / Cargo.toml / go.mod / pyproject.toml (whichever exists)
@@ -52,11 +55,12 @@ Skip when:
52
55
  - Note missing tests, security gaps, fragile areas
53
56
  - Write `.buildwright/codebase/CONCERNS.md`
54
57
  7. Update `.buildwright/steering/tech.md`:
55
- - Replace placeholder in ## Stack with discovered languages, runtime, frameworks
56
- - Replace placeholder in ## Architecture with 3-5 line summary
57
- - Replace placeholder in ## Code Patterns with top 3 patterns from CONVENTIONS.md
58
- - Replace placeholder in ## Dependencies with key packages and their purpose
59
- - Leave ## Project Commands unchanged if already populated; populate if still placeholder
58
+ - If the file does not exist, create it using the standard template (## Stack, ## Project Commands, ## Architecture, ## Code Patterns, ## Dependencies sections with placeholder values), then proceed.
59
+ - Replace placeholder in ## Stack with discovered languages, runtime, frameworks.
60
+ - Replace placeholder in ## Architecture with 3-5 line summary.
61
+ - Replace placeholder in ## Code Patterns with top 3 patterns from CONVENTIONS.md.
62
+ - Replace placeholder in ## Dependencies with key packages and their purpose.
63
+ - Leave ## Project Commands unchanged if already populated; populate if still a placeholder.
60
64
  8. Run `scripts/sync-agents.sh` to propagate codebase docs to all tool directories
61
65
  9. Commit: `chore: add codebase analysis to .buildwright/codebase/`
62
66
  10. Report: list 4 docs with line counts, summarise key findings, suggest next step
@@ -446,7 +446,7 @@ and update them. Common candidates:
446
446
 
447
447
  - **README.md** — new commands, env vars, setup steps, or usage changed
448
448
  - **docs/** — any guides or API reference covering the changed functionality
449
- - **CHANGELOG.md** — if the project maintains one
449
+ - **CHANGELOG.md** — add an entry for any user-facing change
450
450
 
451
451
  State up front which files you will update (e.g. "Updating README.md: adding env var X").
452
452
  Skip entirely if nothing user-facing changed (internal refactor, test-only changes).
@@ -31,7 +31,9 @@ Fast path for ad-hoc tasks that don't need full planning.
31
31
  │ 2. Quick research (relevant files only) │
32
32
  │ 3. Implement with TDD │
33
33
  │ 4. Verify (typecheck, lint, test, build) │
34
- │ 5. Commit
34
+ │ 5. Security (OWASP + secrets + dependencies)
35
+ │ 6. Code Review (Staff Engineer) │
36
+ │ 7. Commit │
35
37
  └─────────────────────────────────────────────────────────────┘
36
38
  ```
37
39
 
@@ -112,10 +114,23 @@ Commit: `test: add test for [task]`
112
114
  - Minimal changes only
113
115
  - KISS, YAGNI
114
116
 
115
- ### 3.3 Update Docs (if applicable)
117
+ ### 3.3 Update Documentation
116
118
 
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
+ Based on what you just implemented, identify which documentation files are affected and update them.
120
+
121
+ Common candidates:
122
+ - **README.md** — new behaviour, changed commands, updated flags, usage examples
123
+ - **docs/** — any guides or reference covering the changed functionality
124
+ - **CHANGELOG.md** — add an entry for any user-facing change
125
+
126
+ State up front which files you will update (e.g. "Updating README.md: correcting pipeline steps").
127
+ Skip entirely if nothing user-facing changed (internal refactor, test-only changes).
128
+
129
+ If docs were updated, commit them separately before the next step:
130
+ ```bash
131
+ git add [doc files]
132
+ git commit -m "docs: update documentation for [task]"
133
+ ```
119
134
 
120
135
  ### 3.4 Verify (with retry)
121
136
 
@@ -133,7 +148,68 @@ then update them (README.md, docs/, CHANGELOG.md). Skip for internal-only change
133
148
  - **Autonomous** (`BUILDWRIGHT_AUTO_APPROVE=true`, default): Commit completed work, push branch, exit(1). No PR for quick tasks.
134
149
  - **Interactive** (`BUILDWRIGHT_AUTO_APPROVE=false`): STOP and report blocker.
135
150
 
136
- ### 3.5 Commit
151
+ ### 3.5 Security Review
152
+
153
+ Adopt Security Engineer persona from `.buildwright/agents/security-engineer.md`.
154
+
155
+ Scope: `git diff HEAD` (uncommitted changes only).
156
+
157
+ Run automated scans:
158
+ - Dependency vulnerabilities (stack-appropriate audit tool) — skip gracefully if unavailable
159
+ - Secrets detection (pattern scan for API keys, passwords, tokens, private keys)
160
+ - SAST (`semgrep --config p/owasp-top-ten .` if available — skip gracefully if unavailable)
161
+
162
+ Then perform manual OWASP Top 10 review of changed files only.
163
+
164
+ **If CRITICAL vulnerabilities found → Handle failure:**
165
+ - **Autonomous** (`BUILDWRIGHT_AUTO_APPROVE=true`, default): Commit completed work, push branch, exit(1).
166
+ - **Interactive** (`BUILDWRIGHT_AUTO_APPROVE=false`): STOP immediately.
167
+
168
+ ```
169
+ ╔═══════════════════════════════════════════════════════════════╗
170
+ ║ SECURITY ║
171
+ ╠═══════════════════════════════════════════════════════════════╣
172
+ ║ Dependencies: ✅/❌ ([N] vulnerabilities) ║
173
+ ║ Secrets: ✅/❌ ([N] found) ║
174
+ ║ OWASP Scan: ✅/❌ ([N] issues) ║
175
+ ╠═══════════════════════════════════════════════════════════════╣
176
+ ║ Status: SECURE / CRITICAL VULNERABILITIES ║
177
+ ╚═══════════════════════════════════════════════════════════════╝
178
+ ```
179
+
180
+ ---
181
+
182
+ ### 3.6 Code Review
183
+
184
+ Adopt Staff Engineer persona from `.buildwright/agents/staff-engineer.md`.
185
+
186
+ Scope: `git diff HEAD` (same diff as security step).
187
+
188
+ Review changed code for:
189
+ - Logic errors and edge cases
190
+ - Error handling completeness
191
+ - Missing validation at system boundaries
192
+ - Unnecessary complexity introduced
193
+
194
+ **If CHANGES REQUESTED → Handle failure:**
195
+ - **Autonomous** (`BUILDWRIGHT_AUTO_APPROVE=true`, default): Commit completed work, push branch, exit(1).
196
+ - **Interactive** (`BUILDWRIGHT_AUTO_APPROVE=false`): STOP immediately.
197
+
198
+ ```
199
+ ╔═══════════════════════════════════════════════════════════════╗
200
+ ║ CODE REVIEW ║
201
+ ╠═══════════════════════════════════════════════════════════════╣
202
+ ║ Logic: ✅/❌ ║
203
+ ║ Error Handling: ✅/❌ ║
204
+ ║ Validation: ✅/❌ ║
205
+ ╠═══════════════════════════════════════════════════════════════╣
206
+ ║ Status: APPROVED / CHANGES REQUESTED ║
207
+ ╚═══════════════════════════════════════════════════════════════╝
208
+ ```
209
+
210
+ ---
211
+
212
+ ### 3.7 Commit
137
213
 
138
214
  ```bash
139
215
  git add [changed files]
@@ -167,13 +243,15 @@ Commit types:
167
243
  ║ ✅ Lint ║
168
244
  ║ ✅ Tests ║
169
245
  ║ ✅ Build ║
246
+ ║ ✅ Security ║
247
+ ║ ✅ Code Review ║
170
248
  ║ ║
171
249
  ║ Commit: [hash] [message] ║
172
250
  ║ ║
173
251
  ╠═══════════════════════════════════════════════════════════════╣
174
252
  ║ ║
175
253
  ║ Ready to push? Run: git push ║
176
- ║ Or run /bw-ship for full security + code review
254
+ ║ Or run /bw-ship to push + open PR
177
255
  ║ ║
178
256
  ╚═══════════════════════════════════════════════════════════════╝
179
257
  ```
@@ -238,8 +316,8 @@ If during implementation you discover:
238
316
  |--------|--------|--------------|
239
317
  | Research | Quick (in-context) | Full (research.md) |
240
318
  | Spec | None | Full spec.md |
241
- | Staff Engineer Review | None | Spec + Code |
242
- | Security Review | Optional (via /bw-ship) | Required |
319
+ | Staff Engineer Review | Required (diff-scoped) | Spec + Code |
320
+ | Security Review | Required (diff-scoped) | Required |
243
321
  | Estimated Time | < 2 hours | Any |
244
322
  | Scope | Clear, bounded | Any |
245
323
  | Commits | 1-2 | Per milestone |
@@ -96,7 +96,7 @@ If ANY required step fails: fix and retry (max 2 attempts). If same error repeat
96
96
  - Multi-agent safety: NEVER use git stash (other agents may be working)
97
97
  - Only `.buildwright/` is committed — never commit `.claude/` or `.opencode/` content files
98
98
  - After editing any file in `.buildwright/`, run `make sync` before committing
99
- - Before committing, update README.md, docs/, or CHANGELOG.md if the change affects user-facing behavior
99
+ - Before committing, update README.md, SKILL.md, docs/, or CHANGELOG.md if the change affects user-facing behavior
100
100
 
101
101
  ## Cross-Domain Features (Claw Architecture)
102
102
  When a feature touches multiple domains (e.g., DB + API + UI):
@@ -1,4 +1,4 @@
1
- .PHONY: dist clean sync sync-check cursor opencode openclaw validate install-hooks uninstall-hooks bump test-cli
1
+ .PHONY: dist clean sync sync-check cursor opencode openclaw validate install-hooks uninstall-hooks bump release test-cli
2
2
 
3
3
  # ============================================================================
4
4
  # Sync — Generate .claude/, .opencode/, .cursor/rules/ from .buildwright/ (canonical)
@@ -63,10 +63,14 @@ uninstall-hooks:
63
63
  # Clean
64
64
  # ============================================================================
65
65
 
66
- bump: ## Bump version: make bump [BUMP=patch|minor|major]
66
+ bump: ## Bump version files only (no git ops): make bump [BUMP=patch|minor|major]
67
67
  @chmod +x scripts/bump-version.sh
68
68
  @scripts/bump-version.sh $(or $(BUMP),patch)
69
69
 
70
+ release: ## Full release: bump, commit, tag, push, GitHub release, npm publish: make release [BUMP=patch|minor|major]
71
+ @chmod +x scripts/release.sh
72
+ @scripts/release.sh $(or $(BUMP),patch)
73
+
70
74
  test-cli: ## Pack and install CLI globally for local testing
71
75
  @echo "Packing cli/..."
72
76
  @cd cli && npm pack
@@ -29,9 +29,5 @@ make sync
29
29
  echo ""
30
30
  echo "✓ Bumped to v$NEW_VERSION"
31
31
  echo ""
32
- echo "Next steps:"
33
- echo " git add cli/package.json SKILL.md"
34
- echo " git commit -m \"chore: bump version to $NEW_VERSION\""
35
- echo " git tag v$NEW_VERSION"
36
- echo " cd cli && npm publish"
37
- echo " make dist # then upload dist/buildwright/ to clawhub.ai"
32
+ echo "Files updated: cli/package.json SKILL.md"
33
+ echo "Run 'make release' to commit, tag, push, create GitHub release, and npm publish."
@@ -0,0 +1,38 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ BUMP="${1:-patch}"
5
+
6
+ # Guard: working tree must be clean before we start
7
+ if ! git diff --quiet || ! git diff --cached --quiet; then
8
+ echo "Error: working tree has uncommitted changes. Commit or stash before releasing."
9
+ exit 1
10
+ fi
11
+
12
+ # Step 1: bump version files (cli/package.json + SKILL.md + make sync)
13
+ make bump BUMP="$BUMP"
14
+
15
+ # Read new version from the bumped package.json
16
+ NEW_VERSION=$(node -p "require('./cli/package.json').version")
17
+
18
+ # Step 2: commit version files
19
+ git add cli/package.json cli/package-lock.json SKILL.md
20
+ git commit -m "chore: bump version to v$NEW_VERSION"
21
+
22
+ # Step 3: annotated tag
23
+ git tag -a "v$NEW_VERSION" -m "Release v$NEW_VERSION"
24
+
25
+ # Step 4: push commit + tag
26
+ git push
27
+ git push origin "v$NEW_VERSION"
28
+
29
+ # Step 5: GitHub release with auto-generated notes
30
+ gh release create "v$NEW_VERSION" --title "v$NEW_VERSION" --generate-notes
31
+
32
+ # Step 6: publish to npm
33
+ cd cli && npm publish
34
+
35
+ echo ""
36
+ echo "✓ Released v$NEW_VERSION"
37
+ echo " GitHub: https://github.com/$(gh repo view --json nameWithOwner -q .nameWithOwner)/releases/tag/v$NEW_VERSION"
38
+ echo " npm: https://www.npmjs.com/package/buildwright/v/$NEW_VERSION"