I built my first CLI – a tool that scans your
codebase and generates AGENTS.md files, the
open standard that AI coding tools (Cursor,
Copilot, Claude Code) automatically read for
project context.
The problem: After a year of learning to code
and building several Next.js projects, I kept
manually writing AGENTS.md files to tell AI
assistants about my components, API routes, and
patterns. Every. Single. Project. It was
tedious and would drift out of sync as the
codebase evolved.
The solution:
npx @jpoindexter/agent-smith
What it does differently:
Unlike Repomix or Code2Prompt (which pack raw
files), agent-smith extracts structured
metadata:
- Components with props and complexity metrics
- Hooks with client-only detection
- API routes with methods and auth status
- Database models (Prisma/Drizzle) with
relations
- Design tokens and pattern detection
- Import graphs and barrel exports
It generates "Critical Rules" with wrong/right
code examples so AI actually follows your
patterns:
// WRONG
<div className="rounded border p-4">...</div>
// RIGHT
<Card><CardContent>...</CardContent></Card>
Output: ~10K tokens of structured context vs
100K+ tokens of raw code.
Tech: TypeScript, zero config, works on any
JS/TS codebase.
GitHub:
https://github.com/jpoindexter/agentsmith
A year ago I couldn't have built this. I spent
a few hours scratching my own itch, and it
turns out the problem is pretty common. Curious
what other metadata would be useful to
extract, or if there are edge cases I'm
missing.