一键导入
lvt-validate-templates
Validate LiveTemplate template files - check syntax, parse errors, execution issues, and common problems
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Validate LiveTemplate template files - check syntax, parse errors, execution issues, and common problems
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when deploying LiveTemplate applications to production - covers Docker containerization, Fly.io deployment, Kubernetes setup, database persistence, and production best practices
Transform app to production-ready - adds authentication, deployment config, environment setup, and best practices
Use when deploying LiveTemplate applications to production - covers Docker containerization, Fly.io deployment, Kubernetes setup, database persistence, and production best practices
Rapid end-to-end workflow - creates app, adds resources, sets up development environment in one flow
Generate test apps, capture screenshots, analyze UI for issues, and recursively fix problems in kit templates
Use when adding database migrations to LiveTemplate apps - guides both auto-generated migrations (from lvt gen resource) and custom migrations (indexes, constraints, data transformations)
| name | lvt-validate-templates |
| description | Validate LiveTemplate template files - check syntax, parse errors, execution issues, and common problems |
| category | core |
| version | 1.0.0 |
| keywords | ["lvt","livetemplate","lt"] |
Validates LiveTemplate template files (*.tmpl) for syntax errors, parsing issues, execution problems, and common mistakes. Uses both html/template and LiveTemplate parsers to ensure templates work correctly.
This skill typically runs in existing LiveTemplate projects (.lvtrc exists).
✅ Context Established By:
.lvtrc exists (most common scenario)lvt-assistant agentKeyword matching (case-insensitive): lvt, livetemplate, lt
With Context: ✅ Generic prompts related to this skill's purpose
Without Context (needs keywords): ✅ Must mention "lvt", "livetemplate", or "lt" ❌ Generic requests without keywords
When to use:
Examples:
# Validate a template file
lvt parse <template-file>
# Examples
lvt parse app/posts/posts.tmpl
lvt parse app/home/home.tmpl
lvt parse custom/template.tmpl
1. html/template parsing:
2. LiveTemplate parsing:
3. Template execution:
4. Common issues:
Successful validation:
Parsing template: app/posts/posts.tmpl
Template name: posts
============================================================
1. Testing html/template parsing...
✅ Successfully parsed with html/template
2. Defined templates:
- posts
- posts_table
- posts_form
3. Testing LiveTemplate parsing...
✅ Successfully parsed with LiveTemplate
4. Testing template execution...
✅ Successfully executed (generated 2847 bytes of HTML)
5. Checking for common issues...
✅ No issues found
============================================================
✅ Template is valid!
Failed validation:
Parsing template: app/broken/broken.tmpl
Template name: broken
============================================================
1. Testing html/template parsing...
❌ Parse error: template: broken:15: unexpected "}" in operand
============================================================
❌ Template validation failed
lvt parse <template-file>Example: {{range .Items (missing }})
Fix: Close all template actions properly
Example: {{UnknownFunction}}
Fix: Use built-in functions or kit helpers
Example: {{range .Items}} without {{end}}
Fix: Add matching {{end}} tag
Example: {{.Count | add "text"}}
Fix: Ensure function arguments match expected types
Example: {{.NonExistentField}}
Warning: Field might not exist in data structure
Valid actions:
<!-- Variables -->
{{.FieldName}}
{{$var := .Value}}
<!-- Conditionals -->
{{if .Show}}...{{end}}
{{if .Show}}...{{else}}...{{end}}
<!-- Loops -->
{{range .Items}}
{{.Name}}
{{end}}
<!-- With (context) -->
{{with .User}}
{{.Name}}
{{end}}
<!-- Template inclusion -->
{{template "component" .}}
<!-- Functions/Pipes -->
{{.Title | uppercase}}
{{add .Count 1}}