twinmind-debug-bundle
Collect comprehensive diagnostic information for TwinMind issues. Use when preparing support requests, investigating complex problems, or gathering evidence for bug reports. Trigger with phrases like "twinmind debug", "twinmind diagnostics", "collect twinmind info", "twinmind support bundle".
What this skill does
# TwinMind Debug Bundle
## Current State
!`node --version 2>/dev/null || echo 'N/A'`
!`python3 --version 2>/dev/null || echo 'N/A'`
!`uname -a`
## Overview
Collect comprehensive diagnostic data to troubleshoot TwinMind issues.
## Prerequisites
- TwinMind extension or API configured
- Access to browser developer tools
- Command-line access (for API debugging)
## Instructions
### Step 1: Create Debug Bundle Script
```typescript
// scripts/twinmind-debug-bundle.ts
import * as fs from 'fs';
import * as os from 'os';
import * as path from 'path';
interface DebugBundle {
timestamp: string;
environment: EnvironmentInfo;
apiStatus: ApiStatus;
recentErrors: ErrorEntry[];
configuration: ConfigSnapshot;
networkTests: NetworkTest[];
}
interface EnvironmentInfo {
nodeVersion: string;
platform: string;
arch: string;
osRelease: string;
timezone: string;
memory: {
total: number;
free: number;
used: number;
};
}
interface ApiStatus {
healthy: boolean;
latencyMs: number;
endpoint: string;
responseHeaders?: Record<string, string>;
}
interface ErrorEntry {
timestamp: string;
type: string;
message: string;
stack?: string;
context?: Record<string, any>;
}
interface ConfigSnapshot {
apiKeyPresent: boolean;
apiKeyPrefix: string;
baseUrl: string;
timeout: number;
environment: string;
}
interface NetworkTest {
endpoint: string;
reachable: boolean;
latencyMs?: number;
error?: string;
}
export async function generateDebugBundle(): Promise<DebugBundle> {
const bundle: DebugBundle = {
timestamp: new Date().toISOString(),
environment: getEnvironmentInfo(),
apiStatus: await checkApiStatus(),
recentErrors: collectRecentErrors(),
configuration: getConfigSnapshot(),
networkTests: await runNetworkTests(),
};
return bundle;
}
function getEnvironmentInfo(): EnvironmentInfo {
return {
nodeVersion: process.version,
platform: os.platform(),
arch: os.arch(),
osRelease: os.release(),
timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
memory: {
total: os.totalmem(),
free: os.freemem(),
used: os.totalmem() - os.freemem(),
},
};
}
async function checkApiStatus(): Promise<ApiStatus> {
const endpoint = process.env.TWINMIND_API_URL || 'https://api.twinmind.com/v1';
const start = Date.now();
try {
const response = await fetch(`${endpoint}/health`, {
headers: {
'Authorization': `Bearer ${process.env.TWINMIND_API_KEY}`,
},
});
return {
healthy: response.ok,
latencyMs: Date.now() - start,
endpoint,
responseHeaders: Object.fromEntries(response.headers.entries()),
};
} catch (error: any) {
return {
healthy: false,
latencyMs: Date.now() - start,
endpoint,
};
}
}
function collectRecentErrors(): ErrorEntry[] {
// In a real implementation, this would read from error logs
// For now, return empty array
return [];
}
function getConfigSnapshot(): ConfigSnapshot {
const apiKey = process.env.TWINMIND_API_KEY || '';
return {
apiKeyPresent: apiKey.length > 0,
apiKeyPrefix: apiKey.substring(0, 8) + '...',
baseUrl: process.env.TWINMIND_API_URL || 'https://api.twinmind.com/v1',
timeout: parseInt(process.env.TWINMIND_TIMEOUT || '30000'), # 30000: 30 seconds in ms
environment: process.env.NODE_ENV || 'development',
};
}
async function runNetworkTests(): Promise<NetworkTest[]> {
const endpoints = [
'https://api.twinmind.com',
'',
'https://twinmind.com',
];
const tests: NetworkTest[] = [];
for (const endpoint of endpoints) {
const start = Date.now();
try {
const response = await fetch(endpoint, { method: 'HEAD' });
tests.push({
endpoint,
reachable: response.ok,
latencyMs: Date.now() - start,
});
} catch (error: any) {
tests.push({
endpoint,
reachable: false,
error: error.message,
});
}
}
return tests;
}
// Save bundle to file
export async function saveDebugBundle(outputPath?: string): Promise<string> {
const bundle = await generateDebugBundle();
const filename = outputPath || path.join(
os.tmpdir(),
`twinmind-debug-${Date.now()}.json`
);
fs.writeFileSync(filename, JSON.stringify(bundle, null, 2));
console.log(`Debug bundle saved to: ${filename}`);
return filename;
}
```
### Step 2: Run Debug Bundle Collection
```bash
set -euo pipefail
# Using the script
npx ts-node scripts/twinmind-debug-bundle.ts
# Or quick CLI commands:
# Check API health
curl -w "\nLatency: %{time_total}s\n" \
-H "Authorization: Bearer $TWINMIND_API_KEY" \
https://api.twinmind.com/v1/health
# Check account status
curl -H "Authorization: Bearer $TWINMIND_API_KEY" \
https://api.twinmind.com/v1/me | jq
# Check rate limit status
curl -I -H "Authorization: Bearer $TWINMIND_API_KEY" \
https://api.twinmind.com/v1/health 2>/dev/null | grep -i ratelimit
# Test transcription endpoint
curl -X POST \
-H "Authorization: Bearer $TWINMIND_API_KEY" \
-H "Content-Type: application/json" \
-d '{"audio_url":"https://example.com/test.mp3"}' \
https://api.twinmind.com/v1/transcribe
```
### Step 3: Browser Extension Debugging
```javascript
// Open Chrome DevTools (F12) on any TwinMind page
// Console commands for debugging:
// Check extension version
chrome.runtime.getManifest().version
// Check stored data
chrome.storage.local.get(null, console.log)
// Check permissions
navigator.permissions.query({name: 'microphone'}).then(console.log)
// Check audio devices
navigator.mediaDevices.enumerateDevices().then(devices => {
console.log('Audio devices:', devices.filter(d => d.kind === 'audioinput'))
})
// Check extension errors
// Go to: chrome://extensions > TwinMind > Errors
```
### Step 4: Collect Network HAR File
```
1. Open Chrome DevTools (F12)
2. Go to Network tab
3. Check "Preserve log"
4. Reproduce the issue
5. Right-click > Save all as HAR with content
```
### Step 5: Generate Full Debug Report
```typescript
// scripts/full-debug-report.ts
import { generateDebugBundle } from './twinmind-debug-bundle';
async function generateFullReport() {
const bundle = await generateDebugBundle();
const report = `
# TwinMind Debug Report
Generated: ${bundle.timestamp}
## Environment
- Node: ${bundle.environment.nodeVersion}
- Platform: ${bundle.environment.platform} (${bundle.environment.arch})
- OS: ${bundle.environment.osRelease}
- Timezone: ${bundle.environment.timezone}
- Memory: ${Math.round(bundle.environment.memory.used / 1024 / 1024)}MB / ${Math.round(bundle.environment.memory.total / 1024 / 1024)}MB # 1024: 1 KB
## API Status
- Healthy: ${bundle.apiStatus.healthy ? 'Yes' : 'No'}
- Latency: ${bundle.apiStatus.latencyMs}ms
- Endpoint: ${bundle.apiStatus.endpoint}
## Configuration
- API Key Present: ${bundle.configuration.apiKeyPresent}
- API Key Prefix: ${bundle.configuration.apiKeyPrefix}
- Base URL: ${bundle.configuration.baseUrl}
- Timeout: ${bundle.configuration.timeout}ms
- Environment: ${bundle.configuration.environment}
## Network Tests
${bundle.networkTests.map(t =>
`- ${t.endpoint}: ${t.reachable ? `OK (${t.latencyMs}ms)` : `FAILED - ${t.error}`}`
).join('\n')}
## Recent Errors
${bundle.recentErrors.length === 0 ? 'No recent errors' :
bundle.recentErrors.map(e =>
`- [${e.timestamp}] ${e.type}: ${e.message}`
).join('\n')
}
## Troubleshooting Steps Taken
[ ] Verified API key is valid
[ ] Checked microphone permissions
[ ] Tested network connectivity
[ ] Cleared browser cache/data
[ ] Disabled conflicting extensions
[ ] Reproduced in incognito mode
## Issue Description
[Describe the issue here]
## Steps to Reproduce
1. [Step 1]
2. [Step 2]
3. [Step 3]
## Expected Behavior
[What should happen]
## Actual Behavior
[What actually happens]
`;
console.log(report);
return report;
}
generateFullReport();
```
## Output
- JSON debug bundle file
- EnvironmentRelated in Code Review
gstack
IncludedFast headless browser for QA testing and site dogfooding. Navigate pages, interact with elements, verify state, diff before/after, take annotated screenshots, test responsive layouts, forms, uploads, dialogs, and capture bug evidence. Use when asked to open or test a site, verify a deployment, dogfood a user flow, or file a bug with screenshots. (gstack)
startup-due-diligence
IncludedLegal due diligence review for seed-stage and Series A startups (US, Delaware C-Corp focus). Supports both investor and founder perspectives. Capabilities include: (1) Interactive document review and issue spotting; (2) Document request list generation; (3) Cap table and SAFE/convertible note analysis; (4) Red flag identification with severity ratings; (5) Diligence report generation. TRIGGERS: due diligence, DD, startup investment, cap table review, Series A, seed round, investor diligence, legal review startup, SAFE analysis, convertible note, 409A, founder vesting.
interview-master
IncludedThis skill should be used when the user asks to "generate interview questions", "prepare for interview", "optimize resume", "conduct mock interview", "analyze git commits for resume", "generate resume from code", "review my resume", or mentions interview preparation, career assistance, or extracting project experience from git history. Provides comprehensive interview and career development guidance for both job seekers and interviewers.
fix-issue
IncludedFixes GitHub issues using parallel analysis agents for root cause investigation, code exploration, and regression detection. Reads issue context from gh CLI, searches codebase and memory for related patterns, generates a fix with tests, and links the resolution back to the issue via PR. Includes prevention analysis to avoid recurrence. Use when debugging errors, resolving regressions, fixing bugs, or triaging issues.
sf-apex
IncludedGenerates and reviews Salesforce Apex code with 150-point scoring. TRIGGER when: user writes, reviews, or fixes Apex classes, triggers, test classes, batch/queueable/schedulable jobs, or touches .cls/.trigger files. DO NOT TRIGGER when: LWC JavaScript (use sf-lwc), Flow XML (use sf-flow), SOQL-only queries (use sf-soql), or non-Salesforce code.
swift-development
IncludedComprehensive Swift development for building, testing, and deploying iOS/macOS applications. Use when Claude needs to: (1) Build Swift packages or Xcode projects from command line, (2) Run tests with XCTest or Swift Testing framework, (3) Manage iOS simulators with simctl, (4) Handle code signing, provisioning profiles, and app distribution, (5) Format or lint Swift code with SwiftFormat/SwiftLint, (6) Work with Swift Package Manager (SPM), (7) Implement Swift 6 concurrency patterns (async/await, actors, Sendable), (8) Create SwiftUI views with MVVM architecture, (9) Set up Core Data or SwiftData persistence, or any other Swift/iOS/macOS development tasks.