ai-readme-mcp 0.1.0 β†’ 0.3.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.
package/README.md CHANGED
@@ -10,26 +10,34 @@
10
10
 
11
11
  AI_README MCP Server is a Model Context Protocol (MCP) server that automatically manages and syncs AI_README.md files across your projects. It enables AI assistants to intelligently read and update relevant context documentation when modifying code.
12
12
 
13
- ## ✨ Features
13
+ ### Why AI_README?
14
+
15
+ When working with AI assistants on code projects, **consistency and quality matter**. This tool helps teams:
14
16
 
15
- ### Available Now
17
+ - **🀝 Standardize AI interactions** - Ensure all team members and AI assistants follow the same coding standards, conventions, and best practices
18
+ - **πŸ“ˆ Improve AI output quality** - By providing clear, structured context, AI generates more accurate and consistent code that matches your project's style
19
+ - **🎯 Maintain consistency across teams** - When multiple developers use AI assistants, AI_README ensures everyone gets the same guidelines and standards
20
+ - **⚑ Save time on onboarding** - New team members and AI assistants instantly understand project conventions without lengthy explanations
21
+ - **πŸ”„ Keep documentation in sync** - AI can automatically update README files as the project evolves, maintaining up-to-date documentation
16
22
 
17
- - πŸ” **Automatic Discovery** - Scan and index all AI_README.md files in your project (Phase 1)
18
- - 🎯 **Smart Context Routing** - Find relevant README content based on file paths (Phase 1)
19
- - πŸ”„ **Update & Sync** - AI can both read and update AI_README files (Phase 2)
20
- - πŸ“¦ **Easy Integration** - Works seamlessly with Claude Code and other MCP clients
21
- - πŸ§ͺ **Well Tested** - 36 unit tests, 100% passing
23
+ Think of it as a **"style guide and context manager for AI"** - ensuring every AI interaction in your project follows your team's standards and produces high-quality, consistent output.
24
+
25
+ ## ✨ Features
22
26
 
23
- ### Coming Soon
27
+ - πŸ” **Automatic Discovery** - Scan and index all AI_README.md files in your project
28
+ - 🎯 **Smart Context Routing** - Find relevant README content based on file paths
29
+ - πŸ”„ **Update & Sync** - AI can both read and update AI_README files
30
+ - βœ… **Validation & Quality** - Ensure README consistency with token limits and structure checks
31
+ - πŸ€– **Smart Initialization** - Auto-generate AI_README files based on project analysis
32
+ - πŸ—οΈ **Monorepo Support** - Place AI_README.md files at different folder levels; the tool automatically finds and uses the most relevant one
33
+ - πŸ“¦ **Easy Integration** - Works seamlessly with Cursor, Claude Code, and other MCP clients
24
34
 
25
- - βœ… **Validation & Health Checks** - Ensure README consistency and integrity (Phase 3)
26
- - 🎬 **Watch Mode** - Auto-sync changes to README files (Phase 4)
27
35
 
28
36
  ## πŸš€ Quick Start
29
37
 
30
38
  ### Installation
31
39
 
32
- **Option 1: Using npx (Recommended - After npm publish)**
40
+ **Option 1: Using npx (Recommended)**
33
41
 
34
42
  No installation needed! Just configure and use via npx:
35
43
 
@@ -46,7 +54,7 @@ No installation needed! Just configure and use via npx:
46
54
 
47
55
  The `-y` flag automatically accepts the npx prompt.
48
56
 
49
- **Option 2: Global Installation (After npm publish)**
57
+ **Option 2: Global Installation**
50
58
 
51
59
  ```bash
52
60
  npm install -g ai-readme-mcp
@@ -64,9 +72,9 @@ Then configure:
64
72
  }
65
73
  ```
66
74
 
67
- **Option 3: Local Development (Current)**
75
+ **Option 3: Local Development**
68
76
 
69
- > **Note:** Use this method before npm package is published.
77
+ > **Note:** Use this method if you want to modify or contribute to the source code.
70
78
 
71
79
  ```bash
72
80
  # Clone this repository to a permanent location
@@ -135,7 +143,7 @@ Add to Cursor's MCP configuration file:
135
143
  **Windows:** `%APPDATA%\Cursor\User\mcp.json`
136
144
  **macOS/Linux:** `~/.cursor/mcp.json`
137
145
 
138
- **After npm publish (Recommended):**
146
+ **Using npx (Recommended):**
139
147
 
140
148
  ```json
141
149
  {
@@ -148,7 +156,7 @@ Add to Cursor's MCP configuration file:
148
156
  }
149
157
  ```
150
158
 
151
- **Or if globally installed:**
159
+ **If globally installed:**
152
160
 
153
161
  ```json
154
162
  {
@@ -160,16 +168,14 @@ Add to Cursor's MCP configuration file:
160
168
  }
161
169
  ```
162
170
 
163
- **Current (local development):**
171
+ **For local development:**
164
172
 
165
173
  ```json
166
174
  {
167
175
  "mcpServers": {
168
176
  "ai-readme-manager": {
169
177
  "command": "node",
170
- "args": [
171
- "D:\\Home\\WorkSpace\\playground\\ai-readme-mcp\\dist\\index.js"
172
- ]
178
+ "args": ["/path/to/ai-readme-mcp/dist/index.js"]
173
179
  }
174
180
  }
175
181
  }
@@ -186,7 +192,7 @@ Add to `claude_desktop_config.json`:
186
192
  **Windows:** `%APPDATA%\claude\claude_desktop_config.json`
187
193
  **macOS/Linux:** `~/.config/claude/config.json` or `~/Library/Application Support/Claude/config.json`
188
194
 
189
- **After npm publish (Recommended):**
195
+ **Using npx (Recommended):**
190
196
 
191
197
  ```json
192
198
  {
@@ -199,7 +205,7 @@ Add to `claude_desktop_config.json`:
199
205
  }
200
206
  ```
201
207
 
202
- **Or if globally installed:**
208
+ **If globally installed:**
203
209
 
204
210
  ```json
205
211
  {
@@ -211,14 +217,14 @@ Add to `claude_desktop_config.json`:
211
217
  }
212
218
  ```
213
219
 
214
- **Current (local development):**
220
+ **For local development:**
215
221
 
216
222
  ```json
217
223
  {
218
224
  "mcpServers": {
219
225
  "ai-readme-manager": {
220
226
  "command": "node",
221
- "args": ["/absolute/path/to/ai-readme-mcp/dist/index.js"]
227
+ "args": ["/path/to/ai-readme-mcp/dist/index.js"]
222
228
  }
223
229
  }
224
230
  }
@@ -226,7 +232,20 @@ Add to `claude_desktop_config.json`:
226
232
 
227
233
  ### Create Your First AI_README
228
234
 
229
- Create `AI_README.md` in your project root:
235
+ You can use the `init_ai_readme` MCP tool to automatically generate a customized AI_README.md based on your project:
236
+
237
+ **Smart Mode (Default)**:
238
+ The tool automatically detects your project and generates relevant content:
239
+ - Detects project type (library/application/monorepo)
240
+ - Identifies language (TypeScript, Python, Go, Rust, Java, etc.)
241
+ - Recognizes framework (React, Vue, Next.js, Express, NestJS, etc.)
242
+ - Analyzes directory structure
243
+ - Generates framework-specific conventions
244
+
245
+ Ask your AI assistant:
246
+ > "Please use init_ai_readme to create an AI_README.md for this project"
247
+
248
+ Or create manually:
230
249
 
231
250
  ```markdown
232
251
  # My Project
@@ -244,13 +263,54 @@ Create `AI_README.md` in your project root:
244
263
  Run tests with: `npm test`
245
264
  ```
246
265
 
266
+ ### Multi-Level AI_README (Not Just for Monorepos!)
267
+
268
+ **The power of this tool is multi-level documentation** - not just for monorepos, but for **any project** that wants to organize conventions by module or feature.
269
+
270
+ **Why multi-level?**
271
+ - 🎯 **Avoid bloated root README** - Keep each README focused and concise
272
+ - πŸ“ **Precise context** - AI gets only the relevant conventions for the code it's working on
273
+ - πŸ”§ **Flexible organization** - Organize by feature, module, or any structure that makes sense
274
+
275
+ Simply place `AI_README.md` files at different folder levels:
276
+
277
+ ```
278
+ my-monorepo/
279
+ β”œβ”€β”€ AI_README.md # Root-level conventions (applies to all)
280
+ β”œβ”€β”€ apps/
281
+ β”‚ β”œβ”€β”€ frontend/
282
+ β”‚ β”‚ β”œβ”€β”€ AI_README.md # Frontend-specific conventions
283
+ β”‚ β”‚ └── src/components/Button.tsx
284
+ β”‚ └── backend/
285
+ β”‚ β”œβ”€β”€ AI_README.md # Backend-specific conventions
286
+ β”‚ └── src/api/users.ts
287
+ └── packages/
288
+ └── shared/
289
+ β”œβ”€β”€ AI_README.md # Shared library conventions
290
+ └── src/utils.ts
291
+ ```
292
+
293
+ **Smart Empty README Handling:**
294
+ - πŸ“ If you create an empty `AI_README.md` in a subdirectory, the tool can auto-fill it with relevant conventions
295
+ - πŸ”— For subdirectories with parent READMEs, generates differential content (only module-specific conventions)
296
+ - πŸ“‹ For root directories, generates full project analysis
297
+ - Ask your AI: "This AI_README.md is empty, can you help fill it?"
298
+
299
+ When AI works on a file, it automatically gets:
300
+ - The **most relevant** AI_README (closest parent directory)
301
+ - Plus the **root-level** AI_README (for project-wide standards)
302
+
303
+ For example, when editing `apps/frontend/src/components/Button.tsx`:
304
+ - βœ… Gets `apps/frontend/AI_README.md` (React component standards)
305
+ - βœ… Gets root `AI_README.md` (project-wide Git, testing conventions)
306
+
247
307
  ### Test the Integration
248
308
 
249
- Restart Claude Code, then ask:
309
+ Restart your IDE, then ask your AI assistant:
250
310
 
251
311
  > "I'm about to create a new component. What conventions should I follow?"
252
312
 
253
- Claude will use the MCP server to retrieve your AI_README context!
313
+ The AI will automatically retrieve your AI_README context!
254
314
 
255
315
  For detailed setup instructions, see [Quick Start Guide](./docs/QUICK_START.md).
256
316
 
@@ -307,10 +367,64 @@ npm run dev
307
367
  - **[Quick Start Guide](./docs/QUICK_START.md)** - Get started in 10 minutes
308
368
  - **[Contributing Guide](./CONTRIBUTING.md)** - How to contribute
309
369
  - [Project Specification](./docs/SPEC.md) - Complete technical specification
310
- - [AI_README Templates](./docs/templates/) - Example templates for your projects
311
370
 
312
371
  ## πŸ› οΈ Available MCP Tools
313
372
 
373
+ ### `init_ai_readme`
374
+
375
+ Initialize a new AI_README.md file with smart content generation based on project analysis.
376
+
377
+ ```typescript
378
+ // Parameters
379
+ {
380
+ targetPath: string; // Required: Directory where AI_README.md will be created
381
+ projectName?: string; // Optional: Project name (auto-detected if not provided)
382
+ overwrite?: boolean; // Optional: Overwrite existing file (default: false)
383
+ smart?: boolean; // Optional: Enable smart content generation (default: true)
384
+ }
385
+
386
+ // Returns
387
+ {
388
+ success: boolean;
389
+ readmePath: string;
390
+ action: 'created' | 'filled' | 'overwritten';
391
+ projectInfo?: {
392
+ projectName: string;
393
+ projectType: 'library' | 'application' | 'monorepo' | 'unknown';
394
+ language: string;
395
+ framework?: string;
396
+ packageManager?: string;
397
+ hasTests: boolean;
398
+ mainDirs: string[];
399
+ };
400
+ message: string;
401
+ }
402
+ ```
403
+
404
+ **Smart Mode Features**:
405
+ - Auto-detects project type, language, and framework
406
+ - Generates framework-specific conventions (React, Vue, Python, etc.)
407
+ - For subdirectories with parent READMEs, generates differential content
408
+ - Handles empty files (< 50 chars) by auto-filling them
409
+ - Analyzes directory structure and dependencies
410
+
411
+ **Example Usage**:
412
+
413
+ ```typescript
414
+ // Create smart README for React project
415
+ {
416
+ targetPath: "/path/to/react-app",
417
+ smart: true
418
+ }
419
+ // Result: Auto-detects React, generates component naming conventions, etc.
420
+
421
+ // Fill empty subdirectory README
422
+ {
423
+ targetPath: "/path/to/monorepo/apps/frontend"
424
+ }
425
+ // Result: Generates differential content extending root README
426
+ ```
427
+
314
428
  ### `discover_ai_readmes`
315
429
 
316
430
  Scans your project and discovers all AI_README.md files.
@@ -433,44 +547,71 @@ Update an AI_README.md file with specified operations.
433
547
  }
434
548
  ```
435
549
 
436
- ## πŸ—ΊοΈ Development Roadmap
437
-
438
- ### Phase 0: Initial Setup βœ… COMPLETED
439
- - [x] Project structure
440
- - [x] TypeScript configuration
441
- - [x] Build tooling (tsup)
442
- - [x] Testing setup (Node.js native test runner)
443
- - [x] Basic type definitions
444
-
445
- ### Phase 1: MVP (Core Features) βœ… COMPLETED
446
- - [x] Implement AIReadmeScanner
447
- - [x] Implement ContextRouter
448
- - [x] Create `discover_ai_readmes` tool
449
- - [x] Create `get_context_for_file` tool
450
- - [x] Write comprehensive tests (26 tests, all passing)
451
- - [x] MCP server integration
452
- - [x] Documentation and templates
453
-
454
- ### Phase 2: Update & Sync βœ… COMPLETED
455
- - [x] Implement ReadmeUpdater
456
- - [x] Create `update_ai_readme` tool
457
- - [x] Support 5 operation types (append, prepend, replace, insert-after, insert-before)
458
- - [x] Write comprehensive tests (36 tests total, all passing)
459
-
460
- ### Phase 3: Validation & Quality πŸ“‹ NEXT
461
- - [ ] Implement ReadmeValidator
462
- - [ ] Create `validate_ai_readmes` tool
463
- - [ ] Health check functionality
464
-
465
- ### Phase 4: Advanced Features
466
- - [ ] Watch mode for auto-sync
467
- - [ ] Performance optimization and caching
468
- - [ ] VSCode Extension
469
-
470
- ### Phase 5: Distribution
471
- - [ ] Publish to npm registry
472
- - [ ] Add npx support for easier installation
473
- - [ ] CI/CD pipeline for automated releases
550
+ ### `validate_ai_readmes`
551
+
552
+ Validate all AI_README.md files in your project for quality and token efficiency.
553
+
554
+ ```typescript
555
+ // Parameters
556
+ {
557
+ projectRoot: string; // Required: Project root directory
558
+ excludePatterns?: string[]; // Optional: Glob patterns to exclude
559
+ config?: { // Optional: Custom validation config
560
+ maxTokens?: number;
561
+ rules?: {
562
+ requireH1?: boolean;
563
+ requireSections?: string[];
564
+ allowCodeBlocks?: boolean;
565
+ maxLineLength?: number;
566
+ };
567
+ tokenLimits?: {
568
+ excellent?: number; // Default: 200
569
+ good?: number; // Default: 400
570
+ warning?: number; // Default: 600
571
+ error?: number; // Default: 1000
572
+ };
573
+ };
574
+ }
575
+
576
+ // Returns
577
+ {
578
+ valid: boolean;
579
+ totalFiles: number;
580
+ results: Array<{
581
+ path: string;
582
+ valid: boolean;
583
+ tokens: number;
584
+ rating: 'excellent' | 'good' | 'needs-improvement' | 'too-long';
585
+ issues: string[];
586
+ suggestions: string[];
587
+ }>;
588
+ summary: string;
589
+ }
590
+ ```
591
+
592
+ **Validation Features**:
593
+ - Token counting for AI consumption optimization
594
+ - Structure validation (H1 heading, sections)
595
+ - Line length checks (default: 100 chars)
596
+ - Code block detection (disabled by default for strict mode)
597
+ - Quality ratings based on token count
598
+
599
+ **Default Token Limits (Strict Mode)**:
600
+ - 🌟 Excellent: < 200 tokens
601
+ - βœ… Good: < 400 tokens
602
+ - ⚠️ Needs improvement: < 600 tokens
603
+ - ❌ Too long: > 1000 tokens
604
+
605
+ ## πŸš€ What's Next
606
+
607
+ We're actively working on new features:
608
+
609
+ - **Watch Mode** - Auto-sync changes when AI_README files are modified
610
+ - **Performance Optimization** - Caching and incremental updates
611
+ - **VSCode Extension** - Visual interface for managing AI_README files
612
+ - **CI/CD Integration** - GitHub Actions for automated README validation
613
+
614
+ Want to contribute? Check out our [Contributing Guide](./CONTRIBUTING.md)!
474
615
 
475
616
  ## 🀝 Contributing
476
617
 
@@ -493,4 +634,4 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
493
634
 
494
635
  ---
495
636
 
496
- **Status:** 🚧 In Development | **Version:** 0.1.0 | **Last Updated:** 2025-11-05
637
+ **Status:** βœ… Published | **Version:** 0.3.0 | **Last Updated:** 2025-11-08