rag-structure-fidelity
Skill1 starsChanged 3 months agoMITView on GitHub
Preserve structural fidelity during document intake for local RAG. Use when admitting md/doc/docx/pdf/lakebook materials, comparing Yuque outlines with正文, deciding whether structure is recoverable, or blocking scanned/image-only PDFs and unrecoverable critical blocks.
In this repository22 other files it gives its agents.
- analysis-skillSkill
- auto-testcase-generatorSkill
- create-agent-skillSkill
- create-skillSkill
- development-systemSkill
- domain-modelingSkill
- figma-rest-syncSkill
- grill-systemSkill
- grill-with-docsSkill
- rag-change-impactSkill
- rag-downstream-handoffSkill
- rag-governanceSkill
- rag-intakeSkill
- rag-querySkill
- rag-schemaSkill
- rag-systemSkill
- researchSkill
- session-handoffSkill
- skill-packagerSkill
- task-understanding-routerSkill
- ui-testSkill
- write-requirements-prdSkill
The file
Files
rag-structure-fidelity
把“结构可复原的文献”稳稳送入本地 RAG。第一版只做结构保真,不做治理裁决,不做下游包装。
适用场景
- 用户要把文档纳入本地知识库
- 用户要求只保留结构可复原的内容
- 用户提供
md正文、doc/docx/pdf或.lakebook - 用户要比较语雀目录与正文是否一致
- 用户要判断扫描件、图片型 PDF、表格、列表、图片引用是否可接受
核心规则
md是唯一正文输入。.lakebook/ 语雀只用于目录对照和备用来源。doc/docx/pdf只在可结构化恢复时处理。- 扫描件和图片型 PDF 硬阻断。
- 表格按整表判定,列表按整块判定。
- 正文中的图片保留引用和位置,不内嵌二进制。
- 关键规则区块必须能复原,否则阻断。
- 只生成候选证据和候选映射,不自动生成 RC。
- 不直接组下游包,统一交给
rag-downstream-handoff。
输出
admission_reportreject_reportstructure_map.jsonevidence.jsonvalidation_report
工作流程
- 识别输入格式与来源类型。
- 以
md正文为主抽取结构。 - 用
.lakebook做目录对照,不进入正文抽取。 - 按语义块判断可复原性。
- 对关键区块、表格、列表、图片引用执行阻断或保留。
- 生成候选证据与校验结果。
- 需要人工确认时,停止在候选层。
永远不要
- 自动扫描未授权磁盘目录
- 读取账号、Cookie、Token、密钥或未脱敏生产数据
- 自动生成 RC
- 自动把候选映射当作正式真值
- 直接输出下游执行包
参考文件
references/structure-policy.mdreferences/input-output-contract.mdreferences/validation-checklist.md
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.

