agentleFS
jsuchetjsuchet/jonathan-skills-lab/skills/brain-process/SKILL.md

brain-process

Skill1 starsChanged 5 months agoMITView on GitHub

Process everything in brain/inbox/. Classifies, extracts, files, and links each item. Produces a daily digest. Also runs as a daily scheduled task.

The file

Show its rules and text

We split this skill into the rules it gives an agent

30 rules. About 0 are common, 20 are distinctive, and 10 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈20

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 10

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If inbox is empty, report "Inbox is empty — nothing to process." and stop immediately (do NOT read brain-config.md, index.md, or any other …

    line 16
  2. Very specific:

    For .md files (Web Clipper clips): Before processing as text, read the file and check:

    line 39
  3. Very specific:

    If yes → extract the video URL and process using the video pipeline (see brain-config.md video rules): extract transcript via yt-dlp, …

    line 42
  4. Distinctive:

    If no → process as normal text/article.

    line 43
  5. Very specific:

    For links.txt: When processing each URL line, check if the URL matches a video pattern:

    line 45
  6. Very specific:

    If video URL → process using the video pipeline (yt-dlp transcript extraction, video template, type: video)

    line 46
  7. Distinctive:

    If non-video URL → fetch via WebFetch, process as article (unchanged)

    line 47
  8. Distinctive:

    Add frontmatter + inline [[wiki-links]]

    line 57
  9. Distinctive:

    Read image (multimodal — Claude can see it)

    line 68
  10. Distinctive:

    Create note with description + extracted info

    line 70
  11. Distinctive:

    Read file, split by newline (skip empty lines)

    line 74
  12. Distinctive:

    Create one note per URL

    line 78
  13. Very specific:

    Check for related existing notes, update related: fields bidirectionally

    line 85
  14. Distinctive:

    After all items processed, scan for ghost links with 3+ references

    line 92
  15. Very specific:

    If any found, create MOCs in mocs/ per brain-config.md MOC rules

    line 93
  16. Very specific:

    Update mocs/_Index.md with new MOCs

    line 94
  17. Distinctive:

    If new tags were introduced, they should already be added during processing

    line 97
  18. Distinctive:

    If a new subcategory seems warranted (5+ notes that don't fit existing subcategories), note this in the digest as a suggestion

    line 98
  19. Very specific:

    Check line count of brain/meta/log.md using Bash (wc -l)

    line 101
  20. Very specific:

    If >100 entries: archive to meta/log-archive/YYYY-QN.md (create directory if needed), then start fresh log.md with just the header

    line 102
  21. Distinctive:

    Add ALL newly created notes in the appropriate category sections

    line 153
  22. Distinctive:

    If a new category section is needed (e.g., first note in admin/), add the section header

    line 155
  23. Distinctive:

    Update the "Total: X notes" count in the header

    line 156
  24. Distinctive:

    Update "Last updated: YYYY-MM-DD"

    line 157
  25. Distinctive:

    Keep it under ~500 words

    line 174
  26. Distinctive:

    If a file can't be processed (corrupt PDF, empty file, etc.), leave it in inbox/ and note it in the digest under "Pending"

    line 188
  27. Very specific:

    If WebFetch fails for a URL, create a seed note with just the URL and mark status as seed with a note that fetching failed

    line 189
  28. Distinctive:

    If category is truly ambiguous for an item, file in the closest match and flag in digest

    line 190
  29. Distinctive:

    Always read brain-config.md after confirming inbox has items (step 1 checks inbox first)

    line 195
  30. Distinctive:

    Do not create duplicate notes — search before creating

    line 196

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “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

/brain-process

Inbox processing pipeline. Iterates all unprocessed files in brain/inbox/, processes each one, and produces a daily digest.

Steps

  1. Scan brain/inbox/ for all files (excluding .processed/ subdirectory and hidden files).
    • If inbox is empty, report "Inbox is empty — nothing to process." and stop immediately (do NOT read brain-config.md, index.md, or any other files).
    • List all found files with types.
  2. Read brain-config.md to load current taxonomy, filing signals, tags, and processing rules. Also read brain-config-rules.md if it exists (processing rules, MOC rules, digest format).
  3. For each file in inbox/, process sequentially:

    Detect file type

    • .md, .txt → text processing (but check for Web Clipper / video URL first — see below)
    • .pdf → PDF processing
    • .png, .jpg, .jpeg, .gif, .webp → image processing
    • links.txt → special: one URL per line, process each separately (with video detection — see below)
    • Other → attempt text read, fall back to noting as unprocessable

    Video URL detection (applies to .md files and links.txt)

    These URL patterns indicate video content:

    • youtube.com/watch
    • youtu.be/
    • youtube.com/shorts/
    • youtube.com/live/
    • vimeo.com/

    For .md files (Web Clipper clips): Before processing as text, read the file and check:

    1. Does it have a source: frontmatter field containing a video URL pattern?
    2. Does the body contain a video URL as primary content? If yes → extract the video URL and process using the video pipeline (see brain-config.md video rules): extract transcript via yt-dlp, create a type: video note with channel/duration/published frontmatter fields. If no → process as normal text/article.

    For links.txt: When processing each URL line, check if the URL matches a video pattern:

    • If video URL → process using the video pipeline (yt-dlp transcript extraction, video template, type: video)
    • If non-video URL → fetch via WebFetch, process as article (unchanged)

    Process content (per brain-config.md processing rules)

    Text files (.md, .txt):

    • Read content
    • Analyze: is this a thought, meeting notes, transcript, article, snippet, list of items?
    • Clean up formatting
    • Extract key points and structure into appropriate note type
    • Determine category via filing signals
    • Add frontmatter + inline [[wiki-links]]

    PDF files:

    • Read PDF content
    • Extract title, author, structure
    • Summarize each major section
    • Extract key data points
    • Create comprehensive note
    • Determine category via filing signals

    Images:

    • Read image (multimodal — Claude can see it)
    • Describe content, extract visible text
    • Create note with description + extracted info
    • Determine category based on content

    links.txt:

    • Read file, split by newline (skip empty lines)
    • For each URL: check if it matches a video URL pattern (youtube.com/watch, youtu.be/, youtube.com/shorts/, youtube.com/live/, vimeo.com/)
      • Video URL → process using video pipeline: extract metadata + transcript via yt-dlp, create type: video note with channel/duration/published fields, use video template from brain-config.md
      • Non-video URL → fetch via WebFetch, process as article (unchanged)
    • Create one note per URL

    File the processed note

    • Path: brain/{category}/{subcategory}[/{subsubcategory}]/{kebab-case-title}.md
    • Subsubcategory routing (when present in brain-config.md): If the chosen subcategory has subsubcategories: defined (e.g. personal/health-fitness/{endurance,strength,technique,nutrition-recovery}), match the content/tags against the subsubcategory signals: and file one level deeper. If the item has a subcategory: frontmatter field set to a path-like value (e.g. "health-fitness/endurance"), honor it directly as a hint rather than re-deriving.
    • Full YAML frontmatter
    • Structured body with inline [[wiki-links]] (3-8 per note)
    • Check for related existing notes, update related: fields bidirectionally

    Archive original

    • Move original file to brain/inbox/.processed/YYYY-MM-DD-{original-filename}
    • Never delete originals
  4. Check for new MOC opportunities:
    • After all items processed, scan for ghost links with 3+ references
    • If any found, create MOCs in mocs/ per brain-config.md MOC rules
    • Update mocs/_Index.md with new MOCs
  5. Check if brain-config.md needs updates:
    • If new tags were introduced, they should already be added during processing
    • If a new subcategory seems warranted (5+ notes that don't fit existing subcategories), note this in the digest as a suggestion
  6. Rotate log.md if oversized:
    • Check line count of brain/meta/log.md using Bash (wc -l)
    • If >100 entries: archive to meta/log-archive/YYYY-QN.md (create directory if needed), then start fresh log.md with just the header
  7. Generate daily digest at brain/meta/digests/YYYY-MM-DD.md:

    ---
    title: "Brain Digest — YYYY-MM-DD"
    type: digest
    created: YYYY-MM-DD
    ---
    
    ## Processed Today
    
    | Source | → | Destination | Type | Tags |
    |--------|---|-------------|------|------|
    | inbox/filename.pdf | → | admin/tax-finance/vat-rules.md | reference | #vat #taxation |
    
    ## Filed In
    
    - professional: X notes
    - admin: X notes
    - personal: X notes
    - creative: X notes
    
    ## New Tags Added
    
    - #new-tag (added because: reason)
    
    ## Links Created
    
    - [[Topic A]] now referenced by X notes
    - Connected: note-a.md ↔ note-b.md (shared topic: [[Topic]])
    
    ## New MOCs Created
    
    - mocs/Topic Name.md (X referencing notes)
    
    ## Pending
    
    - inbox/unprocessable-file.xyz (reason: unsupported format)
    
    ## Brain Stats
    
    - Total notes: X
    - By category: professional (X), personal (X), admin (X), creative (X)
    - MOCs: X
    - Inbox remaining: X
  8. Update index.md (ONCE for entire batch):
    • Read brain/index.md once
    • Add ALL newly created notes in the appropriate category sections
    • Entry format: - [[note-name]](category/subcategory[/subsubcategory]/note-name.md) — One-line summary. Tags: tag1, tag2
    • If a new category section is needed (e.g., first note in admin/), add the section header
    • Update the "Total: X notes" count in the header
    • Update "Last updated: YYYY-MM-DD"
    • Write back once
  9. Append to log.md (do NOT read the file — append only):
    • For each processed item, use Bash to append directly:
      echo '## [YYYY-MM-DD] ingest | {note-title}
      Filed to: {category}/{subcategory}. Source: {source type}. {X} wiki-links created.
      ' >> brain/meta/log.md
    • Batch all entries into a single append command
  10. Update hot cache (ONCE for entire batch):
    • Rewrite brain/meta/hot.md with:
      • Summary of this processing batch (what was processed, where it was filed)
      • Current brain shape (note counts, strongest clusters, growing edges)
      • Current themes based on recent additions
    • Keep it under ~500 words
  11. Report completion:
    📦 Processed {count} items from inbox
    Filed: {breakdown by category}
    New links: {count}
    Digest: meta/digests/YYYY-MM-DD.md
    Index: updated ({count} new entries)
    Log: {count} entries appended

Error handling

  • If a file can't be processed (corrupt PDF, empty file, etc.), leave it in inbox/ and note it in the digest under "Pending"
  • If WebFetch fails for a URL, create a seed note with just the URL and mark status as seed with a note that fetching failed
  • If category is truly ambiguous for an item, file in the closest match and flag in digest

Important

  • Process items one at a time, completing each before starting the next
  • Always read brain-config.md after confirming inbox has items (step 1 checks inbox first)
  • Do not create duplicate notes — search before creating
  • Batch all file updates (index.md, log.md, hot.md) — read/write each ONCE at the end, not per item
  • This skill is also run by the daily cron job. When run via cron, skip the interactive report and just produce the digest

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.