fix: ignore legacy skill dirs in agent discovery#204
Open
affsantos wants to merge 1 commit into
Open
Conversation
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.
Summary
Legacy
.agents/**/*.mddiscovery currently treats Pi skill files under.agents/skills/**as executable subagents when they containnameanddescriptionfrontmatter. That makes valid skill packages like.agents/skills/foo/SKILL.mdshow up insubagent listas runnable agents.This keeps the legacy
.agentscompatibility behavior, but excludes.agents/skills/**from agent discovery. The intent is to preserve custom legacy agents under.agents/while respecting Pi's documented skill location under.agents/skills/.Why
Pi documents both canonical and legacy skill locations, including:
~/.pi/agent/skills/~/.agents/skills/.pi/skills/.agents/skills/Since skills also use markdown/frontmatter, broad
.agents/**/*.mdagent discovery can accidentally classify skill docs as executable agents. This is confusing insubagent list, where skill instruction packages can appear to be runnable subagents.Changes
skillssubtrees only when scanning a legacy.agentsroot for agents..agents/skills/*.mdand.agents/skills/*/SKILL.mdare ignored while ordinary legacy.agents/*.mdagents still load.Validation
node --experimental-strip-types --test test/unit/agent-frontmatter.test.tsNote:
npm test -- test/unit/agent-frontmatter.test.tsstarts the full unit suite in this checkout and hits unrelated missing peer dependencies for TUI-related tests (@earendil-works/pi-tui,@earendil-works/pi-coding-agent). The targeted test file passes with Node's strip-types runner.