/kombinat:write-routinesfrom kombinat
Writes and edits Kombinat routines: markdown files in routines/ that run an AI agent on a schedule, webhook, or after another routine. Use to automate recurring tasks with Kombinat.
Ships in kombinat. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
A routine is one markdown file, routines/<name>.md. The frontmatter sets when and how it runs. The rest of the file is the prompt.
---
name: review-pull-requests
description: A review comment on every pull request that asks for yours
schedule: '15 9-17 * * 1-5'
cwd: ~/projects/app
model: claude-sonnet-5-5
timeoutMinutes: 30
worktree: true
check: n=$(gh pr list --search 'review-requested:@me' --json number --jq length) || exit 1; [ "$n" -gt 0 ] || exit 78
---
List the open pull requests that request my review: `gh pr list --search "review-requested:@me"`.
For each one, read its diff with `gh pr diff <number>` and look for bugs. Check every finding before you write it.
Leave one review with `gh pr review <number> --comment --body-file <file>`. Never approve and never request changes.
End with one line per pull request. If none waits for me, answer only "No pull requests to review."
routines/. If there is none, create it with npx kombinat init, which also adds example routines.kombinat validate and fix what it reports, until it says ok. It shows the first wrong value of each file.kombinat run <name>. It does the real work, so ask first.README.md has the <!-- routines:start --> marker, update its table with kombinat readme.Run kombinat from the folder with routines/, with its package manager: npx kombinat, pnpm kombinat or yarn kombinat. In another folder, validate finds no files and says ok.
The daemon ignores a misspelled setting, and a file with a wrong value stops the schedule of every routine, so never skip validate. A valid file needs no restart: it goes live once the daemon pulls main, every 5 minutes.
| The routine | Use |
|---|---|
| Runs at set times | schedule |
| Reacts to an event in another app | webhook: true, with a webhookGate that checks the sender and skips the events it doesn't need |
| Is one step of a longer job | startsAfter. One routine per step works better than one long prompt |
| Often finds nothing to do | check, a cheap command that skips the run, so the agent spends no tokens |
| Edits code | worktree: true, with a before that installs the dependencies. Have it open draft pull requests, never merge |
| Has to know what it already did | A mark where the work is, such as a label or an open pull request. memory: true only when there is no such place |
| Works on several items | runs, with maxParallel and worktree: true to work at once |
| May have to stop on an error | onAgentGiveUp: fail, so the run fails and the Inbox files it under Needs a look. The prompt needs no special words for it |
| Fails now and then, such as on timeouts | retries: 1 |
Then set the limits:
claude-haiku-5-5 for lookups and short reports, claude-sonnet-5-5 for most code work, claude-opus-5-5 for hard investigations.timeoutMinutes to what the job needs, not the default 55.claude, it denies what needs approval, so allow what the routine needs, such as Bash(git push *), in permissions.allow of .claude/settings.json in its cwd. With worktree: true, commit that file: a worktree holds only what git tracks. Use bypassPermissions only when asked to.15. At most 3 runs work at a time on the machine, and a routine that finds no free slot loses that time.Nobody watches a run, and nobody can answer it. Write the prompt so the agent never has to ask.
gh issue list --label bug.after and the next routine of a chain get it.date first.What Kombinat adds to the prompt:
runs, the next one can start once per run, so have it skip what it already handled.The frontmatter is not full YAML: one key: value per line, and no lists or values over several lines.
| Setting | Value |
|---|---|
name | The file name without .md: lowercase letters, digits and hyphens |
description | One line on what the routine produces. The dashboard shows it |
cwd | Required. The folder the agent starts in, such as ~/projects/app |
schedule | A 5-field cron in quotes, or manual (default) to run only on demand |
agent | claude (default), codex or command |
command | For agent: command only: any CLI, such as gemini --yolo. It gets the prompt on stdin |
account | claude and codex only. The login to run on, added with kombinat login <name>. Default: the machine's own login |
model | Default claude-opus-5-5 for claude, and the one of the Codex config for codex |
fallbackModel | claude only. The model to switch to when model is not available |
effort | claude: low, medium, high (default), xhigh, max. codex: minimal, low, medium, high, xhigh |
permissionMode | claude: auto (default), acceptEdits, dontAsk, bypassPermissions, plan, manual. codex: read-only, workspace-write (default), danger-full-access |
timeoutMinutes | Stops the run after this time. Default 55 |
retries | More attempts after an error or a timeout, 5 minutes apart. Default 0, at most 10 |
runs, maxParallel | Runs per start, and how many of them work at once. Default 1, at most 20, and maxParallel at most runs |
worktree | true gives each run a git worktree of its own, on a new branch from the default branch of origin. before and after run in it |
check | A shell command before each scheduled run, in cwd. Exit 0 starts the run, exit 78 skips it, any other exit fails it. Needs a schedule |
before, after | Shell commands around the agent, 3 minutes each. A failed before fails the run. after gets the finished run as JSON on stdin |
startsAfter, startsWhen | The routine whose runs start this one, and how they must end: succeeds (default), fails, finishes or has-findings, a run that succeeded with something to report |
webhook | true lets a POST to http://localhost:7433/api/routines/<name>/webhook start the routine |
webhookGate | A shell command that gets each request first: the body on stdin, the headers as JSON in KOMBINAT_WEBHOOK_HEADERS, 3 seconds. Exit 0 starts the run, and what it prints replaces the body. Exit 78 skips the request, 79 continues a conversation, any other exit rejects it. See the write-webhook-gates skill |
memory | true keeps notes from one run to the next. claude and codex only |
maxBudgetUsd, maxBudgetTokens | claude only. Stops the run at this cost or this many tokens, such as 2M |
onUsageLimit | claude only. wait (default) continues after the limit resets, fail fails the run |
onAgentGiveUp | claude only. succeed (default), or fail to fail the run when the agent gave up |
enabled | false keeps the file but stops its schedule, webhooks and chain starts. Run now still works |
An executable script in scripts/, next to routines/, runs by its name in check, before, after and webhookGate. Keep secrets in KOMBINAT_ variables, set before kombinat install, which saves them for the daemon.
This page is short on purpose. Before you use a setting in a way it doesn't cover, read the Kombinat README: node_modules/kombinat/README.md describes the installed version, and https://github.com/Danilqa/kombinat the latest. Hooks, webhook gates, worktrees and security have their own pages in its docs/ folder.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
5 skills in this plugin
/debug-runsFinds out why a Kombinat run failed, timed out, was blocked, did nothing or never started, and suggests the fix. Use when a routine did not do what was expected, or when asked why a run ended the way it did./migrate-to-routinesMoves scheduled jobs, such as crontab lines, scheduled GitHub Actions workflows, launchd jobs and systemd timers, to Kombinat routines. Use when asked to migrate, convert or replace a cron job or a scheduled workflow with a routine./review-routinesReviews the routines of a Kombinat folder for wasted tokens, risky permissions, weak prompts and schedules that collide. Use when asked to review, audit or improve routines, or to cut what they cost./write-webhook-gatesWrites the gate script of a Kombinat webhook routine. The gate checks the sender's signature, skips the events the routine doesn't need and keeps follow-up messages in one run. Use when connecting GitHub, Linear, Slack or another app to a routine with `webhook: true`, or when a webhook is rejected or starts runs it shouldn't.npx claudepluginhub danilqa/kombinat --plugin kombinatOther plugins' skills for the same job