Hook Development for Claude Code Plugins
anthropics/claude-plugins-official
Explains how to write Claude Code plugin hooks, both prompt-based checks and bash commands, for events such as PreToolUse, Stop and SessionStart.
A skill your agent uses when writing or modifying the kimi-code terminal UI in apps/kimi-code/src/tui — components, dialogs/selectors, slash commands, themes, streaming render, or the KimiTUI…
$ npx skills add MoonshotAI/kimi-code --skill write-tui -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install MoonshotAI/kimi-code write-tui --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/MoonshotAI/kimi-code.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/write-tui .claude/skills/write-tui && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "write-tui" agent skill from https://github.com/MoonshotAI/kimi-code/tree/main/.agents/skills/write-tui into .claude/skills/write-tui/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "write-tui", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/MoonshotAI/kimi-code/tree/main/.agents/skills/write-tuiType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add MoonshotAI/kimi-code --skill write-tui -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install MoonshotAI/kimi-code write-tui --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/MoonshotAI/kimi-code.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.agents/skills/write-tui .agents/skills/write-tui && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "write-tui" agent skill from https://github.com/MoonshotAI/kimi-code/tree/main/.agents/skills/write-tui into .agents/skills/write-tui/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "write-tui", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add MoonshotAI/kimi-code --skill write-tui -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install MoonshotAI/kimi-code write-tui --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/MoonshotAI/kimi-code.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.agents/skills/write-tui .cursor/skills/write-tui && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "write-tui" agent skill from https://github.com/MoonshotAI/kimi-code/tree/main/.agents/skills/write-tui into .cursor/skills/write-tui/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "write-tui", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/MoonshotAI/kimi-code.git --path .agents/skills/write-tui--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add MoonshotAI/kimi-code --skill write-tui -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install MoonshotAI/kimi-code write-tui --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/MoonshotAI/kimi-code.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.agents/skills/write-tui .gemini/skills/write-tui && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "write-tui" agent skill from https://github.com/MoonshotAI/kimi-code/tree/main/.agents/skills/write-tui into .gemini/skills/write-tui/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "write-tui", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install MoonshotAI/kimi-code write-tuiInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add MoonshotAI/kimi-code --skill write-tui -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/MoonshotAI/kimi-code.git skills-src && mkdir -p .github/skills && cp -r skills-src/.agents/skills/write-tui .github/skills/write-tui && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "write-tui" agent skill from https://github.com/MoonshotAI/kimi-code/tree/main/.agents/skills/write-tui into .github/skills/write-tui/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "write-tui", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add MoonshotAI/kimi-code --skill write-tui -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install MoonshotAI/kimi-code write-tui --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/MoonshotAI/kimi-code.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.agents/skills/write-tui .opencode/skills/write-tui && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "write-tui" agent skill from https://github.com/MoonshotAI/kimi-code/tree/main/.agents/skills/write-tui into .opencode/skills/write-tui/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "write-tui", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
write-tuiA skill your agent uses when writing or modifying the kimi-code terminal UI in apps/kimi-code/src/tui — components, dialogs/selectors, slash commands, themes, streaming render, or the KimiTUI…
Write Tui is an agent skill from MoonshotAI/kimi-code. Use when writing or modifying the kimi-code terminal UI in apps/kimi-code/src/tui — components, dialogs/selectors, slash commands, themes, streaming render, or the KimiTUI controllers. Covers the architecture, where new features go, test placement, the theme system mechanics, and the dialog interaction/visual spec (DESIGN.md).
Its SKILL.md is about 2.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file (for example `DESIGN.md`).
It sits in Agent Workflows, covering Design tokens and Hooks and plugins. It works with Kimi. The repository describes itself as: Kimi Code CLI — The Starting Point for Next-Gen Agents. The licence is MIT.
Read from SKILL.md and the folder at commit 21406fb. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md.
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Write Tui loads about 2.1k tokens when it runs. Until then it costs about 85 tokens; SKILL.md has 897 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from MoonshotAI/kimi-code at commit 21406fb, republished under its MIT licence (© MoonshotAI). 897 words, ~2,101 tokens.
.claude/skills/write-tui/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.The terminal UI lives in apps/kimi-code/src/tui. Before writing TUI code, read apps/kimi-code/AGENTS.md for the always-on map, module boundaries, and hard constraints (printable-key decoding, no chalk named colors, etc.). This skill is the how-to: architecture orientation, feature routing, test placement, theme mechanics, and the dialog spec.
For any list dialog, selector, input box, or status/toggle list, the interaction and visual rules are normative — see DESIGN.md in this folder and follow its self-check list before submitting.
KimiTUI is a coordinator that wires state, layout, session, and dialogs together and delegates heavy logic to controllers.
src/tui/kimi-tui.ts — the KimiTUI coordinator. Holds state, owns startup/shutdown order, layout/editor wiring, user-input entry, sending/queueing, session lifecycle, and the slash-command handler dispatch. It should not accumulate event-routing or rendering logic — those live in controllers.src/tui/tui-state.ts — TUIState, createTUIState, createInitialAppState. The single global UI state shape. Before adding a new global field, decide whether it truly belongs here vs. local component state.src/tui/controllers/ — the independently-testable responsibilities. Each controller owns one slice:session-event-handler.ts — routes SDK session events (handleEvent dispatch + the per-event handleXxx). Concrete event handling goes here, not in KimiTUI.streaming-ui.ts — streaming render: assistant delta, thinking, tool call / result, compaction, subagent, background agent, transcript aggregation.session-replay.ts — resume/replay orchestration; drives replay records through the same live render hooks. Stateless replay parsing/limiting/projection helpers belong in src/tui/utils/message-replay.ts.tasks-browser.ts — the tasks browser controller.editor-keyboard.ts — editor keyboard handling, exit shortcuts, external editor, clipboard image.auth-flow.ts — login/auth orchestration (refreshConfigAfterLogin, etc.).src/tui/commands/ — slash-command declaration, parsing, ordering, and dynamic skill-command generation. Parsing and types only; execution is dispatched from KimiTUI's slash-command handler section, and complex execution sinks into utils or focused components.src/tui/components/ — pi-tui components by UI type: chrome/ (footer, todo, welcome, loader, device code), dialogs/ (selectors, approval/question panels, settings popups that replace the editor), editor/ (input box + mention provider), media/ (image, diff, code highlight), markdown/ (the app's Markdown wrapper and mermaid art), messages/ (transcript blocks + tool-renderers), panes/ (activity, queue).src/tui/reverse-rpc/ — adapts SDK approval/question callbacks into UI panel data and the user's choice back into an SDK response.src/tui/theme/ — themes, color tokens, style helpers, pi-tui markdown theme, terminal-background detection. The single source of truth for color.src/tui/utils/ — TUI-only utilities (need TUIState or a component). App-wide, UI-independent helpers go in src/utils/.When a controller or KimiTUI section keeps growing, split pure functions, state projections, and presentation components into the matching directory rather than expanding the file.
The feature type decides the landing spot:
src/cli/commands.ts / src/cli/options.ts, passed into the TUI via src/cli/run-shell.ts. The CLI never operates on the session directly.src/cli/sub/, non-interactive only; reach core via @moonshot-ai/kimi-code-sdk.src/tui/commands/; add the execution entry in KimiTUI's slash-command handler section; sink complex logic into utils or a focused component.buildSkillSlashCommands / the skill command map; do not hard-code a single skill.src/tui/types.ts, add/extend a components/messages/ component, register the renderer in the transcript builder.components/messages/tool-renderers/registry.ts and the renderer; do not stack branches inside ToolCallComponent.components/dialogs/, mounted via mountEditorReplacement; follow DESIGN.md. If triggered by an SDK callback, check whether reverse-rpc/ needs an adapter/controller/handler.session-event-handler.ts's handleEvent, then the matching handleXxx.controllers/streaming-ui.ts.KimiTUI; replay behavior → controllers/session-replay.ts, reusing live render paths.chrome/footer, panes/activity, panes/queue, and the matching updateXxx.src/tui/config.ts, then the settings UI; persist through saveTuiConfig (a component never writes the config file itself).src/constant/; TUI-only non-copy constants in src/tui/constant/. Component-local copy, option labels, help text, dialog titles/footers stay next to their component — do not centralize copy into a global module.src/utils/; depends on TUI state or a component → src/tui/utils/.test/tui/components/...).test/tui/commands/.test/tui/reverse-rpc/.some-feature.test.ts just to land a small feature; extend the nearest existing test file.Themes are managed centrally under src/tui/theme/:
colors.ts — semantic tokens: ColorPalette, darkColors, lightColors.styles.ts — common chalk helpers built on top of ColorPalette.pi-tui-theme.ts — the markdown/pi-tui theme config.terminal-background.ts — terminal background detection used by auto resolution.bundle.ts — packs colors, styles, markdownTheme into a KimiTUIThemeBundle.index.ts / detect.ts — theme type and auto/dark/light resolution.Keep the color-token set in sync.
ColorPaletteincolors.tsis the source of truth for color tokens. When you add, rename, or remove one, update its mirrors in the same change: the custom-theme JSON schema (apps/kimi-code/src/tui/theme/theme-schema.json), the token tables in the custom-theme docs (docs/en/customization/themes.mdanddocs/zh/customization/themes.md), and the token table in thecustom-themebuilt-in skill (packages/agent-core-v2/src/features/skill/catalog/builtin/custom-theme.md).
Apply / switch flow:
ThemeSelectorComponent → handleThemeCommand → applyThemeChoice.KimiTUI.applyTheme: it updates state.theme, state.appState.theme, and notifies components to refresh their palette.saveTuiConfig — a component must not write the config file itself.The hard color rules (no chalk named colors, contrast ratios, no module-top-level cached styled functions, add a
ColorPalettetoken before inventing a color) are normative and guard-enforced — they live inapps/kimi-code/AGENTS.md. This skill only covers the mechanics.
printableChar() for printable-key comparisons (CI guard) and chalk.hex(colors.<token>) for color (CI guard).© MoonshotAI, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 1 other file in .agents/skills/write-tui of MoonshotAI/kimi-code.
Open the folder on GitHubat commit 21406fb
Write Tui next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Write Tui this skillMoonshotAI/kimi-code | 7.8k | — | ~2.1k | Automated safety check: Pass | MIT | |
| Hook Development for Claude Code Pluginsanthropics/claude-plugins-official | 37k | 11 repos | ~4.1k | Automated safety check: Notes | Apache-2.0 | |
| Claude Code Agent Developmentanthropics/claude-plugins-official | 37k | 8 repos | ~2.8k | Automated safety check: Pass | Apache-2.0 | |
| Claude Code Skill Developer Guidediet103/claude-code-infrastructure-showcase | 10k | 10 repos | ~3.5k | Automated safety check: Pass | MIT | |
| Plugin Settings Patternanthropics/claude-plugins-official | 37k | 7 repos | ~3k | Automated safety check: Pass | Apache-2.0 | |
| MCP Integration for Pluginsanthropics/claude-plugins-official | 37k | 11 repos | ~3.1k | Automated safety check: Pass | Apache-2.0 |
anthropics/claude-plugins-official
Explains how to write Claude Code plugin hooks, both prompt-based checks and bash commands, for events such as PreToolUse, Stop and SessionStart.
anthropics/claude-plugins-official
Explains how to write agents for Claude Code plugins: the markdown file with YAML frontmatter, trigger descriptions, model and color settings, and system prompt design.
diet103/claude-code-infrastructure-showcase
A guide to creating and managing Claude Code skills with auto-activation: skill-rules.json triggers, hooks, enforcement levels, YAML frontmatter and progressive disclosure.
anthropics/claude-plugins-official
Shows how Claude Code plugins keep per-project settings and state in .claude/plugin-name.local.md files with YAML frontmatter and a markdown body.
anthropics/claude-plugins-official
Explains how to bundle Model Context Protocol servers in a Claude Code plugin, covering config files, stdio, SSE, HTTP and WebSocket server types, and authentication.
anthropics/claude-plugins-official
Explains how to write Claude Code slash commands: Markdown files with YAML frontmatter, arguments, file references, bash context and interactive prompts.
MoonshotAI/kimi-code
Kimi Browser Extension(Kimi 浏览器扩展,原 Kimi WebBridge)lets AI control the user's real browser — navigate, click, type, read, screenshot, and interact with any website using the user's actual login…
MoonshotAI/kimi-code
A skill your agent uses when generating changesets in the kimi-code repository — deciding whether to write one, which package to list, the bump level, the wording, and the confirmation workflow.
MoonshotAI/kimi-code
Update Kimi Code CLI user documentation after meaningful code changes that affect product behavior or user experience.
MoonshotAI/kimi-code
Universal data-source assistant for stocks (Wind, S&P, SEC EDGAR), macro (World Bank, IMF, FRED, NBS), Chinese government data and standards (GB/HB/DB/TT), corporate, academic, legal, WHO/FAO/OECD…
MoonshotAI/kimi-code
Use before merging a kimi-code release PR to preview the user-facing CLI changelog in Chinese.
MoonshotAI/kimi-code
在 kimi-code 仓库里 review 一个 PR 时使用:按 PR 模板逐节核对描述与 diff,并单独做一轮"回归与用户影响"评审,给出影响等级与评审摘要,评审摘要用用户当前使用的语言。
Works with
Categories
A skill your agent uses when writing or modifying the kimi-code terminal UI in apps/kimi-code/src/tui — components, dialogs/selectors, slash commands, themes, streaming render, or the KimiTUI…. Write Tui is an agent skill from MoonshotAI/kimi-code. Use when writing or modifying the kimi-code terminal UI in apps/kimi-code/src/tui — components, dialogs/selectors, slash commands, themes, streaming render, or the KimiTUI controllers.
Write Tui fits situations like: modifying the kimi-code terminal UI in apps/kimi-code/src/tui — components; dialogs/selectors; streaming render; the KimiTUI controllers.
Run `npx skills add MoonshotAI/kimi-code --skill write-tui -a claude-code`. Or copy the skill folder (.agents/skills/write-tui in MoonshotAI/kimi-code) into .claude/skills/write-tui in your project. Claude Code loads it when a task matches its description.
Run `npx skills add MoonshotAI/kimi-code --skill write-tui -a codex`. Or copy the skill folder (.agents/skills/write-tui in MoonshotAI/kimi-code) into .agents/skills/write-tui in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add MoonshotAI/kimi-code --skill write-tui -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/write-tui, .gemini/skills/write-tui, .github/skills/write-tui and .opencode/skills/write-tui in your project.
SKILL.md names no scripts, command-line tools or credentials: Write Tui is instructions for the agent only.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Write Tui is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.1k tokens (SKILL.md is roughly 8.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Write Tui: Hook Development for Claude Code Plugins (anthropics/claude-plugins-official, 37k stars), Claude Code Agent Development (anthropics/claude-plugins-official, 37k stars), Claude Code Skill Developer Guide (diet103/claude-code-infrastructure-showcase, 10k stars) and Plugin Settings Pattern (anthropics/claude-plugins-official, 37k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
MoonshotAI (a GitHub organization) maintains it in MoonshotAI/kimi-code, which has 7,785 GitHub stars. The repository holds 11 skills in this directory. The repository was last updated on October 2, 2026.
Source: MoonshotAI/kimi-code on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.