Skip to content

fix(core,tui): support directory-based skills and dynamic TUI autocomplete (rebase of #401) - #409

Open
alecuba16 wants to merge 1 commit into
Kuberwastaken:mainfrom
alecuba16:pr401-rebase
Open

fix(core,tui): support directory-based skills and dynamic TUI autocomplete (rebase of #401)#409
alecuba16 wants to merge 1 commit into
Kuberwastaken:mainfrom
alecuba16:pr401-rebase

Conversation

@alecuba16

@alecuba16 alecuba16 commented Sep 3, 2026

Copy link
Copy Markdown

Summary

Rebased version of #401 — fix skill discovery to support directory-based skills, tilde paths, and dynamic TUI autocomplete. Carries the post-review rework that answered the maintainer's review on #401.

Changes

  • skill_discovery.rs: scan_dir detects SKILL.md/skill.md in subdirectories (e.g. skills/<name>/SKILL.md), parses a direct SKILL.md without returning early (continues scanning sibling flat .md files), and uses the parent dir name when the file stem is skill (case-insensitive). Hidden entries are skipped. resolve_path expands ~/ and ~\ tilde paths for both separators, leaving ~user unexpanded.
  • commands/lib.rs: new all_slash_command_names merges built-in command names with discovered skill names (excluding collisions).
  • app/mod.rs: discovered_slash_commands field populated once in run_interactive after App::new, not in the constructor.
  • app/prompt.rs: update_suggestions merges the cached list with PROMPT_SLASH_COMMANDS — no discover_skills call per keystroke.
  • main.rs: populates discovered_slash_commands at startup.

Rebase notes

Validation

  • cargo check --workspace — clean
  • cargo clippy --workspace --all-targets -- -D warnings — clean
  • cargo test --workspace — all pass except 1 pre-existing failure (settings_screen, fails on main too)

Supersedes #401.

…utocomplete

- scan_dir now handles subdirectories with SKILL.md (directory-based skills)
- parse_skill_file uses parent dir name when file stem is 'skill'
- resolve_path expands ~ and ~/ paths, leaves ~user unexpanded, handles
  both / and backslash separators for Windows
- discover_skills adds ~/.agents/skills/ as a global source
- commands_from_discovered_skills is now wired into autocomplete via
  all_slash_command_names, so skills appear in the command palette
- Discovered slash commands cached on App and merged at prompt update time,
  not re-discovered per keystroke
- No CRLF/LF churn: all changes preserve original line endings

Addresses review feedback on PR Kuberwastaken#401:
1. Rebased on post-Kuberwastaken#403 main, no reformatting
2. resolve_path handles ~user paths (left unexpanded) and Windows separators
3. scan_dir collects rather than returning early on SKILL.md
4. Discovery runs once at startup (not in App::new, not per keystroke)
5. all_slash_command_names cached, not rebuilt per keystroke
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