convez.ai
SkillSegurançaIntermediário
wujiajun4

PII Scrub

wujiajun4/pii-scrub

Detecta dados pessoais antes de você publicar ou compartilhar

Ver no GitHub
InicialPluginScore · de 0 a 100

Scanner defensivo que detecta dados pessoais (PII) antes de publicação — emails, telefones, IDs, chaves API, números de cartão, endereços de carteira cripto e pontuações acadêmicas. Opera localmente sem enviar dados para rede, permitindo triage manual pela severidade detectada. Ideal como step 0 de SOP de publicação segura.

Instalação

$npx convez-ai wujiajun4/pii-scrub

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
0
Forks
0
Acompanhando
0
Saúde
42%
Último commit
há 5 meses
Versão
—
Issues abertas
0
Contribuidores
1

Casos de uso

  • Validar código/conteúdo antes de push para repositórios públicos
  • Escanear arquivos antes de compartilhar em chats, fóruns ou com LLMs
  • Proteger credenciais e informações sensíveis em documentação técnica
  • Implementar step 0 de procedimento de segurança em publicações

Veredito

Ferramenta sólida e minimalista para detectar vazamentos de PII antes da publicação. Abordagem local-first (sem telemetria), padrões configuráveis e triage por severidade a tornam prática; limitação é que apenas reporta, deixando decisão final ao usuário.

README

A tradução para o português deste README ainda está na fila.

🛡️ pii-scrub

A defensive scanner for personal data. Catches real PII (scores, school names, phone numbers, IDs, API keys) before it leaves your machine — to a git push, a public file share, a chat, a forum, or an LLM context.

License: MIT Status: v0.1 Security: First--Class SOP: step--0


✨ What it does

Greps your target directory for personal data patterns. Reports matches — never auto-rewrites, never sends data anywhere, never logs telemetry.

Two pattern sources:

  1. Built-in generic library — email, phone (US / CN / intl), credit card, IBAN, BTC/ETH wallet, US SSN, Chinese resident ID, API key prefixes (sk-, sk-ant-, ghp_, AKIA, AIza...), academic scores (PTE, IELTS, TOEFL, Duolingo, GPA, /100), IPv4/IPv6/MAC, file paths.
  2. Per-user user-patterns.txt — your real school, your real phone, your real work email, anything not in the generic library.

See references/pii-patterns.md for the full pattern library.


🛡️ Severity model

SeverityMeaningAction
CriticalAlmost always a leak.Block publish.
HighVery likely a leak.Block publish.
MediumCould be real, could be example.Triage.
LowProbably example / boilerplate.Note.

The skill sorts the report by severity so you deal with Critical and High first.


📦 Install

# Clone
git clone https://github.com/<owner>/pii-scrub.git

# Or copy into your skills dir
cp -r pii-scrub ~/.claude/skills/pii-scrub

# Verify
ls ~/.claude/skills/pii-scrub/
# SKILL.md  LICENSE  README.md  .gitignore  references/  examples/

Restart Claude Code. The skill is now active and auto-triggers on words like publish, push, share, 发送, 上传, 发布前.


🚀 Usage

Quick — scan a directory

Just ask Claude anything publish-related and the skill fires:

"I want to publish this skill, scan it for PII first" "Check for any API keys or phone numbers in this folder" "发布前帮我扫一下这个目录"

Add your personal patterns

Edit ~/.claude/skills/pii-scrub/user-patterns.txt (gitignored). One POSIX extended regex per line:

# My real school (Chinese)
江西师范大学
# My real school (English)
Jiangxi Normal University
# My PTE score
PTE\s*6[0-9]\s*\(\s*[0-9]{1,2}\s*,\s*[0-9]{1,2}\s*,\s*[0-9]{1,2}\s*,\s*[0-9]{1,2}

Re-run pii-scrub and your patterns are added to the scan.

Suppress false positives

For matches you know are intentional (e.g. a security-check command containing the literal pattern), add to ~/.claude/skills/pii-scrub/user-patterns-whitelist.txt:

# format: <file>:<line>  <reason>
SKILL.md:42  example of a generic security-check command

🔍 What it does NOT do

It doesIt does NOT
✅ Grep for patterns❌ Auto-rewrite files
✅ Categorise by severity❌ Send anything over the network
✅ Show file:line + context❌ Remember or log results (no telemetry)
✅ Sort by severity for triage❌ Replace deleted content with placeholders
✅ Use generic + per-user patterns❌ Decide for you what's a leak

You stay in control. The skill only reports.


📁 File structure

pii-scrub/
├── SKILL.md                       # Main entry — frontmatter + workflow
├── README.md                      # This file (bilingual)
├── LICENSE                        # MIT
├── .gitignore                     # Excludes user-patterns.txt + evals
├── references/
│   └── pii-patterns.md            # Generic pattern library
├── examples/
│   └── before-after.md            # Worked example of a scrub cycle
├── user-patterns.txt              # YOUR patterns (gitignored)
└── user-patterns-whitelist.txt    # YOUR suppressions (gitignored)

🛡️ Publishing SOP integration

This skill is step 0 of the user's publishing SOP — it runs BEFORE preflight. The full sequence:

0. /pii-scrub         ← THIS SKILL — catch PII first
1. /preflight          ← 6 content + 3 distribution checks
2. /readme             ← README optimisation
3. HUMAN REVIEW        ← user explicitly approves
4. ctx_execute push    ← git push (via Node, bypasses sandbox)
5. /brain-sync         ← sync to Memory MCP

If step 0 reports any Critical / High match, do not proceed to step 1. Scrub first.


🤝 Contributing

PRs welcome. Two specific ways to help:

  1. Add a new generic pattern — edit references/pii-patterns.md (the markdown table at the top). Add the ERE, an example, and a note on false-positive rate.
  2. Add a new pattern category — for example, "Medical" (PHN, NHS number), "Education" (NRIC, school IDs), "Travel" (passport numbers by country).

Pre-PR checks

# 1. PII scan (self-aware — see SKILL.md "Self-scan exclusion")
grep -rE "<suspicious-pattern>" ~/.claude/skills/pii-scrub/ \
  --exclude-dir=references --exclude=user-patterns.txt \
  || echo "OK no PII leak"

# 2. LICENSE
ls -la LICENSE
head -3 LICENSE

# 3. File structure
ls SKILL.md README.md LICENSE .gitignore references/ examples/

⚠️ Privacy note

The pattern library in references/pii-patterns.md contains realistic example values to teach the patterns. These are NOT real user data — they're generic formats (e.g. 110101000000000000 style for ID, sk- proj-AbCdEf1234567890XYZ style for keys). If you scan this skill's own directory, the patterns will match the example values. That's expected and harmless — see SKILL.md "Self-scan exclusion" for details.


📜 License

MIT © 2026 pii-scrub contributors


🗺️ Roadmap

  • pii-scrub CLI tool (run without Claude)
  • GitHub Action wrapper
  • Auto-generate per-user user-patterns.txt from past project data
  • Eval suite with 10+ worked examples
  • Locale-specific libraries (CN / IN / EU / US / UK)


🇨🇳 中文版

✨ 做什么

在数据离开你机器之前(git push / 公网分享 / 聊天 / LLM context)抓真实 PII。

两个模式来源:

  1. 内置通用库 — 邮箱 / 电话 / 信用卡 / IBAN / 加密钱包 / 美国 SSN / 中国身份证 / API key 前缀 / 学术分数 / IPv4 / MAC / 文件路径
  2. user-patterns.txt — 你的真实学校 / 真实电话 / 真实工号 / 任何通用库没覆盖的

详细见 references/pii-patterns.md。

🛡️ 严重度模型

严重度含义处理
Critical几乎肯定是泄漏block publish
High很可能泄漏block publish
Medium可能是真,可能是 exampletriage
Low大概率是 example记录一下

📦 安装

git clone https://github.com/<owner>/pii-scrub.git
cp -r pii-scrub ~/.claude/skills/pii-scrub
ls ~/.claude/skills/pii-scrub/

重启 Claude Code。Skill 自动激活,触发词:发布 / push / share / 发送 / 上传 / 发布前。

🚀 用法

直接说"扫一下这个目录"或"发布前检查"就行。

加你的个人 pattern: 编辑 ~/.claude/skills/pii-scrub/user-patterns.txt(gitignored)。一行一个 POSIX 扩展正则。

抑制误报: 加到 user-patterns-whitelist.txt。

🛡️ Publishing SOP 集成

这是你发布 SOP 的 step 0(在 preflight 之前):

0. /pii-scrub         ← 这个 skill — 先抓 PII
1. /preflight          ← 6 项内容 + 3 项分发检查
2. /readme
3. HUMAN REVIEW
4. ctx_execute push
5. /brain-sync

📜 许可

MIT © 2026 pii-scrub contributors

Ver o original no GitHub

Bom para

Relacionados