codebase-ai 0.3.1 → 0.3.3

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 ZySec-AI
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -5,6 +5,8 @@
5
5
  <img src="https://img.shields.io/npm/dm/codebase-ai" alt="npm downloads" />
6
6
  <img src="https://img.shields.io/github/license/ZySec-AI/codebase" alt="license" />
7
7
  <a href="https://github.com/ZySec-AI/codebase/stargazers"><img src="https://img.shields.io/github/stars/ZySec-AI/codebase?style=social" alt="GitHub stars"></a>
8
+ <a href="https://github.com/ZySec-AI/codebase/actions/workflows/ci.yml"><img src="https://github.com/ZySec-AI/codebase/actions/workflows/ci.yml/badge.svg" alt="CI" /></a>
9
+ <a href="https://securityscorecards.dev/viewer/?uri=github.com/ZySec-AI/codebase"><img src="https://api.securityscorecards.dev/projects/github.com/ZySec-AI/codebase/badge" alt="OpenSSF Scorecard" /></a>
8
10
  </p>
9
11
 
10
12
  <p align="center">
@@ -31,7 +33,7 @@ Seven slash commands give AI a complete workflow: simulate real users in a brows
31
33
 
32
34
  ---
33
35
 
34
- ## The three commands that matter
36
+ ## The loop
35
37
 
36
38
  Once set up, your entire development loop is:
37
39
 
@@ -39,7 +41,13 @@ Once set up, your entire development loop is:
39
41
  /simulate → /build → /launch
40
42
  ```
41
43
 
42
- That's it. Here's what each one actually does:
44
+ Or if you want zero intervention — one command that runs the entire loop automatically:
45
+
46
+ ```
47
+ /vibeloop
48
+ ```
49
+
50
+ Here's what each step does:
43
51
 
44
52
  ---
45
53
 
@@ -155,7 +163,7 @@ The autonomous commands (`/simulate`, `/build`, `/launch`) all read the same man
155
163
 
156
164
  ---
157
165
 
158
- ## All seven slash commands
166
+ ## All slash commands
159
167
 
160
168
  These live in `.claude/commands/` in your project. Commit this folder to share them with your team.
161
169
 
@@ -166,6 +174,22 @@ These live in `.claude/commands/` in your project. Commit this folder to share t
166
174
  | `/build` | Reads your open GitHub Issues. Picks the most important one. Implements the fix. Tests it. Commits it. Closes the issue. Moves to the next. Repeats. |
167
175
  | `/launch` | Checks quality gates (bugs, tests, UX score). If everything passes: bumps version, tags release, merges to main, publishes GitHub Release. |
168
176
  | `/review` | Deep code audit. Checks for security vulnerabilities, code quality problems, outdated/vulnerable dependencies, and accessibility issues. Everything goes to GitHub Issues. |
177
+ | `/vibeloop` | **The single command that does everything.** Runs `/simulate → /build → /launch` in a fully autonomous loop until your project is shipped. Zero human intervention required. |
178
+
179
+ ### `/vibeloop` — the one command to rule them all
180
+
181
+ If you only remember one command, make it this one:
182
+
183
+ ```
184
+ /vibeloop # full autonomous run: simulate → build → launch
185
+ /vibeloop --skip-launch # simulate → build only, stop before release
186
+ /vibeloop --dry-run # full run without committing to main or publishing
187
+ /vibeloop --max-rounds 5 # cap the build loop at 5 rounds (default: 20)
188
+ /vibeloop --sim-count 5 # number of simulated users per cycle (default: 3)
189
+ /vibeloop --version 1.2.0 # pin the release version tag
190
+ ```
191
+
192
+ `/vibeloop` runs the full loop repeatedly — simulate real users, fix what breaks, clear the issue backlog, ship the release — without you touching the keyboard. You invoke it once and come back to a shipped, tested, tagged release.
169
193
 
170
194
  ---
171
195
 
@@ -307,6 +331,22 @@ Zero runtime dependencies. Node.js 20+ only.
307
331
 
308
332
  ---
309
333
 
334
+ ## Contributing
335
+
336
+ We welcome contributions! Please read [CONTRIBUTING.md](CONTRIBUTING.md) for
337
+ guidelines on how to get started, our commit conventions, and the PR process.
338
+
339
+ Found a security issue? See [SECURITY.md](SECURITY.md) — do not open a public issue.
340
+
341
+ ## Changelog
342
+
343
+ See [CHANGELOG.md](CHANGELOG.md) for a full version history.
344
+
345
+ ## Code of Conduct
346
+
347
+ This project follows a [Code of Conduct](CODE_OF_CONDUCT.md).
348
+ By participating, you agree to uphold it.
349
+
310
350
  ## License
311
351
 
312
- MIT
352
+ MIT — see [LICENSE](LICENSE) for details.
@@ -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