Skip to content

fix: scope agent rule discovery to instruction paths - #222

Merged
nettapper merged 1 commit into
kitproj:mainfrom
t-gok:fix/scope-agent-rule-discovery
Oct 2, 2026
Merged

nettapper merged 1 commit into
kitproj:mainfrom
t-gok:fix/scope-agent-rule-discovery

Conversation

@t-gok

@t-gok t-gok commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Rule discovery currently scans all Markdown beneath .claude, .codex, and .gemini, loading skill bodies, references, commands, and cached plugin content into the initial prompt as rules. A synthetic workspace with 100 skills produces a 3.17 MB prompt even though skill discovery already exposes metadata separately.

Restrict rule discovery to each agent's rules/ directory and explicit instruction files. The same fixture produces about 20 KB while retaining all 100 skills in discovery. Preserve instruction bootstrap order, namespaces, and selectors, and include Gemini's style guide once.

Compatibility: other rule Markdown under these agent directories must move into rules/ or .agents/rules/. The search-path documentation includes migration instructions.

Validation

  • Regression coverage for all three agents, large skill trees, excluded reference/command/cache content, skill bootstrap isolation, explicit instructions, instruction bootstrap order, namespaces, and selectors.
  • go test -race ./pkg/...
  • Full go test ./... in a network-disabled local container with an empty default home, avoiding unrelated installed user skills.
  • make lint; unrelated baseline formatting changes excluded.

Based on upstream c772470.

@nettapper nettapper self-assigned this Oct 2, 2026
@nettapper
nettapper enabled auto-merge (squash) October 2, 2026 18:46
@nettapper
nettapper merged commit 0a3c5c4 into kitproj:main Oct 2, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants