Skip to content

feat(skills): populate registry from enabled sets and improve autocomplete#226

Merged
LeeCheneler merged 1 commit intomainfrom
feat/220-populate-skills-from-enabled-sets
Mar 29, 2026
Merged

feat(skills): populate registry from enabled sets and improve autocomplete#226
LeeCheneler merged 1 commit intomainfrom
feat/220-populate-skills-from-enabled-sets

Conversation

@LeeCheneler
Copy link
Copy Markdown
Owner

Summary

This PR implements two main changes:

  1. Updates the autocomplete to use substring matching (indexOf) instead of prefix matching, and removes the ghost text feature.
  2. Implements loading skills from enabled skill set sources, namespacing them as setName:skillName, and reloading skills when settings are saved.

GitHub Issue

Closes #220

What Changed

Autocomplete Improvements

  • Removed ghost text functionality and related state (ghost, showGhost) from the autocomplete hook and chat input component.
  • Changed matching strategy from startsWith to indexOf (substring matching) with sorting by match index (earliest match first).
  • Updated tests to reflect the new behavior: removed ghost text tests and added a test for substring matching sorted by index.
  • Simplified the useAutocomplete hook signature by removing the cursor parameter (no longer needed for ghost text).

Skill Set Loading

  • Added getSkillSetPath function to retrieve the absolute path of a specific skill set within a cloned source.
  • Extended Skill interface with an optional skillSet property to track which skill set a skill originated from.
  • Rewrote loadSkills to accept an optional array of SkillSetDir and load skills from skill set directories with namespacing (setName:skillName).
  • Updated skill loading precedence: skill sets → global → local (later wins).
  • Modified the skills registry to resolve enabled skill set directories from config and pass them to the loader.
  • Added reloadSkills() call in settings save callback to refresh skills when skill set sources are updated.
  • Added comprehensive tests for skill set loading, namespacing, coexistence with global skills, multiple skill sets, and precedence rules.

Files Modified

  • src/commands/settings.ts: Import reloadSkills and call it after saving settings.
  • src/components/chat-input.tsx: Simplify autocomplete usage, remove ghost text related code.
  • src/components/chat-input.test.tsx: Remove outdated ghost text test.
  • src/hooks/use-autocomplete.ts: Rewrite matching logic, remove ghost text, adjust return values.
  • src/hooks/use-autocomplete.test.tsx: Remove ghost text tests, add substring matching test.
  • src/skill-sets/sources.ts: Add getSkillSetPath helper function.
  • src/skills/loader.ts: Rewrite to load from skill set directories with namespacing and updated precedence.
  • src/skills/loader.test.ts: Add extensive test suite for skill set loading behavior.
  • src/skills/registry.ts: Resolve enabled skill set directories and pass to loader.
  • src/skills/types.ts: Add skillSet property to Skill interface.

Notes for Reviewers

  • The autocomplete now shows all items containing the typed substring anywhere in the name, sorted by the position of the match (earliest index first). For example, typing "pr" will match "pr", "approve" (contains "pr" at index 2), and "dev:pr" (contains "pr" at index 4) in that order.
  • Skill set skills are namespaced in the registry as setName:skillName (e.g., "ops:deploy") to avoid naming conflicts and allow explicit reference.
  • When loading skills from multiple sources, later sources win: skill set skills override global skills with the same namespaced name, and local skills override everything.
  • The skills registry now automatically reloads when settings are saved, ensuring newly added or updated skill set sources are picked up without a restart.

…plete

Namespace skill set skills as setName:skillName and load them into the
registry from enabled sets in config. Reload skills on settings save
for immediate effect.

Switch autocomplete matching from startsWith to includes, sorted by
match position. Remove ghost text from chat input.

Refs #220
@LeeCheneler LeeCheneler merged commit b24763c into main Mar 29, 2026
4 checks passed
@LeeCheneler LeeCheneler deleted the feat/220-populate-skills-from-enabled-sets branch March 29, 2026 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: populate skills registry from enabled skill sets

1 participant