@voicenter-team/nuxt-llms-generator 0.1.10 โ†’ 0.1.12

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
@@ -1,625 +1,630 @@
1
- # ๐Ÿค– LLMS Documentation Generator for Nuxt 3
2
-
3
- **Transform your Umbraco CMS content into AI-optimized documentation following the 2024 LLMS.txt standard**
4
-
5
- [![TypeScript](https://img.shields.io/badge/TypeScript-007ACC?style=flat&logo=typescript&logoColor=white)](https://typescript.org)
6
- [![Nuxt 3](https://img.shields.io/badge/Nuxt-00DC82?style=flat&logo=nuxt.js&logoColor=white)](https://nuxt.com)
7
- [![Claude AI](https://img.shields.io/badge/Claude_AI-FF6B35?style=flat&logo=anthropic&logoColor=white)](https://claude.ai)
8
- [![MIT License](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
9
-
10
- Generate high-quality, AI-optimized markdown documentation from your Umbraco CMS content using Claude AI. Perfect for creating LLMS.txt files that help AI systems understand your website.
11
-
12
- ## ๐Ÿ”„ How It Works
13
-
14
- ```mermaid
15
- flowchart TB
16
- subgraph "INPUT"
17
- JSON[UmbracoData.json<br/>๐Ÿ“‹ CMS Content]
18
- CONFIG[nuxt.config.ts<br/>โš™๏ธ Configuration]
19
- API_KEY[๐Ÿ”‘ Anthropic API Key]
20
- end
21
-
22
- subgraph "PROCESSING PIPELINE"
23
- START([๐Ÿš€ Build Process Starts])
24
-
25
- subgraph "1๏ธโƒฃ INITIALIZATION"
26
- LOAD[Load Configuration]
27
- VALIDATE[Validate API Connection]
28
- CACHE_CHECK[Check Template Cache]
29
- end
30
-
31
- subgraph "2๏ธโƒฃ CONTENT ANALYSIS"
32
- FILTER[Filter Visible Pages<br/>๐Ÿ“Š Skip hidePage: "1"]
33
- EXTRACT[Extract Page Content<br/>๐Ÿ” JSONPath Resolution]
34
- HASH[Generate Structure Hash<br/>๐Ÿ—๏ธ Detect Changes]
35
- end
36
-
37
- subgraph "3๏ธโƒฃ TEMPLATE GENERATION"
38
- CACHE_HIT{Cache Hit?}
39
- CLAUDE[๐Ÿค– Claude AI Analysis<br/>Semantic Understanding]
40
- TEMPLATE[Generate Mustache Template<br/>๐Ÿ“ AI-Optimized Structure]
41
- STORE_CACHE[๐Ÿ’พ Store in Cache]
42
- end
43
-
44
- subgraph "4๏ธโƒฃ CLEANUP & OPTIMIZATION"
45
- CLEANUP[๐Ÿงน Orphaned Template Cleanup<br/>Remove deleted/hidden pages]
46
- HTML_CLEAN[๐Ÿ”ง HTML-to-Markdown<br/>Clean Artifacts & Entities]
47
- end
48
-
49
- subgraph "5๏ธโƒฃ FILE GENERATION"
50
- RENDER[Render Templates<br/>๐ŸŽจ Mustache + Data]
51
- POST_PROCESS[Post-Process Markdown<br/>โœจ Final Quality Pass]
52
- end
53
- end
54
-
55
- subgraph "OUTPUT FILES"
56
- LLMS_TXT[๐Ÿ“„ llms.txt<br/>Navigation Index]
57
- LLMS_FULL[๐Ÿ“„ llms-full.txt<br/>Complete Documentation]
58
- MD_FILES[๐Ÿ“ Individual .md Files<br/>Per-Page Documentation]
59
- end
60
-
61
- subgraph "MULTI-SITE SUPPORT"
62
- ENV1[๐ŸŒ Site 1<br/>SITE_ENV=main]
63
- ENV2[๐ŸŒ Site 2<br/>SITE_ENV=partner]
64
- ENV3[๐ŸŒ Site 3<br/>SITE_ENV=staging]
65
-
66
- CACHE1[๐Ÿ’พ .llms-templates/main/]
67
- CACHE2[๐Ÿ’พ .llms-templates/partner/]
68
- CACHE3[๐Ÿ’พ .llms-templates/staging/]
69
-
70
- OUT1[๐Ÿ“‚ .output/llms/main/]
71
- OUT2[๐Ÿ“‚ .output/llms/partner/]
72
- OUT3[๐Ÿ“‚ .output/llms/staging/]
73
- end
74
-
75
- %% Flow connections
76
- JSON --> START
77
- CONFIG --> START
78
- API_KEY --> START
79
-
80
- START --> LOAD
81
- LOAD --> VALIDATE
82
- VALIDATE --> CACHE_CHECK
83
-
84
- CACHE_CHECK --> FILTER
85
- FILTER --> EXTRACT
86
- EXTRACT --> HASH
87
-
88
- HASH --> CACHE_HIT
89
- CACHE_HIT -->|โŒ No| CLAUDE
90
- CACHE_HIT -->|โœ… Yes| CLEANUP
91
-
92
- CLAUDE --> TEMPLATE
93
- TEMPLATE --> STORE_CACHE
94
- STORE_CACHE --> CLEANUP
95
-
96
- CLEANUP --> HTML_CLEAN
97
- HTML_CLEAN --> RENDER
98
- RENDER --> POST_PROCESS
99
-
100
- POST_PROCESS --> LLMS_TXT
101
- POST_PROCESS --> LLMS_FULL
102
- POST_PROCESS --> MD_FILES
103
-
104
- %% Multi-site flows
105
- CONFIG -.-> ENV1
106
- CONFIG -.-> ENV2
107
- CONFIG -.-> ENV3
108
-
109
- ENV1 -.-> CACHE1
110
- ENV2 -.-> CACHE2
111
- ENV3 -.-> CACHE3
112
-
113
- CACHE1 -.-> OUT1
114
- CACHE2 -.-> OUT2
115
- CACHE3 -.-> OUT3
116
-
117
- %% Styling
118
- classDef input fill:#e1f5fe
119
- classDef process fill:#f3e5f5
120
- classDef output fill:#e8f5e8
121
- classDef multisite fill:#fff3e0
122
-
123
- class JSON,CONFIG,API_KEY input
124
- class LLMS_TXT,LLMS_FULL,MD_FILES output
125
- class ENV1,ENV2,ENV3,CACHE1,CACHE2,CACHE3,OUT1,OUT2,OUT3 multisite
126
- ```
127
-
128
- ### ๐ŸŽฏ **Key Process Details**
129
-
130
- | Phase | What Happens | Why It Matters |
131
- |--------------------------|----------------------------------------------------------------------------------|--------------------------------------------------------------------------------|
132
- | **๐Ÿ” Content Analysis** | Filters visible pages, extracts content via JSONPath, generates structure hashes | Only processes public pages, detects actual changes (not just content updates) |
133
- | **๐Ÿค– AI Generation** | Claude analyzes page structure and generates semantic Mustache templates | Creates context-aware templates that understand your business domain |
134
- | **๐Ÿ’พ Smart Caching** | Stores templates with structure hashes, reuses unchanged templates | Saves API costs and generation time on subsequent builds |
135
- | **๐Ÿงน Automatic Cleanup** | Removes templates for deleted/hidden pages, syncs with current content | Prevents cache bloat and maintains accuracy |
136
- | **๐Ÿ”ง Post-Processing** | Converts HTML to clean markdown, removes artifacts and entities | Ensures AI-optimized output that follows 2024 LLMS.txt standards |
137
-
138
- ### ๐Ÿข **Multi-Site Architecture**
139
-
140
- The system automatically adapts to different environments using the `SITE_ENV` variable:
141
-
142
- ```bash
143
- SITE_ENV=main โ†’ UmbracoData-main.json โ†’ .llms-templates/main/ โ†’ .output/llms/main/
144
- SITE_ENV=partner โ†’ UmbracoData-partner.json โ†’ .llms-templates/partner/ โ†’ .output/llms/partner/
145
- SITE_ENV=staging โ†’ UmbracoData-staging.json โ†’ .llms-templates/staging/ โ†’ .output/llms/staging/
146
- ```
147
-
148
- Each environment maintains its own isolated cache and output, preventing conflicts while sharing the same codebase and configuration logic.
149
-
150
- ---
151
-
152
- ## ๐ŸŒŸ Features
153
-
154
- ### ๐Ÿค– **AI-Powered Template Generation**
155
- - **Claude API Integration**: Uses Anthropic's Claude for intelligent content analysis
156
- - **2024 LLMS.txt Compliance**: Follows the latest LLMS.txt standard for AI consumption
157
- - **Semantic Understanding**: Automatically detects content types and generates appropriate templates
158
- - **Multi-language Support**: Handles Hebrew/English mixed content and RTL text
159
-
160
- ### โšก **Smart Caching System**
161
- - **Structure-Based Detection**: Only regenerates when page structure changes (not content values)
162
- - **Incremental Updates**: Process only changed pages for faster builds
163
- - **API Cost Optimization**: Avoids unnecessary Claude API calls
164
- - **Git-Friendly**: Templates stored in git, outputs excluded
165
-
166
- ### ๐Ÿงน **Automatic Cleanup**
167
- - **Orphaned Template Detection**: Removes templates for deleted pages
168
- - **Hidden Page Handling**: Cleans up templates for pages marked as hidden
169
- - **Cache Synchronization**: Keeps template cache aligned with Umbraco content
170
-
171
- ### ๐Ÿ“„ **Multiple Output Formats**
172
- 1. **`llms.txt`** - Navigation index following 2024 standard
173
- 2. **`llms-full.txt`** - Complete site documentation in one file
174
- 3. **Individual `.md` files** - Clean, AI-optimized markdown per page
175
-
176
- ### ๐ŸŽฏ **Production Ready**
177
- - **26 Passing Tests**: Comprehensive test coverage
178
- - **TypeScript Support**: Full type safety throughout
179
- - **Parallel Processing**: Configurable concurrency for large sites
180
- - **Error Resilience**: Graceful handling of failures with detailed logging
181
-
182
- ---
183
-
184
- ## ๐Ÿš€ Quick Start
185
-
186
- ### Installation
187
-
188
- ```bash
189
- npm install nuxt-llms-generator
190
- # or
191
- yarn add nuxt-llms-generator
192
- # or
193
- pnpm add nuxt-llms-generator
194
- ```
195
-
196
- ### Basic Configuration
197
-
198
- ```typescript
199
- // nuxt.config.ts
200
- export default defineNuxtConfig({
201
- modules: ['nuxt-llms-generator'],
202
- llmsGenerator: {
203
- anthropicApiKey: process.env.ANTHROPIC_API_KEY,
204
- umbracoDataPath: './public/UmbracoData.json',
205
- finalOutputDir: './.output/llms'
206
- }
207
- })
208
- ```
209
-
210
- ### Environment Variables
211
-
212
- ```bash
213
- # .env
214
- ANTHROPIC_API_KEY=sk-ant-api03-your-key-here
215
- ```
216
-
217
- ### Generate Documentation
218
-
219
- ```bash
220
- npm run build
221
- # Documentation generated automatically during build process
222
- ```
223
-
224
- ---
225
-
226
- ## โš™๏ธ Configuration Options
227
-
228
- ### Core Settings
229
-
230
- | Option | Type | Required | Default | Description |
231
- |----------------------|----------|----------|------------------|--------------------------------------------|
232
- | `anthropicApiKey` | `string` | โœ… | - | Your Claude API key from Anthropic |
233
- | `umbracoDataPath` | `string` | โœ… | - | Path to your UmbracoData.json file |
234
- | `templatesDir` | `string` | โŒ | `./.llms-templates` | Directory for templates and cache files |
235
- | `finalOutputDir` | `string` | โŒ | `./.output/llms` | Output directory for final documentation |
236
-
237
- ### Generation Options
238
-
239
- | Option | Type | Default | Description |
240
- |------------------------|-----------|------------------------------|------------------------------------------|
241
- | `enableIndividualMd` | `boolean` | `true` | Generate individual .md files per page |
242
- | `enableLLMSFullTxt` | `boolean` | `true` | Generate combined llms-full.txt file |
243
- | `enableHtmlToMarkdown` | `boolean` | `true` | Convert HTML content to markdown using [node-html-markdown](https://www.npmjs.com/package/node-html-markdown) |
244
- | `maxConcurrent` | `number` | `5` | Maximum concurrent API requests |
245
- | `anthropicModel` | `string` | `claude-3-5-sonnet-20241022` | Claude model to use |
246
-
247
- ### Cleanup Options
248
-
249
- | Option | Type | Default | Description |
250
- |---------------------|-----------|---------|----------------------------------------|
251
- | `enableAutoCleanup` | `boolean` | `true` | Automatically clean orphaned templates |
252
- | `cleanupOrphaned` | `boolean` | `true` | Remove templates for deleted pages |
253
- | `cleanupHidden` | `boolean` | `true` | Remove templates for hidden pages |
254
-
255
- ---
256
-
257
- ## ๐Ÿข Multi-Site Implementation
258
-
259
- Perfect for projects where one codebase generates multiple websites based on environment variables.
260
-
261
- ### Environment-Based Configuration
262
-
263
- ```typescript
264
- // nuxt.config.ts
265
- const siteEnv = process.env.SITE_ENV || 'main' // 'main', 'staging', 'partner', etc.
266
-
267
- export default defineNuxtConfig({
268
- modules: ['nuxt-llms-generator'],
269
- llmsGenerator: {
270
- anthropicApiKey: process.env.ANTHROPIC_API_KEY,
271
-
272
- // Environment-specific paths
273
- umbracoDataPath: `./public/UmbracoData-${siteEnv}.json`,
274
- templatesDir: `./.llms-templates/${siteEnv}`,
275
- finalOutputDir: `./.output/llms/${siteEnv}`,
276
-
277
- // Shared settings
278
- maxConcurrent: 5,
279
- enableAutoCleanup: true
280
- }
281
- })
282
- ```
283
-
284
- ### Build Commands
285
-
286
- ```json
287
- // package.json
288
- {
289
- "scripts": {
290
- "build:main": "SITE_ENV=main nuxt build",
291
- "build:partner": "SITE_ENV=partner nuxt build",
292
- "build:staging": "SITE_ENV=staging nuxt build"
293
- }
294
- }
295
- ```
296
-
297
- ### Directory Structure
298
-
299
- ```
300
- project/
301
- โ”œโ”€โ”€ .llms-templates/
302
- โ”‚ โ”œโ”€โ”€ main/ # Main site templates & cache
303
- โ”‚ โ”œโ”€โ”€ partner/ # Partner site templates & cache
304
- โ”‚ โ””โ”€โ”€ staging/ # Staging site templates & cache
305
- โ”œโ”€โ”€ .output/
306
- โ”‚ โ””โ”€โ”€ llms/
307
- โ”‚ โ”œโ”€โ”€ main/ # Main site docs
308
- โ”‚ โ”œโ”€โ”€ partner/ # Partner site docs
309
- โ”‚ โ””โ”€โ”€ staging/ # Staging site docs
310
- โ”œโ”€โ”€ public/
311
- โ”‚ โ”œโ”€โ”€ UmbracoData-main.json
312
- โ”‚ โ”œโ”€โ”€ UmbracoData-partner.json
313
- โ”‚ โ””โ”€โ”€ UmbracoData-staging.json
314
- โ””โ”€โ”€ templates/
315
- โ”œโ”€โ”€ main/ # Main site templates
316
- โ”œโ”€โ”€ partner/ # Partner site templates
317
- โ””โ”€โ”€ staging/ # Staging site templates
318
- ```
319
-
320
- ---
321
-
322
- ## ๐Ÿ“Š Generated Output Examples
323
-
324
- ### `llms.txt` (Navigation Index)
325
- ```markdown
326
- # Business Communication Solutions | Voicenter
327
-
328
- > Thousands of organizations in Israel manage their business communications through our advanced cloud platform
329
-
330
- This website contains comprehensive information about business communication solutions. The content is organized into the following sections:
331
-
332
- ## Services
333
-
334
- - [Call Center Solutions](call-center-solutions.md): Complete call center management tools
335
- - [Smart PBX for Business](smart-pbx-business.md): Advanced business telephony services
336
- - [Mobile Solutions](mobile-solutions.md): Unlimited mobile communication solutions
337
-
338
- ## Technical
339
-
340
- - [API Integration](api-integration.md): Developer tools and API documentation
341
- - [CRM Connectivity](crm-connectivity.md): Full CRM integration capabilities
342
-
343
- ## Optional
344
-
345
- - [Complete Documentation](llms-full.txt): All content combined in a single file
346
- ```
347
-
348
- ### Individual `.md` Files
349
- ```markdown
350
- # Call Center Solutions
351
-
352
- > Complete call center management tools for modern businesses
353
-
354
- ## Overview
355
-
356
- Our call center solutions provide comprehensive tools for managing customer communications efficiently. Built on advanced cloud technology, these tools enable seamless implementation and superior organizational management.
357
-
358
- ## Key Features
359
-
360
- - **Advanced Queue Management**: Intelligent call routing and distribution
361
- - **Automated Callbacks**: Smart callback scheduling system
362
- - **CRM Integration**: Seamless connection with existing CRM systems
363
- - **Real-time Analytics**: Live monitoring and performance dashboards
364
- - **Multi-channel Support**: Handle calls, emails, and chat in one platform
365
-
366
- ## Benefits
367
-
368
- - Reduced customer wait times
369
- - Increased agent productivity
370
- - Better customer satisfaction scores
371
- - Scalable solution that grows with your business
372
-
373
- *Generated with Claude AI | Last updated: 2024-01-16*
374
- ```
375
-
376
- ---
377
-
378
- ## ๐Ÿ”ง Advanced Usage
379
-
380
- ### Custom Build Script
381
-
382
- ```javascript
383
- // scripts/generate-docs.js
384
- import { LLMSFilesGenerator } from 'nuxt-llms-generator'
385
-
386
- const config = {
387
- anthropicApiKey: process.env.ANTHROPIC_API_KEY,
388
- umbracoDataPath: './public/UmbracoData.json',
389
- finalOutputDir: './docs/ai-generated'
390
- }
391
-
392
- const generator = new LLMSFilesGenerator(config)
393
-
394
- try {
395
- const files = await generator.generateAllFiles()
396
- console.log(`โœ… Generated ${files.individualMdFiles?.length || 0} markdown files`)
397
- console.log('๐Ÿ“ LLMS documentation generation complete!')
398
- } catch (error) {
399
- console.error('โŒ Generation failed:', error)
400
- process.exit(1)
401
- }
402
- ```
403
-
404
- ### Development vs Production
405
-
406
- ```typescript
407
- // nuxt.config.ts
408
- const isDev = process.env.NODE_ENV === 'development'
409
-
410
- export default defineNuxtConfig({
411
- llmsGenerator: {
412
- anthropicApiKey: process.env.ANTHROPIC_API_KEY,
413
- umbracoDataPath: './public/UmbracoData.json',
414
-
415
- // Generate fewer files during development
416
- enableIndividualMd: !isDev,
417
- enableLLMSFullTxt: !isDev,
418
-
419
- // Lower concurrency in development
420
- maxConcurrent: isDev ? 2 : 8
421
- }
422
- })
423
- ```
424
-
425
- ### CI/CD Integration
426
-
427
- ```yaml
428
- # .github/workflows/build.yml
429
- name: Generate Documentation
430
- on:
431
- push:
432
- branches: [main]
433
-
434
- jobs:
435
- docs:
436
- runs-on: ubuntu-latest
437
- steps:
438
- - uses: actions/checkout@v3
439
- - uses: actions/setup-node@v3
440
- with:
441
- node-version: 18
442
- - run: npm ci
443
- - run: npm run build
444
- env:
445
- ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
446
- - name: Deploy docs
447
- run: cp -r .output/llms/* ./public/docs/
448
- ```
449
-
450
- ---
451
-
452
- ## ๐Ÿงช Testing
453
-
454
- Run the comprehensive test suite:
455
-
456
- ```bash
457
- npm test
458
- # or
459
- npm run test:watch # Watch mode
460
- ```
461
-
462
- ### Test Coverage
463
-
464
- - โœ… Template generation and caching
465
- - โœ… HTML-to-markdown conversion
466
- - โœ… Multi-language content handling
467
- - โœ… Page visibility filtering
468
- - โœ… Orphaned template cleanup
469
- - โœ… Configuration validation
470
- - โœ… Error handling and resilience
471
-
472
- ---
473
-
474
- ## ๐Ÿ› Troubleshooting
475
-
476
- ### Common Issues
477
-
478
- **โŒ "Claude API key not found"**
479
- ```bash
480
- # Make sure your API key is set
481
- echo $ANTHROPIC_API_KEY
482
- # Should show: sk-ant-api03-...
483
- ```
484
-
485
- **โŒ "UmbracoData.json not found"**
486
- ```bash
487
- # Check the file exists
488
- ls -la public/UmbracoData.json
489
- # Verify path in nuxt.config.ts matches
490
- ```
491
-
492
- **โŒ "Template generation failed"**
493
- - Check Claude API quota and rate limits
494
- - Verify UmbracoData.json has valid structure
495
- - Enable debug logging: `DEBUG=llms:* npm run build`
496
-
497
- ### Performance Tips
498
-
499
- 1. **Large Sites (1000+ pages)**:
500
- ```typescript
501
- {
502
- maxConcurrent: 8, // Higher concurrency
503
- enableAutoCleanup: true, // Keep cache clean
504
- }
505
- ```
506
-
507
- 2. **Development Speed**:
508
- ```typescript
509
- {
510
- enableIndividualMd: false, // Skip individual files
511
- maxConcurrent: 2, // Lower API usage
512
- }
513
- ```
514
-
515
- 3. **Production Optimization**:
516
- ```typescript
517
- {
518
- enableAutoCleanup: true,
519
- cleanupOrphaned: true,
520
- cleanupHidden: true,
521
- enableHtmlToMarkdown: true // Clean HTML from CMS content
522
- }
523
- ```
524
-
525
- 4. **HTML Content Processing**:
526
- ```typescript
527
- {
528
- enableHtmlToMarkdown: true, // Convert <p>, <h1>, etc. to clean markdown
529
- enableHtmlToMarkdown: false // Keep HTML as-is (if AI already generates clean content)
530
- }
531
- ```
532
-
533
- ---
534
-
535
- ## ๐Ÿ“š API Reference
536
-
537
- ### LLMSFilesGenerator
538
-
539
- ```typescript
540
- import { LLMSFilesGenerator } from 'nuxt-llms-generator'
541
-
542
- const generator = new LLMSFilesGenerator({
543
- anthropicApiKey: 'your-api-key',
544
- umbracoDataPath: './data.json',
545
- finalOutputDir: './output'
546
- })
547
-
548
- // Generate all documentation files
549
- const files = await generator.generateAllFiles()
550
-
551
- // Test Claude API connection
552
- const isConnected = await generator.testConnection()
553
-
554
- // Clear template cache
555
- generator.clearCache()
556
-
557
- // Get generation statistics
558
- const stats = generator.getStats()
559
- ```
560
-
561
- ### Configuration Interface
562
-
563
- ```typescript
564
- interface LLMSConfig {
565
- // Required
566
- anthropicApiKey: string;
567
- umbracoDataPath: string;
568
-
569
- // Optional with defaults
570
- templatesDir?: string; // './.llms-templates'
571
- finalOutputDir?: string; // './.output/llms'
572
- anthropicModel?: string; // 'claude-3-5-sonnet-20241022'
573
- maxConcurrent?: number; // 5
574
- enableLLMSFullTxt?: boolean; // true
575
- enableIndividualMd?: boolean; // true
576
- enableHtmlToMarkdown?: boolean; // true
577
- enableAutoCleanup?: boolean; // true
578
- cleanupOrphaned?: boolean; // true
579
- cleanupHidden?: boolean; // true
580
- }
581
- ```
582
-
583
- ---
584
-
585
- ## ๐Ÿค Contributing
586
-
587
- We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.
588
-
589
- ### Development Setup
590
-
591
- ```bash
592
- git clone https://github.com/your-org/nuxt-llms-generator.git
593
- cd nuxt-llms-generator
594
- npm install
595
- npm run dev
596
- ```
597
-
598
- ### Running Tests
599
-
600
- ```bash
601
- npm test # Run all tests
602
- npm run test:watch # Watch mode
603
- npm run test:coverage # Coverage report
604
- ```
605
-
606
- ---
607
-
608
- ## ๐Ÿ“„ License
609
-
610
- MIT License - see [LICENSE](LICENSE) file for details.
611
-
612
- ---
613
-
614
- ## ๐Ÿ™ Acknowledgments
615
-
616
- - [Anthropic](https://anthropic.com) for Claude AI API
617
- - [Jeremy Howard](https://github.com/jph00) for the 2024 LLMS.txt standard
618
- - [Nuxt 3](https://nuxt.com) for the amazing framework
619
- - The open-source community for inspiration and feedback
620
-
621
- ---
622
-
623
- **Made with โค๏ธ for the AI-first web**
624
-
625
- Transform your CMS content into AI-optimized documentation that helps AI systems understand your business better.
1
+ # ๐Ÿค– LLMS Documentation Generator for Nuxt 3
2
+
3
+ **Transform your Umbraco CMS content into AI-optimized documentation following the 2024 LLMS.txt standard**
4
+
5
+ [![TypeScript](https://img.shields.io/badge/TypeScript-007ACC?style=flat&logo=typescript&logoColor=white)](https://typescript.org)
6
+ [![Nuxt 3](https://img.shields.io/badge/Nuxt-00DC82?style=flat&logo=nuxt.js&logoColor=white)](https://nuxt.com)
7
+ [![Claude AI](https://img.shields.io/badge/Claude_AI-FF6B35?style=flat&logo=anthropic&logoColor=white)](https://claude.ai)
8
+ [![MIT License](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
9
+
10
+ Generate high-quality, AI-optimized markdown documentation from your Umbraco CMS content using Claude AI. Perfect for creating LLMS.txt files that help AI systems understand your website.
11
+
12
+ ## ๐Ÿ”„ How It Works
13
+
14
+ ```mermaid
15
+ flowchart TB
16
+ subgraph "INPUT"
17
+ JSON[UmbracoData.json<br/>๐Ÿ“‹ CMS Content]
18
+ CONFIG[nuxt.config.ts<br/>โš™๏ธ Configuration]
19
+ API_KEY[๐Ÿ”‘ Anthropic API Key]
20
+ end
21
+
22
+ subgraph "PROCESSING PIPELINE"
23
+ START([๐Ÿš€ Build Process Starts])
24
+
25
+ subgraph "1๏ธโƒฃ INITIALIZATION"
26
+ LOAD[Load Configuration]
27
+ VALIDATE[Validate API Connection]
28
+ CACHE_CHECK[Check Template Cache]
29
+ end
30
+
31
+ subgraph "2๏ธโƒฃ CONTENT ANALYSIS"
32
+ FILTER[Filter Visible Pages<br/>๐Ÿ“Š Skip hidePage: "1"]
33
+ EXTRACT[Extract Page Content<br/>๐Ÿ” JSONPath Resolution]
34
+ HASH[Generate Structure Hash<br/>๐Ÿ—๏ธ Detect Changes]
35
+ end
36
+
37
+ subgraph "3๏ธโƒฃ TEMPLATE GENERATION"
38
+ CACHE_HIT{Cache Hit?}
39
+ CLAUDE[๐Ÿค– Claude AI Analysis<br/>Semantic Understanding]
40
+ TEMPLATE[Generate Mustache Template<br/>๐Ÿ“ AI-Optimized Structure]
41
+ STORE_CACHE[๐Ÿ’พ Store in Cache]
42
+ end
43
+
44
+ subgraph "4๏ธโƒฃ CLEANUP & OPTIMIZATION"
45
+ CLEANUP[๐Ÿงน Orphaned Template Cleanup<br/>Remove deleted/hidden pages]
46
+ HTML_CLEAN[๐Ÿ”ง HTML-to-Markdown<br/>Clean Artifacts & Entities]
47
+ end
48
+
49
+ subgraph "5๏ธโƒฃ FILE GENERATION"
50
+ RENDER[Render Templates<br/>๐ŸŽจ Mustache + Data]
51
+ POST_PROCESS[Post-Process Markdown<br/>โœจ Final Quality Pass]
52
+ end
53
+ end
54
+
55
+ subgraph "OUTPUT FILES"
56
+ LLMS_TXT[๐Ÿ“„ llms.txt<br/>Navigation Index]
57
+ LLMS_FULL[๐Ÿ“„ llms-full.txt<br/>Complete Documentation]
58
+ MD_FILES[๐Ÿ“ Individual .md Files<br/>Per-Page Documentation]
59
+ end
60
+
61
+ subgraph "MULTI-SITE SUPPORT"
62
+ ENV1[๐ŸŒ Site 1<br/>SITE_ENV=main]
63
+ ENV2[๐ŸŒ Site 2<br/>SITE_ENV=partner]
64
+ ENV3[๐ŸŒ Site 3<br/>SITE_ENV=staging]
65
+
66
+ CACHE1[๐Ÿ’พ .llms-templates/main/]
67
+ CACHE2[๐Ÿ’พ .llms-templates/partner/]
68
+ CACHE3[๐Ÿ’พ .llms-templates/staging/]
69
+
70
+ OUT1[๐Ÿ“‚ .output/llms/main/]
71
+ OUT2[๐Ÿ“‚ .output/llms/partner/]
72
+ OUT3[๐Ÿ“‚ .output/llms/staging/]
73
+ end
74
+
75
+ %% Flow connections
76
+ JSON --> START
77
+ CONFIG --> START
78
+ API_KEY --> START
79
+
80
+ START --> LOAD
81
+ LOAD --> VALIDATE
82
+ VALIDATE --> CACHE_CHECK
83
+
84
+ CACHE_CHECK --> FILTER
85
+ FILTER --> EXTRACT
86
+ EXTRACT --> HASH
87
+
88
+ HASH --> CACHE_HIT
89
+ CACHE_HIT -->|โŒ No| CLAUDE
90
+ CACHE_HIT -->|โœ… Yes| CLEANUP
91
+
92
+ CLAUDE --> TEMPLATE
93
+ TEMPLATE --> STORE_CACHE
94
+ STORE_CACHE --> CLEANUP
95
+
96
+ CLEANUP --> HTML_CLEAN
97
+ HTML_CLEAN --> RENDER
98
+ RENDER --> POST_PROCESS
99
+
100
+ POST_PROCESS --> LLMS_TXT
101
+ POST_PROCESS --> LLMS_FULL
102
+ POST_PROCESS --> MD_FILES
103
+
104
+ %% Multi-site flows
105
+ CONFIG -.-> ENV1
106
+ CONFIG -.-> ENV2
107
+ CONFIG -.-> ENV3
108
+
109
+ ENV1 -.-> CACHE1
110
+ ENV2 -.-> CACHE2
111
+ ENV3 -.-> CACHE3
112
+
113
+ CACHE1 -.-> OUT1
114
+ CACHE2 -.-> OUT2
115
+ CACHE3 -.-> OUT3
116
+
117
+ %% Styling
118
+ classDef input fill:#e1f5fe
119
+ classDef process fill:#f3e5f5
120
+ classDef output fill:#e8f5e8
121
+ classDef multisite fill:#fff3e0
122
+
123
+ class JSON,CONFIG,API_KEY input
124
+ class LLMS_TXT,LLMS_FULL,MD_FILES output
125
+ class ENV1,ENV2,ENV3,CACHE1,CACHE2,CACHE3,OUT1,OUT2,OUT3 multisite
126
+ ```
127
+
128
+ ### ๐ŸŽฏ **Key Process Details**
129
+
130
+ | Phase | What Happens | Why It Matters |
131
+ |--------------------------|----------------------------------------------------------------------------------|--------------------------------------------------------------------------------|
132
+ | **๐Ÿ” Content Analysis** | Filters visible pages, extracts content via JSONPath, generates structure hashes | Only processes public pages, detects actual changes (not just content updates) |
133
+ | **๐Ÿค– AI Generation** | Claude analyzes page structure and generates semantic Mustache templates | Creates context-aware templates that understand your business domain |
134
+ | **๐Ÿ’พ Smart Caching** | Stores templates with structure hashes, reuses unchanged templates | Saves API costs and generation time on subsequent builds |
135
+ | **๐Ÿงน Automatic Cleanup** | Removes templates for deleted/hidden pages, syncs with current content | Prevents cache bloat and maintains accuracy |
136
+ | **๐Ÿ”ง Post-Processing** | Converts HTML to clean markdown, removes artifacts and entities | Ensures AI-optimized output that follows 2024 LLMS.txt standards |
137
+
138
+ ### ๐Ÿข **Multi-Site Architecture**
139
+
140
+ The system automatically adapts to different environments using the `SITE_ENV` variable:
141
+
142
+ ```bash
143
+ SITE_ENV=main โ†’ UmbracoData-main.json โ†’ .llms-templates/main/ โ†’ .output/llms/main/
144
+ SITE_ENV=partner โ†’ UmbracoData-partner.json โ†’ .llms-templates/partner/ โ†’ .output/llms/partner/
145
+ SITE_ENV=staging โ†’ UmbracoData-staging.json โ†’ .llms-templates/staging/ โ†’ .output/llms/staging/
146
+ ```
147
+
148
+ Each environment maintains its own isolated cache and output, preventing conflicts while sharing the same codebase and configuration logic.
149
+
150
+ ---
151
+
152
+ ## ๐ŸŒŸ Features
153
+
154
+ ### ๐Ÿค– **AI-Powered Template Generation**
155
+ - **Claude API Integration**: Uses Anthropic's Claude for intelligent content analysis
156
+ - **2024 LLMS.txt Compliance**: Follows the latest LLMS.txt standard for AI consumption
157
+ - **Semantic Understanding**: Automatically detects content types and generates appropriate templates
158
+ - **Multi-language Support**: Handles Hebrew/English mixed content and RTL text
159
+
160
+ ### โšก **Smart Caching System**
161
+ - **Structure-Based Detection**: Only regenerates when page structure changes (not content values)
162
+ - **Incremental Updates**: Process only changed pages for faster builds
163
+ - **API Cost Optimization**: Avoids unnecessary Claude API calls
164
+ - **Git-Friendly**: Templates stored in git, outputs excluded
165
+
166
+ ### ๐Ÿงน **Automatic Cleanup**
167
+ - **Orphaned Template Detection**: Removes templates for deleted pages
168
+ - **Hidden Page Handling**: Cleans up templates for pages marked as hidden
169
+ - **Cache Synchronization**: Keeps template cache aligned with Umbraco content
170
+
171
+ ### ๐Ÿ“„ **Multiple Output Formats**
172
+ 1. **`llms.txt`** - Navigation index following 2024 standard
173
+ 2. **`llms-full.txt`** - Complete site documentation in one file
174
+ 3. **Individual `.md` files** - Clean, AI-optimized markdown per page
175
+
176
+ ### ๐ŸŽฏ **Production Ready**
177
+ - **26 Passing Tests**: Comprehensive test coverage
178
+ - **TypeScript Support**: Full type safety throughout
179
+ - **Parallel Processing**: Configurable concurrency for large sites
180
+ - **Error Resilience**: Graceful handling of failures with detailed logging
181
+
182
+ ---
183
+
184
+ ## ๐Ÿš€ Quick Start
185
+
186
+ ### Installation
187
+
188
+ ```bash
189
+ npm install nuxt-llms-generator
190
+ # or
191
+ yarn add nuxt-llms-generator
192
+ # or
193
+ pnpm add nuxt-llms-generator
194
+ ```
195
+
196
+ ### Basic Configuration
197
+
198
+ ```typescript
199
+ // nuxt.config.ts
200
+ export default defineNuxtConfig({
201
+ modules: ['nuxt-llms-generator'],
202
+ llmsGenerator: {
203
+ anthropicApiKey: process.env.ANTHROPIC_API_KEY,
204
+ umbracoDataPath: './public/UmbracoData.json',
205
+ finalOutputDir: './.output/llms'
206
+ }
207
+ })
208
+ ```
209
+
210
+ ### Environment Variables
211
+
212
+ ```bash
213
+ # .env
214
+ ANTHROPIC_API_KEY=sk-ant-api03-your-key-here
215
+ ```
216
+
217
+ ### Generate Documentation
218
+
219
+ ```bash
220
+ npm run build
221
+ # Documentation generated automatically during build process
222
+ ```
223
+
224
+ ---
225
+
226
+ ## โš™๏ธ Configuration Options
227
+
228
+ ### Core Settings
229
+
230
+ | Option | Type | Required | Default | Description |
231
+ |----------------------|----------|----------|------------------|--------------------------------------------|
232
+ | `anthropicApiKey` | `string` | โœ… | - | Your Claude API key from Anthropic |
233
+ | `umbracoDataPath` | `string` | โœ… | - | Path to your UmbracoData.json file |
234
+ | `templatesDir` | `string` | โŒ | `./.llms-templates` | Directory for templates and cache files |
235
+ | `finalOutputDir` | `string` | โŒ | `./.output/llms` | Output directory for final documentation |
236
+
237
+ ### Generation Options
238
+
239
+ | Option | Type | Default | Description |
240
+ |------------------------|-----------|------------------------------|------------------------------------------|
241
+ | `enableIndividualMd` | `boolean` | `true` | Generate individual .md files per page |
242
+ | `enableLLMSFullTxt` | `boolean` | `true` | Generate combined llms-full.txt file |
243
+ | `enableHtmlToMarkdown` | `boolean` | `true` | Convert HTML content to markdown using [node-html-markdown](https://www.npmjs.com/package/node-html-markdown) |
244
+ | `maxConcurrent` | `number` | `5` | Maximum concurrent API requests |
245
+ | `maxTokens` | `number` | `65000` | Maximum tokens for page content before truncation (Claude context limit protection) |
246
+ | `anthropicModel` | `string` | `claude-3-5-sonnet-20241022` | Claude model to use |
247
+
248
+ ### Cleanup Options
249
+
250
+ | Option | Type | Default | Description |
251
+ |---------------------|-----------|---------|----------------------------------------|
252
+ | `enableAutoCleanup` | `boolean` | `true` | Automatically clean orphaned templates |
253
+ | `cleanupOrphaned` | `boolean` | `true` | Remove templates for deleted pages |
254
+ | `cleanupHidden` | `boolean` | `true` | Remove templates for hidden pages |
255
+
256
+ ---
257
+
258
+ ## ๐Ÿข Multi-Site Implementation
259
+
260
+ Perfect for projects where one codebase generates multiple websites based on environment variables.
261
+
262
+ ### Environment-Based Configuration
263
+
264
+ ```typescript
265
+ // nuxt.config.ts
266
+ const siteEnv = process.env.SITE_ENV || 'main' // 'main', 'staging', 'partner', etc.
267
+
268
+ export default defineNuxtConfig({
269
+ modules: ['nuxt-llms-generator'],
270
+ llmsGenerator: {
271
+ anthropicApiKey: process.env.ANTHROPIC_API_KEY,
272
+
273
+ // Environment-specific paths
274
+ umbracoDataPath: `./public/UmbracoData-${siteEnv}.json`,
275
+ templatesDir: `./.llms-templates/${siteEnv}`,
276
+ finalOutputDir: `./.output/llms/${siteEnv}`,
277
+
278
+ // Shared settings
279
+ maxConcurrent: 5,
280
+ enableAutoCleanup: true
281
+ }
282
+ })
283
+ ```
284
+
285
+ ### Build Commands
286
+
287
+ ```json
288
+ // package.json
289
+ {
290
+ "scripts": {
291
+ "build:main": "SITE_ENV=main nuxt build",
292
+ "build:partner": "SITE_ENV=partner nuxt build",
293
+ "build:staging": "SITE_ENV=staging nuxt build"
294
+ }
295
+ }
296
+ ```
297
+
298
+ ### Directory Structure
299
+
300
+ ```
301
+ project/
302
+ โ”œโ”€โ”€ .llms-templates/
303
+ โ”‚ โ”œโ”€โ”€ main/ # Main site templates & cache
304
+ โ”‚ โ”œโ”€โ”€ partner/ # Partner site templates & cache
305
+ โ”‚ โ””โ”€โ”€ staging/ # Staging site templates & cache
306
+ โ”œโ”€โ”€ .output/
307
+ โ”‚ โ””โ”€โ”€ llms/
308
+ โ”‚ โ”œโ”€โ”€ main/ # Main site docs
309
+ โ”‚ โ”œโ”€โ”€ partner/ # Partner site docs
310
+ โ”‚ โ””โ”€โ”€ staging/ # Staging site docs
311
+ โ”œโ”€โ”€ public/
312
+ โ”‚ โ”œโ”€โ”€ UmbracoData-main.json
313
+ โ”‚ โ”œโ”€โ”€ UmbracoData-partner.json
314
+ โ”‚ โ””โ”€โ”€ UmbracoData-staging.json
315
+ โ””โ”€โ”€ templates/
316
+ โ”œโ”€โ”€ main/ # Main site templates
317
+ โ”œโ”€โ”€ partner/ # Partner site templates
318
+ โ””โ”€โ”€ staging/ # Staging site templates
319
+ ```
320
+
321
+ ---
322
+
323
+ ## ๐Ÿ“Š Generated Output Examples
324
+
325
+ ### `llms.txt` (Navigation Index)
326
+ ```markdown
327
+ # Business Communication Solutions | Voicenter
328
+
329
+ > Thousands of organizations in Israel manage their business communications through our advanced cloud platform
330
+
331
+ This website contains comprehensive information about business communication solutions. The content is organized into the following sections:
332
+
333
+ ## Services
334
+
335
+ - [Call Center Solutions](call-center-solutions.md): Complete call center management tools
336
+ - [Smart PBX for Business](smart-pbx-business.md): Advanced business telephony services
337
+ - [Mobile Solutions](mobile-solutions.md): Unlimited mobile communication solutions
338
+
339
+ ## Technical
340
+
341
+ - [API Integration](api-integration.md): Developer tools and API documentation
342
+ - [CRM Connectivity](crm-connectivity.md): Full CRM integration capabilities
343
+
344
+ ## Optional
345
+
346
+ - [Complete Documentation](llms-full.txt): All content combined in a single file
347
+ ```
348
+
349
+ ### Individual `.md` Files
350
+ ```markdown
351
+ # Call Center Solutions
352
+
353
+ > Complete call center management tools for modern businesses
354
+
355
+ ## Overview
356
+
357
+ Our call center solutions provide comprehensive tools for managing customer communications efficiently. Built on advanced cloud technology, these tools enable seamless implementation and superior organizational management.
358
+
359
+ ## Key Features
360
+
361
+ - **Advanced Queue Management**: Intelligent call routing and distribution
362
+ - **Automated Callbacks**: Smart callback scheduling system
363
+ - **CRM Integration**: Seamless connection with existing CRM systems
364
+ - **Real-time Analytics**: Live monitoring and performance dashboards
365
+ - **Multi-channel Support**: Handle calls, emails, and chat in one platform
366
+
367
+ ## Benefits
368
+
369
+ - Reduced customer wait times
370
+ - Increased agent productivity
371
+ - Better customer satisfaction scores
372
+ - Scalable solution that grows with your business
373
+
374
+ *Generated with Claude AI | Last updated: 2024-01-16*
375
+ ```
376
+
377
+ ---
378
+
379
+ ## ๐Ÿ”ง Advanced Usage
380
+
381
+ ### Custom Build Script
382
+
383
+ ```javascript
384
+ // scripts/generate-docs.js
385
+ import { LLMSFilesGenerator } from 'nuxt-llms-generator'
386
+
387
+ const config = {
388
+ anthropicApiKey: process.env.ANTHROPIC_API_KEY,
389
+ umbracoDataPath: './public/UmbracoData.json',
390
+ finalOutputDir: './docs/ai-generated'
391
+ }
392
+
393
+ const generator = new LLMSFilesGenerator(config)
394
+
395
+ try {
396
+ const files = await generator.generateAllFiles()
397
+ console.log(`โœ… Generated ${files.individualMdFiles?.length || 0} markdown files`)
398
+ console.log('๐Ÿ“ LLMS documentation generation complete!')
399
+ } catch (error) {
400
+ console.error('โŒ Generation failed:', error)
401
+ process.exit(1)
402
+ }
403
+ ```
404
+
405
+ ### Development vs Production
406
+
407
+ ```typescript
408
+ // nuxt.config.ts
409
+ const isDev = process.env.NODE_ENV === 'development'
410
+
411
+ export default defineNuxtConfig({
412
+ llmsGenerator: {
413
+ anthropicApiKey: process.env.ANTHROPIC_API_KEY,
414
+ umbracoDataPath: './public/UmbracoData.json',
415
+
416
+ // Generate fewer files during development
417
+ enableIndividualMd: !isDev,
418
+ enableLLMSFullTxt: !isDev,
419
+
420
+ // Lower concurrency in development
421
+ maxConcurrent: isDev ? 2 : 8
422
+ }
423
+ })
424
+ ```
425
+
426
+ ### CI/CD Integration
427
+
428
+ ```yaml
429
+ # .github/workflows/build.yml
430
+ name: Generate Documentation
431
+ on:
432
+ push:
433
+ branches: [main]
434
+
435
+ jobs:
436
+ docs:
437
+ runs-on: ubuntu-latest
438
+ steps:
439
+ - uses: actions/checkout@v3
440
+ - uses: actions/setup-node@v3
441
+ with:
442
+ node-version: 18
443
+ - run: npm ci
444
+ - run: npm run build
445
+ env:
446
+ ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
447
+ - name: Deploy docs
448
+ run: cp -r .output/llms/* ./public/docs/
449
+ ```
450
+
451
+ ---
452
+
453
+ ## ๐Ÿงช Testing
454
+
455
+ Run the comprehensive test suite:
456
+
457
+ ```bash
458
+ npm test
459
+ # or
460
+ npm run test:watch # Watch mode
461
+ ```
462
+
463
+ ### Test Coverage
464
+
465
+ - โœ… Template generation and caching
466
+ - โœ… HTML-to-markdown conversion
467
+ - โœ… Multi-language content handling
468
+ - โœ… Page visibility filtering
469
+ - โœ… Orphaned template cleanup
470
+ - โœ… Configuration validation
471
+ - โœ… Error handling and resilience
472
+
473
+ ---
474
+
475
+ ## ๐Ÿ› Troubleshooting
476
+
477
+ ### Common Issues
478
+
479
+ **โŒ "Claude API key not found"**
480
+ ```bash
481
+ # Make sure your API key is set
482
+ echo $ANTHROPIC_API_KEY
483
+ # Should show: sk-ant-api03-...
484
+ ```
485
+
486
+ **โŒ "UmbracoData.json not found"**
487
+ ```bash
488
+ # Check the file exists
489
+ ls -la public/UmbracoData.json
490
+ # Verify path in nuxt.config.ts matches
491
+ ```
492
+
493
+ **โŒ "Template generation failed"**
494
+ - Check Claude API quota and rate limits
495
+ - Verify UmbracoData.json has valid structure
496
+ - Enable debug logging: `DEBUG=llms:* npm run build`
497
+
498
+ ### Performance Tips
499
+
500
+ 1. **Large Sites (1000+ pages)**:
501
+ ```typescript
502
+ {
503
+ maxConcurrent: 8, // Higher concurrency
504
+ maxTokens: 80000, // More content per page (if using larger models)
505
+ enableAutoCleanup: true, // Keep cache clean
506
+ }
507
+ ```
508
+
509
+ 2. **Development Speed**:
510
+ ```typescript
511
+ {
512
+ enableIndividualMd: false, // Skip individual files
513
+ maxConcurrent: 2, // Lower API usage
514
+ maxTokens: 50000, // Smaller context for faster processing
515
+ }
516
+ ```
517
+
518
+ 3. **Production Optimization**:
519
+ ```typescript
520
+ {
521
+ enableAutoCleanup: true,
522
+ cleanupOrphaned: true,
523
+ cleanupHidden: true,
524
+ maxTokens: 65000, // Balance between detail and API limits
525
+ enableHtmlToMarkdown: true // Clean HTML from CMS content
526
+ }
527
+ ```
528
+
529
+ 4. **HTML Content Processing**:
530
+ ```typescript
531
+ {
532
+ enableHtmlToMarkdown: true, // Convert <p>, <h1>, etc. to clean markdown
533
+ enableHtmlToMarkdown: false // Keep HTML as-is (if AI already generates clean content)
534
+ }
535
+ ```
536
+
537
+ ---
538
+
539
+ ## ๐Ÿ“š API Reference
540
+
541
+ ### LLMSFilesGenerator
542
+
543
+ ```typescript
544
+ import { LLMSFilesGenerator } from 'nuxt-llms-generator'
545
+
546
+ const generator = new LLMSFilesGenerator({
547
+ anthropicApiKey: 'your-api-key',
548
+ umbracoDataPath: './data.json',
549
+ finalOutputDir: './output'
550
+ })
551
+
552
+ // Generate all documentation files
553
+ const files = await generator.generateAllFiles()
554
+
555
+ // Test Claude API connection
556
+ const isConnected = await generator.testConnection()
557
+
558
+ // Clear template cache
559
+ generator.clearCache()
560
+
561
+ // Get generation statistics
562
+ const stats = generator.getStats()
563
+ ```
564
+
565
+ ### Configuration Interface
566
+
567
+ ```typescript
568
+ interface LLMSConfig {
569
+ // Required
570
+ anthropicApiKey: string;
571
+ umbracoDataPath: string;
572
+
573
+ // Optional with defaults
574
+ templatesDir?: string; // './.llms-templates'
575
+ finalOutputDir?: string; // './.output/llms'
576
+ anthropicModel?: string; // 'claude-3-5-sonnet-20241022'
577
+ maxTokens?: number; // 65000
578
+ maxConcurrent?: number; // 5
579
+ enableLLMSFullTxt?: boolean; // true
580
+ enableIndividualMd?: boolean; // true
581
+ enableHtmlToMarkdown?: boolean; // true
582
+ enableAutoCleanup?: boolean; // true
583
+ cleanupOrphaned?: boolean; // true
584
+ cleanupHidden?: boolean; // true
585
+ }
586
+ ```
587
+
588
+ ---
589
+
590
+ ## ๐Ÿค Contributing
591
+
592
+ We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.
593
+
594
+ ### Development Setup
595
+
596
+ ```bash
597
+ git clone https://github.com/your-org/nuxt-llms-generator.git
598
+ cd nuxt-llms-generator
599
+ npm install
600
+ npm run dev
601
+ ```
602
+
603
+ ### Running Tests
604
+
605
+ ```bash
606
+ npm test # Run all tests
607
+ npm run test:watch # Watch mode
608
+ npm run test:coverage # Coverage report
609
+ ```
610
+
611
+ ---
612
+
613
+ ## ๐Ÿ“„ License
614
+
615
+ MIT License - see [LICENSE](LICENSE) file for details.
616
+
617
+ ---
618
+
619
+ ## ๐Ÿ™ Acknowledgments
620
+
621
+ - [Anthropic](https://anthropic.com) for Claude AI API
622
+ - [Jeremy Howard](https://github.com/jph00) for the 2024 LLMS.txt standard
623
+ - [Nuxt 3](https://nuxt.com) for the amazing framework
624
+ - The open-source community for inspiration and feedback
625
+
626
+ ---
627
+
628
+ **Made with โค๏ธ for the AI-first web**
629
+
630
+ Transform your CMS content into AI-optimized documentation that helps AI systems understand your business better.