Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/meari-prototype/iftree-editor/smart-importnpx skills add Meari-Prototype/iftree-editor --skill smart-importgit clone --depth 1 https://github.com/Meari-Prototype/iftree-editorWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/meari-prototype/iftree-editor/smart-import)<a href="https://agentmods.dev/skills/meari-prototype/iftree-editor/smart-import"><img src="https://agentmods.dev/badge/skills/meari-prototype/iftree-editor/smart-import.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00095 | $0.02212 |
| Opus 5 | $0.00048 | $0.01106 |
| Sonnet 5 | $0.00019 | $0.00442 |
| Haiku 4.5 | $0.00010 | $0.00221 |
Grade A, and why
smart-import scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 121 lines — stays where its author put it; the contents beside it link to each section on GitHub.
智能导入 skill(projectneed 4-3)
把任意源文件整理成条件树文档并入库。本文写给执行导入的 LLM——内置 agent、外部模型、
或任何能跑脚本的工具都行:产物是与流式写入(db push)同一契约的 JSON,
经 db import-json 校验入库,不挑框架(4-3-4 去中心化)。
原则
- LLM 只贡献结构,不贡献正文。 正文
text必须是导入源的逐字节切片, 由你写的脚本机械切割产生——你不得复述、改写、润色、纠错任何正文字符。 校验器会逐字节比对,改一个字就过不了。 - 观察样本、写脚本,不要逐段标注。 读源文的开头/中间/结尾各一段, 识别这个文件特有的结构模式(标题行特征、编号体系、段落分隔), 然后写一个一次性脚本扫全文产出 JSON。规则零成本,token 按量计费。
- 你造的文字走专用字段。 原文没有标题而你需要分组时,建虚拟容器:
text留空,章节名写进nodeTitle,绝不把自己写的字混进text。 - 切到段落级,句子交给系统。 你只切到「章节 → 段落」两层:章节标题作 text 节点、
其下每个自然段作一个子 text 节点。不要自己切句子——产物 JSON 顶层加
"splitSentences": true, 入库后系统会用句末标点正则把每个段落自动细切成句子子节点(能用规则做的不劳你)。 也不要只切到章节那么粗:段落归属是规则识别不到、需要你判断的语义结构。
JSON 契约(与 db push 完全一致)
{
"title": "文档标题",
"splitSentences": true,
"nodes": [
{
"text": "第一章 总则",
"trustLevel": "不受控",
"children": [
{ "text": "本章第一段的正文……。", "trustLevel": "不受控" },
{ "text": "本章第二段的正文……。", "trustLevel": "不受控" }
]
},
{
"text": "第二章 罚则",
"trustLevel": "不受控",
"children": [
{ "text": "本章正文……。", "trustLevel": "不受控" }
]
}
]
}
字段规则:
address:可选,不用写——系统按 children 嵌套前序自动生成(顶层1-1、1-2…, 子节点为父地址 + 序号)。层级只用children嵌套表达即可,连续地址这种机械的事不用你算。text:源文的逐字节连续切片。切片允许去掉首尾空白,不得改动内部任何字符 (包括空格、标点、换行——跨行句子保留原换行符)。trustLevel:智能导入产物一律"不受控"(4-3-2-1)。nodeTitle:你构造的标题(虚拟容器的章节名)。真实标题行不用它—— 原文里存在的标题行本身就是一个text节点。- 虚拟容器(
text为空的节点):必须给数值sourcePosition, 取它后面第一个带正文的节点的句位序号减 0.5(句位序号 = 该节点在全部text非空节点的前序遍历中的序号,从 1 起)。相邻多个虚拟容器依次再减 (3.5、3.25 不必——用 3.5、3.4 等不冲突的小数即可,只为排序不碰撞)。 - 带正文节点的
sourcePosition可以省略:校验器锚定后自动回填句位。 nodeType缺省TEXT,导入阶段不做条件类型标注。
顺序铁律:树的前序遍历顺序必须与正文在源文中的出现顺序一致。 校验器按前序逐个在源文中向后匹配——你想重排章节顺序,那不是导入,别在这里做。
工作流
- 观察:读源文样本片段,写下这个文件的结构模式 (例:标题是独立行的「数字+顿号」;段落以空行分隔;含页眉「第 N 页」)。
- 写脚本:在 LLM 工作区(
.iftree-llm-workspace)写一个一次性 node 脚本, 读源文 → 按你识别的模式切割 → 输出tree.json。脚本要点: 按行/按模式定位结构边界,切到段落即可(句子层入库后由系统补);正文一律slice原文,不要重新拼写。 - 校验:
读返回的 JSON 报告,按db import-json <工作区>/tree.json <源文件路径> --dry-runmissing/out_of_order/uncovered三类错误修脚本重跑,直到ok: true:missing——正文在源文中不存在:九成是脚本改动了内部空白/换行, 或源文有不可见字符;对照textPreview定位。out_of_order——正文存在但位置在已消费区间之前:JSON 顺序与源文不一致, 检查脚本的遍历顺序。uncovered——源文有带字的区间没被任何节点覆盖:脚本漏切了这段,对照textPreview把它切进对应节点(系统不替你补、也不放行)。 地址、句子层由系统处理、你不用管:地址按 children 前序自动生成;段落正文由系统按句末标点切成 句子(段落本身变成空容器、句子作它的子)。但覆盖是你的事:纯空白(段落间空行、分页符)不用管、 靠段落空容器的位置表达边界;任何带字的区间(含装饰线 ⸻、漏掉的正文段)都得切进某个节点,否则报uncovered。
- 导入:去掉
--dry-run正式入库(需要向量时加--embed)。 命令自动完成:建文档(增量编辑模式)→ 批量建树 → 绑定源文档层与句位对照 (导入后的文档支持选区高亮与句位回溯)。 - 留档:脚本与
tree.json留在工作区,默认保留 30 天—— 它们是这次导入的证据链,可追溯、可重跑、可修正后重导。
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3d ago First seen · 121 lines · 95 tokens per session scan A f735c40a59d2
smart-import is a skill published in the GitHub repository Meari-Prototype/iftree-editor (5 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 95 tokens to every session and 2,212 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
gog
Google Workspace CLI for Gmail, Calendar, Drive, Contacts, Sheets, and Docs.
powerpoint
Create designed, editable PowerPoint .pptx presentations with PptxGenJS. Use when the user asks to create, generate, update, or inspect a deck, slide deck, presentation, or .pptx file.
wiki-lint
Audit and maintain the health of the Obsidian wiki. Use this skill when the user wants to check their wiki for issues, find orphaned pages, detect contradictions, identify stale content, fix broken wikilinks, or perform general maintenance on their knowledge base. Also triggers on "clean up the wiki", "what needs…
docx
使用 OpenXML SDK (.NET) 进行专业的 DOCX 文档创建、编辑和格式化。 三种管道:(A) 从零创建新文档,(B) 在已有文档中填充/编辑内容, (C) 应用模板格式化并通过 XSD 验证门控检查。 当用户需要生成、修改或格式化 Word 文档时,必须使用此 skill—— 包括他们说"写一份报告"、"起草建议书"、"制作合同"、 "填写此表单"、"按此模板重新排版",或任何最终输出为 .docx 文件的任务。 即使用户未明确提及 "docx",如果任务暗示生成可打印/正式文档,也应使用此 skill。.
pptx-generator
生成、编辑和读取 PowerPoint 演示文稿。使用 PptxGenJS 从零创建(封面、目录、内容、章节分隔、总结幻灯片),通过 XML 工作流编辑已有 PPTX,或使用 markitdown 提取文本。触发词:PPT、PPTX、PowerPoint、演示文稿、幻灯片、slide、deck、slides。.
Create, inspect, fill, reformat, and visually verify PDFs on Windows with local Python rendering. Use whenever a PDF must preserve deliberate layout, including Chinese text, tables, charts, covers, or form fields.