codebase-ai 0.3.3 → 0.3.5

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 CHANGED
@@ -1,4 +1,6 @@
1
- # CodeBase
1
+ <p align="center">
2
+ <img src="assets/logo.svg" alt="codebase" width="800"/>
3
+ </p>
2
4
 
3
5
  <p align="center">
4
6
  <img src="https://img.shields.io/npm/v/codebase-ai" alt="npm version" />
@@ -9,176 +11,101 @@
9
11
  <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>
10
12
  </p>
11
13
 
12
- <p align="center">
13
- <b>One command. Your AI understands your project, finds bugs, fixes them, and ships.</b>
14
- </p>
15
-
16
14
  ---
17
15
 
18
- ## The idea in plain English
19
-
20
- 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.
21
-
22
- **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.
23
-
24
- **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.
25
-
26
- **Two things happen:**
27
-
28
- **1 — Claude gets permanent memory of your project**
29
- 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.
30
-
31
- **2 — AI gets the ability to act**
32
- 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.
16
+ > **~95% fewer tokens.** Claude reads one 500-token snapshot instead of exploring thousands of files. Instant context, every session.
33
17
 
34
18
  ---
35
19
 
36
- ## The loop
37
-
38
- Once set up, your entire development loop is:
20
+ ## Install
39
21
 
40
- ```
41
- /simulate → /build → /launch
22
+ ```bash
23
+ npm install -g codebase-ai
42
24
  ```
43
25
 
44
- Or if you want zero intervention — one command that runs the entire loop automatically:
26
+ Then in your project:
45
27
 
28
+ ```bash
29
+ npx codebase-ai
46
30
  ```
47
- /vibeloop
48
- ```
49
-
50
- Here's what each step does:
51
-
52
- ---
53
-
54
- ### `/simulate` — AI becomes your user
55
-
56
- 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:
57
31
 
58
- 1. Fixes the bug directly in your code
59
- 2. Commits the fix with a proper message
60
- 3. Opens a GitHub Issue if the bug is too complex to fix inline
61
- 4. Records UX problems (confusing copy, broken flows, accessibility issues) as issues
32
+ That's it. Every Claude session now starts with instant project context.
62
33
 
63
- After `/simulate`, your repo has real user-found bugs tracked and many already fixed.
34
+ > Requires Node.js 20+. For the autonomous loop, also install [Claude Code](https://www.npmjs.com/package/@anthropic-ai/claude-code) and run `gh auth login`.
64
35
 
65
36
  ---
66
37
 
67
- ### `/build` AI works through your issue backlog
38
+ ## What it does
68
39
 
69
- Claude reads your open GitHub Issues (prioritized by label), picks the most important one, and implements the fix. It:
40
+ `codebase` is a vibecoding loop built around three ideas:
70
41
 
71
- 1. Reads `codebase brief` to understand your project
72
- 2. Picks the top issue labeled `vibekit`, `critical`, `high`, or `bug`
73
- 3. Writes the fix
74
- 4. Runs your test suite
75
- 5. Commits if tests pass — or opens a new issue if it gets stuck
76
- 6. Closes the original issue with a summary of what was done
77
- 7. Moves to the next issue
78
- 8. Repeats until the backlog is clear or you stop it
42
+ - **Codebase = brain.** One scan writes a compact snapshot (`.codebase.json`) your stack, commands, open issues, recent decisions. AI reads this instead of exploring files. ~95% fewer tokens, instant context.
43
+ - **GitHub = memory.** Issues, PRs, and labels are the persistent state. The loop can restart anytime and pick up where it left off.
44
+ - **Claude = execution.** Slash commands give AI a complete workflow: simulate real users, fix bugs, run tests, commit, ship.
79
45
 
80
- This runs in a loop. You can run `/build` once or keep it running until the backlog is clear.
46
+ Multiple developers can jump into the same loop. Commit `.codebase.json` and `.claude/commands/` everyone gets the same context and commands.
81
47
 
82
48
  ---
83
49
 
84
- ### `/launch` — AI ships your release
50
+ ## The loop
85
51
 
86
- Before merging to `main`, Claude checks four quality gates:
52
+ <p align="center">
53
+ <img src="assets/loop.svg" alt="codebase loop animation" width="800"/>
54
+ </p>
87
55
 
88
- | Gate | What it checks |
89
- |------|---------------|
90
- | **Bugs** | No open critical or high severity issues |
91
- | **Tests** | Your full test suite passes |
92
- | **UX score** | World-class score ≥ 7.0 (from `/simulate` cycles) |
93
- | **Branch** | No uncommitted changes, branch is clean |
56
+ Or run the entire loop hands-free with one command:
94
57
 
95
- If all gates pass, it:
96
- - Auto-increments your version
97
- - Tags the release
98
- - Merges `develop → main` with a proper merge commit
99
- - Creates a GitHub Release with auto-generated release notes
100
- - Rotates the milestone
58
+ ```
59
+ /vibeloop
60
+ ```
101
61
 
102
- One command. Zero manual steps.
62
+ | Command | What it does |
63
+ |---------|-------------|
64
+ | `/simulate` | Opens your app in a real browser. Acts like real users. Fixes bugs inline, tracks complex ones as GitHub Issues. |
65
+ | `/build` | Reads open issues, picks the highest priority, implements the fix, tests it, commits, closes the issue. Repeats. |
66
+ | `/launch` | Checks quality gates (open bugs, test suite, UX score). If all pass: bumps version, tags release, merges to main, publishes GitHub Release. |
67
+ | `/vibeloop` | **Runs everything.** Continuous `/simulate → /build → /launch` loop. Zero intervention. |
68
+
69
+ First time? Run `/setup` in Claude Code to create `docs/PRODUCT.md` and your first milestone.
103
70
 
104
71
  ---
105
72
 
106
73
  ## Quick start
107
74
 
108
- ### Level 1 — Give Claude memory of your project
109
-
110
- Only requires Node.js 20+.
75
+ **Level 1 — Give Claude memory of your project** (Node.js only)
111
76
 
112
77
  ```bash
113
78
  cd your-project
114
79
  npx codebase-ai
115
80
  ```
116
81
 
117
- This scans your project and wires everything automatically:
118
- - Writes `.codebase.json` — a compact snapshot of your stack, commands, and structure
119
- - Injects smart instructions into `CLAUDE.md`
120
- - Configures the MCP server so Claude can query project context natively
121
- - Installs git hooks so the manifest stays fresh on every commit
122
- - Updates `.gitignore`
82
+ Scans your project and wires everything: `.codebase.json`, `CLAUDE.md`, MCP server, git hooks, `.gitignore`.
123
83
 
124
- That's it. Every Claude session now starts with instant project context no re-explaining, no file pasting.
84
+ **Level 2Autonomous dev loop**
125
85
 
126
- ---
127
-
128
- ### Level 2 — Autonomous dev loop
129
-
130
- > **Requires:** Claude Code (`npm install -g @anthropic-ai/claude-code`) and GitHub CLI (`gh auth login`)
131
-
132
- Open Claude Code in your project and run `/setup` — this creates `docs/PRODUCT.md` and sets up your first GitHub milestone.
133
-
134
- Then run the loop:
135
86
  ```bash
136
- /simulate # find and fix bugs as a real user would
137
- /build # clear the issue backlog
138
- /launch # ship the release
87
+ npm install -g @anthropic-ai/claude-code
88
+ gh auth login
139
89
  ```
140
90
 
141
- ---
142
-
143
- ## Why does Claude actually understand my project?
144
-
145
- Without codebase, Claude starts every session knowing nothing:
91
+ Open Claude Code in your project, then:
146
92
 
147
93
  ```
148
- Session start → reads package.json → reads src/ reads tests/ → reads configs...
149
- 30 seconds + ~10,000 tokens later: "ok so you're using Next.js..."
94
+ /setup ← run once
95
+ /simulate ← find & fix bugs
96
+ /build ← clear the backlog
97
+ /launch ← ship
150
98
  ```
151
99
 
152
- With codebase, every session starts instantly:
100
+ Or just:
153
101
 
154
102
  ```
155
- Session start reads .codebase.json (~500 tokens)
156
- "I can see: Next.js 14, Prisma, Vitest, dev server on port 3000,
157
- 3 open critical bugs, last commit 2 hours ago, milestone v1.2 is 60% done"
103
+ /vibeloop ← does all of the above, continuously
158
104
  ```
159
105
 
160
- **~95% fewer tokens. Instant context. Every session.**
161
-
162
- 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.
163
-
164
106
  ---
165
107
 
166
- ## All slash commands
167
-
168
- These live in `.claude/commands/` in your project. Commit this folder to share them with your team.
169
-
170
- | Command | Plain English |
171
- |---------|--------------|
172
- | `/setup` | First-time setup. Creates GitHub labels, your first milestone, and `docs/PRODUCT.md`. Run once per project. |
173
- | `/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. |
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. |
175
- | `/launch` | Checks quality gates (bugs, tests, UX score). If everything passes: bumps version, tags release, merges to main, publishes GitHub Release. |
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:
108
+ ## `/vibeloop` zero intervention mode
182
109
 
183
110
  ```
184
111
  /vibeloop # full autonomous run: simulate → build → launch
@@ -189,51 +116,41 @@ If you only remember one command, make it this one:
189
116
  /vibeloop --version 1.2.0 # pin the release version tag
190
117
  ```
191
118
 
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.
119
+ Invoke once. Come back to a shipped, tested, tagged release.
193
120
 
194
121
  ---
195
122
 
196
- ## How the git workflow works
197
-
198
- codebase enforces a simple convention that makes autonomous commits safe:
199
-
200
- - **All work happens on `develop`** — the AI commits here
201
- - **`main` is protected** — direct commits are blocked by a git hook
202
- - **Releases merge `develop → main`** — only via `codebase release`, with a proper merge commit
203
- - **One commit per verified fix** — the AI never batches unrelated changes
123
+ ## All CLI commands
204
124
 
205
- This means you can safely let the AI commit to `develop`. Nothing reaches `main` until you run `/launch` and the quality gates pass.
125
+ ```bash
126
+ # First run
127
+ npx codebase-ai # scan + wire AI tools + hooks
206
128
 
207
- ---
129
+ # Re-wire after adding a new AI tool
130
+ codebase setup
208
131
 
209
- ## What gets captured in `.codebase.json`
132
+ # AI interface
133
+ codebase brief # full project briefing
134
+ codebase next # highest-priority open issue
135
+ codebase status # kanban board + milestones
136
+ codebase query <path> # e.g. stack.languages or commands.test
210
137
 
211
- | Category | Examples |
212
- |----------|---------|
213
- | **Stack** | TypeScript, Next.js, Prisma, PostgreSQL, Vitest |
214
- | **Commands** | `npm run dev`, `npm test`, `npm run build` |
215
- | **Structure** | Where `src/` is, entry points, build output |
216
- | **Dependencies** | What's installed, what's outdated, what's notable |
217
- | **Config** | Which env vars exist, feature flags, CI setup |
218
- | **Git** | Recent commits, active branches, uncommitted changes |
219
- | **Quality** | Test framework, linter, formatter, pre-commit hooks |
220
- | **GitHub** | Open issues by priority, PRs, milestones, releases |
221
- | **Patterns** | Architecture style, API patterns, state management |
138
+ # Issues
139
+ codebase issue create "title"
140
+ codebase issue close <n> --reason "why"
141
+ codebase issue comment <n> --message "text"
222
142
 
223
- 30+ languages and 100+ frameworks detected automatically.
143
+ # Maintenance
144
+ codebase scan # refresh .codebase.json
145
+ codebase doctor # health check
146
+ codebase fix # auto-repair
147
+ codebase mcp # start MCP server
148
+ ```
224
149
 
225
150
  ---
226
151
 
227
152
  ## MCP Server
228
153
 
229
- For AI tools that support Model Context Protocol:
230
-
231
- ```bash
232
- codebase mcp # start stdio MCP server
233
- ```
234
-
235
- Add to your Claude Code MCP config (`.mcp.json` in project root):
236
-
237
154
  ```json
238
155
  {
239
156
  "mcpServers": {
@@ -245,96 +162,40 @@ Add to your Claude Code MCP config (`.mcp.json` in project root):
245
162
  }
246
163
  ```
247
164
 
248
- Tools available: `project_brief`, `get_codebase`, `query_codebase`, `get_next_task`, `get_blockers`, `create_issue`, `close_issue`, `rescan_project`, `list_commands`.
165
+ Add to `.mcp.json` in your project root. Tools: `project_brief`, `get_codebase`, `query_codebase`, `get_next_task`, `get_blockers`, `create_issue`, `close_issue`, `rescan_project`, `list_commands`.
249
166
 
250
167
  ---
251
168
 
169
+ ## Team usage
252
170
 
253
- ## Diagnostics
254
-
255
- ```bash
256
- codebase doctor # shows exactly what's broken and why
257
- codebase fix # auto-repairs everything doctor flags
258
- ```
259
-
260
- `doctor` checks: manifest freshness, AI tool injection, MCP config, git hooks, commit-msg hook, `.claude/commands/`, and `.gitignore`.
261
-
262
- ---
263
-
264
- ## All CLI commands
265
-
266
- ```bash
267
- # Setup
268
- # Use `npx codebase` / `codebase init` the first time: scans your project AND wires AI tools + hooks.
269
- # Use `codebase setup` to re-wire AI tools and hooks only — it does NOT re-scan. Run it when you
270
- # add a new AI tool or need to reinstall hooks on an existing project.
271
- npx codebase # full setup — scan + wire AI tools + hooks (run once per project)
272
- codebase setup # re-wire AI tools and hooks only (no scan)
273
-
274
- # AI interface (what AI tools call)
275
- codebase brief # full project briefing
276
- codebase next # highest-priority open issue
277
- codebase status # kanban board + milestones
278
- codebase query <path> # any field, e.g. stack.languages or commands.test
279
-
280
- # Issues
281
- codebase issue create "title" # create GitHub issue
282
- codebase issue close <n> --reason "why" # close with reason
283
- codebase issue comment <n> --message "text" # add comment (audit trail)
284
-
285
- # Maintenance
286
- codebase scan # refresh .codebase.json
287
- codebase release # quality gates → tag → develop→main → GitHub release
288
- codebase doctor # health check
289
- codebase fix # auto-repair
290
-
291
- # Integrations
292
- codebase mcp # start MCP server
293
- ```
171
+ Commit `.codebase.json` and `.claude/commands/`. Every teammate with Claude Code gets the same context and slash commands. The loop is resumable — restart anytime, GitHub tracks state.
294
172
 
295
173
  ---
296
174
 
297
175
  ## FAQ
298
176
 
299
- **Do I need Claude Code for this to work?**
300
- Yes. `codebase` is built for Claude Code. The MCP server, slash commands, and autonomous loop all require Claude Code.
301
-
302
- **What does "autonomous" actually mean — will it break my code?**
303
- 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.
304
-
305
177
  **Does it send my code to anyone?**
306
- 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).
307
-
308
- **Will the git hooks slow down my commits?**
309
- No. The scan runs in ~200ms on most projects.
178
+ No. Everything runs locally. External calls go only to GitHub (via `gh` CLI) and Anthropic's API (only when you run Claude commands).
310
179
 
311
180
  **What if I don't use GitHub?**
312
- The manifest and AI tool wiring work without GitHub. You lose issues, PRs, releases, and labels — but the core context injection still works.
181
+ Manifest and AI tool wiring work without GitHub. You lose issues, PRs, releases, and labels — core context injection still works.
313
182
 
314
183
  **My project isn't JavaScript — does it work?**
315
- 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.
316
-
317
- **Can my whole team use this?**
318
- Yes. Commit `.codebase.json` and `.claude/commands/`. Every team member with Claude Code gets the same context and the same slash commands.
319
-
320
- ---
184
+ Yes. 30+ languages, 100+ frameworks detected automatically.
321
185
 
322
- ## Install
186
+ **Will the git hooks slow down my commits?**
187
+ No. Scan runs in ~200ms.
323
188
 
324
- ```bash
325
- npm install -g codebase-ai # global (recommended)
326
- npx codebase-ai # try without installing
327
- pnpm add -g codebase-ai
328
- ```
189
+ **What does "autonomous" mean — will it break my code?**
190
+ All AI commits go to `develop`. Nothing reaches `main` until `/launch` passes quality gates.
329
191
 
330
- Zero runtime dependencies. Node.js 20+ only.
192
+ [Full how-it-works docs](docs/HOW-IT-WORKS.md)
331
193
 
332
194
  ---
333
195
 
334
196
  ## Contributing
335
197
 
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.
198
+ We welcome contributions! Please read [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines on how to get started, our commit conventions, and the PR process.
338
199
 
339
200
  Found a security issue? See [SECURITY.md](SECURITY.md) — do not open a public issue.
340
201
 
@@ -344,8 +205,7 @@ See [CHANGELOG.md](CHANGELOG.md) for a full version history.
344
205
 
345
206
  ## Code of Conduct
346
207
 
347
- This project follows a [Code of Conduct](CODE_OF_CONDUCT.md).
348
- By participating, you agree to uphold it.
208
+ This project follows a [Code of Conduct](CODE_OF_CONDUCT.md). By participating, you agree to uphold it.
349
209
 
350
210
  ## License
351
211