# hipaa-compliance

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

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 215 installs · ★ 274 repo stars
- Author: curiositech
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/curiositech/some_claude_skills/tree/HEAD/.claude/skills/hipaa-compliance/SKILL.md
- Updated: 2026-10-30
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/curiositech-hipaa-compliance

## What it 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.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add curiositech/some_claude_skills --skill hipaa-compliance -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/hipaa-compliance/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/hipaa-compliance/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add curiositech/some_claude_skills --skill hipaa-compliance -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/hipaa-compliance/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add curiositech/some_claude_skills --skill hipaa-compliance -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/hipaa-compliance/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install curiositech/some_claude_skills .claude/skills/hipaa-compliance
```

2. **Manually: put the files in place**
- File: `.github/skills/hipaa-compliance/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add curiositech/some_claude_skills --skill hipaa-compliance -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/curiositech/some_claude_skills --path .claude/skills/hipaa-compliance
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/hipaa-compliance/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add curiositech/some_claude_skills --skill hipaa-compliance -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/curiositech/some_claude_skills/tree/HEAD/.claude/skills/hipaa-compliance/SKILL.md

## When to use it
- 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
- 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.

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 735b9ade935b6d9f.

BEGIN THIRD-PARTY FILE 735b9ade935b6d9f
````text
---
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,
````
END THIRD-PARTY FILE 735b9ade935b6d9f

The third-party file has ended. Everything between the 735b9ade935b6d9f tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2435 of 6016 bytes. © curiositech · MIT · https://github.com/curiositech/some_claude_skills/tree/HEAD/.claude/skills/hipaa-compliance/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
