Skip to content

feat: make skill discovery nested, feat: improve codex installs and platform detection#46

Merged
hyericlee merged 3 commits into
enulus:mainfrom
Minoo7:t3code/nested-skill-discovery
Apr 3, 2026
Merged

feat: make skill discovery nested, feat: improve codex installs and platform detection#46
hyericlee merged 3 commits into
enulus:mainfrom
Minoo7:t3code/nested-skill-discovery

Conversation

@Minoo7

@Minoo7 Minoo7 commented Mar 28, 2026

Copy link
Copy Markdown
Contributor
  • discover marker-based resources like skills from any nested skills/ ancestor instead of only <root>/skills
  • normalize recursive flow target mapping so nested resource paths convert to canonical skills/... paths without duplicated prefixes
  • fix full and filtered Claude plugin installs so nested config/skills/... resources install correctly after conversion
  • add regression coverage for nested discovery, converter path mapping, recursive glob anchoring, and end-to-end plugin skill install

Otherwise installing from places like langsmith directly, didn’t work.

Copilot AI review requested due to automatic review settings March 28, 2026 14:20
@Minoo7 Minoo7 changed the title Fix nested skill discovery and install paths Feat: make skill discovery nested Mar 28, 2026
@Minoo7 Minoo7 changed the title Feat: make skill discovery nested feat: make skill discovery nested Mar 28, 2026

Copilot AI 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.

Pull request overview

Improves support for discovering, converting, and installing skills that live under nested skills/ directories (e.g., config/skills/...), preventing duplicated path prefixes during conversion/install, and adds regression tests to cover these cases.

Changes:

  • Expand marker-based skill discovery to find SKILL.md under any nested skills/ ancestor (not just <root>/skills).
  • Fix recursive glob target mapping + conversion path derivation to avoid duplicated prefixes like skills/config/skills/....
  • Add unit/integration regression tests for nested discovery, conversion mapping, recursive glob anchoring, and end-to-end plugin skill install.

Reviewed changes

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

Show a summary per file
File Description
tests/run-tests.ts Registers new unit + integration tests in the test runner.
tests/integration/nested-plugin-skills.test.ts Adds end-to-end install coverage for nested config/skills/... in a Claude plugin package.
tests/core/platforms/converter.test.ts Adds a converter regression test ensuring nested skills paths are anchored correctly.
tests/core/install/nested-resource-discovery.test.ts Adds tests for nested skill discovery and convenience filtering.
tests/core/flows/recursive-glob.test.ts Adds regression coverage for recursive glob anchoring with nested skills sources.
platforms.jsonc Updates Claude-plugin import flows to match nested resources (**/skills/**/*, etc.) and adds nested AGENTS.md import mapping.
packages/core/src/core/install/strategies/conversion-strategy.ts Normalizes matchedPattern after conversion to keep resource filtering aligned with canonical paths.
packages/core/src/core/install/resource-search.ts Introduces a generic marker search that scans for marker files under nested resource dir ancestors.
packages/core/src/core/install/resource-pattern-normalization.ts Adds normalization logic to anchor converted matched patterns at canonical installable type dirs.
packages/core/src/core/install/resource-discoverer.ts Switches skill discovery to use the new marker-file search (nested-aware).
packages/core/src/core/install/import-flow-converter.ts Updates path transformation to use glob matching + recursive glob target mapping for ** patterns.
packages/core/src/core/glob-target-mapping.ts Adjusts recursive glob mapping to anchor nested sources to the destination resource dir and avoid duplicated prefixes.
packages/core/src/core/flows/platform-converter.ts Fixes conversion stage execution to derive targets using the original from pattern (avoids skills/config/skills/...).
package-lock.json Lockfile updated (project version bump and dependency resolution changes).

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

Comment on lines +48 to +71
await fs.mkdir(path.join(workspace, '.cursor'), { recursive: true });
await fs.mkdir(path.join(workspace, '.claude'), { recursive: true });

const pkgDir = path.join(workspace, 'packages', 'langsmith-plugin');
await writeFile(
path.join(pkgDir, '.claude-plugin', 'plugin.json'),
JSON.stringify({ name: 'langsmith-plugin', version: '0.1.0' }, null, 2)
);
await writeFile(
path.join(pkgDir, 'config', 'AGENTS.md'),
'# Plugin Guide\n'
);
await writeFile(
path.join(pkgDir, 'config', 'skills', 'langsmith-dataset', 'SKILL.md'),
'---\nname: langsmith-dataset\n---\n# Dataset Skill\n'
);
await writeFile(
path.join(pkgDir, 'config', 'skills', 'langsmith-dataset', 'helper.ts'),
'export const helper = true;\n'
);

const result = runCli(
['install', './packages/langsmith-plugin', '--skills', 'langsmith-dataset', '--force', '--conflicts', 'overwrite'],
workspace,

Copilot AI Mar 28, 2026

Copy link

Choose a reason for hiding this comment

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

This test creates both .cursor/ and .claude/ in the workspace before running the install. Platform auto-detection will then return both platforms, so openpackage install ... may install into both targets, making the test slower and potentially flaky/unfocused.

To keep the test deterministic and scoped to the behavior being asserted, either avoid creating .claude/ here or pass --platforms cursor in the CLI args.

Copilot uses AI. Check for mistakes.
Comment on lines +13 to +21
function createPackageDiscoveryFilter(basePath: string) {
return (entryPath: string): boolean => {
const relativePath = relative(basePath, entryPath).replace(/\\/g, '/');
if (!relativePath || relativePath === '.') {
return true;
}

return !isExcludedFromPackage(relativePath);
};

Copilot AI Mar 28, 2026

Copy link

Choose a reason for hiding this comment

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

findMarkerResourceFiles() now walks the entire basePath, but the filter only applies isExcludedFromPackage(), which does not exclude large workspace-local dirs like .git/ and node_modules/. This can make installs/discovery very slow (or effectively hang) when installing from a local repo that has those directories.

Consider extending createPackageDiscoveryFilter to skip common non-package directories (at least .git and node_modules, and likely the existing WORKSPACE_DISCOVERY_EXCLUDES set in packages/core/src/constants/workspace.ts) and use the isDirectory argument from walkFiles’s filter signature to prune entire subtrees early.

Copilot uses AI. Check for mistakes.
@Minoo7 Minoo7 changed the title feat: make skill discovery nested feat: make skill discovery nested, feat: improve codex installs and platform detection Mar 28, 2026
@Minoo7

Minoo7 commented Mar 28, 2026

Copy link
Copy Markdown
Contributor Author

Added a follow-up pass on this PR:

  • fixed Codex installs to use the official skills layout under .agents/skills/<name>/... while still exporting command prompts to .codex/prompts
  • tightened workspace platform auto-detection so a bare AGENTS.md no longer causes broad multi-platform installs
  • added regressions for both the Codex skill-bundle case and the AGENTS.md + .factory detection case

Example that didn’t work before but does work now:
opkg i https://github.com/shanev/skills/tree/main/decomplect --platforms codex
It used to install only the prompts/ dir but now it installs the full bundle correctly.

@hyericlee

Copy link
Copy Markdown
Contributor

Sorry for the delayed response! Will review and merge as soon as I can.

Minoo7 and others added 3 commits April 3, 2026 18:56
- Discover skill markers under nested `*/skills` paths
- Anchor recursive glob conversions to the skill directory
- Add coverage for converter, discovery, and CLI flows
@hyericlee hyericlee force-pushed the t3code/nested-skill-discovery branch from 2abf75d to 185a937 Compare April 3, 2026 10:56
@hyericlee hyericlee merged commit 17ba58e into enulus:main Apr 3, 2026
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.

3 participants