Skip to content

Recipes

A recipe is a YAML file at .mewrite/recipes/<name>.yaml that pins a goal, model, tool allowlist, and optional sub-recipes. Goose-style schema.

Schema

yaml
# .mewrite/recipes/migrate-to-biome.yaml
name: "Migrate to Biome"
goal: |
  Replace ESLint + Prettier with Biome 2.x. Update CI. Remove old configs.
  Re-run the test suite. Commit when green.

model: claude-sonnet-4
effort: medium

tools:
  - Read
  - Glob
  - Grep
  - Edit
  - Write
  - Bash

env:
  BIOME_VERSION: 2.3.5

include:
  - bump-deps   # re-uses .mewrite/recipes/bump-deps.yaml

steps:
  - "Audit current ESLint/Prettier config"
  - "Generate biome.json from existing rules"
  - "Replace package.json scripts"
  - "Update CI workflow"
  - "Run biome check, fix violations"
  - "Run tests, ensure green"
  - "Commit with conventional-commit message"

Run:

bash
mewrite run-recipe migrate-to-biome
mewrite run-recipe migrate-to-biome --dry-run    # plan-mode-only

Built-in recipes

Me Write Code ships 10 default recipes you can copy or extend:

RecipePurpose
migrate-depsBump major dependencies, fix breakage
add-feature-flagWire a new feature flag end-to-end
port-to-typescriptJS → TS port
add-testsIncrease test coverage on a file or directory
bump-depsPatch/minor dependency bumps
extract-componentPull a chunk of a file into its own component
seo-auditSEO audit of a static site
accessibility-audita11y audit, WCAG 2.1 AA
migrate-to-biomeESLint+Prettier → Biome
releaseBump version, generate changelog, tag, push

List:

bash
mewrite recipes list
mewrite recipes show migrate-to-biome

include: subrecipes

A recipe can include other recipes. They run before the parent's steps unless include-after: true.

yaml
include:
  - bump-deps      # runs first
  - audit-bundle:  # runs after this recipe's steps
      include-after: true

Composition with hooks

Hooks fire during recipe execution like any other session. Useful pairing:

  • A recipe that runs npm test + a Stop hook that comments on the PR with the test summary.
  • A recipe that does dependency bumps + a PreToolUse Bash:git push hook that runs the full test suite.

Authoring

The fastest path is copying a built-in:

bash
cp ~/.mewrite/agent/recipes/release.yaml .mewrite/recipes/release-rc.yaml
$EDITOR .mewrite/recipes/release-rc.yaml

Validate:

bash
mewrite recipes lint .mewrite/recipes/release-rc.yaml

The linter checks: required keys, model exists in the registry, tools are valid, includes resolve.

Recipes vs commands vs skills

ConstructTriggerWhen to use
Skillmodel-invoked by description matchknowledge / how-to
Slash commanduser-invoked by /fooone-shot tasks
Recipeuser-invoked by mewrite run-recipemulti-step pipelines, sub-tasks, env vars

A recipe can dispatch slash commands as steps. A slash command can dispatch a recipe. Don't overcomplicate — pick the simplest construct that fits.

MIT Licensed.