$npx -y skills add woodfishhhh/EZ_math_model --skill user-corpus-explorerUse near the end of EZ_math_model intake when external/user-corpus contains user-provided papers, notes, PDFs, datasets, or examples that should become a local AGENTS.md reference index.
| 1 | # user-corpus-explorer — 用户资料库索引 |
| 2 | |
| 3 | ## 何时使用 |
| 4 | |
| 5 | - `external/user-corpus/` 存在用户自带参考材料。 |
| 6 | - `pipeline 00` 对该域决策不是 `skip`。 |
| 7 | - `pipeline 01` intake 结束前需要生成用户资料索引。 |
| 8 | |
| 9 | ## 设计原则 |
| 10 | |
| 11 | - 由 subagent 执行,不污染主对话上下文。 |
| 12 | - 每次覆盖生成 `external/user-corpus/AGENTS.md`。 |
| 13 | - 失败不打断主 pipeline。 |
| 14 | - 不上传全文到外部服务。 |
| 15 | |
| 16 | ## 扫描范围 |
| 17 | |
| 18 | 递归扫描 `external/user-corpus/`,跳过: |
| 19 | |
| 20 | - `.gitkeep` |
| 21 | - `README.md` |
| 22 | - `AGENTS.md` |
| 23 | - `.corpus_index.json` |
| 24 | - `.git/`、`.cache/`、以 `.` 开头的目录 |
| 25 | - 大于 200MB 的文件只记录路径和大小 |
| 26 | |
| 27 | ## 读取策略 |
| 28 | |
| 29 | | 扩展名 | 策略 | |
| 30 | |---|---| |
| 31 | | `.md` `.txt` | 读全文,超长读首尾 | |
| 32 | | `.pdf` | MinerU → pdf → pdfplumber,长文仅读首 15 页和末 5 页 | |
| 33 | | `.docx` | docx 提取文本 | |
| 34 | | `.html` | Jina Reader 或 BeautifulSoup | |
| 35 | | 图片 | 视觉描述 | |
| 36 | | 其他二进制 | 只记录元信息 | |
| 37 | |
| 38 | ## 输出 |
| 39 | |
| 40 | 生成: |
| 41 | |
| 42 | ```text |
| 43 | external/user-corpus/AGENTS.md |
| 44 | external/user-corpus/.corpus_index.json |
| 45 | ``` |
| 46 | |
| 47 | `AGENTS.md` 包含 inventory、per-file index、cross-cutting topics、recommendations、limitations。 |
| 48 | |
| 49 | ## 下游衔接 |
| 50 | |
| 51 | - modeler 必读 recommendations,并在 `modeling_plan.md` 标注参考来源。 |
| 52 | - writer 可优先把 corpus 中可验证 DOI 的论文列入参考候选。 |
| 53 | - coder 不直接读 corpus,除非 modeler 在计划中转述其方法。 |
| 54 | |
| 55 | ## 失败诊断 |
| 56 | |
| 57 | | 情况 | 处理 | |
| 58 | |---|---| |
| 59 | | corpus 目录为空 | 写空索引,pipeline 继续 | |
| 60 | | 单文件读取失败 | 在 limitations 记录 | |
| 61 | | MinerU 不可用 | 降级 pdf → pdfplumber | |
| 62 | | 总耗时超过 5 分钟 | 写已完成索引,剩余标 unread | |