Sample patterns

~5 min read

Sample patterns

Copy-pasteable patterns for common vault automations. Drop these into .lettuce/triggers.yml or .lettuce/schedules.yml.

Inbox processor

When a note lands in Inbox/, splice a directive asking the connected agent to triage it — file daily notes, tag the rest.

A trigger rule does exactly one thing: when a new file matches the glob, it splices a > [!ai] <prompt> directive into that note (idempotent). The agent picks it up via pending_directives and does the real work.

# triggers.yml
- when: "file:created:Inbox/**"
  prompt: |
    Triage this inbox note. If the title looks like a date
    (YYYY-MM-DD), move it to Daily/. Otherwise add the tag
    #untriaged. Use search to discover existing tags first.

The glob is the only condition — there are no if: predicates, no move-to/add-tag/shell actions, and no notifications built into the trigger itself. The deciding and moving happen in the agent’s response to the directive.

Once a week, ask the connected agent to find and propose fixes for broken wikilinks.

A schedule fires at a fixed daily/weekly time and splices its prompt as a > [!ai] directive into the target note. There is no cron, no agent: block, and no event like link:broken — the agent finds the broken links itself when it reads the directive.

# schedules.yml
- weekly: "Mon 09:00"
  target: "Maintenance/link-audit.md"
  prompt: |
    Scan the vault for broken wikilinks. For each one, either
    propose an edit fixing it to a matching alias / similar note,
    or propose removing the link if no good target exists.
    Record what you found and fixed here in this note.

Daily digest

End-of-day rollup of what was created and modified.

# schedules.yml
- daily: "18:00"
  target: "Daily/digest.md"
  prompt: |
    Build today's digest in this note (overwrite the body).
    Use search and read_note to find notes touched today,
    group them by tag, and format with H2 sections.

There is no {{ today }} templating, so point target at a stable note (or let the agent create dated notes from inside its directive). The schedule only delivers the prompt at 18:00; the agent assembles the digest.

Tag auto-suggester

When a new note lands in Inbox/, ask an agent to propose a few tags.

# triggers.yml
- when: "file:created:Inbox/**"
  prompt: |
    Read this note. If it has no tags and enough body to judge,
    propose adding 2-3 tags. Prefer tags that already exist in the
    vault (call search to discover them). If the note is too short
    or already tagged, do nothing.

The trigger fires on every new note under Inbox/; the “only if untagged / long enough” logic lives in the prompt, because triggers have no if: predicates. The agent reads the note via the directive and proposes the edits.

Reading-list ingest

Drop one URL per file into Inbox/links/; an agent turns each into a structured note.

# triggers.yml
- when: "file:created:Inbox/links/**"
  prompt: |
    This note holds a single URL the user wants to read. Ingest it
    (use lettuce's ingest, or whatever fetch tools you have) and turn
    it into a structured note in Reading/ with:
      - frontmatter: title, source, captured, tags
      - body: # Title, then ## Summary / ## Quotes / ## Takeaways
    Then replace this note's body with a [[wikilink]] to the new note.

A trigger only fires on file:created, so use one new file per link rather than appending lines to a shared links.md. The directive lands in the new note, and the agent does the fetching and writing.

Stale-proposal cleanup

Withdraw old proposals once a week.

# schedules.yml
- weekly: "Mon 09:00"
  target: "Maintenance/proposals-log.md"
  prompt: |
    Call list_my_proposals (it returns your pending proposals).
    Withdraw any that are stale by their timestamp, and log what
    you withdrew here in this note.

list_my_proposals takes no arguments and returns only pending proposals, so the agent inspects each one’s timestamp to decide what’s stale.

“Read more later” capture

Web clipper writes each article to a new file under Inbox/clips/; an agent files it.

# triggers.yml
- when: "file:created:Inbox/clips/**"
  prompt: |
    This is a clipped article with frontmatter keys source, captured.
    Move it to Reading/ under a slug derived from its title.
    Don't add tags — the user will tag during triage.

Have the clipper create a fresh file per clip (the trigger only sees file:created), and let the agent move and rename it.

Birthday reminders

Each morning, have an agent scan People/ and note today’s birthdays.

# schedules.yml
- daily: "09:00"
  target: "Daily/today.md"
  prompt: |
    Read the frontmatter of each note in People/. For anyone whose
    `birthday: MM-DD` matches today, add a "Birthdays today" section
    to this note listing their names (with [[wikilinks]]).

A schedule can’t send a system notification or run a shell command — it only splices the prompt into target. The agent writes the reminder into the note; read it when you open the vault.