SimHacker avatar

worm

Two-pointer reversible cursor worms for traversal and dataflow

作者 SimHacker|オープンソース

Worm 🪱

Two-pointer reversible cursor for filesystem traversal and data pipelines.

Overview

A worm is a two-pointer cursor (head + tail) that can:

  • Crawl directories and follow links
  • Ingest content (EAT/CHOMP) into a normalized buffer
  • Emit data at head or tail (POOP/BARF)
  • Pipe between documents or into a worm network
flowchart LR
    Tail["TAIL<br/>POOP here"] --> Buffer["buffer / payload / active_tokens"] --> Head["HEAD<br/>EAT here"]

The Reversible Verb Basis

The worm's verbs form a reversible basis for undo/redo:

VerbActionReverse
EATIngest at headBARF
CHOMPPattern-scan + ingestBARF
POOPEmit at tailEAT
BARFEmit at headEAT
STICK-UP-BUMInject dataPOOP

"Every EAT has a POOP. Every CHOMP has a BARF."

Quick Start

"Move the worm to skills/adventure/"
"EAT the CARD.yml"
"POOP what you learned to .moollm/skills/worm/out/"

Movement

VerbEffect
MOVE-WORMMove head (and optionally tail)
MOVE-HEADMove head only
MOVE-ASSMove tail only
NEXT-UNITAdvance head by char/word/sentence/paragraph/section/page
PREV-UNITMove head backward by unit
SELECT-RANGESelect N units into buffer

Tree Navigation

TREE-UP / TREE-DOWN / TREE-NEXT / TREE-PREV
TREE-OPEN / TREE-CLOSE / TREE-HIDE / TREE-SHOW

Worm Variants

VariantBehavior
BulldozerMoves and overwrites
Link-hopperFollows symlinks like an inchworm
MapperMaps trees, leaves markers
DreamSpeed-of-light ephemeral synthesis
TreeClimbs hierarchies with context
SearchCrawls search results

Use Cases

Copy with Transform

1. CHOMP source (pattern-aware)
2. Tokens normalize in buffer  
3. POOP to destination

Doc-to-Doc Pipeline

Head in doc A, tail in doc B
EAT from A → POOP to B
Streaming pipeline!

Casting Network

Worm A: POOPs YAML to emit_dir
Worm B: EATs from emit_dir → POOPs processed output
Worm C: Builds taxonomy from B's castings

State

head: "."           # Current head position
tail: "."           # Current tail position
buffer: []          # Ingested content
payload: null       # Last consumed chunk
active_tokens: []   # Parsed tokens in worm's "brain"
emit_dir: ".moollm/skills/worm/out"
reversible: true    # Enable undo/redo basis

Integration

SkillHow Worm Integrates
adventureWorm traverses rooms, head = location
roomRooms expose FEED-WORM ads
buffFAST-CRAWL, CLEAN-CASTINGS buffs
data-flowWorms are streaming cursors

Safety

  • Default to NOP if path unclear
  • Avoid ingesting secrets/PII
  • Respect read/write boundaries
  • Reversible ops enable rollback

Files

FilePurpose
CARD.ymlInterface, advertisements, methods
SKILL.mdProtocol documentation
README.mdThis file

Lineage

Inspired by the LLOOOOMM worms (bulldozer, link-hopper, mapper, dream, tree) and inchworm cursors in editors.

worm - AI Agent Skill for Claude Code & Cursor | Agent Skills