Community研究與資料分析github.com

grahama1970/anonymize-data

使用明確的政策對 CSV、JSON、UTF-8 文字和 SQLite 檔案進行匿名化處理。一個基於 oai-trial 專案的輕量 CLI/Docker 介面。

anonymize-data 是什麼?

此技能提供了一個輕量級包裝器,用於操作規範的 `oai-trial` 匿名化專案,專注於處理 CSV、JSON、UTF-8 文字和 SQLite 資料格式。它採用基於政策的顯式方法,其中所有匿名化、假名化和編輯規則都在一個單獨的 `policy.json` 檔案中定義。關鍵區別在於它嚴格的設計原則:它不會複製專案的比對器、格式適配器、驗證器或錯誤處理,而是保留現有的 argparse CLI 和 Docker 介面。設定需要 `uv` 並安裝專案的開發/發現擴展,但執行時期不需要記憶體、LLM、網路或資料庫服務,使其可預測且自包含。該技能支援明確的匿名化操作,並透過一個可選的 RapidFuzz 發現步驟,用於識別潛在的名稱別名,但始終要求人工明確批准,且絕不允許自動替換。它在不和專案本身註定入的許多陷阱(例如字串與值的比對以及表示形式問題)方面包含了重要的經驗教訓。該技能設計為在 Claude Code、Cursor 和 Codex 等 AI 代理平台上運行,作為一個確定性的、可驗證的工具,用於安全地匿名化匯出檔案,同時保持嚴格的安全評定邊界。

相容平台~Claude Code~Codex CLI~Cursor✓Antigravity
npx skills add https://github.com/grahama1970/agent-skills/tree/main/skills/anonymize-data

Installed? Explore more 研究與資料分析 skills: affaan-m/uspto-database, affaan-m/scholar-evaluation, affaan-m/literature-review · View all 6 →

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

匿名化資料

操作規範的 oai-trial 專案。請勿在此技能中複製其比對器、格式適配器、驗證器、結構或錯誤處理。專案現有的 argparse CLI 特意保留;此包裝器不添加 Python CLI 或服務。

設定與主要操作

ANONYMIZE_DATA_ROOT 會覆蓋上述預設的主要檢出目錄。設定需要 uv 並安裝專案所宣告的開發/發現擴展。執行時期操作不需要記憶體、提供者憑證、LLM、網路或資料庫服務。

./run.sh setup
./run.sh --input /data/exports --policy /data/policy.json --output /data/release
./run.sh anonymize --input /data/export.sqlite --policy /data/policy.json --output /data/release

輸入可以是單一 .csv、.json、.txt 或 .sqlite 檔案,或包含這些檔案的目錄。政策必須是一個獨立的常規檔案。在輸入目錄外部使用一個專用的空輸出目錄。原始檔案會被複製到私有的臨時快照中;成功的輸出僅包含 corpus/ 和 report.json。

現有的套件介面仍可使用:

./run.sh run --input /data/bundle --output /data/release
./run.sh verify --input /data/bundle --output /data/release
./run.sh inspect /data/release

一個套件包含 policy.json 和 corpus/。政策、規範識別碼、保護值規則、類型化失敗和報告結構屬於專案擁有。在解讀它們時,請閱讀專案的 README.md、docs/ANONYMIZATION_SEMANTICS.md 和 schemas/report.schema.json。不要僅根據退出碼就宣告成功:請閱讀實際報告,驗證其就緒狀態欄位,並檢查輸出是否為要求的格式。損壞或缺失的報告視為未就緒 (NOT READY)。

可選的 RapidFuzz 發現:絕非自動取代

./run.sh discover --input /data/exports --policy /data/policy.json --output /data/work/review.json
./run.sh approve-discovery --input /data/exports --policy /data/policy.json \
  --review /data/work/review.json --approve CANDIDATE_ID --output /data/work/approved-policy.json
./run.sh --input /data/exports --policy /data/work/approved-policy.json --output /data/release

發現過程會將整個結構化字串值和整個文字行與 name 類型的政策條目進行比較。這不是 NLP 實體提取或一般的 PII 掃描器。預設值:相似度閾值 90,分離邊際 5;可使用 --threshold 和 --margin 進行配置。並列、接近並列、受保護的值、包含數字或標識符標點符號(例如 @、/、_)的值以及已知的字面量將不會被提出。在類似名稱的文字中允許使用撇號、連字號和句點;相似度永遠不是證明兩個人是同一人的證據。

要求操作者批准特定的候選 ID。 切勿僅根據相似度分數進行批准。批准會根據當前政策/語料庫重新推導提議,拒絕過時的/已編輯的審查,並編譯一個完全比對的政策。未經批准的提議永遠不會影響匿名化。在發現/批准收據上,release_ready: false 是強制性的。

審查和已批准的政策檔案包含原始名稱:請將它們保持在發行版、日誌和共享報告之外。它們以模式 0600 建立,且絕不會覆蓋現有檔案。臨時快照預設使用工件磁碟機;必要時可使用 ANONYMIZE_DATA_WORK_DIR 覆蓋。

Docker 仍然是獨立介面

從專案檢出目錄中執行:

docker build -t anonymization-trial .
docker run --rm anonymization-trial
# 可選的啟用發現功能的映像;預設映像保持精確引擎無依賴關係。
docker build --build-arg INCLUDE_DISCOVERY=1 -t anonymization-trial:discovery .

只掛載請求的唯讀輸入/政策目錄以及一個專用的輸出目錄。相同的專案 CLI 在映像內部執行;評估器不需要此技能。請參閱專案的 docs/DISCOVERY.md 以獲得完整的掛載命令範例。

失敗與證明邊界

此包裝器保留專案退出碼和清理過的錯誤碼。缺少專案/設定和錯誤的已安裝套件路徑會在處理開始前失敗。請使用 --help 獲取實際的引數合約。發現是審查材料,而非發行版、匿名保證、信心機率或人類授權。

./sanity.sh 執行真實的正向、負向和對抗性 CLI 檢查。保留的 fixtures/agentic_eval.json 重複這些檢查並需要工件回讀。先前的試驗資格不會自動使這些試驗後擴展符合資格。

表示形式規則(操作者,2026-09-11)

PII 必須根據值而非字串進行比對:在任何 JSON/SQL 標量未經更改地傳遞之前,先以標準方式將其字串化(電話格式的數字使用 E.164 形式),然後對字串化後的形式執行政策比對。測試夾具必須包含每種 JSON 標量類型中的每一類 PII。儲存為整數的電話號碼與格式化的電話號碼是相同的,包括當政策將其寫為格式化字串(例如 555-123-4567)而語料庫儲存為 5551234567 的情況。除非類型特定的標準規則能證明安全等價,否則前導零或浮點數精度損失的數值轉換必須以失敗關閉。請參閱 $best-practices-skills "值表示形式矩陣"。

強化教訓(請勿重新經歷這些困難)

該試驗因儲存為 JSON/SQLite 整數的電話通過了僅限字串的比對器而被取消資格。根本原因是流程錯誤:驗收檢查是根據程式碼的行為撰寫的,而非根據交付的規格。這些規則的存在是為了防止此類錯誤再次發生。

  1. 根據規格推導檢查,而非程式碼。 policy.json 列出了確切的敏感值。正確的驗收檢查是「解碼後的輸出中,以任何表示形式,都不會出現這些值中的任何一個」——從政策檔案讀取值,絕不要使用手寫的清單。透過依賴性探測(翻轉一個政策值 → 結果必須翻轉)來證明檢查依賴於規格。參考實作:專案的 scripts/spec_derived_check.py 整合到 scripts/verify.sh 中。

  2. 獨立驗證器不得與轉換共用任何假設。 原始驗證器與生產者具有相同的僅限字串盲點,因此沒有什麼能以失敗關閉。驗證預言機必須具有表示形式意識且獨立:解析 JSON(解碼 \uXXXX),將數值標量展開為整數/小數形式,對兩側進行 NFC/NFD 正規化,掃描 SQLite 表格+檢視儲存格以及 sqlite_master DDL 以及每個標頭整數,並掃描整個已發佈的邊界,包括 report.json——而不僅僅是 corpus/。

  3. 完整的表示形式類別是一個檢查清單,而非單一錯誤。 以下每一項都可能攜帶敏感值通過天真的比對器;專案修復並為每一項保留了防護措施:類型化數值標量(int/float、科學記號)、SQLite BLOB(失敗關閉)、Unicode NFC/NFD、檢視重建、空閒串列殘留、敵意資料庫結構(表達式/部分索引、非確定性檢視、計算的 DEFAULT)、結構 DDL 字面量以及持久性標頭整數。請參閱專案的 docs/SECURITY_REMEDIATION.md 以獲得完整表格。

  4. 透過真實的 Docker 路徑,確定性地證明它。 驗證必須是一個提交的腳本,用來建置映像、執行簡報的確切命令,並以硬性的 PASS/FAIL 退出碼回讀已發佈的位元組——而不是代理人的散文。參考資料:security/docker_brief_contract.py(建置 + 兩個簡報命令 + 具有表示形式意識的漏洞掃描 + 輸入前提條件)和 security/docker_hardening_matrix.py(透過 docker run 的對抗性漏洞)。記錄 git 提交和已建置的映像 ID。

  5. 誠實地界定範圍。 確定性的公共命名空間假名會揭露相等性/頻率,且不提供外部連結抵抗能力;執行報告在 key_mode 和 does_not_establish 中說明了這一點。一個等於強制性 SQLite 格式常數的政策值是一個退化輸入,而非真正的 PII;管道會以失敗關閉處理它,且該殘留物被記錄為已界定範圍。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

grahama1970/acceptance-contract

Turn a client brief, zip bundle, directory, or single requirements file into a typed acceptance-contract bundle with extracted requirements, acceptance checks, open questions, an immutable-goal draft, and a create-report-backed decision report. Use when users say acceptance contract, brief to requirements, freeze the goal, create immutable goal, amend immutable goal, build a Battle requirements bundle, or extract requirements from this bundle.

grahama1970/agent-ecosystem

Canonical map and shared contracts for the agent-governance ecosystem: the pi.receipt_envelope.v1 boundary envelope, the component graph, and the rules for which component owns which schema. Use when wiring a skill or extension into the shared receipt world, when asking how shame, triage-error, tau, ask, project-watchdog, ops-herdr, ponytail, and Memory fit together, or when validating an envelope.

grahama1970/agentic-evals

Agentic evaluation of skills using multi-trial fixtures, deterministic command assertions, trajectory checks, safety constraints, and evidence-backed readiness scoring. Use when users ask for agentic evals, multi-trial skill evaluation, skill trajectory validation, or readiness scoring for a skill workflow.

grahama1970/agent-inbox

File-based inter-agent messaging with headless dispatch. Check inbox, send bugs/requests to other projects, automatically spawn headless agents to fix bugs, and track progress via task-monitor.

grahama1970/agents-registry

Generate and query the centralized agent identity registry. Scans .pi/agents/*/AGENTS.md, parses frontmatter, outputs agents-registry.json and optionally syncs to /memory for semantic search.

grahama1970/agent-status

Artifact-driven status surfaces for long-running project-agent work. Maintains status.json, events.jsonl, proof manifests, and a stale-aware STATUS.html so humans can tell where the agent is, what passed, what is still unproven, and what decision or action is next — without dashboard theater.

grahama1970/align

Round-based context alignment before execution. Use when the human, project agent, WebGPT, scillm, ask, dogpile, memory, or project-knowledge may each hold different facts about a task; especially before ambiguous design, infographic, product workflow, high-stakes implementation, plan-iterate, project-infographic, or multi-review work.

grahama1970/analytics

Flexible data science analytics for any dataset. Auto-discovers schema, recommends charts, exports to create-figure. Works with JSONL, JSON, CSV from any source.

grahama1970/analyze-chatterbox-emotions

Evaluate generated Chatterbox voice files as voice-quality artifacts: affect match, arousal/valence proxies, pause placement, intelligibility inputs, clipping, loudness, and discontinuity flags. Use when reviewing Chatterbox emotional tags, pauses, Turbo/base affect delivery, Persona Dream utterance renders, or whether generated speech matches an intended product-facing affect.

grahama1970/analyze-elf

Reverse-engineer features from ELF binaries. Extracts CLI commands, state machines, protocols, Zod schemas, and data models. Automatically generates a /create-walkthrough prosecution brief with Mermaid diagrams. Uses /treesitter for AST analysis of bundled JS/TS source.

grahama1970/animation-vocabulary

Reverse-lookup glossary that turns a vague description of a web animation or motion effect into its exact term ("the bouncy thing when a popover opens" → Pop in; "the iOS rubber-band scroll" → Rubber-banding). Use when the user asks "what's it called when…", or describes a motion effect without knowing its name and wants the right word to prompt an AI or designer with. For naming an effect, not designing or building one.

grahama1970/anvil

Heavy-duty "No-Vibes" debugging and hardening orchestrator. Use this for complex, stubborn bugs where `review-code` has failed, or for "Red Teaming" (hardening) a codebase. Runs multiple agents in parallel (Thunderdome) using git worktree isolation.

grahama1970/apple-design

Apple's approach to interface design and fluid, physical motion, translated for the web. Use when building or reviewing gesture-driven UI, spring animations, drag/swipe/sheet interactions, momentum and interruptible transitions, translucent materials and depth, typography (optical sizing, tracking, leading), reduced-motion, or the design foundations (feedback, spatial consistency, restraint) behind Apple-style interfaces.

grahama1970/argue

Multi-persona structured debate orchestrator. Personas research via /dogpile, consult colleagues via /ask, and argue toward nuanced synthesis on complex questions.

grahama1970/arxiv

Search arXiv for papers and extract knowledge into memory. Use `search` to find papers, `learn` to extract knowledge.

grahama1970/ask

Use when the user asks to query project memory, ask an oracle, use supported browser-backed reviewers, run Tau roundtable/single-handler workflows, ask Pi-native subagents from within Pi, run persona/deep-review workflows, generate image prompts, check OS/project health through composed skills, or run an ask DAG. This skill is the executable /ask runtime; do not replace it with an informal subagent, plain web search, or hand-written review; inside Pi, explicit Pi-native subagent targets are routed through the pi-subagents tool as an Ask target type.

grahama1970/assess

Step back and critically reassess project state. Use when asked to "assess", "step back", "fresh eyes", "check alignment", "sanity check", "health check", "prune documentation", or "evaluate what's working". Offers documentation pruning and doc-code alignment analysis. Offer to run after major changes (don't auto-run).

grahama1970/assistant

Shared GPT + classifier inference gateway for persona monitor tasks. Routes validation and classification through a 4-tier cascade: heuristic → classifier → local GPT → scillm.

grahama1970/assistant-lab

Self-improvement workbench for /assistant. All the tools needed to diagnose, train, evaluate, and promote models in a continuous loop. The "warm pond" where /assistant evolves its own inference stack.

grahama1970/batch-quality

Pre-flight validation and quality gates for batch LLM operations. ACTUALLY tests samples through LLM before burning tokens. Uses SPARTA contracts for DuckDB validation queries. Integrates with task-monitor for enforced quality gates.

相關技能