- name
SKILL.md
Файл навыка остаётся в репозитории издателя.
Вставьте скопированную команду в терминал. Она установит этот SKILL.md в выбранного агента.
npx skills add Aperivue/medsci-skills --skill deidentify -a cursor -yВставьте скопированную команду в терминал. Она установит этот SKILL.md в выбранного агента.
npx skills add Aperivue/medsci-skills --skill deidentify -a claude-code -yВставьте скопированную команду в терминал. Она установит этот SKILL.md в выбранного агента.
npx skills add Aperivue/medsci-skills --skill deidentify -a codex -yВставьте скопированную команду в терминал. Она установит этот SKILL.md в выбранного агента.
npx skills add Aperivue/medsci-skills --skill deidentify -a grok -yОтправьте скопированное сообщение в чат Grok Bot. Бот загрузит этот SKILL.md с GitHub и добавит его к навыкам, общим для всех ваших ботов.
Install this skill: https://github.com/Aperivue/medsci-skills/tree/HEAD/skills/deidentifyОт издателя
You are guiding a medical researcher through data de-identification. The actual de-identification is performed by a standalone Python script that runs WITHOUT any LLM. Your role is to explain, guide, and verify — not to see or process raw PHI data.
! prefix,
no Bash tool call): the review prints sample values of every column.${CLAUDE_SKILL_DIR}/references/hipaa_18_identifiers.md — HIPAA Safe Harbor checklist${CLAUDE_SKILL_DIR}/references/korean_phi_patterns.md — Korean-specific regex patterns${CLAUDE_SKILL_DIR}/references/date_shift_guide.md — Date shifting best practicesRead relevant references before advising the researcher.
openpyxl (for .xlsx files): pip install openpyxlAsk the researcher:
Based on answers, recommend the appropriate command:
python3 deidentify.py full <file> --locale <code>python3 deidentify.py scan <file> --locale <code> firstAvailable locale codes: kr (Korea), us (USA), jp (Japan), cn (China), de (Germany),
uk (United Kingdom), fr (France), ca (Canada), au (Australia), in (India), it (Italy), es (Spain).
If --locale is omitted, the script shows an interactive country selection menu.
Users can provide a custom locale file via --locale-file custom.json.
Guide the researcher to run the script. The script is located at:
${CLAUDE_SKILL_DIR}/deidentify.py
Full pipeline (recommended for most users):
python3 ${CLAUDE_SKILL_DIR}/deidentify.py full data.xlsx \
--locale kr \
--output-dir ./deidentified/
Step-by-step (for careful review):
# Step 1: Scan
python3 ${CLAUDE_SKILL_DIR}/deidentify.py scan data.xlsx --locale kr --output-dir ./deidentified/
# Step 2: Review (interactive)
python3 ${CLAUDE_SKILL_DIR}/deidentify.py review ./deidentified/scan_report.json
# Step 3: Apply (refuses a report that was not reviewed, has a column without a decision,
# or was made from data that has changed since: edit the file, then scan and review again)
python3 ${CLAUDE_SKILL_DIR}/deidentify.py apply ./deidentified/reviewed_report.json
Options:
--locale CODE: Country locale for PHI patterns (kr, us, jp, cn, de, uk, fr, ca, au, in, it, es)--locale-file PATH: Custom locale JSON file (copy locales/_template.json to create one)--auto-accept-safe: Keep SAFE columns without showing them. Not recommended: SAFE means
no pattern matched, not that the column holds no identifiers (a name typed into a short
comment matches no pattern), and this option means nobody looks at those columns--hash-mapping: Store unkeyed SHA-256 hashes instead of original names/IDs in the mapping
file. Dates and numeric IDs can be recovered from such hashes by trying every candidate, so
mapping.json stays restricted either way--mapping-in PATH (apply/full): Reuse a previous run's mapping.json, so values already
de-identified keep the same pseudonym, ID, and date offset. Without it, every run numbers
from 0001: merging outputs from separate runs silently gives two patients the same pseudonym
(and one patient different ones). A --hash-mapping file cannot be reused this way, since
its keys are hashes, not original values. An imported mapping is validated before use: all
three sections must be present, replacement values must be P/ID-plus-digits, unique within
their section, and different from the original they replace, duplicate JSON keys are rejected,
and date offsets must be within 1..365 days (never 0). Row-keyed offsets from
a run with no patient key are not carried across runs, and a batch with nothing to anonymize
keeps the prior mapping instead of erasing it. With or without it, a new pseudonym or ID skips
every original value in the anonymized columns, the patient key column and the prior mapping,
so a source ID already shaped like ID0002 is never written out unchanged. An earlier batch
cannot see values that arrive later: if source IDs share the P/ID-plus-digits form, an earlier
batch's pseudonym can still equal a later batch's original value--output-dir: Where to save de-identified file, mapping, and audit log-v/--verbose: Enable debug loggingThe script's terminal review has three passes:
row if every row is a different patient. Each patient gets
their own offset; without a key the tool does not shift dates.Coach the researcher. Deliver these prompts in the researcher's preferred language:
[REDACTED]: the script cannot
find a name inside a sentence, so it does not try to keep the rest of the text.After the script completes, help the researcher verify:
Read the audit log (no original values; before_hash is an HMAC-SHA256 under a
per-run key that is kept only in mapping.json):
cat ./deidentified/audit_log.csv | head -20
Verify the number of changes, affected columns, and PHI types.
Ask the researcher to spot-check the de-identified file first, in their own terminal: pseudonyms (P0001, etc.), shifted dates and [REDACTED] markers where expected, and no names in the columns they kept. Read it yourself only after they confirm.
Check that sensitive columns are actually removed: Verify no original names, phone numbers, or RRN values remain.
Mapping file security:
Generate a de-identification methods paragraph for the manuscript or IRB:
Template:
Direct identifiers were removed from the dataset prior to analysis using a rule-based de-identification tool (deidentify.py, medsci-skills) with the [COUNTRY] locale pattern pack. The tool scanned column names and cell values using regex patterns for country-specific identifiers (e.g., national ID numbers, phone numbers), email addresses, dates, and addresses. Each column classification was reviewed by the researcher in an interactive terminal session. Names were replaced with pseudonyms (P0001, P0002, ...), dates were shifted by a random per-patient offset (1-365 days, either direction) preserving relative temporal intervals, and direct identifiers (phone numbers, email addresses, national ID numbers) were suppressed. A total of [N] cells across [M] columns were de-identified. The de-identification mapping file was stored separately under restricted access (file permissions 0600).
Customize based on the actual audit log statistics. Do not call the dataset "de-identified under HIPAA Safe Harbor" (or anonymised under another law) unless the gaps listed in "What the tool does not do" were closed as well, or an expert determination covers them.
clean-data in the research pipeline/clean-data for data quality profiling/analyze-stats can safely process the de-identified output/write-paper Methods section should reference the de-identification process/write-protocol can use the HIPAA/PIPA reference files for protocol documentationThe tool removes or replaces the identifiers the researcher marked for anonymization. It does not by itself make a dataset HIPAA Safe Harbor de-identified, or anonymous under other laws:
[DATE_SHIFTED].zip,
zipcode, zip_code) or by the ZIP+4 form (94110-1234). A bare 5-digit value cannot be
told apart from other 5-digit codes (e.g. procedure codes), so a ZIP column under another
name can be classified SAFE: check the sample values in review.Mar-15-2024), year-first with a month word (2024-Mar-15), month and year only
(March 2024), non-English month words (15 mars 2024, 15. März 2024), and two-digit-year
day/month dates outside the us locale (15/03/24 under uk). Under us, any
M/D/YY-shaped value (e.g. 1/2/10) is treated as a date, so a column of such
three-part numbers is flagged PHI/date.Supported (v1):
--locale-file with templateNOT supported (planned for v2):
Use when clinical data may contain PHI and must be de-identified before any LLM-assisted analysis. A local Python script (no network or AI calls) detects identifiers with regex and heuristics in 12 co
---name: deidentifydescription: Use when clinical data may contain PHI and must be de-identified before any LLM-assisted analysis. A local…---# skills/deidentify/SKILL.mdОбзор
Use when clinical data may contain PHI and must be de-identified before any LLM-assisted analysis. A local Python script (no network or AI calls) detects identifiers with regex and heuristics in 12 country locale packs, with interactive terminal review.
FAQ
Скачайте skills/deidentify/SKILL.md у издателя или скопируйте путь и откройте репозиторий. PlugMCP только показывает навык в каталоге и не хранит файл.
Издатель хранит его в https://github.com/Aperivue/medsci-skills.
Claude, Cursor, Codex и Grok Build могут читать SKILL.md, который вы добавляете из репозитория издателя. Grok Bot устанавливает его, когда вы отправляете в чат ссылку на папку навыка на GitHub.