@malamute/ai-rules 1.0.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/README.md +270 -121
  2. package/bin/cli.js +5 -2
  3. package/configs/_shared/.claude/rules/conventions/documentation.md +324 -0
  4. package/configs/_shared/.claude/rules/conventions/git.md +265 -0
  5. package/configs/_shared/.claude/rules/{performance.md → conventions/performance.md} +1 -1
  6. package/configs/_shared/.claude/rules/conventions/principles.md +334 -0
  7. package/configs/_shared/.claude/rules/devops/ci-cd.md +262 -0
  8. package/configs/_shared/.claude/rules/devops/docker.md +275 -0
  9. package/configs/_shared/.claude/rules/devops/nx.md +194 -0
  10. package/configs/_shared/.claude/rules/domain/backend/api-design.md +203 -0
  11. package/configs/_shared/.claude/rules/lang/csharp/async.md +220 -0
  12. package/configs/_shared/.claude/rules/lang/csharp/csharp.md +314 -0
  13. package/configs/_shared/.claude/rules/lang/csharp/linq.md +210 -0
  14. package/configs/_shared/.claude/rules/lang/python/async.md +337 -0
  15. package/configs/_shared/.claude/rules/lang/python/celery.md +476 -0
  16. package/configs/_shared/.claude/rules/lang/python/config.md +339 -0
  17. package/configs/{python/.claude/rules → _shared/.claude/rules/lang/python}/database/sqlalchemy.md +6 -1
  18. package/configs/_shared/.claude/rules/lang/python/deployment.md +523 -0
  19. package/configs/_shared/.claude/rules/lang/python/error-handling.md +330 -0
  20. package/configs/_shared/.claude/rules/lang/python/migrations.md +421 -0
  21. package/configs/_shared/.claude/rules/lang/python/python.md +172 -0
  22. package/configs/_shared/.claude/rules/lang/python/repository.md +383 -0
  23. package/configs/{python/.claude/rules → _shared/.claude/rules/lang/python}/testing.md +2 -69
  24. package/configs/_shared/.claude/rules/lang/typescript/async.md +447 -0
  25. package/configs/_shared/.claude/rules/lang/typescript/generics.md +356 -0
  26. package/configs/_shared/.claude/rules/lang/typescript/typescript.md +212 -0
  27. package/configs/_shared/.claude/rules/quality/error-handling.md +48 -0
  28. package/configs/_shared/.claude/rules/quality/logging.md +45 -0
  29. package/configs/_shared/.claude/rules/quality/observability.md +240 -0
  30. package/configs/_shared/.claude/rules/quality/testing-patterns.md +65 -0
  31. package/configs/_shared/.claude/rules/security/secrets-management.md +222 -0
  32. package/configs/_shared/.claude/skills/analysis/explore/SKILL.md +257 -0
  33. package/configs/_shared/.claude/skills/analysis/security-audit/SKILL.md +184 -0
  34. package/configs/_shared/.claude/skills/dev/api-endpoint/SKILL.md +126 -0
  35. package/configs/_shared/.claude/{commands/generate-tests.md → skills/dev/generate-tests/SKILL.md} +6 -0
  36. package/configs/_shared/.claude/{commands/fix-issue.md → skills/git/fix-issue/SKILL.md} +6 -0
  37. package/configs/_shared/.claude/{commands/review-pr.md → skills/git/review-pr/SKILL.md} +6 -0
  38. package/configs/_shared/.claude/skills/infra/deploy/SKILL.md +139 -0
  39. package/configs/_shared/.claude/skills/infra/docker/SKILL.md +95 -0
  40. package/configs/_shared/.claude/skills/infra/migration/SKILL.md +158 -0
  41. package/configs/_shared/.claude/skills/nx/nx-affected/SKILL.md +72 -0
  42. package/configs/_shared/.claude/skills/nx/nx-lib/SKILL.md +375 -0
  43. package/configs/_shared/CLAUDE.md +52 -149
  44. package/configs/angular/.claude/rules/{components.md → core/components.md} +69 -15
  45. package/configs/angular/.claude/rules/core/resource.md +285 -0
  46. package/configs/angular/.claude/rules/core/signals.md +323 -0
  47. package/configs/angular/.claude/rules/http.md +338 -0
  48. package/configs/angular/.claude/rules/routing.md +291 -0
  49. package/configs/angular/.claude/rules/ssr.md +312 -0
  50. package/configs/angular/.claude/rules/state/signal-store.md +408 -0
  51. package/configs/angular/.claude/rules/{state.md → state/state.md} +2 -2
  52. package/configs/angular/.claude/rules/testing.md +7 -7
  53. package/configs/angular/.claude/rules/ui/aria.md +422 -0
  54. package/configs/angular/.claude/rules/ui/forms.md +424 -0
  55. package/configs/angular/.claude/rules/ui/pipes-directives.md +335 -0
  56. package/configs/angular/.claude/settings.json +1 -0
  57. package/configs/angular/.claude/skills/ngrx-slice/SKILL.md +362 -0
  58. package/configs/angular/.claude/skills/signal-store/SKILL.md +445 -0
  59. package/configs/angular/CLAUDE.md +24 -216
  60. package/configs/dotnet/.claude/rules/background-services.md +552 -0
  61. package/configs/dotnet/.claude/rules/configuration.md +426 -0
  62. package/configs/dotnet/.claude/rules/ddd.md +447 -0
  63. package/configs/dotnet/.claude/rules/dependency-injection.md +343 -0
  64. package/configs/dotnet/.claude/rules/mediatr.md +320 -0
  65. package/configs/dotnet/.claude/rules/middleware.md +489 -0
  66. package/configs/dotnet/.claude/rules/result-pattern.md +363 -0
  67. package/configs/dotnet/.claude/rules/validation.md +388 -0
  68. package/configs/dotnet/.claude/settings.json +21 -3
  69. package/configs/dotnet/CLAUDE.md +53 -286
  70. package/configs/fastapi/.claude/rules/background-tasks.md +254 -0
  71. package/configs/fastapi/.claude/rules/dependencies.md +170 -0
  72. package/configs/{python → fastapi}/.claude/rules/fastapi.md +61 -1
  73. package/configs/fastapi/.claude/rules/lifespan.md +274 -0
  74. package/configs/fastapi/.claude/rules/middleware.md +229 -0
  75. package/configs/fastapi/.claude/rules/pydantic.md +433 -0
  76. package/configs/fastapi/.claude/rules/responses.md +251 -0
  77. package/configs/fastapi/.claude/rules/routers.md +202 -0
  78. package/configs/fastapi/.claude/rules/security.md +222 -0
  79. package/configs/fastapi/.claude/rules/testing.md +251 -0
  80. package/configs/fastapi/.claude/rules/websockets.md +298 -0
  81. package/configs/fastapi/.claude/settings.json +33 -0
  82. package/configs/fastapi/CLAUDE.md +144 -0
  83. package/configs/flask/.claude/rules/blueprints.md +208 -0
  84. package/configs/flask/.claude/rules/cli.md +285 -0
  85. package/configs/flask/.claude/rules/configuration.md +281 -0
  86. package/configs/flask/.claude/rules/context.md +238 -0
  87. package/configs/flask/.claude/rules/error-handlers.md +278 -0
  88. package/configs/flask/.claude/rules/extensions.md +278 -0
  89. package/configs/flask/.claude/rules/flask.md +171 -0
  90. package/configs/flask/.claude/rules/marshmallow.md +206 -0
  91. package/configs/flask/.claude/rules/security.md +267 -0
  92. package/configs/flask/.claude/rules/testing.md +284 -0
  93. package/configs/flask/.claude/settings.json +33 -0
  94. package/configs/flask/CLAUDE.md +166 -0
  95. package/configs/nestjs/.claude/rules/common-patterns.md +300 -0
  96. package/configs/nestjs/.claude/rules/filters.md +376 -0
  97. package/configs/nestjs/.claude/rules/interceptors.md +317 -0
  98. package/configs/nestjs/.claude/rules/middleware.md +321 -0
  99. package/configs/nestjs/.claude/rules/modules.md +26 -0
  100. package/configs/nestjs/.claude/rules/pipes.md +351 -0
  101. package/configs/nestjs/.claude/rules/websockets.md +451 -0
  102. package/configs/nestjs/.claude/settings.json +16 -2
  103. package/configs/nestjs/CLAUDE.md +57 -215
  104. package/configs/nextjs/.claude/rules/api-routes.md +358 -0
  105. package/configs/nextjs/.claude/rules/authentication.md +355 -0
  106. package/configs/nextjs/.claude/rules/components.md +52 -0
  107. package/configs/nextjs/.claude/rules/data-fetching.md +249 -0
  108. package/configs/nextjs/.claude/rules/database.md +400 -0
  109. package/configs/nextjs/.claude/rules/middleware.md +303 -0
  110. package/configs/nextjs/.claude/rules/routing.md +324 -0
  111. package/configs/nextjs/.claude/rules/seo.md +350 -0
  112. package/configs/nextjs/.claude/rules/server-actions.md +353 -0
  113. package/configs/nextjs/.claude/rules/state/zustand.md +6 -6
  114. package/configs/nextjs/.claude/settings.json +5 -0
  115. package/configs/nextjs/CLAUDE.md +69 -331
  116. package/package.json +23 -9
  117. package/src/cli.js +220 -0
  118. package/src/config.js +29 -0
  119. package/src/index.js +13 -0
  120. package/src/installer.js +361 -0
  121. package/src/merge.js +116 -0
  122. package/src/tech-config.json +29 -0
  123. package/src/utils.js +96 -0
  124. package/configs/python/.claude/rules/flask.md +0 -332
  125. package/configs/python/.claude/settings.json +0 -18
  126. package/configs/python/CLAUDE.md +0 -273
  127. package/src/install.js +0 -315
  128. /package/configs/_shared/.claude/rules/{accessibility.md → domain/frontend/accessibility.md} +0 -0
  129. /package/configs/_shared/.claude/rules/{security.md → security/security.md} +0 -0
  130. /package/configs/_shared/.claude/skills/{debug → dev/debug}/SKILL.md +0 -0
  131. /package/configs/_shared/.claude/skills/{learning → dev/learning}/SKILL.md +0 -0
  132. /package/configs/_shared/.claude/skills/{spec → dev/spec}/SKILL.md +0 -0
  133. /package/configs/_shared/.claude/skills/{review → git/review}/SKILL.md +0 -0
package/README.md CHANGED
@@ -1,8 +1,33 @@
1
1
  # AI Rules
2
2
 
3
3
  [![npm version](https://badge.fury.io/js/@malamute/ai-rules.svg)](https://www.npmjs.com/package/@malamute/ai-rules)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
+ [![Node.js](https://img.shields.io/badge/node-%3E%3D18.0.0-brightgreen.svg)](https://nodejs.org/)
4
6
 
5
- CLI to install Claude Code configuration boilerplates for Angular, Next.js, NestJS, .NET, Python and more.
7
+ **Supercharge Claude Code with framework-specific rules, skills, and best practices.**
8
+
9
+ AI Rules installs curated configuration boilerplates that teach Claude Code your stack's conventions, patterns, and guardrails. Stop explaining the same things over and over — let Claude understand your architecture from the start.
10
+
11
+ ## Why Use This?
12
+
13
+ | Without AI Rules | With AI Rules |
14
+ |------------------|---------------|
15
+ | Claude uses generic patterns | Claude follows your framework's idioms |
16
+ | You repeat "use signals, not decorators" | Angular 21 patterns are built-in |
17
+ | Security issues slip through | OWASP Top 10 rules catch vulnerabilities |
18
+ | Inconsistent code style | Consistent conventions across the team |
19
+
20
+ ## Quick Start
21
+
22
+ ```bash
23
+ # Interactive setup (recommended)
24
+ npx @malamute/ai-rules init
25
+
26
+ # Or specify your stack directly
27
+ npx @malamute/ai-rules init angular nestjs --all
28
+ ```
29
+
30
+ That's it. Claude Code now understands your stack.
6
31
 
7
32
  ## Installation
8
33
 
@@ -10,165 +35,289 @@ CLI to install Claude Code configuration boilerplates for Angular, Next.js, Nest
10
35
  # Global install
11
36
  npm install -g @malamute/ai-rules
12
37
 
13
- # Or use directly with npx
14
- npx @malamute/ai-rules init angular
38
+ # Or use with npx (no install needed)
39
+ npx @malamute/ai-rules <command>
15
40
  ```
16
41
 
17
- ## Usage
42
+ ## Supported Technologies
43
+
44
+ | Technology | Stack | Version |
45
+ |------------|-------|---------|
46
+ | **Angular** | Nx + NgRx + Signals + Vitest | 21+ |
47
+ | **Next.js** | App Router + React 19 + Server Components | 15+ |
48
+ | **NestJS** | Prisma/TypeORM + Passport + Vitest | 11+ |
49
+ | **.NET** | Clean Architecture + MediatR + EF Core | 9+ |
50
+ | **FastAPI** | Pydantic v2 + SQLAlchemy 2.0 + pytest | 0.115+ |
51
+ | **Flask** | Marshmallow + SQLAlchemy 2.0 + pytest | 3.0+ |
52
+
53
+ ## Commands
18
54
 
19
55
  ```bash
20
- # Single technology
21
- ai-rules init angular
22
- ai-rules init nestjs
23
- ai-rules init python
24
-
25
- # Fullstack (combines multiple configs)
26
- ai-rules init angular nestjs
27
- ai-rules init nextjs python
28
- ai-rules init nextjs dotnet
29
-
30
- # With extras
31
- ai-rules init angular --with-skills # /learning, /review, /spec, /debug
32
- ai-rules init angular nestjs --with-commands # fix-issue, review-pr, generate-tests
33
- ai-rules init nextjs --with-rules # security, performance, accessibility
34
- ai-rules init angular nestjs --all # Everything
35
-
36
- # Custom target directory
37
- ai-rules init dotnet --target ./my-project
38
-
39
- # List available technologies
40
- ai-rules list
56
+ ai-rules init [tech...] # Install configs (interactive if no tech)
57
+ ai-rules update # Update to latest rules
58
+ ai-rules status # Show installation info
59
+ ai-rules list # List available technologies
41
60
  ```
42
61
 
43
- ## Available Technologies
62
+ ### Options
44
63
 
45
- | Technology | Stack |
46
- | ---------- | ------------------------------------- |
47
- | `angular` | Angular 21 + Nx + NgRx + Signals |
48
- | `nextjs` | Next.js 15 + React 19 + App Router |
49
- | `nestjs` | NestJS 10 + Prisma/TypeORM + Passport |
50
- | `dotnet` | .NET 8 + ASP.NET Core + EF Core |
51
- | `python` | FastAPI/Flask + SQLAlchemy 2.0 |
64
+ | Option | Description |
65
+ |--------|-------------|
66
+ | `--with-skills` | Add skills: `/learning`, `/review`, `/debug`, etc. |
67
+ | `--with-rules` | Add shared rules: security, performance, accessibility |
68
+ | `--all` | Include both skills and rules |
69
+ | `--dry-run` | Preview changes without writing files |
70
+ | `--target <dir>` | Install to a specific directory |
71
+ | `--force` | Overwrite without creating backups |
52
72
 
53
73
  ## What Gets Installed
54
74
 
55
75
  ```
56
76
  your-project/
57
- ├── CLAUDE.md # Main instructions for Claude
77
+ ├── CLAUDE.md # Architecture & conventions
58
78
  └── .claude/
59
- ├── settings.json # Permissions
60
- ├── rules/ # Technology-specific rules
61
- ├── skills/ # Optional: /learning, /review, /spec, /debug
62
- └── commands/ # Optional: fix-issue, review-pr, generate-tests
79
+ ├── settings.json # Allowed/denied commands
80
+ ├── rules/ # Framework-specific patterns
81
+ ├── components.md
82
+ │ ├── state.md
83
+ │ └── testing.md
84
+ └── skills/ # Optional workflows
85
+ ├── learning/
86
+ ├── review/
87
+ └── debug/
63
88
  ```
64
89
 
65
- ## Available Skills
90
+ ### CLAUDE.md
66
91
 
67
- | Skill | Usage | Description |
68
- | ----------- | --------------------- | ----------------------------------------------- |
69
- | `/learning` | `/learning nextjs` | Pedagogical mode - explains before implementing |
70
- | `/review` | `/review src/users/` | Code review with structured checklist |
71
- | `/spec` | `/spec add auth` | Technical specification before implementing |
72
- | `/debug` | `/debug TypeError...` | Systematic debugging workflow |
92
+ The main instruction file. Contains:
93
+ - Project architecture overview
94
+ - Technology stack and versions
95
+ - Coding conventions (naming, structure, patterns)
96
+ - Commands to run (build, test, lint)
73
97
 
74
- ## Available Commands
98
+ ### Rules
99
+
100
+ Context-aware rules that activate based on file paths:
101
+
102
+ ```markdown
103
+ ---
104
+ paths:
105
+ - "**/*.component.ts"
106
+ ---
107
+ # Angular Component Rules
108
+ - Use `ChangeDetectionStrategy.OnPush`
109
+ - Use `input()`, `output()`, not decorators
110
+ - Template in separate `.html` file
111
+ ```
75
112
 
76
- | Command | Usage | Description |
77
- | ---------------- | ------------------------------------ | ------------------------------------ |
78
- | `fix-issue` | `/project:fix-issue 123` | Fetch GitHub issue and implement fix |
79
- | `review-pr` | `/project:review-pr 456` | Review PR diff with checklist |
80
- | `generate-tests` | `/project:generate-tests src/users/` | Generate tests for a file |
113
+ ### Skills
114
+
115
+ Interactive workflows invoked with `/skill-name`:
116
+
117
+ | Skill | Description |
118
+ |-------|-------------|
119
+ | `/learning` | Pedagogical mode — explains before coding |
120
+ | `/review` | Code review with security/perf checklist |
121
+ | `/debug` | Structured debugging workflow |
122
+ | `/spec` | Write technical spec before implementing |
123
+ | `/fix-issue` | Analyze GitHub issue and implement fix |
124
+ | `/generate-tests` | Generate comprehensive tests |
125
+
126
+ <details>
127
+ <summary><strong>See all 13 skills</strong></summary>
128
+
129
+ | Skill | Usage | Description |
130
+ |-------|-------|-------------|
131
+ | `/learning` | `/learning nextjs` | Explains concepts before implementing |
132
+ | `/review` | `/review src/users/` | Code review with checklist |
133
+ | `/spec` | `/spec add auth` | Technical specification |
134
+ | `/debug` | `/debug TypeError...` | Systematic debugging |
135
+ | `/fix-issue` | `/fix-issue 123` | Fix GitHub issue |
136
+ | `/review-pr` | `/review-pr 456` | Review pull request |
137
+ | `/generate-tests` | `/generate-tests src/user.ts` | Generate tests |
138
+ | `/api-endpoint` | `/api-endpoint POST /users` | Generate API endpoint |
139
+ | `/migration` | `/migration add users` | Database migration |
140
+ | `/security-audit` | `/security-audit` | Security analysis |
141
+ | `/docker` | `/docker` | Dockerfile generation |
142
+ | `/deploy` | `/deploy` | Deployment config |
143
+ | `/explore` | `/explore` | Repository analysis |
144
+
145
+ </details>
81
146
 
82
147
  ## Shared Rules
83
148
 
84
- When using `--with-rules` or `--all`, these transversal rules are included:
149
+ Cross-framework rules included with `--with-rules`:
85
150
 
86
- - **security.md** - OWASP Top 10 (injection, XSS, CSRF, auth, secrets)
87
- - **performance.md** - N+1 queries, caching, memoization, lazy loading
88
- - **accessibility.md** - WCAG 2.1 (semantic HTML, ARIA, keyboard nav)
151
+ | Rule | What It Covers |
152
+ |------|----------------|
153
+ | **security.md** | OWASP Top 10: injection, XSS, CSRF, secrets |
154
+ | **performance.md** | N+1 queries, caching, lazy loading |
155
+ | **accessibility.md** | WCAG 2.1, semantic HTML, ARIA |
156
+ | **testing-patterns.md** | AAA pattern, mocking, coverage |
157
+ | **error-handling.md** | Error categories, response formats |
158
+ | **git.md** | Conventional commits, branching, PRs |
159
+ | **observability.md** | Logging, metrics, tracing |
89
160
 
90
- ## Technology Details
161
+ ## Examples
91
162
 
92
- ### Angular
163
+ ### Fullstack Setup
93
164
 
94
- | Aspect | Convention |
95
- | -------------- | ------------------------------------------- |
96
- | Components | Standalone by default, OnPush required |
97
- | Templates | Always in separate `.html` files |
98
- | Inputs/Outputs | `input()`, `output()`, `model()` functions |
99
- | State | NgRx + Entity Adapter + Functional Effects |
100
- | Tests | Vitest + Marble testing (no `.subscribe()`) |
165
+ ```bash
166
+ # Angular frontend + NestJS backend
167
+ ai-rules init angular nestjs --all
101
168
 
102
- ### Next.js
169
+ # Next.js frontend + FastAPI backend
170
+ ai-rules init nextjs fastapi --all
171
+ ```
103
172
 
104
- | Aspect | Convention |
105
- | ----------------- | ------------------------------------------ |
106
- | Components | Server Components by default |
107
- | Client Components | Add `'use client'` directive |
108
- | Data Fetching | Server Components + `fetch()` |
109
- | Mutations | Server Actions |
110
- | State | Zustand (simple) / Redux Toolkit (complex) |
173
+ ### Preview Before Installing
111
174
 
112
- ### NestJS
175
+ ```bash
176
+ ai-rules init angular --dry-run
177
+ ```
113
178
 
114
- | Aspect | Convention |
115
- | ------------ | -------------------------------------- |
116
- | Architecture | Modular Monolith |
117
- | Validation | class-validator + class-transformer |
118
- | Database | Prisma (modern) / TypeORM (decorators) |
119
- | Auth | Passport + JWT |
120
- | Tests | Jest + Supertest |
179
+ Output:
180
+ ```
181
+ DRY RUN - No files will be modified
121
182
 
122
- ### .NET
183
+ Would install to: /your/project
123
184
 
124
- | Aspect | Convention |
125
- | ------------ | ----------------------------------------- |
126
- | Architecture | Clean Architecture (Domain → App → Infra) |
127
- | API Style | Minimal APIs or Controllers |
128
- | CQRS | MediatR (Commands/Queries) |
129
- | ORM | Entity Framework Core |
130
- | Tests | xUnit + NSubstitute + FluentAssertions |
185
+ Would install angular...
186
+ ○ CLAUDE.md (create)
187
+ ○ settings.json (create)
188
+ ○ rules/ (8 files)
131
189
 
132
- ### Python
190
+ Summary:
191
+ 10 file(s) would be created
192
+ 0 file(s) would be modified
193
+ ```
133
194
 
134
- | Aspect | Convention |
135
- | ---------- | ------------------------------------------- |
136
- | Frameworks | FastAPI (async) / Flask (traditional) |
137
- | Validation | Pydantic v2 (FastAPI) / Marshmallow (Flask) |
138
- | ORM | SQLAlchemy 2.0 (async support) |
139
- | Tests | pytest + httpx |
140
- | Migrations | Alembic |
195
+ ### Update Configs
141
196
 
142
- ## Package Structure
197
+ ```bash
198
+ # Check current version
199
+ ai-rules status
143
200
 
201
+ # Preview updates
202
+ ai-rules update --dry-run
203
+
204
+ # Apply updates (auto-backup enabled)
205
+ ai-rules update
144
206
  ```
145
- claude-code-configs/
146
- ├── package.json
147
- ├── bin/
148
- │ └── cli.js # CLI entry point
149
- ├── src/
150
- │ └── install.js # Installation logic
151
- └── configs/
152
- ├── angular/
153
- ├── nextjs/
154
- ├── nestjs/
155
- ├── dotnet/
156
- ├── python/
157
- └── _shared/
158
- ├── CLAUDE.md
159
- └── .claude/
160
- ├── skills/
161
- ├── commands/
162
- └── rules/
163
- ```
207
+
208
+ ## Technology Conventions
209
+
210
+ <details>
211
+ <summary><strong>Angular</strong></summary>
212
+
213
+ | Aspect | Convention |
214
+ |--------|------------|
215
+ | Components | Standalone, OnPush change detection |
216
+ | Signals | `input()`, `output()`, `model()` functions |
217
+ | State | NgRx with Entity Adapter + Functional Effects |
218
+ | Structure | Nx monorepo with feature/ui/data-access libs |
219
+ | Tests | Vitest + Marble testing |
220
+
221
+ </details>
222
+
223
+ <details>
224
+ <summary><strong>Next.js</strong></summary>
225
+
226
+ | Aspect | Convention |
227
+ |--------|------------|
228
+ | Components | Server Components by default |
229
+ | Client | `'use client'` directive for interactivity |
230
+ | Data | Server Components + fetch, Server Actions |
231
+ | State | Zustand (simple) / Redux Toolkit (complex) |
232
+ | Structure | App Router with route groups |
233
+
234
+ </details>
235
+
236
+ <details>
237
+ <summary><strong>NestJS</strong></summary>
238
+
239
+ | Aspect | Convention |
240
+ |--------|------------|
241
+ | Architecture | Modular Monolith |
242
+ | Validation | class-validator + class-transformer |
243
+ | Database | Prisma (modern) / TypeORM (decorators) |
244
+ | Auth | Passport + JWT |
245
+ | Tests | Vitest + Supertest |
246
+
247
+ </details>
248
+
249
+ <details>
250
+ <summary><strong>.NET</strong></summary>
251
+
252
+ | Aspect | Convention |
253
+ |--------|------------|
254
+ | Architecture | Clean Architecture (Domain → App → Infra) |
255
+ | API | Minimal APIs (preferred) or Controllers |
256
+ | CQRS | MediatR for Commands/Queries |
257
+ | ORM | Entity Framework Core |
258
+ | Tests | xUnit + NSubstitute + FluentAssertions |
259
+
260
+ </details>
261
+
262
+ <details>
263
+ <summary><strong>FastAPI</strong></summary>
264
+
265
+ | Aspect | Convention |
266
+ |--------|------------|
267
+ | Framework | FastAPI with async/await |
268
+ | Validation | Pydantic v2 |
269
+ | ORM | SQLAlchemy 2.0 with async support |
270
+ | Tests | pytest + httpx |
271
+ | Migrations | Alembic |
272
+
273
+ </details>
274
+
275
+ <details>
276
+ <summary><strong>Flask</strong></summary>
277
+
278
+ | Aspect | Convention |
279
+ |--------|------------|
280
+ | Framework | Flask 3.0 with Application Factory |
281
+ | Validation | Marshmallow schemas |
282
+ | ORM | SQLAlchemy 2.0 |
283
+ | Tests | pytest |
284
+ | Extensions | Flask-SQLAlchemy, Flask-Migrate, Flask-JWT-Extended |
285
+
286
+ </details>
287
+
288
+ ## How It Works
289
+
290
+ 1. **CLAUDE.md** is read by Claude Code at session start
291
+ 2. **Rules** activate based on file paths you're editing
292
+ 3. **Skills** are invoked on-demand with `/skill-name`
293
+ 4. **Settings** define what commands Claude can run
294
+
295
+ Claude Code sees your conventions as first-class instructions, not just suggestions in the chat.
164
296
 
165
297
  ## Contributing
166
298
 
167
- 1. Fork the repository
168
- 2. Create a new technology folder in `configs/`
169
- 3. Add `CLAUDE.md` and `.claude/rules/`
170
- 4. Submit a PR
299
+ ```bash
300
+ # Clone and install
301
+ git clone https://github.com/malamute/ai-rules.git
302
+ cd ai-rules
303
+ npm install
304
+
305
+ # Run tests
306
+ npm test
307
+
308
+ # Add a new technology
309
+ mkdir configs/your-tech
310
+ # Add CLAUDE.md and .claude/rules/
311
+ ```
312
+
313
+ ### Adding a Technology
314
+
315
+ 1. Create `configs/[tech]/CLAUDE.md` — start with `@../_shared/CLAUDE.md`
316
+ 2. Add rules in `configs/[tech]/.claude/rules/`
317
+ 3. Add `configs/[tech]/.claude/settings.json` for permissions
318
+ 4. Add tests
319
+ 5. Submit a PR
171
320
 
172
321
  ## License
173
322
 
174
- MIT
323
+ MIT © Mehdi Chaabi
package/bin/cli.js CHANGED
@@ -1,5 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const { run } = require('../src/install.js');
3
+ const { run } = require('../src/cli.js');
4
4
 
5
- run(process.argv.slice(2));
5
+ run(process.argv.slice(2)).catch((err) => {
6
+ console.error(err);
7
+ process.exit(1);
8
+ });