@clipboard-health/ai-rules
Pre-built AI agent rules for consistent coding standards.
Table of contents
Install
npm install --save-dev @clipboard-health/ai-rules
Usage
Quick Start
-
Choose the profile that matches your project type:
common | common | TypeScript libraries, generic projects |
frontend | common + frontend | React apps, web apps |
backend | common + backend | NestJS services, APIs |
fullstack | common + frontend + backend | Monorepos, fullstack apps |
Rule categories:
- common: TypeScript, testing, code style, error handling, key conventions
- frontend: React patterns, hooks, performance, styling, data fetching, custom hooks
- backend: NestJS APIs, three-tier architecture, controllers, services
-
Add it to your package.json:
{
"scripts": {
"sync-ai-rules": "node ./node_modules/@clipboard-health/ai-rules/scripts/sync.js [PROFILE_NAME]",
"postinstall": "npm run sync-ai-rules"
}
}
-
Run:
npm install
-
Commit the generated files:
git add .
git commit -m "feat: add AI coding rules"
-
Bonus: For repo-specific rules, create an OVERLAY.md file. The sync script appends its contents in each generated file to load the contents into AI agent context.
Updating Rules
When we release new rules or improvements:
npm update @clipboard-health/ai-rules
npm install
git diff .
git add .
git commit -m "chore: update AI coding rules"
Local development commands
See package.json scripts for a list of commands.