Project Internals & Contributing
Source Code Structure
ai-dev-kit/
├── src/
│ ├── index.ts # CLI entry point (Commander.js)
│ ├── commands/ # CLI command handlers (init, add)
│ ├── generators/ # File generation logic from templates
│ └── utils/ # Utilities (file system, logging)
├── templates/ # Template files for rules/skills/workflows/docs
│ ├── rules/
│ ├── skills/
│ ├── workflows/
│ └── docs/
├── tests/ # Unit & integration tests (Vitest)
├── tsconfig.json
└── tsup.config.ts # Build configuration
How It Works
- CLI Entry point (
src/index.ts): Initializes Commander.js and registers subcommands. - Command handler (
src/commands/): Handles logic for each command (init,add). - Generator (
src/generators/): Reads templates fromtemplates/, renders them, and writes to the filesystem. - Templates (
templates/): Markdown/JSON template files that are copied into the user's project.
Development Environment Setup
git clone https://git.caerux.com/caeruxlab/clx-ai-kit.git
cd clx-ai-kit
npm install
npm run dev # Watch mode build
Running Tests
npm test # Run full test suite
npm run test:watch # Watch mode
npm run test:coverage # Coverage report
Build
npm run build
Output will be generated in the dist/ directory.
Adding a New Command
- Create a handler file in
src/commands/<command-name>.ts. - Register the command in
src/index.ts. - Add templates if needed to
templates/. - Write tests in
tests/.
Lint & Type Check
npm run lint # TypeScript type check (tsc --noEmit)
Coding Rules
- No
console.log— Usepicocolorsfor CLI output formatting. - Small files — Maximum 800 lines, ideally 200–400 lines.
- Immutable patterns — Do not mutate objects/arrays directly.
- Named exports — Prefer named exports over default exports in internal modules.