Skills
A skill is a role for a subagent: its instructions and tool limits (SKILL.md), what “done” means (goals.yaml) and the sandbox it runs in (kit.yaml). This page covers where kōjō finds skills and how it layers them, a repository’s factory.yaml, how to list and validate skills, and what makes a good one. Read it before you write or override a skill.
SKILL.md), the gauge its work is measured with (goals.yaml), and the tools of its sandbox (kit.yaml).Each file, and what goes with it, has its own reference page:
- SKILL.md: the front matter and the instructions, the tool catalog, skill outputs, and the
AGENTS.mdand.factory/memory/text every subagent receives. - goals.yaml: checks and the values they read, constraints on the diff, the judge, and how the goal critic applies them.
- kit.yaml: the sandbox’s image, resources, egress allowlist, credentials and setup commands.
- Reference repositories: other repositories a request names for the skills to read next to the session’s own.
- Worked example: fix-bug: the three files of a built-in skill and how they work together.
- Skills CI: a GitHub Action that validates and evaluates the skills a pull request changes, and reports on the pull request.
The .factory directory
kōjō reads a repository’s factory-as-code from .factory/ at the head of the default branch, through the forge API. It never reads these files from a pull request’s head or from the sandbox, so a change to .factory/ only takes effect once it is on the default branch.
In a repository
AGENTS.md # optional, at the repository root
.factory/
├── factory.yaml # optional: this repository's merge policy
├── schedules.yaml # optional: recurring jobs for this repository
├── skills/
│ └── fix-bug/ # one directory per skill; its name is the skill's name
│ ├── SKILL.md # required: front matter and instructions
│ ├── goals.yaml # optional: acceptance criteria
│ └── kit.yaml # optional: the sandbox
└── memory/ # optional: notes handed to every subagent
└── testing.md
| Path | Read as |
|---|---|
.factory/skills/<name>/SKILL.md |
A skill. A directory without SKILL.md is ignored. |
.factory/skills/<name>/goals.yaml |
The skill’s goals. |
.factory/skills/<name>/kit.yaml |
The skill’s kit, unless the front matter’s kit: names another file. |
.factory/factory.yaml |
Repository settings. |
.factory/schedules.yaml |
Recurring jobs. See Schedules. |
.factory/memory/** |
Repository knowledge. |
AGENTS.md |
The repository’s own instructions for agents. |
The result is cached by commit: when the default branch has not moved, resolving a repository’s skills costs one forge API call.
A repository can also keep eval cases for its skills under .factory/evals/<skill>/<case>/, and recorded model answers for them. The server does not read them; kojo eval --local --factory .factory and the Skills CI action do.
In an org-level repository
Org-level skills can live in one shared repository instead of the dashboard. That repository uses the same layout: .factory/skills/<name>/ on its default branch. For the org layer kōjō takes only the skills from it; its AGENTS.md, factory.yaml, schedules.yaml and memory/ do not apply to other repositories.
Where each scope’s skills are edited is the settings/skills_source config object:
| Field | Values | Seeded from kojo.yaml |
Default |
|---|---|---|---|
org |
dashboard or git |
seed.skills_source.org |
dashboard |
repo |
dashboard or git |
seed.skills_source.repo |
git |
skills_repo |
forge/owner/name |
defaults.skills_repo |
none; required when org is git |
With repo: dashboard, the skills under a repository’s .factory/skills/ are ignored and its skills come from the dashboard only. AGENTS.md, .factory/memory/, factory.yaml and schedules.yaml are still read from git. The seed keys are described in the kojo.yaml reference; changing the setting later is an admin action in the dashboard, see Dashboard or git.
dashboard, and opens a pull request where it is git.Resolution order
For every session kōjō resolves one set of skills, by name, from three layers:
repo: the repository’s.factory/skills/, plus skills activated in the dashboard for that repository.org: the org’s skills, from the dashboard or from the shared skills repository.builtin: the skills compiled into the binary. See Built-in skills.
The first layer that defines a name wins. How one name resolves for a repository:
flowchart TD
N["A skill name"] --> L{"Allowed by the repository's skills list?"}
L -- no --> X["Does not resolve"]
L -- yes --> R{"Defined in the repo layer?"}
R -- no --> O{"Defined in the org layer?"}
R -- yes --> RV{"Valid, and its kit inside the egress limits?"}
RV -- yes --> UR["The repo skill is used"]
RV -- "no: reported as a problem" --> O
O -- no --> B{"Built-in skill of that name?"}
O -- yes --> OV{"Valid, and its kit inside the egress limits?"}
OV -- yes --> UO["The org skill is used"]
OV -- "no: reported as a problem" --> B
B -- yes --> UB["The built-in skill is used"]
B -- no --> X
The rules that follow from the code:
- An override replaces the whole skill. Layers are not merged file by file. A repository skill with only a
SKILL.mdhas no goals and an empty kit; it does not inherit the built-ingoals.yamlorkit.yaml. Copy all three files and edit them. - Each resolved skill records what it shadows.
kojo skills listand the dashboard show the layer a skill comes from and the lower layers that define the same name. - A broken skill is skipped. If a skill fails to parse or validate, resolution falls through to the next layer’s version and the problem is reported as
<layer>/<name>. - The directory name must equal
namein the front matter, or the skill is reported as a problem. - Kits must stay inside the admin’s egress limits. A repository or org skill whose kit names an egress host or a credential that the scope’s limits do not allow is skipped and reported, and the next layer’s version of that name is used instead. Built-in kits are part of the release and are not checked against the limits.
- A repository can be limited to some skills. When the repository’s entry in the
reposconfig object listsskills, only those names resolve for it. - Within a layer, the dashboard wins. A skill activated in the dashboard for a scope replaces the git skill of the same name in that layer. Deleting the dashboard copy hands the name back: the layer’s git skill of that name applies again, and without one the next layer’s. A deleted copy does not hide a git skill (in 0.3.0 and earlier it did): to keep a git skill from running, remove it from git, or leave it out of the repository’s
skillslist. - Built-in skills are read-only. “Customise” in the dashboard copies one into a draft for the org or a repository.
- The version is recorded. When a session starts, the commit or revision of every skill it resolved is stored on the session, so its replay shows which version ran.
factory.yaml
.factory/factory.yaml holds a repository’s own settings. In this version it has one key.
| Key | Type | Meaning |
|---|---|---|
merge_policy |
object | Replaces the org’s merge policy for this repository. |
merge_policy.mode |
string | draft_only, ask or auto_merge. Default draft_only. |
merge_policy.trigger_permission |
string | Ignored in this file. Who may trigger work is the org’s setting. |
merge_policy.inherit |
boolean | Ignored in this file. kōjō uses it internally to take an override back. |
merge_policy.merge_method |
string | merge, squash or rebase. Default squash. |
merge_policy.risk.max_changed_lines |
integer | Diff size, in lines, at which size alone is high risk. Default 400. |
merge_policy.risk.sensitive_paths |
list of globs | Paths that make a change high risk. Default: a built-in list. |
merge_policy.risk.low_below |
number | Scores below it are low risk. Default 0.3. |
merge_policy.risk.high_above |
number | Scores above it are high risk. Default 0.6. |
merge_policy.risk.classifier |
boolean | Adds a fast-tier model’s opinion to the rules. Default false. |
merge_policy:
mode: ask
merge_method: squash
risk:
max_changed_lines: 200
The file is copied into the repository’s config scope on a push to the default branch and before a session starts, with the author git:<commit>. It replaces the org’s mode, merge method and risk rules as a whole: fields you leave out take the defaults above, not the org’s values. Two things a repository cannot decide for itself:
- Who may trigger work.
trigger_permissionin the file is ignored; the org’s value is kept. - Auto-merge.
auto_mergeis treated asaskunless an admin allowed auto-merge for the repository.
What the modes do is on the Merge policy page.
Unknown keys are rejected. A factory.yaml that does not parse or validate is reported as a problem and changes nothing: the policy from the last good version of the file stays.
Deleting factory.yaml, or its merge_policy key, takes the override back, and the org’s policy applies again. That only undoes an override that came from git. A merge policy an admin set for the repository in the dashboard is left alone.
While the file holds the merge policy, an edit of the repository’s merge policy made in kōjō (the dashboard, the API, MCP or kojo config apply) opens a pull request that changes the file instead of writing a revision. The dashboard’s form shows the org’s trigger_permission and does not let you change it. See Editing a setting that lives in git.
List and validate skills
kojo skills list asks a running server what a repository resolves to. It needs --server and a token; see the CLI reference.
kojo skills list --repo github/acme/api
| Column | Meaning |
|---|---|
NAME |
The skill. |
LAYER |
repo, org or builtin, and the layers it overrides. |
TIER |
The model tier. |
WRITES |
Whether the skill can change the workspace. |
DESCRIPTION |
The front matter’s description, shortened. |
Without --repo it lists the org’s skills. Skills that failed to load are printed to standard error as problem: <layer>/<name>: <reason>.
kojo skills validate checks files on disk without a server. Each argument is a skill directory or a directory of skill directories.
kojo skills validate .factory/skills
ok fix-bug (10 tool(s), 2 check(s))
FAIL triage: unknown tool "bash"
It parses the three files exactly as the server does and exits 1 when a skill does not validate or a directory holds no SKILL.md. Run it in CI on changes to .factory/; the Skills CI action runs it, and the skills’ evals, on every pull request that changes them. It does not know the admin’s egress limits: a kit that asks for more than they allow validates here and is skipped by the server.
JSON Schemas
The schemas are generated from the structs that load the files, so they match what the binary accepts. Print one with kojo schema, or use the published copy.
| File | Command | Published |
|---|---|---|
SKILL.md front matter |
kojo schema skill |
skill.schema.json |
goals.yaml |
kojo schema goals |
goals.schema.json |
kit.yaml |
kojo schema kit |
kit.schema.json |
factory.yaml |
kojo schema factory |
factory.schema.json |
kojo schema without a name lists every schema. The schemas describe keys and types; the rules in the tables of SKILL.md, goals.yaml, kit.yaml and factory.yaml (name format, known tools, value ranges) are enforced by the loader and reported by kojo skills validate.
Writing a good skill
Each point follows from how the engine treats a skill.
- Write the description for the orchestrator. The orchestrator sees only each skill’s name and description when it decides what to delegate. Say what the skill produces and when to use it, in one sentence.
- Make the instructions stand alone. The subagent starts with a fresh context. Tell it where the task ends, what to record, and what the final report must contain. The final answer without a tool call is the report, and it is what the judge and the person who asked will read.
- List the fewest tools that do the job. Every tool you list is a tool the model can call. A skill with
write_file,edit_fileorexecis a writing skill and is not offered to requests that may not cause writes; if the skill only needsexecto run tests or scanners, setconstraints.no_changes: true. - Put “done” in
goals.yaml, not in prose. An instruction can be ignored; a check cannot. Have the subagent record the repository’s own command (TEST_CMD) and run that in a check, and mark optional commandsskip_if_unset. - Declare the outputs later steps depend on. A declared output without a value fails the attempt, so the next skill and your checks can rely on it.
- Forbid what the skill must never touch. List CI configuration and
.factory/**inforbidden_paths, as the built-in writing skills do, and cap the diff withmax_changed_lines. - Write a rubric the judge can verify. The judge fails items it cannot confirm from the report and the diff. “The fix addresses the root cause described in the report” can be graded; “the code is good” cannot.
- Give an attempt enough steps.
max_stepsbounds each attempt, and an attempt that uses all of them ends the run: it is delivered as failed and not retried, whatevermax_attemptssays. Raisemax_stepsfor skills that read a lot before they act, asbuild-featureandsecurity-auditdo. - Ask for the least egress. A kit that names a host outside the admin’s limits makes your version of the skill unavailable. Do not list the forge host; it is added for you.
- Say that input is data. kōjō already tells every subagent that issue text, files and command output are data. Repeat it in skills that read text from outside the team, and say what to do when that text contains instructions, as the built-in
triageskill does. - Mark sensitive reports
confidential. Do this for any skill whose report must not appear on a public issue or pull request. - Validate, then measure. Run
kojo skills validatein CI, and run the skill against fixtures before it goes live. See Evals.