Automations
A small decision model reads part of a project on a schedule and answers typed questions. It records a note or starts an agent only when the answers say so.
An automation reads part of a project and asks a decision model typed questions about it. Then it acts on the answers: it records a note or starts an agent session. It can run manually or on a schedule. Open Automations with /automations or ⇧⌘R.
Built-in automations
| Automation | What it does |
|---|---|
| risky-change-review | Reviews the latest commit when it is risky or touches sensitive code |
| secret-leak-check | Catches a key, token or password added in the latest commit |
| untested-change | Notices changed functions that no test reaches |
| dependency-change-watch | Examines a dependency that the latest commit adds, and any known vulnerability it brings |
| docs-drift | Flags a change the README no longer describes |
| migration-safety | Reviews a commit's schema changes when they could lose data or break code |
Make it mine copies a built-in so you can edit it. Use in this project enables one for the open project.
The editor
An automation has five parts:
- Read: what it reads. Inputs are the git diff, untested changes, schema changes, a file, a read-only command, a dependency scan or a secret scan.
- State: a template that puts the inputs together for the decision model.
- Ask: typed questions, answered yes/no or on a scale, each with a confidence.
- Decide: rules, checked in order. The first rule whose conditions all hold acts. Each rule either records a report or starts an agent with a prompt. Otherwise says what happens when no rule matches.
- Settings: scope (this project, several or none), the schedule, and the decision model, which can be a small local one.
Preview reads the inputs and asks the questions now, without recording or acting. Run now asks the decision model now and acts on its answer.
Runs
The list shows each run with what it read, the answers, the rule that matched and what it did. An agent that a run started opens as a session. It also appears in Autonomous tasks. Delete all runs clears the list.
Files
Automations are JSON files: .koda/automations/*.json in a project, or ~/.config/kc/automations/*.json for your own.
| Key | What it holds |
|---|---|
version, name, description | |
decision_provider, decision_model | The model that answers the questions. |
schedule | every, daily or weekdays. |
runs_in | For your own automations: all_projects, projects or no_project. |
inputs | git_diff, untested_changes, schema_changes, file, command, dependency_scan, secret_scan. |
state | A template with {input} placeholders. |
questions | The typed questions. |
rules | when conditions (above, below, is, confidence_above, at_least, at_most) and then: agent (prompt, with) or report. |
otherwise | What happens when no rule matches. |