Skip to content

Fix/discover nested skills without parent skillmd#109

Merged
LadyBluenotes merged 3 commits intoTanStack:mainfrom
riku99:fix/discover-nested-skills-without-parent-skillmd
Apr 3, 2026
Merged

Fix/discover nested skills without parent skillmd#109
LadyBluenotes merged 3 commits intoTanStack:mainfrom
riku99:fix/discover-nested-skills-without-parent-skillmd

Conversation

@riku99
Copy link
Copy Markdown
Contributor

@riku99 riku99 commented Apr 3, 2026

🎯 Changes

The walk() function in discoverSkills only recursed into directories that contained a SKILL.md. This meant skills nested
under intermediate grouping directories (directories without their own SKILL.md) were silently skipped.

For example, the following structure would fail to discover group/nested-skill:

skills/
group/ ← no SKILL.md (grouping directory)
nested-skill/ ← has SKILL.md → not found

Fixed by moving walk(childDir) outside the if (existsSync(skillFile)) block so the traversal always recurses into
subdirectories. Applied to both scanner.ts and library-scanner.ts, with regression tests added for each.

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm run test:pr.

🚀 Release Impact

  • This change affects published code, and I have generated a
    changeset.
  • This change is docs/CI/dev-only (no release).

Summary by CodeRabbit

  • Bug Fixes

    • Fixed skill discovery to properly detect skills nested within intermediate grouping directories that do not contain their own SKILL.md file.
  • Tests

    • Added test coverage for nested skill discovery scenarios.

Riku Kurosawa added 2 commits April 4, 2026 00:59
The recursive walk in discoverSkills only descended into directories
that contained a SKILL.md, so skills nested under grouping directories
(dirs without their own SKILL.md) were silently skipped. Move the
walk(childDir) call outside the SKILL.md existence check so the
traversal always recurses into subdirectories.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 3, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 080ecd0d-3437-4bb9-8d39-5b1c95854707

📥 Commits

Reviewing files that changed from the base of the PR and between f078ab8 and 3830864.

📒 Files selected for processing (5)
  • .changeset/fix-nested-skill-discovery.md
  • packages/intent/src/library-scanner.ts
  • packages/intent/src/scanner.ts
  • packages/intent/tests/library-scanner.test.ts
  • packages/intent/tests/scanner.test.ts

📝 Walkthrough

Walkthrough

This pull request fixes skill discovery in the intent scanner by ensuring subdirectories are always traversed during the discovery process, rather than only when a SKILL.md file is found in the current directory. A changeset file and test cases validate the fix for nested skills located under intermediate grouping directories without their own SKILL.md files.

Changes

Cohort / File(s) Summary
Changeset Declaration
.changeset/fix-nested-skill-discovery.md
Declares a patch release for @tanstack/intent package documenting the nested skill discovery fix.
Scanner Implementations
packages/intent/src/library-scanner.ts, packages/intent/src/scanner.ts
Moved subdirectory traversal (walk(childDir)) outside the SKILL.md detection conditional, ensuring all nested directories are recursively scanned regardless of whether the parent directory contains a SKILL.md file.
Scanner Tests
packages/intent/tests/library-scanner.test.ts, packages/intent/tests/scanner.test.ts
Added test cases validating that skills nested under intermediate grouping directories (without SKILL.md) are correctly discovered and named with their full path prefix.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 Hop skip and jump through folders deep,
No SKILL.md? The scan won't sleep!
Through nested paths, the finder goes,
Every skill the scanner knows! 🌿

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main fix: discovering nested skills without parent SKILL.md files in grouping directories.
Description check ✅ Passed The description includes all required sections with detailed explanation of changes, completed checklist items, and changeset acknowledgment.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@nx-cloud
Copy link
Copy Markdown

nx-cloud bot commented Apr 3, 2026

View your CI Pipeline Execution ↗ for commit a819dcf

Command Status Duration Result
nx affected --targets=test:eslint,test:sherif,t... ✅ Succeeded 3s View ↗
nx run-many --targets=build --exclude=examples/** ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2026-04-03 17:41:01 UTC

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 3, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@tanstack/intent@109

commit: a819dcf

@LadyBluenotes
Copy link
Copy Markdown
Member

Ty for working on this! I appreciate your work

@LadyBluenotes LadyBluenotes merged commit 3067196 into TanStack:main Apr 3, 2026
5 checks passed
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.

2 participants