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.
Files changed (44) hide show
  1. package/package.json +1 -1
  2. package/src/commands/init.js +8 -4
  3. package/src/commands/update.js +33 -11
  4. package/src/utils/copy-files.js +7 -1
  5. package/templates/.buildwright +1 -0
  6. package/templates/.env.example +1 -0
  7. package/templates/.github +1 -0
  8. package/templates/BUILDWRIGHT.md +1 -99
  9. package/templates/CLAUDE.md +1 -150
  10. package/templates/Makefile +1 -82
  11. package/templates/docs +1 -0
  12. package/templates/scripts +1 -0
  13. package/templates/.buildwright/agents/README.md +0 -53
  14. package/templates/.buildwright/agents/architect.md +0 -143
  15. package/templates/.buildwright/agents/security-engineer.md +0 -193
  16. package/templates/.buildwright/agents/staff-engineer.md +0 -134
  17. package/templates/.buildwright/claws/README.md +0 -89
  18. package/templates/.buildwright/claws/TEMPLATE.md +0 -71
  19. package/templates/.buildwright/claws/backend.md +0 -114
  20. package/templates/.buildwright/claws/database.md +0 -120
  21. package/templates/.buildwright/claws/devops.md +0 -175
  22. package/templates/.buildwright/claws/frontend.md +0 -111
  23. package/templates/.buildwright/commands/bw-analyse.md +0 -82
  24. package/templates/.buildwright/commands/bw-claw.md +0 -332
  25. package/templates/.buildwright/commands/bw-help.md +0 -85
  26. package/templates/.buildwright/commands/bw-new-feature.md +0 -504
  27. package/templates/.buildwright/commands/bw-quick.md +0 -245
  28. package/templates/.buildwright/commands/bw-ship.md +0 -288
  29. package/templates/.buildwright/commands/bw-verify.md +0 -108
  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 -150
  36. package/templates/docs/requirements/TEMPLATE.md +0 -33
  37. package/templates/env.example +0 -11
  38. package/templates/scripts/bump-version.sh +0 -37
  39. package/templates/scripts/hooks/post-checkout +0 -24
  40. package/templates/scripts/hooks/post-merge +0 -14
  41. package/templates/scripts/hooks/pre-commit +0 -14
  42. package/templates/scripts/install-hooks.sh +0 -35
  43. package/templates/scripts/sync-agents.sh +0 -294
  44. package/templates/scripts/validate-skill.sh +0 -156
@@ -1,16 +0,0 @@
1
- # Product Context
2
-
3
- ## What We're Building
4
- [Describe your product/project here]
5
-
6
- ## Key Features
7
- [List main features]
8
-
9
- ## User Personas
10
- [Describe target users]
11
-
12
- ## Business Constraints
13
- [Timeline, compliance, integrations]
14
-
15
- ## Current Focus
16
- [What's being worked on now]
@@ -1,35 +0,0 @@
1
- # Quality Gates
2
-
3
- These automated gates replace human code review. ALL must pass for merge.
4
-
5
- ## Gate 1: Static Analysis
6
- - [ ] Type check passes (zero errors)
7
- - [ ] Lint passes (zero errors, warnings acceptable)
8
- - [ ] No new lint warnings introduced
9
-
10
- ## Gate 2: Tests
11
- - [ ] All existing tests pass
12
- - [ ] New code has tests
13
- - [ ] Coverage does not decrease
14
- - [ ] Critical paths have >80% coverage
15
-
16
- ## Gate 3: Security
17
- - [ ] No high/critical vulnerabilities in dependencies
18
- - [ ] No secrets in code
19
- - [ ] SAST scan passes (if configured)
20
-
21
- ## Gate 4: Build
22
- - [ ] Production build succeeds
23
- - [ ] No build warnings
24
-
25
- ## Gate 5: AI Review (Optional)
26
- - [ ] No blocking issues from AI reviewer
27
-
28
- ## Financial/Trading Code (Additional)
29
- - [ ] No floating-point for currency
30
- - [ ] All inputs validated
31
- - [ ] Rate limiting on sensitive endpoints
32
- - [ ] Audit logging for transactions
33
-
34
- ## Auto-Merge Criteria
35
- When ALL gates pass → PR auto-merges → Deploy triggers
@@ -1,27 +0,0 @@
1
- # Technical Context
2
-
3
- ## Stack
4
- [List your tech stack]
5
-
6
- ## Project Commands
7
-
8
- Fill in these slots with your project's actual commands. If left empty, Buildwright
9
- auto-detects from project files (package.json, Cargo.toml, go.mod, pyproject.toml,
10
- Makefile) and populates this section on the first run.
11
-
12
- ```
13
- typecheck: [command] # Examples: npx tsc --noEmit | cargo check | go build ./... | mypy .
14
- lint: [command] # Examples: npx eslint . | cargo clippy | golangci-lint run | ruff check .
15
- test: [command] # Examples: npm test | cargo test | go test ./... | pytest
16
- build: [command] # Examples: npm run build | cargo build --release | go build ./...
17
- dev: [command] # Examples: npm run dev | cargo run | go run ./... | uvicorn app:main
18
- ```
19
-
20
- ## Architecture
21
- [High-level architecture notes]
22
-
23
- ## Code Patterns
24
- [Patterns used in this codebase]
25
-
26
- ## Dependencies
27
- [Key dependencies and why]
@@ -1,79 +0,0 @@
1
- # Task: [Feature Name]
2
-
3
- ## Quick Reference
4
- - **Status**: DRAFTING | SPEC_REVIEW | IMPLEMENTING | CODE_REVIEW | COMPLETE | BLOCKED
5
- - **Branch**: feature/[name]
6
- - **Spec**: docs/specs/[name]/spec.md
7
- - **Current Owner**: [agent-role or "unassigned"]
8
-
9
- ---
10
-
11
- ## Status: DRAFTING
12
-
13
- ## Branch: feature/[name]
14
-
15
- ## Current Owner: unassigned
16
-
17
- ---
18
-
19
- ## Phases
20
-
21
- ### Phase 1: Specification
22
- | Field | Value |
23
- |-------|-------|
24
- | Owner | architect-agent |
25
- | Status | ⏳ PENDING |
26
- | Output | docs/specs/[name]/spec.md |
27
- | Started | - |
28
- | Completed | - |
29
-
30
- ### Phase 2: Implementation
31
- | Field | Value |
32
- |-------|-------|
33
- | Owner | implementer-agent |
34
- | Status | ⏳ WAITING |
35
- | Branch | feature/[name] |
36
- | Started | - |
37
- | Completed | - |
38
-
39
- **Milestones**:
40
- - [ ] Milestone 1: [description]
41
- - [ ] Milestone 2: [description]
42
- - [ ] Milestone 3: [description]
43
-
44
- ### Phase 3: Review & Ship
45
- | Field | Value |
46
- |-------|-------|
47
- | Owner | reviewer-agent |
48
- | Status | ⏳ WAITING |
49
- | PR | - |
50
- | Started | - |
51
- | Completed | - |
52
-
53
- ---
54
-
55
- ## Context for Next Agent
56
-
57
- ### Decisions Made
58
- -
59
-
60
- ### Key Files Modified
61
- -
62
-
63
- ### Known Issues / TODOs
64
- -
65
-
66
- ### Test Commands
67
- ```bash
68
- npm run test
69
- ```
70
-
71
- ---
72
-
73
- ## Blockers
74
- None currently.
75
-
76
- ---
77
-
78
- ## Communication Log
79
- - [timestamp] [agent]: Starting work
@@ -1,150 +0,0 @@
1
- name: Quality Gates
2
-
3
- on:
4
- pull_request:
5
- branches: [main, master]
6
- push:
7
- branches: [main, master]
8
-
9
- jobs:
10
- quality:
11
- runs-on: ubuntu-latest
12
- steps:
13
- - uses: actions/checkout@v4
14
-
15
- # Verify sync script runs without errors (catches broken scripts or missing deps)
16
- - name: Verify sync script
17
- run: make sync
18
-
19
- # Detect package manager and project type
20
- - name: Detect project type
21
- id: detect
22
- run: |
23
- if [ -f "package.json" ]; then
24
- echo "type=node" >> $GITHUB_OUTPUT
25
- if [ -f "pnpm-lock.yaml" ]; then
26
- echo "pm=pnpm" >> $GITHUB_OUTPUT
27
- elif [ -f "yarn.lock" ]; then
28
- echo "pm=yarn" >> $GITHUB_OUTPUT
29
- elif [ -f "bun.lockb" ]; then
30
- echo "pm=bun" >> $GITHUB_OUTPUT
31
- else
32
- echo "pm=npm" >> $GITHUB_OUTPUT
33
- fi
34
- elif [ -f "Cargo.toml" ]; then
35
- echo "type=rust" >> $GITHUB_OUTPUT
36
- elif [ -f "go.mod" ]; then
37
- echo "type=go" >> $GITHUB_OUTPUT
38
- elif [ -f "pyproject.toml" ] || [ -f "setup.py" ]; then
39
- echo "type=python" >> $GITHUB_OUTPUT
40
- fi
41
-
42
- # Node.js setup
43
- - name: Setup Node.js
44
- if: steps.detect.outputs.type == 'node'
45
- uses: actions/setup-node@v4
46
- with:
47
- node-version: '20'
48
-
49
- - name: Setup pnpm
50
- if: steps.detect.outputs.pm == 'pnpm'
51
- uses: pnpm/action-setup@v2
52
- with:
53
- version: 8
54
-
55
- - name: Install dependencies (Node)
56
- if: steps.detect.outputs.type == 'node'
57
- run: |
58
- case "${{ steps.detect.outputs.pm }}" in
59
- pnpm) pnpm install --frozen-lockfile ;;
60
- yarn) yarn install --frozen-lockfile ;;
61
- bun) bun install ;;
62
- *) npm ci ;;
63
- esac
64
-
65
- # Rust setup
66
- - name: Setup Rust
67
- if: steps.detect.outputs.type == 'rust'
68
- uses: dtolnay/rust-toolchain@stable
69
- with:
70
- components: clippy
71
-
72
- # Go setup
73
- - name: Setup Go
74
- if: steps.detect.outputs.type == 'go'
75
- uses: actions/setup-go@v5
76
- with:
77
- go-version: '1.21'
78
-
79
- # Python setup
80
- - name: Setup Python
81
- if: steps.detect.outputs.type == 'python'
82
- uses: actions/setup-python@v5
83
- with:
84
- python-version: '3.11'
85
-
86
- - name: Install dependencies (Python)
87
- if: steps.detect.outputs.type == 'python'
88
- run: |
89
- pip install -e ".[dev]" || pip install -r requirements.txt
90
-
91
- # Quality checks
92
- - name: Type Check
93
- run: |
94
- case "${{ steps.detect.outputs.type }}" in
95
- node) ${{ steps.detect.outputs.pm }} run typecheck || npx tsc --noEmit ;;
96
- rust) cargo check ;;
97
- go) go build ./... ;;
98
- python) mypy . || pyright || echo "No type checker configured" ;;
99
- esac
100
-
101
- - name: Lint
102
- run: |
103
- case "${{ steps.detect.outputs.type }}" in
104
- node) ${{ steps.detect.outputs.pm }} run lint || npx eslint . ;;
105
- rust) cargo clippy -- -D warnings ;;
106
- go) golangci-lint run || echo "golangci-lint not installed" ;;
107
- python) ruff check . || flake8 ;;
108
- esac
109
-
110
- - name: Test
111
- run: |
112
- case "${{ steps.detect.outputs.type }}" in
113
- node) ${{ steps.detect.outputs.pm }} test ;;
114
- rust) cargo test ;;
115
- go) go test ./... ;;
116
- python) pytest ;;
117
- esac
118
-
119
- - name: Build
120
- run: |
121
- case "${{ steps.detect.outputs.type }}" in
122
- node) ${{ steps.detect.outputs.pm }} run build ;;
123
- rust) cargo build --release ;;
124
- go) go build ./... ;;
125
- python) echo "No build step" ;;
126
- esac
127
-
128
- - name: Security Audit
129
- run: |
130
- case "${{ steps.detect.outputs.type }}" in
131
- node) ${{ steps.detect.outputs.pm }} audit --audit-level=high || true ;;
132
- rust) cargo audit || echo "cargo-audit not installed" ;;
133
- go) govulncheck ./... || echo "govulncheck not installed" ;;
134
- python) pip-audit || safety check || echo "No Python audit tool" ;;
135
- esac
136
-
137
- auto-merge:
138
- needs: quality
139
- runs-on: ubuntu-latest
140
- if: github.event_name == 'pull_request'
141
- permissions:
142
- contents: write
143
- pull-requests: write
144
- steps:
145
- - name: Auto-merge on quality pass
146
- uses: pascalgn/automerge-action@v0.15.6
147
- env:
148
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
149
- MERGE_METHOD: squash
150
- MERGE_LABELS: ""
@@ -1,33 +0,0 @@
1
- # Feature: [Name]
2
-
3
- ## Problem Statement
4
- [What problem are we solving? Who has this problem?]
5
-
6
- ## Success Metrics
7
- - [Metric]: [Target]
8
-
9
- ## User Stories
10
- As a [role], I want [capability] so that [benefit].
11
-
12
- ## Functional Requirements
13
-
14
- ### Must Have (MVP)
15
- 1. [Requirement]
16
- - Acceptance: [Criteria]
17
-
18
- ### Should Have
19
- 1. [Requirement]
20
-
21
- ### Out of Scope
22
- - [What NOT to build]
23
-
24
- ## Constraints
25
- - Timeline: [Deadline]
26
- - Technical: [Integrations, platforms]
27
- - Regulatory: [Compliance]
28
-
29
- ## Examples / Edge Cases
30
- 1. [Scenario]: [Expected behavior]
31
-
32
- ## Open Questions
33
- [Questions needing answers]
@@ -1,11 +0,0 @@
1
- # Buildwright Environment Variables
2
- # Copy to .env or export in your shell: source .env.example
3
-
4
- # Autonomous mode — skip human approval, fail gracefully on errors
5
- # true (default): Pipeline runs fully autonomous. Failures commit + push + create failed PR + exit(1).
6
- # false: Pipeline stops on failure and waits for human input.
7
- BUILDWRIGHT_AUTO_APPROVE=true
8
-
9
- # Number of verify retries (typecheck, lint, test, build) before giving up
10
- # Default: 2
11
- BUILDWRIGHT_AGENT_RETRIES=2
@@ -1,37 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
-
4
- # npm versions that are reserved/broken and must never be published
5
- BLOCKED_VERSIONS=("1.0.0" "1.0.1" "1.0.2")
6
-
7
- BUMP="${1:-patch}" # patch | minor | major
8
-
9
- # 1. Bump cli/package.json (no git tag yet)
10
- cd cli
11
- npm version "$BUMP" --no-git-tag-version
12
- NEW_VERSION=$(node -p "require('./package.json').version")
13
-
14
- # 2. Check if new version is blocked — if so, keep patching until clear
15
- while printf '%s\n' "${BLOCKED_VERSIONS[@]}" | grep -qx "$NEW_VERSION"; do
16
- echo "⚠️ Version $NEW_VERSION is reserved on npm — skipping to next patch..."
17
- npm version patch --no-git-tag-version
18
- NEW_VERSION=$(node -p "require('./package.json').version")
19
- done
20
- cd ..
21
-
22
- # 3. Update SKILL.md frontmatter
23
- sed -i.bak "s/^ version: \".*\"/ version: \"$NEW_VERSION\"/" SKILL.md
24
- rm -f SKILL.md.bak
25
-
26
- # 4. Sync dist/
27
- make sync
28
-
29
- echo ""
30
- echo "✓ Bumped to v$NEW_VERSION"
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"
@@ -1,24 +0,0 @@
1
- #!/bin/bash
2
- # Buildwright post-checkout hook
3
- # Runs after git checkout.
4
- # $1 = previous HEAD, $2 = new HEAD, $3 = 1 (branch switch) or 0 (file checkout)
5
- # Only acts on branch switches ($3 == 1) where .buildwright/ content differs.
6
-
7
- set -e
8
-
9
- PREV_HEAD="$1"
10
- NEW_HEAD="$2"
11
- BRANCH_SWITCH="$3"
12
-
13
- # Skip file-level checkouts
14
- if [ "$BRANCH_SWITCH" != "1" ]; then
15
- exit 0
16
- fi
17
-
18
- if git diff --name-only "$PREV_HEAD" "$NEW_HEAD" 2>/dev/null | grep -q '^\.buildwright/'; then
19
- echo "Buildwright: .buildwright/ differs between branches — running make sync..."
20
- make sync
21
- echo "Buildwright: sync complete."
22
- fi
23
-
24
- exit 0
@@ -1,14 +0,0 @@
1
- #!/bin/bash
2
- # Buildwright post-merge hook
3
- # Runs after git pull / git merge.
4
- # If any file under .buildwright/ changed in the merge, run make sync automatically.
5
-
6
- set -e
7
-
8
- if git diff --name-only ORIG_HEAD HEAD 2>/dev/null | grep -q '^\.buildwright/'; then
9
- echo "Buildwright: .buildwright/ changed in merge — running make sync..."
10
- make sync
11
- echo "Buildwright: sync complete."
12
- fi
13
-
14
- exit 0
@@ -1,14 +0,0 @@
1
- #!/bin/bash
2
- # Buildwright pre-commit hook
3
- # If any staged file is under .buildwright/, run make sync before committing.
4
- # Never blocks the commit — sync is a convenience to keep generated files current.
5
-
6
- set -e
7
-
8
- if git diff --cached --name-only | grep -q '^\.buildwright/'; then
9
- echo "Buildwright: .buildwright/ changes detected — running make sync..."
10
- make sync
11
- echo "Buildwright: sync complete."
12
- fi
13
-
14
- exit 0
@@ -1,35 +0,0 @@
1
- #!/bin/bash
2
- # Buildwright hook installer
3
- # Copies scripts/hooks/* to .git/hooks/ and makes them executable.
4
- # Idempotent — safe to run multiple times.
5
-
6
- set -e
7
-
8
- if ! git rev-parse --show-toplevel >/dev/null 2>&1; then
9
- echo "Not inside a git repository — skipping hook installation."
10
- echo "Run 'git init && make install-hooks' to enable auto-sync hooks."
11
- exit 0
12
- fi
13
-
14
- HOOKS_SRC="$(cd "$(dirname "$0")/hooks" && pwd)"
15
- HOOKS_DEST="$(git rev-parse --show-toplevel)/.git/hooks"
16
-
17
- if [ ! -d "$HOOKS_SRC" ]; then
18
- echo "Error: hooks source directory not found at $HOOKS_SRC" >&2
19
- exit 1
20
- fi
21
-
22
- if [ ! -d "$HOOKS_DEST" ]; then
23
- echo "Error: .git/hooks directory not found. Are you inside a git repo?" >&2
24
- exit 1
25
- fi
26
-
27
- for hook in "$HOOKS_SRC"/*; do
28
- name="$(basename "$hook")"
29
- dest="$HOOKS_DEST/$name"
30
- cp "$hook" "$dest"
31
- chmod +x "$dest"
32
- echo " Installed: .git/hooks/$name"
33
- done
34
-
35
- echo "Buildwright hooks installed successfully."