TW

twinmind-local-dev-loop

Configures a local environment with TypeScript and TwinMind API connectivity for rapid integration development.

Install

mkdir -p .claude/skills/twinmind-local-dev-loop && curl -L -o skill.zip "https://agentskills.codes/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

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Set up local development workflow with TwinMind API integration.
64 charsno explicit “when” trigger
Beginner

Key capabilities

  • Create a project directory and initialize a Node.js project
  • Install TypeScript, dotenv, axios, and zod dependencies
  • Configure environment variables in a .env file
  • Generate a TypeScript client for the TwinMind API
  • Set up a development runner script with health checks and examples
  • Create mock response fixtures for testing

How it works

The skill creates a project directory, initializes a Node.js project, installs necessary dependencies, and configures environment variables. It then generates a TypeScript TwinMind API client and a development runner script.

Inputs & outputs

You give it
User request to set up TwinMind API integration
You get back
A configured local development environment with TwinMind API client, environment variables, and development scripts

When to use twinmind-local-dev-loop

  • Initialize a new TwinMind integration project
  • Configure local .env files for API keys
  • Setup TypeScript boilerplate for TwinMind clients
  • Test API connectivity during local development

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.

Prerequisites

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

How it compares

This skill automates the setup of a TwinMind API development environment, unlike manual configuration which requires individual steps for project initialization, dependency installation, and client creation.

Compared to similar skills

twinmind-local-dev-loop side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
twinmind-local-dev-loop (this skill)127dCautionBeginner
write-test15moReviewAdvanced
deepgram-hello-world127dReviewBeginner
groq-hello-world127dNo flagsBeginner

Try saying

Example prompts that trigger this skill in your AI assistant.

More by jeremylongshore

View all by jeremylongshore

analyzing-logs

jeremylongshore

Analyze application logs to detect performance issues, identify error patterns, and improve stability by extracting key insights.

14123

ollama-setup

jeremylongshore

Configure auto-configure Ollama when user needs local LLM deployment, free AI alternatives, or wants to eliminate hosted API costs. Trigger phrases: "install ollama", "local AI", "free LLM", "self-hosted AI", "replace OpenAI", "no API costs". Use when appropriate context detected. Trigger with relevant phrases based on skill purpose.

1167

backtesting-trading-strategies

jeremylongshore

Backtest crypto and traditional trading strategies against historical data. Calculates performance metrics (Sharpe, Sortino, max drawdown), generates equity curves, and optimizes strategy parameters. Use when user wants to test a trading strategy, validate signals, or compare approaches. Trigger with phrases like "backtest strategy", "test trading strategy", "historical performance", "simulate trades", "optimize parameters", or "validate signals".

1071

generating-database-seed-data

jeremylongshore

Process this skill enables AI assistant to generate realistic test data and database seed scripts for development and testing environments. it uses faker libraries to create realistic data, maintains relational integrity, and allows configurable data volumes. u... Use when working with databases or data models. Trigger with phrases like 'database', 'query', or 'schema'.

1033

cursor-codebase-indexing

jeremylongshore

Execute set up and optimize Cursor codebase indexing. Triggers on "cursor index setup", "codebase indexing", "index codebase", "cursor semantic search". Use when working with cursor codebase indexing functionality. Trigger with phrases like "cursor codebase indexing", "cursor indexing", "cursor".

885

testing-mobile-apps

jeremylongshore

Execute mobile app testing on iOS and Android devices/simulators. Use when performing specialized testing. Trigger with phrases like "test mobile app", "run iOS tests", or "validate Android functionality".

810

You might also like

write-test

useautumn

Write integration tests for the Autumn billing system. Use when creating tests, writing test scenarios for billing/subscription features, track/check endpoints, or when the user asks about testing, test cases, or QA.

12

deepgram-hello-world

jeremylongshore

Create a minimal working Deepgram transcription example. Use when starting a new Deepgram integration, testing your setup, or learning basic Deepgram API patterns. Trigger with phrases like "deepgram hello world", "deepgram example", "deepgram quick start", "simple transcription", "transcribe audio".

11

groq-hello-world

jeremylongshore

Create a minimal working Groq example. Use when starting a new Groq integration, testing your setup, or learning basic Groq API patterns. Trigger with phrases like "groq hello world", "groq example", "groq quick start", "simple groq code".

11

speak-hello-world

jeremylongshore

Create a minimal working Speak language learning example. Use when starting a new Speak integration, testing your setup, or learning basic Speak API patterns for language tutoring. Trigger with phrases like "speak hello world", "speak example", "speak quick start", "simple speak lesson".

01

exa-local-dev-loop

jeremylongshore

Configure Exa local development with hot reload and testing. Use when setting up a development environment, configuring test workflows, or establishing a fast iteration cycle with Exa. Trigger with phrases like "exa dev setup", "exa local development", "exa dev environment", "develop with exa".

00

instantly-local-dev-loop

jeremylongshore

Configure Instantly local development with hot reload and testing. Use when setting up a development environment, configuring test workflows, or establishing a fast iteration cycle with Instantly. Trigger with phrases like "instantly dev setup", "instantly local development", "instantly dev environment", "develop with instantly".

00

Search skills

Search the agent skills registry