Skip to content

feat: add init command for AI agent adoption#34

Merged
bntvllnt merged 2 commits into
mainfrom
worktree-agent-adoption-init
May 30, 2026
Merged

feat: add init command for AI agent adoption#34
bntvllnt merged 2 commits into
mainfrom
worktree-agent-adoption-init

Conversation

@bntvllnt
Copy link
Copy Markdown
Owner

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.mdags 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.

bntvllnt added 2 commits May 30, 2026 02:01
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
@bntvllnt bntvllnt self-assigned this May 30, 2026
@bntvllnt bntvllnt merged commit 8cfac95 into main May 30, 2026
2 checks passed
@bntvllnt bntvllnt deleted the worktree-agent-adoption-init branch May 30, 2026 00:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant