abridge-local-dev-loop
Configure Abridge local development with FHIR server, synthetic data, and hot reload. Use when setting up a development environment for clinical AI integration, testing encounter workflows locally, or iterating on EHR integration code. Trigger: "abridge local dev", "abridge dev setup", "abridge test locally".
What this skill does
# Abridge Local Dev Loop
## Overview
Local development workflow for Abridge clinical AI integrations. Uses a local HAPI FHIR server for EHR simulation, synthetic patient data from Synthea, and Abridge sandbox APIs. Never use real PHI in development.
## Prerequisites
- Completed `abridge-install-auth` setup
- Docker installed (for local FHIR server)
- Node.js 18+ with TypeScript
- Abridge sandbox credentials
## Instructions
### Step 1: Start Local FHIR Server
```bash
# Run HAPI FHIR R4 server locally
docker run -d --name hapi-fhir \
-p 8080:8080 \
-e hapi.fhir.default_encoding=json \
hapiproject/hapi:latest
# Verify
curl -s http://localhost:8080/fhir/metadata | jq '.fhirVersion'
# → "4.0.1"
# Seed synthetic patient
curl -X POST http://localhost:8080/fhir/Patient \
-H "Content-Type: application/fhir+json" \
-d '{"resourceType":"Patient","name":[{"given":["Jane"],"family":"Doe"}],"birthDate":"1985-03-15","gender":"female"}'
```
### Step 2: Create Dev Environment Configuration
```typescript
// src/config/dev.ts
interface DevConfig {
abridge: { baseUrl: string; clientSecret: string; orgId: string };
fhir: { baseUrl: string };
fixtures: { transcriptsDir: string };
}
const devConfig: DevConfig = {
abridge: {
baseUrl: process.env.ABRIDGE_SANDBOX_URL || 'https://sandbox.api.abridge.com/v1',
clientSecret: process.env.ABRIDGE_CLIENT_SECRET!,
orgId: process.env.ABRIDGE_ORG_ID!,
},
fhir: { baseUrl: 'http://localhost:8080/fhir' },
fixtures: { transcriptsDir: './fixtures/transcripts' },
};
export default devConfig;
```
### Step 3: Build Transcript Fixtures
```typescript
// fixtures/transcripts/index.ts
export const CARDIOLOGY_VISIT = {
specialty: 'cardiology',
segments: [
{ speaker: 'provider', text: 'I see you are here for a blood pressure follow-up.', timestamp_ms: 0 },
{ speaker: 'patient', text: 'Yes, I have been taking the lisinopril like you prescribed.', timestamp_ms: 3500 },
{ speaker: 'provider', text: 'Your BP today is 138 over 85. Better, but still elevated. Let us increase lisinopril from 10 to 20mg.', timestamp_ms: 7200 },
{ speaker: 'patient', text: 'Okay. Should I be worried?', timestamp_ms: 15000 },
{ speaker: 'provider', text: 'Not at all. Come back in four weeks.', timestamp_ms: 18000 },
],
};
export const DERMATOLOGY_VISIT = {
specialty: 'dermatology',
segments: [
{ speaker: 'provider', text: 'What brings you in today?', timestamp_ms: 0 },
{ speaker: 'patient', text: 'I have this mole on my back that has been changing color.', timestamp_ms: 2500 },
{ speaker: 'provider', text: 'How long has it been changing? Any itching or bleeding?', timestamp_ms: 5000 },
{ speaker: 'patient', text: 'About three months. It itches sometimes.', timestamp_ms: 8000 },
{ speaker: 'provider', text: 'The borders look irregular. I want to do a biopsy today.', timestamp_ms: 12000 },
],
};
```
### Step 4: Dev Test Runner with Watch Mode
```typescript
// src/dev/test-encounter.ts
import devConfig from '../config/dev';
import { CARDIOLOGY_VISIT } from '../../fixtures/transcripts';
import axios from 'axios';
async function runDevEncounter() {
const api = axios.create({
baseURL: devConfig.abridge.baseUrl,
headers: {
'Authorization': `Bearer ${devConfig.abridge.clientSecret}`,
'X-Org-Id': devConfig.abridge.orgId,
},
});
const { data: session } = await api.post('/encounters/sessions', {
patient_id: 'demo-patient-001',
provider_id: 'demo-provider-001',
encounter_type: 'outpatient',
specialty: CARDIOLOGY_VISIT.specialty,
sandbox: true,
});
for (const seg of CARDIOLOGY_VISIT.segments) {
await api.post(`/encounters/sessions/${session.session_id}/transcript`, seg);
}
await api.post(`/encounters/sessions/${session.session_id}/finalize`);
// Poll for note
for (let i = 0; i < 30; i++) {
const { data } = await api.get(`/encounters/sessions/${session.session_id}/note`);
if (data.status === 'completed') {
console.log(JSON.stringify(data.note.sections, null, 2));
// Push to local FHIR
await axios.post(`${devConfig.fhir.baseUrl}/DocumentReference`, {
resourceType: 'DocumentReference',
status: 'current',
content: [{ attachment: { contentType: 'text/plain', data: Buffer.from(JSON.stringify(data.note.sections)).toString('base64') } }],
});
console.log('Note pushed to local FHIR server');
return;
}
await new Promise(r => setTimeout(r, 2000));
}
}
runDevEncounter().catch(console.error);
```
### Step 5: Package Scripts
```json
{
"scripts": {
"dev:fhir": "docker start hapi-fhir 2>/dev/null || docker run -d --name hapi-fhir -p 8080:8080 hapiproject/hapi:latest",
"dev:encounter": "tsx watch src/dev/test-encounter.ts",
"dev:all": "npm run dev:fhir && npm run dev:encounter",
"test:fixtures": "vitest run --grep 'fixture'"
}
}
```
## Output
- Local HAPI FHIR R4 server on port 8080
- Synthetic patient data seeded
- Specialty-specific transcript fixtures
- Watch-mode dev loop with live note generation
## Error Handling
| Error | Cause | Solution |
|-------|-------|----------|
| Docker port conflict | Port 8080 in use | `docker stop hapi-fhir && docker rm hapi-fhir` |
| Sandbox rate limit | Too many test sessions | Wait 60s between test runs |
| FHIR validation error | Malformed resource | Validate against FHIR R4 schema |
## Resources
- [HAPI FHIR Server](https://hapifhir.io/)
- [Synthea Patient Generator](https://synthetichealth.github.io/synthea/)
## Next Steps
For reusable SDK patterns, see `abridge-sdk-patterns`.
Related 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.