Skills CI
A repository that keeps its own skills under .factory/skills/ can check them on every pull request that changes them, before they reach the default branch, where kōjō reads them. The kōjō repository is also a GitHub Action that does this: it validates each changed skill, runs its evals on cases the repository keeps next to it, and reports the result in one comment on the pull request. This page is for teams that write skills and want them checked like code.
What the action does
- Installs
kojo, the latest release or the oneversionnames, from the release’s archive. The archive’s SHA-256 must be the one the release’schecksums.txtlists, as with the install script. - Finds the skills to check. On a pull request these are the skills it changes: a file under
.factory/skills/<name>/or.factory/evals/<name>/, or a recordings file named<name>.yaml. Theskillsinput changes this. - Runs
kojo skills validateon each, which parses its three files as the server does. - For each valid skill that has cases under
.factory/evals/<name>/, runskojo eval <name> --local --factory .factory --json. Each case runs as a dry run in a throwaway sandbox, a plain container on the runner’s Docker (thedockerdriver), and passes when the goal critic accepts the result. - Writes the report to the job summary and to one comment on the pull request, which it updates on later pushes.
- Fails the step when a skill does not validate, when a skill’s pass rate is below the minimum, or when an eval does not run to the end.
It needs a Linux runner with Docker, such as ubuntu-latest.
A workflow
This workflow checks the skills of every pull request that changes .factory/, with recorded model answers, so it needs no model key:
name: Skills
on:
pull_request:
paths: [".factory/**"]
permissions:
contents: read
pull-requests: write
jobs:
skills:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: xavidop/kojo@v0
with:
recordings: .factory/recordings
xavidop/kojo@v0 follows the latest v0 release of the action. To pin it, use the full commit SHA of a release instead, with the version in a comment, as above for actions/checkout.
With a live model instead of recordings, pass the provider’s key from a secret. Each case then costs what its model calls cost, and the minimum pass rate defaults to 0.7:
- uses: xavidop/kojo@v0
with:
provider: anthropic
api-key: ${{ secrets.ANTHROPIC_API_KEY }}
With a kojo.yaml of your own, for a provider that needs more than a key (vertexai, bedrock, azure, ollama), prices, budgets or another sandbox image:
- uses: xavidop/kojo@v0
with:
config: .factory/kojo.ci.yaml
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
The file must name the docker driver and dev: true, as the config the action writes does.
Permissions
The action needs these two, and nothing else:
| Permission | For |
|---|---|
contents: read |
Checking out the repository. |
pull-requests: write |
Listing the files the pull request changes, and writing and updating the comment. |
A pull request from a fork gets a read-only token and no secrets. The action then cannot comment: it logs a warning, and the report is in the job summary. A live model cannot be called without its key either, so recordings are what works on forks. Do not run the action on pull_request_target to get around this: that event runs the fork’s skills, cases and kits with the base repository’s token and secrets.
The repository’s layout
.factory/
├── skills/
│ └── changelog-entry/ # a skill, as the server reads it
│ ├── SKILL.md
│ ├── goals.yaml
│ └── kit.yaml
├── evals/
│ └── changelog-entry/ # the skill's name
│ ├── fixed-timeout/ # a case
│ │ ├── case.yaml
│ │ ├── reference.patch # optional
│ │ └── repo/ # the repository the skill works on
│ └── new-feature/
│ ├── case.yaml
│ └── repo/
└── recordings/
└── changelog-entry.yaml # model answers for the cases, if you replay
A case has the layout of the built-in fixtures: Fixtures describes case.yaml, repo/, reference.patch and the issues and pull requests a case can seed, and Write a new case how to design one. A file of a case keeps its executable bit. A symbolic link that leads out of .factory/ is not followed.
A skill with cases under evals/<name>/ is evaluated on those cases alone. A valid skill without any is reported as validated only and does not fail the step. A directory under evals/ for a skill the repository does not define evaluates the built-in skill of that name on the repository’s cases.
The server does not read evals/ or recordings/: they are for the action, and for kojo eval --local --factory on your machine. The kōjō repository’s test has a complete example: the changelog-entry skill, two cases and their recordings.
Inputs
| Input | Default | Meaning |
|---|---|---|
version |
latest |
The kōjō release to install, such as v0.3.0. The action needs a release whose kojo eval has --factory, and says so when it does not. |
kojo-path |
A kojo binary to use instead of installing a release, such as one an earlier step built. |
|
working-directory |
. |
The directory that holds .factory/, relative to the workspace. kojo runs there, and config and recordings are relative to it. |
skills |
changed |
changed: on a pull request, the skills it changes; on any other event, all of them. all: every directory under .factory/skills/ and .factory/evals/. Otherwise, skill names separated by spaces, commas or new lines. |
config |
A kojo.yaml for the evals. Without it, the action writes one. |
|
recordings |
A directory of recorded model answers. The config the action writes then replays them, and no key is needed. Not with config: set models.recordings in it instead. |
|
provider |
anthropic |
The model provider of the config the action writes when there are no recordings: anthropic, openai, googleai or openrouter. |
api-key |
The provider’s API key, from a secret. Without it, kojo reads the provider’s usual variable, such as ANTHROPIC_API_KEY, from the step’s environment. |
|
fast-model |
claude-haiku-5-5 for anthropic |
The model of the fast tier. Required for the other providers. |
strong-model |
claude-opus-5-5 for anthropic |
The model of the strong tier. Required for the other providers. |
sandbox-image |
alpine/git (pinned) |
The image of a sandbox whose kit names none, in the config the action writes. The cases of the example need only sh and git; set the image your cases need, or image in the skill’s kit.yaml. |
min-pass-rate |
the config’s | Fail when a skill’s pass rate is below this, 0 to 1. Without it, seed.activation.min_eval_pass_rate of the config applies: 1 with recordings and 0.7 with a live model in the config the action writes, 0 in a config that sets none. |
comment |
true |
Write the report as a comment on the pull request. false leaves it in the job summary only. |
github-token |
${{ github.token }} |
The token that lists the pull request’s files and writes the comment. |
Outputs
| Output | Value |
|---|---|
passed |
true when every skill checked passed, false otherwise. |
skills |
The skills checked, separated by spaces. |
report |
The path of the report in Markdown: the body of the comment. |
results |
The path of the results in JSON: per skill, the validation output and the eval run as kojo eval --json prints it. |
Keyless runs with recordings
The mock model provider answers model calls from recorded answers instead of calling a model (Recordings has the format). Only the model is replaced: the tool calls in a recording run for real in the sandbox, and the skill’s checks really run. A replayed eval therefore checks the skill’s goals, its kit and its cases against fixed answers, which is what a pull request that changes a check or a constraint needs. It does not measure how a model does with changed instructions: record again when you change SKILL.md, and run against a live model when that is the question.
To record the answers, run the evals once against a live model with KOJO_LIVE_MODELS=1 and KOJO_RECORD=1. Write a config with real tiers and a recordings directory, for example kojo.record.yaml:
dev: true
server:
public_url: http://localhost:8080
database:
url: postgres://unused@localhost/unused # not opened by --local
models:
gateway: embedded
recordings: out/recordings # where the answers are written
tiers:
fast: { provider: anthropic, model: claude-haiku-5-5 }
strong: { provider: anthropic, model: claude-opus-5-5 }
providers:
anthropic:
api_key: "${ANTHROPIC_API_KEY}"
sandbox:
driver: docker
image: alpine/git:v2.54.1@sha256:27279f417b0d0f6267fe22468fb12ecc2dd84783e6b44a6642d1c31f61e174b7
Then, from the repository root, with Docker running:
KOJO_LIVE_MODELS=1 KOJO_RECORD=1 kojo eval changelog-entry --local -f kojo.record.yaml --factory .factory --min-pass-rate 0
Every answer is written under out/recordings/recorded/, one file per session and purpose (subagent:<skill>, and judge:<skill> when the skill has a judge). To keep them:
- Read each file. A recording holds what the model said, tool calls included: make sure no key or token is in it.
- Add a
matchto each recording: a string that occurs in its case’s task and in no other case of the skill, such as the issue number. A recorded file has none. - Put them in
.factory/recordings/<skill>.yaml, one file per skill, so that a pull request that changes the recordings checks that skill.
Check the result the way the action will:
kojo skills validate .factory/skills/changelog-entry
kojo eval changelog-entry --local -f kojo.replay.yaml --factory .factory
where kojo.replay.yaml is the record config with recordings: .factory/recordings, both tiers { provider: mock, model: replay } and no providers. In the kōjō repository, make record does the same for the built-in skills; see Live models and recording.
The config the action writes
Without config, the action writes a kojo.yaml like this one, with the recordings directory made absolute:
dev: true
server:
public_url: http://localhost:8080
database:
url: postgres://unused@localhost/unused
models:
gateway: embedded
recordings: "/home/runner/work/app/app/.factory/recordings"
tiers:
fast: { provider: mock, model: replay }
strong: { provider: mock, model: replay }
sandbox:
driver: docker
image: "alpine/git:v2.54.1@sha256:27279f417b0d0f6267fe22468fb12ecc2dd84783e6b44a6642d1c31f61e174b7"
seed:
activation:
min_eval_pass_rate: 1
Without recordings the tiers name provider, fast-model and strong-model, the key is read from the environment as api_key: "${SKILLS_CI_API_KEY}" (it is never written to the file), and min_eval_pass_rate is 0.7. dev: true is what the docker driver requires; The docker driver says what it isolates. The store is in memory and nothing is kept after the job.
The comment
The comment starts with a hidden marker that names the working directory, so the action finds and updates its own comment, and two uses of the action with different working-directory values keep one comment each. It shows:
| Part | What |
|---|---|
| Status | Passed with the number of skills checked, or Failed with how many did not pass. |
| Table | One row per skill: whether it is valid, its pass rate with passed and total cases, the number of cases, and the cost of its eval. A skill without cases shows none; a skill whose eval did not run shows error; a skill the pull request deletes shows removed. |
| Bar and models | The minimum pass rate the skills were held to, and the models of the tiers, mock/replay when the answers are recorded. |
| Folded details | For each evaluated skill, its cases: result, the critic’s attempts, cost, and similarity to reference.patch when the case has one; for a failed case, the session’s error or the critic’s report. For a skill that does not validate, what kojo skills validate said. For an eval that did not run, kojo’s error. |
| Footer | A link to the workflow run, and the commit checked. |
Text that came from a model or a repository is shown in code blocks only, where a mention notifies nobody. When the details would make the comment longer than GitHub allows, the comment leaves them out and says that the job summary has them.
The comment is updated in place on each push. A push that no longer changes any skill turns it into “This pull request changes no skill”. A pull request that never changed a skill gets no comment.
Cost is what kōjō computes from the price of each tier (Prices and cost). The config the action writes sets no price, so it shows $0.00: give a config of your own with prices to see, and with models.budgets, bound what a live run costs.
Run it from a checkout of kōjō
kojo-path runs the action with a binary built from source instead of a release. The kōjō repository tests the action that way in skills-ci.yml, on testdata/skills-ci:
- run: go build -o "$RUNNER_TEMP/kojo" ./cmd/kojo
- uses: ./
with:
kojo-path: ${{ runner.temp }}/kojo
working-directory: testdata/skills-ci
skills: changelog-entry
recordings: .factory/recordings
comment: "false"