> For the complete documentation index, see [llms.txt](https://ai-os-and-trend-finder.gitbook.io/ai-os-and-trend-finder-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ai-os-and-trend-finder.gitbook.io/ai-os-and-trend-finder-docs/.spec_system/archive/sessions/phase40-session13-command-ux-and-slash-actions/tasks.md).

# Task Checklist

**Session ID**: `phase40-session13-command-ux-and-slash-actions` **Total Tasks**: 23 **Estimated Duration**: 3-4 hours **Created**: 2026-07-03

***

Legend: `[x]` completed; `[ ]` pending; `[P]` parallelizable; `[SNNMM]` session ref; `TNNN` task ID.

***

## Setup (2 tasks)

* [x] T001 \[S4013] Verify existing command endpoint, admin hook, compact flow, composer toolbar, and Intelligence event contracts before edits (`scripts/lib/hermes-admin-bridge.ts`, `src/hooks/use-hermes-admin.ts`, `src/components/hermes/chat/hermes-chat-tab.tsx`, `src/lib/hermes-intelligence-events.ts`)
* [x] T002 \[S4013] Add or refresh chat test fixtures for command mutation success, command mutation failure, update confirmation, slash drafts, and Intelligence launcher behavior (`src/components/hermes/chat/__tests__/hermes-chat-tab.test.tsx`)

***

## Foundation (5 tasks)

* [x] T003 \[S4013] \[P] Create typed command action registry, slash aliases, fixed filtering order, admin request builders, and safe output formatter (`src/components/hermes/chat/command-actions.ts`)
* [x] T004 \[S4013] \[P] Create split command menu and slash suggestion component with platform-appropriate accessibility labels, focus management, and input support (`src/components/hermes/chat/command-menu.tsx`)
* [x] T005 \[S4013] Extend local chat message metadata for command output and failure bubbles with types matching declared contract and exhaustive rendering (`src/components/hermes/chat/chat-types.ts`)
* [x] T006 \[S4013] Add command action props, slash candidate props, and command menu slot to the composer without disturbing model selector or context meter layout (`src/components/hermes/chat/chat-composer.tsx`)
* [x] T007 \[S4013] Export command helpers or types needed by tests while keeping route-facing chat exports minimal (`src/components/hermes/chat/index.ts`)

***

## Implementation (10 tasks)

* [x] T008 \[S4013] Wire command execution state, selected action context, and duplicate-trigger prevention while in-flight (`src/components/hermes/chat/hermes-chat-tab.tsx`)
* [x] T009 \[S4013] Route menu actions for status, doctor, version, insights command mode, and update through `admin.commands.runCommand` with authorization enforced at the existing admin boundary (`src/components/hermes/chat/hermes-chat-tab.tsx`)
* [x] T010 \[S4013] Implement update armed-confirmation flow with cancel and accept states, duplicate-trigger prevention while in-flight, and `confirmation: "update"` only after acceptance (`src/components/hermes/chat/hermes-chat-tab.tsx`, `src/components/hermes/chat/command-menu.tsx`)
* [x] T011 \[S4013] Route `/compact` and compact menu action to the existing compact flow with existing disabled, pending, success, and failure states preserved (`src/components/hermes/chat/hermes-chat-tab.tsx`)
* [x] T012 \[S4013] Route `/new-chat` and new chat menu action to the existing new-chat reset path with stale command, slash, and confirmation state reset on re-entry (`src/components/hermes/chat/hermes-chat-tab.tsx`)
* [x] T013 \[S4013] Route the insights slash/menu action to the existing Intelligence launcher when available and to the allowlisted insights command when command execution is selected or the launcher is unavailable (`src/components/hermes/chat/hermes-chat-tab.tsx`)
* [x] T014 \[S4013] Intercept known slash submits so they execute fixed actions and are not sent through `admin.chat.sendPrompt` as prompt text (`src/components/hermes/chat/chat-composer.tsx`, `src/components/hermes/chat/hermes-chat-tab.tsx`)
* [x] T015 \[S4013] Append successful command responses as redacted assistant-side command messages with stable pre/monospace stdout and stderr rendering (`src/components/hermes/chat/hermes-chat-tab.tsx`, `src/components/hermes/chat/chat-message-list.tsx`)
* [x] T016 \[S4013] Append controlled command failure messages for timeout, offline, token missing, admin disabled, endpoint error, empty output, and non-zero command paths without exposing raw bridge diagnostics (`src/components/hermes/chat/hermes-chat-tab.tsx`, `src/components/hermes/chat/chat-message-list.tsx`)
* [x] T017 \[S4013] Preserve sanitized chat `info` events as diagnostics or Intelligence activity rather than normal assistant reply text (`src/lib/hermes-intelligence-events.ts`, `src/components/hermes/chat/hermes-chat-tab.tsx`)

***

## Testing (6 tasks)

* [x] T018 \[S4013] \[P] Test command action lookup, slash filtering, aliases, request builders, update confirmation payload, and output formatting (`src/components/hermes/chat/__tests__/command-actions.test.ts`)
* [x] T019 \[S4013] \[P] Test command menu rendering, keyboard selection, slash suggestions, and fixed action selection without tutorial prose (`src/components/hermes/chat/__tests__/hermes-chat-tab.test.tsx`)
* [x] T020 \[S4013] Test status, doctor, version, and insights command execution payloads plus duplicate-trigger prevention while in-flight (`src/components/hermes/chat/__tests__/hermes-chat-tab.test.tsx`)
* [x] T021 \[S4013] Test update cancel, update accept, timeout failure copy, and no command request before explicit confirmation (`src/components/hermes/chat/__tests__/hermes-chat-tab.test.tsx`)
* [x] T022 \[S4013] Test `/compact`, `/new-chat`, unknown slash text, known slash text not sent as prompt, and demo/admin-disabled write-gate behavior (`src/components/hermes/chat/__tests__/hermes-chat-tab.test.tsx`)
* [x] T023 \[S4013] Run focused checks and ASCII/LF validation for touched files (`bunx vitest run src/components/hermes/chat/__tests__/command-actions.test.ts src/components/hermes/chat/__tests__/hermes-chat-tab.test.tsx src/hooks/__tests__/use-hermes-admin.test.tsx src/lib/__tests__/hermes-admin-types.test.ts src/lib/__tests__/hermes-intelligence-events.test.ts`, `bun run typecheck`, `perl -ne 'exit 1 if /[^\x00-\x7F]/' .spec_system/specs/phase40-session13-command-ux-and-slash-actions/spec.md .spec_system/specs/phase40-session13-command-ux-and-slash-actions/tasks.md`)

***

## Completion Checklist

* [x] All tasks marked `[x]`
* [x] All tests and checks passing
* [x] All files ASCII-encoded with LF line endings
* [x] implementation-notes.md updated
* [x] Ready for `creview` (next step in the implement -> creview -> validate sequence)

***

## Next Steps

Run the `creview` workflow step.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://ai-os-and-trend-finder.gitbook.io/ai-os-and-trend-finder-docs/.spec_system/archive/sessions/phase40-session13-command-ux-and-slash-actions/tasks.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
