@voicenter-team/nuxt-llms-generator 0.1.6 → 0.1.7

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.
@@ -49,121 +49,133 @@ class AnthropicClient {
49
49
  throw new Error("Failed to generate template");
50
50
  }
51
51
  buildPrompt(request) {
52
- return `You are an expert creating Mustache.js templates for **Voicenter - Leading Cloud Communications Platform**, converting Umbraco CMS content into LLMS.txt-optimized markdown.
52
+ return `# llms\u2011aware Mustache Template Generator Prompt (Key\u2011Agnostic)
53
53
 
54
- **BUSINESS CONTEXT**: Voicenter provides enterprise cloud telephony solutions including Contact Centers, Business Phone Services, Mobile Communications, API integrations, and AI-powered voice tools for 50,000+ users globally.
54
+ You are an expert in crafting **Mustache.js templates** whose output is **clean Markdown pages** (with \`.md\` extension) intended for **LLM-friendly ingestion** following the [\`llms.txt\`](https://llmstxt.org/) standard.
55
+
56
+ ---
57
+
58
+ ## \u{1F3AF} Purpose & Goal
59
+
60
+ The \`.md\` files generated from these templates represent the **structured, machine-readable versions of website pages**.
61
+ They are designed to be indexed and understood by **Large Language Models** through the \`llms.txt\` manifest.
62
+ Each \`.md\` file provides semantic, human-readable, and hierarchically organized content for LLMs to learn from.
63
+
64
+ Your task: Given an arbitrary JSON page structure (potentially deeply nested, dynamic, and unpredictable), produce a **generic Mustache template** that renders this JSON into an \`.md\` file conforming to \`llms.txt\` principles \u2014 emphasizing clarity, structure, and interpretability.
65
+
66
+ These templates must be domain-agnostic: usable for **B2B SaaS**, **marketplaces**, **landing pages**, **blogs**, **docs**, or **personal websites**.
67
+
68
+ ---
69
+
70
+ ## \u{1F4E5} Context Supplied to You
55
71
 
56
- **CURRENT PAGE ANALYSIS:**
57
72
  - URL: ${request.url}
58
- - Template: ${request.templateAlias}
59
- - JSONPath: ${request.jpath}
73
+ - Template Alias: ${request.templateAlias}
74
+ - JSON Path: ${request.jpath}
60
75
 
61
- **AVAILABLE DATA PROPERTIES:**
76
+ ### Available Data
62
77
  \`\`\`json
63
78
  ${JSON.stringify(request.pageContent, null, 2)}
64
79
  \`\`\`
65
80
 
66
- **CRITICAL REQUIREMENTS (2024 LLMS.txt Standard):**
81
+ ---
67
82
 
68
- 1. **USE EXACT PROPERTY NAMES**:
69
- \u274C Wrong: {{pageTitle}}
70
- \u2705 Correct: {{pageTittle}} or {{pageDescription}} (match actual JSON keys)
83
+ ## \u{1F9E9} Core Principles (Key\u2011Agnostic)
71
84
 
72
- 2. **BUSINESS-FOCUSED CONTENT HIERARCHY**:
73
- - H1: Clear service/feature name
74
- - Blockquote: Value proposition
75
- - H2: Key capabilities/benefits
76
- - H3: Technical details/specs
77
- - Lists: Features, integrations, use cases
85
+ 1. **Do not assume fixed property names.**
86
+ Infer content type and importance dynamically from value structure, length, and position.
78
87
 
79
- 3. **VOICENTER-SPECIFIC CONTENT MAPPING**:
80
- - Service descriptions \u2192 Clear business benefits
81
- - Technical features \u2192 User-friendly explanations
82
- - Integration lists \u2192 Specific partner names
83
- - API documentation \u2192 Implementation clarity
84
- - Contact info \u2192 Business value context
88
+ 2. **Purpose\u2011Driven Hierarchy (LLMS.txt\u2011Friendly):**
89
+ - Start with the main concept (\`#\` heading)
90
+ - Follow with a one-paragraph value statement or summary (\`>\` blockquote)
91
+ - Then expand into structured content with \`##\`, \`###\`, and lists
85
92
 
86
- 4. **SMART CONTENT SELECTION**:
87
- - Prioritize business value over technical jargon
88
- - Include specific numbers/metrics when available
89
- - Map complex nested arrays to structured lists
90
- - Extract key differentiators and benefits
93
+ 3. **Semantic Markdown Only**
94
+ Use only Markdown syntax (\`#\`, \`>\`, \`-\`, \`[link](url)\`, \`![alt](img)\`).
95
+ **No HTML**, **no entities**, **no inline styles**, **no attributes**.
91
96
 
92
- **TEMPLATE PATTERNS FOR VOICENTER CONTENT:**
97
+ 4. **Dynamic Interpretation**
98
+ - Short textual fields near the root likely represent titles.
99
+ - Long text blocks indicate overviews, descriptions, or stories.
100
+ - Arrays of primitives \u2192 bullet lists.
101
+ - Arrays of objects \u2192 repeated sub-sections or tables.
102
+ - Objects \u2192 nested sections with humanized headings.
93
103
 
94
- **Service Pages Pattern:**
95
- \`\`\`mustache
96
- # {{serviceName}}
104
+ 5. **Exact Property Bindings**
105
+ When referencing values, always use the **exact property name** from JSON (\`{{keyName}}\`).
106
+ Do not rename or modify binding identifiers.
97
107
 
98
- {{#serviceSubtitle}}
99
- > {{serviceSubtitle}}
100
- {{/serviceSubtitle}}
108
+ 6. **Humanized Section Titles**
109
+ Convert keys into readable Markdown headings:
110
+ e.g., \`productDetails\` \u2192 \u201CProduct Details\u201D, \`seo_meta\` \u2192 \u201CSEO Meta\u201D.
111
+ These headings are for readability; the Mustache bindings remain exact.
101
112
 
102
- {{#serviceDescription}}
103
- ## Overview
104
- {{serviceDescription}}
105
- {{/serviceDescription}}
113
+ 7. **Omit Noise**
114
+ Exclude non-content fields like IDs, timestamps, internal flags, etc.
106
115
 
107
- {{#serviceTools.0}}
108
- ## Key Features
109
- {{#serviceTools}}
110
- - {{textItem}}
111
- {{/serviceTools}}
112
- {{/serviceTools.0}}
116
+ 8. **URL Handling**
117
+ - If a value looks like a URL, render \`[Label]({{key}})\`.
118
+ - If image URL, render \`![Alt text]({{key}})\`.
113
119
 
114
- {{#serviceLink}}
115
- ## Learn More
116
- [Explore {{serviceName}} \u2192]({{serviceLink}})
117
- {{/serviceLink}}
118
- \`\`\`
120
+ 9. **Recursion & Nesting**
121
+ Apply the same logic recursively to all nested objects and arrays.
122
+ Heading depth corresponds to the nesting level, but avoid exceeding four \`#\` levels.
119
123
 
120
- **Feature/API Pages Pattern:**
121
- \`\`\`mustache
122
- # {{cardTitle}}
124
+ ---
123
125
 
124
- {{#cardText}}
125
- > {{cardText}}
126
- {{/cardText}}
126
+ ## \u{1F9E0} LLMS.txt Relevance
127
127
 
128
- {{#featureDescription}}
129
- ## How It Works
130
- {{featureDescription}}
131
- {{/featureDescription}}
128
+ The resulting \`.md\` output should be suitable for inclusion in or referencing from \`llms.txt\`.
129
+ Each file acts as an **LLM-ingestible mirror** of the website content \u2014 optimized for understanding by AI systems.
130
+ Focus on **semantic clarity**, **hierarchical consistency**, and **contextual richness**.
131
+ This ensures that LLMs reading the \`.md\` files will correctly infer what each page is about.
132
132
 
133
- {{#capabilities.0}}
134
- ## Capabilities
135
- {{#capabilities}}
136
- ### {{name}}
137
- {{description}}
133
+ ---
138
134
 
139
- {{/capabilities}}
140
- {{/capabilities.0}}
135
+ ## \u{1F9F1} Example Structural Patterns
141
136
 
142
- ## Business Benefits
143
- - Reduces operational costs
144
- - Improves customer experience
145
- - Seamless integration with existing systems
137
+ ### Generic Page Template
138
+ \`\`\`mustache
139
+ # {{mainTitle}}
140
+
141
+ {{#summary}}
142
+ > {{summary}}
143
+ {{/summary}}
144
+
145
+ {{#sections.0}}
146
+ ## {{sectionTitle}}
147
+ {{#sections}}
148
+ ### {{itemTitle}}
149
+ {{itemDescription}}
150
+ {{/sections}}
151
+ {{/sections.0}}
152
+
153
+ {{#links.0}}
154
+ ## Links
155
+ {{#links}}
156
+ - [{{label}}]({{url}})
157
+ {{/links}}
158
+ {{/links.0}}
146
159
  \`\`\`
147
160
 
148
- **CONTENT EXTRACTION RULES:**
149
- 1. **Identify primary content** from JSON structure
150
- 2. **Map nested arrays** to organized sections
151
- 3. **Extract business value** from technical descriptions
152
- 4. **Include contact/action items** for lead generation
153
- 5. **Maintain SEO-friendly** heading structure
161
+ > Example only \u2014 the actual template must reflect the JSON shape dynamically.
162
+
163
+ ---
154
164
 
155
- **OUTPUT REQUIREMENTS:**
156
- - Return ONLY the Mustache template
157
- - NO explanations or code blocks
158
- - Use actual property names from the provided JSON
159
- - Focus on business value for AI consumption
160
- - Follow LLMS.txt hierarchical structure
161
- - **CLEAN MARKDOWN ONLY**: No HTML tags, entities, or attributes
162
- - **NO HTML**: Use pure Markdown syntax (##, **, -, etc.)
163
- - **NO ENTITIES**: Use actual characters, not & or /
164
- - **NO ATTRIBUTES**: No dir="RTL", style="", class="" etc.
165
+ ## \u2705 Output Requirements
165
166
 
166
- Generate the optimized Mustache template:`;
167
+ - Output **only** the Mustache template (no extra text, no code fences).
168
+ - Use **exact JSON property names** in bindings.
169
+ - Render **clean, human-readable Markdown** suitable for \`llms.txt\`.
170
+ - Maintain logical hierarchy derived from JSON structure.
171
+ - Avoid domain-specific or brand-specific logic.
172
+
173
+ ---
174
+
175
+ ## \u{1F680} Task
176
+
177
+ Analyze the provided JSON and **generate the Mustache template** that will produce the \`.md\` page following these rules.
178
+ `;
167
179
  }
168
180
  parseResponse(responseText) {
169
181
  const codeBlockRegex = /```(?:mustache)?\n?([\s\S]*?)```/;
package/dist/module.json CHANGED
@@ -4,5 +4,5 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^3.0.0"
6
6
  },
7
- "version": "0.1.6"
7
+ "version": "0.1.7"
8
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voicenter-team/nuxt-llms-generator",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "Nuxt 3 module for automatically generating AI-optimized documentation files (llms.txt, llms-full.txt, and individual .md files) from Umbraco CMS data using Anthropic's Claude API.",
5
5
  "repository": "https://github.com/VoicenterTeam/nuxt-llms-generator",
6
6
  "license": "MIT",