[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6F97WZTVQ22DF4MFVY5APQ0":3,"skill-same:01M6F97WZTVQ22DF4MFVY5APQ0":87},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":31,"publishedAt":55,"linkOnly":56,"markdownContent":57,"markdownBody":58,"frontMatter":59,"refName":64,"commitSha":65,"skillDirectory":66,"forksCount":67,"repositoryHtmlUrl":68,"repositoryHomepageUrl":6,"ownerHtmlUrl":69,"ownerBlogUrl":70,"ownerDescription":71,"updatedAt":72,"install":73,"resources":86},"01M6F97WZTVQ22DF4MFVY5APQ0","speak-cost-tuning",null,"Optimize Speak costs through tier selection, usage monitoring, and efficient lesson design.\nUse when analyzing Speak billing, reducing API costs,\nor implementing usage monitoring and budget alerts for language learning apps.\nTrigger with phrases like \"speak cost\", \"speak billing\",\n\"reduce speak costs\", \"speak pricing\", \"speak expensive\", \"speak budget\".","Dicklesworthstone\u002Fpi_agent_rust","Dicklesworthstone","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F35050222?v=4","01M6CG26AR942CSVMN1M5E3DSE","Jeff Emanuel","01M6CG26EPP71PSHW1VDS71121",1979,"MIT","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Fplugins-community\u002Fplugins\u002Fsaas-packs\u002Fspeak-pack\u002Fskills\u002Fspeak-cost-tuning\u002FSKILL.md",[18,23,28],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000015","视觉设计","SCENARIO","使用场景",{"categoryNo":24,"categoryName":25,"taxonomyType":26,"taxonomyTypeDesc":27},"01JBSEEDCAT000000000000039","教师与教育","PROFESSION","适用职业",{"categoryNo":29,"categoryName":30,"taxonomyType":26,"taxonomyTypeDesc":27},"01JBSEEDCAT000000000000040","财务",[32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54],"tuning","speak cost tuning","speak","cost","language learning","when","reduce","implementing","billing","apps","trigger","io","alerts","lesson","optimize","design","selection","read","api","Budget","analyzing","monitoring","pricing","2026-11-10 10:12:30",false,"---\nname: speak-cost-tuning\ndescription: |\n  Optimize Speak costs through tier selection, usage monitoring, and efficient lesson design.\n  Use when analyzing Speak billing, reducing API costs,\n  or implementing usage monitoring and budget alerts for language learning apps.\n  Trigger with phrases like \"speak cost\", \"speak billing\",\n  \"reduce speak costs\", \"speak pricing\", \"speak expensive\", \"speak budget\".\nallowed-tools: Read, Grep\nversion: 1.0.0\nlicense: MIT\nauthor: Jeremy Longshore \u003Cjeremy@intentsolutions.io>\n---\n\n# Speak Cost Tuning\n\n## Overview\nOptimize Speak costs through smart tier selection, efficient lesson design, and usage monitoring.\n\n## Prerequisites\n- Access to Speak billing dashboard\n- Understanding of current usage patterns\n- Database for usage tracking (optional)\n- Alerting system configured (optional)\n\n## Pricing Model\n\n### Subscription Tiers\n| Tier | Monthly Cost | Lessons\u002Fmo | Audio Min\u002Fmo | Users |\n|------|-------------|------------|--------------|-------|\n| Free | $0 | 50 | 30 | 1 |\n| Personal | $29 | 500 | 300 | 1 |\n| Team | $199 | 5,000 | 2,000 | 10 |\n| Business | $499 | 20,000 | 10,000 | 50 |\n| Enterprise | Custom | Unlimited | Unlimited | Unlimited |\n\n### Usage-Based Pricing (Overages)\n| Resource | Unit | Overage Cost |\n|----------|------|--------------|\n| Lesson Sessions | per session | $0.05 |\n| Audio Recognition | per minute | $0.02 |\n| Pronunciation Scoring | per evaluation | $0.01 |\n| AI Tutor Interactions | per exchange | $0.02 |\n\n## Cost Estimation\n\n```typescript\ninterface UsageEstimate {\n  lessonsPerMonth: number;\n  audioMinutesPerMonth: number;\n  tier: string;\n  baseCost: number;\n  overageCost: number;\n  totalCost: number;\n  recommendation?: string;\n}\n\nfunction estimateSpeakCost(\n  lessonsPerMonth: number,\n  audioMinutesPerMonth: number,\n  currentTier: 'free' | 'personal' | 'team' | 'business' = 'personal'\n): UsageEstimate {\n  const tiers = {\n    free: { cost: 0, lessons: 50, audio: 30 },\n    personal: { cost: 29, lessons: 500, audio: 300 },\n    team: { cost: 199, lessons: 5000, audio: 2000 },\n    business: { cost: 499, lessons: 20000, audio: 10000 },\n  };\n\n  const tier = tiers[currentTier];\n  const baseCost = tier.cost;\n\n  \u002F\u002F Calculate overages\n  const lessonOverage = Math.max(0, lessonsPerMonth - tier.lessons);\n  const audioOverage = Math.max(0, audioMinutesPerMonth - tier.audio);\n\n  const overageCost =\n    lessonOverage * 0.05 +\n    audioOverage * 0.02;\n\n  const totalCost = baseCost + overageCost;\n\n  \u002F\u002F Recommend upgrade if overage is high\n  let recommendation: string | undefined;\n  if (overageCost > baseCost * 0.5) {\n    const nextTier = getNextTier(currentTier);\n    if (nextTier) {\n      const nextTierCost = estimateSpeakCost(\n        lessonsPerMonth,\n        audioMinutesPerMonth,\n        nextTier\n      );\n      if (nextTierCost.totalCost \u003C totalCost) {\n        recommendation = `Consider upgrading to ${nextTier} tier to save $${(totalCost - nextTierCost.totalCost).toFixed(2)}\u002Fmonth`;\n      }\n    }\n  }\n\n  return {\n    lessonsPerMonth,\n    audioMinutesPerMonth,\n    tier: currentTier,\n    baseCost,\n    overageCost,\n    totalCost,\n    recommendation,\n  };\n}\n```\n\n## Usage Monitoring\n\n```typescript\nclass SpeakUsageMonitor {\n  private lessonCount = 0;\n  private audioMinutes = 0;\n  private pronunciationScores = 0;\n  private monthStart: Date;\n  private alertThreshold: number;\n\n  constructor(monthlyBudget: number) {\n    this.alertThreshold = monthlyBudget * 0.8; \u002F\u002F 80% warning\n    this.monthStart = new Date();\n    this.monthStart.setDate(1);\n  }\n\n  trackLesson(duration: number, audioMinutes: number, scores: number): void {\n    this.lessonCount++;\n    this.audioMinutes += audioMinutes;\n    this.pronunciationScores += scores;\n\n    const currentCost = this.estimatedCost();\n    if (currentCost > this.alertThreshold) {\n      this.sendAlert(`Approaching Speak budget: $${currentCost.toFixed(2)}`);\n    }\n  }\n\n  estimatedCost(): number {\n    \u002F\u002F Base tier cost prorated + overages\n    const lessonCost = Math.max(0, this.lessonCount - 500) * 0.05;\n    const audioCost = Math.max(0, this.audioMinutes - 300) * 0.02;\n    const scoreCost = Math.max(0, this.pronunciationScores - 1000) * 0.01;\n\n    return 29 + lessonCost + audioCost + scoreCost; \u002F\u002F Assuming personal tier\n  }\n\n  getUsageReport(): UsageReport {\n    return {\n      lessons: this.lessonCount,\n      audioMinutes: this.audioMinutes,\n      pronunciationScores: this.pronunciationScores,\n      estimatedCost: this.estimatedCost(),\n      period: {\n        start: this.monthStart,\n        end: new Date(),\n      },\n    };\n  }\n\n  private sendAlert(message: string): void {\n    \u002F\u002F Send to Slack, email, PagerDuty, etc.\n    console.warn('[SPEAK BUDGET ALERT]', message);\n  }\n}\n```\n\n## Cost Reduction Strategies\n\n### Strategy 1: Efficient Lesson Design\n```typescript\n\u002F\u002F Reduce unnecessary API calls by batching\nasync function efficientLesson(\n  session: LessonSession,\n  exchanges: number\n): Promise\u003Cvoid> {\n  \u002F\u002F Pre-fetch all prompts at once\n  const prompts = await session.getPromptsBatch(exchanges);\n\n  \u002F\u002F Process in sequence but with prepared data\n  for (const prompt of prompts) {\n    displayPrompt(prompt);\n    const response = await getUserResponse();\n    \u002F\u002F Submit when ready\n  }\n}\n```\n\n### Strategy 2: Client-Side Audio Pre-processing\n```typescript\n\u002F\u002F Reduce audio minutes billed by trimming silence\nasync function optimizedAudioSubmit(\n  session: LessonSession,\n  rawAudio: ArrayBuffer\n): Promise\u003CFeedback> {\n  \u002F\u002F Trim silence locally (free)\n  const trimmed = await trimSilence(rawAudio);\n\n  \u002F\u002F Only upload meaningful audio (billed)\n  const durationReduction = 1 - (trimmed.byteLength \u002F rawAudio.byteLength);\n  console.log(`Saved ${(durationReduction * 100).toFixed(0)}% audio cost`);\n\n  return session.submitAudio(trimmed);\n}\n```\n\n### Strategy 3: Caching Vocabulary Lookups\n```typescript\n\u002F\u002F Cache vocabulary to reduce API calls\nconst vocabularyCache = new Map\u003Cstring, VocabularyEntry>();\n\nasync function cachedVocabularyLookup(\n  word: string,\n  language: string\n): Promise\u003CVocabularyEntry> {\n  const key = `${language}:${word.toLowerCase()}`;\n\n  if (vocabularyCache.has(key)) {\n    return vocabularyCache.get(key)!; \u002F\u002F Free\n  }\n\n  const entry = await speakClient.vocabulary.lookup(word, language); \u002F\u002F Costs\n  vocabularyCache.set(key, entry);\n  return entry;\n}\n```\n\n### Strategy 4: Pronunciation Scoring Optimization\n```typescript\n\u002F\u002F Only score pronunciation on final attempts\nasync function smartPronunciationScoring(\n  session: LessonSession,\n  phrase: string,\n  audioAttempts: ArrayBuffer[]\n): Promise\u003CPronunciationResult> {\n  \u002F\u002F Quick local validation for early attempts (free)\n  for (let i = 0; i \u003C audioAttempts.length - 1; i++) {\n    const basic = await localAudioValidation(audioAttempts[i]);\n    if (!basic.acceptable) {\n      return { needsRetry: true, feedback: basic.feedback };\n    }\n  }\n\n  \u002F\u002F Only call paid API for final attempt\n  return session.scorePronunciation(audioAttempts[audioAttempts.length - 1], phrase);\n}\n```\n\n### Strategy 5: Off-Peak Usage\n```typescript\n\u002F\u002F Schedule non-urgent operations for off-peak\nasync function scheduleProgressSync(userId: string): Promise\u003Cvoid> {\n  const now = new Date();\n  const hour = now.getUTCHours();\n\n  \u002F\u002F Off-peak: 2am-6am UTC\n  if (hour >= 2 && hour \u003C 6) {\n    \u002F\u002F Immediate sync\n    await speakClient.users.syncProgress(userId);\n  } else {\n    \u002F\u002F Queue for off-peak\n    await queue.add('progress-sync', { userId }, {\n      delay: getDelayUntilOffPeak(),\n    });\n  }\n}\n```\n\n## Budget Alerts Configuration\n\n```typescript\n\u002F\u002F Set up billing alerts\ninterface BudgetAlert {\n  threshold: number; \u002F\u002F Percentage of budget\n  channels: ('email' | 'slack' | 'pagerduty')[];\n  action?: 'notify' | 'throttle' | 'pause';\n}\n\nconst budgetAlerts: BudgetAlert[] = [\n  { threshold: 50, channels: ['email'], action: 'notify' },\n  { threshold: 75, channels: ['email', 'slack'], action: 'notify' },\n  { threshold: 90, channels: ['email', 'slack', 'pagerduty'], action: 'throttle' },\n  { threshold: 100, channels: ['email', 'slack', 'pagerduty'], action: 'pause' },\n];\n\nasync function checkBudget(usage: UsageReport): Promise\u003Cvoid> {\n  const budget = 500; \u002F\u002F Monthly budget\n  const percentUsed = (usage.estimatedCost \u002F budget) * 100;\n\n  for (const alert of budgetAlerts) {\n    if (percentUsed >= alert.threshold) {\n      await sendBudgetAlert(alert, usage, percentUsed);\n\n      if (alert.action === 'throttle') {\n        await enableRateLimiting();\n      } else if (alert.action === 'pause') {\n        await pauseNonEssentialFeatures();\n      }\n    }\n  }\n}\n```\n\n## Cost Dashboard Query\n\n```sql\n-- Track Speak usage costs by user and feature\nSELECT\n  DATE_TRUNC('day', created_at) as date,\n  user_id,\n  feature,\n  COUNT(*) as operations,\n  SUM(audio_seconds) \u002F 60.0 as audio_minutes,\n  SUM(\n    CASE\n      WHEN feature = 'lesson' THEN 0.05\n      WHEN feature = 'audio' THEN audio_seconds \u002F 60.0 * 0.02\n      WHEN feature = 'pronunciation' THEN 0.01\n      ELSE 0\n    END\n  ) as estimated_cost\nFROM speak_usage_logs\nWHERE created_at >= DATE_TRUNC('month', CURRENT_DATE)\nGROUP BY 1, 2, 3\nORDER BY estimated_cost DESC;\n```\n\n## Output\n- Optimized tier selection\n- Usage monitoring implemented\n- Budget alerts configured\n- Cost reduction strategies applied\n- Efficient lesson design patterns\n\n## Error Handling\n| Issue | Cause | Solution |\n|-------|-------|----------|\n| Unexpected charges | Untracked usage | Implement monitoring |\n| Overage fees | Wrong tier | Upgrade tier |\n| Budget exceeded | No alerts | Set up alerts |\n| Inefficient audio | No preprocessing | Add client-side optimization |\n\n## Examples\n\n### Quick Cost Check\n```typescript\nconst usage = usageMonitor.getUsageReport();\nconst estimate = estimateSpeakCost(usage.lessons, usage.audioMinutes, 'personal');\n\nconsole.log(`Current spend: $${estimate.totalCost.toFixed(2)}`);\nconsole.log(`Base: $${estimate.baseCost} | Overage: $${estimate.overageCost.toFixed(2)}`);\n\nif (estimate.recommendation) {\n  console.log(`Recommendation: ${estimate.recommendation}`);\n}\n```\n\n## Resources\n- [Speak Pricing](https:\u002F\u002Fspeak.com\u002Fpricing)\n- [Speak Billing Dashboard](https:\u002F\u002Fdeveloper.speak.com\u002Fbilling)\n- [Usage API](https:\u002F\u002Fdeveloper.speak.com\u002Fdocs\u002Fusage)\n\n## Next Steps\nFor architecture patterns, see `speak-reference-architecture`.\n","# Speak Cost Tuning\n\n## Overview\nOptimize Speak costs through smart tier selection, efficient lesson design, and usage monitoring.\n\n## Prerequisites\n- Access to Speak billing dashboard\n- Understanding of current usage patterns\n- Database for usage tracking (optional)\n- Alerting system configured (optional)\n\n## Pricing Model\n\n### Subscription Tiers\n| Tier | Monthly Cost | Lessons\u002Fmo | Audio Min\u002Fmo | Users |\n|------|-------------|------------|--------------|-------|\n| Free | $0 | 50 | 30 | 1 |\n| Personal | $29 | 500 | 300 | 1 |\n| Team | $199 | 5,000 | 2,000 | 10 |\n| Business | $499 | 20,000 | 10,000 | 50 |\n| Enterprise | Custom | Unlimited | Unlimited | Unlimited |\n\n### Usage-Based Pricing (Overages)\n| Resource | Unit | Overage Cost |\n|----------|------|--------------|\n| Lesson Sessions | per session | $0.05 |\n| Audio Recognition | per minute | $0.02 |\n| Pronunciation Scoring | per evaluation | $0.01 |\n| AI Tutor Interactions | per exchange | $0.02 |\n\n## Cost Estimation\n\n```typescript\ninterface UsageEstimate {\n  lessonsPerMonth: number;\n  audioMinutesPerMonth: number;\n  tier: string;\n  baseCost: number;\n  overageCost: number;\n  totalCost: number;\n  recommendation?: string;\n}\n\nfunction estimateSpeakCost(\n  lessonsPerMonth: number,\n  audioMinutesPerMonth: number,\n  currentTier: 'free' | 'personal' | 'team' | 'business' = 'personal'\n): UsageEstimate {\n  const tiers = {\n    free: { cost: 0, lessons: 50, audio: 30 },\n    personal: { cost: 29, lessons: 500, audio: 300 },\n    team: { cost: 199, lessons: 5000, audio: 2000 },\n    business: { cost: 499, lessons: 20000, audio: 10000 },\n  };\n\n  const tier = tiers[currentTier];\n  const baseCost = tier.cost;\n\n  \u002F\u002F Calculate overages\n  const lessonOverage = Math.max(0, lessonsPerMonth - tier.lessons);\n  const audioOverage = Math.max(0, audioMinutesPerMonth - tier.audio);\n\n  const overageCost =\n    lessonOverage * 0.05 +\n    audioOverage * 0.02;\n\n  const totalCost = baseCost + overageCost;\n\n  \u002F\u002F Recommend upgrade if overage is high\n  let recommendation: string | undefined;\n  if (overageCost > baseCost * 0.5) {\n    const nextTier = getNextTier(currentTier);\n    if (nextTier) {\n      const nextTierCost = estimateSpeakCost(\n        lessonsPerMonth,\n        audioMinutesPerMonth,\n        nextTier\n      );\n      if (nextTierCost.totalCost \u003C totalCost) {\n        recommendation = `Consider upgrading to ${nextTier} tier to save $${(totalCost - nextTierCost.totalCost).toFixed(2)}\u002Fmonth`;\n      }\n    }\n  }\n\n  return {\n    lessonsPerMonth,\n    audioMinutesPerMonth,\n    tier: currentTier,\n    baseCost,\n    overageCost,\n    totalCost,\n    recommendation,\n  };\n}\n```\n\n## Usage Monitoring\n\n```typescript\nclass SpeakUsageMonitor {\n  private lessonCount = 0;\n  private audioMinutes = 0;\n  private pronunciationScores = 0;\n  private monthStart: Date;\n  private alertThreshold: number;\n\n  constructor(monthlyBudget: number) {\n    this.alertThreshold = monthlyBudget * 0.8; \u002F\u002F 80% warning\n    this.monthStart = new Date();\n    this.monthStart.setDate(1);\n  }\n\n  trackLesson(duration: number, audioMinutes: number, scores: number): void {\n    this.lessonCount++;\n    this.audioMinutes += audioMinutes;\n    this.pronunciationScores += scores;\n\n    const currentCost = this.estimatedCost();\n    if (currentCost > this.alertThreshold) {\n      this.sendAlert(`Approaching Speak budget: $${currentCost.toFixed(2)}`);\n    }\n  }\n\n  estimatedCost(): number {\n    \u002F\u002F Base tier cost prorated + overages\n    const lessonCost = Math.max(0, this.lessonCount - 500) * 0.05;\n    const audioCost = Math.max(0, this.audioMinutes - 300) * 0.02;\n    const scoreCost = Math.max(0, this.pronunciationScores - 1000) * 0.01;\n\n    return 29 + lessonCost + audioCost + scoreCost; \u002F\u002F Assuming personal tier\n  }\n\n  getUsageReport(): UsageReport {\n    return {\n      lessons: this.lessonCount,\n      audioMinutes: this.audioMinutes,\n      pronunciationScores: this.pronunciationScores,\n      estimatedCost: this.estimatedCost(),\n      period: {\n        start: this.monthStart,\n        end: new Date(),\n      },\n    };\n  }\n\n  private sendAlert(message: string): void {\n    \u002F\u002F Send to Slack, email, PagerDuty, etc.\n    console.warn('[SPEAK BUDGET ALERT]', message);\n  }\n}\n```\n\n## Cost Reduction Strategies\n\n### Strategy 1: Efficient Lesson Design\n```typescript\n\u002F\u002F Reduce unnecessary API calls by batching\nasync function efficientLesson(\n  session: LessonSession,\n  exchanges: number\n): Promise\u003Cvoid> {\n  \u002F\u002F Pre-fetch all prompts at once\n  const prompts = await session.getPromptsBatch(exchanges);\n\n  \u002F\u002F Process in sequence but with prepared data\n  for (const prompt of prompts) {\n    displayPrompt(prompt);\n    const response = await getUserResponse();\n    \u002F\u002F Submit when ready\n  }\n}\n```\n\n### Strategy 2: Client-Side Audio Pre-processing\n```typescript\n\u002F\u002F Reduce audio minutes billed by trimming silence\nasync function optimizedAudioSubmit(\n  session: LessonSession,\n  rawAudio: ArrayBuffer\n): Promise\u003CFeedback> {\n  \u002F\u002F Trim silence locally (free)\n  const trimmed = await trimSilence(rawAudio);\n\n  \u002F\u002F Only upload meaningful audio (billed)\n  const durationReduction = 1 - (trimmed.byteLength \u002F rawAudio.byteLength);\n  console.log(`Saved ${(durationReduction * 100).toFixed(0)}% audio cost`);\n\n  return session.submitAudio(trimmed);\n}\n```\n\n### Strategy 3: Caching Vocabulary Lookups\n```typescript\n\u002F\u002F Cache vocabulary to reduce API calls\nconst vocabularyCache = new Map\u003Cstring, VocabularyEntry>();\n\nasync function cachedVocabularyLookup(\n  word: string,\n  language: string\n): Promise\u003CVocabularyEntry> {\n  const key = `${language}:${word.toLowerCase()}`;\n\n  if (vocabularyCache.has(key)) {\n    return vocabularyCache.get(key)!; \u002F\u002F Free\n  }\n\n  const entry = await speakClient.vocabulary.lookup(word, language); \u002F\u002F Costs\n  vocabularyCache.set(key, entry);\n  return entry;\n}\n```\n\n### Strategy 4: Pronunciation Scoring Optimization\n```typescript\n\u002F\u002F Only score pronunciation on final attempts\nasync function smartPronunciationScoring(\n  session: LessonSession,\n  phrase: string,\n  audioAttempts: ArrayBuffer[]\n): Promise\u003CPronunciationResult> {\n  \u002F\u002F Quick local validation for early attempts (free)\n  for (let i = 0; i \u003C audioAttempts.length - 1; i++) {\n    const basic = await localAudioValidation(audioAttempts[i]);\n    if (!basic.acceptable) {\n      return { needsRetry: true, feedback: basic.feedback };\n    }\n  }\n\n  \u002F\u002F Only call paid API for final attempt\n  return session.scorePronunciation(audioAttempts[audioAttempts.length - 1], phrase);\n}\n```\n\n### Strategy 5: Off-Peak Usage\n```typescript\n\u002F\u002F Schedule non-urgent operations for off-peak\nasync function scheduleProgressSync(userId: string): Promise\u003Cvoid> {\n  const now = new Date();\n  const hour = now.getUTCHours();\n\n  \u002F\u002F Off-peak: 2am-6am UTC\n  if (hour >= 2 && hour \u003C 6) {\n    \u002F\u002F Immediate sync\n    await speakClient.users.syncProgress(userId);\n  } else {\n    \u002F\u002F Queue for off-peak\n    await queue.add('progress-sync', { userId }, {\n      delay: getDelayUntilOffPeak(),\n    });\n  }\n}\n```\n\n## Budget Alerts Configuration\n\n```typescript\n\u002F\u002F Set up billing alerts\ninterface BudgetAlert {\n  threshold: number; \u002F\u002F Percentage of budget\n  channels: ('email' | 'slack' | 'pagerduty')[];\n  action?: 'notify' | 'throttle' | 'pause';\n}\n\nconst budgetAlerts: BudgetAlert[] = [\n  { threshold: 50, channels: ['email'], action: 'notify' },\n  { threshold: 75, channels: ['email', 'slack'], action: 'notify' },\n  { threshold: 90, channels: ['email', 'slack', 'pagerduty'], action: 'throttle' },\n  { threshold: 100, channels: ['email', 'slack', 'pagerduty'], action: 'pause' },\n];\n\nasync function checkBudget(usage: UsageReport): Promise\u003Cvoid> {\n  const budget = 500; \u002F\u002F Monthly budget\n  const percentUsed = (usage.estimatedCost \u002F budget) * 100;\n\n  for (const alert of budgetAlerts) {\n    if (percentUsed >= alert.threshold) {\n      await sendBudgetAlert(alert, usage, percentUsed);\n\n      if (alert.action === 'throttle') {\n        await enableRateLimiting();\n      } else if (alert.action === 'pause') {\n        await pauseNonEssentialFeatures();\n      }\n    }\n  }\n}\n```\n\n## Cost Dashboard Query\n\n```sql\n-- Track Speak usage costs by user and feature\nSELECT\n  DATE_TRUNC('day', created_at) as date,\n  user_id,\n  feature,\n  COUNT(*) as operations,\n  SUM(audio_seconds) \u002F 60.0 as audio_minutes,\n  SUM(\n    CASE\n      WHEN feature = 'lesson' THEN 0.05\n      WHEN feature = 'audio' THEN audio_seconds \u002F 60.0 * 0.02\n      WHEN feature = 'pronunciation' THEN 0.01\n      ELSE 0\n    END\n  ) as estimated_cost\nFROM speak_usage_logs\nWHERE created_at >= DATE_TRUNC('month', CURRENT_DATE)\nGROUP BY 1, 2, 3\nORDER BY estimated_cost DESC;\n```\n\n## Output\n- Optimized tier selection\n- Usage monitoring implemented\n- Budget alerts configured\n- Cost reduction strategies applied\n- Efficient lesson design patterns\n\n## Error Handling\n| Issue | Cause | Solution |\n|-------|-------|----------|\n| Unexpected charges | Untracked usage | Implement monitoring |\n| Overage fees | Wrong tier | Upgrade tier |\n| Budget exceeded | No alerts | Set up alerts |\n| Inefficient audio | No preprocessing | Add client-side optimization |\n\n## Examples\n\n### Quick Cost Check\n```typescript\nconst usage = usageMonitor.getUsageReport();\nconst estimate = estimateSpeakCost(usage.lessons, usage.audioMinutes, 'personal');\n\nconsole.log(`Current spend: $${estimate.totalCost.toFixed(2)}`);\nconsole.log(`Base: $${estimate.baseCost} | Overage: $${estimate.overageCost.toFixed(2)}`);\n\nif (estimate.recommendation) {\n  console.log(`Recommendation: ${estimate.recommendation}`);\n}\n```\n\n## Resources\n- [Speak Pricing](https:\u002F\u002Fspeak.com\u002Fpricing)\n- [Speak Billing Dashboard](https:\u002F\u002Fdeveloper.speak.com\u002Fbilling)\n- [Usage API](https:\u002F\u002Fdeveloper.speak.com\u002Fdocs\u002Fusage)\n\n## Next Steps\nFor architecture patterns, see `speak-reference-architecture`.\n",{"name":5,"author":60,"license":15,"version":61,"description":62,"allowed-tools":63},"Jeremy Longshore \u003Cjeremy@intentsolutions.io>","1.0.0","Optimize Speak costs through tier selection, usage monitoring, and efficient lesson design.\nUse when analyzing Speak billing, reducing API costs,\nor implementing usage monitoring and budget alerts for language learning apps.\nTrigger with phrases like \"speak cost\", \"speak billing\",\n\"reduce speak costs\", \"speak pricing\", \"speak expensive\", \"speak budget\".\n","Read, Grep","main","90b50ed0778745a80fd5bfb13b1843d45b9e82f7","tests\u002Fext_conformance\u002Fartifacts\u002Fplugins-community\u002Fplugins\u002Fsaas-packs\u002Fspeak-pack\u002Fskills\u002Fspeak-cost-tuning",231,"https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust","https:\u002F\u002Fgithub.com\u002FDicklesworthstone","https:\u002F\u002Fwww.jeffreyemanuel.com\u002F","Building in NY","2026-11-11 01:23:40",{"source":8,"skillName":5,"commands":74,"prompt":84,"zipAvailable":85},[75,78,81],{"tool":76,"command":77},"npx","npx skills add Dicklesworthstone\u002Fpi_agent_rust --skill speak-cost-tuning",{"tool":79,"command":80},"bunx","bunx skills add Dicklesworthstone\u002Fpi_agent_rust --skill speak-cost-tuning",{"tool":82,"command":83},"pnpm","pnpm dlx skills add Dicklesworthstone\u002Fpi_agent_rust --skill speak-cost-tuning","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Fplugins-community\u002Fplugins\u002Fsaas-packs\u002Fspeak-pack\u002Fskills\u002Fspeak-cost-tuning\u002FSKILL.md",true,[],[88,127,152,178,205,227],{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":92,"licenseFileUrl":93,"sourceHtmlUrl":94,"categories":95,"keywords":99,"publishedAt":55},"01M6FEGPPK0ZTKCCM0R3E3KS33","web-artifacts-builder","Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn\u002Fui). Use for complex artifacts requiring state management, routing, or shadcn\u002Fui components - not for simple single-file HTML\u002FJSX artifacts.","Apache-2.0","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Futilities\u002Fweb-artifacts-builder\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Futilities\u002Fweb-artifacts-builder\u002FSKILL.md",[96],{"categoryNo":97,"categoryName":98,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000009","前端开发",[100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126],"web artifacts builder","web","artifacts","artifacts builder","builder","frontend","css","components","react","component","routing","state management","state","shadcn","file","ui","Tools","Tailwind","use","html","single-file","simple","ui components","multi","for","jsx","suite",{"skillNo":128,"name":129,"nameZh":6,"description":130,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":92,"licenseFileUrl":131,"sourceHtmlUrl":132,"categories":133,"keywords":138,"publishedAt":55},"01M6FEE9VTK1W4GY21AKREJXRG","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fsecurity\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fsecurity\u002Fwebapp-testing\u002FSKILL.md",[134,137],{"categoryNo":135,"categoryName":136,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000008","测试与质量",{"categoryNo":97,"categoryName":98,"taxonomyType":21,"taxonomyTypeDesc":22},[139,140,141,105,142,143,101,144,145,146,115,147,148,149,150,151,124],"testing","webapp testing","webapp","screenshots","playwright","debugging","toolkit","browser","logs","applications","behavior","local","with",{"skillNo":153,"name":154,"nameZh":6,"description":155,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":156,"sourceHtmlUrl":157,"categories":158,"keywords":159,"publishedAt":55},"01M6FE20F7ZTQBFWKF4MPJ2SBX","neuropixels-analysis","Neuropixels neural recording analysis. Load SpikeGLX\u002FOpenEphys data, preprocess, motion correction, Kilosort4 spike sorting, quality metrics, Allen\u002FIBL curation, AI-assisted visual analysis, for Neuropixels 1.0\u002F2.0 extracellular electrophysiology. Use when working with neural recordings, spike sorting, extracellular electrophysiology, or when the user mentions Neuropixels, SpikeGLX, Open Ephys, Kilosort, quality metrics, or unit curation.","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fscientific\u002Fneuropixels-analysis\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fscientific\u002Fneuropixels-analysis\u002FSKILL.md",[],[160,161,162,163,164,165,166,167,118,168,169,170,171,172,173,174,151,175,176,177,124,37],"analysis","neuropixels analysis","spike","metrics","data","open","quality","user","recordings","Neural","motion","visual","quality metrics","unit","sorting","curation","recording","load",{"skillNo":179,"name":180,"nameZh":6,"description":181,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":92,"licenseFileUrl":182,"sourceHtmlUrl":183,"categories":184,"keywords":188,"publishedAt":55},"01M6FDP0PDK6F1GGX395C7625Z","skill-creator","Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fproductivity\u002Fskill-creator\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fproductivity\u002Fskill-creator\u002FSKILL.md",[185],{"categoryNo":186,"categoryName":187,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发",[189,190,191,192,193,194,195,196,197,198,199,200,201,202,151,124,203,37,204],"skill creator","creator","workflows","create","update","capabilities","knowledge","tool","integrations","specialized","guide","new skill","existing skill","users","Existing","new",{"skillNo":206,"name":207,"nameZh":6,"description":208,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":209,"sourceHtmlUrl":210,"categories":211,"keywords":213,"publishedAt":55},"01M6FDM8Y7VK7NYG9SM7QPA3PW","notebooklm","Use this skill to query your Google NotebookLM notebooks directly from Claude Code for source-grounded, citation-backed answers from Gemini. Browser automation, library management, persistent auth. Drastically reduced hallucinations through document-only responses.","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fproductivity\u002Fnotebooklm\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fproductivity\u002Fnotebooklm\u002FSKILL.md",[212],{"categoryNo":186,"categoryName":187,"taxonomyType":21,"taxonomyTypeDesc":22},[207,214,215,216,217,218,219,146,220,221,118,222,223,224,225,124,226],"google","browser automation","gemini","automation","auth","code","library","management","only","document","query","Citation","source",{"skillNo":228,"name":229,"nameZh":6,"description":230,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":92,"licenseFileUrl":231,"sourceHtmlUrl":232,"categories":233,"keywords":240,"publishedAt":55},"01M6FDHPXE10J3XGTCH5HBHS1M","slack-gif-creator","Knowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like \"make me a GIF of X doing Y for Slack.\"","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fenterprise-communication\u002Fslack-gif-creator\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fenterprise-communication\u002Fslack-gif-creator\u002FSKILL.md",[234,237],{"categoryNo":235,"categoryName":236,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000005","邮件与沟通",{"categoryNo":238,"categoryName":239,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000016","图像与多媒体",[241,242,243,190,244,116,245,246,195,118,247,202,248,249,250,124,251,37],"slack gif creator","slack","gif","validation","constraints","Animation","me","make","Utilities","concepts","request"]