Skip to content

fix(compile): stop writing the same skill twice for agents that read .agents/skills - #113

Merged
singhharsh1708 merged 1 commit into
mainfrom
fix/vendor-neutral-dedup
Aug 10, 2026
Merged

fix(compile): stop writing the same skill twice for agents that read .agents/skills#113
singhharsh1708 merged 1 commit into
mainfrom
fix/vendor-neutral-dedup

Conversation

@singhharsh1708

Copy link
Copy Markdown
Owner

Found by a reader on a launch thread raising "context contamination" — inactive instructions parked in context. Checking it against our own output turned up a real duplication bug.

The bug

A repo with both .agents/ and .github/ (or .gemini/) got byte-identical SKILL.md files in both places — the exact duplication the comment beside the agents adapter claimed could not happen:

"agents that also have a native path already get their own adapter, and emitting both would duplicate the skill for no benefit."

That narrow detection only covers the case where .agents/ is absent, not the common one where a repo has it and a native skills directory.

Why the duplicate is never harmless

Verified against each client's own source/docs:

Client Behavior with two copies
Copilot Searches .github/skills first, dedupes by name → the .agents copy is silently ignored
Gemini CLI Loads the .agents alias after .gemini/skills, overrides it, and prints Skill conflict detected per duplicated name — noise we were causing
Codex Dedupes root paths, not skill namesloads the skill twice

Fix

copilot and gemini yield to .agents/skills/ when it's written, with a note. A copy left by an earlier version is pruned on the next compile.

A repo without .agents/ is unaffected — Copilot still gets .github/skills/. The dedup must never cost an agent its only copy, and that's tested.

Two unverified claims corrected

The same comment asserted things nobody had checked:

  • .agents/skills is not Codex's only repo path — <repo>/.codex/skills also loads at repo scope.
  • Roo, Amp, OpenCode and Antigravity were listed as readers without ever being verified. Removed; they may well read it, but nothing should assume so.

The readers now named (Codex, Copilot, Gemini CLI, Cursor, Zed, Cline) were each confirmed against that client's own source or documentation.

Benchmark

The harness read Copilot/Gemini cost from their own skills dirs, which are no longer written when the shared path serves them — it crashed, and my first check masked it (>/dev/null + git diff --exit-code read a failed run as "no change"). Now it reads the path that actually serves them. Published numbers are unchanged, the bytes being identical.

7 new tests; two existing assertions updated because they encoded the old duplicated behavior. Suite, typecheck, site --check and bench gate green. Ships as 0.22.0.

….agents/skills

A repo with both .agents/ and .github/ (or .gemini/) got byte-identical
SKILL.md files in both places — the exact duplication the comment beside the
agents adapter claimed could not happen. Its narrow detection only covers the
case where .agents/ is absent, not the common one where a repo has it and a
native skills directory too.

The duplicate is never harmless, and it fails differently per client:
Copilot searches .github/skills first and dedupes by name, so the .agents copy
was silently ignored; Gemini CLI loads the .agents alias after .gemini/skills,
overrides it, and prints "Skill conflict detected" for every duplicated name —
noise kitbash itself was causing; Codex dedupes root paths but not skill names,
so it loaded the skill twice.

copilot and gemini now yield to .agents/skills/ when it is written, with a note
saying so, and a copy left by an earlier version is pruned on the next compile.
A repo without .agents/ is unaffected — copilot still gets .github/skills/,
because the dedup must never cost an agent its only copy.

Also corrects two claims in that comment that were never verified: .agents/skills
is not Codex's only repo path (<repo>/.codex/skills also loads at repo scope),
and Roo, Amp, OpenCode and Antigravity were listed as readers without being
checked. The readers now named — Codex, Copilot, Gemini CLI, Cursor, Zed, Cline
— were each confirmed against that client's own source or docs.

The benchmark harness read copilot and gemini from their own skills dirs, which
are no longer written when the shared path serves them; it now reads the path
that serves them. Published numbers are unchanged, the bytes being identical.

Adds 7 tests. 0.22.0.
@vercel

vercel Bot commented Aug 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
kitbash Ready Ready Preview Aug 10, 2026 8:13am

@github-actions github-actions Bot added documentation Docs, spec, RFCs, README, site dependencies Dependency or action version bumps benchmark Benchmark script or measured numbers labels Aug 10, 2026
@singhharsh1708
singhharsh1708 merged commit 0091351 into main Aug 10, 2026
10 checks passed
@singhharsh1708
singhharsh1708 deleted the fix/vendor-neutral-dedup branch August 10, 2026 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

benchmark Benchmark script or measured numbers dependencies Dependency or action version bumps documentation Docs, spec, RFCs, README, site

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant