@specverse/mcp
Version:
SpecVerse MCP Server - Universal AI assistance for all environments
149 lines (123 loc) • 5.74 kB
Markdown
# Terminal Chat Example: E-commerce Store
**User Request**: "I want to build an online store for selling handmade crafts with user accounts, product catalog, shopping cart, and payment processing"
## Generated Terminal Prompt
### System Context
You are a SpecVerse AI assistant helping create .specly specifications with 90% code reduction through library-first development.
### Library Recommendations
Based on your e-commerce requirements, here are the recommended SpecVerse libraries:
**🎯 Perfect Match - E-commerce Domain**
- **ecommerce**: `@specverse/domains/ecommerce` - Complete e-commerce models (Product, Order, Cart, Customer, Payment, Inventory) with PCI-DSS compliance patterns
**📦 Deployment Pattern**
- **monolith**: `@specverse/deployments/monolith` (1.5x expansion) - Perfect for getting started, single deployment
- *Alternative*: **microservices**: `@specverse/deployments/microservices` (3.2x expansion) - If planning for high scale
**⚙️ Technology Stack**
- **nextjs**: `@specverse/manifests/nextjs` - Next.js 14 React framework with SSR for SEO-friendly product pages
- **postgresql**: `@specverse/manifests/postgresql` - Robust database for products, orders, inventory
- **oauth**: `@specverse/manifests/oauth` - Social login (Google, Facebook) for easier user registration
### Generated Specification
```yaml
version: "3.1.0"
# Import libraries (handles 90% of e-commerce boilerplate)
imports:
- "@specverse/deployments/monolith" # Simple deployment to start
- "@specverse/domains/ecommerce" # Complete e-commerce models
- "@specverse/manifests/nextjs" # React frontend with SSR
- "@specverse/manifests/postgresql" # Database for products/orders
- "@specverse/manifests/oauth" # User authentication
components:
HandmadeCraftsStore:
# Your unique business logic (libraries handle the rest)
models:
Craft:
# Extends ecommerce.Product with craft-specific fields
attributes:
artisan_name: String
craft_technique: String
materials_used: [String]
time_to_make: Integer
story: Text
Artisan:
# Extends ecommerce.Customer with artisan features
attributes:
bio: Text
specialties: [String]
years_experience: Integer
location: String
controllers:
CraftController:
# CURED operations for craft management
actions:
- create_craft: "Artisan uploads new craft"
- feature_craft: "Admin features popular crafts"
- search_by_technique: "Users find crafts by technique"
ArtisanController:
actions:
- register_artisan: "Artisan creates seller profile"
- view_artisan_store: "Customers view artisan's crafts"
# AI inference will expand this to include:
# - Complete shopping cart functionality (from ecommerce library)
# - Payment processing integration
# - Order management system
# - User authentication flows (from oauth library)
# - Product catalog with search/filter
# - Inventory management
# - Email notifications
# - Admin dashboard
# - Deployment configurations (from monolith library)
# - Database schema with relationships
# - API endpoints for frontend
# - React components and pages (from nextjs library)
deployments:
development:
# Deployment details handled by monolith library
# Includes: database setup, environment config, local dev server
```
### Expected AI Expansion (4.2x growth)
Your minimal specification will expand to include:
**From E-commerce Library:**
- Complete Product, Order, OrderItem, Customer, Cart models
- Shopping cart operations (add, remove, update, checkout)
- Order processing workflow
- Payment integration patterns
- Inventory management
- Customer account management
**From Next.js Library:**
- React components for product listing, cart, checkout
- SSR pages for SEO-friendly product pages
- API routes for backend operations
- Responsive design patterns
**From OAuth Library:**
- Social login integration
- User session management
- Authentication middleware
- Account registration/login flows
**From PostgreSQL Library:**
- Database schema with proper relationships
- Query optimization patterns
- Connection pooling
- Migration scripts
### How to Use This Specification
1. **Copy the specification above** to `specs/main.specly`
2. **Install SpecVerse CLI**: `npm install -g @specverse/lang`
3. **Process specification**: `specverse process specs/main.specly`
4. **Generate complete system**: View the expanded specification with all e-commerce functionality
5. **Generate diagrams**: `specverse generate specs/main.specly --uml all`
### What You Get (90% generated automatically)
- ✅ Complete e-commerce functionality (cart, checkout, payments)
- ✅ User authentication with social login
- ✅ Product catalog with search and filtering
- ✅ Order management and tracking
- ✅ Admin dashboard for managing products/orders
- ✅ Responsive Next.js frontend with SSR
- ✅ PostgreSQL database with optimized schema
- ✅ API endpoints for all operations
- ✅ Email notifications and workflows
- ✅ Deployment configuration
- ✅ Documentation and architecture diagrams
### What You Focus On (10% custom)
- ✨ Craft-specific fields (artisan_name, technique, materials)
- ✨ Artisan profile and story features
- ✨ Craft-specific search and categorization
- ✨ Your unique brand and styling
- ✨ Custom business rules and workflows
**Result**: A complete e-commerce platform with 90% standard functionality handled by libraries, letting you focus on what makes your handmade crafts store unique!