create-qa-architect 5.6.1 → 5.8.0
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/.github/workflows/quality.yml +82 -6
- package/docs/MIGRATION-5.8.0.md +157 -0
- package/docs/OPTIMAL_QUALITY_STRATEGY.md +421 -0
- package/docs/QUALITY_AUTOMATION_ANALYSIS.md +339 -0
- package/docs/SIMPLE_STRATEGY.md +48 -0
- package/docs/TESTING_AND_REVIEW_FLOW.md +364 -0
- package/lib/smart-strategy-generator.js +37 -0
- package/lib/workflow-config.js +4 -2
- package/package.json +1 -1
|
@@ -70,7 +70,7 @@ jobs:
|
|
|
70
70
|
id: detect
|
|
71
71
|
run: |
|
|
72
72
|
# Use the project maturity detector
|
|
73
|
-
node
|
|
73
|
+
node lib/project-maturity.js --github-actions >> $GITHUB_OUTPUT
|
|
74
74
|
|
|
75
75
|
- name: Display Detection Report
|
|
76
76
|
run: |
|
|
@@ -402,11 +402,33 @@ jobs:
|
|
|
402
402
|
|
|
403
403
|
- name: Lighthouse CI
|
|
404
404
|
if: hashFiles('.lighthouserc.js', '.lighthouserc.json', 'lighthouserc.js') != ''
|
|
405
|
+
id: lighthouse
|
|
405
406
|
run: |
|
|
406
407
|
echo "🚢 Running Lighthouse CI..."
|
|
407
408
|
npx lhci autorun
|
|
408
409
|
continue-on-error: true
|
|
409
410
|
|
|
411
|
+
- name: Report Lighthouse Failures
|
|
412
|
+
if: steps.lighthouse.outcome == 'failure'
|
|
413
|
+
env:
|
|
414
|
+
MATURITY: ${{ needs.detect-maturity.outputs.maturity }}
|
|
415
|
+
run: |
|
|
416
|
+
echo "::error::Lighthouse CI failed - performance budgets or quality thresholds violated"
|
|
417
|
+
echo "Review the Lighthouse report to see which metrics failed."
|
|
418
|
+
echo "Common failures: performance score, accessibility issues, SEO problems"
|
|
419
|
+
|
|
420
|
+
# Add to job summary for visibility
|
|
421
|
+
echo "## ⚠️ Lighthouse CI Failed" >> $GITHUB_STEP_SUMMARY
|
|
422
|
+
echo "Performance budgets or quality thresholds were violated." >> $GITHUB_STEP_SUMMARY
|
|
423
|
+
echo "This is currently a soft failure (continue-on-error: true)." >> $GITHUB_STEP_SUMMARY
|
|
424
|
+
echo "Review the Lighthouse report in the Actions logs above." >> $GITHUB_STEP_SUMMARY
|
|
425
|
+
|
|
426
|
+
# Fail build for production-ready projects
|
|
427
|
+
if [ "$MATURITY" == "production-ready" ]; then
|
|
428
|
+
echo "::error::Production-ready projects must pass Lighthouse CI checks"
|
|
429
|
+
exit 1
|
|
430
|
+
fi
|
|
431
|
+
|
|
410
432
|
# Step 7: Summary - report what checks ran
|
|
411
433
|
summary:
|
|
412
434
|
runs-on: ubuntu-latest
|
|
@@ -421,6 +443,12 @@ jobs:
|
|
|
421
443
|
|
|
422
444
|
steps:
|
|
423
445
|
- name: Generate Check Summary
|
|
446
|
+
env:
|
|
447
|
+
CORE_RESULT: ${{ needs.core-checks.result }}
|
|
448
|
+
LINTING_RESULT: ${{ needs.linting.result }}
|
|
449
|
+
SECURITY_RESULT: ${{ needs.security.result }}
|
|
450
|
+
TESTS_RESULT: ${{ needs.tests.result }}
|
|
451
|
+
DOCS_RESULT: ${{ needs.documentation.result }}
|
|
424
452
|
run: |
|
|
425
453
|
echo "## Quality Checks Summary 📊" >> $GITHUB_STEP_SUMMARY
|
|
426
454
|
echo "" >> $GITHUB_STEP_SUMMARY
|
|
@@ -433,11 +461,59 @@ jobs:
|
|
|
433
461
|
echo "- Has documentation: ${{ needs.detect-maturity.outputs.has-docs }}" >> $GITHUB_STEP_SUMMARY
|
|
434
462
|
echo "" >> $GITHUB_STEP_SUMMARY
|
|
435
463
|
echo "### Checks Executed" >> $GITHUB_STEP_SUMMARY
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
464
|
+
|
|
465
|
+
# Core checks
|
|
466
|
+
if [ "$CORE_RESULT" == "success" ]; then
|
|
467
|
+
echo "- ✅ Core checks: Passed" >> $GITHUB_STEP_SUMMARY
|
|
468
|
+
elif [ "$CORE_RESULT" == "failure" ]; then
|
|
469
|
+
echo "- ❌ Core checks: Failed" >> $GITHUB_STEP_SUMMARY
|
|
470
|
+
else
|
|
471
|
+
echo "- ⚠️ Core checks: $CORE_RESULT" >> $GITHUB_STEP_SUMMARY
|
|
472
|
+
fi
|
|
473
|
+
|
|
474
|
+
# Linting
|
|
475
|
+
if [ "$LINTING_RESULT" == "success" ]; then
|
|
476
|
+
echo "- ✅ Linting: Passed" >> $GITHUB_STEP_SUMMARY
|
|
477
|
+
elif [ "$LINTING_RESULT" == "failure" ]; then
|
|
478
|
+
echo "- ❌ Linting: Failed" >> $GITHUB_STEP_SUMMARY
|
|
479
|
+
elif [ "$LINTING_RESULT" == "skipped" ]; then
|
|
480
|
+
echo "- ⏭️ Linting: Skipped (no source files)" >> $GITHUB_STEP_SUMMARY
|
|
481
|
+
else
|
|
482
|
+
echo "- ⚠️ Linting: $LINTING_RESULT" >> $GITHUB_STEP_SUMMARY
|
|
483
|
+
fi
|
|
484
|
+
|
|
485
|
+
# Security
|
|
486
|
+
if [ "$SECURITY_RESULT" == "success" ]; then
|
|
487
|
+
echo "- ✅ Security: Passed" >> $GITHUB_STEP_SUMMARY
|
|
488
|
+
elif [ "$SECURITY_RESULT" == "failure" ]; then
|
|
489
|
+
echo "- ❌ Security: Failed" >> $GITHUB_STEP_SUMMARY
|
|
490
|
+
elif [ "$SECURITY_RESULT" == "skipped" ]; then
|
|
491
|
+
echo "- ⏭️ Security: Skipped (no dependencies)" >> $GITHUB_STEP_SUMMARY
|
|
492
|
+
else
|
|
493
|
+
echo "- ⚠️ Security: $SECURITY_RESULT" >> $GITHUB_STEP_SUMMARY
|
|
494
|
+
fi
|
|
495
|
+
|
|
496
|
+
# Tests
|
|
497
|
+
if [ "$TESTS_RESULT" == "success" ]; then
|
|
498
|
+
echo "- ✅ Tests: Passed" >> $GITHUB_STEP_SUMMARY
|
|
499
|
+
elif [ "$TESTS_RESULT" == "failure" ]; then
|
|
500
|
+
echo "- ❌ Tests: Failed" >> $GITHUB_STEP_SUMMARY
|
|
501
|
+
elif [ "$TESTS_RESULT" == "skipped" ]; then
|
|
502
|
+
echo "- ⏭️ Tests: Skipped (no test files)" >> $GITHUB_STEP_SUMMARY
|
|
503
|
+
else
|
|
504
|
+
echo "- ⚠️ Tests: $TESTS_RESULT" >> $GITHUB_STEP_SUMMARY
|
|
505
|
+
fi
|
|
506
|
+
|
|
507
|
+
# Documentation
|
|
508
|
+
if [ "$DOCS_RESULT" == "success" ]; then
|
|
509
|
+
echo "- ✅ Documentation: Passed" >> $GITHUB_STEP_SUMMARY
|
|
510
|
+
elif [ "$DOCS_RESULT" == "failure" ]; then
|
|
511
|
+
echo "- ❌ Documentation: Failed" >> $GITHUB_STEP_SUMMARY
|
|
512
|
+
elif [ "$DOCS_RESULT" == "skipped" ]; then
|
|
513
|
+
echo "- ⏭️ Documentation: Skipped (not production-ready)" >> $GITHUB_STEP_SUMMARY
|
|
514
|
+
else
|
|
515
|
+
echo "- ⚠️ Documentation: $DOCS_RESULT" >> $GITHUB_STEP_SUMMARY
|
|
516
|
+
fi
|
|
441
517
|
# PR_COMMENTS_PLACEHOLDER
|
|
442
518
|
|
|
443
519
|
# ALERTS_PLACEHOLDER
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
# Migration Guide: v5.8.0
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Version 5.8.0 fixes critical silent failure bugs in the GitHub Actions workflow template that could allow broken code to merge:
|
|
6
|
+
|
|
7
|
+
1. **Lighthouse CI failures** were silently ignored (now fails production builds)
|
|
8
|
+
2. **Job summaries** always showed ✅ even when checks failed (now shows actual results)
|
|
9
|
+
|
|
10
|
+
## Who Should Upgrade?
|
|
11
|
+
|
|
12
|
+
**All projects using qa-architect** - especially production-ready projects that rely on Lighthouse CI for performance gates.
|
|
13
|
+
|
|
14
|
+
## Quick Migration (Recommended)
|
|
15
|
+
|
|
16
|
+
Update your workflow in one command:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npx create-qa-architect@latest
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
This will:
|
|
23
|
+
|
|
24
|
+
- Detect your existing workflow mode (minimal/standard/comprehensive)
|
|
25
|
+
- Preserve your current configuration
|
|
26
|
+
- Apply the bug fixes to `.github/workflows/quality.yml`
|
|
27
|
+
|
|
28
|
+
## What Changes?
|
|
29
|
+
|
|
30
|
+
### 1. Lighthouse CI - Now Fails Production Builds
|
|
31
|
+
|
|
32
|
+
**Before (v5.7.0):**
|
|
33
|
+
|
|
34
|
+
```yaml
|
|
35
|
+
- name: Lighthouse CI
|
|
36
|
+
run: npx lhci autorun
|
|
37
|
+
continue-on-error: true # ⚠️ Failures silently ignored
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
**After (v5.8.0):**
|
|
41
|
+
|
|
42
|
+
```yaml
|
|
43
|
+
- name: Lighthouse CI
|
|
44
|
+
id: lighthouse
|
|
45
|
+
run: npx lhci autorun
|
|
46
|
+
continue-on-error: true
|
|
47
|
+
|
|
48
|
+
- name: Report Lighthouse Failures
|
|
49
|
+
if: steps.lighthouse.outcome == 'failure'
|
|
50
|
+
env:
|
|
51
|
+
MATURITY: ${{ needs.detect-maturity.outputs.maturity }}
|
|
52
|
+
run: |
|
|
53
|
+
echo "::error::Lighthouse CI failed"
|
|
54
|
+
# Fail build for production-ready projects
|
|
55
|
+
if [ "$MATURITY" == "production-ready" ]; then
|
|
56
|
+
exit 1
|
|
57
|
+
fi
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**Impact:**
|
|
61
|
+
|
|
62
|
+
- **Production-ready projects**: Lighthouse failures now block merges (hard gate)
|
|
63
|
+
- **Other projects**: Lighthouse failures show warnings but don't block (soft gate)
|
|
64
|
+
|
|
65
|
+
### 2. Job Summary - Shows Actual Results
|
|
66
|
+
|
|
67
|
+
**Before (v5.7.0):**
|
|
68
|
+
|
|
69
|
+
```yaml
|
|
70
|
+
# Always showed ✅ if enabled, regardless of pass/fail
|
|
71
|
+
echo "- ✅ Tests: Enabled" >> $GITHUB_STEP_SUMMARY
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**After (v5.8.0):**
|
|
75
|
+
|
|
76
|
+
```yaml
|
|
77
|
+
# Shows actual result: ✅ success, ❌ failure, ⏭️ skipped
|
|
78
|
+
if [ "$TESTS_RESULT" == "success" ]; then
|
|
79
|
+
echo "- ✅ Tests: Passed" >> $GITHUB_STEP_SUMMARY
|
|
80
|
+
elif [ "$TESTS_RESULT" == "failure" ]; then
|
|
81
|
+
echo "- ❌ Tests: Failed" >> $GITHUB_STEP_SUMMARY
|
|
82
|
+
fi
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
**Impact:**
|
|
86
|
+
|
|
87
|
+
- Summaries now accurately reflect job outcomes
|
|
88
|
+
- Failures are immediately visible in PR checks
|
|
89
|
+
|
|
90
|
+
## Verification
|
|
91
|
+
|
|
92
|
+
After upgrading, verify the changes:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
# Check workflow mode marker
|
|
96
|
+
grep "WORKFLOW_MODE:" .github/workflows/quality.yml
|
|
97
|
+
|
|
98
|
+
# Verify Lighthouse failure handler exists
|
|
99
|
+
grep -A 10 "Report Lighthouse Failures" .github/workflows/quality.yml
|
|
100
|
+
|
|
101
|
+
# Verify summary uses actual results
|
|
102
|
+
grep "CORE_RESULT" .github/workflows/quality.yml
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Rollback (If Needed)
|
|
106
|
+
|
|
107
|
+
If you need to rollback to v5.7.0:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
npx create-qa-architect@5.7.0
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Breaking Changes
|
|
114
|
+
|
|
115
|
+
None - these are backwards-compatible bug fixes.
|
|
116
|
+
|
|
117
|
+
**Exception:** If you have production-ready maturity and currently have Lighthouse failures that are being ignored, they will now block your builds. This is the intended behavior to prevent quality regressions.
|
|
118
|
+
|
|
119
|
+
## FAQ
|
|
120
|
+
|
|
121
|
+
### Q: Will this affect my CI minutes?
|
|
122
|
+
|
|
123
|
+
No - the changes only add a conditional failure reporting step. No new jobs or scans.
|
|
124
|
+
|
|
125
|
+
### Q: What if I want to keep Lighthouse as a soft failure?
|
|
126
|
+
|
|
127
|
+
Remove the production-ready check from the "Report Lighthouse Failures" step:
|
|
128
|
+
|
|
129
|
+
```yaml
|
|
130
|
+
# Remove this block:
|
|
131
|
+
if [ "$MATURITY" == "production-ready" ]; then
|
|
132
|
+
exit 1
|
|
133
|
+
fi
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Q: How do I know my maturity level?
|
|
137
|
+
|
|
138
|
+
Check your workflow or run:
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
npx create-qa-architect --check-maturity
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Maturity levels: minimal → bootstrap → development → production-ready
|
|
145
|
+
|
|
146
|
+
### Q: Can I update manually instead of re-running the tool?
|
|
147
|
+
|
|
148
|
+
Yes, but not recommended. The template changes are extensive. If you must:
|
|
149
|
+
|
|
150
|
+
1. Copy the new steps from `.github/workflows/quality.yml` in this repo
|
|
151
|
+
2. Add Lighthouse failure handler (lines 411-430)
|
|
152
|
+
3. Update summary step to use `needs.<job>.result` (lines 445-516)
|
|
153
|
+
|
|
154
|
+
## Support
|
|
155
|
+
|
|
156
|
+
- Issues: https://github.com/anthropics/qa-architect/issues
|
|
157
|
+
- Docs: https://github.com/anthropics/qa-architect/blob/main/README.md
|
|
@@ -0,0 +1,421 @@
|
|
|
1
|
+
# Optimal Quality Strategy - Universal & Cost-Effective
|
|
2
|
+
|
|
3
|
+
**Date:** 2026-01-14
|
|
4
|
+
**Goal:** Maintain high quality while getting under 2,000 GH Actions min/month
|
|
5
|
+
|
|
6
|
+
## Key Insights
|
|
7
|
+
|
|
8
|
+
1. **/bs:quality already exists** - Comprehensive autonomous quality loop using Claude Code agents
|
|
9
|
+
2. **qa-architect should work for everyone** - Not everyone has Claude Code MAX
|
|
10
|
+
3. **60-80% of CI checks are redundant** - Already running in pre-push hooks
|
|
11
|
+
4. **Security scans CAN run locally** - gitleaks, npm audit are free
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Three-Tier Quality Approach
|
|
16
|
+
|
|
17
|
+
### Tier 1: Pre-Push (Universal - Works for Everyone)
|
|
18
|
+
|
|
19
|
+
**Time:** 45-150 seconds
|
|
20
|
+
**Cost:** Free (runs locally)
|
|
21
|
+
**Who:** Everyone using qa-architect
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
✅ ESLint + Prettier + Stylelint (already in place)
|
|
25
|
+
✅ TypeScript type-check (already in place)
|
|
26
|
+
✅ Unit tests - smart strategy (already in place)
|
|
27
|
+
+ 🔐 Gitleaks (secret scanning) - ADD THIS
|
|
28
|
+
+ 🔐 npm audit (dependency vulnerabilities) - ADD THIS
|
|
29
|
+
+ 🔐 XSS pattern detection (grep-based) - ADD THIS
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
**Result:** Catch 95% of issues before push, including security issues
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
### Tier 2: On-Demand /bs:quality (Claude Code Users)
|
|
37
|
+
|
|
38
|
+
**Time:** 2-5 min (quick) to 1-3 hours (level 98)
|
|
39
|
+
**Cost:** Free with Claude Code MAX, usage-based on other tiers
|
|
40
|
+
**Who:** Claude Code users (any tier)
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
/bs:quality --scope changed # Quick: 2-5 min, uncommitted changes
|
|
44
|
+
/bs:quality # Default: 30-60 min, branch scope, 95%
|
|
45
|
+
/bs:quality --level 98 # Comprehensive: 1-3 hours, 98% quality
|
|
46
|
+
/bs:quality --merge # + auto-merge and deploy
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
**Agents:**
|
|
50
|
+
|
|
51
|
+
- code-reviewer
|
|
52
|
+
- silent-failure-hunter
|
|
53
|
+
- type-design-analyzer
|
|
54
|
+
- code-simplifier
|
|
55
|
+
- security-auditor (level 98)
|
|
56
|
+
- accessibility-tester (level 98)
|
|
57
|
+
- performance-engineer (level 98)
|
|
58
|
+
- architect-reviewer (level 98)
|
|
59
|
+
|
|
60
|
+
**Result:** Comprehensive AI-powered review before PR
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
### Tier 3: Minimal GitHub Actions (Safety Net Only)
|
|
65
|
+
|
|
66
|
+
**Time:** 1-3 minutes
|
|
67
|
+
**Cost:** Minimized to essential checks only
|
|
68
|
+
**Who:** Runs automatically on push to main
|
|
69
|
+
|
|
70
|
+
**REMOVE redundant checks:**
|
|
71
|
+
|
|
72
|
+
- ❌ ESLint (redundant with pre-push)
|
|
73
|
+
- ❌ Prettier (redundant with pre-push)
|
|
74
|
+
- ❌ Stylelint (redundant with pre-push)
|
|
75
|
+
- ❌ Unit tests (redundant with pre-push)
|
|
76
|
+
- ❌ TypeScript type-check (redundant with pre-push)
|
|
77
|
+
- ❌ Gitleaks (moving to pre-push)
|
|
78
|
+
- ❌ npm audit (moving to pre-push)
|
|
79
|
+
- ❌ XSS detection (moving to pre-push)
|
|
80
|
+
- ❌ Smoke tests (redundant, covered by unit tests)
|
|
81
|
+
|
|
82
|
+
**KEEP minimal checks:**
|
|
83
|
+
|
|
84
|
+
- ✅ Package signature verification (needs npm registry)
|
|
85
|
+
- ✅ E2E smoke test (optional, main branch only)
|
|
86
|
+
- ✅ Build verification (quick, ensures deployability)
|
|
87
|
+
|
|
88
|
+
**Optional scheduled scan:**
|
|
89
|
+
|
|
90
|
+
- 🗓️ Weekly security audit (gitleaks + npm audit) - runs once/week
|
|
91
|
+
- **Cost:** ~10 min/week = 40 min/month per repo
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## Implementation for qa-architect
|
|
96
|
+
|
|
97
|
+
### Phase 1: Add Local Security Scans (Everyone Benefits)
|
|
98
|
+
|
|
99
|
+
**Timeline:** v5.7.0 release
|
|
100
|
+
|
|
101
|
+
Add to pre-push hook (`.husky/pre-push`):
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
#!/bin/sh
|
|
105
|
+
echo "🔍 Running pre-push validation..."
|
|
106
|
+
|
|
107
|
+
# Existing checks
|
|
108
|
+
npm run lint || exit 1
|
|
109
|
+
npm run format:check || exit 1
|
|
110
|
+
npm test || exit 1
|
|
111
|
+
|
|
112
|
+
# NEW: Security scans
|
|
113
|
+
echo "🔐 Scanning for secrets..."
|
|
114
|
+
if command -v gitleaks &> /dev/null; then
|
|
115
|
+
gitleaks detect --no-git --verbose || exit 1
|
|
116
|
+
else
|
|
117
|
+
echo "⚠️ gitleaks not installed - skipping secret scan"
|
|
118
|
+
echo " Install: brew install gitleaks (Mac) or see https://github.com/gitleaks/gitleaks"
|
|
119
|
+
fi
|
|
120
|
+
|
|
121
|
+
echo "🔐 Checking dependencies..."
|
|
122
|
+
npm audit --audit-level=high || exit 1
|
|
123
|
+
|
|
124
|
+
echo "🔐 Scanning for XSS patterns..."
|
|
125
|
+
# Check for dangerous patterns
|
|
126
|
+
if grep -rE "innerHTML.*\\\$\{" src/ --include="*.js" --include="*.jsx" --include="*.ts" --include="*.tsx" 2>/dev/null; then
|
|
127
|
+
echo "❌ Potential XSS: innerHTML with interpolation found"
|
|
128
|
+
exit 1
|
|
129
|
+
fi
|
|
130
|
+
|
|
131
|
+
echo "✅ All pre-push checks passed!"
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
**Add gitleaks to devDependencies** (or recommend global install):
|
|
135
|
+
|
|
136
|
+
```json
|
|
137
|
+
{
|
|
138
|
+
"devDependencies": {
|
|
139
|
+
"gitleaks": "^8.18.0" // or global install instructions
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
**Benefits:**
|
|
145
|
+
|
|
146
|
+
- ✅ Works for everyone (not just MAX tier)
|
|
147
|
+
- ✅ Catches secrets before they reach GitHub
|
|
148
|
+
- ✅ Catches vulnerable dependencies early
|
|
149
|
+
- ✅ Catches XSS patterns locally
|
|
150
|
+
- ✅ Still fast enough (adds ~10-15s to pre-push)
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
### Phase 2: Slim Down GitHub Actions Template
|
|
155
|
+
|
|
156
|
+
**Timeline:** v5.7.0 release
|
|
157
|
+
|
|
158
|
+
New `.github/workflows/quality.yml` template:
|
|
159
|
+
|
|
160
|
+
```yaml
|
|
161
|
+
name: Quality Checks
|
|
162
|
+
|
|
163
|
+
on:
|
|
164
|
+
push:
|
|
165
|
+
branches: [main, master]
|
|
166
|
+
# Only run on main - feature branches rely on pre-push hooks
|
|
167
|
+
schedule:
|
|
168
|
+
# Weekly security audit as safety net
|
|
169
|
+
- cron: '0 2 * * 0' # Sunday 2 AM
|
|
170
|
+
|
|
171
|
+
concurrency:
|
|
172
|
+
group: quality-${{ github.workflow }}-${{ github.ref }}
|
|
173
|
+
cancel-in-progress: true
|
|
174
|
+
|
|
175
|
+
jobs:
|
|
176
|
+
minimal-verification:
|
|
177
|
+
runs-on: ubuntu-latest
|
|
178
|
+
steps:
|
|
179
|
+
- uses: actions/checkout@v6
|
|
180
|
+
|
|
181
|
+
- uses: actions/setup-node@v6
|
|
182
|
+
with:
|
|
183
|
+
node-version: '22'
|
|
184
|
+
cache: 'npm'
|
|
185
|
+
|
|
186
|
+
- name: Install dependencies
|
|
187
|
+
run: npm ci
|
|
188
|
+
|
|
189
|
+
# Only essential checks that can't run locally
|
|
190
|
+
- name: Verify build
|
|
191
|
+
run: npm run build
|
|
192
|
+
|
|
193
|
+
- name: Package signature verification
|
|
194
|
+
run: npm audit signatures || echo "⚠️ Signature verification failed"
|
|
195
|
+
|
|
196
|
+
# Optional: E2E smoke test (only on main)
|
|
197
|
+
- name: E2E smoke test
|
|
198
|
+
if: github.ref == 'refs/heads/main'
|
|
199
|
+
run: |
|
|
200
|
+
npx playwright install --with-deps chromium
|
|
201
|
+
npm run test:e2e || echo "⚠️ E2E tests failed"
|
|
202
|
+
continue-on-error: true
|
|
203
|
+
|
|
204
|
+
# Weekly security audit (safety net)
|
|
205
|
+
weekly-security:
|
|
206
|
+
if: github.event_name == 'schedule'
|
|
207
|
+
runs-on: ubuntu-latest
|
|
208
|
+
steps:
|
|
209
|
+
- uses: actions/checkout@v6
|
|
210
|
+
with:
|
|
211
|
+
fetch-depth: 0 # Full history for gitleaks
|
|
212
|
+
|
|
213
|
+
- name: Gitleaks scan
|
|
214
|
+
uses: gitleaks/gitleaks-action@v2
|
|
215
|
+
|
|
216
|
+
- name: Dependency audit
|
|
217
|
+
run: npm audit --audit-level=high
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
**Result:**
|
|
221
|
+
|
|
222
|
+
- Main branch push: ~2-3 minutes (build + signatures + optional E2E)
|
|
223
|
+
- Weekly security: ~3-5 minutes once/week
|
|
224
|
+
- **Total per repo:** ~10-15 min/week = 40-60 min/month
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
## Cost Calculation
|
|
229
|
+
|
|
230
|
+
### Before (Current State)
|
|
231
|
+
|
|
232
|
+
**Per repo per day:**
|
|
233
|
+
|
|
234
|
+
- Every push: 5 min (redundant checks)
|
|
235
|
+
- Average 5 pushes/day = 25 min/day
|
|
236
|
+
- **Monthly:** 25 × 30 = 750 min/month per repo
|
|
237
|
+
|
|
238
|
+
**11 repos:**
|
|
239
|
+
|
|
240
|
+
- 750 × 11 = 8,250 min/month
|
|
241
|
+
- **Cost:** ~$49/month
|
|
242
|
+
|
|
243
|
+
### After (Optimized)
|
|
244
|
+
|
|
245
|
+
**Per repo per day:**
|
|
246
|
+
|
|
247
|
+
- Main branch push: 2-3 min (1-2 times/day max)
|
|
248
|
+
- Average 2 min/day (most work on feature branches uses local hooks)
|
|
249
|
+
- **Monthly:** 2 × 30 = 60 min/month per repo
|
|
250
|
+
|
|
251
|
+
**11 repos:**
|
|
252
|
+
|
|
253
|
+
- 60 × 11 = 660 min/month
|
|
254
|
+
- **Cost:** ~$4/month
|
|
255
|
+
|
|
256
|
+
**Savings: $45/month (92% reduction)**
|
|
257
|
+
|
|
258
|
+
---
|
|
259
|
+
|
|
260
|
+
## For Users Without Claude Code
|
|
261
|
+
|
|
262
|
+
**They still get:**
|
|
263
|
+
|
|
264
|
+
- ✅ Pre-push security scans (gitleaks, npm audit, XSS detection)
|
|
265
|
+
- ✅ Full lint/format/test automation
|
|
266
|
+
- ✅ Minimal CI as safety net
|
|
267
|
+
- ✅ All core qa-architect features
|
|
268
|
+
|
|
269
|
+
**They miss:**
|
|
270
|
+
|
|
271
|
+
- ❌ /bs:quality autonomous agents (need Claude Code)
|
|
272
|
+
|
|
273
|
+
**But they can:**
|
|
274
|
+
|
|
275
|
+
- ✅ Use /pr-review-toolkit:review-pr skill (if they have Claude Code on any tier)
|
|
276
|
+
- ✅ Manual PR reviews with Claude Code
|
|
277
|
+
- ✅ Still maintain high quality with automated tooling
|
|
278
|
+
|
|
279
|
+
---
|
|
280
|
+
|
|
281
|
+
## For Users With Claude Code MAX
|
|
282
|
+
|
|
283
|
+
**They get everything above PLUS:**
|
|
284
|
+
|
|
285
|
+
- ✅ /bs:quality autonomous loops (unlimited)
|
|
286
|
+
- ✅ On-demand comprehensive reviews
|
|
287
|
+
- ✅ AI-powered architecture guidance
|
|
288
|
+
- ✅ Cost-free comprehensive testing
|
|
289
|
+
|
|
290
|
+
**Workflow:**
|
|
291
|
+
|
|
292
|
+
```bash
|
|
293
|
+
# 1. Work on feature
|
|
294
|
+
git checkout -b feature/new-auth
|
|
295
|
+
|
|
296
|
+
# 2. Small commits with quick checks
|
|
297
|
+
# ... code ...
|
|
298
|
+
/bs:quality --scope changed # 2-5 min
|
|
299
|
+
git commit -m "feat: add login"
|
|
300
|
+
|
|
301
|
+
# 3. Feature complete
|
|
302
|
+
/bs:quality # 30-60 min, comprehensive
|
|
303
|
+
/bs:quality --merge # Auto-merge and deploy
|
|
304
|
+
|
|
305
|
+
# Total GH Actions cost: $0 (only runs on main after merge)
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
---
|
|
309
|
+
|
|
310
|
+
## Migration Path
|
|
311
|
+
|
|
312
|
+
### Week 1: Update qa-architect (v5.7.0)
|
|
313
|
+
|
|
314
|
+
- [ ] Add gitleaks to pre-push hook
|
|
315
|
+
- [ ] Add npm audit to pre-push hook
|
|
316
|
+
- [ ] Add XSS pattern detection to pre-push hook
|
|
317
|
+
- [ ] Update GH Actions template (minimal)
|
|
318
|
+
- [ ] Update documentation
|
|
319
|
+
- [ ] Release v5.7.0
|
|
320
|
+
|
|
321
|
+
### Week 2: Update All Repos
|
|
322
|
+
|
|
323
|
+
- [ ] Run `npx create-qa-architect@latest` on all 11 repos
|
|
324
|
+
- [ ] Test pre-push hooks work (try to commit a secret, should fail)
|
|
325
|
+
- [ ] Verify CI runs only on main
|
|
326
|
+
- [ ] Commit and push
|
|
327
|
+
|
|
328
|
+
### Week 3: Monitor
|
|
329
|
+
|
|
330
|
+
- [ ] Check GH Actions usage dashboard
|
|
331
|
+
- [ ] Verify under 2,000 min/month
|
|
332
|
+
- [ ] Collect feedback on pre-push speed
|
|
333
|
+
|
|
334
|
+
---
|
|
335
|
+
|
|
336
|
+
## FAQ
|
|
337
|
+
|
|
338
|
+
### "Won't pre-push be too slow with security scans?"
|
|
339
|
+
|
|
340
|
+
**A:** Gitleaks is fast (~3-5s), npm audit is ~5-10s, XSS grep is ~2s. Total addition: ~10-15s max.
|
|
341
|
+
|
|
342
|
+
**Before:** 30-120s
|
|
343
|
+
**After:** 45-150s
|
|
344
|
+
**Still acceptable** for catching security issues before they hit GitHub.
|
|
345
|
+
|
|
346
|
+
### "What if I don't have gitleaks installed?"
|
|
347
|
+
|
|
348
|
+
**A:** Pre-push hook shows warning but doesn't fail. User can install with `brew install gitleaks` or continue without it (CI weekly scan still catches issues).
|
|
349
|
+
|
|
350
|
+
### "What about repos I'm not actively working on?"
|
|
351
|
+
|
|
352
|
+
**A:** They still get weekly security scans (40-60 min/month). If inactive for >3 months, consider disabling CI entirely and re-enabling when active.
|
|
353
|
+
|
|
354
|
+
### "Can I still use comprehensive CI if I want?"
|
|
355
|
+
|
|
356
|
+
**A:** Yes! Add `--workflow-comprehensive` flag when running qa-architect. Good for critical production apps or open-source projects with external contributors.
|
|
357
|
+
|
|
358
|
+
---
|
|
359
|
+
|
|
360
|
+
## Decision Matrix: Which Repos Need What?
|
|
361
|
+
|
|
362
|
+
### Minimal CI (Default - Recommended for 9/11 repos)
|
|
363
|
+
|
|
364
|
+
**Use for:** Side projects, internal tools, personal sites
|
|
365
|
+
**Cost:** 40-60 min/month per repo
|
|
366
|
+
**Safety:** Weekly security scan + local pre-push
|
|
367
|
+
|
|
368
|
+
- brettstark-about
|
|
369
|
+
- ai-learning-companion
|
|
370
|
+
- retireabroad
|
|
371
|
+
- stark-program-intelligence
|
|
372
|
+
- project-starter-guide
|
|
373
|
+
- jobrecon
|
|
374
|
+
- vibebuildlab
|
|
375
|
+
- postrail
|
|
376
|
+
- brettstark
|
|
377
|
+
|
|
378
|
+
### Standard CI (Active Projects - 2 repos)
|
|
379
|
+
|
|
380
|
+
**Use for:** Active development, moderate traffic
|
|
381
|
+
**Cost:** 100-150 min/month per repo
|
|
382
|
+
**Safety:** Main branch checks + weekly security
|
|
383
|
+
|
|
384
|
+
- keyflash
|
|
385
|
+
- qa-architect (your product)
|
|
386
|
+
|
|
387
|
+
### Comprehensive CI (Critical Only - 0 repos currently)
|
|
388
|
+
|
|
389
|
+
**Use for:** Open source with external PRs, production critical
|
|
390
|
+
**Cost:** 300-500 min/month per repo
|
|
391
|
+
**Safety:** Every commit checked
|
|
392
|
+
|
|
393
|
+
- (None currently - can enable per-project if needed)
|
|
394
|
+
|
|
395
|
+
**Total with this approach:**
|
|
396
|
+
|
|
397
|
+
- 9 minimal repos: 9 × 50 = 450 min/month
|
|
398
|
+
- 2 standard repos: 2 × 125 = 250 min/month
|
|
399
|
+
- **Total: 700 min/month (~$4.20/month)**
|
|
400
|
+
|
|
401
|
+
✅ **Well under 2,000 min/month limit**
|
|
402
|
+
|
|
403
|
+
---
|
|
404
|
+
|
|
405
|
+
## Recommendation
|
|
406
|
+
|
|
407
|
+
**Best strategy:**
|
|
408
|
+
|
|
409
|
+
1. **Update qa-architect v5.7.0** with local security scans (benefits everyone)
|
|
410
|
+
2. **Use minimal CI template** for 9/11 repos (weekly scans only)
|
|
411
|
+
3. **Use standard CI** for qa-architect and keyflash (active development)
|
|
412
|
+
4. **Keep /bs:quality** for on-demand comprehensive reviews (MAX tier users)
|
|
413
|
+
5. **Don't disable CI completely** - weekly scans are valuable safety net
|
|
414
|
+
|
|
415
|
+
**Result:**
|
|
416
|
+
|
|
417
|
+
- ✅ Under 2,000 min/month (~700 min/month)
|
|
418
|
+
- ✅ Better security (local scans catch issues earlier)
|
|
419
|
+
- ✅ Works for everyone (not just MAX tier)
|
|
420
|
+
- ✅ Maintains quality (pre-push + weekly scans + /bs:quality)
|
|
421
|
+
- ✅ Cost-effective ($4/month vs $49/month)
|