Format Detector logo

Format Detector

Organization
cas-bigdatalab
format_detector

接入资源格式识别工具。读取单个文件或目录中的接入资源,识别文本、表格、文档、图像、HTML、数据或未知类型,输出带推荐处理路由的格式识别结果文件。 当用户提到格式识别、资源类型预判、采集入口分流、为文本/表格/文档/图像/HTML 选择后续处理路径等需求时使用此 skill。 即使用户没有明确说出"格式识别",只要任务涉及在采集入口判断文件类型并分配推荐处理路由,就应该使用此 skill。 不负责读取正文内容、提取图像元信息、表格采集、文档解析、格式转换或实际执行后续处理。

Overview

Publishercas-bigdatalab
Repositorypiflow
Skill nameformat_detector
Stars
541
Forks
172
Bundled files
3
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 3 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by cas-bigdatalab on GitHub. Read the source before you install it.

Installation

Install the Format Detector AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/cas-bigdatalab/piflow/tree/master/workspace/skills/format_detector
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/cas-bigdatalab/piflow.git /tmp/piflow
mkdir -p .claude/skills
cp -r /tmp/piflow/workspace/skills/format_detector .claude/skills/format_detector
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Format Detector in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Format Detector on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Format Detector is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Format Detector 格式识别 Skill

功能概述

本 skill 用于在采集入口扫描文件资源,按扩展名和轻量内容特征识别资源基础类型,并输出推荐后续处理路由。

触发条件

当用户请求以下任务时,应使用此 skill:

  • 识别文件格式
  • 判断资源是文本、表格、文档、图像、HTML 还是数据文件
  • 为采集入口资源分配后续处理路由
  • 对混合目录做格式预识别
  • 降低异构资源进入流水线后的适配冲突

不适用于正文采集、图像元信息提取、表格读取、文档解析、格式转换或实际执行后续处理;这些任务需要使用对应的采集、解析或转换 skill。

核心参数说明

必需参数

参数说明
--input输入文件或目录路径
--output输出文件路径(格式识别结果)

可选参数

参数说明默认值
--recursive是否递归扫描子目录False
--output_format输出格式,支持 jsonl、json、csv、autojsonl

输入文件格式

输入可以是单个文件,也可以是包含多类文件的目录。目录模式会扫描所有普通文件并输出格式识别记录。

text
input_dir/
  notes.txt
  station_table.csv
  report.pdf
  image.png
  payload.json
  nested/raw.bin

使用方法

递归识别目录并输出 JSONL

bash
python scripts/run_format_detector.py \
  --input ./input_dir \
  --output ./format_detector_output.jsonl \
  --recursive true \
  --output_format jsonl

识别单个文件并输出 JSON

bash
python scripts/run_format_detector.py \
  --input ./notes.txt \
  --output ./format_detector_output.json \
  --output_format json

处理示例

输入文件识别类型推荐路由
notes.txttexttext_collector
station_table.csvtabletable_collector
report.pdfdocumentpdf_collector
image.pngimageimage_collector
payload.jsondatacontent_parser
page.htmlhtmlcontent_parser
raw.binunknownmanual_review

输出示例

json
{"file_path": "notes.txt", "filename": "notes.txt", "extension": ".txt", "category": "text", "content_format": "plain_text", "recommended_route": "text_collector", "file_size": 128, "detected_at": "2026-06-12 14:00:00"}

环境要求

使用仓库内 Python 环境运行;Windows bash 下建议加 PYTHONIOENCODING=utf-8 避免中文控制台编码问题。脚本仅使用 Python 标准库。

注意事项

  1. 本 skill 只做格式识别和推荐路由,不读取完整正文或执行后续处理。
  2. --recursive false 时只扫描输入目录第一层文件。
  3. file_path 输出为相对输入根目录路径,不能包含本地绝对路径。
  4. 未识别扩展名会归类为 unknown,推荐路由为 manual_review。

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Format Detector AI skill do?

接入资源格式识别工具。读取单个文件或目录中的接入资源,识别文本、表格、文档、图像、HTML、数据或未知类型,输出带推荐处理路由的格式识别结果文件。 当用户提到格式识别、资源类型预判、采集入口分流、为文本/表格/文档/图像/HTML 选择后续处理路径等需求时使用此 skill。 即使用户没有明确说出"格式识别",只要任务涉及在采集入口判断文件类型并分配推荐处理路由,就应该使用此 skill。 不负责读取正文内容、提取图像元信息、表格采集、文档解析、格式转换或实际执行后续处理。

Why use Format Detector on TypingMind?

Because you install it once and use it with any model. Format Detector is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Format Detector in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/cas-bigdatalab/piflow/tree/master/workspace/skills/format_detector. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Format Detector?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Format Detector?

As many as you like. As long as a model supports skills, you can use Format Detector with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Format Detector AI skill free?

It is published on GitHub by cas-bigdatalab. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇