codebase-ai 0.1.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/README.md +309 -0
- package/commands/build.md +171 -0
- package/commands/launch.md +220 -0
- package/commands/review.md +150 -0
- package/commands/setup.md +220 -0
- package/commands/simulate.md +177 -0
- package/dist/index.js +608 -0
- package/package.json +56 -0
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Code review (security, quality, deps health, UI/accessibility) + test generation. Outputs GitHub Issues. Uses codebase context.
|
|
3
|
+
argument-hint: [--security] [--quality] [--deps] [--ui] [--test] [--pr N] [--fix]
|
|
4
|
+
model: sonnet
|
|
5
|
+
allowed-tools: Agent, Bash(gh:*), Bash(git add:*), Bash(git commit:*), Bash(git push:*), Bash(git checkout:*), Bash(git pull:*), Bash(git fetch:*), Bash(git stash:*), Bash(git log:*), Bash(git status:*), Bash(git diff:*), Bash(git rev-parse:*), Bash(git branch:*), Bash(npx:*), Bash(npm:*), Bash(node:*), Bash(pnpm:*), Bash(uv:*), Bash(pip:*), Read, Write, Edit, Glob, Grep
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# /review
|
|
9
|
+
|
|
10
|
+
Security, quality, dependency health, accessibility review + test generation. Every finding becomes a GitHub Issue. Powered by `codebase` project intelligence.
|
|
11
|
+
|
|
12
|
+
Branch: `develop` for read-only review. For `--fix`: use a `fix/<slug>` branch → PR → merge to develop.
|
|
13
|
+
|
|
14
|
+
## Arguments
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
$ARGUMENTS
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
- `--security` — OWASP top 10, dependency CVEs, secrets in code, auth/authz
|
|
21
|
+
- `--quality` — convention adherence (CLAUDE.md), dead code, lint, complexity, duplication
|
|
22
|
+
- `--deps` — outdated/vulnerable packages, suggest updates
|
|
23
|
+
- `--ui` — accessibility (contrast, ARIA, keyboard nav), responsive issues
|
|
24
|
+
- `--test` — generate and run persistent test suites for untested code
|
|
25
|
+
- `--test --unit` / `--integration` / `--e2e` / `--coverage` / `--for "feature"` — test scope
|
|
26
|
+
- `--pr N` — scope review to changes in PR #N
|
|
27
|
+
- `--fix` — auto-fix fixable quality, deps, UI issues, commit to develop
|
|
28
|
+
- *(no flags)* — runs all: security + quality + deps + ui
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Prerequisites
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
gh auth status || { echo "ERROR: gh auth login first."; exit 1; }
|
|
36
|
+
git remote get-url origin || { echo "ERROR: No git remote."; exit 1; }
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Load codebase project intelligence
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
npx codebase brief 2>/dev/null > /tmp/cb-brief.json || true
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Read the brief. Extract and use throughout:
|
|
46
|
+
- `stack.languages`, `stack.frameworks` — language-specific review rules
|
|
47
|
+
- `dependencies.notable`, `dependencies.direct_count` — dependency surface
|
|
48
|
+
- `quality.linter`, `quality.formatter`, `quality.test_framework` — tooling
|
|
49
|
+
- `quality.pre_commit_hooks` — hook coverage
|
|
50
|
+
- `patterns.architecture`, `patterns.api_style` — architecture context
|
|
51
|
+
- `config.env_vars` — identify secrets/sensitive config exposure
|
|
52
|
+
|
|
53
|
+
Read `CLAUDE.md` if present — conventions drive the quality dimension.
|
|
54
|
+
Read `docs/PRODUCT.md` if present — product context informs security review (roles, auth model, data sensitivity).
|
|
55
|
+
|
|
56
|
+
### Ensure `review` label exists
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
gh label create "review" --color "6f42c1" --description "From a /review audit" 2>/dev/null || true
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Review Workflow
|
|
65
|
+
|
|
66
|
+
Follow the complete `/vb-review` workflow across all phases:
|
|
67
|
+
|
|
68
|
+
- **Phase 0** — Scope (`--pr N` or full codebase)
|
|
69
|
+
- **Phase 1** — Security Review (OWASP top 10, CVEs, secrets, auth/authz)
|
|
70
|
+
- **Phase 2** — Quality Review (CLAUDE.md conventions, dead code, lint, complexity)
|
|
71
|
+
- **Phase 3** — Dependency Health (outdated, vulnerable, alternatives)
|
|
72
|
+
- **Phase 4** — UI/Accessibility (contrast, ARIA, keyboard, responsive)
|
|
73
|
+
- **Phase 5** — Consolidate & prioritize
|
|
74
|
+
- **Phase 6** — Create GitHub Issues (one per finding, labeled `review,[severity],[dimension]`)
|
|
75
|
+
- **Phase 7** — Auto-fix (if `--fix`) + commit
|
|
76
|
+
- **Phase 8** — Summary
|
|
77
|
+
|
|
78
|
+
### codebase integration points
|
|
79
|
+
|
|
80
|
+
**Use brief data to skip re-scanning what codebase already knows:**
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
# Instead of re-detecting test framework:
|
|
84
|
+
TEST_FRAMEWORK=$(node -e "try{const b=require('/tmp/cb-brief.json');console.log(b.quality?.test_framework||'')}catch{}" 2>/dev/null)
|
|
85
|
+
|
|
86
|
+
# Instead of re-detecting linter:
|
|
87
|
+
LINTER=$(node -e "try{const b=require('/tmp/cb-brief.json');console.log(b.quality?.linter||'')}catch{}" 2>/dev/null)
|
|
88
|
+
|
|
89
|
+
# Get dependency count for scope estimate:
|
|
90
|
+
DEPS=$(node -e "try{const b=require('/tmp/cb-brief.json');console.log(b.dependencies?.direct_count||0)}catch{}" 2>/dev/null)
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
**Issue creation** — after creating a GitHub Issue, also track in codebase:
|
|
94
|
+
```bash
|
|
95
|
+
npx codebase issue create "[title]" --message "[body summary]" 2>/dev/null || true
|
|
96
|
+
npx codebase scan-only --incremental --quiet --sync
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
**Pre-work sync:**
|
|
100
|
+
```bash
|
|
101
|
+
git fetch origin
|
|
102
|
+
git status # abort if dirty
|
|
103
|
+
git checkout develop && git pull origin develop
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
**Commit convention (if `--fix`):**
|
|
107
|
+
|
|
108
|
+
For each finding, use an isolated branch:
|
|
109
|
+
```bash
|
|
110
|
+
SLUG=$(echo "[finding title]" | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | tr -cd 'a-z0-9-' | cut -c1-40)
|
|
111
|
+
git checkout -b fix/${SLUG}
|
|
112
|
+
|
|
113
|
+
git add [specific files only]
|
|
114
|
+
git commit -m "fix([dim]): [short description]
|
|
115
|
+
|
|
116
|
+
/review --fix | Severity: [sev] | Dimension: [dim]
|
|
117
|
+
Closes #[N]"
|
|
118
|
+
git push origin fix/${SLUG}
|
|
119
|
+
|
|
120
|
+
gh pr create \
|
|
121
|
+
--base develop \
|
|
122
|
+
--head fix/${SLUG} \
|
|
123
|
+
--title "fix(#[N]): [short description]" \
|
|
124
|
+
--body "## Finding
|
|
125
|
+
[description]
|
|
126
|
+
|
|
127
|
+
## Fix
|
|
128
|
+
[what was changed]
|
|
129
|
+
|
|
130
|
+
Severity: [sev] | Closes #[N]"
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
After PR merge: `git checkout develop && git pull origin develop && git branch -d fix/${SLUG}`
|
|
134
|
+
|
|
135
|
+
Print scope banner:
|
|
136
|
+
```
|
|
137
|
+
REVIEW SCOPE
|
|
138
|
+
════════════════════════════════════════════════════════
|
|
139
|
+
Project: [name from brief]
|
|
140
|
+
Stack: [frameworks from brief]
|
|
141
|
+
Source files: [N]
|
|
142
|
+
Dependencies: [direct_count from brief]
|
|
143
|
+
Test framework:[quality.test_framework]
|
|
144
|
+
Linter: [quality.linter]
|
|
145
|
+
Dimensions: [security | quality | ui | all]
|
|
146
|
+
Auto-fix: [yes | no]
|
|
147
|
+
════════════════════════════════════════════════════════
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
All other behavior (security agent prompts, quality rules, CVE research, accessibility checks, test generation) follows the `/vb-review` specification exactly.
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Bootstrap a project for the /simulate → /build → /launch loop. Run once per project.
|
|
3
|
+
argument-hint: [--auto] [--refresh]
|
|
4
|
+
model: sonnet
|
|
5
|
+
allowed-tools: Bash(gh:*), Bash(git add:*), Bash(git commit:*), Bash(git push:*), Bash(git checkout:*), Bash(git pull:*), Bash(git fetch:*), Bash(git status:*), Bash(git rev-parse:*), Bash(git branch:*), Bash(git remote:*), Bash(node:*), Bash(npx:*), Bash(npm:*), Bash(brew:*), Bash(curl:*), Bash(chmod:*), Read, Write, Edit, Glob, Grep
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# /setup
|
|
9
|
+
|
|
10
|
+
Bootstrap this project for the codebase + vibekit development loop. Run once when starting on a new project.
|
|
11
|
+
|
|
12
|
+
## Arguments
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
$ARGUMENTS
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
- `--auto` — generate PRODUCT.md entirely from codebase scan, zero questions. Marks uncertain sections with `[INFERRED]`.
|
|
19
|
+
- `--refresh` — re-scan codebase, diff against existing PRODUCT.md, propose updates for stale sections.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Step 1 — Prerequisites
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
node --version 2>/dev/null || echo "MISSING: install Node.js 18+"
|
|
27
|
+
claude --version 2>/dev/null || echo "MISSING: npm install -g @anthropic-ai/claude-code"
|
|
28
|
+
gh --version 2>/dev/null || echo "MISSING: brew install gh"
|
|
29
|
+
gh auth status 2>/dev/null || echo "NOT AUTHENTICATED: gh auth login"
|
|
30
|
+
git remote get-url origin 2>/dev/null || echo "NO REMOTE: git remote add origin <url>"
|
|
31
|
+
agent-browser --version 2>/dev/null || {
|
|
32
|
+
echo "Installing agent-browser..."
|
|
33
|
+
npm install -g agent-browser && agent-browser install
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Print status table:
|
|
38
|
+
```
|
|
39
|
+
PREREQUISITE CHECK
|
|
40
|
+
══════════════════════════════════════
|
|
41
|
+
Node.js: [OK vX.X.X | MISSING]
|
|
42
|
+
Claude Code: [OK vX.X.X | MISSING]
|
|
43
|
+
gh CLI: [OK vX.X.X | MISSING]
|
|
44
|
+
gh auth: [OK | NOT AUTHENTICATED]
|
|
45
|
+
git remote: [OK | MISSING]
|
|
46
|
+
agent-browser: [OK | installed now]
|
|
47
|
+
══════════════════════════════════════
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Stop if any prerequisite is missing. Do not proceed until all are resolved.
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Step 2 — codebase init
|
|
55
|
+
|
|
56
|
+
Run the full codebase setup to generate `.codebase.json`, wire AI tools, and install git hooks:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
npx codebase setup --sync 2>/dev/null || npx codebase init --sync
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
This installs:
|
|
63
|
+
- `.codebase.json` manifest
|
|
64
|
+
- `CLAUDE.md` injection
|
|
65
|
+
- `post-commit` hook (auto-updates manifest)
|
|
66
|
+
- `commit-msg` hook (blocks direct commits to main/master)
|
|
67
|
+
- `.claude/hooks/git-guard.sh` (PreToolUse — blocks unsafe git ops in Claude)
|
|
68
|
+
- `.claude/hooks/git-post.sh` (PostToolUse — PR reminder after branch push)
|
|
69
|
+
- `.claude/settings.json` (wires Claude Code hooks)
|
|
70
|
+
- `.gitignore` entries
|
|
71
|
+
|
|
72
|
+
Print: `codebase manifest: generated`
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Step 3 — GitHub labels
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
for label in \
|
|
80
|
+
"bug:d73a4a:Something isn't working" \
|
|
81
|
+
"arch:0075ca:Architectural change needed" \
|
|
82
|
+
"sim:e4e669:Found by simulation" \
|
|
83
|
+
"carry:ff6b35:Bug surviving 2+ cycles" \
|
|
84
|
+
"cycle:c5def5:Simulation cycle summary" \
|
|
85
|
+
"critical:b60205:Critical severity" \
|
|
86
|
+
"high:d93f0b:High severity" \
|
|
87
|
+
"medium:e99695:Medium severity" \
|
|
88
|
+
"low:fef2c0:Low severity" \
|
|
89
|
+
"highlight:0e8a16:Positive product signal" \
|
|
90
|
+
"vibekit:7057ff:Queued for autonomous build" \
|
|
91
|
+
"performance:ff8c00:Performance issue" \
|
|
92
|
+
"review:6f42c1:From a code review"; do
|
|
93
|
+
NAME=$(echo "$label" | cut -d: -f1)
|
|
94
|
+
COLOR=$(echo "$label" | cut -d: -f2)
|
|
95
|
+
DESC=$(echo "$label" | cut -d: -f3-)
|
|
96
|
+
gh label list --json name --jq '.[].name' 2>/dev/null | grep -q "^${NAME}$" || \
|
|
97
|
+
gh label create "$NAME" --color "$COLOR" --description "$DESC" 2>/dev/null || true
|
|
98
|
+
done
|
|
99
|
+
echo "Labels ready"
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## Step 4 — Milestone + .vibekit dir
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
mkdir -p .vibekit
|
|
108
|
+
[ -f ".vibekit/milestone.env" ] && source .vibekit/milestone.env || true
|
|
109
|
+
|
|
110
|
+
if [ -z "${MILESTONE_NUMBER:-}" ]; then
|
|
111
|
+
REPO=$(gh repo view --json nameWithOwner --jq '.nameWithOwner' 2>/dev/null)
|
|
112
|
+
MS_NUM=$(gh api "repos/${REPO}/milestones" -X POST \
|
|
113
|
+
-f title="v0.1" -f state="open" \
|
|
114
|
+
-f description="First release — managed by codebase" \
|
|
115
|
+
--jq '.number' 2>/dev/null || echo "")
|
|
116
|
+
if [ -n "$MS_NUM" ]; then
|
|
117
|
+
echo "MILESTONE_NUMBER=${MS_NUM}" > .vibekit/milestone.env
|
|
118
|
+
echo "MILESTONE_TITLE=v0.1" >> .vibekit/milestone.env
|
|
119
|
+
echo "Milestone v0.1 created (#${MS_NUM})"
|
|
120
|
+
fi
|
|
121
|
+
fi
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Add `.vibekit/` entries to `.gitignore` (lock/log files only):
|
|
125
|
+
```bash
|
|
126
|
+
grep -q "build.lock" .gitignore 2>/dev/null || printf "\n.vibekit/build.lock\n" >> .gitignore
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## Step 5 — Highlights Index issue
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
EXISTING=$(gh issue list --search "Highlights Index" --state all --limit 1 --json number --jq '.[0].number // empty' 2>/dev/null)
|
|
135
|
+
if [ -z "$EXISTING" ]; then
|
|
136
|
+
gh issue create \
|
|
137
|
+
--title "Highlights Index" \
|
|
138
|
+
--label "highlight" \
|
|
139
|
+
--body "# Product Highlights Index
|
|
140
|
+
|
|
141
|
+
Tracks positive signals from /simulate cycles. Updated automatically — do not edit manually.
|
|
142
|
+
|
|
143
|
+
## Index
|
|
144
|
+
<!-- /simulate appends here -->"
|
|
145
|
+
echo "Highlights Index issue created"
|
|
146
|
+
else
|
|
147
|
+
echo "Highlights Index already exists (#$EXISTING)"
|
|
148
|
+
fi
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## Step 6 — PRODUCT.md
|
|
154
|
+
|
|
155
|
+
Use `codebase brief` as the primary source of project intelligence:
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
npx codebase brief 2>/dev/null > /tmp/cb-brief.json || true
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
Read the brief. If `docs/PRODUCT.md` exists and `--refresh` not passed: show diff of stale sections, ask user to confirm updates.
|
|
162
|
+
|
|
163
|
+
Otherwise generate `docs/PRODUCT.md` from:
|
|
164
|
+
- `project.name`, `project.description` → Summary
|
|
165
|
+
- `stack.languages`, `stack.frameworks`, `commands.*` → Tech Stack (auto-filled)
|
|
166
|
+
- `patterns.architecture`, `patterns.api_style` → Context
|
|
167
|
+
- Route/page file scan → infer User Roles
|
|
168
|
+
- `repo.url` → links
|
|
169
|
+
|
|
170
|
+
Mark genuinely unknown sections with `[INFERRED: ...]`.
|
|
171
|
+
|
|
172
|
+
**Never hardcode example industries, roles, or countries** — infer from codebase or ask the user.
|
|
173
|
+
|
|
174
|
+
Commit:
|
|
175
|
+
```bash
|
|
176
|
+
git checkout develop 2>/dev/null || git checkout -b develop
|
|
177
|
+
git add docs/PRODUCT.md .vibekit/ .gitignore 2>/dev/null || true
|
|
178
|
+
git diff --cached --quiet || git commit -m "chore: bootstrap codebase + vibekit setup
|
|
179
|
+
|
|
180
|
+
Initialized by /setup"
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## Step 7 — Summary
|
|
186
|
+
|
|
187
|
+
```
|
|
188
|
+
/setup COMPLETE
|
|
189
|
+
══════════════════════════════════════════════════
|
|
190
|
+
.codebase.json: generated
|
|
191
|
+
GitHub labels: 13 ready
|
|
192
|
+
Milestone: v0.1 (#N)
|
|
193
|
+
Highlights Index: #N
|
|
194
|
+
docs/PRODUCT.md: [generated | updated]
|
|
195
|
+
Branch: develop
|
|
196
|
+
Claude hooks: git-guard + git-post active
|
|
197
|
+
|
|
198
|
+
Branch convention:
|
|
199
|
+
main protected — only /launch merges here
|
|
200
|
+
develop integration — all work lands here
|
|
201
|
+
feat/<slug> new features → PR to develop
|
|
202
|
+
fix/<slug> bug fixes → PR to develop
|
|
203
|
+
chore/<slug> maintenance → PR to develop
|
|
204
|
+
hotfix/<slug> urgent fixes → PR to develop
|
|
205
|
+
docs/<slug> docs only → PR to develop
|
|
206
|
+
test/<slug> tests only → PR to develop
|
|
207
|
+
|
|
208
|
+
Commit format:
|
|
209
|
+
feat(#N): short description
|
|
210
|
+
fix(#N): short description
|
|
211
|
+
chore: short description
|
|
212
|
+
docs: short description
|
|
213
|
+
|
|
214
|
+
Next steps:
|
|
215
|
+
1. Review docs/PRODUCT.md — fill in [INFERRED] sections
|
|
216
|
+
2. /simulate — AI customer journeys find & fix bugs
|
|
217
|
+
3. /build — implement architectural issues
|
|
218
|
+
4. /launch — gate check, release, merge to main
|
|
219
|
+
══════════════════════════════════════════════════
|
|
220
|
+
```
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Customer journeys (agent-browser) + UX audit (9 dimensions, 3 iterations). Fixes all bugs inline. Outputs GitHub Issues. Uses codebase context.
|
|
3
|
+
argument-hint: [country] [industry] [--count N] [--iterations N] [--cx-only] [--journey-only]
|
|
4
|
+
model: sonnet
|
|
5
|
+
allowed-tools: Agent, Bash(gh:*), Bash(pnpm:*), Bash(npx:*), Bash(npm:*), Bash(git add:*), Bash(git commit:*), Bash(git push:*), Bash(git checkout:*), Bash(git pull:*), Bash(git fetch:*), Bash(git stash:*), Bash(git log:*), Bash(git status:*), Bash(git diff:*), Bash(git rev-parse:*), Bash(git branch:*), Bash(node:*), Bash(curl:*), Bash(uv:*), Read, Write, Edit, Glob, Grep
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# /simulate
|
|
9
|
+
|
|
10
|
+
Simulate real customers via agent-browser, perform a deep UX audit, fix everything fixable inline, and track all output in GitHub Issues. Powered by `codebase` project intelligence.
|
|
11
|
+
|
|
12
|
+
Runs indefinitely (Ctrl+C to stop). Branch: always `develop`. All inline fixes go directly to `develop` as atomic commits (one commit per fix).
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Arguments
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
$ARGUMENTS
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
- First positional word(s) → `country` (optional)
|
|
23
|
+
- Any industry keyword → `industry` (optional)
|
|
24
|
+
- `--count N` — customers per cycle (default: 3)
|
|
25
|
+
- `--iterations N` — UX audit iterations (default: 3)
|
|
26
|
+
- `--cx-only` — UX audit only, skip journeys
|
|
27
|
+
- `--journey-only` — journeys only, skip UX audit
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Phase 0 — Preflight
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
gh auth status || { echo "ERROR: gh auth login first."; exit 1; }
|
|
35
|
+
git remote get-url origin || { echo "ERROR: No git remote."; exit 1; }
|
|
36
|
+
gh label list --limit 1 --json name --jq '.[0].name' 2>/dev/null | grep -q "sim" || {
|
|
37
|
+
echo "Labels not found — run /setup first."; exit 1;
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Load codebase project intelligence
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npx codebase brief 2>/dev/null > /tmp/cb-brief.json || true
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Read `/tmp/cb-brief.json`. Extract and hold in context:
|
|
48
|
+
- `project.name`, `project.description`
|
|
49
|
+
- `commands.dev`, `commands.test`, `commands.build`
|
|
50
|
+
- `stack.frameworks`, `stack.languages`, `stack.package_manager`
|
|
51
|
+
- `patterns.architecture`, `patterns.api_style`
|
|
52
|
+
- `git.default_branch` — verify it's `develop`
|
|
53
|
+
|
|
54
|
+
Load vibekit config:
|
|
55
|
+
```bash
|
|
56
|
+
[ -f ".vibekit/project.env" ] && source .vibekit/project.env || true
|
|
57
|
+
[ -f ".vibekit/milestone.env" ] && source .vibekit/milestone.env || true
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Read PRODUCT.md (required)
|
|
61
|
+
|
|
62
|
+
Read `docs/PRODUCT.md`. If missing → print "Run /setup first." and exit.
|
|
63
|
+
|
|
64
|
+
Extract: **ICP**, **Roles**, **Role tasks**, **Competitive context**, **Dev credentials**.
|
|
65
|
+
|
|
66
|
+
**Never hardcode a country or industry list. Always read from PRODUCT.md.**
|
|
67
|
+
|
|
68
|
+
### Detect cycle number
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
LAST=$(gh issue list --label "cycle" --state all --limit 1 --json title --jq '.[0].title // ""')
|
|
72
|
+
# Parse N from "[Sim] Cycle N", default 0, set CYCLE_N=$((N+1))
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Pull carry-forward bugs and open bugs.
|
|
76
|
+
|
|
77
|
+
### Detect dev server
|
|
78
|
+
|
|
79
|
+
Try ports 3000, 3001, 5173, 8000, 8080, 4000, 4200, 8888 with a quick curl.
|
|
80
|
+
|
|
81
|
+
If none respond, use `commands.dev` from codebase brief:
|
|
82
|
+
```bash
|
|
83
|
+
DEV_CMD=$(node -e "try{const b=require('/tmp/cb-brief.json');console.log(b.commands?.dev||'')}catch{}" 2>/dev/null)
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Node projects: use detected package manager from brief. Python: `uv run dev` or `uv run uvicorn main:app`.
|
|
87
|
+
|
|
88
|
+
### Detect login mechanism
|
|
89
|
+
|
|
90
|
+
1. Check `.vibekit/repo.env` for `DEV_LOGIN_PATH`
|
|
91
|
+
2. Scan route files for `dev-login`, `dev_login`, `bypass`, `quick-login`
|
|
92
|
+
3. Standard form — seed creds from `docs/PRODUCT.md`
|
|
93
|
+
4. OAuth — note and warn
|
|
94
|
+
|
|
95
|
+
Print preflight summary:
|
|
96
|
+
```
|
|
97
|
+
PREFLIGHT — CYCLE [N]
|
|
98
|
+
══════════════════════════════════════════════════
|
|
99
|
+
Project: [name from codebase brief]
|
|
100
|
+
Stack: [frameworks from brief]
|
|
101
|
+
Carry bugs: [N]
|
|
102
|
+
Open bugs: [N]
|
|
103
|
+
Server: http://localhost:[port]
|
|
104
|
+
Login: [method]
|
|
105
|
+
Customers: [N]
|
|
106
|
+
══════════════════════════════════════════════════
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Phases 1–7 — Full Simulation Loop
|
|
112
|
+
|
|
113
|
+
Follow the complete `/vb-simulate` workflow:
|
|
114
|
+
|
|
115
|
+
- **Phase 1** — Customer Journeys (agent-browser, profile generation, triage, inline fixes)
|
|
116
|
+
- **Phase 2** — UX Audit (9 dimensions, 3 iterations, page inventory, IA audit, fixes)
|
|
117
|
+
- **Phase 3** — Performance Audit (Core Web Vitals via CDP)
|
|
118
|
+
- **Phase 4** — Dedup
|
|
119
|
+
- **Phase 5** — GitHub Output ([Sim] Cycle N parent issue, Highlights Index update)
|
|
120
|
+
- **Phase 6** — GTM Sync (DEMO-SEQUENCE.md)
|
|
121
|
+
- **Phase 7** — Status → Loop
|
|
122
|
+
|
|
123
|
+
### codebase integration points
|
|
124
|
+
|
|
125
|
+
**After every inline fix commit**, refresh the manifest so `codebase next` stays current:
|
|
126
|
+
```bash
|
|
127
|
+
npx codebase scan-only --incremental --quiet --sync
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
**Issue creation** uses the standard `gh issue create` flow. After creating any issue, also run:
|
|
131
|
+
```bash
|
|
132
|
+
npx codebase issue create "[title]" --message "[body summary]" 2>/dev/null || true
|
|
133
|
+
```
|
|
134
|
+
This keeps the codebase manifest's issue list in sync.
|
|
135
|
+
|
|
136
|
+
**Pre-work sync (run once at the start of each cycle):**
|
|
137
|
+
```bash
|
|
138
|
+
git fetch origin
|
|
139
|
+
git status # if dirty, stash first: git stash
|
|
140
|
+
git checkout develop && git pull origin develop
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
**Commit convention — one atomic commit per fix, never batch:**
|
|
144
|
+
```bash
|
|
145
|
+
git add [specific files only — never git add .]
|
|
146
|
+
git commit -m "fix([severity]): [short description]
|
|
147
|
+
|
|
148
|
+
Simulation cycle [N] — [role] at [company]
|
|
149
|
+
Page: [route]
|
|
150
|
+
Closes #[issue-N if exists]"
|
|
151
|
+
git push origin develop
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
**If working files are dirty before checkout:**
|
|
155
|
+
```bash
|
|
156
|
+
git stash
|
|
157
|
+
git checkout develop && git pull origin develop
|
|
158
|
+
git stash pop
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
**After each full cycle** run a fresh scan:
|
|
162
|
+
```bash
|
|
163
|
+
npx codebase scan-only --quiet --sync
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
Use agent-browser for all browser automation. One sequential browser session per journey — no parallel tabs. Example session:
|
|
167
|
+
```bash
|
|
168
|
+
agent-browser open http://localhost:[port]
|
|
169
|
+
agent-browser snapshot -i # get @e1, @e2 refs from accessibility tree
|
|
170
|
+
agent-browser click @e1
|
|
171
|
+
agent-browser fill @e2 "value"
|
|
172
|
+
agent-browser screenshot # capture evidence
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
Auth persistence: `agent-browser auth save <role>` after login, `agent-browser auth login <role>` to restore. State: `agent-browser state save/load <name>` between pages.
|
|
176
|
+
|
|
177
|
+
All other behavior follows the `/vb-simulate` specification exactly.
|