feat(skills): per-skill agent targeting (agents/excludeAgents frontmatter) - #13
Merged
Conversation
…tmatter Skills can now whitelist (agents:) or blacklist (excludeAgents:) the agent mirror directories they emit to. Agent IDs derive from each manifest mirror path's first segment (.claude/skills → claude, .agents/skills → agents), so a claude-only skill is agents: [claude]. Unknown IDs fail with the new AICTX_SKILL_AGENT_UNKNOWN error. Orphan detection is plan-aware so build --remove-orphans deletes mirrors excluded by a newly-added filter. skills create gains --agents; skills list surfaces the filter. Touched files were run through prettier (repo-declared style), which accounts for the formatting-only hunks. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ApprovabilityVerdict: Needs human review Unable to check for correctness in 046a3ec. This PR introduces a new feature (per-skill agent targeting) that changes build pipeline behavior - skills can now filter which agent mirrors they emit to, and orphan detection is modified accordingly. New features with runtime behavior changes warrant human review. You can customize Macroscope's approvability policy. Learn more. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Some skills should only be visible to one agent. The motivating case: a skill teaching Claude Code how to dispatch Codex subagents must not mirror into
.agents/skills/, where Codex itself would discover it — recursive, confusing instructions for the wrong audience. Until now every skill fanned out to everymanifest.skills.mirrorsentry unconditionally.What
agents: [claude](whitelist) orexcludeAgents: [claude](blacklist), mutually exclusive. Agent IDs derive from each mirror path's first segment minus the leading dot:.claude/skills→claude,.agents/skills→agents, a future.cursor/skills→cursor. No manifest change needed.AICTX_SKILL_AGENT_UNKNOWN.findOrphanedSkillMirrorsaccepts the planned mirror set (optional, back-compat), so adding a filter to an existing skill +build --remove-orphansdeletes the now-excluded symlinks;doctorflags them with an updated message.skills create --agents <id>(repeatable);skills listshows[agents: …]and emitsagents/excludeAgentsin--json.Verification
preflight:releaseclean..claude/skills, blacklist inverts, filter composes withscope:, doctor flags and--remove-orphansdeletes stale mirrors, unknown ID errors cleanly,verifystays green.Note: touched files were run through prettier (the repo's declared style), which accounts for the formatting-only hunks — main has pre-existing format drift in ~125 files.
🤖 Generated with Claude Code
Note
Add per-skill agent targeting via
agents/excludeAgentsfrontmatter fieldsagents(whitelist) orexcludeAgents(blacklist) in theirSKILL.mdfrontmatter to control which agent mirrors are produced; both fields cannot be set simultaneously and unknown agent IDs raiseAICTX_SKILL_AGENT_UNKNOWN.planSkillMirrorsin skills.ts derives known agent IDs from mirror paths, validates the filter fields, and trims the mirror plan accordingly.findOrphanedSkillMirrorsis now plan-aware: mirrors for still-active skills are treated as orphans when their exact paths are no longer in the current plan (e.g., excluded by agent filters).ai-context doctorflags mirrors excluded by scope or agent filters and suggestsbuild --remove-orphans; the diff and verify commands also reflect plan-aware orphan state.skills createCLI accepts a new repeatable--agents <id>flag written into the generated frontmatter, andskills listshows agent filters in text and JSON output.--remove-orphansnow deletes mirrors excluded by agent filters for active skills, not only mirrors whose skill name is gone entirely.Macroscope summarized 046a3ec.