1实现原理 · 为什么它能做到
整条流水线由一份 SKILL.md 的 8 步指令 + 模型阅读构成,目录内没有任何脚本:抽取靠 shell,理解靠模型,汇总靠固定报告模板。
Extract, categorize, and analyze Google Takeout ZIP exports of Gemini Apps activity. The skill handles:
先判类型再选策略:抽样 3-5 个文件,用「说话人标签 / 内容形态 / 长度分布 / 文件命名」四个信号区分「会议转写」还是「提示-应答」,两类走不同的分析路线。
Before full analysis, sample 3-5 files to determine the **conversation type**:
抽取环节有明确的技术选型理由:macOS 自带 unzip 会静默损坏中文文件名,所以必须用 unar。
Google Takeout files contain Chinese/Unicode filenames. **macOS `unzip` corrupts these — always use `unar`.**
先清点后阅读:用 find + sed/uniq 统计扩展名分布、列 txt 清单、按类型算体积,建完清单再决定读什么。
find <extract-dir> -type f | sed 's/.*\.//' | sort | uniq -c | sort -rn
关键词检索被明确定位为「第一步而不是答案」:必须回读命中处前后 10 行上下文再判定,并把命中分三类。
**Read surrounding context** (10 lines before/after each match) — keyword matching alone produces massive false positives. "Investment" can mean business strategy, "option" can mean UI choice, "fund" can mean insurance feature
PII 的处理方式是「标记但不誊抄」:发现简历/背调/联系人这类内容要写进报告的风险项,但绝不把内容抄进报告或 memory。
- File: <name>, Type: <resume/background-check/etc.>, Risk: <high/medium/low>
大文件分层读、超大集合并行读,都是为了守住上下文预算:单文件读首尾各 10%,100+ 文件派并行 sub-agent 每批 10-15 个。
For 100+ files, spawn parallel sub-agents to read and summarize in batches (10-15 files each). Merge results. One agent reading all files sequentially will exhaust context.
输出结构固定为 7 节报告(概览/话题分布/关键发现/领域专项/值得注意的文档/有价值原话/PII 风险),可选再落 memory 文件。
# Gemini History Analysis Report
可选产物 memory 文件有明确协议:遵循项目既有 memory 格式、带 originSessionId 溯源、更新 MEMORY.md 索引、不重复已有内容。
- Include `originSessionId` or source tag pointing back to the analysis
收尾清理需用户确认:分析完成后才 rm -rf 解包目录。
# Remove extracted files after analysis complete (user confirms)
2核心能力
3外部依赖
| Kind | Dependency / Endpoint |
|---|---|
| cli | unar(解包 Takeout ZIP,处理中文文件名) |
| package | Homebrew(仅在 unar 缺失时安装;命令带 2>/dev/null || true 容错) |
| cli | find / sed / sort / uniq / du(清单与统计) |
| cli | grep(领域关键词检索,随后必须人工回读上下文) |
| cli | rm(分析完成后清理解包目录,需用户确认) |
| api | 宿主 sub-agent 能力(100+ 文件时并行批处理) |
4管控建议与判定依据
- 网络端点: 声明外部网络访问: 唯一潜在出网动作是 brew install unar——仅在 unar 缺失时执行,经 Homebrew 拉取第三方包;SKILL.md 用 2>/
- 本地工作目录: 文件读写与工件输出: <output-dir>/**:unar 解出的全部 Takeout 内容(txt 转写、图片、音视频、PDF/Office 文档、嵌套 zip)
5第二遍独立确认
- [ok] 是否真的没有脚本(避免凭 description 臆测) — glob 结果:仅 SKILL.md。所有「处理」都是写在文档里让 agent 用通用 shell/工具执行的命令,非自带可执行文件。scripts_executed = []。
- [discrepancy] spawn 命中是否等于进程创建 — 〔第二遍标注:扫描器误报,已澄清〕SKILL.md 原文为『spawn parallel sub-agents to read and summarize in batches』,指宿主的 sub-agent 能力;全文件无 child_process / subprocess / exec / eval。
- [ok] brew install 是否被夸大成依赖 — 命令为 brew install unar 2>/dev/null || true,位于『Install unar if missing』注释下,失败被吞掉;SKILL.md 未把它列为前置条件(前置条件段落只说要 macOS 与 Takeout zip)。已在 external_deps 与 network_calls 中标为条件性、尽力而为。
- [discrepancy] rm -rf 的危险性是否被如实标注 — 〔第二遍标注:第一遍低估,已加强〕Step 8 的清理命令确为 rm -rf <extract-dir>,作用是删除解包出来的整棵目录树。命令上方注释写了『(user confirms)』,但这是文档级约束、无技术强制;已在 file_writes 与 verdict.risks 中单列,并指出它同时是隐私卫生措施(不留私人历史副本)——两个动机都要讲,避免读者只看到「破坏性」。
- [ok] PII 保护是否只是声明 — 报告第 7 节模板字段(File / Type / Risk)本身就是「不含内容」的结构;Pitfalls 4 条再次强调 do NOT include their contents;memory 段落要求 PII 摘要而非复制。三处一致,属可执行的结构性约束。
- [ok] 关键词检索纪律是否与实测证据一致 — Step 5 的四步(设计词表 → grep 全部文件 → 回读前后 10 行 → 三分类后全文重读)与 Pitfalls 2 的实测结论(80%+ 命中全为假阳性)互相印证,报告第 4 节要求列出假阳性条数与原因——方法、证据、交付物三者闭环。
- [ok] memory 写入是否有副作用管理 — Step 7 限定三个触发条件、要求遵循项目既有 frontmatter 约定、要带 originSessionId 溯源、要更新 MEMORY.md 索引、且『Never duplicate what's already in memory — update existing files instead』。副作用有明确协议。
- [ok] 元数据(license/stars/last_push) — 取自同 repo 同 commit 的池内既有值(MIT、1385★、2026-09-09T12:33:29Z);本次未联网复核 gh。
6结论
16d58ad7768cadfe…