跳到正文
cccskills
免费在 GitHub 公开

formax-slash-command-workflow

Use when adding/modifying Formax slash commands (/permissions /agents /hooks /todos etc), especially output rendering (command sublines), overlay dismiss messages, and whether outputs are injected into the next LLM turn.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(1)

  • SKILL.md4.1 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Formax slash command workflow

Goal

Use this skill when changing slash command discovery, dispatch, overlay dismissal output, or next-turn injection behavior.

Read First

  • docs/contracts/slash-command-contract.md
  • docs/contracts/semantics-contract.md when command behavior crosses canonical UI messages or routing
  • docs/contracts/config-settings-contract.md when the change touches /config

These docs are canonical. If stable behavior changes, update them before or with code.

Code Map

1) Command discovery + dispatch

  • packages/core/src/features/commands/registry.ts: command list/suggest/dispatch wiring
  • packages/core/src/features/commands/CommandStore.ts: disk scanning + precedence (project overrides user)
  • packages/core/src/features/semantics/core/commandRouting.ts: exact /clear / /compact and command-dispatch routing boundary

2) Command result contract (UI vs model)

  • packages/core/src/features/commands/contracts.ts: UiEffect / UiMessage / ModelEffect shapes
  • packages/core/src/features/commands/adapter.ts: maps command execution output → CommandResult
  • packages/core/src/features/repl/controller/send/send.ts: consumed slash handling, local_async, and injected-block plumbing

3) Overlay dismissal “subline output”

  • packages/core/src/features/repl/controller/ui/overlays.ts: overlay open/close + append “dismissed” sublines

4) REPL message plumbing + rendering

  • packages/core/src/features/repl/controller/send/send.ts: applies UiEffect.appendMessages to Msg
  • packages/core/src/screens/REPL.tsx: render msg.ui.kind === 'command_subline' as ⎿ ... (no ⏺)
  • packages/core/src/screens/REPL.slashSuggestions.test.tsx: duplicate command selection / preferredSlashSpecId

High-Signal Patterns

  • Pattern A: one-line overlay dismissal
    • append a single assistant Msg with ui.kind='command_subline'
    • keep copy stable unless the user explicitly requests copy changes
  • Pattern B: multi-line local output
    • split output into multiple command_subline rows
    • this is UI only; model injection remains separately controlled
  • Pattern C: inject-but-don't-spam
    • when a command needs to inform the model, keep UI output minimal and preserve recordForNextTurn / injected-block behavior separately

Minimal Workflow

  1. Classify the change first: discovery / precedence, local UI output, next-turn injection, or overlay dismiss behavior.
  2. Update the slash command contract first.
  3. Preserve “show in UI” vs “inject into model context” as separate concerns; local output alone must not imply injection.
  4. Use command_subline for Claude-style sublines; do not invent new message shapes.
  5. Run the minimum regression set below before review.

Minimum Regression

  • bun run test -- packages/core/src/features/commands/registry.test.ts packages/core/src/features/commands/CommandStore.test.ts packages/core/src/features/commands/adapter.test.ts packages/core/src/features/commands/contracts.test.ts
  • bun run test -- packages/core/src/features/repl/controller/ui/overlays.test.tsx
  • bun run test -- packages/core/src/features/repl/controller/send/send.test.ts packages/core/src/features/repl/useReplController.test.tsx
  • bun run test -- packages/core/src/screens/REPL.slashSuggestions.test.tsx packages/core/src/screens/repl/inputHint.test.ts
  • bun run type-check when command shapes or routing plumbing changes

Guardrails

  • Do not add bespoke commandSubLines-style structures; use Msg.ui.kind='command_subline'.
  • Do not change UI copy / spacing / colors as a side-effect of routing changes.
  • Do not patch only overlay output if the real bug is discovery or dispatch precedence.
  • If behavior is unclear, add or extend an Ink test first; tests are not the only spec, but they should lock the visible key path.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Use when a Formax repository task is non-trivial and you should analyze goals, non-goals, boundaries, data/type/interface impact, contract impact, test strategy, and whether an xhigh subagent is actually needed before writing a todo or code.

中文简介正在准备中。当前显示原文说明。

yusifeng/formax1942026年7月25日 更新

Use when adding or changing any Approval prompt/presenter.

中文简介正在准备中。当前显示原文说明。

yusifeng/formax1942026年7月25日 更新

Use when implementing or extending /config (storage, prompt injection, request params, UI-only toggles) with tests and strict UI parity.

中文简介正在准备中。当前显示原文说明。

yusifeng/formax1942026年7月25日 更新

Use when working on Formax code changes and you need a disciplined dev loop: keep a single mainline task, avoid scope drift, run only targeted tests (no coverage), avoid partial staging (MM), run mandatory review before commit, include an incremental optimization check, and keep commits small and reviewable.

中文简介正在准备中。当前显示原文说明。

yusifeng/formax1942026年7月25日 更新

Use when implementing/debugging Ctrl+O Expanded Transcript (second view) and thinking persistence in the REPL.

中文简介正在准备中。当前显示原文说明。

yusifeng/formax1942026年7月25日 更新

Use when implementing or debugging Formax permissions/policy/approval behavior and UI (allow/ask/deny rules, workspace boundaries, approval prompts, and /permissions overlay parity with Claude Code).

中文简介正在准备中。当前显示原文说明。

yusifeng/formax1942026年7月25日 更新

查看 yusifeng 的全部技能

报告此技能的问题