Committed skills as agent instructions: ownership, updates and required tools #208

Closed
opened 2026-11-16 06:10:52 +00:00 by Claude · 2 comments
Owner

Part of #87

Question

Shared agent primitives through apm commits the deployed .claude/skills and .claude/agents, leaves them outside CODEOWNERS and lets their updates automerge. Every AGENTS.md is under CODEOWNERS because an agent rewriting its own instructions is the risk. Four reviewers flagged the gap from different sides. Decide:

  • Are committed skills and agents agent instructions for the threat model? A skill's frontmatter can grant itself tools, run shell commands on load and register hooks, and these apply in unattended runs without a trust prompt. apm's executable gate does not look at them.
  • If they are: CODEOWNERS on .claude/skills and .claude/agents (one maintainer approval per skills update), or a bot-diff rule that blocks automerge when frontmatter gains a grant, a hook or a shell line? Do apm.yml, apm.lock.yaml and .mcp.json join CODEOWNERS?
  • The skills to be committed cite documents outside this repository, against Sanitise private-environment references. Does the commit wait for a clean source, or is an exception recorded?
  • Agreement between apm.yml, the lock and the committed tree is "held by review". apm audit --ci compares deployed files with lock hashes. Is that the control?
  • rtk is a required contributor tool only because the skills call rtk git. Its hook already rewrites plain git, and its default edition carries a non-open-source component installed by curl | sh. Required, optional, or removed from the skills?
  • Skills contradict decided rules ("skills carry no rules"): one mandates Co-authored-by:. Who fixes the skill, and what holds until then?
  • Renovate's apm manager needs the apm CLI to update the lock, and the bot-diff gate refuses apm.yml and its lock today.

From the review

  • Amends, depending on the answer: the deployed-skills issue (#193), the CODEOWNERS issue (#144), the local settings and hooks issue (#196), the contributor docs issue (#189, which tells every contributor to run apm install), and the scope of the open re-check task (#194).
Part of #87 ## Question [Shared agent primitives through apm](https://git.rkdr.net/Mortis/Kamino/issues/104) commits the deployed `.claude/skills` and `.claude/agents`, leaves them outside CODEOWNERS and lets their updates automerge. Every `AGENTS.md` is under CODEOWNERS because an agent rewriting its own instructions is the risk. Four reviewers flagged the gap from different sides. Decide: - Are committed skills and agents agent instructions for the threat model? A skill's frontmatter can grant itself tools, run shell commands on load and register hooks, and these apply in unattended runs without a trust prompt. apm's executable gate does not look at them. - If they are: CODEOWNERS on `.claude/skills` and `.claude/agents` (one maintainer approval per skills update), or a bot-diff rule that blocks automerge when frontmatter gains a grant, a hook or a shell line? Do `apm.yml`, `apm.lock.yaml` and `.mcp.json` join CODEOWNERS? - The skills to be committed cite documents outside this repository, against [Sanitise private-environment references](https://git.rkdr.net/Mortis/Kamino/issues/88). Does the commit wait for a clean source, or is an exception recorded? - Agreement between `apm.yml`, the lock and the committed tree is "held by review". `apm audit --ci` compares deployed files with lock hashes. Is that the control? - `rtk` is a required contributor tool only because the skills call `rtk git`. Its hook already rewrites plain `git`, and its default edition carries a non-open-source component installed by `curl | sh`. Required, optional, or removed from the skills? - Skills contradict decided rules ("skills carry no rules"): one mandates `Co-authored-by:`. Who fixes the skill, and what holds until then? - Renovate's `apm` manager needs the `apm` CLI to update the lock, and the bot-diff gate refuses `apm.yml` and its lock today. ## From the review - Amends, depending on the answer: the deployed-skills issue (#193), the CODEOWNERS issue (#144), the local settings and hooks issue (#196), the contributor docs issue (#189, which tells every contributor to run `apm install`), and the scope of the open re-check task (#194).
Claude added the
Wayfinder
Grilling
label 2026-11-16 06:10:52 +00:00
Claude added a new dependency 2026-11-16 06:11:27 +00:00
Author
Owner

Evidence from the review of the map (2026-11-15). File references below are to the skills as apm install deploys them today (gitignored, .gitignore:19), which chore: commit the deployed agent skills, trim the apm plugins and pin apm-cli would commit as they are.

Are skills agent instructions?

  • Claude Code skills docs: allowed-tools are "Tools Claude can use without asking permission", and "Claude Code applies a project skill's allowed-tools even in a -p run in a folder you've never trusted"; a !`<command>` line "runs shell commands before the skill content is sent to Claude"; frontmatter hooks register when the skill is invoked, also in an untrusted -p run.
  • apm approve docs: "Text primitives (skills, agents, instructions) are never gated". So apm's executable gate does not see these.
  • Deployed today: git-commits/SKILL.md:19 allowed-tools: Bash; pc-author/SKILL.md:7 allowed-tools: Bash Read Write Edit; a shell script under diagnosing-bugs/scripts/.
  • Shared agent primitives through apm: ".claude/ is not under CODEOWNERS: skills carry no rules". Its own survey contradicts this: git-commits mandates rtk git and shows Co-authored-by:. Contributor doc set owns every AGENTS.md because "an agent rewriting its own instructions is the mistake the threat model guards against".
  • Four findings agree: yes, they are instructions and executable configuration. Confidence high on the mechanism.

How they are held

Option Cost
CODEOWNERS on \.claude/.* (whole directory) one maintainer approval per skills update; then it merges itself
Bot-diff rule: automerge only if no frontmatter gains allowed-tools, hooks or a ! line and no executable file changes a new check in scripts/check_bot_pr_diff.py
Neither, residual risk recorded in ADR 0001 none
  • Cheap extra layer from one finding: "disableSkillShellExecution": true in the tracked .claude/settings.json (documented setting).
  • apm.yml, apm.lock.yaml and .mcp.json: apm grants are package-scoped ("a bare owner/repo key and an owner/repo#1.2.0 key both match ... regardless of the installed version"), and a self-defined MCP server is an executable written to the tool's MCP config. Recommendation: own them, with docs/agents/.*.

Private references in the skills

apm audit as the control

  • apm baseline checks: deployed-files-present, content-integrity ("SHA-256 drift between the on-disk content and the hash recorded in deployed_file_hashes") and a drift replay in apm audit --ci, which fetches the lock-pinned source.
  • The objection "needs source access" goes away once the source is public. Recommendation: add apm audit --ci to Lint, or to pull requests touching apm.* or .claude/, in the re-check task.

rtk

  • Required only because git-commits/SKILL.md:24 says "Run git as rtk git <subcommand>, never bare git — org convention".
  • rtk README: its hook rewrites plain git status "automatically"; the default edition is "Apache-2.0 + BUSL-1.1", rtk-oss is Apache-only; install by curl ... | sh.
  • Recommendation: optional. If kept, name rtk-oss and rtk init -g only, because project-level init writes a CLAUDE.md.

The Co-authored-by: skill

Renovate's apm manager, and related

  • Renovate apm manager: lock update "requires the apm CLI"; reads only the string form, while apm.yml:19-27 uses the object form. apm is not in enabledManagers; the bot-diff gate refuses apm.yml and its lock.
  • Not verified: whether the committed .claude/ drifts from the lock after a Renovate bump.
  • Setup in docs(contributing): split the contributor docs into CONTRIBUTING.md and docs/contributing/ tells everyone to run apm install, which fails without access to the SSH source and dirties committed files.
  • apm-cli reaches the ci image through requirements-dev.txt, against the apm decision's "not in the ci image"; accept or ask.
  • Backlog issues tell agents to use agentsmd-author/agentsmd-audit, from the core plugin the commit issue drops.
  • docs/agents/issue-tracker.md:3 points to an MCP-only skill; line 30 says fork pull requests are not accepted.
Evidence from the review of the map (2026-11-15). File references below are to the skills as `apm install` deploys them today (gitignored, `.gitignore:19`), which [chore: commit the deployed agent skills, trim the apm plugins and pin apm-cli](https://git.rkdr.net/Mortis/Kamino/issues/193) would commit as they are. ### Are skills agent instructions? - [Claude Code skills docs](https://code.claude.com/docs/en/skills): `allowed-tools` are "Tools Claude can use without asking permission", and "Claude Code applies a project skill's `allowed-tools` even in a `-p` run in a folder you've never trusted"; a `` !`<command>` `` line "runs shell commands before the skill content is sent to Claude"; frontmatter `hooks` register when the skill is invoked, also in an untrusted `-p` run. - [apm approve docs](https://github.com/microsoft/apm): "Text primitives (skills, agents, instructions) are never gated". So apm's executable gate does not see these. - Deployed today: `git-commits/SKILL.md:19` `allowed-tools: Bash`; `pc-author/SKILL.md:7` `allowed-tools: Bash Read Write Edit`; a shell script under `diagnosing-bugs/scripts/`. - [Shared agent primitives through apm](https://git.rkdr.net/Mortis/Kamino/issues/104): "`.claude/` is not under CODEOWNERS: skills carry no rules". Its own survey contradicts this: `git-commits` mandates `rtk git` and shows `Co-authored-by:`. [Contributor doc set](https://git.rkdr.net/Mortis/Kamino/issues/103) owns every `AGENTS.md` because "an agent rewriting its own instructions is the mistake the threat model guards against". - Four findings agree: yes, they are instructions and executable configuration. Confidence high on the mechanism. ### How they are held | Option | Cost | |---|---| | CODEOWNERS on `\.claude/.*` (whole directory) | one maintainer approval per skills update; then it merges itself | | Bot-diff rule: automerge only if no frontmatter gains `allowed-tools`, `hooks` or a `!` line and no executable file changes | a new check in `scripts/check_bot_pr_diff.py` | | Neither, residual risk recorded in ADR 0001 | none | - Cheap extra layer from one finding: `"disableSkillShellExecution": true` in the tracked `.claude/settings.json` (documented setting). - `apm.yml`, `apm.lock.yaml` and `.mcp.json`: apm grants are package-scoped ("a bare `owner/repo` key and an `owner/repo#1.2.0` key both match ... regardless of the installed version"), and a self-defined MCP server is an executable written to the tool's MCP config. Recommendation: own them, with `docs/agents/.*`. ### Private references in the skills - [Sanitise private-environment references](https://git.rkdr.net/Mortis/Kamino/issues/88): "No tracked file refers to another repository of the maintainer's". `git-history/references/git-log-format.md:169-172` cites design records of another repository ("ADR-0023"). - The clean-source check is deferred to [Re-check Shared agent primitives once the skills source is public](https://git.rkdr.net/Mortis/Kamino/issues/194); the commit is not. - Options: move the commit under the re-check, or record a second exception to the sanitise rule with an expiry. ### apm audit as the control - [apm baseline checks](https://github.com/microsoft/apm): `deployed-files-present`, `content-integrity` ("SHA-256 drift between the on-disk content and the hash recorded in `deployed_file_hashes`") and a drift replay in `apm audit --ci`, which fetches the lock-pinned source. - The objection "needs source access" goes away once the source is public. Recommendation: add `apm audit --ci` to Lint, or to pull requests touching `apm.*` or `.claude/`, in the re-check task. ### rtk - Required only because `git-commits/SKILL.md:24` says "Run git as `rtk git <subcommand>`, never bare `git` — org convention". - [rtk README](https://github.com/rtk-ai/rtk): its hook rewrites plain `git status` "automatically"; the default edition is "Apache-2.0 + BUSL-1.1", `rtk-oss` is Apache-only; install by `curl ... | sh`. - Recommendation: optional. If kept, name `rtk-oss` and `rtk init -g` only, because project-level init writes a `CLAUDE.md`. ### The `Co-authored-by:` skill - `git-commits/SKILL.md:68`, `references/create-commit.md:15`, `references/commit-template.md:62`. [AI-assistance policy and commit trailer](https://git.rkdr.net/Mortis/Kamino/issues/94) excludes it; the apm decision lets the root policy win. - The skills source has an open request for a consumer setting or `Assisted-by:`; nothing there holds it yet. The commit-msg check discussed in [Making sure an agent actually loads the guidance](https://git.rkdr.net/Mortis/Kamino/issues/213) would hold it here. ### Renovate's apm manager, and related - [Renovate apm manager](https://docs.renovatebot.com/modules/manager/apm/): lock update "requires the `apm` CLI"; reads only the string form, while `apm.yml:19-27` uses the object form. `apm` is not in `enabledManagers`; the bot-diff gate refuses `apm.yml` and its lock. - Not verified: whether the committed `.claude/` drifts from the lock after a Renovate bump. - Setup in [docs(contributing): split the contributor docs into CONTRIBUTING.md and docs/contributing/](https://git.rkdr.net/Mortis/Kamino/issues/189) tells everyone to run `apm install`, which fails without access to the SSH source and dirties committed files. - `apm-cli` reaches the `ci` image through `requirements-dev.txt`, against the apm decision's "not in the ci image"; accept or ask. - Backlog issues tell agents to use `agentsmd-author`/`agentsmd-audit`, from the `core` plugin the commit issue drops. - `docs/agents/issue-tracker.md:3` points to an MCP-only skill; line 30 says fork pull requests are not accepted.
Defame1297 was assigned by Claude 2026-11-16 14:33:37 +00:00
Author
Owner

Resolution

Resolved on 2026-11-16 with the maintainer, by grilling. Evidence: the review comment above. Partly supersedes Shared agent primitives through apm (points 2, 3 and 8) and the note from Agent guard hook and permission allowlist that "skills and agents stay unowned and automerged".

Decision

  1. Skills and agents are agent instructions. Committed .claude/skills and .claude/agents are instructions and executable configuration for the threat model, the same as AGENTS.md. Reason: a skill can grant itself tools, run shell commands on load and register hooks, also in an unattended -p run, and apm's approval step never looks at text primitives.
  2. Held by CODEOWNERS on the whole .claude/ (\.claude/.*, because Gitea patterns are regexes). This replaces the separate settings.json, hooks/ and rules/ entries. A frontmatter bot-diff rule was rejected: it cannot see instructions in a skill's prose, and it would be a custom checker. Cost accepted: each skills bump waits for one maintainer approval. How that sits with Renovate automerge is for Code-owner approval against Renovate automerge, and where secrets live.
  3. Also owned: apm.yml, apm.lock.yaml, .mcp.json and docs/agents/. Each changes what an agent does or may run: apm grants are scoped to the package, .mcp.json registers executables, and docs/agents/ is read by the skills as configuration.
  4. "disableSkillShellExecution": true goes in the tracked .claude/settings.json, as a second layer. Not verified here: the implementation confirms that the setting exists and drops the line if it does not.
  5. The commit of the deployed skills waits for the clean public source. It moves from #193 into Re-check Shared agent primitives once the skills source is public. The public, clean source becomes a precondition of Open to friends (#229). Until it exists, the contributor docs do not tell anyone to run apm install. No exception to Sanitise private-environment references is recorded.
  6. Skills that contradict this repository's rules fail the re-check's clean-content check. The example is the Co-authored-by: trailer, against AI-assistance policy and commit trailer. The fix belongs in the skills source. Until then the skills are not committed (point 5). The trailer stays held by review here. A commit-msg control stays with Making sure an agent actually loads the guidance.
  7. rtk is mandatory, as rtk-oss. The maintainer's choice, because it is relevant to agentic coding with or without the skills. The objection is recorded: it is a token saver, not a correctness tool, and the default edition carries a BUSL-1.1 component installed by curl | sh. How it is held:
    • scripts/dev-setup.sh installs the pinned rtk-oss into ~/.local/bin. It verifies a checksum, or falls back to cargo install at the pinned version if no checksummed release exists. There is never a curl | sh, and there is a tested minimum version.
    • The tracked .claude/settings.json carries a guarded PreToolUse hook on Bash: command -v rtk >/dev/null 2>&1 && exec rtk hook claude || exit 0. A clone plus dev-setup.sh is the whole setup, with no rtk init -g. Without rtk, it degrades to plain git. This reverses #104's "no hook is tracked here", whose reason the guard removes.
    • The rule is aspirational: no control sees a contributor's machine.
    • Not verified: how the tracked hook behaves next to a global rtk init -g hook. The implementation tests it; if the two double-wrap, dev-setup.sh warns about a global hook.
    • Neither sibling repository installs rtk. One carries its usage block in a CLAUDE.md, which this repository does not have.
  8. apm audit --ci is the control for agreement between apm.yml, the lock and the committed tree, replacing "held by review". It runs in Lint, only on pull requests that touch apm.yml, apm.lock.yaml or .claude/. It is outside the network-off fast path (#168), because the drift replay fetches the source. apm-cli goes into the ci image, reversing #104's "not in the ci image". It ships with the re-check, because it needs the public source. Not verified: whether the hash check alone runs offline; if it does, the fetch is dropped.
  9. Renovate's apm support stays in the re-check's scope. Its bot-diff allowance for apm.yml, the lock and .claude/ must not bypass CODEOWNERS.
  10. No ADR. Every part is a one-line reversal. One line goes in ADR 0001: committed skills and agents are agent instructions and are owned like AGENTS.md.

Backlog

## Resolution Resolved on 2026-11-16 with the maintainer, by grilling. Evidence: the review comment above. Partly supersedes [Shared agent primitives through apm](https://git.rkdr.net/Mortis/Kamino/issues/104) (points 2, 3 and 8) and the note from [Agent guard hook and permission allowlist](https://git.rkdr.net/Mortis/Kamino/issues/195) that "skills and agents stay unowned and automerged". ### Decision 1. **Skills and agents are agent instructions.** Committed `.claude/skills` and `.claude/agents` are instructions and executable configuration for the threat model, the same as `AGENTS.md`. Reason: a skill can grant itself tools, run shell commands on load and register hooks, also in an unattended `-p` run, and apm's approval step never looks at text primitives. 2. **Held by CODEOWNERS on the whole `.claude/`** (`\.claude/.*`, because Gitea patterns are regexes). This replaces the separate `settings.json`, `hooks/` and `rules/` entries. A frontmatter bot-diff rule was rejected: it cannot see instructions in a skill's prose, and it would be a custom checker. Cost accepted: each skills bump waits for one maintainer approval. How that sits with Renovate automerge is for [Code-owner approval against Renovate automerge, and where secrets live](https://git.rkdr.net/Mortis/Kamino/issues/210). 3. **Also owned:** `apm.yml`, `apm.lock.yaml`, `.mcp.json` and `docs/agents/`. Each changes what an agent does or may run: apm grants are scoped to the package, `.mcp.json` registers executables, and `docs/agents/` is read by the skills as configuration. 4. **`"disableSkillShellExecution": true`** goes in the tracked `.claude/settings.json`, as a second layer. Not verified here: the implementation confirms that the setting exists and drops the line if it does not. 5. **The commit of the deployed skills waits for the clean public source.** It moves from [#193](https://git.rkdr.net/Mortis/Kamino/issues/193) into [Re-check Shared agent primitives once the skills source is public](https://git.rkdr.net/Mortis/Kamino/issues/194). The public, clean source becomes a precondition of *Open to friends* ([#229](https://git.rkdr.net/Mortis/Kamino/issues/229)). Until it exists, the contributor docs do not tell anyone to run `apm install`. No exception to [Sanitise private-environment references](https://git.rkdr.net/Mortis/Kamino/issues/88) is recorded. 6. **Skills that contradict this repository's rules fail the re-check's clean-content check.** The example is the `Co-authored-by:` trailer, against [AI-assistance policy and commit trailer](https://git.rkdr.net/Mortis/Kamino/issues/94). The fix belongs in the skills source. Until then the skills are not committed (point 5). The trailer stays held by review here. A `commit-msg` control stays with [Making sure an agent actually loads the guidance](https://git.rkdr.net/Mortis/Kamino/issues/213). 7. **`rtk` is mandatory, as `rtk-oss`.** The maintainer's choice, because it is relevant to agentic coding with or without the skills. The objection is recorded: it is a token saver, not a correctness tool, and the default edition carries a BUSL-1.1 component installed by `curl | sh`. How it is held: - `scripts/dev-setup.sh` installs the pinned `rtk-oss` into `~/.local/bin`. It verifies a checksum, or falls back to `cargo install` at the pinned version if no checksummed release exists. There is never a `curl | sh`, and there is a tested minimum version. - The tracked `.claude/settings.json` carries a guarded PreToolUse hook on `Bash`: `command -v rtk >/dev/null 2>&1 && exec rtk hook claude || exit 0`. A clone plus `dev-setup.sh` is the whole setup, with no `rtk init -g`. Without `rtk`, it degrades to plain `git`. This reverses #104's "no hook is tracked here", whose reason the guard removes. - The rule is aspirational: no control sees a contributor's machine. - Not verified: how the tracked hook behaves next to a global `rtk init -g` hook. The implementation tests it; if the two double-wrap, `dev-setup.sh` warns about a global hook. - Neither sibling repository installs `rtk`. One carries its usage block in a `CLAUDE.md`, which this repository does not have. 8. **`apm audit --ci` is the control** for agreement between `apm.yml`, the lock and the committed tree, replacing "held by review". It runs in Lint, only on pull requests that touch `apm.yml`, `apm.lock.yaml` or `.claude/`. It is outside the network-off fast path ([#168](https://git.rkdr.net/Mortis/Kamino/issues/168)), because the drift replay fetches the source. `apm-cli` goes into the `ci` image, reversing #104's "not in the ci image". It ships with the re-check, because it needs the public source. Not verified: whether the hash check alone runs offline; if it does, the fetch is dropped. 9. **Renovate's apm support** stays in the re-check's scope. Its bot-diff allowance for `apm.yml`, the lock and `.claude/` must not bypass CODEOWNERS. 10. **No ADR.** Every part is a one-line reversal. One line goes in ADR 0001: committed skills and agents are agent instructions and are owned like `AGENTS.md`. ### Backlog - New: [chore(dev): install rtk-oss from dev-setup.sh and track its guarded Claude Code hook](https://git.rkdr.net/Mortis/Kamino/issues/228), blocked by #196. - New: [chore: publish the agent skills source in the organisation before opening to friends](https://git.rkdr.net/Mortis/Kamino/issues/229); it now blocks #194. - Scope changed, by comment: #193 (commit and `rtk` moved out), #144 (owned paths), #196 (shell-execution setting), #189 (no `apm install`, `rtk` via `dev-setup.sh`), #194 (commit, clean content, `apm audit`, CODEOWNERS), #143 (ADR 0001 line).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: Mortis/Kamino#208