[ Case study · Developer Tools ]
Publishing an AI-Powered Developer CLI on npm
Internal Product · AI Product Engineering
[ Developer Tools · AI Product Engineering ]
Internal Product
$ npm i -g @gkganesh12/codecraft-cli $ codecraft init › /plan scope the change › /code write inside the guard › /verify check it against the rules
The problem
AI coding assistants treat every codebase the same — they don't understand architectural constraints, project conventions or the different perspectives that a PM, architect and QA engineer bring to the same code. We wanted to build a CLI tool that brings role-based AI reasoning to development workflows, with guardrails that prevent AI from going off-scope.
What we built
CodeCraft is the AI coding assistant that understands your project's rules, not just your code. The role-based persona system means you get different perspectives on the same problem — a PM thinks about user stories, an architect thinks about system design, QA thinks about edge cases. The scope guard and rule engine prevent the AI from making well-intentioned but architecture-breaking changes.
- CLI ArchitectureDesigned a Commander.js-based CLI with an interactive REPL that maintains persistent context across sessions. Plugin architecture for slash commands. Configuration system via ~/.codecraft/config.json for per-project rules and constraints.
- Role System & CommandsBuilt 6 role-based personas (PM, Architect, Backend Dev, Frontend Dev, QA Lead, Full-Stack) that change how the AI reasons about code. Implemented 9+ slash commands: /plan, /code, /verify, /doctor, /feature, /adr, /test, /review, /explain. Each command uses the active persona to shape its output.
- Guardrails & PublishingImplemented Scope Guard (prevents modifications to files outside the defined scope) and a rule engine for architectural constraints (e.g., 'no direct database calls from route handlers'). Published on npm as a globally installable CLI with binary entry point.