Twig

Skills, macros & scripts

Remember how. Run safe on phone. Real code only on laptop.

Skills = agent remembers how it did thing last time. Prose. Not code. Stored in home. Loaded into context by name when useful.

Skills

Path: skills/<slug>/SKILL.md

FieldJob
nameTitle
descriptionOne line. Prompt lists this so agent picks skill.
bodyFull how-to
authoredByDreamDream wrote it? True.

Dreams can invent skills when you keep asking same thing (propose-skillDreams).

Macros

Macro = declarative tool chain. JSON in macros/<slug>.json. Phone-safe because it only calls tools that already exist. Args are:

  • literals, or
  • earlier step output ({ "$step": 0, "path": "text" }), or
  • caller input ({ "$input": "name" })

Max 20 steps. Longer = script in disguise. We reject disguise.

Scripts

Real code: scripts/*.ts. Only laptop companion runs this. Phone never evals random TS from agent home. That boundary is the whole security story for code.

Tool ran on companion? Message says ranOnCompanion: true. Transcript honest.

Brain picture

skills/   → prose how-to (context)
macros/   → safe tool chains (phone ok)
scripts/  → real code (companion only)

Agent picks skill by description. Runs macro when steps fit. Escalates to script only when USB companion present and work needs real runtime.