agentleFS
23blocks-OS23blocks-OS/lolabot/skills/file-processing/SKILL.md

file-processing

Skill8 starsChanged 43 days agoMITView on GitHub

Classify, file and index documents, and extract the facts in them into the user's memory. Use when a document needs classifying, filing or indexing, such as a new PDF, scan or photo of an ID, contract, certificate, medical or financial record.

3 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions3 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 3

    1. baidu-baige/LoongFlow★ 480same name
    2. aws-samples/sample-strands-agents-agentskills★ 90same name
    3. hi-space/strands-agentskills★ 0same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository4 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read PDFs, images and text with the Read tool.

    line 13

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

File Processing

Processing a document means four things, all of them: read it, move it to its permanent folder, index it at the new path, and save the facts it contains to the user's memory. Stopping after any one of these leaves the document unfindable or its facts unknown.

1. Read it

Read PDFs, images and text with the Read tool. Note the document type, the people in it, dates, and the facts the user would later ask about. Convert HEIC photos first with $LOLABOT_HOME/tools/heic-convert.sh <file-or-folder> (JPGs go to /tmp/heic-converted/).

2. Move it to its permanent folder

DocumentFolder
The user's own ID (passport, national ID, police certificates)~/documents/personal/id/
Military records~/documents/personal/military/
A family member's documents~/documents/personal/<name>/
Legal (contracts, divorce)~/documents/legal/<category>/
Migration and immigration~/documents/legal/migration/
Medical records and bills~/documents/medical/
A company's documents~/<Company>/documents/ (the company's folder, not personal documents)
Someone else's documents (a contact or third party)~/documents/contacts/<name>/

The companies and their folders are listed under "Companies & Projects" in CLAUDE.md. Create folders with mkdir -p as needed.

New documents usually arrive in the transport folder, the instance's drop folder (if CLAUDE.md does not say where it is, ask the user). Transport is a drop zone, not storage: move each file out, and once it is indexed at its new path, delete the original from transport.

3. Index it

$LOLABOT_HOME/tools/files.sh add "<new path>" -d "<one-line description>" -t "<tags>"
$LOLABOT_HOME/tools/files.sh scan <folder> --tags "<tags>"     # a whole folder (--no-recursive, --pattern '*.pdf')
$LOLABOT_HOME/tools/files.sh find "<query>"                     # check it is findable

Tags: the document type (personal, legal, medical, business), the person's name if it is about someone, and the category (id, passport, divorce, migration...). The description is what search matches on, so say what the document is and whose it is.

4. Save the facts to the user's memory

$LOLABOT_HOME/tools/memory.sh add "<fact>" --type fact|event|person --tags "<tags>" \
    [--date YYYY-MM-DD] [--people "<names>"] [--files "<path>"] [--source "<document>"]
The document containsTypeExample
ID numbers, birth dates, addresses, balances, expiry datesfact"Sam's passport expires 2030-01-01"
Something that happened on a dateevent"Sam was born on 2012-03-03"
Who someone is to the userperson"Jordan Rivera is Alex's cousin"

Pass --files with the document's new path and --source with its name, so the fact can be traced back. Skip facts memory already has and trivial details. Passwords, PINs and other credentials do not go into memory. Follow the pa-memory-delegation skill for evolving facts (a new address replaces the old one) and for saving to the matching markdown file as well.

files.sh and memory.sh activate the virtualenv themselves.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.