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 ADDED
@@ -0,0 +1,309 @@
1
+ # CodeBase
2
+
3
+ <p align="center">
4
+ <img src="https://img.shields.io/npm/v/codebase-ai" alt="npm version" />
5
+ <img src="https://img.shields.io/npm/dm/codebase-ai" alt="npm downloads" />
6
+ <img src="https://img.shields.io/github/license/ZySec-AI/codebase" alt="license" />
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
+ </p>
9
+
10
+ <p align="center">
11
+ <b>One command. Your AI understands your project, finds bugs, fixes them, and ships.</b>
12
+ </p>
13
+
14
+ ---
15
+
16
+ ## The idea in plain English
17
+
18
+ Imagine hiring an engineer who reads your entire project in seconds and works through your bug list on demand. That's what `codebase` does — it gives AI the context and the tools to work *on* your project, not just *for* you.
19
+
20
+ **Without codebase:** Every time you open Claude Code, it starts from zero. You re-explain your project, paste in files, describe what's broken. You're the coordinator. Claude is the cursor.
21
+
22
+ **With codebase:** Claude reads a single compact file that captures everything about your project — your stack, your commands, your open issues. It knows where things are. It knows what needs doing. It can act.
23
+
24
+ **Two things happen:**
25
+
26
+ **1 — Claude gets permanent memory of your project**
27
+ One command scans your project and writes a small snapshot file (`.codebase.json`). Claude reads this automatically on every session via `CLAUDE.md`. You never re-explain your project again.
28
+
29
+ **2 — AI gets the ability to act**
30
+ Seven slash commands give AI a complete workflow: simulate real users in a browser, work through your bug backlog, run tests, commit fixes, and ship releases. Not prompts — real, repeatable actions.
31
+
32
+ ---
33
+
34
+ ## The three commands that matter
35
+
36
+ Once set up, your entire development loop is:
37
+
38
+ ```
39
+ /simulate → /build → /launch
40
+ ```
41
+
42
+ That's it. Here's what each one actually does:
43
+
44
+ ---
45
+
46
+ ### `/simulate` — AI becomes your user
47
+
48
+ Claude opens your app in a real browser (agent-browser) and acts like a real customer. It tries to sign up, log in, complete purchases, hit edge cases. When something breaks or feels wrong, it:
49
+
50
+ 1. Fixes the bug directly in your code
51
+ 2. Commits the fix with a proper message
52
+ 3. Opens a GitHub Issue if the bug is too complex to fix inline
53
+ 4. Records UX problems (confusing copy, broken flows, accessibility issues) as issues
54
+
55
+ After `/simulate`, your repo has real user-found bugs tracked and many already fixed.
56
+
57
+ ---
58
+
59
+ ### `/build` — AI works through your issue backlog
60
+
61
+ Claude reads your open GitHub Issues (prioritized by label), picks the most important one, and implements the fix. It:
62
+
63
+ 1. Reads `codebase brief` to understand your project
64
+ 2. Picks the top issue labeled `vibekit`, `critical`, `high`, or `bug`
65
+ 3. Writes the fix
66
+ 4. Runs your test suite
67
+ 5. Commits if tests pass — or opens a new issue if it gets stuck
68
+ 6. Closes the original issue with a summary of what was done
69
+ 7. Moves to the next issue
70
+ 8. Repeats until the backlog is clear or you stop it
71
+
72
+ This runs in a loop. You can run `/build` once or keep it running until the backlog is clear.
73
+
74
+ ---
75
+
76
+ ### `/launch` — AI ships your release
77
+
78
+ Before merging to `main`, Claude checks four quality gates:
79
+
80
+ | Gate | What it checks |
81
+ |------|---------------|
82
+ | **Bugs** | No open critical or high severity issues |
83
+ | **Tests** | Your full test suite passes |
84
+ | **UX score** | World-class score ≥ 7.0 (from `/simulate` cycles) |
85
+ | **Branch** | No uncommitted changes, branch is clean |
86
+
87
+ If all gates pass, it:
88
+ - Auto-increments your version
89
+ - Tags the release
90
+ - Merges `develop → main` with a proper merge commit
91
+ - Creates a GitHub Release with auto-generated release notes
92
+ - Rotates the milestone
93
+
94
+ One command. Zero manual steps.
95
+
96
+ ---
97
+
98
+ ## Quick start
99
+
100
+ ### Level 1 — Give Claude memory of your project
101
+
102
+ Only requires Node.js 18+.
103
+
104
+ ```bash
105
+ cd your-project
106
+ npx codebase-ai
107
+ ```
108
+
109
+ This scans your project and wires everything automatically:
110
+ - Writes `.codebase.json` — a compact snapshot of your stack, commands, and structure
111
+ - Injects smart instructions into `CLAUDE.md`
112
+ - Configures the MCP server so Claude can query project context natively
113
+ - Installs git hooks so the manifest stays fresh on every commit
114
+ - Updates `.gitignore`
115
+
116
+ That's it. Every Claude session now starts with instant project context — no re-explaining, no file pasting.
117
+
118
+ ---
119
+
120
+ ### Level 2 — Autonomous dev loop
121
+
122
+ > **Requires:** Claude Code (`npm install -g @anthropic-ai/claude-code`) and GitHub CLI (`gh auth login`)
123
+
124
+ Open Claude Code in your project and run `/setup` — this creates `docs/PRODUCT.md` and sets up your first GitHub milestone.
125
+
126
+ Then run the loop:
127
+ ```bash
128
+ /simulate # find and fix bugs as a real user would
129
+ /build # clear the issue backlog
130
+ /launch # ship the release
131
+ ```
132
+
133
+ ---
134
+
135
+ ## Why does Claude actually understand my project?
136
+
137
+ Without codebase, Claude starts every session knowing nothing:
138
+
139
+ ```
140
+ Session start → reads package.json → reads src/ → reads tests/ → reads configs...
141
+ 30 seconds + ~10,000 tokens later: "ok so you're using Next.js..."
142
+ ```
143
+
144
+ With codebase, every session starts instantly:
145
+
146
+ ```
147
+ Session start → reads .codebase.json (~500 tokens)
148
+ "I can see: Next.js 14, Prisma, Vitest, dev server on port 3000,
149
+ 3 open critical bugs, last commit 2 hours ago, milestone v1.2 is 60% done"
150
+ ```
151
+
152
+ **~95% fewer tokens. Instant context. Every session.**
153
+
154
+ The autonomous commands (`/simulate`, `/build`, `/launch`) all read the same manifest. That's why they work without human guidance. They know your stack, your commands, your open issues, your product brief. They're not guessing.
155
+
156
+ ---
157
+
158
+ ## All seven slash commands
159
+
160
+ These live in `.claude/commands/` in your project. Commit this folder to share them with your team.
161
+
162
+ | Command | Plain English |
163
+ |---------|--------------|
164
+ | `/setup` | First-time setup. Creates GitHub labels, your first milestone, and `docs/PRODUCT.md`. Run once per project. |
165
+ | `/simulate` | Opens your app in a real browser. Acts like multiple types of users. Finds bugs, UX problems, and accessibility issues. Fixes what it can, tracks the rest as GitHub Issues. |
166
+ | `/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
+ | `/launch` | Checks quality gates (bugs, tests, UX score). If everything passes: bumps version, tags release, merges to main, publishes GitHub Release. |
168
+ | `/review` | Deep code audit. Checks for security vulnerabilities, code quality problems, outdated/vulnerable dependencies, and accessibility issues. Everything goes to GitHub Issues. |
169
+
170
+ ---
171
+
172
+ ## How the git workflow works
173
+
174
+ codebase enforces a simple convention that makes autonomous commits safe:
175
+
176
+ - **All work happens on `develop`** — the AI commits here
177
+ - **`main` is protected** — direct commits are blocked by a git hook
178
+ - **Releases merge `develop → main`** — only via `codebase release`, with a proper merge commit
179
+ - **One commit per verified fix** — the AI never batches unrelated changes
180
+
181
+ This means you can safely let the AI commit to `develop`. Nothing reaches `main` until you run `/launch` and the quality gates pass.
182
+
183
+ ---
184
+
185
+ ## What gets captured in `.codebase.json`
186
+
187
+ | Category | Examples |
188
+ |----------|---------|
189
+ | **Stack** | TypeScript, Next.js, Prisma, PostgreSQL, Vitest |
190
+ | **Commands** | `npm run dev`, `npm test`, `npm run build` |
191
+ | **Structure** | Where `src/` is, entry points, build output |
192
+ | **Dependencies** | What's installed, what's outdated, what's notable |
193
+ | **Config** | Which env vars exist, feature flags, CI setup |
194
+ | **Git** | Recent commits, active branches, uncommitted changes |
195
+ | **Quality** | Test framework, linter, formatter, pre-commit hooks |
196
+ | **GitHub** | Open issues by priority, PRs, milestones, releases |
197
+ | **Patterns** | Architecture style, API patterns, state management |
198
+
199
+ 30+ languages and 100+ frameworks detected automatically.
200
+
201
+ ---
202
+
203
+ ## MCP Server
204
+
205
+ For AI tools that support Model Context Protocol:
206
+
207
+ ```bash
208
+ codebase mcp # start stdio MCP server
209
+ ```
210
+
211
+ Add to your Claude Code MCP config (`.mcp.json` in project root):
212
+
213
+ ```json
214
+ {
215
+ "mcpServers": {
216
+ "codebase": {
217
+ "command": "npx",
218
+ "args": ["codebase", "mcp"]
219
+ }
220
+ }
221
+ }
222
+ ```
223
+
224
+ Tools available: `project_brief`, `get_codebase`, `query_codebase`, `get_next_task`, `get_blockers`, `create_issue`, `close_issue`, `rescan_project`, `list_commands`.
225
+
226
+ ---
227
+
228
+
229
+ ## Diagnostics
230
+
231
+ ```bash
232
+ codebase doctor # shows exactly what's broken and why
233
+ codebase fix # auto-repairs everything doctor flags
234
+ ```
235
+
236
+ `doctor` checks: manifest freshness, AI tool injection, MCP config, git hooks, commit-msg hook, `.claude/commands/`, and `.gitignore`.
237
+
238
+ ---
239
+
240
+ ## All CLI commands
241
+
242
+ ```bash
243
+ # Setup
244
+ npx codebase # full setup — run once per project
245
+ codebase setup # re-run wiring (updates commands, hooks, tools)
246
+
247
+ # AI interface (what AI tools call)
248
+ codebase brief # full project briefing
249
+ codebase next # highest-priority open issue
250
+ codebase status # kanban board + milestones
251
+ codebase query <path> # any field, e.g. stack.languages or commands.test
252
+
253
+ # Issues
254
+ codebase issue create "title" # create GitHub issue
255
+ codebase issue close <n> --reason "why" # close with reason
256
+ codebase issue comment <n> --message "text" # add comment (audit trail)
257
+
258
+ # Maintenance
259
+ codebase scan # refresh .codebase.json
260
+ codebase release # quality gates → tag → develop→main → GitHub release
261
+ codebase doctor # health check
262
+ codebase fix # auto-repair
263
+
264
+ # Integrations
265
+ codebase mcp # start MCP server
266
+ ```
267
+
268
+ ---
269
+
270
+ ## FAQ
271
+
272
+ **Do I need Claude Code for this to work?**
273
+ Yes. `codebase` is built for Claude Code. The MCP server, slash commands, and autonomous loop all require Claude Code.
274
+
275
+ **What does "autonomous" actually mean — will it break my code?**
276
+ All AI commits go to `develop`. Nothing reaches `main` until you run `/launch` and quality gates pass. You're always in control of what ships. The AI runs tests before committing and opens issues rather than guessing when it's stuck.
277
+
278
+ **Does it send my code to anyone?**
279
+ No. Everything runs locally. The only external calls are to GitHub (via `gh` CLI) and to Anthropic's API (only when you run Claude commands).
280
+
281
+ **Will the git hooks slow down my commits?**
282
+ No. The scan runs in ~200ms on most projects.
283
+
284
+ **What if I don't use GitHub?**
285
+ The manifest and AI tool wiring work without GitHub. You lose issues, PRs, releases, and labels — but the core context injection still works.
286
+
287
+ **My project isn't JavaScript — does it work?**
288
+ Yes. Detectors cover Python, Go, Rust, Ruby, Java, PHP, Swift, C#, and more. The slash commands use `codebase brief` to detect your stack and adapt automatically.
289
+
290
+ **Can my whole team use this?**
291
+ Yes. Commit `.codebase.json` and `.claude/commands/`. Every team member with Claude Code gets the same context and the same slash commands.
292
+
293
+ ---
294
+
295
+ ## Install
296
+
297
+ ```bash
298
+ npm install -g codebase-ai # global (recommended)
299
+ npx codebase-ai # try without installing
300
+ pnpm add -g codebase-ai
301
+ ```
302
+
303
+ Zero runtime dependencies. Node.js 18+ only.
304
+
305
+ ---
306
+
307
+ ## License
308
+
309
+ MIT
@@ -0,0 +1,171 @@
1
+ ---
2
+ description: Autonomous development loop — builds arch issues, simulates, watches for new issues, repeats until production-ready. Uses codebase context.
3
+ argument-hint: [--dry-run] [--issue N] [--once] [--interval N] [--max-rounds 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:*), Read, Write, Edit, Glob, Grep
6
+ ---
7
+
8
+ # /build
9
+
10
+ Autonomous development loop. Builds all open `[Arch]` and `vibekit`-labeled issues, runs the test suite, runs a `/simulate` cycle, polls for new issues, repeats until launch gates pass.
11
+
12
+ Branch: always `develop`. For full arch issues, use a `feat/<slug>` branch → PR → merge to develop.
13
+
14
+ ## Arguments
15
+
16
+ ```
17
+ $ARGUMENTS
18
+ ```
19
+
20
+ - *(no flags)* — full autonomous loop: build → test → simulate → poll → repeat
21
+ - `--dry-run` — show plan only, no implementation
22
+ - `--issue N` — implement only issue #N, then exit
23
+ - `--once` — build all open arch issues once, then exit (no simulate cycle)
24
+ - `--interval N` — polling interval in minutes (default: 5)
25
+ - `--max-rounds N` — safety limit (default: 20)
26
+
27
+ ---
28
+
29
+ ## Prerequisites
30
+
31
+ ```bash
32
+ gh auth status || { echo "ERROR: gh auth login first."; exit 1; }
33
+ git remote get-url origin || { echo "ERROR: No git remote."; exit 1; }
34
+ ```
35
+
36
+ ### Load codebase project intelligence
37
+
38
+ ```bash
39
+ npx codebase brief 2>/dev/null > /tmp/cb-brief.json || true
40
+ ```
41
+
42
+ Read `/tmp/cb-brief.json`. Extract:
43
+ - `commands.test` — use this as the test command (fallback to package.json detection)
44
+ - `commands.dev` — dev server start command
45
+ - `stack.frameworks`, `stack.languages` — implementation context
46
+ - `patterns.architecture` — follow existing patterns
47
+ - `quality.test_framework` — confirms test runner
48
+
49
+ Read `docs/PRODUCT.md` before evaluating any issue. If missing → print "Run /setup first." and exit.
50
+
51
+ Load dev login path:
52
+ ```bash
53
+ DEV_LOGIN_PATH=""
54
+ [ -f ".vibekit/repo.env" ] && DEV_LOGIN_PATH=$(grep "DEV_LOGIN_PATH" .vibekit/repo.env 2>/dev/null | cut -d= -f2)
55
+ ```
56
+
57
+ ### Detect test runner
58
+
59
+ Prefer `commands.test` from codebase brief. Fall back to package.json/pyproject.toml detection.
60
+
61
+ ### Label check
62
+
63
+ ```bash
64
+ gh label list --limit 1 --json name --jq '.[0].name' 2>/dev/null | grep -q "sim" || {
65
+ echo "Labels not found — run /setup first."; exit 1;
66
+ }
67
+ ```
68
+
69
+ ---
70
+
71
+ ## Phase 0 — Orientation
72
+
73
+ Load project board config, define `add_to_project()` helper, parse flags, auto-triage unlabeled issues — all exactly as in `/vb-build`.
74
+
75
+ For the implementation plan, use `codebase next` to surface the highest-priority item first:
76
+ ```bash
77
+ npx codebase next 2>/dev/null || true
78
+ ```
79
+
80
+ ---
81
+
82
+ ## Phases 1–4 — Implementation Loop
83
+
84
+ Follow the complete `/vb-build` workflow:
85
+
86
+ - **Phase 0.5** — Mode selection, approval banner
87
+ - **Phase 1** — Plan (read issues, wait for approval, dry-run exit)
88
+ - **Phase 2** — Implement (read → implement → verify via Playwright → commit → close)
89
+ - **Phase 3** — Carry-forward resolution
90
+ - **Phase 4** — Summary
91
+
92
+ ### codebase integration points
93
+
94
+ **Before implementing each issue**, get fresh context:
95
+ ```bash
96
+ npx codebase brief 2>/dev/null > /tmp/cb-brief.json || true
97
+ ```
98
+
99
+ Read `CLAUDE.md` if present — follow its conventions exactly.
100
+
101
+ **Branch + commit convention:**
102
+
103
+ For small fixes (< 50 lines): commit directly to `develop`.
104
+ For arch issues (significant changes): use a feature branch → PR.
105
+
106
+ ```bash
107
+ # Pre-work: always sync first
108
+ git fetch origin
109
+ git status # abort if dirty uncommitted changes exist
110
+ git checkout develop && git pull origin develop
111
+
112
+ # For arch issues — create a feature branch
113
+ SLUG=$(echo "[issue title]" | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | tr -cd 'a-z0-9-' | cut -c1-40)
114
+ git checkout -b feat/${SLUG}
115
+
116
+ # ... implement the fix ...
117
+
118
+ # Stash if you need to switch context mid-work
119
+ # git stash && git checkout develop && git stash pop
120
+
121
+ # Atomic commit — one commit per issue, never batch unrelated changes
122
+ git add [specific files changed]
123
+ git commit -m "feat(#[N]): [short description]
124
+
125
+ [1-2 sentence description of what was built]
126
+ Closes #[N]"
127
+ git push origin feat/${SLUG}
128
+
129
+ # Raise PR — do not merge directly
130
+ gh pr create \
131
+ --base develop \
132
+ --head feat/${SLUG} \
133
+ --title "feat(#[N]): [short description]" \
134
+ --body "## What
135
+ [description]
136
+
137
+ ## Test evidence
138
+ [test output or Playwright result]
139
+
140
+ Closes #[N]"
141
+
142
+ # After PR is merged, clean up
143
+ git checkout develop && git pull origin develop
144
+ git branch -d feat/${SLUG} 2>/dev/null || true
145
+ ```
146
+
147
+ For direct `develop` commits (small fixes only):
148
+ ```bash
149
+ git checkout develop && git pull origin develop
150
+ git add [specific files changed]
151
+ git commit -m "fix(#[N]): [short description]
152
+
153
+ Closes #[N]"
154
+ git push origin develop
155
+ ```
156
+
157
+ **After closing each issue**, update the manifest so `codebase next` stays current:
158
+ ```bash
159
+ npx codebase scan-only --incremental --quiet --sync
160
+ ```
161
+
162
+ **When closing an issue via gh**:
163
+ ```bash
164
+ gh issue close [N] --comment "Implemented in $(git rev-parse --short HEAD). Verified via Playwright."
165
+ # Also update codebase issue tracking
166
+ npx codebase issue close [N] --reason "Implemented in $(git rev-parse --short HEAD)" 2>/dev/null || true
167
+ ```
168
+
169
+ **simulate step** (in full loop mode): invoke `/simulate` with `--journey-only` on even rounds, full on odd rounds.
170
+
171
+ All other behavior (Playwright verification, project board updates, auto-launch gate, polling) follows the `/vb-build` specification exactly.
@@ -0,0 +1,220 @@
1
+ ---
2
+ description: Gates on open bugs, runs test suite + world-class score check, generates release notes, creates GitHub release, merges develop to main.
3
+ argument-hint: [--version X.Y.Z] [--dry-run]
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 log:*), Bash(git status:*), Bash(git diff:*), Bash(git tag:*), Bash(git rev-parse:*), Bash(git branch:*), Bash(git merge:*), Bash(npx:*), Bash(npm:*), Bash(node:*), Read, Write, Edit, Glob, Grep
6
+ ---
7
+
8
+ # /launch
9
+
10
+ Release manager. Gate on open bugs, generate all release artifacts, create a GitHub release, merge to main.
11
+
12
+ Branch flow: `develop` → `main`.
13
+
14
+ ## Arguments
15
+
16
+ ```
17
+ $ARGUMENTS
18
+ ```
19
+
20
+ - `--version X.Y.Z` — override version tag (default: auto-increment from latest tag)
21
+ - `--dry-run` — run all gates and generate artifacts, do NOT create release or merge
22
+
23
+ ---
24
+
25
+ ## Prerequisites
26
+
27
+ ```bash
28
+ gh auth status || { echo "ERROR: gh auth login first."; exit 1; }
29
+ git remote get-url origin || { echo "ERROR: No git remote."; exit 1; }
30
+ ```
31
+
32
+ ### Load codebase project intelligence
33
+
34
+ ```bash
35
+ npx codebase brief 2>/dev/null > /tmp/cb-brief.json || true
36
+ ```
37
+
38
+ Read the brief. Extract: `project.name`, `project.description`, `commands.test`, `quality.test_framework`.
39
+
40
+ Read `docs/PRODUCT.md` before generating any artifact. Fetch highlights data from the Highlights Index GitHub Issue.
41
+
42
+ ---
43
+
44
+ ## Phase 0 — Gate Check
45
+
46
+ All gates must pass. Any blocking failure exits.
47
+
48
+ ### Gate 1a — No open critical or high bugs
49
+
50
+ ```bash
51
+ gh issue list --label "bug,critical" --state open --limit 10 --json number,title
52
+ gh issue list --label "bug,high" --state open --limit 10 --json number,title
53
+ ```
54
+
55
+ If any exist → print list, exit with "BLOCKED".
56
+
57
+ ### Gate 1b — Test suite passes
58
+
59
+ Use `commands.test` from codebase brief. Fall back to package.json/pyproject.toml detection.
60
+
61
+ ```bash
62
+ TEST_CMD=$(node -e "try{const b=require('/tmp/cb-brief.json');console.log(b.commands?.test||'')}catch{}" 2>/dev/null)
63
+ [ -z "$TEST_CMD" ] && TEST_CMD="npm test"
64
+ ```
65
+
66
+ Run test suite. If failures → print last 10 lines, exit "BLOCKED".
67
+
68
+ If no test files exist: warn (not blocking) — "No tests found. Run /review --test to generate them."
69
+
70
+ ### Gate 1c — World-class score ≥ 7.0
71
+
72
+ Read the most recent `[Sim]` cycle issue body. Parse world-class scores.
73
+
74
+ If average < 7.0 → exit "BLOCKED". If no data → warn only.
75
+
76
+ ### Gate 2 — Carry bugs (warning, not blocking)
77
+
78
+ List open carry bugs — they appear in release notes as known issues.
79
+
80
+ ### Gate 3 — Branch clean and current
81
+
82
+ ```bash
83
+ git fetch origin
84
+ git status --short
85
+ git log HEAD..origin/develop --oneline
86
+ ```
87
+
88
+ If uncommitted changes → exit "BLOCKED: commit or stash all changes first."
89
+ If behind remote → exit "BLOCKED: git pull origin develop".
90
+
91
+ Print gate summary:
92
+ ```
93
+ LAUNCH GATES
94
+ ════════════════════════════════════════════════════════
95
+ Gate 1a — Critical/high bugs: PASS (0 open)
96
+ Gate 1b — Test suite: [PASS | FAIL | WARNING: no tests]
97
+ Gate 1c — World-class score: [PASS (N/10) | FAIL (N/10 < 7.0) | WARNING]
98
+ Gate 2 — Carry bugs: [PASS | WARNING: N open]
99
+ Gate 3 — Branch clean: PASS
100
+ All blocking gates passed. Proceeding.
101
+ ════════════════════════════════════════════════════════
102
+ ```
103
+
104
+ ---
105
+
106
+ ## Phase 1 — Version
107
+
108
+ ```bash
109
+ LATEST=$(git tag --sort=-version:refname | head -1)
110
+ ```
111
+
112
+ - `--version X.Y.Z` passed → use it
113
+ - No tags → `v0.1.0`
114
+ - Tags exist → increment patch
115
+
116
+ ---
117
+
118
+ ## Phase 2 — Release Notes
119
+
120
+ Generate `docs/RELEASE-NOTES.md`:
121
+ - **What's New** — closed `[Arch]` issues since last tag
122
+ - **Bug Fixes** — closed `bug,sim` issues
123
+ - **Improvements** — UX/content improvements
124
+ - **Known Issues** — open carry bugs + open arch issues (honest, never omit)
125
+
126
+ ---
127
+
128
+ ## Phase 3 — Create GitHub Release
129
+
130
+ ```bash
131
+ # Always sync before tagging
132
+ git fetch origin
133
+ git checkout develop && git pull origin develop
134
+ git tag -a [version] -m "Release [version]"
135
+ git push origin [version]
136
+
137
+ gh release create [version] \
138
+ --title "v[version]" \
139
+ --notes-file docs/RELEASE-NOTES.md \
140
+ --target develop
141
+ ```
142
+
143
+ If `--dry-run`: print what would be created, skip.
144
+
145
+ ---
146
+
147
+ ## Phase 4 — Merge to Main
148
+
149
+ ```bash
150
+ git checkout main && git pull origin main
151
+ git merge develop --no-ff -m "Release [version]"
152
+ git push origin main
153
+ git checkout develop
154
+ ```
155
+
156
+ If `--dry-run`: print what would happen, skip.
157
+
158
+ ---
159
+
160
+ ## Phase 5 — Milestone rotation
161
+
162
+ Load `.vibekit/milestone.env`. Close current milestone. Create next (increment minor: v0.1 → v0.2).
163
+
164
+ ---
165
+
166
+ ## Phase 6 — Refresh codebase manifest
167
+
168
+ ```bash
169
+ npx codebase scan-only --quiet --sync
170
+ ```
171
+
172
+ This updates `.codebase.json` with the new release tag so `codebase brief` reflects the released version.
173
+
174
+ ---
175
+
176
+ ## Phase 7 — Summary
177
+
178
+ ```
179
+ /launch COMPLETE
180
+ ════════════════════════════════════════════════════════
181
+ Version: [version]
182
+ Release date: [date]
183
+ GitHub release: [URL]
184
+
185
+ Artifacts:
186
+ docs/RELEASE-NOTES.md
187
+
188
+ develop → main: merged
189
+ Tag [version]: pushed
190
+ Milestone: [v0.1 closed → v0.2 created]
191
+ .codebase.json: refreshed
192
+
193
+ [If --dry-run: DRY RUN — no release, no merge]
194
+ ════════════════════════════════════════════════════════
195
+ ```
196
+
197
+ ---
198
+
199
+ ## Ground Rules
200
+
201
+ 1. **Gates 1a/1b/1c failures always block** — no exceptions
202
+ 2. **Grounded release notes** — every item traceable to a closed GitHub Issue
203
+ 3. **main is production** — merging to main is the last step, only via /launch
204
+ 4. **Dry-run is safe** — never touches git history or creates releases
205
+ 5. **Honest known issues** — never omit carry bugs or open arch from release notes
206
+ 6. **No force push ever** — use `git revert` to undo commits
207
+ 7. **No direct push to main** — only the merge step in Phase 4 touches main
208
+
209
+ ## Branch Convention (reference)
210
+
211
+ ```
212
+ main protected — only /launch merges here
213
+ develop integration branch — all work lands here
214
+ feat/<slug> new features (→ PR to develop)
215
+ fix/<slug> bug fixes (→ PR to develop)
216
+ chore/<slug> maintenance (→ PR to develop)
217
+ hotfix/<slug> urgent prod fixes (→ PR to develop, then /launch fast-track)
218
+ docs/<slug> documentation only (→ PR to develop)
219
+ test/<slug> test additions (→ PR to develop)
220
+ ```