Mirrin Protocols

ProtocolsAvailable now

Routines your twin runs, one file each.

A protocol is a routine for your twin: a short text file that says when to run and, in plain words, what to check, what matters and what to say. Your twin runs it on a schedule or when you ask. There's no code to write, so anyone can make one, share it, and install someone else's.

Format
One YAML file
Runs
On a schedule, or when you ask
Comes with
Six starters
Shared as
Packs, in git
1FormatAvailable now

One file, one routine.

This is a whole protocol: the morning briefing every new install starts with, exactly as it ships.

morning-briefing.yamlthe whole file · ships with it
name: morning briefing
description: The day at a glance, delivered before the user asks.
version: 1.0.0
author: Mirrin
tags: [briefing, daily]
requires: [reminders]
schedule: "0 7 * * *"
prompt: |
  Prepare the morning briefing. Check today's calendar and any reminders due today.
  If email is available, note anything from the last 12 hours that needs a reply or a decision.
  Deliver it as a short message: greeting, the day's shape in two or three lines,
  then anything that needs a decision. Skip sections that are empty. If there is truly nothing
  (no events, no reminders, no mail), reply NOTHING_TO_REPORT.
  • name is what you say to run it: “run morning briefing”.
  • schedule is when it runs, as cron in your own time zone: 0 7 * * * is every day at 7:00. Leave it empty and the protocol runs only when you ask. If the computer is asleep when one is due, it runs once when it wakes, as long as that's within 12 hours.
  • requires names the skills or tools the prompt relies on (reminders, email, calendar, web and so on), so anyone can see what it needs before they install it.
  • prompt is the brief, written to your twin the way you'd brief a colleague. It can use every tool you've connected, under your approvals.
  • NOTHING_TO_REPORT is how a routine stays quiet. When a scheduled run has nothing worth saying, your twin replies with it and you hear nothing.
  • vars (this one has none) are the parts each person fills in, used as {{city}} in the prompt, with values kept in ~/.mirrin/protocols/vars.yaml.

If a routine can't run, or still needs a setting, your twin tells you in plain words what to do: once a day for a scheduled run, every time for one you started.

Every field, schedule rule and message: the protocol reference.

2StartersAvailable now

Six to start with.

Every new install starts with these six in ~/.mirrin/protocols. Two run on a schedule; four wait until you ask. Change them, turn them off or delete them: they're your files.

  • morning briefing

    “The day at a glance, delivered before the user asks.”

    Today's calendar and reminders and, if email is connected, anything from the last 12 hours that needs a reply or a decision. Quiet when there's nothing.

    When
    Every day at 7:00 0 7 * * *
    Needs
    reminders
  • evening wrap

    “Close out the day and set up tomorrow.”

    Tomorrow's calendar and reminders in three lines, with at most one question if something needs preparing. Quiet when tomorrow is empty.

    When
    Every day at 21:00 0 21 * * *
    Needs
    reminders
  • inbox triage

    “Surface the emails that actually matter.”

    Reads your latest 20 emails and reports only the ones that need a reply or a decision, one line each.

    When
    When you ask
    Needs
    email
  • reply like me

    “Reply to an email the way the user would write it.”

    Reads two or three of your own sent emails to match your tone, sign-off and length, then shows the draft in full. Nothing is sent without your yes.

    When
    When you ask
    Needs
    email
  • rebook

    “Move or cancel an appointment and tell the other side.”

    Moves or cancels it on your calendar or the booking site, drafts a note to the other person, and follows up two business days later.

    When
    When you ask
    Needs
    calendar
  • chase refund

    “Get money back from a merchant, politely and persistently.”

    Finds the receipt, then drafts a refund request or fills in the merchant's form, with a screenshot before it submits. It checks back in five business days.

    When
    When you ask
    Needs
    email

Beyond these, a protocol is whatever you can brief. The quickstart below builds rain check, which warns on weekday mornings when rain is likely during something outdoors. The pack template's example is a commute check: before you leave, how long the drive is and whether to go now or wait.

3QuickstartAvailable now

Write your first one.

About ten minutes, with your twin running (the menu bar app, or mirrin run). You'll build rain check.

  1. Make the file

    This writes ~/.mirrin/protocols/rain-check.yaml, already a working protocol that runs when asked.

    Terminal
    mirrin protocols new rain check
  2. Say what it should do

    Open the file in any text editor and brief your twin: when to run, what it needs, which values each person fills in, and when to stay quiet.

    rain-check.yamlfrom the quickstart
    name: rain check
    description: Warns on weekday mornings when rain is likely during something outdoors.
    version: 0.1.0
    author: your-handle
    tags: [weather, daily]
    schedule: "30 6 * * 1-5"
    requires: [calendar, web]
    vars:
      city:
        description: The city to check the forecast for
        required: true
      forecast_site:
        description: A forecast page fetch_url can read
        default: https://wttr.in
    prompt: |
      Look at today's calendar with list_events and pick out anything that happens
      outdoors or means walking somewhere. Fetch the forecast for {{city}} from
      {{forecast_site}} with fetch_url. If rain is likely during any of those, say so
      in one or two sentences: which event, what time, and what to bring.
      If nothing is outdoors, or no rain is expected, reply NOTHING_TO_REPORT.
  3. Lint it

    Lint finds what breaks a protocol or makes it hard to share: a {{var}} that isn't declared, a schedule cron can't read, a scheduled prompt that never says NOTHING_TO_REPORT, a requires that isn't a known skill or tool, and anything that looks like a password or key. It exits with status 1 on an error.

    Terminal
    mirrin protocols lint ~/.mirrin/protocols/rain-check.yaml
  4. Check it on your machine

    Lint checks the file; check checks it against your own twin. Each protocol gets a line: ✓ ready, ✗ and what isn't connected, or ! and the values still to fill in. Put your city in ~/.mirrin/protocols/vars.yaml, under rain check:, and run it again.

    Terminal
    mirrin protocols check
  5. Run it now

    Say /reload to your twin so it reads your edits. Then open the Routines page (Protocols… in the menu bar or tray; with mirrin run, mirrin devices page and then Routines) and press Run now. Or say “run rain check” in chat: running a protocol asks first, and the answer comes back into the conversation even when there's nothing to report, which makes chat the better way to test. From then on the schedule takes over; change it on the same page (Set time, Skip next) or just say “move rain check to 7:15 on weekdays”.

Each step with what you'll see, and what to do when it isn't that: Your first protocol in ten minutes. Then the writing guide, on writing protocols people keep switched on.

4SharingAvailable nowPlanned

Packs, and the registry.

A pack is a git repository with a pack.yaml, a protocols/ folder and, if you like, a personas/ folder. Start from the template: it has a protocol, a persona and a lint workflow. The registry is a single list of packs, kept in the Mirrin repository; the packs themselves stay in their authors' own repositories.

  • Available now Find one. Search looks in each pack's name, description and tags. Every release carries a copy of the index, so it works offline too.
    mirrin protocols search travel
  • Available now Install it by name, from the registry, at the commit its entry names.
    mirrin protocols install <name>
  • Available now Or by its address, and pin it with # and a tag, a branch or a full commit.
    mirrin protocols add https://github.com/you/mirrin-pack-weather-wise#v0.2.0
  • Available now Update. It shows the old and new commit and every file that changed, and applies them only when you say yes (--yes to skip asking).
    mirrin protocols update
  • Available now See what you have, and remove a pack.
    mirrin protocols
    mirrin protocols remove weather-wise

Or ask your twin: “is there a protocol for commuting?” searches the registry and can show you what a pack would add before it installs anything. The Routines page has the same under Find more.

  • A pack stays put. It stays on the commit it was installed at until you apply an update. Pinned to a commit, it stays there; pinned to a tag or branch, it follows it.
  • Your copy wins. A protocol of your own with the same name as a pack's is the one that runs, so you can change one routine without forking the pack.
  • Listing yours is a pull request that adds one entry to the registry, with the full commit to install. A maintainer reads the pack at that commit before it's merged.
  • Your licence. A pack in your own repository is under the licence you give it there; listing it doesn't change that.

Planned A signed index. Your twin is built to use the published index only when its signature checks out. The signing key isn't in the repository yet, so for now every release answers search, install and update from the copy built into it, and a newly listed pack reaches people with the release after it's merged.

Make a pack: the layout, testing it on a throwaway twin, pinning and shipping updates. Get your pack listed: the entry, the pull request and what reviewers check.

5SafetyAvailable nowPlanned

Your approvals still apply.

  1. It's a brief, not a program.

    Nothing in a protocol is executed. Its prompt is handed to your twin, which acts with the tools you've connected, under the same approvals as anything you ask it yourself.

  2. What asks first.

    Sending email or messages, changing your calendar, clicks and form fills in the browser, writing files, phone calls, and running, creating or changing a protocol or installing a pack. With the default settings, reading your calendar and mail and fetching public pages run without asking.

  3. The hard floor.

    Payments, shell commands, payment-looking clicks in the browser and sensitive files (~/.ssh, keychains, .env files, private keys and more) always ask, whatever your settings say. A “never” you've set stays a refusal.

  4. No standing powers.

    “Yes, always” can't be given for creating or changing protocols, installing packs or clicks in the browser, so a protocol can't talk its way into more.

  5. Never secrets.

    Passwords, API keys and tokens belong in your config or a connected account, never in a protocol, which is meant to be shared and is shown in full to anyone who previews it. mirrin protocols lint fails on anything in a prompt or a var's default that looks like a key, a token or a written-out password. It doesn't read descriptions or READMEs, so check those yourself.

  6. Read it before you install it.

    A pack's protocols are trusted like your own, and its scheduled ones start at their next due time. Ask your twin to show you a pack first, or press Preview on the Routines page: you'll see each protocol's schedule, what it needs and every word of its prompt. mirrin protocols add and install install straight away, so read the pack's protocols/ folder on its repository page first.

To be plain about it: fetching a public web page counts as reading, so a protocol can do it without asking, and a harmful prompt could put your details in a web address. Registry review reads every prompt for that. To be asked before every fetch, add fetch_url to autonomy.always_ask in your config. Planned Limiting which sites and files a pack's protocols may reach.

What a harmful pack could try and what stops it, the red flags reviewers look for, and how to report one: the safety model for protocols and packs.

6ContributingToday

Three ways in.

  1. Share a routine as a pack

    No programming needed. Write it, put it in a pack from the template, lint it, run it on your own twin, then open a pull request that adds one entry to the registry. It stays in your repository, under your name and your licence.

  2. Improve the six starters

    Every new install begins with them, so the bar is high: useful to nearly everyone, built on what most people connect, and quiet when there's nothing to say. Fixes to the six are welcome as pull requests; a new starter starts as an issue.

  3. Improve the engine

    The loader, scheduler, lint and pack tools are written in Go; the contributor's guide shows where each one lives. Work on a throwaway twin, MIRRIN_HOME=$(mktemp -d), so nothing you try reaches your own.

No time to write it? Open a Protocol idea issue and describe it the way you'd brief a person. What you contribute to the repository is MIT, like the rest of the source; a pack in your own repository stays under the licence you give it. By taking part you agree to the Code of Conduct.