buildwright 0.0.11 → 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 (37) 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/release.sh +4 -4
  18. package/templates/scripts/sync-agents.sh +24 -27
  19. package/templates/scripts/validate-docs.sh +1 -4
  20. package/templates/.buildwright/agents/architect.md +0 -143
  21. package/templates/.buildwright/claws/README.md +0 -89
  22. package/templates/.buildwright/claws/TEMPLATE.md +0 -71
  23. package/templates/.buildwright/claws/backend.md +0 -114
  24. package/templates/.buildwright/claws/database.md +0 -120
  25. package/templates/.buildwright/claws/devops.md +0 -175
  26. package/templates/.buildwright/claws/frontend.md +0 -111
  27. package/templates/.buildwright/commands/bw-claw.md +0 -332
  28. package/templates/.buildwright/commands/bw-help.md +0 -88
  29. package/templates/.buildwright/commands/bw-new-feature.md +0 -539
  30. package/templates/.buildwright/commands/bw-quick.md +0 -336
  31. package/templates/.buildwright/steering/naming-conventions.md +0 -40
  32. package/templates/.buildwright/steering/product.md +0 -16
  33. package/templates/.buildwright/steering/quality-gates.md +0 -35
  34. package/templates/.buildwright/steering/tech.md +0 -27
  35. package/templates/.buildwright/tasks/TEMPLATE.md +0 -79
  36. package/templates/.github/workflows/quality-gates.yml +0 -135
  37. package/templates/docs/requirements/TEMPLATE.md +0 -33
@@ -1,336 +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. Security (OWASP + secrets + dependencies) │
35
- │ 6. Code Review (Staff Engineer) │
36
- │ 7. Commit │
37
- └─────────────────────────────────────────────────────────────┘
38
- ```
39
-
40
- ---
41
-
42
- ## Step 1: Understand Task
43
-
44
- **First, run Tech Discovery Protocol** (Command Discovery in CLAUDE.md) to determine the project's
45
- test, lint, typecheck, and build commands. Cache the result for subsequent steps.
46
-
47
- If no project files are found (greenfield — no `package.json`, `Cargo.toml`, `go.mod`, etc.),
48
- ask for the product vision before proceeding. Quick tasks on a blank project need context.
49
-
50
- Parse: $ARGUMENTS.task
51
-
52
- Identify:
53
- - What needs to change
54
- - Why (bug, feature, refactor)
55
- - Expected outcome
56
- - Scope boundaries
57
-
58
- If scope is unclear or large, recommend:
59
- ```
60
- This task seems complex. Consider using /bw-new-feature instead for:
61
- • Proper research phase
62
- • Technical specification
63
- • Staff Engineer review
64
-
65
- Continue with /bw-quick anyway? (say "continue" or use /bw-new-feature)
66
- ```
67
-
68
- ---
69
-
70
- ## Step 2: Quick Research
71
-
72
- **Lightweight research - only what's needed for this task.**
73
-
74
- **First, check for pre-analysed codebase docs:**
75
-
76
- ```bash
77
- ls .buildwright/codebase/ 2>/dev/null
78
- ```
79
-
80
- If present, read `CONVENTIONS.md` and `ARCHITECTURE.md` — they give you naming patterns
81
- and layer boundaries without scanning the whole codebase. Check `CONCERNS.md` to avoid
82
- introducing more of the same issues. Then narrow your search to the specific files for
83
- this task.
84
-
85
- ```bash
86
- # Find directly relevant files
87
- grep -r "[relevant terms]" --include="*.ts" --include="*.tsx" -l .
88
-
89
- # Read the specific files that will change
90
- cat [files to modify]
91
-
92
- # Check for existing tests
93
- find . -name "*.test.*" -o -name "*.spec.*" | xargs grep -l "[relevant terms]"
94
- ```
95
-
96
- Understand:
97
- - Current implementation
98
- - Patterns used in these files
99
- - Existing functions, types, and utilities that can be reused instead of reimplemented
100
- - Related tests
101
-
102
- **Do NOT write a research document. Keep it in context.**
103
-
104
- ---
105
-
106
- ## Step 3: Implement with TDD
107
-
108
- ### 3.1 Write/Update Tests First
109
-
110
- If bug fix:
111
- ```bash
112
- # Write a failing test that reproduces the bug
113
- ```
114
-
115
- If feature:
116
- ```bash
117
- # Write tests for the expected behavior
118
- ```
119
-
120
- Commit: `test: add test for [task]`
121
-
122
- ### 3.2 Implement
123
-
124
- - Fix the bug / add the feature
125
- - Follow existing patterns in the file
126
- - Reuse existing functions and types — do NOT reimplement what already exists
127
- - Minimal changes only
128
- - KISS, YAGNI, DRY
129
-
130
- ### 3.3 Update Documentation
131
-
132
- Based on what you just implemented, identify which documentation files are affected and update them.
133
-
134
- Common candidates:
135
- - **README.md** — new behaviour, changed commands, updated flags, usage examples
136
- - **docs/** — any guides or reference covering the changed functionality
137
- - **CHANGELOG.md** — add an entry for any user-facing change
138
-
139
- State up front which files you will update (e.g. "Updating README.md: correcting pipeline steps").
140
- Skip entirely if nothing user-facing changed (internal refactor, test-only changes).
141
-
142
- If docs were updated, commit them separately before the next step:
143
- ```bash
144
- git add [doc files]
145
- git commit -m "docs: update documentation for [task]"
146
- ```
147
-
148
- ### 3.4 Verify (with retry)
149
-
150
- ```bash
151
- # Run project's verification commands
152
- [typecheck]
153
- [lint]
154
- [test]
155
- [build]
156
- ```
157
-
158
- - If fails → Fix and retry (up to BUILDWRIGHT_AGENT_RETRIES attempts, default 2)
159
- - If same error repeats → Not making progress — handle failure (see below)
160
- - If still failing after retries → Handle failure:
161
- - **Autonomous** (`BUILDWRIGHT_AUTO_APPROVE=true`, default): Commit completed work, push branch, exit(1). No PR for quick tasks.
162
- - **Interactive** (`BUILDWRIGHT_AUTO_APPROVE=false`): STOP and report blocker.
163
-
164
- ### 3.5 Security Review
165
-
166
- Adopt Security Engineer persona from `.buildwright/agents/security-engineer.md`.
167
-
168
- Scope: `git diff HEAD` (uncommitted changes only).
169
-
170
- Run automated scans:
171
- - Dependency vulnerabilities (stack-appropriate audit tool) — skip gracefully if unavailable
172
- - Secrets detection (pattern scan for API keys, passwords, tokens, private keys)
173
- - SAST (`semgrep --config p/owasp-top-ten .` if available — skip gracefully if unavailable)
174
-
175
- Then perform manual OWASP Top 10 review of changed files only.
176
-
177
- **If CRITICAL vulnerabilities found → Handle failure:**
178
- - **Autonomous** (`BUILDWRIGHT_AUTO_APPROVE=true`, default): Commit completed work, push branch, exit(1).
179
- - **Interactive** (`BUILDWRIGHT_AUTO_APPROVE=false`): STOP immediately.
180
-
181
- ```
182
- ╔═══════════════════════════════════════════════════════════════╗
183
- ║ SECURITY ║
184
- ╠═══════════════════════════════════════════════════════════════╣
185
- ║ Dependencies: ✅/❌ ([N] vulnerabilities) ║
186
- ║ Secrets: ✅/❌ ([N] found) ║
187
- ║ OWASP Scan: ✅/❌ ([N] issues) ║
188
- ╠═══════════════════════════════════════════════════════════════╣
189
- ║ Status: SECURE / CRITICAL VULNERABILITIES ║
190
- ╚═══════════════════════════════════════════════════════════════╝
191
- ```
192
-
193
- ---
194
-
195
- ### 3.6 Code Review
196
-
197
- Adopt Staff Engineer persona from `.buildwright/agents/staff-engineer.md`.
198
-
199
- Scope: `git diff HEAD` (same diff as security step).
200
-
201
- Review changed code for:
202
- - Logic errors and edge cases
203
- - Error handling completeness
204
- - Missing validation at system boundaries
205
- - Unnecessary complexity introduced
206
-
207
- **If CHANGES REQUESTED → Handle failure:**
208
- - **Autonomous** (`BUILDWRIGHT_AUTO_APPROVE=true`, default): Commit completed work, push branch, exit(1).
209
- - **Interactive** (`BUILDWRIGHT_AUTO_APPROVE=false`): STOP immediately.
210
-
211
- ```
212
- ╔═══════════════════════════════════════════════════════════════╗
213
- ║ CODE REVIEW ║
214
- ╠═══════════════════════════════════════════════════════════════╣
215
- ║ Logic: ✅/❌ ║
216
- ║ Error Handling: ✅/❌ ║
217
- ║ Validation: ✅/❌ ║
218
- ╠═══════════════════════════════════════════════════════════════╣
219
- ║ Status: APPROVED / CHANGES REQUESTED ║
220
- ╚═══════════════════════════════════════════════════════════════╝
221
- ```
222
-
223
- ---
224
-
225
- ### 3.7 Commit
226
-
227
- ```bash
228
- git add [changed files]
229
- git commit -m "[type]([scope]): [description]"
230
- ```
231
-
232
- Commit types:
233
- - `fix:` for bug fixes
234
- - `feat:` for small features
235
- - `refactor:` for refactors
236
- - `chore:` for config/maintenance
237
-
238
- ---
239
-
240
- ## Step 4: Report
241
-
242
- ```
243
- ╔═══════════════════════════════════════════════════════════════╗
244
- ║ QUICK TASK COMPLETE ║
245
- ╠═══════════════════════════════════════════════════════════════╣
246
- ║ ║
247
- ║ Task: [description] ║
248
- ║ Type: [bug fix / feature / refactor / chore] ║
249
- ║ ║
250
- ║ Changes: ║
251
- ║ • [file1]: [what changed] ║
252
- ║ • [file2]: [what changed] ║
253
- ║ ║
254
- ║ Verification: ║
255
- ║ ✅ Type Check ║
256
- ║ ✅ Lint ║
257
- ║ ✅ Tests ║
258
- ║ ✅ Build ║
259
- ║ ✅ Security ║
260
- ║ ✅ Code Review ║
261
- ║ ║
262
- ║ Commit: [hash] [message] ║
263
- ║ ║
264
- ╠═══════════════════════════════════════════════════════════════╣
265
- ║ ║
266
- ║ Ready to push? Run: git push ║
267
- ║ Or run /bw-ship to push + open PR ║
268
- ║ ║
269
- ╚═══════════════════════════════════════════════════════════════╝
270
- ```
271
-
272
- ---
273
-
274
- ## When to Escalate
275
-
276
- If during implementation you discover:
277
- - Task is larger than expected
278
- - Changes needed in multiple systems
279
- - Architectural decisions required
280
- - Unclear requirements
281
-
282
- **STOP and recommend:**
283
-
284
- ```
285
- ╔═══════════════════════════════════════════════════════════════╗
286
- ║ SCOPE ESCALATION ║
287
- ╠═══════════════════════════════════════════════════════════════╣
288
- ║ ║
289
- ║ This task is more complex than expected: ║
290
- ║ • [Reason 1] ║
291
- ║ • [Reason 2] ║
292
- ║ ║
293
- ║ Recommendation: Use /bw-new-feature for proper planning ║
294
- ║ ║
295
- ║ /bw-new-feature "[task description with discovered context]" ║
296
- ║ ║
297
- ╚═══════════════════════════════════════════════════════════════╝
298
- ```
299
-
300
- ---
301
-
302
- ## Examples
303
-
304
- ### Bug Fix
305
- ```
306
- /bw-quick "Fix login timeout - session expires after 5 minutes instead of 30"
307
- ```
308
-
309
- ### Small Feature
310
- ```
311
- /bw-quick "Add loading spinner to the submit button"
312
- ```
313
-
314
- ### Config Change
315
- ```
316
- /bw-quick "Increase rate limit from 100 to 500 requests per minute"
317
- ```
318
-
319
- ### Refactor
320
- ```
321
- /bw-quick "Extract the validation logic from UserForm into a separate hook"
322
- ```
323
-
324
- ---
325
-
326
- ## Difference from /bw-new-feature
327
-
328
- | Aspect | /bw-quick | /bw-new-feature |
329
- |--------|--------|--------------|
330
- | Research | Quick (in-context) | Full (research.md) |
331
- | Spec | None | Full spec.md |
332
- | Staff Engineer Review | Required (diff-scoped) | Spec + Code |
333
- | Security Review | Required (diff-scoped) | Required |
334
- | Estimated Time | < 2 hours | Any |
335
- | Scope | Clear, bounded | Any |
336
- | Commits | 1-2 | Per milestone |
@@ -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`)
@@ -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
- ## Merge Policy
35
- When ALL gates pass → PR is ready for merge (team follows their own merge process)
@@ -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,135 +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