feat: add init command for AI agent adoption#34
Merged
Conversation
codebase-intelligence has the data, but AI agents default to grep/read
instead of querying it. `init` closes that gap.
`codebase-intelligence init [path]` writes an idempotent, marked instruction
block ("query CI before grep/read") into each agent's repo file — AGENTS.md,
CLAUDE.md, .cursor/rules/codebase-intelligence.mdc,
.github/copilot-instructions.md, GEMINI.md, CONVENTIONS.md — and installs a
portable skill to ~/.claude/skills/. Only content between the
codebase-intelligence:start/:end markers is touched, so re-running is safe.
- src/install: pure managed-block upsert engine + per-agent target registry
+ shared block/skill content (single source of truth)
- skills/codebase-intelligence/SKILL.md: registry skill for ags / npx skills add
- flags: --agents <list>, --no-skill, --json
- 18 new tests (real fs, temp dirs); drift-guard ties SKILL.md to renderSkill()
- docs: README, cli-reference, architecture, llms.txt, llms-full.txt, CHANGELOG.md
This was referenced May 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
codebase-intelligence has the data (architecture, impact, risk metrics) — but AI coding agents default to grep/read instead of querying it.
initcloses 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:AGENTS.md,CLAUDE.md,.cursor/rules/codebase-intelligence.mdc,.github/copilot-instructions.md,GEMINI.md,CONVENTIONS.md~/.claude/skills/codebase-intelligence/SKILL.mdskills/codebase-intelligence/SKILL.md→ags install/npx skills addFlags:
--agents <list>(subset),--no-skill,--json.Safety / correctness
upsertManagedBlock()is pure + idempotent. Only content between<!-- codebase-intelligence:start -->/:endis ever touched — existing user content is preserved.renderBlock()/renderSkill(); 6 agents are a thin path+preamble table.SKILL.mdtorenderSkill().Tests / gates
Docs
README (Agent Adoption section + TOC + Features),
docs/cli-reference.md,docs/architecture.md,llms.txt,llms-full.txt, and a newCHANGELOG.md.Follow-up (manual)
skills.sh directory listing needs a logged-in web submit at agentskill.sh; the
SKILL.mdis spec-valid sonpx skills add github.com/bntvllnt/codebase-intelligenceworks once merged.