feat(skill-loader): recursive merge for multi-file skills#6
feat(skill-loader): recursive merge for multi-file skills#6codewithkenzo wants to merge 6 commits into
Conversation
- Reactivated disabled agents - Created test fixtures for multi-file skills - Multiple improvements and refactoring
- Export loadSkillFromPath for testing - Add recursive merge test describe block - Test expects merged content from subdirectories - RED phase: test fails as implementation doesn't merge yet
- Add collectSubdirMdFiles helper to collect .md from immediate subdirs - Integrate helper into loadSkillFromPath after mcpConfig - Merge content appended with HTML comment marker - Files sorted alphabetically by path - Frontmatter stripped from subdir files
- Test nested subdirs at depth 2 (rules/auth/advanced.md) - Test nested subdirs at depth 3 (rules/auth/oauth/spec.md) - Test depth 4+ exclusion (should NOT appear) - RED phase: tests fail as recursive merge not implemented
- Replace collectSubdirMdFiles with recursive collectMdFilesRecursive - Add currentDepth/maxDepth tracking (default max 3) - Add basePath for relative path construction - Skip symlinks for security - Collect .md files only at depth > 0 (skip SKILL.md at root) - Sort results alphabetically by path
- Test root README.md exclusion (passes - depth 0 files skipped)
- Test hidden file exclusion (passes - startsWith('.') check)
- Test frontmatter stripping in subdirs (passes - parseFrontmatter)
- Test empty subdir handling (passes - graceful empty return)
- Test backward compat with single-file skills (passes - no merge comment)
|
Skipped: This PR changes more files than the configured file change limit: ( |
|
Thank you for your contribution! Before we can merge this PR, we need you to sign our Contributor License Agreement (CLA). To sign the CLA, please comment on this PR with: This is a one-time requirement. Once signed, all your future contributions will be automatically accepted. I have read the CLA Document and I hereby sign the CLA codewithkenzo seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. |
|
I have read the CLA Document and I hereby sign the CLA |
#6) * fix(publish): make git operations idempotent - Check for staged changes before commit - Check if tag exists before creating - Check if release exists before creating * fix(session-recovery): handle empty content from interrupted reasoning - Add THINKING_TYPES set including 'reasoning' type (OpenCode's thinking) - Add hasNonEmptyOutput() to detect messages with only thinking/meta parts - Add findEmptyContentMessage() to scan all messages for empty content - Handle step-start/step-finish meta parts in empty content detection - Patch interrupted messages with '(interrupted)' text before falling back to revert
Summary
Extends the OpenCode skill loader to recursively merge all
.mdfiles from skill subdirectories into the skill content, enabling multi-file skills likereact-best-practicesto work out-of-the-box without pre-compilation.Changes
.mdfiles from subdirectories up to depth 3Test Coverage
Verification
bun test src/features/opencode-skill-loader/→ 60 passbun run typecheck→ cleanbun run build→ success