SKILL.md

SKILL.md is the one file every skill needs: what the subagent is told, on which model tier, and which tools it may call. This page is its reference, with the tools a skill can list, the outputs it records, and the repository text that reaches every subagent whatever its skill.

SKILL.md is a YAML front matter block followed by Markdown. The file must start with ---, and the block must be closed by a line starting with ---.

Front matter

Field Type Default Rules
name string required Lowercase letters, digits and dashes; starts with a letter or digit; at most 63 characters. Must equal the directory name.
description string required Not empty. The orchestrator chooses skills by it.
model_tier string fast The model tier the subagent runs on. See Models.
tools list of strings none Names from the tool catalog. Unknown names and duplicates are errors. The subagent gets exactly these tools.
kit string ./kit.yaml Path of the kit file, relative to the skill directory. If you set it, the file must exist.
outputs list of strings none UPPER_SNAKE_CASE names the skill must record. Requires set_output in tools.
max_steps integer 40 1 to 200. Model turns the subagent may take in each attempt. The count starts again when the critic sends the work back.
confidential boolean false Keeps the session’s final report off public places. See below.

Unknown fields are rejected.

confidential: true matters when a session’s result is posted as a comment on an issue or pull request of a repository that is not private: the comment then only says that the report is confidential and links to the session in the dashboard. The flag also means the session never gets a shareable report, whatever settings/reports says. Those are the only two places it acts: a report delivered to a chat thread, the description of a pull request the session opens, and comments a skill posts itself with the comment tool are not withheld.

Body

The Markdown after the front matter is the subagent’s instructions. It must not be empty. It becomes the start of the subagent’s system prompt, followed by text kōjō adds:

  • The environment: where the repository is checked out (/workspace), that network access is limited to an allowlist, that it must not commit or push, the outputs it must record, and that its final answer without a tool call is its report.
  • The repository’s AGENTS.md, when it has one.
  • The repository knowledge from .factory/memory/.
  • What kōjō remembers: the preferences of the person who asked, the lessons maintainers taught this skill in reviews of its earlier pull requests in the repository, and up to five team memory entries that match the task.

The user message holds the task and the values recorded so far in the session. A subagent starts with a fresh context: it sees nothing of the orchestrator’s conversation or of earlier subagents except those values.

Tool catalog

A skill lists the tools its subagent may call. The model is only offered those tools, and a call to any other tool is refused. This is the whole catalog. A follow-up on one of kōjō’s pull requests gives every subagent get_review_comments and get_check_runs as well, whatever its skill lists.

Tool Runs in Arguments What it does
read_file sandbox path, start_line, end_line Reads a text file with line numbers. Output stops at 24 KiB; read on with start_line. Files over 1 MiB and binary files are refused.
list_files sandbox dir, glob Lists tracked and untracked files that .gitignore does not hide. At most 500 paths.
search sandbox pattern, path, ignore_case Searches the workspace for an extended regular expression. At most 200 matching lines.
write_file sandbox path, content, purpose Creates or overwrites a file. At most 1 MiB.
edit_file sandbox path, old_string, new_string, replace_all, purpose Replaces an exact string. It must occur once unless replace_all is set.
exec sandbox command, timeout_seconds, purpose Runs a shell command from the repository root. Default timeout 600 seconds, at most 3600. Output is capped at 24 KiB.
git_diff sandbox none Shows every change made to the workspace in the session so far.
set_output core name, value Records a named value. See Skill outputs.
memory_search core query Searches team memory of the repository and the org, and the personal memory of whoever asked. Returns up to five entries, each marked team or personal.
memory_save core topic, content, scope Saves one fact, 1 to 2000 characters. scope: team (the default) saves to the repository’s team memory and is refused in sessions that may not write. scope: personal saves to the personal memory of whoever asked. Stores nothing in a dry run.
get_issue core number Reads an issue and its comments. Without a number, the session’s own issue.
list_issues core state, since_hours, limit Lists issues, without pull requests. state is open (default), closed or all; limit defaults to 30.
list_pull_requests core state, since_hours, limit Lists pull requests, the most recently updated first, each with its state, draft flag, author, branches, times (merged_at when merged) and body, clipped to 1,000 bytes. state is open (default), closed (closed without merging), merged or all; a merge counts as an update for since_hours; limit defaults to 30, at most 100.
get_pr core number Reads a pull request.
get_pr_diff core number Reads the diff of a pull request, clipped in the middle when large.
comment core body Posts a comment on the issue or pull request the session is about. At most three per run; recorded but not posted in a dry run.
get_review_comments core number Reads the review of a pull request: the comments on lines of its diff, with file, line and diff hunk, and the text of each review with its verdict. Without a number, the session’s own pull request. The newest 100, each body clipped to 4,000 characters.
get_check_runs core number, sha, failed_only Reads the checks of a commit with their state and, where the forge keeps it, their output, cut to its last 8 KiB. By default the head of the session’s pull request (in a follow-up, the commit the session started from). At most 40 checks.

Tools that run in the core use kōjō’s own forge client and store. They do not go through the sandbox and need no egress.

write_file, edit_file and exec are the tools that can change the workspace. A skill that lists one of them and does not set no_changes: true is a writing skill. Each of them takes an optional purpose, one line on why the change is made: a reviewer sees it next to the lines the call wrote, in the pull request’s description and in the dashboard (where each changed line came from).

A failing tool call is returned to the model as an error it can act on. It does not fail the session.

Skill outputs

An output is a named, one-line value a skill records with set_output: a command, a path, a count.

  • outputs: in the front matter lists the names the skill must record. The goal critic rejects an attempt while one of them has no value. A value an earlier skill of the session recorded under the same name counts.
  • A name is UPPER_SNAKE_CASE, at most 64 characters, and must not start with KOJO_. A value is one non-empty line of at most 2000 characters.
  • A skill may record names it did not declare. The built-in build-feature skill records BUILD_CMD and LINT_CMD when the repository has them.
  • Outputs are kept on the session. Later skills of the same session receive them as “Values recorded so far”, checks read them as ${NAME}, the orchestrator sees them in the skill’s result, and the session’s result lists them.

This is how the built-in skills hand work to each other: reproduce-bug records REPRO_TEST and REPRO_CMD, and fix-bug has a check that runs ${REPRO_CMD} and a constraint that forbids changing ${REPRO_TEST}.

AGENTS.md and .factory/memory

Two kinds of repository text reach every subagent, whatever its skill:

  • AGENTS.md at the repository root is appended to the system prompt as “The repository’s AGENTS.md”. It is cut at 24 KiB.
  • .factory/memory/ files are concatenated in path order, each under a heading with its path, and appended as “Repository knowledge (.factory/memory)”. The total is cut at 24 KiB. Use it for conventions and architecture notes that do not belong in AGENTS.md.

Both are read from the default branch with the skills. They are instructions from the repository’s maintainers, so treat changes to them like changes to code.

Team memory is separate: it is stored in the database, written by memory_save, from the dashboard and from maintainers’ reviews, and searched per task. Files under .factory/memory/ are not copied into it. See Memory.

Scroll to move. + - zoom, 0 fit, Esc close.100%