Skip to content
0064 · Skills for task runs

Run skills are pinned from the default branch, loaded through the broker, and changed only by human pull requests

Status: Accepted
Date: 2026-12-06
Deciders: Smana (Platform Owner)
Related: skills for task runs design, ADR-0063, ADR-0061


Context

ADR-0063 established taught-first repository lessons in the broker database and withdrew autonomous self-evolution. Lessons handle short day-to-day corrections well, and steering notes handle class-wide rules under 2 KiB, but repositories increasingly keep multi-step procedures, checklists, and helper scripts as Agent Skills under .agents/skills/<name>/SKILL.md for local coding agents (Claude Code, Codex, OpenCode).

Exposing repository skills naively to autonomous task runs introduces three distinct failure modes:

  • Branch injection (GitInject). Published research (arXiv 2606.09935) showed that adding an instruction file on a pull request branch steered CI agents 5 of 5 times, while identical text in the pull request body did 0 of 5 times. Every coding harness discovers project skills from the working tree, never from the base branch.
  • No mid-run stop or auditability. Harness-native skill loading reads local files invisibly: loads are uncounted, cannot be refused once a run starts, and silently pull developer-only skills into agent runs.
  • Unvetted authoring and supply chain risk. One-shot generated skills underperform human-reviewed guidance, skills can smuggle prompt injections or malicious scripts in pull requests (including from forks), and autonomous self-editing of skills would reopen ADR-0063.

Decision Drivers

  • Every trust decision sits outside the run sandbox: a merge approves skill text, a pinned commit fixes what a run sees, an explicit role marker opts a skill in, and a maintainer stop revokes it immediately
  • Repositories with existing .agents/skills/ for local developers are unaffected until a maintainer explicitly opts a skill in
  • Both harnesses (OpenCode and OpenHands) share one trust boundary and one audit trail in the room log
  • No second skill store or browser editor outside Git; every change to .agents/skills/ lands via a scanned pull request merged by a human
  • Static security scanning of untrusted skill pull requests runs with zero credentials and zero network egress

Considered Options

Option 1: Enable native harness skill loading from the working tree

Let OpenCode and OpenHands discover .agents/skills/ directly from the checked-out repository.

Pros:

  • Zero broker or factory code; works out of the box with harness updates
  • Immediate access to skill files beside the working tree

Cons:

  • A run can load unreviewed or attacker-edited skills from its own or a pull request’s branch (violates branch-injection isolation)
  • Loads are invisible to the broker, cannot be counted per room, and cannot be stopped once a run starts
  • Developer-only skills enter autonomous runs without opt-in; OpenCode and OpenHands diverge on discovery rules

Option 2: Store and edit skills inside the broker database

Manage skills in Postgres through an in-browser editor on /learning, matching repository lessons.

Pros:

  • Instant updates and per-role filtering without waiting for Git merges
  • One API for reading, editing, and stopping

Cons:

  • Creates a second source of truth outside Git, diverging from local tools (gh skill, Claude Code, Codex)
  • Bypasses code review, Git history, branch rulesets, and pull-request security scanning
  • Requires duplicating file storage and diff tooling in the broker

Option 3: Autonomous self-editing and model-evaluated skills

Let runs propose, evaluate against holdout tasks, and auto-merge skill updates.

Pros:

  • Reduces maintainer review work for iterative skill tuning

Cons:

  • Reopens ADR-0063 — repositories lack the task volume required for statistical evaluation gates
  • One-shot generated skills degrade pass rates and add token overhead by repeating existing repository docs
  • Lets a model-written instruction reach future runs without a human approving the exact diff

Option 4: Default-branch pinning, broker-mediated loading with instant stop, and human-merged scanned pull requests

Keep skills in Git under .agents/skills/, opt them in with metadata.maku-roles, pin and serve them through the factory and broker, close native loaders, and gate every change to .agents/skills/ with static scanning and human merge.

Pros:

  • Single source of truth in Git shared with local developer tools; zero impact on unmarked skills
  • Eliminates branch-injected skill execution through default-branch pinning, sparse exclusion, SHA-256 verification, and closed native loaders
  • Gives maintainers a one-step deny-only stop that reaches runs already in progress
  • Keeps authoring grounded in repository history (recommendations, skill: generate, skill: remove, public-only trusted sources) while preserving human merge authority

Cons:

  • Skills require maku-factory (not broker-only installs) to pin default-branch commits
  • Stopping a skill withdraws skill_load and listing, while companion files already extracted for a run that loaded the skill remain in its read-only directory until the run ends
  • Enabling skillScan requires statuses: write on the merger App and a branch ruleset requiring maku/skill-scan from that App

Decision

Option 4. The full rulings (P1–P8, D1–D55) are recorded in the skills for task runs design.

  • Opt-in by role marker (metadata.maku-roles). Only skills under .agents/skills/<name>/SKILL.md on the default branch carrying metadata.maku-roles with a subset of implementer, tester, and reviewer are offered to runs (at most 20 per role, sorted by name; subject to strict size, text-only, control-character, and redaction validation). triager, scoper, judge, and publisher never load skills; the scoper receives only pinned, non-stopped skill names and descriptions in its brief as data.
  • Default-branch pinning, sparse exclusion, and closed native loaders. At run creation, maku-factory reads .agents/skills/ at the default branch’s head commit and posts the pin (POST /v1/skills/pin) to maku-broker. Every normal run excludes .agents/skills/ from its working tree via git sparse-checkout (only skill-class drafting runs opt out via AGENT_SKILLS_CHECKOUT=1). The shared bootstrap extracts non-SKILL.md companion files at the pinned commit into read-only /workspace/skills/<name>/, verified against broker-supplied SHA-256 hashes. Both OpenCode and OpenHands disable their native skill loaders (pinned by automated tests), and allowed-tools is ignored: skills grant no tool, token scope, or network egress.
  • Broker-mediated skill_load and immediate deny-only stop. Runs load SKILL.md exclusively through the broker’s :8090 MCP tool skill_load, recording skills_pinned and skill_loaded room events, metrics without skill-name labels, and the Agent-Skills pull-request trailer for served loads. A repository writer can stop or resume any skill by name (POST /api/skills/{owner}/{name}/{skill}/actions or maku learning skill <name> stop --reason …); the broker’s stop is strictly deny-only, never adds or edits text, and refuses new skill_load calls immediately across runs already in progress.
  • Human-only pull requests, no editor, and grounded recommendations. Any agent pull request touching .agents/skills/ is held for a human merge (skill_path). Maku ships no browser skill editor and performs no autonomous self-editing or model evaluation of skills. The Skills tab on /learning surfaces usage counts, a count-only 30-day outcome line, and deterministic history-backed recommendations (plus an optional maintainer-triggered Find more pass over redacted 90-day summaries through the model gateway’s recommender client, using a read-only ROOMS_VISIBILITY_GITHUB_APP_DIR mount). Maintainers act via Draft it (skill: generate, optionally codifying lessons on merge and consulting public-only skills.trustedSources), Copy prompt, Draft removal pull request (skill: remove, no model), or Dismiss.
  • Static SkillSpector scan in a zero-network Job. When skillScan.enabled is set, every pull request head touching .agents/skills/ (hand-written, drafted, or adapted) is scanned statically by NVIDIA SkillSpector (maku-skillspector, digest-pinned, --no-llm) inside an ephemeral Kubernetes Job with automountServiceAccountToken: false, no credentials, read-only projected input ConfigMaps, and a deny-all CiliumNetworkPolicy or NetworkPolicy (maku-skill-scan-deny) proved active by a pre-scan init deny probe. Findings and deterministic authoring lint notes are posted in one comment per head; HIGH/CRITICAL findings or scan failures hold the pull request (skill_security, via the merger App’s required maku/skill-scan status) until a maintainer posts an unedited, head-bound /factory skill-override <40-hex head sha>.

Consequences

  • Teams can share .agents/skills/ between local coding agents and Maku task runs with one Git review workflow and zero risk to unmarked developer skills.
  • Branch-injected or fork-injected .agents/skills/ files cannot steer runs: sparse exclusion removes them from checkouts, native loaders stay closed, and skill_load serves only the pinned default-branch commit.
  • Enabling skillScan requires statuses: write on the merger App (requested on every merger call once enabled), a branch ruleset requiring maku/skill-scan from that App, and a dedicated scan namespace without mesh injection or competing allow policies.
  • Enabling Find more adds a third broker client (recommender / recommenderInternal) to maku-gateway and mounts the factory App read-only (ROOMS_VISIBILITY_GITHUB_APP_DIR) on maku-broker.
  • maku-broker gains Postgres tables for skill pins, loads, stops, stop actions, task evidence, recommendation dismissals, and recommendation passes, all purged by existing retention policies.

What would reopen this

  • Upstream headless MCP skills support (SEP-2640 or successor) gains archive/directory delivery, executable-bit handling, and commit pinning, making custom bootstrap extraction unnecessary.
  • Organizations need skills.trustedSources to adapt skills from private internal repositories, requiring factory-mediated bounded file delivery rather than widened run tokens.
  • Maintainers require SkillSpector’s optional model stage, warranting a dedicated gateway allow-list beside the deny-all Job policy and a max-of-static-and-model severity rule.
  • Adoption shows frequent third-party skill imports needing a dedicated skill: import execution pipeline beyond the reserved grammar.