@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.
- package/dist/chunks/llms-files-generator.mjs +99 -87
- package/dist/module.json +1 -1
- package/package.json +1 -1
|
@@ -49,121 +49,133 @@ class AnthropicClient {
|
|
|
49
49
|
throw new Error("Failed to generate template");
|
|
50
50
|
}
|
|
51
51
|
buildPrompt(request) {
|
|
52
|
-
return
|
|
52
|
+
return `# llms\u2011aware Mustache Template Generator Prompt (Key\u2011Agnostic)
|
|
53
53
|
|
|
54
|
-
|
|
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
|
-
-
|
|
73
|
+
- Template Alias: ${request.templateAlias}
|
|
74
|
+
- JSON Path: ${request.jpath}
|
|
60
75
|
|
|
61
|
-
|
|
76
|
+
### Available Data
|
|
62
77
|
\`\`\`json
|
|
63
78
|
${JSON.stringify(request.pageContent, null, 2)}
|
|
64
79
|
\`\`\`
|
|
65
80
|
|
|
66
|
-
|
|
81
|
+
---
|
|
67
82
|
|
|
68
|
-
|
|
69
|
-
\u274C Wrong: {{pageTitle}}
|
|
70
|
-
\u2705 Correct: {{pageTittle}} or {{pageDescription}} (match actual JSON keys)
|
|
83
|
+
## \u{1F9E9} Core Principles (Key\u2011Agnostic)
|
|
71
84
|
|
|
72
|
-
|
|
73
|
-
|
|
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
|
-
|
|
80
|
-
-
|
|
81
|
-
-
|
|
82
|
-
-
|
|
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
|
-
|
|
87
|
-
|
|
88
|
-
|
|
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)\`, \`\`).
|
|
95
|
+
**No HTML**, **no entities**, **no inline styles**, **no attributes**.
|
|
91
96
|
|
|
92
|
-
**
|
|
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
|
-
**
|
|
95
|
-
|
|
96
|
-
|
|
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
|
-
|
|
99
|
-
|
|
100
|
-
|
|
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
|
-
|
|
103
|
-
|
|
104
|
-
{{serviceDescription}}
|
|
105
|
-
{{/serviceDescription}}
|
|
113
|
+
7. **Omit Noise**
|
|
114
|
+
Exclude non-content fields like IDs, timestamps, internal flags, etc.
|
|
106
115
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
{{
|
|
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 \`\`.
|
|
113
119
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
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
|
-
|
|
121
|
-
\`\`\`mustache
|
|
122
|
-
# {{cardTitle}}
|
|
124
|
+
---
|
|
123
125
|
|
|
124
|
-
{
|
|
125
|
-
> {{cardText}}
|
|
126
|
-
{{/cardText}}
|
|
126
|
+
## \u{1F9E0} LLMS.txt Relevance
|
|
127
127
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
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
|
-
|
|
134
|
-
## Capabilities
|
|
135
|
-
{{#capabilities}}
|
|
136
|
-
### {{name}}
|
|
137
|
-
{{description}}
|
|
133
|
+
---
|
|
138
134
|
|
|
139
|
-
{
|
|
140
|
-
{{/capabilities.0}}
|
|
135
|
+
## \u{1F9F1} Example Structural Patterns
|
|
141
136
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
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
|
-
|
|
149
|
-
|
|
150
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voicenter-team/nuxt-llms-generator",
|
|
3
|
-
"version": "0.1.
|
|
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",
|