Skip to content
Skillv1.0.0

speak-local-dev-loop

Configure Speak local development with mocked tutors and audio testing. Use when setting up a development environment, configuring test workflows, or building language learning features locally. Trigg

by jeremylongshore(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from jeremylongshore/tons-of-skills-marketplace (skills/.curated/speak-local-dev-loop/SKILL.md). Install upstream with npx skills add jeremylongshore/tons-of-skills-marketplace --skill speak-local-dev-loop. Copyright stays with the author (MIT).

Speak Local Dev Loop

Overview

Set up a fast local development workflow for Speak language learning integrations. Includes mock tutor responses for offline development, audio test fixtures, and a debug mode for scoring analysis.

Prerequisites

  • Completed speak-install-auth setup
  • Node.js 18+ with npm/pnpm
  • ffmpeg installed (for audio conversion)

Instructions

Step 1: Project Structure

speak-app/
  src/
    speak/client.ts       # Speak API client
    speak/tutor.ts        # AI tutor conversation manager
    speak/pronunciation.ts # Pronunciation assessment
    speak/audio.ts        # Audio recording and preprocessing
  tests/
    mocks/                # Mock responses for offline dev
    fixtures/             # Sample audio files for testing
    unit/                 # Unit tests with mocked API
    integration/          # Integration tests (needs API key)
  .env.development        # Dev credentials
  .env.test              # Test credentials (mock mode)

Step 2: Mock Tutor for Offline Development

// tests/mocks/mock-speak-client.ts
export class MockSpeakClient {
  async startConversation(config: any) {
    return {
      id: 'mock-session-123',
      firstPrompt: {
        text: 'Hola! Bienvenido. Como te llamas?',
        audioUrl: null,
      },
    };
  }

  async sendTurn(sessionId: string, input: any) {
    return {
      tutorText: 'Muy bien! Tu pronunciacion es buena.',
      pronunciationScore: 85,
      corrections: [],
      vocabularyNotes: ['llamo = I call myself'],
    };
  }

  async assessPronunciation(config: any) {
    return {
      score: 82,
      words: [
        { text: 'Hola', score: 95, phonemes: [] },
        { text: 'como', score: 78, phonemes: [
          { symbol: 'o', score: 65, suggestion: 'Round lips more' }
        ]},
      ],
    };
  }
}

Step 3: Audio Test Fixtures

# Generate test audio files using text-to-speech
# macOS:
say -v "Paulina" "Hola, como estas" -o tests/fixtures/hola-es.wav
# Linux:
espeak -v es "Hola, como estas" -w tests/fixtures/hola-es.wav

# Convert to required format
ffmpeg -i tests/fixtures/hola-es.wav -ar 16000 -ac 1 tests/fixtures/hola-es-16k.wav

Step 4: Development Scripts

{
  "scripts": {
    "dev": "tsx watch src/index.ts",
    "dev:mock": "SPEAK_MOCK_MODE=true tsx watch src/index.ts",
    "test": "vitest run",
    "test:watch": "vitest",
    "lesson:test": "tsx src/test-lesson.ts"
  }
}

Step 5: Debug Mode

// Enable detailed scoring output
const DEBUG = process.env.SPEAK_DEBUG === 'true';

function logAssessment(result: PronunciationResult) {
  if (!DEBUG) return;
  console.log('=== Pronunciation Debug ===');
  for (const word of result.words) {
    const flag = word.score < 70 ? 'WEAK' : 'OK';
    console.log(`  [${flag}] "${word.text}": ${word.score}/100`);
    for (const p of word.phonemes || []) {
      if (p.score < 70) {
        console.log(`    phoneme "${p.symbol}": ${p.score} - ${p.suggestion}`);
      }
    }
  }
}

Output

  • Project structure with client, tests, and mocks
  • Mock tutor client for offline development
  • Audio test fixtures generated with TTS
  • Debug mode for pronunciation analysis
  • Development scripts for fast iteration

Error Handling

Error Cause Solution
ffmpeg not found Not installed Install via brew install ffmpeg or apt install ffmpeg
Mock mode not activating Env var not set Check SPEAK_MOCK_MODE=true
Audio file too large Long recording Trim to 30 seconds max for testing
Test timeout Slow API response Use mock mode for unit tests

Resources

Next Steps

See speak-sdk-patterns for production-ready code patterns.

Examples

Mock-first development: Run npm run dev:mock to iterate on UI and conversation flow without API calls. Switch to real API for integration testing.

Audio quality testing: Record samples at different quality levels and compare pronunciation scores to calibrate your recording pipeline.

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/jeremylongshore-tons-of-skills-marketplace-speak-local-dev-loop/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

jeremylongshore-tons-of-skills-marketplace-speak-local-dev-loop.ocm.jsonjson
{
  "ocm": "1",
  "id": "jeremylongshore-tons-of-skills-marketplace-speak-local-dev-loop",
  "kind": "skill",
  "name": "speak-local-dev-loop",
  "description": "Configure Speak local development with mocked tutors and audio testing. Use when setting up a development environment, configuring test workflows, or building language learning features locally. Trigger with phrases like \"speak dev setup\", \"speak local development\", \"speak dev environment\", \"develop with speak\".",
  "publisher": "jeremylongshore",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "general"
    ],
    "tags": [
      "skill-md",
      "saas",
      "speak",
      "testing",
      "workflow",
      "skills-sh"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Configure Speak local development with mocked tutors and audio testing. Use when setting up a development environment, configuring test workflows, or building language learning features locally. Trigger with phrases like \"speak dev setup\", \"speak local development\", \"speak dev environment\", \"develop with speak\"."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "skills.sh",
      "repository": "https://github.com/jeremylongshore/tons-of-skills-marketplace",
      "path": "skills/.curated/speak-local-dev-loop/SKILL.md",
      "ref": "HEAD",
      "url": "https://github.com/jeremylongshore/tons-of-skills-marketplace/blob/HEAD/skills/.curated/speak-local-dev-loop/SKILL.md",
      "key": "jeremylongshore/tons-of-skills-marketplace/skills/.curated/speak-local-dev-loop/SKILL.md"
    },
    "compatibility": "Designed for Claude Code",
    "allowed_tools": [
      "Read,",
      "Write,",
      "Edit,",
      "Bash(npm:*),",
      "Bash(pnpm:*),",
      "Grep"
    ],
    "license": "MIT"
  },
  "instructions": "# Speak Local Dev Loop\n\n## Overview\n\nSet up a fast local development workflow for Speak language learning integrations. Includes mock tutor responses for offline development, audio test fixtures, and a debug mode for scoring analysis.\n\n## Prerequisites\n\n- Completed `speak-install-auth` setup\n- Node.js 18+ with npm/pnpm\n- ffmpeg installed (for audio conversion)\n\n## Instructions\n\n### Step 1: Project Structure\n\n```\nspeak-app/\n  src/\n    speak/client.ts       # Speak API client\n    speak/tutor.ts        # AI tutor conversation manager\n    speak/pronunciation.ts # Pronunciation assessment\n    speak",
  "cost": {
    "context_tokens": 1061
  }
}

Fetch it by URL: GET /api/v1/registry/jeremylongshore-tons-of-skills-marketplace-speak-local-dev-loop/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.