twinmind-local-dev-loop

1
0
Source

Set up local development workflow with TwinMind API integration. Use when building applications that integrate TwinMind transcription, testing API calls locally, or developing meeting automation tools. Trigger with phrases like "twinmind dev setup", "twinmind local development", "twinmind API testing", "build with twinmind".

Install

mkdir -p .claude/skills/twinmind-local-dev-loop && curl -L -o skill.zip "https://mcp.directory/api/skills/download/6327" && unzip -o skill.zip -d .claude/skills/twinmind-local-dev-loop && rm skill.zip

Installs to .claude/skills/twinmind-local-dev-loop

About this skill

TwinMind Local Dev Loop

Overview

Configure a productive local development environment for TwinMind API integration.

Prerequisites

  • TwinMind Pro or Enterprise account (API access)
  • Node.js 18+ or Python 3.10+
  • API key from TwinMind dashboard
  • Local development environment

Instructions

Step 1: Project Setup

set -euo pipefail
# Create project directory
mkdir twinmind-integration && cd twinmind-integration

# Initialize Node.js project
npm init -y

# Install dependencies
npm install dotenv axios zod typescript ts-node @types/node

# Initialize TypeScript
npx tsc --init

Step 2: Configure Environment

# Create environment file
cat > .env << 'EOF'
TWINMIND_API_KEY=your-api-key-here
TWINMIND_API_URL=https://api.twinmind.com/v1
TWINMIND_WEBHOOK_SECRET=your-webhook-secret
NODE_ENV=development
EOF

# Add to .gitignore
echo ".env" >> .gitignore
echo "node_modules" >> .gitignore

Step 3: Create TwinMind Client

// src/twinmind/client.ts
import axios, { AxiosInstance } from 'axios';
import { z } from 'zod';

// Response schemas
const TranscriptSchema = z.object({
  id: z.string(),
  text: z.string(),
  duration_seconds: z.number(),
  language: z.string(),
  speakers: z.array(z.object({
    id: z.string(),
    name: z.string().optional(),
    segments: z.array(z.object({
      start: z.number(),
      end: z.number(),
      text: z.string(),
      confidence: z.number(),
    })),
  })),
  created_at: z.string(),
});

const SummarySchema = z.object({
  id: z.string(),
  transcript_id: z.string(),
  summary: z.string(),
  action_items: z.array(z.object({
    text: z.string(),
    assignee: z.string().optional(),
    due_date: z.string().optional(),
  })),
  key_points: z.array(z.string()),
});

export type Transcript = z.infer<typeof TranscriptSchema>;
export type Summary = z.infer<typeof SummarySchema>;

export class TwinMindClient {
  private client: AxiosInstance;

  constructor(apiKey: string, baseUrl?: string) {
    this.client = axios.create({
      baseURL: baseUrl || 'https://api.twinmind.com/v1',
      headers: {
        'Authorization': `Bearer ${apiKey}`,
        'Content-Type': 'application/json',
      },
      timeout: 30000,  # 30000: 30 seconds in ms
    });
  }

  async healthCheck(): Promise<boolean> {
    const response = await this.client.get('/health');
    return response.status === 200;  # HTTP 200 OK
  }

  async transcribe(audioUrl: string, options?: {
    language?: string;
    diarization?: boolean;
    model?: 'ear-3' | 'ear-2';
  }): Promise<Transcript> {
    const response = await this.client.post('/transcribe', {
      audio_url: audioUrl,
      language: options?.language || 'auto',
      diarization: options?.diarization ?? true,
      model: options?.model || 'ear-3',
    });
    return TranscriptSchema.parse(response.data);
  }

  async summarize(transcriptId: string): Promise<Summary> {
    const response = await this.client.post('/summarize', {
      transcript_id: transcriptId,
    });
    return SummarySchema.parse(response.data);
  }

  async search(query: string, options?: {
    limit?: number;
    date_from?: string;
    date_to?: string;
  }): Promise<Transcript[]> {
    const response = await this.client.get('/search', {
      params: {
        q: query,
        limit: options?.limit || 10,
        date_from: options?.date_from,
        date_to: options?.date_to,
      },
    });
    return z.array(TranscriptSchema).parse(response.data.results);
  }
}

Step 4: Create Dev Runner Script

// src/dev.ts
import 'dotenv/config';
import { TwinMindClient } from './twinmind/client';

async function main() {
  const client = new TwinMindClient(process.env.TWINMIND_API_KEY!);

  // Health check
  console.log('Checking TwinMind API health...');
  const healthy = await client.healthCheck();
  console.log(`API Status: ${healthy ? 'Healthy' : 'Unhealthy'}`);

  // Example: Transcribe audio file
  // const transcript = await client.transcribe('https://example.com/meeting.mp3');
  // console.log('Transcript:', transcript);

  // Example: Generate summary
  // const summary = await client.summarize(transcript.id);
  // console.log('Summary:', summary);

  // Example: Search memory vault
  // const results = await client.search('budget review');
  // console.log('Search results:', results);
}

main().catch(console.error);

Step 5: Configure Dev Scripts

// package.json scripts
{
  "scripts": {
    "dev": "ts-node src/dev.ts",
    "build": "tsc",
    "test": "jest",
    "lint": "eslint src/**/*.ts",
    "typecheck": "tsc --noEmit"
  }
}

Step 6: Create Test Fixtures

// tests/fixtures/mock-responses.ts
export const mockTranscript = {
  id: 'tr_test_123',
  text: 'Welcome to the meeting. Today we discuss the project timeline.',
  duration_seconds: 45,
  language: 'en',
  speakers: [
    {
      id: 'spk_1',
      name: 'Host',
      segments: [
        {
          start: 0,
          end: 5.2,
          text: 'Welcome to the meeting.',
          confidence: 0.97,
        },
        {
          start: 5.5,
          end: 12.1,
          text: 'Today we discuss the project timeline.',
          confidence: 0.95,
        },
      ],
    },
  ],
  created_at: '2025-01-15T10:00:00Z',  # 2025 year
};

export const mockSummary = {
  id: 'sum_test_456',
  transcript_id: 'tr_test_123',
  summary: 'Brief meeting to discuss project timeline and milestones.',
  action_items: [
    {
      text: 'Review timeline document',
      assignee: 'John',
      due_date: '2025-01-20',
    },
  ],
  key_points: [
    'Project kickoff confirmed',
    'Timeline review scheduled',
  ],
};

Step 7: Run Development Loop

set -euo pipefail
# Start development
npm run dev

# Watch mode (requires nodemon)
npm install -D nodemon
npx nodemon --exec ts-node src/dev.ts

# Run with debug logging
DEBUG=twinmind:* npm run dev

Output

  • Project structure with TypeScript configuration
  • TwinMind client with type-safe schemas
  • Environment configuration
  • Development scripts
  • Test fixtures for offline development

Error Handling

ErrorCauseSolution
API key missing.env not loadedCheck dotenv import
Connection refusedWrong API URLVerify TWINMIND_API_URL
Rate limitedToo many requestsAdd delay between calls
Schema validation failedAPI response changedUpdate Zod schemas
TimeoutLarge audio fileIncrease timeout value

Project Structure

twinmind-integration/
├── src/
│   ├── twinmind/
│   │   ├── client.ts       # API client
│   │   ├── types.ts        # TypeScript types
│   │   └── errors.ts       # Error classes
│   ├── services/
│   │   └── meeting.ts      # Business logic
│   └── dev.ts              # Development entry
├── tests/
│   ├── fixtures/
│   │   └── mock-responses.ts
│   └── twinmind.test.ts
├── .env                    # Environment (gitignored)
├── .env.example            # Template
├── package.json
└── tsconfig.json

Resources

Next Steps

Apply patterns in twinmind-sdk-patterns for production-ready code.

Examples

Basic usage: Apply twinmind local dev loop to a standard project setup with default configuration options.

Advanced scenario: Customize twinmind local dev loop for production environments with multiple constraints and team-specific requirements.

svg-icon-generator

jeremylongshore

Svg Icon Generator - Auto-activating skill for Visual Content. Triggers on: svg icon generator, svg icon generator Part of the Visual Content skill category.

6814

d2-diagram-creator

jeremylongshore

D2 Diagram Creator - Auto-activating skill for Visual Content. Triggers on: d2 diagram creator, d2 diagram creator Part of the Visual Content skill category.

2412

performing-penetration-testing

jeremylongshore

This skill enables automated penetration testing of web applications. It uses the penetration-tester plugin to identify vulnerabilities, including OWASP Top 10 threats, and suggests exploitation techniques. Use this skill when the user requests a "penetration test", "pentest", "vulnerability assessment", or asks to "exploit" a web application. It provides comprehensive reporting on identified security flaws.

379

designing-database-schemas

jeremylongshore

Design and visualize efficient database schemas, normalize data, map relationships, and generate ERD diagrams and SQL statements.

978

performing-security-audits

jeremylongshore

This skill allows Claude to conduct comprehensive security audits of code, infrastructure, and configurations. It leverages various tools within the security-pro-pack plugin, including vulnerability scanning, compliance checking, cryptography review, and infrastructure security analysis. Use this skill when a user requests a "security audit," "vulnerability assessment," "compliance review," or any task involving identifying and mitigating security risks. It helps to ensure code and systems adhere to security best practices and compliance standards.

86

django-view-generator

jeremylongshore

Generate django view generator operations. Auto-activating skill for Backend Development. Triggers on: django view generator, django view generator Part of the Backend Development skill category. Use when working with django view generator functionality. Trigger with phrases like "django view generator", "django generator", "django".

15

You might also like

flutter-development

aj-geddes

Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.

643969

drawio-diagrams-enhanced

jgtolentino

Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.

591705

ui-ux-pro-max

nextlevelbuilder

"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."

318398

godot

bfollington

This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.

339397

nano-banana-pro

garg-aayush

Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.

451339

fastapi-templates

wshobson

Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.

304231

Stay ahead of the MCP ecosystem

Get weekly updates on new skills and servers.