Self-improvement

kōjō’s skills are files: SKILL.md, goals.yaml and kit.yaml (Skills). Over time kōjō sees how each skill does. The goal critic rejects some of its results and says why, maintainers leave review comments that become lessons, and pull requests are closed unmerged or changed by a person before they are merged.

With self-improvement turned on, kōjō turns that evidence into a proposal: a changed version of a skill’s instructions or goals, with a rationale that cites the evidence item by item. The proposal is a skill draft written by kōjō. It is measured by evals against the version in use, and it only becomes the skill in use when a person approves it in the dashboard. kōjō never changes its own skills by itself.

It is off by default.

A drafting table with a machine blueprint and an orange rubber stamp, beside a test bench that holds two versions of a part under a measuring arch. A drafting table with a machine blueprint and an orange rubber stamp, beside a test bench that holds two versions of a part under a measuring arch.
kōjō redraws a skill and measures the new version next to the one in use. Only a person's approval puts it into service.

The loop

flowchart TD
    E["Evidence: rejected results, lessons, pull requests"] --> T{"Enough, past the cooldown, no open proposal?"}
    T -- no --> W["Wait for more"]
    T -- yes --> M["One model call writes the changed files"]
    M --> C{"Checked in code: widens the skill, does not validate, cites nothing?"}
    C -- yes --> R["Closed as refused"]
    C -- no --> D["A draft by kōjō, with what it loosens listed"]
    D --> V["Evals of the draft and of the version in use"]
    V --> H{"Pass rate at least the version in use's and the policy's minimum?"}
    H -- no --> N["Closed as did not hold up"]
    H -- yes --> P["Ready: listed in the dashboard, announced in chat"]
    P --> A["A person approves: the draft is activated"]
    P --> J["A person rejects, with a reason kept"]

Every 15 minutes one server of the install looks at every scope where self-improvement is on and every skill it covers. It queues a proposal for a skill when the skill has no open proposal, its cooldown has passed since the last proposal, and enough new evidence has gathered since then. A proposal can also be asked for by hand, which skips the cooldown and reads the whole window of evidence (see Start one by hand).

A proposal is written by a session of kind improve. It runs no skill and needs no sandbox: it gathers the evidence, makes one model call, checks the answer, and waits for the evals. Its result links to the proposal. There is one open proposal per skill and scope at a time.

What counts as evidence

Kind What Where it links
Goal critic A real run of the skill whose result the critic rejected, or accepted only after rejecting earlier attempts. The unmet criteria and the end of the failed checks’ output are shown. The session
Lesson A lesson learned from a maintainer’s review of a pull request the skill produced The review comment
Pull request A pull request of the skill that was closed without merging, merged only after a person pushed commits to it, or is open with a person’s commits The pull request
  • Dry runs (skill tests, evals) are not evidence: a fixture says nothing about how a skill does on real work.
  • For a dashboard-managed or built-in skill, only the runs of the version in use count. For a skill kept in git, every run of it counts, since its commit moves with every push.
  • The org’s proposals read the evidence of every repository that uses the org’s skill. A repository’s proposals read that repository’s evidence only.
  • Evidence is read from the last window_days days, and never from before the last approved proposal for the skill: what came before was about the version it replaced.
  • The periodic check counts only the evidence that is newer than the last proposal for the skill, so the same evidence does not propose twice.
  • Every item counts towards min_evidence. The model is shown at most 10 critic results, 20 lessons and 10 pull requests.

What the model is asked

One call on the strong tier, with the purpose improve. It is shown the skill’s SKILL.md and goals.yaml as they are in use, how the skill did (runs, accepted runs, pull requests merged and closed), the evidence under references E1, E2, …, and the earlier proposals for the skill that did not go through: rejected (with the maintainer’s reason), did worse in the evals, or refused.

All of that is data. Evidence comes from review comments and from the output of repository code, so it reaches the model inside the same fence as an issue body (Security), and the instructions tell the model that text in it asking for a tool, a host, a credential or an approval is evidence of nothing but itself. The limits below do not rely on the model following that: they are checked in code.

The model answers with the complete new SKILL.md and goals.yaml (or leaves one as it is), a summary, and the list of changes with the references of the evidence each answers. It can also answer that the evidence shows no pattern worth a change. With the mock provider the call is replayed from a recording whose purpose is improve (Local stacks).

What a proposal may and may not change

A proposal writes SKILL.md and goals.yaml. Every other file of the skill is copied from the version in use. Then kōjō parses the proposed skill and compares it with the one in use, field by field. These are refused, and the proposal is closed as refused with the list:

  • a new tool, a renamed skill, or a higher model tier (or a tier kōjō cannot rank);
  • any change to any file other than SKILL.md and goals.yaml, the kit first of all: image, resources, egress hosts, credentials, needs_docker, setup commands, or a kit: pointing at another file;
  • removing no_changes, or confidential;
  • a check on a skill that has no sandbox, or a new or rewritten check command on a skill without the exec tool (a check is a command);
  • a judge on a higher or unknown model tier.

The proposed files must also pass the same validation as any draft (they parse, and the kit stays inside the scope’s settings/egress), and the proposal must cite at least one piece of the evidence it was given. A reference the model made up is dropped. A proposal whose files are those of a proposal a maintainer rejected is closed as nothing_to_propose, with the earlier reason.

Changes that make the goals easier to meet are allowed, as a separate list on the proposal that the approver sees before anything else:

  • max_attempts raised, or max_steps raised;
  • a check removed, its command changed, expect_failure added or removed, skip_if_unset added, or its timeout raised;
  • max_changed_lines raised or removed, a forbidden path removed, required_paths removed or given another pattern;
  • the judge removed, a rubric item dropped or reworded, or the judge moved to a lower tier;
  • an output no longer required.

kōjō finds these by comparing the two goals files, not by asking the model. A tool removed or a lower tier narrows the skill and is not listed.

How it is measured

When the proposal passes those checks it becomes a draft whose author is kojo, and two evals start: one of the draft, and one of the version in use, run as a copy of it so the comparison is with exactly the files the scope resolves. An eval of the version in use with the same files from the last seven days is reused instead of running again. The proposal waits for both, for six hours at most.

Result Status
The proposal’s pass rate is lower than the version in use’s did_not_hold_up, with both numbers
It is below min_eval_pass_rate of settings/activation did_not_hold_up, with the numbers
Otherwise ready, with both numbers

A skill without eval fixtures cannot be measured this way. Its proposal goes to ready unmeasured, and says plainly that there was nothing to measure it against. If the activation policy requires an eval, approving it then needs a test run of the draft that the goal critic accepted, as for any draft of such a skill.

Status Meaning
proposing Queued, or the model is writing it
evaluating Its draft exists and the evals run
ready It held up and waits for a person
approved A person activated it
rejected A person turned it down; the reason is kept
did_not_hold_up Its pass rate was below the version in use’s or the policy’s minimum
refused It tried to change what a proposal may not, or did not validate, or cited nothing
nothing_to_propose The evidence showed no pattern, the answer changed nothing, it repeated a rejected change, or by the time it was written the evidence was below the threshold or self-improvement was off
failed Its session failed before a result. A failed proposal does not start the cooldown.

Who approves

Only a person. Approving a proposal activates its draft through the activation gate, and on top of that gate:

  • The caller must be a person signed in to the dashboard with the operator role. An API token is refused with 403 whatever its role, so no script, CLI, MCP client or automation acting for someone can approve one, neither through the proposal nor by activating its draft. Sessions and schedules have no way to activate anything.
  • The proposal must be ready, and its files must still not widen the skill as it is in use at that moment.
  • kōjō wrote the proposal, so for require_second_reviewer the person who approves is the second reviewer, unless they edited the proposal themselves, last or at any time before.

A person may edit a ready proposal in the Skills studio before approving it. The edit is held to the same limits: saving files that would widen the skill is refused. The proposal then records who edited it and what it loosens now, and the eval it was measured with no longer counts: run an eval of the draft again. A proposal’s draft cannot be deleted; reject the proposal instead. Rejecting takes an optional reason, which the next proposal for the skill is shown, and the same files are not proposed again.

When activation goes through, the proposal is approved with the approver’s name, and what the new version is judged on starts from there. Where the scope’s skills are kept in git, approving opens the pull request, as activating any draft does.

Telling the maintainers

A proposal that is ready is listed in the dashboard: in Skills, under “Proposed by kōjō”, and on the skill’s row. With notify set, a chat message also goes to that channel, with the summary, the numbers, how many goals it loosens and the link to the proposal. A channel that cannot be reached does not undo the proposal.

Turn it on

The settings/improvement object turns it on for one scope. Only an admin changes it, in the dashboard under Settings, Self-improvement, with kojo config apply, or through the API. The org’s object covers the org’s skills. A repository’s object covers the skills that repository resolves; a repository does not inherit the org’s object.

version: 1
objects:
  - scope: org
    object: settings/improvement
    content:
      enabled: true
      # Empty means every skill of the scope.
      skills: [fix-bug, review-pr]
      # At least 2: one data point is not a pattern.
      min_evidence: 5
      window_days: 30
      cooldown_days: 7
      # A channel ID, or surface:channel when there is more than one chat surface.
      notify: slack:C0123ABC
  - scope: repo:github/acme/api
    object: settings/improvement
    content:
      enabled: true
Key Default Meaning
enabled false Propose changes to this scope’s skills
skills All Only these skills
min_evidence 3 Evidence a proposal needs
window_days 30 How far back evidence is read
cooldown_days 7 Least time between two proposals the periodic check makes for one skill
notify None The chat channel told when a proposal is ready

Start one by hand

Someone with the operator role can ask for a proposal for one skill now. It is refused when self-improvement is off for the skill, when the evidence is below min_evidence, and while the skill has an open proposal. It does not wait for the cooldown.

  • Dashboard: Propose a change on the skill’s row in Skills.
  • API: POST /api/v1/proposals with {"scope": "org", "skill": "fix-bug"} (HTTP API).
  • MCP: kojo_proposal_start (Manage with MCP).
  • CLI: kojo skills propose.
kojo skills propose fix-bug
kojo skills proposals --open

What it costs

  • One model call on the strong tier per proposal. Its prompt carries the skill’s SKILL.md (up to 24 KiB) and goals.yaml (up to 12 KiB), the evidence and the earlier proposals. The call is priced into the proposal’s session like any other.
  • Two eval runs per proposal that passes the checks: the draft, and the version in use unless a run of the same files from the last seven days is reused. Each runs every fixture case of the skill as a dry-run session, with its model calls and sandboxes. That is usually most of the cost.
  • A proposal that is refused, has nothing to propose or repeats a rejected change costs the model call only.
  • While the daily budget of settings/models is spent, a proposal waits like any session.

cooldown_days and min_evidence bound how often this happens per skill; skills bounds which skills it happens for.

Read a proposal

A proposal’s page in the dashboard (/skills/proposals/<id>) has, from the top:

  1. What it loosens, in a box that is never folded away, and, if the skill in use changed since and the proposal would now widen it, why approval will be refused.
  2. The numbers: its pass rate, the version in use’s, how many goals it loosens and how many pieces of evidence it rests on.
  3. Why: the summary, and each change with the references of the evidence it answers. A reference links to the item below.
  4. The evidence, each item with its kind, date and repository, and a link to the session, the pull request or the review.
  5. The changes: a diff of each file against the version in use now.
  6. The eval, case by case: whether each case passed for the version in use and for the proposal, and which ones changed.
  7. The decision: approve and activate, reject with a reason, or open the draft in the studio to edit or test it first.
A proposal page for fix-bug, ready for review: a box saying it loosens the bar in one way (max_attempts raised from 3 to 4), its pass rate of 100% against 75% for the version in use, the rationale with the evidence each change answers, and the start of the evidence list.
The top of a ready proposal: items 1 to 4 of the list, with the evidence references (E1, E2, …) under each change.

The same is in GET /api/v1/proposals/{id} and the MCP tool kojo_proposal. Every step is in the audit log as skill.proposal.start, create, validate, close, approve and reject, and counted by kojo_skill_proposals_total and kojo_skill_proposal_outcomes_total (Prometheus metrics).

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