Skip to content

fix(skill): resolve multi-word skill names in slash invocations - #628

Merged
1jehuang merged 1 commit into
masterfrom
fix/skill-invocation-multi-word-619
Jul 28, 2026
Merged

fix(skill): resolve multi-word skill names in slash invocations#628
1jehuang merged 1 commit into
masterfrom
fix/skill-invocation-multi-word-619

Conversation

@1jehuang

Copy link
Copy Markdown
Owner

Summary

  • add registry-aware slash invocation resolution with longest registered-name matching
  • preserve the existing identifier guard and single-token fallback for file drops, typos, and install hints
  • use the resolver in local TUI input, remote TUI dispatch, and the headless REPL
  • add six focused base tests plus an end-to-end TUI regression for name: My Custom Skill

This follows and credits @MrVokia's root-cause analysis and proposed longest-match design.

Fixes #619

Validation

  • cargo test -p jcode-base skill ✅ 30 passed
  • cargo test -p jcode-tui --lib skill -- --test-threads=1 ✅ 14 passed
  • cargo clippy -p jcode-base --lib --tests -- -D warnings
  • cargo clippy -p jcode-tui --lib -- -D warnings
  • cargo build -p jcode --bin jcode

The requested combined cargo clippy -p jcode-base -p jcode-tui --lib --tests -- -D warnings is currently blocked by eight pre-existing jcode-tui test warnings on origin/master in scroll_copy_*, helpers.rs, and subscribe_nudge.rs. The changed production code and base tests are Clippy-clean under -D warnings.


— Jcode agent (automated triage), on behalf of @1jehuang

…#619)

Resolve slash invocations against registered skill names longest-first, while preserving the existing identifier guard and unknown-skill fallback. Wire the resolver into local TUI, remote TUI, and headless REPL paths, with base and end-to-end TUI coverage.

Co-authored-by: 陈朱衡 <wsadwsadqe@hotmail.com>
@greptile-apps

greptile-apps Bot commented Jul 27, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds registry-aware slash skill resolution for multi-word skill names. The main changes are:

  • Longest registered-name matching for slash invocations.
  • Existing identifier fallback and file-drop rejection preserved.
  • Local TUI, remote TUI dispatch, and headless REPL paths updated to use the resolver.
  • Focused resolver tests and a TUI test for name: My Custom Skill added.

Confidence Score: 5/5

Safe to merge with minimal risk.

The change is scoped to skill invocation parsing and dispatch. Existing fallback and file-drop behavior are preserved. Targeted resolver and TUI tests cover the main changed behavior. No correctness or security issues were identified.

Files Needing Attention: No files require special attention.

T-Rex T-Rex Logs

What T-Rex did

  • T-Rex created trex-artifacts and began capturing focused command logs.
  • The base skill tests were run and completed with EXIT_CODE: 0, reporting 30 tests passed.
  • The results showed matches for multi-word skill names, the longest-registered match, trailing prompt handling after multi-word names, fallback to a single token when no registry match exists, and preservation of single-word skill invocations.
  • An artifact entry for the base skill tests log was created to enable review of the test results.

T-Rex Ran code and verified through T-Rex

Important Files Changed

Filename Overview
crates/jcode-base/src/skill/invocation.rs Adds longest-registered-name skill invocation resolution while preserving identifier fallback and file-drop rejection.
crates/jcode-tui/src/tui/app/input.rs Updates local TUI slash skill activation to resolve names against the current skills snapshot.
crates/jcode-tui/src/tui/app/remote/input_dispatch.rs Updates remote slash dispatch to use registry-aware resolution for command detection and trailing prompt extraction.
crates/jcode-app-core/src/agent/turn_execution.rs Updates the headless REPL skill activation path to use registry-aware invocation resolution.
crates/jcode-tui/src/tui/app/tests/skill_invocation_multi_word.rs Adds a TUI test covering activation of a multi-word SKILL.md skill name.

Sequence Diagram

sequenceDiagram
participant User
participant Entry as TUI / Remote Dispatch / Headless REPL
participant Registry as SkillRegistry snapshot
participant Resolver as resolve_invocation
participant Skill as Registered skill
User->>Entry: /My Custom Skill trailing prompt
Entry->>Registry: load current skills snapshot
Registry->>Resolver: resolve against registered names
Resolver->>Resolver: keep identifier fallback guard
Registry->>Resolver: try longest whitespace-boundary matches
Registry-->>Resolver: matched "My Custom Skill"
Resolver-->>Entry: SkillInvocation(name, prompt)
Entry->>Skill: get(name)
Skill-->>Entry: skill metadata
Entry-->>User: activate skill and submit trailing prompt when present
Loading

Reviews (1): Last reviewed commit: "fix(skill): resolve multi-word skill nam..." | Re-trigger Greptile

@1jehuang
1jehuang merged commit 2689134 into master Jul 28, 2026
9 of 11 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.

Skill invocation misparses multi-word SKILL.md names (e.g. "/Git Commit Helper" reports Unknown skill)

1 participant