name: lvt-suggest description: Suggest improvements and next steps based on app analysis - recommends features, optimizations, security enhancements category: maintenance version: 1.0.0 keywords: ["lvt", "livetemplate", "lt"]
lvt:suggest
Analyzes app structure and suggests actionable improvements. Provides prioritized recommendations for features, performance, security, and user experience.
๐ฏ ACTIVATION RULES
Context Detection
This skill typically runs in existing LiveTemplate projects (.lvtrc exists).
โ Context Established By:
- Project context -
.lvtrcexists (most common scenario) - Agent context - User is working with
lvt-assistantagent - Keyword context - User mentions "lvt", "livetemplate", or "lt"
Keyword matching (case-insensitive): lvt, livetemplate, lt
Trigger Patterns
With Context: โ Generic prompts related to this skill's purpose
Without Context (needs keywords): โ Must mention "lvt", "livetemplate", or "lt" โ Generic requests without keywords
User Prompts
When to use:
- "What should I add to my app?"
- "Suggest improvements for my application"
- "What's missing from my app?"
- "How can I make this better?"
- "What features should I add next?"
Examples:
- "Suggest improvements for my blog"
- "What should I add to make this production-ready?"
- "How can I improve performance?"
- "What security improvements do I need?"
How It Works
Step 1: Analyze Current State
Use lvt:resource-inspect to understand the app:
lvt resource list
lvt resource describe <table>
Gather context:
- What resources exist?
- What relationships are present?
- What features are implemented?
- What's the domain/purpose?
Step 2: Categorize Suggestions
Generate recommendations in these categories:
1. Missing Core Features (P0 - Critical)
Authentication:
โ ๏ธ No authentication system detected
โ Add user authentication to protect resources
โ Command: lvt gen auth
โ Impact: Security, user management, sessions
Essential Relationships:
โ ๏ธ posts table exists but no comments
โ Add comments to enable reader engagement
โ Command: lvt gen resource comments post_id:references:posts:CASCADE content author
โ Impact: User engagement, community building
2. Performance Optimizations (P1 - Important)
Missing Indexes:
โ ๏ธ No index on posts(created_at)
โ Add index for date-based queries
โ Command: lvt migration create add_posts_created_at_index
โ SQL: CREATE INDEX idx_posts_created_at ON posts(created_at);
โ Impact: Faster list/pagination queries
Query Optimization:
โ ๏ธ N+1 query potential in posts โ comments
โ Consider eager loading or denormalization
โ Impact: Reduced database roundtrips
3. Security Enhancements (P1 - Important)
CSRF Protection:
โ ๏ธ Forms lack CSRF protection
โ Add CSRF tokens to all forms
โ Already built-in with auth system
โ Impact: Prevent cross-site request forgery
Input Validation:
โ ๏ธ No field length limits
โ Add validation to prevent abuse
โ Add constraints in migrations
โ Impact: Data integrity, DoS prevention
4. UX Improvements (P2 - Nice to have)
Pagination:
๐ก Large lists without pagination
โ Add infinite scroll or page-based navigation
โ Already supported by LiveTemplate
โ Impact: Better performance, usability
Search:
๐ก No search functionality
โ Add search to help users find content
โ SQL: WHERE title LIKE ? OR content LIKE ?
โ Impact: Improved user experience
Sorting/Filtering:
๐ก No sort or filter controls
โ Add UI controls for sorting/filtering
โ Impact: Better content discovery
5. Data Management (P2 - Nice to have)
Soft Deletes:
๐ก Hard deletes with CASCADE
โ Consider soft deletes for audit trail
โ Add deleted_at:time field
โ Impact: Data recovery, audit compliance
Timestamps:
๐ก Missing updated_at fields
โ Add updated_at for change tracking
โ Impact: Better data lifecycle management
Step 3: Prioritize Recommendations
Priority matrix:
P0 (Critical - Do now):
- Security vulnerabilities
- Missing authentication (if handling user data)
- Broken relationships
- Data integrity issues
P1 (Important - Do soon):
- Performance bottlenecks
- Missing core features for domain
- UX pain points
- Production readiness gaps
P2 (Nice to have - Do later):
- Advanced features
- Polish and refinement
- Optional optimizations
Step 4: Generate Action Plan
Format suggestions as actionable steps:
## Recommendations for [App Name]
### Critical (Do Now)
1. **Add Authentication System**
- Why: Protect user data and enable personalization
- How: `lvt gen auth`
- Time: 10 minutes
- Impact: โญโญโญโญโญ
2. **Add Missing Foreign Keys**
- Why: Data integrity and relationships
- How: `lvt gen resource comments post_id:references:posts content`
- Time: 5 minutes
- Impact: โญโญโญโญ
### Important (Do Soon)
3. **Add Indexes for Performance**
- Why: Faster queries on large datasets
- How: Migration to add indexes
- Time: 5 minutes
- Impact: โญโญโญโญ
4. **Add Search Functionality**
- Why: Better content discovery
- How: Add search form + WHERE clause
- Time: 15 minutes
- Impact: โญโญโญ
### Nice to Have (Do Later)
5. **Add Categories/Tags**
- Why: Better content organization
- How: `lvt gen resource categories name slug`
- Time: 20 minutes
- Impact: โญโญโญ
6. **Add Soft Deletes**
- Why: Data recovery and audit trail
- How: Add deleted_at field + filter queries
- Time: 30 minutes
- Impact: โญโญ
Domain-Specific Suggestions
Blog Domain
If has: posts Suggest:
- Comments (user engagement)
- Categories/tags (organization)
- Authors (multi-user)
- Search (content discovery)
- RSS feed (syndication)
- Related posts (engagement)
- View counter (analytics)
E-commerce Domain
If has: products Suggest:
- Reviews/ratings (social proof)
- Inventory tracking (stock management)
- Categories/filters (navigation)
- Search (product discovery)
- Cart persistence (UX)
- Order history (customer service)
- Product images (visual appeal)
SaaS Domain
If has: users (via auth) Suggest:
- Organizations/teams (multi-tenant)
- Role-based access control (permissions)
- Usage tracking (billing)
- API keys (integrations)
- Audit logs (compliance)
- Activity feed (transparency)
- Export functionality (data portability)
Project Management Domain
If has: projects, tasks Suggest:
- Labels/tags (organization)
- Time tracking (productivity)
- Comments/activity (collaboration)
- File attachments (documentation)
- Notifications (updates)
- Dashboard/analytics (insights)
- Kanban board view (workflow)
Suggestion Patterns
Pattern 1: Missing CRUD Relationships
Detection: Parent resource without children Example: posts without comments Suggestion:
Add comments to enable reader engagement
โ lvt gen resource comments post_id:references:posts:CASCADE content author created_at
โ Impact: Community building, feedback loop
Pattern 2: No Search/Filter
Detection: Large datasets without search Example: 100+ products without search Suggestion:
Add search functionality to help users find products
โ Add search input to list template
โ Add WHERE clause: WHERE name LIKE ? OR description LIKE ?
โ Impact: Better user experience, faster discovery
Pattern 3: Missing Authentication
Detection: User-specific resources without auth Example: tasks, posts with "user_email" but no auth system Suggestion:
Add authentication to protect user data
โ lvt gen auth
โ Use auth.RequireAuth middleware on routes
โ Impact: Security, user management
Pattern 4: Performance Issues
Detection: Tables > 1000 rows without indexes on common queries Example: posts sorted by created_at without index Suggestion:
Add index on created_at for faster sorting
โ lvt migration create add_posts_created_at_index
โ CREATE INDEX idx_posts_created_at ON posts(created_at);
โ Impact: 10-100x faster queries
Pattern 5: Missing Production Features
Detection: App ready to deploy but missing prod features Example: No health checks, no monitoring Suggestion:
Add production readiness features
โ Health check endpoint
โ Structured logging
โ Error monitoring (Sentry)
โ Database backups (Litestream)
โ Impact: Reliability, observability
Checklist
- Use lvt:resource-inspect to analyze schema
- Detect domain from existing resources
- Identify missing core features (auth, relationships)
- Check for performance issues (indexes, N+1)
- Review security posture (CSRF, validation)
- Assess UX completeness (search, pagination)
- Categorize by priority (P0/P1/P2)
- Generate actionable recommendations
- Provide specific commands/code
- Estimate time and impact
- Present in order of priority
Output Format
# Suggestions for [App Name]
## Overview
Your app is a [domain] with [X] resources. Here are prioritized recommendations:
## ๐ด Critical (Do Now)
### 1. [Suggestion Title]
**Why:** [Business/technical reason]
**How:**
```bash
[Exact commands to run]
Time: [Estimate] Impact: [What changes]
๐ก Important (Do Soon)
2. [Suggestion Title]
...
๐ข Nice to Have (Do Later)
3. [Suggestion Title]
...
Next Steps
- Start with critical items (๐ด)
- Test each change before moving to next
- Re-run suggestions after implementing top items
## Example Suggestions
### Example 1: Simple Blog
**Analysis:**
- Has: posts (title, content, created_at)
- Missing: comments, categories, auth
**Suggestions:**
๐ด Critical
- Add User Authentication
- Why: Protect post creation/editing
- How: lvt gen auth
- Time: 10 min
- Impact: Security, author attribution
๐ก Important
Add Comments
- Why: Reader engagement
- How: lvt gen resource comments post_id:references:posts:CASCADE content author
- Time: 5 min
- Impact: Community building
Add Categories
- Why: Content organization
- How: lvt gen resource categories name slug
- Time: 5 min
- Impact: Better navigation
๐ข Nice to Have
- Add Search
- Why: Content discovery
- How: Add WHERE title LIKE ? OR content LIKE ?
- Time: 15 min
- Impact: Better UX
### Example 2: E-commerce App
**Analysis:**
- Has: products (name, price, quantity)
- Missing: orders, cart, reviews, categories
**Suggestions:**
๐ด Critical
Add Order Management
- Why: Can't process sales without orders
- How: lvt gen resource orders user_email total:float status lvt gen schema order_items order_id:references:orders product_id:references:products quantity:int price:float
- Time: 15 min
- Impact: Enable sales
Add Authentication
- Why: Track customer orders
- How: lvt gen auth
- Time: 10 min
- Impact: Customer accounts
๐ก Important
Add Product Reviews
- Why: Social proof increases sales
- How: lvt gen resource reviews product_id:references:products rating:int content
- Time: 10 min
- Impact: Trust, conversions
Add Shopping Cart
- Why: Multi-item purchases
- How: lvt gen schema cart_items session_id product_id:references:products quantity:int
- Time: 20 min
- Impact: Better UX, higher AOV
## Success Criteria
Good suggestions should:
1. โ
Be specific and actionable
2. โ
Include exact commands
3. โ
Explain business value
4. โ
Estimate time and impact
5. โ
Be prioritized by urgency
6. โ
Be domain-appropriate
7. โ
Be achievable quickly
## Common Suggestion Categories
**Features:**
- Authentication/authorization
- Search and filtering
- Pagination/infinite scroll
- Comments/reviews
- Categories/tags
- File uploads
- Email notifications
**Performance:**
- Database indexes
- Query optimization
- Caching strategies
- Asset optimization
- Connection pooling
**Security:**
- CSRF protection
- Input validation
- Rate limiting
- SQL injection prevention
- XSS prevention
**Data Management:**
- Soft deletes
- Audit trails
- Data exports
- Backups
- Migrations
**Production:**
- Health checks
- Monitoring
- Error tracking
- Logging
- Deployment config
## Notes
- Suggestions should be contextual (based on actual analysis)
- Always explain "why" not just "what"
- Provide specific commands, not generic advice
- Estimate time realistically (err on high side)
- Focus on high-impact, low-effort wins first
- Re-run suggestions after implementing to find new opportunities
- Combine with lvt:add-related-resources for resource suggestions
- Combine with lvt:production-ready for deployment suggestions