Skip to content

feat(skills): Scope wildcard discovery by path#144

Open
gricha wants to merge 4 commits into
mainfrom
gricha/feat/wildcard-skill-path
Open

feat(skills): Scope wildcard discovery by path#144
gricha wants to merge 4 commits into
mainfrom
gricha/feat/wildcard-skill-path

Conversation

@gricha

@gricha gricha commented Jul 21, 2026

Copy link
Copy Markdown
Member

Allow wildcard skill dependencies to limit discovery to one source subdirectory.

A wildcard entry can now set path, recursively discovering only skills beneath that directory while continuing to apply exclude. Omitting path preserves the existing repository-wide discovery behavior.

Git-backed skills retain their complete repository-relative paths in agents.lock, and wildcard paths that escape the acquired source root are rejected. The same scoped discovery behavior is used for Git, local, and well-known sources.

Fixes #131

Allow wildcard skill dependencies to select a source subdirectory while preserving recursive discovery, exclusions, and repository-relative lockfile paths.

Reject wildcard paths that escape the acquired source root.

Fixes #131
@vercel

vercel Bot commented Jul 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
dotagents Ready Ready Preview Jul 22, 2026 7:24pm

Request Review

@gricha
gricha marked this pull request as ready for review July 21, 2026 16:39
@github-actions github-actions Bot added the risk: high PR risk score: high label Jul 21, 2026
Comment thread packages/dotagents-lib/src/skills/resolver.ts
Comment thread packages/dotagents/src/config/schema.ts
Fail fast for invalid wildcard paths, retain source-relative lock metadata for scoped local and well-known skills, and prune out-of-scope wildcard entries during offline sync.

Add canonical path containment and regression coverage for well-known discovery and lockfile round-trips.
Comment thread packages/dotagents/src/cli/commands/sync.ts
Comment thread packages/dotagents/src/cli/commands/sync.ts Outdated
Use one scope matcher for list and sync while retaining legacy lock entries until install records source-relative paths.
Comment thread packages/dotagents-lib/src/skills/resolver.ts

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 9775bfd. Configure here.


const lockedLocalSkillSchema = z.object({
source: z.string(),
resolved_path: z.string().optional(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Well-known lock entries misclassified as git

Medium Severity

Adding optional resolved_path to well-known lock entries makes those objects satisfy lockedGitSkillSchema, which is tried first in the z.union. Wildcard well-known installs now always persist resolved_path, so load parses them as git skills and breaks the git/well-known lock discrimination the schema relied on.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 9775bfd. Configure here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This does not cause observable misclassification. The lockfile variants are structural and no consumer discriminates Git from well-known entries by union branch. A well-known entry with resolved_path parses through the first compatible schema but preserves the identical source, resolved_url, and resolved_path fields; Git-only fields remain absent. Writer/loader round-trip coverage confirms the metadata is preserved.

— Claude Code

Comment thread packages/dotagents/src/lockfile/wildcard.ts
Avoid offering wildcard exclusion for stale skills that fall outside the configured path scope.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: high PR risk score: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support path field when using wildcard name

1 participant