开发与测试
ai-coding-agents-command-runtime
Designs slash-command runtimes for coding-agent CLIs. Use when modeling command registries, lazy loading, aliases, forked commands, or remote-safe dispatch.
vasilyu1983 · 已有 AI 审核记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add vasilyu1983/AI-Agents-public --skill ai-coding-agents-command-runtime技能说明
name: ai-coding-agents-command-runtime description: "Designs slash-command runtimes for coding-agent CLIs. Use when modeling command registries, lazy loading, aliases, forked commands, or remote-safe dispatch." compatibility: Portable core. Works on Claude Code and Codex. version: "1.1" last_validated: 2026-07-11
AI Coding Agents Command Runtime
Use this skill to design or review the slash-command layer of a coding-agent CLI: command registry shape, typed command kinds, lazy loading, source-aware discovery, and safe dispatch across local, remote, and bridge modes.
This skill owns command-runtime architecture for coding agents. For broader agent creation, start with ../ai-coding-agents/SKILL.md.
ASCII Flow
command sources
built-ins + skills + plugins + workflows + dynamic discoveries
|
v
registry composition
typed command contract + source tags + deterministic precedence
plugin-namespaced skills: plugin-name:skill-name
|
v
availability + enablement
feature gates + auth + mode filters + aliases
/agents as first-class tabbed command surface (background agent management)
|
v
dispatch
prompt command | local text | local UI | forked subagent | remote-safe
/reload-skills (in-session reload) | SessionStart reloadSkills hook
--safe-mode (disables CLAUDE.md, plugins, skills, hooks, MCP)
|
v
execution result or unavailable-command error
Quick Reference
| Question | Read | Outcome |
|---|---|---|
| How should commands be represented and discovered? | references/command-registry-and-discovery.md | Registry model, command kinds, load order, source precedence |
| How should commands execute across inline, forked, and remote flows? | references/command-dispatch-forking-and-remote-safety.md | Dispatch rules, forked execution, remote-safe filtering, bridge gating |
| How does OpenAI Codex model slash-command availability? | references/openai-codex-command-state-machine.md | Command metadata, inline-arg support, active-task availability, side-conversation availability |
When To Use
- Design slash-command architecture for a coding-agent CLI or REPL
- Add commands from built-ins, skills, plugins, workflows, or MCP-backed sources
- Define command kinds such as prompt, local text, and local JSX or TUI commands
- Review aliasing, immediacy, availability gates, or source-aware command formatting
- Separate bridge-safe, remote-safe, and terminal-only commands in hybrid runtimes
Use Other Skills
| Need | Use Instead |
|---|---|
| Broader coding-agent architecture | ../ai-coding-agents/SKILL.md |
| Plugin package and extension architecture | ../ai-coding-agents-plugins/SKILL.md |
| Tool registry and tool execution semantics | ../ai-coding-agents-tools/SKILL.md |
| Session lifecycle and resume | ../ai-coding-agents-sessions/SKILL.md |
| Terminal REPL interaction design | ../ai-coding-agents-terminal-ui/SKILL.md |
| Generic CLI design outside agent runtimes | ../software-devtools/SKILL.md |
Default Workflow
- Classify command surfaces. Separate prompt-expansion commands from local text commands and local JSX or TUI commands.
- Define the registry contract. Keep one typed command interface with stable fields for names, aliases, source, availability, and enablement.
- Model load order explicitly. Load bundled and built-in entries, then skills, plugins, workflows, and any dynamic discoveries, with deterministic precedence.
- Keep loading lazy. Heavy implementations should load on invocation, not during registry bootstrap.
- Decide which commands are model-invocable. Prompt-style commands and skills need extra fields for descriptions, argument hints, fork behavior, and tool allowances.
- Separate UI-safe from bridge-safe. Remote and bridge clients should see only commands that are valid without local terminal interaction.
- Treat forked commands as subagent orchestration. Give them explicit allowed tools, agent selection, and prompt-cache-safe context inheritance.
- Make cache invalidation explicit. Memoized command discovery must have a host-owned invalidation path when skills, plugins, or policy layers change.
- Validate with conflict cases. Test aliases, duplicate names, missing loaders, auth-gated commands, stale caches, and mode-specific filtering.
Host Rules
- Keep one registry type for every command source so built-ins, skills, plugins, and workflows share the same dispatch contract.
- Make command kind explicit. Do not infer "text versus TUI versus prompt" from file layout or naming.
- Separate static availability from dynamic enablement. Auth or provider eligibility and feature-flag or environment checks are different concerns.
- Default to lazy loading for anything with heavy UI, IO, or optional dependencies.
- Allow heavyweight commands to expose lightweight shims so menus and help text stay responsive before the real implementation loads.
- Keep prompt commands declarative and source-tagged so they can be formatted differently in UI and model contexts.
- Gate remote and bridge command execution with explicit allowlists. Do not let terminal-only commands leak into mobile or web control paths.
- De-duplicate dynamically discovered commands by canonical file identity, not only by display name or path string.
Build Order
- Define the typed command contract and command kinds.
- Implement deterministic registry composition and precedence.
- Add aliases, source tags, and availabi