ai-readme-mcp 0.3.3 → 0.4.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
@@ -46,9 +46,9 @@ This MCP (Model Context Protocol) server automates the entire workflow:
46
46
 
47
47
  - 🔍 **Auto-discovers** all AI_README.md files in your project
48
48
  - 🎯 **Routes context** - AI gets the most relevant README for the code it's editing
49
+ - 🚀 **Guided initialization** - `init_ai_readme` scans for empty files and guides AI through population
49
50
  - ✏️ **Updates automatically** - AI can add new conventions it discovers while coding
50
51
  - ✅ **Validates quality** - Ensures READMEs are concise and optimized for AI consumption
51
- - 🤖 **Smart generation** - Auto-creates AI_README based on your project structure
52
52
 
53
53
  **Result:** Every AI interaction in your project follows your team's standards and produces consistent, high-quality code.
54
54
 
@@ -58,9 +58,9 @@ This MCP (Model Context Protocol) server automates the entire workflow:
58
58
 
59
59
  - 🔍 **Automatic Discovery** - Scan and index all AI_README.md files in your project
60
60
  - 🎯 **Smart Context Routing** - Find relevant README content based on file paths
61
+ - 🚀 **Guided Initialization** - `init_ai_readme` tool scans for empty files and guides AI through population
61
62
  - 🔄 **Update & Sync** - AI can both read and update AI_README files
62
63
  - ✅ **Validation & Quality** - Ensure README consistency with token limits and structure checks
63
- - 🤖 **Smart Initialization** - Auto-generate AI_README files based on project analysis
64
64
  - 🏗️ **Monorepo Support** - Place AI_README.md files at different folder levels; the tool automatically finds and uses the most relevant one
65
65
  - 📦 **Easy Integration** - Works seamlessly with Cursor, Claude Code, and other MCP clients
66
66
 
@@ -265,37 +265,81 @@ Add to `claude_desktop_config.json`:
265
265
 
266
266
  ### Create Your First AI_README
267
267
 
268
- You can use the `init_ai_readme` MCP tool to automatically generate a customized AI_README.md based on your project:
268
+ You have two main approaches to create and populate AI_README files:
269
269
 
270
- **Smart Mode (Default)**:
271
- The tool automatically detects your project and generates relevant content:
272
- - Detects project type (library/application/monorepo)
273
- - Identifies language (TypeScript, Python, Go, Rust, Java, etc.)
274
- - Recognizes framework (React, Vue, Next.js, Express, NestJS, etc.)
275
- - Analyzes directory structure
276
- - Generates framework-specific conventions
270
+ #### Option 1: Automated Initialization (Recommended)
277
271
 
278
- Ask your AI assistant:
279
- > "Please use init_ai_readme to create an AI_README.md for this project"
272
+ Use the `init_ai_readme` tool to automatically scan and populate empty AI_README files:
280
273
 
281
- Or create manually:
274
+ **Step 1:** Create empty AI_README.md files where needed
275
+
276
+ ```bash
277
+ # Example: Create empty AI_READMEs in different directories
278
+ touch AI_README.md
279
+ touch apps/backend/AI_README.md
280
+ touch apps/frontend/AI_README.md
281
+ ```
282
+
283
+ **Step 2:** Trigger the initialization
284
+
285
+ In your AI assistant (Claude Code, Cursor, etc.), simply say:
286
+
287
+ > "Please run init_ai_readme for this project"
288
+
289
+ Or more explicitly:
290
+
291
+ > "Initialize AI_README files"
292
+ > "Help me populate the empty AI_README files"
293
+
294
+ **What happens:**
295
+ - 🔍 Scans your project for empty AI_README files
296
+ - 📝 Creates root-level AI_README if none exist
297
+ - 📋 Provides detailed step-by-step instructions for each file
298
+ - 🤖 AI assistant will then:
299
+ - Explore relevant directories
300
+ - Analyze your codebase (tech stack, patterns, conventions)
301
+ - Populate each AI_README with relevant documentation
302
+
303
+ **When to use `init_ai_readme`:**
304
+ - First time setting up AI_README in your project
305
+ - After creating new empty AI_README.md files in subdirectories
306
+ - When `get_context_for_file` detects empty AI_README files
307
+ - To batch-process multiple empty AI_README files
308
+
309
+ #### Option 2: Manual Creation
310
+
311
+ Create and write AI_README.md files yourself:
282
312
 
283
313
  ```markdown
284
314
  # My Project
285
315
 
286
- ## Architecture
316
+ ## Tech Stack
287
317
  - Framework: React + Express
288
318
  - Database: PostgreSQL
319
+ - Testing: Jest + Vitest
320
+
321
+ ## Architecture Patterns
322
+ - Follows MVC pattern for backend
323
+ - Component-based architecture for frontend
324
+ - RESTful API design
289
325
 
290
326
  ## Coding Conventions
291
327
  - Use TypeScript for all files
292
328
  - Components in PascalCase
293
- - Test coverage: 80%+
329
+ - Functions and variables in camelCase
330
+ - Test coverage: 80%+ required
294
331
 
295
332
  ## Testing
296
333
  Run tests with: `npm test`
334
+ Write tests alongside source files
297
335
  ```
298
336
 
337
+ **Best Practices:**
338
+ - Keep it concise (< 400 tokens is ideal)
339
+ - Focus on conventions, not documentation
340
+ - Update as your project evolves
341
+ - Use AI to help maintain it
342
+
299
343
  ### Multi-Level AI_README (Not Just for Monorepos!)
300
344
 
301
345
  **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.
@@ -324,10 +368,11 @@ my-monorepo/
324
368
  ```
325
369
 
326
370
  **Smart Empty README Handling:**
327
- - 📝 If you create an empty `AI_README.md` in a subdirectory, the tool can auto-fill it with relevant conventions
371
+ - 📝 Create empty `AI_README.md` files in subdirectories where you need specific conventions
372
+ - 🚀 Run `init_ai_readme` tool (just tell your AI: "Please initialize AI_README files")
373
+ - 🤖 AI automatically analyzes each directory and populates conventions
328
374
  - 🔗 For subdirectories with parent READMEs, generates differential content (only module-specific conventions)
329
375
  - 📋 For root directories, generates full project analysis
330
- - Ask your AI: "This AI_README.md is empty, can you help fill it?"
331
376
 
332
377
  When AI works on a file, it automatically gets:
333
378
  - The **most relevant** AI_README (closest parent directory)
@@ -409,61 +454,6 @@ npm run dev
409
454
 
410
455
  ## 🛠️ Available MCP Tools
411
456
 
412
- ### `init_ai_readme`
413
-
414
- Initialize a new AI_README.md file with smart content generation based on project analysis.
415
-
416
- ```typescript
417
- // Parameters
418
- {
419
- targetPath: string; // Required: Directory where AI_README.md will be created
420
- projectName?: string; // Optional: Project name (auto-detected if not provided)
421
- overwrite?: boolean; // Optional: Overwrite existing file (default: false)
422
- smart?: boolean; // Optional: Enable smart content generation (default: true)
423
- }
424
-
425
- // Returns
426
- {
427
- success: boolean;
428
- readmePath: string;
429
- action: 'created' | 'filled' | 'overwritten';
430
- projectInfo?: {
431
- projectName: string;
432
- projectType: 'library' | 'application' | 'monorepo' | 'unknown';
433
- language: string;
434
- framework?: string;
435
- packageManager?: string;
436
- hasTests: boolean;
437
- mainDirs: string[];
438
- };
439
- message: string;
440
- }
441
- ```
442
-
443
- **Smart Mode Features**:
444
- - Auto-detects project type, language, and framework
445
- - Generates framework-specific conventions (React, Vue, Python, etc.)
446
- - For subdirectories with parent READMEs, generates differential content
447
- - Handles empty files (< 50 chars) by auto-filling them
448
- - Analyzes directory structure and dependencies
449
-
450
- **Example Usage**:
451
-
452
- ```typescript
453
- // Create smart README for React project
454
- {
455
- targetPath: "/path/to/react-app",
456
- smart: true
457
- }
458
- // Result: Auto-detects React, generates component naming conventions, etc.
459
-
460
- // Fill empty subdirectory README
461
- {
462
- targetPath: "/path/to/monorepo/apps/frontend"
463
- }
464
- // Result: Generates differential content extending root README
465
- ```
466
-
467
457
  ### `discover_ai_readmes`
468
458
 
469
459
  Scans your project and discovers all AI_README.md files.
@@ -586,6 +576,59 @@ Update an AI_README.md file with specified operations.
586
576
  }
587
577
  ```
588
578
 
579
+ ### `init_ai_readme`
580
+
581
+ Initialize and populate empty AI_README files in your project.
582
+
583
+ ```typescript
584
+ // Parameters
585
+ {
586
+ projectRoot: string; // Required: Project root directory
587
+ excludePatterns?: string[]; // Optional: Glob patterns to exclude
588
+ targetPath?: string; // Optional: Specific directory to initialize
589
+ }
590
+
591
+ // Returns
592
+ {
593
+ success: boolean;
594
+ message: string;
595
+ readmesToInitialize: string[]; // Paths to empty AI_README files
596
+ instructions: string; // Detailed step-by-step guide for populating
597
+ }
598
+ ```
599
+
600
+ **Features:**
601
+ - 🔍 Scans project for empty or missing AI_README files
602
+ - 📝 Creates root-level AI_README if none exist
603
+ - 📋 Generates detailed step-by-step instructions for each file
604
+ - 🎯 Can target specific directories with `targetPath` parameter
605
+ - 🤖 Guides AI through analysis: tech stack, patterns, conventions
606
+
607
+ **Example Usage:**
608
+
609
+ ```typescript
610
+ // Initialize all empty AI_READMEs in project
611
+ {
612
+ projectRoot: "/path/to/project"
613
+ }
614
+
615
+ // Initialize only in specific directory
616
+ {
617
+ projectRoot: "/path/to/project",
618
+ targetPath: "apps/backend"
619
+ }
620
+ ```
621
+
622
+ **Typical Workflow:**
623
+ 1. AI assistant runs `init_ai_readme`
624
+ 2. Receives detailed instructions for each empty file
625
+ 3. Follows instructions:
626
+ - Uses `Glob` to scan directory
627
+ - Reads 2-5 key source files
628
+ - Analyzes tech stack, patterns, conventions
629
+ 4. Uses `update_ai_readme` to populate each file
630
+ 5. Verifies with `get_context_for_file` or `validate_ai_readmes`
631
+
589
632
  ### `validate_ai_readmes`
590
633
 
591
634
  Validate all AI_README.md files in your project for quality and token efficiency.