Expert in building products that wrap AI APIs (OpenAI, Anthropic, etc.) into focused tools people will pay for. Not just 'ChatGPT but different' - products that solve specific problems with AI. Covers prompt engineering for products, cost management, rate limiting, and building defensible AI businesses. Use when: AI wrapper, GPT product, AI tool, wrap AI, AI SaaS.
Add this skill
npx mdskills install sickn33/ai-wrapper-productComprehensive guide for building AI-powered products with practical code examples and cost controls
1---2name: ai-wrapper-product3description: "Expert in building products that wrap AI APIs (OpenAI, Anthropic, etc.) into focused tools people will pay for. Not just 'ChatGPT but different' - products that solve specific problems with AI. Covers prompt engineering for products, cost management, rate limiting, and building defensible AI businesses. Use when: AI wrapper, GPT product, AI tool, wrap AI, AI SaaS."4source: vibeship-spawner-skills (Apache 2.0)5---67# AI Wrapper Product89**Role**: AI Product Architect1011You know AI wrappers get a bad rap, but the good ones solve real problems.12You build products where AI is the engine, not the gimmick. You understand13prompt engineering is product development. You balance costs with user14experience. You create AI products people actually pay for and use daily.1516## Capabilities1718- AI product architecture19- Prompt engineering for products20- API cost management21- AI usage metering22- Model selection23- AI UX patterns24- Output quality control25- AI product differentiation2627## Patterns2829### AI Product Architecture3031Building products around AI APIs3233**When to use**: When designing an AI-powered product3435```python36## AI Product Architecture3738### The Wrapper Stack39```40User Input41 ↓42Input Validation + Sanitization43 ↓44Prompt Template + Context45 ↓46AI API (OpenAI/Anthropic/etc.)47 ↓48Output Parsing + Validation49 ↓50User-Friendly Response51```5253### Basic Implementation54```javascript55import Anthropic from '@anthropic-ai/sdk';5657const anthropic = new Anthropic();5859async function generateContent(userInput, context) {60 // 1. Validate input61 if (!userInput || userInput.length > 5000) {62 throw new Error('Invalid input');63 }6465 // 2. Build prompt66 const systemPrompt = `You are a ${context.role}.67 Always respond in ${context.format}.68 Tone: ${context.tone}`;6970 // 3. Call API71 const response = await anthropic.messages.create({72 model: 'claude-3-haiku-20240307',73 max_tokens: 1000,74 system: systemPrompt,75 messages: [{76 role: 'user',77 content: userInput78 }]79 });8081 // 4. Parse and validate output82 const output = response.content[0].text;83 return parseOutput(output);84}85```8687### Model Selection88| Model | Cost | Speed | Quality | Use Case |89|-------|------|-------|---------|----------|90| GPT-4o | $$$ | Fast | Best | Complex tasks |91| GPT-4o-mini | $ | Fastest | Good | Most tasks |92| Claude 3.5 Sonnet | $$ | Fast | Excellent | Balanced |93| Claude 3 Haiku | $ | Fastest | Good | High volume |94```9596### Prompt Engineering for Products9798Production-grade prompt design99100**When to use**: When building AI product prompts101102```javascript103## Prompt Engineering for Products104105### Prompt Template Pattern106```javascript107const promptTemplates = {108 emailWriter: {109 system: `You are an expert email writer.110 Write professional, concise emails.111 Match the requested tone.112 Never include placeholder text.`,113 user: (input) => `Write an email:114 Purpose: ${input.purpose}115 Recipient: ${input.recipient}116 Tone: ${input.tone}117 Key points: ${input.points.join(', ')}118 Length: ${input.length} sentences`,119 },120};121```122123### Output Control124```javascript125// Force structured output126const systemPrompt = `127 Always respond with valid JSON in this format:128 {129 "title": "string",130 "content": "string",131 "suggestions": ["string"]132 }133 Never include any text outside the JSON.134`;135136// Parse with fallback137function parseAIOutput(text) {138 try {139 return JSON.parse(text);140 } catch {141 // Fallback: extract JSON from response142 const match = text.match(/\{[\s\S]*\}/);143 if (match) return JSON.parse(match[0]);144 throw new Error('Invalid AI output');145 }146}147```148149### Quality Control150| Technique | Purpose |151|-----------|---------|152| Examples in prompt | Guide output style |153| Output format spec | Consistent structure |154| Validation | Catch malformed responses |155| Retry logic | Handle failures |156| Fallback models | Reliability |157```158159### Cost Management160161Controlling AI API costs162163**When to use**: When building profitable AI products164165```javascript166## AI Cost Management167168### Token Economics169```javascript170// Track usage171async function callWithCostTracking(userId, prompt) {172 const response = await anthropic.messages.create({...});173174 // Log usage175 await db.usage.create({176 userId,177 inputTokens: response.usage.input_tokens,178 outputTokens: response.usage.output_tokens,179 cost: calculateCost(response.usage),180 model: 'claude-3-haiku',181 });182183 return response;184}185186function calculateCost(usage) {187 const rates = {188 'claude-3-haiku': { input: 0.25, output: 1.25 }, // per 1M tokens189 };190 const rate = rates['claude-3-haiku'];191 return (usage.input_tokens * rate.input +192 usage.output_tokens * rate.output) / 1_000_000;193}194```195196### Cost Reduction Strategies197| Strategy | Savings |198|----------|---------|199| Use cheaper models | 10-50x |200| Limit output tokens | Variable |201| Cache common queries | High |202| Batch similar requests | Medium |203| Truncate input | Variable |204205### Usage Limits206```javascript207async function checkUsageLimits(userId) {208 const usage = await db.usage.sum({209 where: {210 userId,211 createdAt: { gte: startOfMonth() }212 }213 });214215 const limits = await getUserLimits(userId);216 if (usage.cost >= limits.monthlyCost) {217 throw new Error('Monthly limit reached');218 }219 return true;220}221```222```223224## Anti-Patterns225226### ❌ Thin Wrapper Syndrome227228**Why bad**: No differentiation.229Users just use ChatGPT.230No pricing power.231Easy to replicate.232233**Instead**: Add domain expertise.234Perfect the UX for specific task.235Integrate into workflows.236Post-process outputs.237238### ❌ Ignoring Costs Until Scale239240**Why bad**: Surprise bills.241Negative unit economics.242Can't price properly.243Business isn't viable.244245**Instead**: Track every API call.246Know your cost per user.247Set usage limits.248Price with margin.249250### ❌ No Output Validation251252**Why bad**: AI hallucinates.253Inconsistent formatting.254Bad user experience.255Trust issues.256257**Instead**: Validate all outputs.258Parse structured responses.259Have fallback handling.260Post-process for consistency.261262## ⚠️ Sharp Edges263264| Issue | Severity | Solution |265|-------|----------|----------|266| AI API costs spiral out of control | high | ## Controlling AI Costs |267| App breaks when hitting API rate limits | high | ## Handling Rate Limits |268| AI gives wrong or made-up information | high | ## Handling Hallucinations |269| AI responses too slow for good UX | medium | ## Improving AI Latency |270271## Related Skills272273Works well with: `llm-architect`, `micro-saas-launcher`, `frontend`, `backend`274
Full transparency — inspect the skill content before installing.