smart-import

smart-import is a skill for Claude Code, Codex from Meari-Prototype/iftree-editor. It costs 95 tokens per session (2,309 once invoked), scanned A, original, Apache-2.0.

A document-import tool that turns any source file into a structured document tree while keeping its text exactly unchanged.

In plain words
What is it for?
Use it to import files by identifying their sections and paragraphs, generating validated JSON, and letting the system split paragraphs into sentences.
Why use it?
It separates structural work from writing, so imported content is not accidentally rewritten, corrected, or altered.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to import files by identifying their sections and paragraphs, generating validated JSON, and letting the system split paragraphs into sentences.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/meari-prototype/iftree-editor/smart-import
Install

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.

Any agent
npx skills add Meari-Prototype/iftree-editor --skill smart-import
Clone the repo
git clone --depth 1 https://github.com/Meari-Prototype/iftree-editor

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for smart-import

README.md
[![agentmods](https://agentmods.dev/badge/skills/meari-prototype/iftree-editor/smart-import/github.svg)](https://agentmods.dev/skills/meari-prototype/iftree-editor/smart-import)
Your own site
<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/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for smart-import

Your own site · 80×15
<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="Reviewed on agentmods" width="80" height="20"></a>
Per session 95 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,309 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00095 $0.02309
Opus 5.5 $0.00038 $0.00924
Sonnet 5.5 $0.00019 $0.00462
Haiku 4.5 $0.00010 $0.00231

Measured 1mo ago against content hash fa23461cf1fb, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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 1mo 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.

.iftree-llm-workspace/skills/smart-import/SKILL.md · 122 lines

How it starts

The opening of the file, as written. The whole thing — 122 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 去中心化)。

原则

  1. LLM 只贡献结构,不贡献正文。 正文 text 必须是导入源的逐字节切片, 由你写的脚本机械切割产生——你不得复述、改写、润色、纠错任何正文字符。 校验器会逐字节比对,改一个字就过不了。
  2. 观察样本、写脚本,不要逐段标注。 读源文的开头/中间/结尾各一段, 识别这个文件特有的结构模式(标题行特征、编号体系、段落分隔), 然后写一个一次性脚本扫全文产出 JSON。规则零成本,token 按量计费。
  3. 你造的文字走专用字段。 原文没有标题而你需要分组时,建虚拟容器: text 留空,章节名写进 nodeTitle,绝不把自己写的字混进 text。
  4. 切到段落级,句子交给系统。 你只切到「章节 → 段落」两层:章节标题作 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,导入阶段不做条件类型标注。

顺序铁律:树的前序遍历顺序必须与正文在源文中的出现顺序一致。 校验器按前序逐个在源文中向后匹配——你想重排章节顺序,那不是导入,别在这里做。

工作流

  1. 观察:读源文样本片段,写下这个文件的结构模式 (例:标题是独立行的「数字+顿号」;段落以空行分隔;含页眉「第 N 页」)。
  2. 写脚本:在 LLM 工作区(.iftree-llm-workspace)写一个一次性 node 脚本, 读源文 → 按你识别的模式切割 → 输出 tree.json。脚本要点: 按行/按模式定位结构边界,切到段落即可(句子层入库后由系统补);正文一律 slice 原文,不要重新拼写。
  3. 校验:
    db import-json <工作区>/tree.json <源文件路径> --dry-run
    
    读返回的 JSON 报告,按 missing / out_of_order / uncovered 三类错误修脚本重跑,直到 ok: true:
    • missing——正文在源文中不存在:九成是脚本改动了内部空白/换行, 或源文有不可见字符;对照 textPreview 定位。
    • out_of_order——正文存在但位置在已消费区间之前:JSON 顺序与源文不一致, 检查脚本的遍历顺序。
    • uncovered——源文有带字的区间没被任何节点覆盖:脚本漏切了这段,对照 textPreview 把它切进对应节点(系统不替你补、也不放行)。 地址、句子层由系统处理、你不用管:地址按 children 前序自动生成;段落正文由系统按句末标点切成 句子(段落本身变成空容器、句子作它的子)。但覆盖是你的事:纯空白(段落间空行、分页符)不用管、 靠段落空容器的位置表达边界;任何带字的区间(含装饰线 ⸻、漏掉的正文段)都得切进某个节点,否则报 uncovered。
  4. 导入:去掉 --dry-run 正式入库(需要向量时加 --embed)。 命令自动完成:源路径查重 → 建文档 → 批量建树(期间临时切增量编辑模式,结束切回完整模式) → 绑定源文档层与句位对照(导入后的文档支持选区高亮与句位回溯)。写入中途失败会删除已建的文档(删除也失败时,残留文档须手动删掉才能重导)。 同一份源文已经导入过时,正式导入会报重复(--dry-run 在查重之前返回,不会提示);要重导须先删除旧文档。
  5. 留档:脚本与 tree.json 留在工作区,默认保留 30 天—— 它们是这次导入的证据链,可追溯、可重跑、可修正后重导(重导前先删除旧文档)。

Read the full file on GitHub · 122 lines

Changes

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.

  1. 1mo ago Changed · +1 lines fa23461cf1fb
  2. 1mo ago First seen · 121 lines · 95 tokens per session scan A f735c40a59d2

Subscribe to this mod's changes

smart-import is a skill published in the GitHub repository Meari-Prototype/iftree-editor (6 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 95 tokens to every session and 2,309 once invoked, about $0.0004 per session on Opus 5.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.

Related

Other skills, from other repositories

openkb-deck-neon

A skill for creating a single-file HTML slide deck from content stored in OpenKB, a knowledge-base chat system. It defines a dark, high-tech visual style using neon colors, glow effects, and glass-like panels.

VectifyAI/OpenKB · 173 tokens

openkb-deck-editorial

A tool for creating a single-file HTML slide presentation from compiled knowledge-base content. Its visual style uses a warm cream background, serif typography, and brick-red accents.

VectifyAI/OpenKB · 117 tokens

create-an-asset

Build a customer deck, one-pager or leave-behind from your account data, call notes and approved materials, with no made-up numbers. Use when the user asks for a sales asset, one-pager, deck, leave-behind, "create an asset for [prospect]", or "make something for [account]".

Bevel-Software/Hexis · 72 tokens

wiki-knowledge-agent

Turn chat-pasted text/links into a verified, translated, searchable wiki knowledge base. When a user pastes a link or text (in ANY channel — Discord, Slack, CLI, etc.), fetch+verify it, classify it (useful vs ad), translate+summarize it into the target language, save it to the wiki, and optionally alert on…

atukunare/wiki-knowledge-agent · 141 tokens

second-reader

Build and run a source-verified Markdown knowledge vault (opens as an Obsidian vault). Ingests books, PDFs, transcripts, and articles into atomic, cross-linked, cited notes, then gates every note and every answer behind an independent verification pass that re-reads the source cold and loops until a round finds…

mplind/second-reader · 191 tokens

wiki-ingest

A workflow for bringing URLs, files, and pasted external material into a LoreKit knowledge collection, then saving it as wiki pages with source links and tracking records.

GYF0311/lorekit · 62 tokens