git plugin: rtk git vs bare git is inconsistent across skills #113

Closed
opened 2026-08-30 13:19:20 +00:00 by Claude · 1 comment
Collaborator

Surfaced during the #99 ADR-0020 retrofit, wave 2. Pre-existing — held out of that wave because it needs one normalising pass across the plugin, not nine independent per-skill judgment calls.

The inconsistency

CLAUDE.md states the golden rule: always prefix commands with rtk, including inside && chains, because RTK either applies a token-reducing filter or passes through unchanged — so it is always safe.

The plugin does not follow this uniformly:

  • git-commits/SKILL.md mandates rtk git <subcommand> and says "never bare git".
  • git-history uses bare git throughout its body and references.
  • git-submodules uses rtk git in the body's gates but bare git in reference code blocks.
  • Across the plugin, reference files generally use bare git while bodies vary.

Two auditors independently flagged it, one noting that bare git in reference blocks "matches the convention in every sibling git skill's references, so it is house-normal" — which is the problem: there are two house norms and no stated rule for which applies where.

Why it is worth fixing

The cost is not correctness — both forms work. It is that an agent reading one skill learns a convention that the next skill contradicts, and neither states which is intended. That is the same class of defect as a stale cross-reference: cheap individually, corrosive in aggregate, and invisible to every gate.

What a fix needs to decide

  1. Does rtk apply to illustrative commands in references/ files, or only to commands the agent is instructed to execute? A reasonable split is: executable instructions get rtk, syntax illustrations do not — but it has to be written down.
  2. Once decided, normalise all nine skills in one pass and state the rule somewhere durable (plugin README.md, or AGENTS.md if it generalises beyond the git plugin).

Doing this per-skill as each is touched guarantees the inconsistency persists for months and gets re-litigated every time.

Scope

plugins/git/.apm/skills/ — all nine: git-commits, git-branches, git-worktrees, git-remotes, git-workflow, git-submodules, git-history, pc-run, pc-author. Worth checking whether the gitea-* family has the same split before deciding where the rule lives.

#99 (the retrofit), #112 (the other pre-existing git-plugin item from the same wave).

Surfaced during the #99 ADR-0020 retrofit, wave 2. **Pre-existing** — held out of that wave because it needs one normalising pass across the plugin, not nine independent per-skill judgment calls. ## The inconsistency `CLAUDE.md` states the golden rule: always prefix commands with `rtk`, including inside `&&` chains, because RTK either applies a token-reducing filter or passes through unchanged — so it is always safe. The plugin does not follow this uniformly: - `git-commits/SKILL.md` mandates `rtk git <subcommand>` and says "never bare `git`". - `git-history` uses bare `git` throughout its body and references. - `git-submodules` uses `rtk git` in the body's gates but bare `git` in reference code blocks. - Across the plugin, reference files generally use bare `git` while bodies vary. Two auditors independently flagged it, one noting that bare `git` in reference blocks "matches the convention in every sibling git skill's references, so it is house-normal" — which is the problem: there are two house norms and no stated rule for which applies where. ## Why it is worth fixing The cost is not correctness — both forms work. It is that an agent reading one skill learns a convention that the next skill contradicts, and neither states which is intended. That is the same class of defect as a stale cross-reference: cheap individually, corrosive in aggregate, and invisible to every gate. ## What a fix needs to decide 1. Does `rtk` apply to **illustrative** commands in `references/` files, or only to commands the agent is instructed to **execute**? A reasonable split is: executable instructions get `rtk`, syntax illustrations do not — but it has to be written down. 2. Once decided, normalise all nine skills in one pass and state the rule somewhere durable (plugin `README.md`, or `AGENTS.md` if it generalises beyond the git plugin). Doing this per-skill as each is touched guarantees the inconsistency persists for months and gets re-litigated every time. ## Scope `plugins/git/.apm/skills/` — all nine: `git-commits`, `git-branches`, `git-worktrees`, `git-remotes`, `git-workflow`, `git-submodules`, `git-history`, `pc-run`, `pc-author`. Worth checking whether the `gitea-*` family has the same split before deciding where the rule lives. ## Related #99 (the retrofit), #112 (the other pre-existing git-plugin item from the same wave).
Claude added the Kind/Enhancement
Reviewed
Confirmed
1
Priority
Low
4
labels 2026-08-30 13:19:20 +00:00
Claude added this to the Skills & Agents milestone 2026-08-30 15:59:06 +00:00
Author
Collaborator

Implementation note

Rule decided in session, empirically validated against git-commits before the corpus-wide pass (every existing bare git there turned out illustrative, never an instructed step): executable instructed commands get rtk git; illustrative/referential mentions of a git command stay bare git. Documented in a new plugins/git/README.md under a "Conventions" section — confirmed it doesn't generalize beyond this plugin, since gitea-* skills talk to the server over the MCP tools and contain zero git/rtk mentions.

Normalized all nine skills:

  • git-branches, git-history, git-remotes, git-worktrees, pc-run — real instructed-command gaps fixed (dispatch-table "Run" cells and fenced-code-block procedures counted as instructed, e.g. git-worktrees' whole dispatch table and git-remotes' entire fetch/push/pull/remote-config catalogs were 0% rtk before this).
  • pc-author — the pre-dispatch audit had this at 0/0 bare occurrences, but a full pass found 2 unflagged git ls-files commands inside instructed steps (not backtick-quoted, so the earlier grep missed them). Fixed both.
  • git-submodules, git-workflow — already essentially compliant; one deliberate exception left bare in git-submodules: the inner command string passed to git submodule foreach '<command>' runs inside each submodule's own subshell, not as a top-level agent-invoked Bash command, so rtk's wrapper has nothing to intercept there — the outer foreach invocation itself is rtk git submodule foreach.

No new pre-commit gate added for this (discussed and decided against) — the Claude Code rtk hook already guarantees correctness for any command actually executed regardless of prose; this was purely a documentation-consistency gap, confirmed via Context7 against RTK's own docs that neither RTK nor any git hook in this repo checks skill-file prose at all.

"Never do X" anti-pattern warnings (e.g. git-worktrees' detached-HEAD warning, pc-run's --no-verify warning) were left bare as illustrative rather than rtk-prefixed, consistent with the rule — flagging in case that reads differently to a reviewer.

## Implementation note Rule decided in session, empirically validated against `git-commits` before the corpus-wide pass (every existing bare `git` there turned out illustrative, never an instructed step): **executable instructed commands get `rtk git`; illustrative/referential mentions of a git command stay bare `git`.** Documented in a new `plugins/git/README.md` under a "Conventions" section — confirmed it doesn't generalize beyond this plugin, since `gitea-*` skills talk to the server over the MCP tools and contain zero `git`/`rtk` mentions. Normalized all nine skills: - `git-branches`, `git-history`, `git-remotes`, `git-worktrees`, `pc-run` — real instructed-command gaps fixed (dispatch-table "Run" cells and fenced-code-block procedures counted as instructed, e.g. `git-worktrees`' whole dispatch table and `git-remotes`' entire fetch/push/pull/remote-config catalogs were 0% `rtk` before this). - `pc-author` — the pre-dispatch audit had this at 0/0 bare occurrences, but a full pass found 2 unflagged `git ls-files` commands inside instructed steps (not backtick-quoted, so the earlier grep missed them). Fixed both. - `git-submodules`, `git-workflow` — already essentially compliant; one deliberate exception left bare in `git-submodules`: the *inner* command string passed to `git submodule foreach '<command>'` runs inside each submodule's own subshell, not as a top-level agent-invoked Bash command, so `rtk`'s wrapper has nothing to intercept there — the outer `foreach` invocation itself is `rtk git submodule foreach`. No new pre-commit gate added for this (discussed and decided against) — the Claude Code `rtk` hook already guarantees correctness for any command actually executed regardless of prose; this was purely a documentation-consistency gap, confirmed via Context7 against RTK's own docs that neither RTK nor any git hook in this repo checks skill-file prose at all. "Never do X" anti-pattern warnings (e.g. `git-worktrees`' detached-HEAD warning, `pc-run`'s `--no-verify` warning) were left bare as illustrative rather than rtk-prefixed, consistent with the rule — flagging in case that reads differently to a reviewer.
Sign in to join this conversation.