Skip to main content
skill CX Codex

hipaa-compliance · curiositech — Claude Code skill: what it does, how to install

The hipaa-compliance skill guides PHI handling with audit logging, log sanitization, and session checks. Use it when coding features that touch health data.

MIT 215 installs ★ 274 updated 2026-10-30

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add curiositech/some_claude_skills --skill hipaa-compliance -a claude-code
Open on GitHub

What hipaa-compliance does

hipaa-compliance guides the agent through HIPAA-related checks for features that access PHI. It covers reads, creates, updates, deletes, exports, administrator access, failed authentication, and security events. Check-ins, journal entries, chats, user profiles, sobriety dates, and emergency contacts are treated as PHI.

The skill points to audit helpers in src/lib/hipaa/audit.ts: logPHIAccess, logPHIModification, logSecurityEvent, and logAdminAction. It asks for identifiers and metadata instead of health-data content in audit records, and includes checks for authentication, encryption at rest, admin trails, and six-year audit retention.

Its session guidance uses a 15-minute inactivity timeout, an 8-hour absolute limit, and a 30-minute lockout after 5 failed attempts. Emergency access uses src/lib/hipaa/break-glass, with written justification and a permanent audit record. If the project does not have src/lib/hipaa/audit.ts, the logging examples need adaptation.

What it helps with

  • audit PHI reads and edits in API routes
  • keep journal content out of audit records
  • check authentication before returning health data
  • track failed logins and security events
  • add a reviewed emergency-access trail

Example prompts for the agent

  • Review this API route and log every PHI access through src/lib/hipaa/audit.ts.
  • Rewrite the journal audit payload so it keeps metadata but never stores the entry content.
  • Check the emergency access flow in src/lib/hipaa/break-glass and require a written reason.

How to install hipaa-compliance

1Skills CLI (Vercel)

npx skills add curiositech/some_claude_skills --skill hipaa-compliance -a claude-code

2Manually: put the files in place

~/.claude/skills/hipaa-compliance/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/hipaa-compliance/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about hipaa-compliance

How do I install hipaa-compliance in Claude Code?

Run npx skills add curiositech/some_claude_skills --skill hipaa-compliance -a claude-code, then check ~/.claude/skills/hipaa-compliance/SKILL.md.

What does hipaa-compliance do?

It guides HIPAA checks for PHI features, including audit trails, log sanitization, authentication, session protection, and emergency access.

Which data does the skill treat as PHI?

It includes check-ins, journal entries, chat conversations, user profiles, sobriety dates, and emergency contacts. Aggregated analytics and page views without content are treated separately.

Source text

SKILL.md · MIT
---
name: hipaa-compliance
description: Ensure HIPAA compliance when handling PHI (Protected Health Information). Use when writing code that accesses user health data, check-ins, journal entries, or any sensitive information. Activates
  for audit logging, data access, security events, and compliance questions.
allowed-tools: Read,Write,Edit
metadata:
  category: Code Quality & Testing
  tags:
  - hipaa
  - compliance
  - security
  pairs-with:
  - skill: recovery-app-legal-terms
    reason: HIPAA requirements directly inform privacy policy and terms of service content for health apps
  - skill: security-auditor
    reason: HIPAA technical safeguards overlap with security vulnerability scanning and access controls
  - skill: recovery-social-features
    reason: Social features handling health data must comply with HIPAA privacy and consent rules
  - skill: crisis-response-protocol
    reason: Crisis responses involving health disclosures must follow HIPAA breach notification rules
---

# HIPAA Compliance for Recovery Coach

This skill helps you maintain HIPAA compliance when developing features that handle Protected Health Information (PHI).

## What is PHI in This Application?

| Data Type | PHI Status | Handling |
|-----------|------------|----------|
| Check-in mood/cravings | PHI | Audit all access |
| Journal entries | PHI | Audit all access |
| Chat conversations | PHI | Audit all access |
| User profile (name, email) | PHI | Audit modifications |
| Sobriety date | PHI | Audit access |
| Emergency contacts | PHI | Audit access |
| Usage analytics (aggregated) | NOT PHI | No audit needed |
| Page views (no content) | NOT PHI | No audit needed |

## Audit Logging Requirements

### When to Log

**Always log these operations:**
- Viewing any PHI (check-ins, journal, messages)
- Creating/updating/deleting PHI
- Exporting user data
- Admin access to user information
- Failed authentication attempts
- Security events (rate limiting, unauthorized access)

### How to Log

Use the audit logging utilities in `src/lib/hipaa/audit.ts`:

```typescript
import {
  logPHIAccess,
  logPHIModification,
  logSecurityEvent,
  logAdminAction
} from '@/lib/hipaa/audit';

// Viewing PHI
await logPHIAccess(
  userId,
  'checkin',        // targetType
  checkinId,        // targetId
  AuditAction.PHI_VIEW
);

// Modifying PHI
await logPHIModification(
  userId,
  'journal',
  journalId,
  AuditAction.PHI_UPDATE,
  { field: 'content' }  // Never include actual content!
);

// Security event
await logSecurityEvent(
  userId,
  AuditAction.RATE_LIMIT,
  { path: '/api/chat', attempts: 60 }
);

// Admin action
await logAdminAction(
  adminId,
  AuditAction.ADMIN_USER_VIEW,
  'user',
  targetUserId
);
```

## Data Sanitization

### Never Log These Fields

The audit system automatically sanitizes, but be explicit:

```typescript
// BAD - Contains PHI
await logPHIAccess(userId, 'journal', id, action, {
  content: journalEntry.content  // NEVER DO THIS
});

// GOOD - Only metadata
await logPHIAccess(userId, 'journal', id, action, {
  wordCount: journalEntry.content.length,
  hasAttachments: false
});
```

### Sanitized Fields (Auto-Redacted)

- `password`, `token`, `secret`, `key`
- `authorization`, `cookie`, `session`
- `credential`, `content`, `message`, `notes`

## Session Security Requirements

From `src/lib/auth.ts`:

- **Session timeout**: 15 minutes of inactivity (HIPAA requirement)
- **Max session**: 8 hours absolute maximum
- **Failed login lockout**: 5 attempts = 30 minute ban
- **Password requirements**: 12+ chars, mixed case, numbers, special chars

## Code Patterns

### API Route with Audit Logging

```typescript
import { getSession, requireAuth } from '@/lib/auth';
import { logPHIAccess } from '@/lib/hipaa/audit';

export async function GET(request: Request) {
  const session = await getSession();
  if (!session) {
    return Response.json({ error: 'Unauthorized' }, { status: 401 });
  }

  // Fetch the data
  const data = await fetchUserData(session.userId);

  // Log the access
  await logPHIAccess(
    session.userId,
    'userdata',
    session.userId,
    AuditAction.PHI_VIEW
  );

  return Response.json(data);
}
```

### Component with PHI Access

```typescript
'use client';

import { useEffect } from 'react';

export function JournalViewer({ entryId }: { entryId: string }) {
  useEffect(() => {
    // Log view on mount (server-side preferred, but client backup)
    fetch('/api/audit/log', {
      method: 'POST',
      body: JSON.stringify({
        action: 'PHI_VIEW',
        targetType: 'journal',
        targetId: entryId
      })
    });
  }, [entryId]);

  // ... render
}
```

## Compliance Checklist

Before shipping any feature that touches PHI:

- [ ] All PHI access is audit logged
- [ ] No PHI content in logs (only IDs and metadata)
- [ ] Data access requires authentication
- [ ] Admin access has separate audit trail
- [ ] Failed access attempts are logged
- [ ] Data export includes audit entry
- [ ] Sensitive fields are encrypted at rest
- [ ] Session timeout is enforced

## Audit Log Retention

- **Minimum**: 6 years (HIPAA requirement)
- **Format**: Raw logs for 1 year, compressed thereafter
- **Location**: `audit_log` table in database
- **Export**: Encrypted exports for compliance audits

## Emergency Access (Break Glass)

For emergency situations, use break-glass access:

```typescript
import { requestBreakGlassAccess } from '@/lib/hipaa/break-glass';

// This creates enhanced audit trail
const access = await requestBreakGlassAccess(
  adminId,
  targetUserId,
  'Emergency support required - user reported crisis'
);
```

Break glass access:
- Requires written justification
- Creates permanent audit record
- Triggers alert to compliance officer
- Must be reviewed within 24 hours

## Resources

- HIPAA Security Rule: 45 C.F.R. § 164.312
- Audit controls standard: 45 C.F.R. § 164.312(b)
- Incident response plan: `docs/INCIDENT-RESPONSE-PLAN.md`
- Security documentation: `docs/SECURITY-HARDENING.md`

© curiositech · MIT · curiositech/some_claude_skills

Similar skills

All skills for Security →

hipaa-compliance by other authors comes first.

hipaa-compliance affaan-m The skill runs in Claude Code and other platforms, handling HIPAA compliance tasks and PHI security workflows in software. CX Codex +1 6,200installs hipaa-compliance devops-skills The hipaa-compliance skill maps HIPAA requirements to safeguards for systems handling ePHI. Use it when reviewing healthcare data protections or planning cloud infrastructure. CX Codex +1 357installs hipaa-audit briiirussell hipaa-audit audits applications and infrastructure that handle PHI against HIPAA and HITECH. Use it when an engineering review involves ePHI, BAAs, or breach duties. CX Codex +1 401installs healthcare-phi-compliance affaan-m healthcare-phi-compliance is a Claude Code skill with PHI and PII security patterns for HIPAA, GDPR, and DISHA, including RLS configuration, access audits, and leak prevention in logs and URLs. CX Codex +1 6,300installs VLayer abasensei VLayer audits healthcare software against HIPAA rules. Flags PHI exposure, missing encryption, and suggests code patches directly inside the AI agent. CX Codex +1 1,871installs compliance-automation-specialist Alysson Franklin compliance-automation-specialist designs automated evidence collection, control monitoring, and audit readiness workflows for SOC 2, ISO 27001, and GDPR. CX Codex ★ 1,013repo stars data-privacy-compliance davila7 data-privacy-compliance provides implementation blueprints for GDPR, CCPA, and HIPAA compliance directly in your codebase. CX Codex +1 259installs ai-agent-audit-specialist davila7 ai-agent-audit-specialist designs tamper-evident audit trails and compliance mappings for AI coding tools under HIPAA, SOC 2, and EU AI Act rules. CX Codex 148installs

From the same set180

The whole set →
team-builder team-builder designs team structures using organizational psychology. When a required role is missing from the skill library, it writes a new skill right away. CX Codex +1 216installs react-performance-optimizer react-performance-optimizer diagnoses React render bottlenecks to hit 60fps. It tackles sluggish lists, unnecessary component updates, and oversized bundles. CX Codex +1 215installs digital-estate-planner digital-estate-planner — a skill for organizing digital life ahead of death, incapacity, or emergencies. It inventories accounts, documents passwords and crypto, and writes instructions for a digital executor. CX Codex +1 215installs data-pipeline-engineer data-pipeline-engineer guides data pipeline design, Medallion storage layers, Airflow DAG orchestration, and dbt models. Activates for batch processing and streaming workloads. CX Codex +1 215installs web-wave-designer web-wave-designer — a skill that builds ocean waves, ripples, and underwater distortion for the web with SVG filters and CSS animation. Handy when a page needs a living water background. CX Codex +1 214installs test-automation-expert test-automation-expert — a test automation skill that covers strategy, framework setup, coverage gaps and flaky test debugging. Useful when a project needs tests from scratch or existing ones keep breaking. CX Codex +1 212installs very-long-text-summarization very-long-text-summarization — a Claude Code skill that digests books, handbooks and large codebases with hierarchical multi-pass extraction. It outputs a structured knowledge map, not a plain compressed retelling. CX Codex +1 210installs rest-api-design The rest-api-design skill guides REST endpoint design with Zod validation and OpenAPI docs. Use it when adding routes to a Next.js App Router project. CX Codex +1 209installs

Project sponsors

Companies that keep this analytics open