generating-synthetic-surrogates

generating-synthetic-surrogates is a skill for Claude Code from maziyarpanahi/openmed. It costs 145 tokens per session (1,800 once invoked), scanned A, original, Apache-2.0.

A method for replacing protected health information, or PHI, in clinical notes with realistic fake values. OpenMed is a tool for de-identifying medical text while keeping it readable and machine-parseable.

In plain words
What is it for?
Use it to create safer clinical NLP training data, demonstrations, test cases, or readable de-identified notes, with consistent fake identities when needed.
Why use it?
It removes real names, medical record numbers, addresses, dates, and similar identifiers without filling the note with unreadable redaction markers.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the openmed-skills plugin — 74 skills shipped together

Good fit Use it to create safer clinical NLP training data, demonstrations, test cases, or readable de-identified notes, with consistent fake identities when needed.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/maziyarpanahi/openmed/generating-synthetic-surrogates
About the project

OpenMed is local-first healthcare AI software that extracts clinical information and removes personally identifying details from clinical text on hardware controlled by the user. Healthcare developers use its Python runtime, Apple Silicon and mobile SDKs, and browser support for on-device clinical NER and PII de-identification.

maziyarpanahi/openmed · 5,290 stars · on GitHub · openmed.life

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add maziyarpanahi/openmed --skill generating-synthetic-surrogates
Clone the repo
git clone --depth 1 https://github.com/maziyarpanahi/openmed

Made for: Claude Code.

Or install openmed-skills, the plugin that ships this one along with the rest of its 74 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for generating-synthetic-surrogates

README.md
[![agentmods](https://agentmods.dev/badge/skills/maziyarpanahi/openmed/generating-synthetic-surrogates/github.svg)](https://agentmods.dev/skills/maziyarpanahi/openmed/generating-synthetic-surrogates)
Your own site
<a href="https://agentmods.dev/skills/maziyarpanahi/openmed/generating-synthetic-surrogates"><img src="https://agentmods.dev/badge/skills/maziyarpanahi/openmed/generating-synthetic-surrogates/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for generating-synthetic-surrogates

Your own site · 80×15
<a href="https://agentmods.dev/skills/maziyarpanahi/openmed/generating-synthetic-surrogates"><img src="https://agentmods.dev/badge/skills/maziyarpanahi/openmed/generating-synthetic-surrogates.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 145 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,800 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00145 $0.01800
Opus 5 $0.00072 $0.00900
Sonnet 5 $0.00029 $0.00360
Haiku 4.5 $0.00015 $0.00180

Measured 11d ago against content hash 04abd33856c2, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

generating-synthetic-surrogates scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/generating-synthetic-surrogates/SKILL.md · 146 lines

How it starts

The opening of the file, as written. The whole thing — 146 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Generating synthetic surrogates

method="replace" swaps each detected identifier for a realistic, type-matched fakeJohn Doe becomes Mark Lee, a phone becomes a plausible phone, a date becomes a plausible date. Unlike opaque [REDACTED]/[NAME] masks, surrogate text reads naturally and stays parseable by downstream NLP, while still containing no real PHI. OpenMed generates surrogates on-device via Faker-backed providers keyed to each canonical label.

When to use this skill

Use surrogates when the de-identified text must remain readable or machine- parseable: training data for clinical NLP, demos, QA, or notes a human still needs to skim. If you only need the identifiers gone and don't care about readability, plain method="mask" is simpler and more obviously redacted.

Quick start

import openmed

note = (
    "Patient John Doe (MRN 1234567) saw Dr. John Doe's colleague on 2024-03-02. "
    "Reach John Doe at 617-555-0142."
)

result = openmed.deidentify(
    note,
    method="replace",
    consistent=True,     # every "John Doe" -> the SAME surrogate within this call
    seed=42,             # reproducible across runs
    locale="en_US",      # shapes the fakes; defaults from lang via LANG_TO_LOCALE
)
print(result.deidentified_text)
# Patient Mark Lee (MRN 8830127) saw Dr. Mark Lee's colleague on 2024-07-18. ...

consistent=True is what makes the output coherent: the three mentions of "John Doe" collapse to one fake identity instead of three different ones, so the note still makes sense. seed= makes that mapping reproducible run to run.

Surrogates vs opaque redaction

method="mask" ([NAME]) method="replace" (surrogate)
Readability low — placeholders high — reads like a real note
Downstream NLP tokenizers see [NAME] everywhere natural distribution preserved
Co-reference lost (all [NAME]) preserved with consistent=True
Obvious it's de-identified yes no (must be tracked out-of-band)
Reversible with keep_mapping=True with keep_mapping=True

Read the full file on GitHub · 146 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 146 lines · 145 tokens per session scan A 04abd33856c2

Subscribe to this mod's changes

generating-synthetic-surrogates is a skill published in the GitHub repository maziyarpanahi/openmed (5,290 stars, last pushed today), licensed Apache-2.0. It adds 145 tokens to every session and 1,800 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

benchmarking

Use this skill when the user wants to benchmark an MLX-VLM change and present the numbers in a PR — fork-vs-main A/B comparisons, isolated-module micro-benchmarks, median-of-N timing with warmup, peak-memory reporting, correctness checks, parameter sweeps, and self-contained reproducible bench scripts to paste into a…

Blaizzy/mlx-vlm · 74 tokens

fda-database

Query openFDA API for drugs, devices, adverse events, recalls, regulatory submissions (510k, PMA), substance identification (UNII), for FDA regulatory data analysis and safety research.

synthetic-sciences/openscience · 43 tokens

clinical

Clinical study design, statistical analysis, and regulatory compliance for medical research.

beita6969/ScienceClaw · 1 tokens

patent-drafting

Draft patent applications for scientific inventions, covering claims, specification, and prior art analysis.

beita6969/ScienceClaw · 4 tokens

pdf

Use this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and…

beita6969/ScienceClaw · 92 tokens

phi-cleaner

De-identify clinical text for drafts, notes, and manuscript excerpts using phi-cleaner before sharing with external tools or collaborators. Use when: (1) Removing patient names/dates/identifiers from free-text notes, (2) Producing sanitized excerpts for LLM prompts, (3) Running a PHI detection pass to audit sensitive…

sciclaw/sciclaw · 90 tokens