codebase-ai 0.3.1 → 0.3.2

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.
@@ -0,0 +1,257 @@
1
+ ---
2
+ description: Full autonomous loop — simulate → build → launch, repeating until shipped. Zero intervention required.
3
+ argument-hint: [--max-rounds N] [--version X.Y.Z] [--dry-run] [--skip-launch] [--sim-count N]
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 tag:*), Bash(git rev-parse:*), Bash(git branch:*), Bash(git merge:*), Bash(pnpm:*), Bash(npx:*), Bash(npm:*), Bash(node:*), Bash(uv:*), Bash(curl:*), Read, Write, Edit, Glob, Grep
6
+ ---
7
+
8
+ # /vibeloop
9
+
10
+ **The single command that does everything.** Runs simulate → build → launch in a fully autonomous loop until your project is shipped. No human intervention required after invocation.
11
+
12
+ ```
13
+ /vibeloop # full run: simulate → build → launch
14
+ /vibeloop --skip-launch # simulate → build only, stop before release
15
+ /vibeloop --dry-run # full run with --dry-run passed to launch (no actual release/merge)
16
+ /vibeloop --max-rounds 5 # cap the build loop at 5 rounds (default: 20)
17
+ /vibeloop --sim-count 5 # number of simulated customers per cycle (default: 3)
18
+ /vibeloop --version 1.2.0 # pin the release version tag
19
+ ```
20
+
21
+ ---
22
+
23
+ ## Arguments
24
+
25
+ ```
26
+ $ARGUMENTS
27
+ ```
28
+
29
+ Parse from `$ARGUMENTS`:
30
+ - `--max-rounds N` → cap build loop rounds (default: 20)
31
+ - `--version X.Y.Z` → pin release version (passed to /launch)
32
+ - `--dry-run` → no commits to main, no GitHub release (passed to /launch)
33
+ - `--skip-launch` → stop after build loop, do not release
34
+ - `--sim-count N` → customers per simulate cycle (default: 3)
35
+
36
+ ---
37
+
38
+ ## Phase 0 — Preflight
39
+
40
+ ```bash
41
+ gh auth status || { echo "ERROR: gh auth login first."; exit 1; }
42
+ git remote get-url origin || { echo "ERROR: No git remote."; exit 1; }
43
+ gh label list --limit 1 --json name --jq '.[0].name' 2>/dev/null | grep -q "sim" || {
44
+ echo "Labels not found — run /setup first."; exit 1;
45
+ }
46
+ [ -f "docs/PRODUCT.md" ] || { echo "docs/PRODUCT.md missing — run /setup first."; exit 1; }
47
+ ```
48
+
49
+ ### Load codebase project intelligence
50
+
51
+ ```bash
52
+ npx codebase brief 2>/dev/null > /tmp/cb-brief.json || true
53
+ ```
54
+
55
+ Read `/tmp/cb-brief.json`. Extract and hold in context:
56
+ - `project.name`, `project.description`
57
+ - `commands.dev`, `commands.test`, `commands.build`
58
+ - `stack.frameworks`, `stack.languages`, `stack.package_manager`
59
+ - `git.default_branch` — verify it's `develop`
60
+
61
+ Ensure on develop and clean:
62
+ ```bash
63
+ git fetch origin
64
+ git checkout develop && git pull origin develop
65
+ git status --short # warn if dirty but don't block
66
+ ```
67
+
68
+ Print the startup banner:
69
+ ```
70
+ ╔══════════════════════════════════════════════════════════╗
71
+ ║ /vibeloop STARTING ║
72
+ ╠══════════════════════════════════════════════════════════╣
73
+ ║ Project: [name from brief] ║
74
+ ║ Stack: [frameworks from brief] ║
75
+ ║ Mode: simulate → build → launch ║
76
+ ║ Max rounds: [N] ║
77
+ ║ Sim customers:[N] per cycle ║
78
+ ║ Launch: [yes | --skip-launch | --dry-run] ║
79
+ ╚══════════════════════════════════════════════════════════╝
80
+ ```
81
+
82
+ ---
83
+
84
+ ## Phase 1 — Simulate (seed the issue queue)
85
+
86
+ Run a full simulation cycle to find bugs before building anything.
87
+
88
+ ### 1a. Run customer journeys
89
+
90
+ Invoke the full `/simulate` logic as a sub-agent:
91
+
92
+ Use the Agent tool to run one complete simulation cycle (Phase 0 through Phase 6 of /simulate). Pass `--count [sim-count]`. The simulation should:
93
+ - Run `[sim-count]` customer journeys against the live dev server
94
+ - Perform the 9-dimension UX audit
95
+ - Fix all fixable bugs inline with atomic commits
96
+ - Create GitHub issues for all findings
97
+ - Write the cycle summary issue
98
+
99
+ When the simulation cycle completes (one full pass), return to this orchestrator.
100
+
101
+ **Do not run /simulate in its own infinite loop** — vibeloop controls the outer loop. Run exactly one simulate cycle here.
102
+
103
+ ### 1b. Count open issues after simulate
104
+
105
+ ```bash
106
+ ARCH=$(gh issue list --label "arch" --state open --json number --jq 'length')
107
+ BUGS=$(gh issue list --label "bug" --state open --json number --jq 'length')
108
+ ```
109
+
110
+ Print:
111
+ ```
112
+ PHASE 1 COMPLETE — Simulate seeded [N] arch issues, [N] bug issues
113
+ ```
114
+
115
+ If `$ARCH == 0` and `$BUGS == 0`:
116
+ - Print "No issues found. Project looks clean."
117
+ - Skip Phase 2 and proceed directly to Phase 3.
118
+
119
+ ---
120
+
121
+ ## Phase 2 — Build loop
122
+
123
+ Run the full `/build` loop to resolve all arch and bug issues found by simulate.
124
+
125
+ ### 2a. Outer loop (controlled by vibeloop)
126
+
127
+ This phase repeats until either:
128
+ - All `arch` + `vibekit` labeled issues are closed AND no open `bug` issues remain, OR
129
+ - `--max-rounds` is reached
130
+
131
+ For each round:
132
+
133
+ **Step 1 — Build all arch/vibekit issues:**
134
+
135
+ Use the Agent tool to run one full `/build --once` pass (Phase 0 through Phase 2 of /build, then exit). This implements every open `arch`/`vibekit` issue once without running the inner simulate/poll loop — vibeloop controls that loop here.
136
+
137
+ **Step 2 — Simulate verification:**
138
+
139
+ Use the Agent tool to run one `/simulate --journey-only --count [sim-count]` cycle (customer journeys only, no full UX audit). This verifies the build didn't break anything and may find new bugs.
140
+
141
+ **Step 3 — Check gates:**
142
+
143
+ ```bash
144
+ npx codebase scan-only --quiet --sync
145
+ ARCH=$(gh issue list --label "arch" --state open --json number --jq 'length')
146
+ BUGS=$(gh issue list --label "bug,critical" --state open --json number --jq 'length')
147
+ BUGS_HIGH=$(gh issue list --label "bug,high" --state open --json number --jq 'length')
148
+ ```
149
+
150
+ Print round summary:
151
+ ```
152
+ VIBELOOP ROUND [R] / [max-rounds]
153
+ ════════════════════════════════════════════════════
154
+ Arch issues remaining: [N]
155
+ Critical/high bugs: [N]
156
+ Status: [continuing | all clear]
157
+ ════════════════════════════════════════════════════
158
+ ```
159
+
160
+ If `$ARCH == 0` and `$BUGS == 0` and `$BUGS_HIGH == 0`: break loop → proceed to Phase 3.
161
+
162
+ If round >= `--max-rounds`: print "Max rounds reached. Some issues may remain." → proceed to Phase 3 anyway.
163
+
164
+ Otherwise: increment round, repeat Step 1.
165
+
166
+ ### 2b. Final full simulate (pre-launch verification)
167
+
168
+ Before launching, run one final comprehensive simulate cycle:
169
+
170
+ Use the Agent tool to run one complete `/simulate` cycle (all phases). This is the final QA gate — any bugs found here must be fixed before launch can proceed.
171
+
172
+ ```bash
173
+ BUGS=$(gh issue list --label "bug,critical" --state open --json number --jq 'length')
174
+ BUGS_HIGH=$(gh issue list --label "bug,high" --state open --json number --jq 'length')
175
+ ```
176
+
177
+ If critical or high bugs remain after final simulate:
178
+ - Print "Final simulate found blocking bugs. Running one more build pass."
179
+ - Return to Phase 2a for one more round (hard cap at 3 extra rounds regardless of --max-rounds).
180
+
181
+ ---
182
+
183
+ ## Phase 3 — Launch
184
+
185
+ Skip this phase entirely if `--skip-launch` was passed. Print "Skipping launch (--skip-launch). Done." and exit.
186
+
187
+ ### 3a. Pre-launch gate summary
188
+
189
+ ```bash
190
+ CRITICAL=$(gh issue list --label "bug,critical" --state open --json number --jq 'length')
191
+ HIGH=$(gh issue list --label "bug,high" --state open --json number --jq 'length')
192
+ ARCH=$(gh issue list --label "arch" --state open --json number --jq 'length')
193
+ ```
194
+
195
+ Print:
196
+ ```
197
+ PRE-LAUNCH STATUS
198
+ ════════════════════════════════════════════════════
199
+ Critical bugs: [N] [BLOCKED if > 0]
200
+ High bugs: [N] [BLOCKED if > 0]
201
+ Arch issues: [N] [WARNING if > 0]
202
+ ════════════════════════════════════════════════════
203
+ ```
204
+
205
+ If `$CRITICAL > 0` or `$HIGH > 0`:
206
+ - Print "BLOCKED: Open critical/high bugs prevent launch. Fix them first or run /launch --dry-run to inspect."
207
+ - Exit.
208
+
209
+ ### 3b. Execute launch
210
+
211
+ Use the Agent tool to run the full `/launch` logic (all phases of /launch). Pass:
212
+ - `--version [version]` if `--version` was specified
213
+ - `--dry-run` if `--dry-run` was specified
214
+
215
+ The launch sub-agent will:
216
+ - Run all gate checks (bugs, tests, UX scores, branch cleanliness)
217
+ - Generate `docs/RELEASE-NOTES.md`
218
+ - Create the GitHub release and tag
219
+ - Merge `develop` → `main`
220
+ - Rotate the milestone
221
+ - Refresh the codebase manifest
222
+
223
+ ---
224
+
225
+ ## Phase 4 — Final Summary
226
+
227
+ ```
228
+ ╔══════════════════════════════════════════════════════════╗
229
+ ║ /vibeloop COMPLETE ║
230
+ ╠══════════════════════════════════════════════════════════╣
231
+ ║ Simulate cycles: [N] ║
232
+ ║ Build rounds: [N] ║
233
+ ║ Issues implemented: [N] ║
234
+ ║ Bugs fixed inline: [N] ║
235
+ ║ Version released: [vX.Y.Z | --dry-run | skipped] ║
236
+ ║ develop → main: [merged | --dry-run | skipped] ║
237
+ ╚══════════════════════════════════════════════════════════╝
238
+
239
+ Next steps:
240
+ • Check GitHub releases for the release notes
241
+ • Run /vibeloop again next sprint to start a new cycle
242
+ • Use /simulate for targeted UX testing
243
+ • Use /build --issue N to fix a specific issue
244
+ ```
245
+
246
+ ---
247
+
248
+ ## Ground Rules
249
+
250
+ 1. **One agent per phase** — simulate, build, and launch each run as isolated sub-agents via the Agent tool
251
+ 2. **vibeloop controls the outer loop** — do not let /build or /simulate run their own infinite loops; vibeloop orchestrates timing
252
+ 3. **Never force push** — if git state is broken, investigate before acting
253
+ 4. **Hard stop on launch blockers** — critical/high bugs always block Phase 3, no overrides
254
+ 5. **Atomic commits throughout** — every fix in every sub-agent must be `git add [specific files]`, never `git add .`
255
+ 6. **Dry-run is always safe** — `--dry-run` must propagate to all sub-agents and never touch `main` or create releases
256
+ 7. **Max-rounds is a safety net** — if hit, proceed to launch anyway (with warnings in release notes about remaining issues)
257
+ 8. **Always on develop** — vibeloop never switches away from develop except for the final merge to main in /launch