Contributing
AI Kit is open source and welcomes contributions. Here’s how to get involved.
Development Setup
# Clone the repository
git clone https://github.com/mikulgohil/ai-kit.git
cd ai-kit
# Install dependencies
npm install
# Build the project
npm run build
# Run tests
npm run test:run
# Watch mode during development
npm run devProject Structure
ai-kit/
├── src/
│ ├── index.ts # CLI entry point (Commander.js)
│ ├── types.ts # TypeScript interfaces
│ ├── constants.ts # Paths, version, fragment list
│ ├── utils.ts # File I/O, logging, merge utilities
│ ├── commands/
│ │ ├── init.ts # ai-kit init command
│ │ ├── update.ts # ai-kit update command
│ │ └── reset.ts # ai-kit reset command
│ ├── scanner/
│ │ ├── index.ts # Master scanner orchestrator
│ │ ├── nextjs.ts # Next.js detection
│ │ ├── sitecore.ts # Sitecore detection
│ │ ├── styling.ts # Styling tools detection
│ │ ├── typescript.ts # TypeScript detection
│ │ ├── monorepo.ts # Monorepo tool detection
│ │ ├── package-manager.ts # Package manager detection
│ │ └── figma.ts # Figma integration detection
│ ├── generator/
│ │ ├── assembler.ts # Template reading and assembly
│ │ ├── claude-md.ts # CLAUDE.md generation + fragment selection
│ │ ├── cursorrules.ts # .cursorrules generation
│ │ ├── cursor-mdc.ts # .cursor/rules/*.mdc generation
│ │ └── config.ts # ai-kit.config.json generation
│ └── copier/
│ ├── skills.ts # Skill copying (Claude Code + Cursor)
│ ├── commands.ts # Legacy slash command copying
│ ├── guides.ts # Guide copying
│ └── docs.ts # Doc scaffold copying
├── templates/
│ ├── header.md # Shared header template
│ ├── claude-md/ # 8 CLAUDE.md fragments
│ └── cursorrules/ # 8 .cursorrules fragments
├── skills/ # 48 skill directories (name/SKILL.md)
├── commands/ # 48 legacy slash command files
├── guides/ # 5 developer guide files
├── docs-scaffolds/ # 3 doc scaffold templates
├── tests/ # Vitest test files
│ ├── scanner/ # Scanner unit tests
│ ├── generator/ # Generator unit tests
│ └── copier/ # Copier unit tests
└── docs/ # Project documentationAdding a New Scanner
To support a new technology:
- Create
src/scanner/your-tech.ts:
interface YourTechResult {
yourTech: boolean;
yourTechVersion?: string;
}
export function detectYourTech(
projectPath: string,
pkg: Record<string, unknown>,
): YourTechResult {
// Detection logic
}- Add the detector to
src/scanner/index.ts - Add the result fields to
ProjectScaninsrc/types.ts - Create template fragments in
templates/claude-md/your-tech.mdandtemplates/cursorrules/your-tech.md - Add the fragment name to
TEMPLATE_FRAGMENTSinsrc/constants.ts - Add selection logic in
selectFragments()insrc/generator/claude-md.ts - Add
.mdcconfig insrc/generator/cursor-mdc.ts - Write tests in
tests/scanner/your-tech.test.ts
Adding a New Skill
- Create
skills/your-skill/SKILL.mdwith the skill content. The file must include adescription:field that the AI reads for auto-discovery. - Add the skill name to
AVAILABLE_SKILLSinsrc/copier/skills.ts
The copier will generate both:
.claude/skills/your-skill/SKILL.md(Claude Code).cursor/skills/your-skill/SKILL.md(Cursor)
Adding a Legacy Slash Command (Backward Compatibility)
If you also want a legacy slash command for explicit invocation in Claude Code:
- Create
commands/your-command.mdwith the command content - Add the command name to
AVAILABLE_COMMANDSinsrc/copier/commands.ts
Modifying Templates
Templates are in templates/claude-md/ and templates/cursorrules/. They use {{variable}} placeholders.
Available variables:
{{projectName}}— project name from package.json{{techStack}}— detected technologies{{packageManager}}— detected package manager{{routerType}}— Next.js router type{{scripts}}— filtered project scripts{{framework}}— detected framework name
Running Tests
# Run all tests
npm run test:run
# Run tests in watch mode
npm run test
# Run specific test file
npx vitest run tests/scanner/nextjs.test.ts
# Run with coverage
npm run test:run -- --coverageCode Style
- TypeScript with strict mode
- ESM modules (
"type": "module") - Named exports preferred
- Colocated types (interfaces near usage)
- Defensive file I/O (try-catch, existence checks)
Commit Messages
Follow conventional commits:
feat: add Vue.js scanner
fix: correct Tailwind v4 detection for @theme
docs: update supported stacks page
test: add tests for monorepo scanner
refactor: extract shared detection utilitiesPull Request Process
- Create a feature branch from
main - Make your changes
- Run
npm run test:run— all tests must pass - Run
npm run build— build must succeed - Submit PR with description of changes and motivation
Last updated on