一键导入
lvt-add-view
Add a view-only handler to an existing LiveTemplate app without database integration - perfect for static pages, dashboards, and UI-only components
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Add a view-only handler to an existing LiveTemplate app without database integration - perfect for static pages, dashboards, and UI-only components
用 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-add-view |
| description | Add a view-only handler to an existing LiveTemplate app without database integration - perfect for static pages, dashboards, and UI-only components |
| category | core |
| version | 1.0.0 |
| keywords | ["lvt","livetemplate","lt"] |
Adds a view-only handler to an existing LiveTemplate application. Unlike resources, views don't interact with the database - they're pure UI components perfect for static pages, dashboards, landing pages, or any content that doesn't need CRUD operations.
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
This skill should activate when the user requests to add a view-only handler:
Explicit prompts:
Implicit prompts:
Examples:
Before executing this skill, verify:
In Project Directory:
.lvtrc file (confirms it's an lvt project)go.mod (confirms it's a Go project)app/ directoryDependencies Available:
lvt binary is installed and accessiblelvt newNot Already Exists:
app/[viewname]/Step 1: Verify we're in an lvt project directory
.lvtrc filego.mod fileapp/ directoryStep 2: Validate prerequisites
lvt command is availableStep 3: Extract view details from user request
Step 4: Normalize view name
Step 5: Check for naming conflicts
app/[viewname]/ already exists Step 6: Build and run the lvt gen view command
lvt gen view <name>lvt gen view dashboardStep 7: Verify view generation succeeded
app/<view>/<view>.go (handler)app/<view>/<view>.tmpl (template)app/<view>/<view>_test.go (test)cmd/<app>/main.go or main.go (route injected)app/home/home.tmpl (view registered on home page) Step 8: Run go mod tidy
Step 9: Verify app builds successfully
go build ./cmd/<app>go buildStep 10: Provide user with success summary
Help users understand when to use views vs resources:
Use Views For:
Use Resources For:
If view directory already exists:
If not in an lvt project:
.lvtrc fileIf view name is invalid:
If build fails after generation:
go mod tidy againAfter generating a view, guide users on common customizations:
Handler Customization (app/<view>/<view>.go):
Template Customization (app/<view>/<view>.tmpl):
Test Customization (app/<view>/<view>_test.go):
After successful view generation, provide:
✅ View '[name]' generated successfully!
📁 Files created:
- app/[view]/[view].go
- app/[view]/[view].tmpl
- app/[view]/[view]_test.go
📝 Files updated:
- cmd/[app]/main.go (route: /[view])
- app/home/home.tmpl (view link added)
✅ App builds successfully
🚀 Next steps:
1. Customize content: app/[view]/[view].tmpl
2. Add logic: app/[view]/[view].go
3. Start your app: lvt serve (or go run main.go)
4. Visit: http://localhost:8080/[view]
5. Run tests: go test ./app/[view]
Scenario 1: Dashboard page
Scenario 2: About page
Scenario 3: Landing page
Scenario 4: Custom UI component
View generation is successful if:
go build succeedsHandler() not Handler(queries)