sync-pii-anonymizer
Skill329 starsChanged 7 days agoMIT-0View on GitHub
Use when re-syncing the vendored copy of awslabs/pii-anonymizer under feature-platform/pii-anonymizer/hook/vendor/ after an upstream fix or feature.
- Deletes or force-pushes
In this repository42 other files it gives its agents.
- .claude/rules/agents.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- add-modelSkill
- agent-capability-reviewSkill
- api-rbac-testSkill
- backend-lambdaSkill
- code-reviewSkill
- create-hf-dataset-prSkill
- curate-security-resultsSkill
- cut-release-changelogSkill
- dependabot-prsSkill
- documentationSkill
- extraction-pipelineSkill
- fix-single-issueSkill
- frontend-uiSkill
- full-test-batterySkill
- infrastructureSkill
- live-auth-checksSkill
- live-eval-and-costSkill
- prepare-changelogSkill
- prep-develop-for-releaseSkill
- product-demoSkill
- pr-review-ciSkill
- pr-reviewSkill
- releaseSkill
- release-validationSkill
- remove-classification-flat-keysSkill
- repo-quality-reviewSkill
- run-benchmarksSkill
- run-stack-testsSkill
- srt-security-scanSkill
- testing-qaSkill
- test-upgradeSkill
- transform-deploy-testSkill
- ui-i18nSkill
- update-solution-profileSkill
- ux-test-ciSkill
- ux-testSkill
- ux-test-stories-ciSkill
- ux-test-storiesSkill
- work-the-backlog-hazardsSkill
- work-the-backlogSkill
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 56
NOT copy audio_processor, handlers/, infra/, observability, throttle_handler, log_scrubber, or core/redactor.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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
Skill: Re-sync the vendored pii-anonymizer library
When to use: Upstream awslabs/pii-anonymizer
has fixed a bug or added a feature you want in the PII Anonymization extension,
and you need to pull updated files into the vendored copy at
feature-platform/pii-anonymizer/hook/vendor/pii_anonymizer/.
This skill keeps the vendored document closure in sync WITHOUT dragging in the parts we deliberately excluded (audio, handlers, infra, observability).
Background
We vendor (copy) rather than submodule because upstream is an AWS Labs sample
with no PyPI release and no git tags — a submodule pinned to main is a moving
target, and the code must pass our lint + SRT security scan as owned code.
The vendored set, the excluded set, and the current pinned commit are documented
in feature-platform/pii-anonymizer/hook/vendor/PROVENANCE.md. Read it first.
Procedure
- Clone upstream fresh and capture the new HEAD SHA:
rm -rf /tmp/pii-anonymizer-src git clone --depth 50 https://github.com/awslabs/pii-anonymizer.git /tmp/pii-anonymizer-src cd /tmp/pii-anonymizer-src && git rev-parse HEAD - Diff what changed since the pinned commit (from PROVENANCE.md) — scope the
diff to the closure paths so you ignore churn in excluded modules:
Review the diff. Pay attention to:PINNED=<sha-from-PROVENANCE.md> git -C /tmp/pii-anonymizer-src diff --stat $PINNED..HEAD -- \ src/core src/helpers src/processors src/redaction src/validation- New intra-project imports in any closure file (
from core...,from helpers...,from validation...,from redaction...,from processors...). A new import may pull in a module we don't yet vendor — the closure has grown. Add the new file(s) and re-check transitively. - Changes that reintroduce excluded deps (audio, xray, infra) — do NOT vendor those.
- New external pip deps — update
hook/requirements.txt/ the layer.
- New intra-project imports in any closure file (
- Re-copy the closure (same file list as PROVENANCE.md). The helper script
does exactly this and preserves the excluded-module exclusions:
The script re-copies the documented closure, re-writes the emptybash feature-platform/pii-anonymizer/hook/vendor/resync.sh /tmp/pii-anonymizer-srcpii_anonymizer/__init__.pymarker, and re-copies LICENSE/NOTICE. It does NOT copy audio_processor, handlers/, infra/, observability, throttle_handler, log_scrubber, or core/redactor. - Verify the closure still imports cleanly and nothing excluded leaked in:
cd feature-platform/pii-anonymizer/hook/vendor/pii_anonymizer grep -rnE "observability|throttle_handler|log_scrubber|audio_processor|from infra|import infra" . && echo "!! LEAK — investigate" || echo "no excluded refs" python3 - <<'PY' import sys, os; sys.path.insert(0, os.getcwd()) for m in ["core.pii_detector","core.synthetic_pii_generator","helpers.model_router", "helpers.threaded_detector","processors.txt_processor","processors.pdf_text_processor", "processors.tabular_processor","processors.word_processor","processors.pdf_image_processor", "processors.image_processor","redaction.pdf_redactor","validation.model_schemas"]: __import__(m) print("ALL CLOSURE MODULES IMPORT OK") PY - Update PROVENANCE.md: bump the Vendored commit, Commit date, and Vendored on fields; note any files added to (or removed from) the closure; record any local modifications you had to re-apply.
- Quality gates:
Triage any new SRT HIGH findings (mitigate withmake ruff-lint # vendored code must pass our lint cd lib/idp_common_pkg && python -m pytest ../../feature-platform/pii-anonymizer/hook/tests -q make srt-scan # security-scan the updated vendored code (see .claude/skills/srt-security-scan/SKILL.md)# nosec+ rationale, a code fix, or ascripts/srt/issues.jsonsuppression). - Bump the feature version in
feature.yamlif the sync changes behavior, and add a CHANGELOG entry.
Gotchas
- Import root, not package root. Submodules use absolute
from core...imports;pii_anonymizer/goes onsys.path. Do NOT restore upstream's eagersrc/__init__.pyre-exports — they pull in excluded modules. - Closure can grow. A new upstream import inside a vendored file may reference a module we don't have yet. Step 2's import scan catches this; add the transitive file(s) and update PROVENANCE.md's file list.
- Never vendor audio/ffmpeg. Out of scope; it bloats the Lambda layer.
- Config is a dict. Upstream reads config via
config[...]; the hook passes a plain dict built from the active config version'spreprocessingblock. A re-sync must not reintroduce a hard dependency onconfig_loader/ CONFIG_BUCKET (it's a lazy fallback only — keep it that way).
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.

