Batch Collector logo

Batch Collector

Organization
cas-bigdatalab
batch_collector

批量文件清单采集器。扫描一个或多个本地文件/目录,或从任务列表加载路径, 按支持的扩展名生成文件元信息清单,供后续文本、表格、文档、图像等采集流程继续处理。 当用户需要批量盘点待采集文件、生成本地文件 manifest、统计输入文件类型或为后续采集算子准备文件清单时使用此 skill。

Overview

Publishercas-bigdatalab
Repositorypiflow
Skill namebatch_collector
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 Batch Collector 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/batch_collector
  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/batch_collector .claude/skills/batch_collector
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Batch Collector 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 Batch Collector 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 Batch Collector 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.

Batch Collector 批量文件清单采集器

功能概述

本 skill 用于批量扫描本地文件或目录,生成“待采集文件清单”。它不会读取、清洗或解析文件正文,只记录文件路径、文件名、扩展名、大小、采集时间和任务序号等基础元信息。

它适合放在采集流程入口,用来把一批本地资源整理成统一 manifest,再交给 text_collector、table_collector、image_collector 等后续算子继续处理。

触发条件

当用户提出以下需求时,应使用本 skill:

  • 批量盘点本地待采集文件
  • 扫描一个或多个输入目录并生成文件清单
  • 统计输入文件的扩展名分布
  • 为后续采集/解析/校验流程准备 manifest
  • 从任务列表批量加载待处理路径

不处理什么

  • 不读取文件正文
  • 不清洗文本内容
  • 不解析 CSV、JSON、PDF、DOCX 等内部结构
  • 不判断文件内容质量
  • 不执行真实下载、爬取或远程采集

核心参数说明

必需参数

参数说明
--output输出文件路径

输入参数

参数说明
--input一个或多个文件/目录路径,与 --task_list 二选一
--task_list任务列表文件,支持 json 或 txt,与 --input 二选一

可选参数

参数默认值说明
--recursivefalse是否递归扫描子目录
--file_types脚本默认支持类型指定允许采集的扩展名,如 txt csv pdf
--batch_size0进度报告间隔,0 表示不按批次报告
--output_formatjsonl输出格式:jsonl、json、csv 或 auto

输入文件格式

目录输入

text
input_dir/
  alpha.txt
  beta.csv
  config.json
  nested/
    deep.md
  skip.exe

文本任务列表

text
workspace/data/a.txt
workspace/data/b.csv
workspace/data/docs

JSON任务列表

json
[
  "workspace/data/a.txt",
  "workspace/data/b.csv",
  "workspace/data/docs"
]

输出格式

默认输出 JSONL,每行代表一个被采集到的文件:

json
{"file_path": "workspace/data/a.txt", "filename": "a.txt", "extension": ".txt", "file_size": 123, "collected_at": "2026-06-10 10:00:00", "task_index": 1, "total_tasks": 2}

字段含义:

字段说明
file_path相对输入根目录的文件路径
filename文件名
extension扩展名
file_size文件字节数
collected_at清单生成时间
task_index当前文件序号
total_tasks本次输出文件总数

使用方法

扫描单个目录

bash
python scripts/run_batch_collector.py \
  --input ./data \
  --output ./batch_result.jsonl \
  --recursive true

扫描多个路径

bash
python scripts/run_batch_collector.py \
  --input ./papers ./tables ./images \
  --output ./batch_result.jsonl \
  --recursive true

只采集指定扩展名

bash
python scripts/run_batch_collector.py \
  --input ./data \
  --output ./result.jsonl \
  --file_types txt csv pdf

从任务列表加载路径

bash
python scripts/run_batch_collector.py \
  --task_list ./tasks.txt \
  --output ./batch_result.jsonl

输出示例

命令行输出:

text
[OK] Batch collection completed!
   Input paths: 1
   Total files collected: 5
   File type distribution:
     - .csv: 1
     - .json: 1
     - .md: 1
     - .txt: 2
   Output: ./batch_result.jsonl

JSONL输出:

jsonl
{"file_path": ".../alpha.txt", "filename": "alpha.txt", "extension": ".txt", "file_size": 20, "collected_at": "2026-06-10 10:00:00", "task_index": 1, "total_tasks": 5}
{"file_path": ".../beta.csv", "filename": "beta.csv", "extension": ".csv", "file_size": 24, "collected_at": "2026-06-10 10:00:00", "task_index": 2, "total_tasks": 5}

环境要求

本 skill 使用 Python 标准库实现,无需额外安装第三方依赖。请使用项目虚拟环境运行:

bash
.\.venv\Scripts\python.exe scripts/run_batch_collector.py --help

注意事项

  1. --input 和 --task_list 至少提供一个。
  2. --recursive true 才会扫描子目录。
  3. --file_types 只控制扩展名筛选,不检查文件内容是否真实符合该格式。
  4. 输出清单中的 file_path 是后续算子可继续读取的文件路径。
  5. 如果需要正文抽取、表格解析、图像检查或内容校验,应交给后续专用 skill。

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 Batch Collector AI skill do?

批量文件清单采集器。扫描一个或多个本地文件/目录,或从任务列表加载路径, 按支持的扩展名生成文件元信息清单,供后续文本、表格、文档、图像等采集流程继续处理。 当用户需要批量盘点待采集文件、生成本地文件 manifest、统计输入文件类型或为后续采集算子准备文件清单时使用此 skill。

Why use Batch Collector on TypingMind?

Because you install it once and use it with any model. Batch Collector 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 Batch Collector in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/cas-bigdatalab/piflow/tree/master/workspace/skills/batch_collector. 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 Batch Collector?

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 Batch Collector?

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

Is the Batch Collector 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 👇