Skip to content

fix: use harness-specific directory names for skills/agents/commands extraction#20

Merged
neiii merged 5 commits intomasterfrom
fix/opencode-singular-directory-paths
Jan 5, 2026
Merged

fix: use harness-specific directory names for skills/agents/commands extraction#20
neiii merged 5 commits intomasterfrom
fix/opencode-singular-directory-paths

Conversation

@neiii
Copy link
Owner

@neiii neiii commented Jan 5, 2026

Summary

  • Fix OpenCode skills/agents/commands not being detected due to hardcoded plural directory names
  • Add fallback support to check alternate directory form (singular ↔ plural)

Problem

Bridle was hardcoding plural directory names (skills/, agents/, commands/) when extracting resources from profiles. However, OpenCode uses singular directory names (skill/, agent/, command/), causing all OpenCode skills, agents, and commands to go undetected.

# What Bridle was looking for:
~/.config/bridle/profiles/opencode/test/skills/    ❌ doesn't exist

# What OpenCode actually uses:
~/.config/bridle/profiles/opencode/test/skill/     ✓ exists

Solution

  1. Use harness-provided paths: Extract the actual directory name from harness_locate's DirectoryResource.path instead of hardcoding strings

  2. Add fallback support: If the primary directory is empty/missing, check the alternate form:

    • OpenCode: tries skill/ first, falls back to skills/
    • Claude: tries skills/ first, falls back to skill/

Changes

  • Added dir_name_from_path() helper to extract directory name from path
  • Added fallback_dir_name() to get alternate singular/plural form
  • Modified extract_skills(), extract_agents(), extract_commands() to use dynamic paths with fallback

Testing

  • Added unit tests for helper functions
  • Added test verifying OpenCode uses singular directory names
  • Verified with cargo run -- profile show opencode test - now correctly detects skills, agents, and commands

neiii added 5 commits January 5, 2026 03:49
…extraction

OpenCode uses singular directory names (skill/, agent/, command/) while
Claude uses plural (skills/, agents/, commands/). Previously Bridle
hardcoded plural names, causing OpenCode resources to go undetected.

Now extracts the actual directory name from harness_locate paths and
adds fallback support to check the alternate form if primary is empty.
@neiii neiii force-pushed the fix/opencode-singular-directory-paths branch from b66816a to 6ef9c47 Compare January 5, 2026 04:28
@neiii neiii merged commit ba58053 into master Jan 5, 2026
10 checks passed
@neiii neiii deleted the fix/opencode-singular-directory-paths branch January 5, 2026 04:30
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.

1 participant