You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add init command for AI agent adoption (#34)
## Why
codebase-intelligence has the data (architecture, impact, risk metrics)
— but AI coding agents default to grep/read instead of querying it.
`init` closes that adoption gap. Native TypeScript, zero new runtime
deps, no LLM.
## What
`codebase-intelligence init [path]` writes an **idempotent, marked**
instruction block ("query CI before grep/read") into each agent's repo
file, and installs a portable skill:
| Layer | Target |
|---|---|
| Repo instructions | `AGENTS.md`, `CLAUDE.md`,
`.cursor/rules/codebase-intelligence.mdc`,
`.github/copilot-instructions.md`, `GEMINI.md`, `CONVENTIONS.md` |
| Portable skill | `~/.claude/skills/codebase-intelligence/SKILL.md` |
| Registry | `skills/codebase-intelligence/SKILL.md` → `ags install` /
`npx skills add` |
Flags: `--agents <list>` (subset), `--no-skill`, `--json`.
## Safety / correctness
- `upsertManagedBlock()` is pure + idempotent. Only content between
`<!-- codebase-intelligence:start -->` / `:end` is ever touched —
**existing user content is preserved**.
- Single source of truth: one `renderBlock()`/`renderSkill()`; 6 agents
are a thin path+preamble table.
- Drift-guard test ties the committed `SKILL.md` to `renderSkill()`.
## Tests / gates
- 18 new tests (real fs, temp dirs — no mocks): create / append /
replace / idempotent / preserve-outside / subset /
merge-without-clobber.
- Full suite: **310 passed**. lint / typecheck / build all green.
## Docs
README (Agent Adoption section + TOC + Features),
`docs/cli-reference.md`, `docs/architecture.md`, `llms.txt`,
`llms-full.txt`, and a new `CHANGELOG.md`.
## Follow-up (manual)
skills.sh **directory listing** needs a logged-in web submit at
agentskill.sh; the `SKILL.md` is spec-valid so `npx skills add
github.com/bntvllnt/codebase-intelligence` works once merged.
Copy file name to clipboardExpand all lines: docs/cli-reference.md
+17-1Lines changed: 17 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# CLI Reference
2
2
3
-
15 commands for terminal and CI use. Full parity with MCP tools. All commands auto-cache the index to `.code-visualizer/`.
3
+
16 commands for terminal and CI use. The 15 analysis commands have full parity with MCP tools and auto-cache the index to `.code-visualizer/`; `init` sets up agent adoption.
description: Query the codebase-intelligence CLI to understand TypeScript architecture, dependencies, blast radius, and risk before reading files. Use for any "how is this structured", "what breaks if I change X", "where is the complexity" question.
4
+
---
5
+
6
+
# Codebase Intelligence
7
+
8
+
`codebase-intelligence` turns a TypeScript codebase into a queryable graph of
9
+
architecture, dependencies, and risk metrics. **Prefer it over grep/read** when the
10
+
task is about structure, impact, or risk — it is faster and more accurate than
11
+
scanning files one by one.
12
+
13
+
## When to use
14
+
15
+
| Goal | Command |
16
+
|------|---------|
17
+
| First look / architecture |`codebase-intelligence overview <path>`|
0 commit comments