feat(slash): custom slash commands — skills, agents, settings.json, .claude/ compat#2386
Open
JimmyDaddy wants to merge 9 commits into
Open
feat(slash): custom slash commands — skills, agents, settings.json, .claude/ compat#2386JimmyDaddy wants to merge 9 commits into
JimmyDaddy wants to merge 9 commits into
Conversation
…spatch - SlashContext gets extraHandlers/reloadExtraHandlers hooks - handleSlash falls back to ctx.extraHandlers after static HANDLERS - Skill interface adds disableModelInvocation frontmatter support - SkillStore.roots() adds .reasonix/agents/ + .claude/agents/ scan - Agent files force runAs:subagent; tools frontmatter maps to allowedTools
Loads project/global settings.json slashCommands, executes shell commands synchronously as SlashResult, pure TUI-side only.
Scans .md files with YAML frontmatter as slash commands or agent definitions. Supports $ARGUMENTS substitution. First-write-wins across dirs; callers stack dirs in priority order.
setExtraSlashSpecs() injects custom commands into suggestSlashCommands, countAdvancedCommands, detectSlashArgContext. Deduplication keeps built-in commands dominant. Alias map is cached and invalidated on spec change.
Merges .reasonix/commands/ > .claude/commands/ > settings.json > skill/agent auto-registration. Reloadable via /slash reload.
- slash-custom.test.ts: 23 tests (registry, dispatch, suggestions, skills) - slash-md-commands.test.ts: 31 tests (md loader, agents, /agents handler) - Adjusted ui-slash-suggestions and slash test counts for new commands - PlanPanel.tsx: biome-ignore useImportType (classic JSX transform)
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.
What
自定义 Slash Command 能力,对标 Claude Code Skills + OpenCode Commands:
优先级:.reasonix/commands/ > .claude/commands/ > settings.json > skills/agents
Why
Closes #2026. 用户无需 fork 即可添加自定义工作流命令,Claude Code / OpenCode 项目零迁移。
How to verify
```sh
npm run verify # 318 files, 4104 tests, 0 failures
```
在 .reasonix/commands/ 或 .claude/commands/ 放入 .md 文件 → /name 直接调用。
在 settings.json 配置 slashCommands → /name 执行 shell 命令。
Checklist