Skip to content

fix(models): exclude skill dirs from agent discovery#16

Open
ricardoalt1515 wants to merge 2 commits into
Gentleman-Programming:mainfrom
ricardoalt1515:fix/exclude-agents-skills
Open

fix(models): exclude skill dirs from agent discovery#16
ricardoalt1515 wants to merge 2 commits into
Gentleman-Programming:mainfrom
ricardoalt1515:fix/exclude-agents-skills

Conversation

@ricardoalt1515
Copy link
Copy Markdown

Fixes #15

Summary

  • Excludes skills subdirectories while discovering model-routable agents from .agents roots.
  • Keeps recursive discovery for non-skill nested agent directories.
  • Adds regression tests covering SKILL.md and reference markdown files under .agents/skills.

Test plan

  • node --experimental-strip-types --test tests/gentle-ai.test.ts
  • node --experimental-strip-types --test tests/*.test.ts
  • npm run test:harness

Note: I used direct Node/npm commands locally because pnpm is not installed in my shell. CI still uses the repository's pnpm workflow.

Copilot AI review requested due to automatic review settings May 16, 2026 18:42
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds configurable directory-skipping to agent discovery (notably to ignore .agents/skills) and introduces tests to validate discovery behavior with nested directories.

Changes:

  • Add AgentDiscoveryOptions.skipDirectoryNames and thread it through sync/async recursive discovery.
  • Update discoverable agent listing to skip skills directories under .agents.
  • Add Node test coverage for skipping .agents/skills while still scanning other subdirectories.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.

File Description
tests/gentle-ai.test.ts Adds tests that validate agent discovery behavior when skipping skills directories.
extensions/gentle-ai.ts Introduces discovery options, applies them to recursive traversal, and exports testing hooks.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/gentle-ai.test.ts Outdated
}

test("agent discovery can skip .agents skills directories", () => {
const root = join(tmpdir(), `gentle-pi-agents-${Date.now()}`);
Comment thread tests/gentle-ai.test.ts Outdated
Comment on lines +55 to +56
test("agent discovery still scans non-skill subdirectories", () => {
const root = join(tmpdir(), `gentle-pi-nested-agents-${Date.now()}`);
Comment thread extensions/gentle-ai.ts Outdated
join(cwd, ".pi", "npm", "node_modules", "pi-subagents", "agents"),
join(homedir(), ".local", "lib", "node_modules", "pi-subagents", "agents"),
];
const dotAgentsOptions = { skipDirectoryNames: ["skills"] };
Comment thread extensions/gentle-ai.ts Outdated
[join(homedir(), ".agents"), "user"],
[join(cwd, ".agents"), "project"],
[join(cwd, ".pi", "agents"), "project"],
const dotAgentsOptions = { skipDirectoryNames: ["skills"] };
Comment thread extensions/gentle-ai.ts Outdated
Comment on lines +519 to +522
async function listAgentFilesRecursiveAsync(
dir: string,
options: AgentDiscoveryOptions = {},
): Promise<string[]> {
Comment thread extensions/gentle-ai.ts
Comment on lines +1258 to +1261
export const __testing = {
listAgentsFromDir,
listAgentFilesRecursive,
};
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.

fix(models): exclude .agents/skills from agent discovery

2 participants