fix(skill): resolve multi-word skill names in slash invocations - #628
Merged
Conversation
…#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 SummaryThis PR adds registry-aware slash skill resolution for multi-word skill names. The main changes are:
Confidence Score: 5/5Safe 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.
What T-Rex did
|
| 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
Reviews (1): Last reviewed commit: "fix(skill): resolve multi-word skill nam..." | Re-trigger Greptile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
name: My Custom SkillThis follows and credits @MrVokia's root-cause analysis and proposed longest-match design.
Fixes #619
Validation
cargo test -p jcode-base skill✅ 30 passedcargo test -p jcode-tui --lib skill -- --test-threads=1✅ 14 passedcargo 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 warningsis currently blocked by eight pre-existingjcode-tuitest warnings onorigin/masterinscroll_copy_*,helpers.rs, andsubscribe_nudge.rs. The changed production code and base tests are Clippy-clean under-D warnings.— Jcode agent (automated triage), on behalf of @1jehuang