Skip to content

Updating skill / agent rules to be index files#15

Merged
mxriverlynn merged 4 commits into
mainfrom
rules-as-index-files
May 26, 2026
Merged

Updating skill / agent rules to be index files#15
mxriverlynn merged 4 commits into
mainfrom
rules-as-index-files

Conversation

@mxriverlynn
Copy link
Copy Markdown
Collaborator

@mxriverlynn mxriverlynn commented May 26, 2026

Summary

This PR replaces 27 per-rule symlinks with 2 path-scoped index files, so that Claude loads only the rule files it actually needs instead of paying the full token cost of every matching standard.

  • Switches the .claude/rules/ mechanism from "load every matching standard in full" to "load a short index, then selectively open standards by name" — the progressive-disclosure pattern applied to rule loading itself.
  • Scope is rule wiring only. No standard's content moves; the canonical guidance still lives under docs/guidance/agent-building-guidelines/ and docs/guidance/skill-building-guidance/. Nothing under plugin/ or docs/ changes.
  • Path scoping narrows: agent rules now fire only on plugin/agents/**/*.md, and skill rules now fire on plugin/skills/**/*.md plus plugin/skills/**/scripts/** (previously each symlink carried its own scope).
  • Reviewer attention: confirm the two index files list every standard a contributor actually needs, and that the "do not read everything; scan and pick" instruction is unambiguous enough that Claude will actually follow it.

Behavior changes

Before: opening any file that matched a rule's path glob caused Claude Code to load the full text of every matching standard. For a skill edit, that meant up to 22 standards loaded in full whether relevant or not.

After: opening a matching file loads one short index file (40 lines for agents, 59 lines for skills). The index tells Claude it is an index rather than a standard, lists the available standards with one-line descriptions, and instructs Claude to Read only the standards clearly relevant to the current task — possibly none.

Editing a file under Before (loaded automatically) After (loaded automatically) After (loaded on demand)
plugin/agents/**/*.md All 5 agent-building standards in full plugin-agents.md index only Whichever agent standards Claude judges relevant
plugin/skills/**/*.md or plugin/skills/**/scripts/** All 22 skill-building standards in full plugin-skills.md index only Whichever skill standards Claude judges relevant

What to look at first

  • The "do not read every linked standard" instruction in each index file. This is the load-bearing behavioral change — if Claude ignores it and opens everything anyway, the PR is a net loss (two extra files plus the same full load).
  • Coverage of the standards lists. The agent index lists 5 standards and the skill index lists 22; verify none of the previously-symlinked guidance files were dropped and that each entry's one-line description is specific enough to drive a "relevant / not relevant" judgment.
  • Path-scope narrowing. The skill rule now also fires on plugin/skills/**/scripts/**, which the prior symlink layout may not have covered uniformly — check that this matches intent.
  • The choice to file these under .claude/rules/coding-standards/ rather than keeping agents/ and skills/ subdirectories. The new names (plugin-agents.md, plugin-skills.md) imply this convention will extend to other index files later.

Files of interest

  • .claude/rules/coding-standards/plugin-skills.md — new skills index; 22 standards listed, scoped to skill SKILL.md files and skill scripts.
  • .claude/rules/coding-standards/plugin-agents.md — new agents index; 5 standards listed, scoped to agent definition files.

Replace the 23 one-symlink-per-doc entries under .claude/rules/skills/
with a single .claude/rules/skill-building-guidance.md index file. The
index carries paths: "plugin/skills/**/*.md" so it loads only when a
skill file is being read, and lists every guidance doc with a 1-3
sentence description so Claude can pick the relevant subset to open
on demand instead of loading all 23 docs at once.

This mirrors the per-file-type index-file pattern that /coding-standard
now uses for coding standards.
Replace the 5 one-symlink-per-doc entries under .claude/rules/agents/
with a single .claude/rules/agent-building-guidelines.md index file.
The index carries paths: "plugin/agents/**/*.md" so it loads only when
an agent file is being read, and lists every guidance doc with a 1-3
sentence description so Claude can pick the relevant subset to open on
demand instead of loading all 5 docs at once.

Matches the layout introduced in the previous commit for skill-building
guidance.
Move .claude/rules/skill-building-guidance.md to its canonical location
under .claude/rules/coding-standards/plugin-skills.md, and use the
template's verbatim instruction paragraph and "## Available standards"
section heading. The previous file paraphrased the template (saying
"guidance" / "## Available guidance" instead of "standard" /
"## Available standards"), which violated Step 7.3 and Step 10.4 of
the coding-standard skill, both of which require the instruction
paragraph to be unchanged from the template.

Entries are sorted alphabetically by title.
@mxriverlynn mxriverlynn force-pushed the rules-as-index-files branch from 1340e64 to dbe6893 Compare May 26, 2026 16:05
Move .claude/rules/agent-building-guidelines.md to its canonical
location under .claude/rules/coding-standards/plugin-agents.md, and use
the template's verbatim instruction paragraph and "## Available
standards" section heading. Matches the realignment applied in the
previous commit for the plugin-skills index.

Entries are sorted alphabetically by title.
@mxriverlynn mxriverlynn marked this pull request as ready for review May 26, 2026 16:13
@mxriverlynn mxriverlynn merged commit 252c649 into main May 26, 2026
@mxriverlynn mxriverlynn deleted the rules-as-index-files branch May 26, 2026 16:13
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.

1 participant