pii-detection
Skill6 starsChanged 8 months agoMITView on GitHub
Detect and flag PII (emails, SSNs, credit cards, phone numbers) in code, test fixtures, and logs. Enforce masking before logging and GDPR/CCPA-aware data handling.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- BuilderCed/agent-skillstheir own version, first seen Apr 21, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- BuilderCed/agent-skills★ 2same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository64 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- api-backward-compatibilitySkill
- api-design-standardsSkill
- api-versioningSkill
- database-designSkill
- distributed-systemsSkill
- observability-by-defaultSkill
- performance-budgetsSkill
- resilience-patternsSkill
- twelve-factor-appSkill
- codex-cross-reviewSkill
- dispatching-parallel-agentsSkill
- receiving-code-reviewSkill
- requesting-code-reviewSkill
- subagent-driven-developmentSkill
- architecture-awarenessSkill
- intent-to-specSkill
- project-diagnosisSkill
- using-shipworthySkill
- systematic-debuggingSkill
- documentation-as-codeSkill
- accessibilitySkill
- frontend-standardsSkill
- retrospectiveSkill
- writing-skillsSkill
- ci-cd-awarenessSkill
- context-managerSkill
- environment-setupSkill
- feature-flag-disciplineSkill
- finishing-a-development-branchSkill
- guardrail-audit-logSkill
- incident-responseSkill
- mcp-integrationSkill
- migration-strategiesSkill
- production-readinessSkill
- scope-creep-detectionSkill
- session-memorySkill
- slo-sli-definitionSkill
- tech-debt-trackingSkill
- using-git-worktreesSkill
- zero-downtime-migrationsSkill
- brainstormingSkill
- decision-frameworksSkill
- design-documentsSkill
- executing-plansSkill
- writing-plansSkill
- code-complexitySkill
- confidence-based-strictnessSkill
- error-handling-patternsSkill
- feedback-driven-adaptationSkill
- quality-gatesSkill
- response-schema-validationSkill
- test-driven-developmentSkill
- verification-before-completionSkill
- adaptive-securitySkill
- bias-detectionSkill
- compliance-awarenessSkill
- container-securitySkill
- dependency-managementSkill
- secrets-managementSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 23
Never use real PII in tests.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
PII Detection
PII Patterns to Flag
Any of these in source code, test fixtures, config files, or seed data is a finding:
| Type | Pattern | Example |
\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z]{2,}\b | john.doe@company.com | |
| SSN | \b\d{3}-\d{2}-\d{4}\b | 123-45-6789 |
| Credit card | 13-19 digit sequences (validate with Luhn) | 4111111111111111 |
| Phone | \b(\+?1[-.\s]?)?\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}\b | (555) 867-5309 |
| IP address | \b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b (in user context) | 192.168.1.42 |
Test Fixtures: Use Fake Data
Never use real PII in tests. Use obviously fake values:
// BAD -- looks like real data
const user = { email: "jsmith@gmail.com", ssn: "078-05-1120" };
// GOOD -- clearly synthetic
const user = { email: "test-user@example.com", ssn: "000-00-0000" };For bulk test data, use libraries like @faker-js/faker with deterministic seeds.
Log Masking Requirements
PII must never reach logs, metrics, or error tracking unmasked.
function maskPII(value: string): string {
return value
.replace(/\b\d{3}-\d{2}-\d{4}\b/g, '***-**-****')
.replace(/\b\d{13,19}\b/g, (m) => '****' + m.slice(-4))
.replace(/\b[\w.+-]+@[\w.-]+\.\w{2,}\b/g, '****@****');
}
// Apply at the logging boundary, not per-call
logger.info('Processing request', { userId: user.id }); // OK: ID only
logger.info('Processing request', { user }); // BAD: full objectRules
- Log IDs, not objects -- pass
userId, not the user record. - Mask at the boundary -- a single log sanitizer, not scattered
maskPIIcalls. - Audit log output -- grep production logs periodically for PII patterns.
- Structured logging only -- no string interpolation with user data.
GDPR / CCPA Awareness
- Purpose limitation -- only collect PII you actually need.
- Retention policy -- define how long each PII field is kept. Soft-delete is not deletion.
- Right to deletion -- the system must support purging a user's PII from all stores (DB, caches, logs, backups).
- Consent tracking -- record what the user consented to and when.
- Data export -- users can request all data held about them (Article 15 / CCPA right to know).
Data Retention Guidance
| Data Type | Suggested Max Retention | Notes |
| Session tokens | 24 hours | Rotate, don't extend |
| Access logs with IPs | 90 days | Anonymize after |
| Payment card data | Don't store | Use tokenized processor (Stripe, etc.) |
| User profile PII | Until account deletion + 30 days | Legal hold exceptions |
Code Review Checklist
- No real PII in test fixtures or seed files
- Log statements do not include raw user objects
- PII fields are masked before reaching any logging/error tracking
- Data retention is defined for any new PII field
- Deletion/export paths cover the new data
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

