Agent skill

Add AI Chat Tool

by ryokun6 in ryokun6/ryos

Add or modify an AI chat tool ("Ask Ryo" capability) in ryOS.

AGPL-3.0Auto-check passedAI & LLM Engineering

Install Add AI Chat Tool

skills CLI
$ npx skills add ryokun6/ryos --skill add-ai-chat-tool -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install ryokun6/ryos add-ai-chat-tool --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/ryokun6/ryos.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.cursor/skills/add-ai-chat-tool .claude/skills/add-ai-chat-tool && rm -rf skills-src

Use ~/.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/

Facts

Skill name
add-ai-chat-tool
GitHub stars
1.3k
Token cost
~2.2k tokens
SKILL.md length
657 words
Files
1
Skills in repo
10
Repo updated
First seen
Licence
AGPL-3.0

At a glance

Add or modify an AI chat tool ("Ask Ryo" capability) in ryOS.

  • Works in 2 steps: Add a clear, behavior-specifying entry… → Add the tool to the allTools object…
  • Giving the AI a new capability
  • SKILL.md covers File Map, Decision: Server or Client?, A. Add the Schema… and B. Define the Tool…, plus 6 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Add AI Chat Tool is an agent skill from ryokun6/ryos. Add or modify an AI chat tool ("Ask Ryo" capability) in ryOS. Covers the server-side tool definition (Zod schema + description + optional execute) and the client-side handler dispatch, plus the server-vs-client execution split. Use when giving the AI a new capability, adding a tool to the chat agent, or editing chat/tool schemas, descriptions, or handlers.

Its SKILL.md is about 2.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in AI & LLM Engineering, covering Structured output and tool calling and Backend development. It works with Zod. The repository describes itself as: ryOS, made with Cursor. The licence is AGPL-3.0.

When your agent uses it

  • Giving the AI a new capability
  • Adding a tool to the chat agent
  • Editing chat/tool schemas

Example prompts

  • “Ask Ryo”
  • “/add-ai-chat-tool”

Workflow steps

2 steps, taken from the first numbered list in SKILL.md.

  1. Add a clear, behavior-specifying entry to TOOL_DESCRIPTIONS (the model relies heavily on this — describe each action, required params, and…
  2. Add the tool to the allTools object inside createChatTools.

What it can do on your machine

Read from SKILL.md and the folder at commit d989f4d. It shows what the files ask for, not the result of running them.

  • Tool permissions

    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.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Add AI Chat Tool loads about 2.2k tokens when it runs. Until then it costs about 94 tokens; SKILL.md has 657 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~94
When it runs · the whole SKILL.md, loaded when a task matches
~2.2k

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.

Safety

Auto-check passed

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.

SKILL.md

The full file from ryokun6/ryos at commit d989f4d, republished under its AGPL-3.0 licence (© ryokun6). 657 words, ~2,187 tokens.

Download SKILL.mdSave it as .claude/skills/add-ai-chat-tool/SKILL.md (or your agent's skills folder).
name
add-ai-chat-tool
description
Add or modify an AI chat tool ("Ask Ryo" capability) in ryOS. Covers the server-side tool definition (Zod schema + description + optional execute) and the client-side handler dispatch, plus the server-vs-client execution split. Use when giving the AI a new capability, adding a tool to the chat agent, or editing chat/tool schemas, descriptions, or handlers.

Adding an AI Chat Tool

ryOS chat tools follow the Vercel AI SDK tool-loop pattern. A tool is defined on the server (name + description + Zod inputSchema), and is either:

  • Server-executed — has an execute fn that runs in api/chat/tools/ (needs Redis, secrets, server fetch). Add the name to SERVER_EXECUTED_TOOL_NAMES.
  • Client-executed — has no execute. The model emits a tool call, the browser runs a handler in src/apps/chats/tools/, and the result is sent back via addToolOutput (needs Zustand stores, IndexedDB, media/DOM APIs).

File Map

ConcernFile
Server: input schemas (Zod)api/chat/tools/schemas.ts
Server: descriptions + tool object + profile filteringapi/chat/tools/index.ts (TOOL_DESCRIPTIONS, createChatTools)
Server: shared types/constantsapi/chat/tools/types.ts
Server: execute logicapi/chat/tools/executors.ts, app-state-executors.ts, maps-executor.ts
Server/client: execution split source of truthsrc/shared/tools/serverExecuted.ts
Client: per-tool handlerssrc/apps/chats/tools/<name>Handler.ts
Client: handler types/registrysrc/apps/chats/tools/types.ts, index.ts
Client: dispatch (switch on tool name)src/apps/chats/hooks/useAiChat.ts

Decision: Server or Client?

Needs…Execution
Redis, secrets, server-only fetch, SSRF-safe fetchServer (execute)
Zustand store mutation, IndexedDB/VFS, media playback, app windows, DOMClient (handler)

Some tools run both ways (e.g. stickiesControl, calendarControl, contactsControl): client in web chat, server in the Telegram profile. In that case provide both a handler and an executor.


A. Add the Schema (api/chat/tools/schemas.ts)

Schemas are Zod. Keep action-style tools as a discriminated/enum action plus optional params, and use .superRefine for cross-field rules so the model gets a clear error before the handler runs.

typescript
export const myFeatureControlSchema = z.object({
  action: z.enum(["list", "create", "delete"]),
  id: z.string().optional(),
  content: z.string().optional(),
});

Add any shared enums/constants to types.ts and import them here (mirrors CALENDAR_ACTIONS, TV_ACTIONS, etc.).

B. Define the Tool (api/chat/tools/index.ts)

  1. Add a clear, behavior-specifying entry to TOOL_DESCRIPTIONS (the model relies heavily on this — describe each action, required params, and when NOT to use it).
  2. Add the tool to the allTools object inside createChatTools.

Client-executed (no execute):

typescript
myFeatureControl: {
  description: TOOL_DESCRIPTIONS.myFeatureControl,
  inputSchema: schemas.myFeatureControlSchema,
  // No execute — handled client-side (requires Zustand store access)
},

Server-executed:

typescript
myFeatureControl: {
  description: TOOL_DESCRIPTIONS.myFeatureControl,
  inputSchema: schemas.myFeatureControlSchema,
  execute: async (input: MyFeatureControlInput) => executeMyFeatureControl(input, context),
},

If the tool should be available to the Telegram/memory profiles, also add it to the relevant branch in createChatTools (the telegram profile object or MEMORY_TOOL_NAMES). Tools default to the "all" profile.

C. Mark Execution Side (src/shared/tools/serverExecuted.ts)

If (and only if) the tool is server-executed, add it to TOOL_EXECUTION_METADATA with execution: "server". The client uses SERVER_EXECUTED_TOOL_NAME_SET to skip client dispatch for these (it returns early without running a handler).

typescript
export const TOOL_EXECUTION_METADATA = [
  // ...
  { name: "myFeatureControl", execution: "server" },
] as const;

Client-executed tools do NOT go here.


D. Client Handler (client-executed tools only)

Create src/apps/chats/tools/myFeatureHandler.ts. The handler reads/writes Zustand stores and reports a result through context.addToolOutput.

typescript
import type { ToolContext } from "./types";
import { useMyFeatureStore } from "@/stores/useMyFeatureStore";
import { useAppStore } from "@/stores/useAppStore";
import i18n from "@/lib/i18n";

export interface MyFeatureControlInput {
  action: "list" | "create" | "delete";
  id?: string;
  content?: string;
}

export const handleMyFeatureControl = (
  input: MyFeatureControlInput,
  toolCallId: string,
  context: ToolContext
): void => {
  const store = useMyFeatureStore.getState();
  try {
    switch (input.action) {
      case "list": {
        context.addToolOutput({
          tool: "myFeatureControl",
          toolCallId,
          output: JSON.stringify(store.items, null, 2),
        });
        break;
      }
      // create / delete ...
      default:
        context.addToolOutput({
          tool: "myFeatureControl",
          toolCallId,
          state: "output-error",
          errorText: i18n.t("apps.chats.toolCalls.unknownError"),
        });
    }
  } catch (error) {
    context.addToolOutput({
      tool: "myFeatureControl",
      toolCallId,
      state: "output-error",
      errorText: error instanceof Error ? error.message : "error",
    });
  }
};

Handler conventions (match existing handlers like stickiesHandler.ts):

  • Always emit exactly one addToolOutput per call — a success output string or an { state: "output-error", errorText }.
  • Localize user-facing strings via i18n.t(...) (apps.chats.toolCalls.*).
  • Open the relevant app first when a mutation should surface it (context.launchApp("myfeature") / guard with useAppStore.getState().getInstancesByAppId).
  • For list→mutate flows where the AI passes IDs back, use createShortIdMap / resolveId from ./helpers to keep token usage low.

ToolContext provides { launchApp, addToolOutput, detectUserOS }.

Show full SKILL.md (220 more words)Show less

E. Wire the Client Dispatch

  1. In src/apps/chats/tools/index.ts, export the handler and its input type.
  2. In src/apps/chats/tools/dispatchToolCall.ts (shared by the Chats app and the desktop assistant), add a case to the switch (toolCall.toolName):
typescript
case "myFeatureControl": {
  handleMyFeatureControl(
    toolCall.input as MyFeatureControlInput,
    toolCall.toolCallId,
    toolContext
  );
  result = ""; // handler already called addToolOutput
  break;
}

Dispatch is an explicit switch — there is no handler registry. Add the case, otherwise the tool falls through to the default branch and reports "Unhandled tool". Set result = "" when the handler emits its own output (return a non-empty string only for trivial tools that don't call addToolOutput). VFS tools (list/open/read/write/edit) live in vfsHandlers.ts and receive a VfsToolContext with saveFile + recordOpenedInstance.

F. Server Executor (server-executed / dual tools)

Add executeMyFeatureControl(input, context) to executors.ts (or app-state-executors.ts for app-state tools), export it from api/chat/tools/index.ts, and reference it in the tool's execute. The executor receives the server context (MemoryToolContext: logging, env, redis/auth helpers) and must return a JSON-serializable result.

For tools that return images to the model (like infiniteMacControl's readScreen), add a toModelOutput that converts the result into multimodal content.


Testing

  • Schema (fast, no server): add a tests/unit/<domain>/test-<feature>-schema.test.ts that safeParses valid and invalid inputs (see tests/unit/media/test-media-control-unified.test.ts). Unit suites are auto-discovered. See the write-tests skill.
  • Server executor: cover via the AI endpoint suite (test:ai) where applicable.
  • Client handler / end-to-end: exercise in the Chats app by asking Ryo to use the capability and confirming the store/app updates and the tool result bubble.

Checklist

- [ ] Schema in api/chat/tools/schemas.ts (+ shared enums in types.ts)
- [ ] Description in TOOL_DESCRIPTIONS + entry in createChatTools (right profile)
- [ ] If server-executed: add to TOOL_EXECUTION_METADATA (serverExecuted.ts) + write executor
- [ ] If client-executed: handler in src/apps/chats/tools/ + export + switch case in useAiChat.ts
- [ ] Localize tool-call strings (apps.chats.toolCalls.*)
- [ ] Schema unit test in tests/ (registered in test:unit)

© ryokun6, AGPL-3.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .cursor/skills/add-ai-chat-tool of ryokun6/ryos.

Open the folder on GitHubat commit d989f4d

Compare with similar skills

Add AI Chat Tool 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.

Add AI Chat Tool compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Add AI Chat Tool this skillryokun6/ryos1.3k—~2.2kAutomated safety check: PassAGPL-3.0
AI SDK Developmenttrypostit/trypost6911 repos~3.5kAutomated safety check: PassMIT
Spring AI Integrationrrezartprebreza/spring-boot-skills301—~2.5kAutomated safety check: PassMIT
LLM Generation Workflowslobehub/lobehub83k—~1.1kAutomated safety check: PassCustom licence
Langchain Middlewarelangchain-ai/langchain-skills1.3k—~2.7kAutomated safety check: PassMIT
LLM Structured Outputsickn33/agentic-awesome-skills47k2 repos~3.9kAutomated safety check: PassMIT

Similar skills

  • AI SDK Development

    trypostit/trypost

    TRIGGER when working with ai-sdk which is Laravel official first-party AI SDK.

    691 GitHub starsUsed in 1 repo~3.5k tokens
    AI & LLM EngineeringAuto-check passed
  • Spring AI Integration

    rrezartprebreza/spring-boot-skills

    A skill your agent uses when integrating LLMs, chat clients, embeddings, RAG pipelines, or AI agents into Spring Boot.

    301 GitHub stars~2.5k tokensUpdated 19 days ago
    AI & LLM EngineeringAuto-check passed
  • Implements business-facing LLM calls as explicit, traceable workflows, keeping prompt versions, model policy, structured output and tracing scenarios in separate places.

    83k GitHub stars~1.1k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Langchain Middleware

    langchain-ai/langchain-skills

    Official

    INVOKE THIS SKILL when you need human-in-the-loop approval, custom middleware, or structured output.

    1.3k GitHub stars~2.7k tokensUpdated 2 days ago
    AI & LLM EngineeringAuto-check passed
  • LLM Structured Output

    sickn33/agentic-awesome-skills

    Get reliable JSON, enums, and typed objects from LLMs using responseformat, tooluse, and schema-constrained decoding across OpenAI, Anthropic, and Google APIs.

    47k GitHub starsUsed in 2 repos~3.9k tokens
    AI & LLM EngineeringAuto-check passed
  • Local AI Agents

    microsoft/ai-agents-for-beginners

    Official

    Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models.

    77k GitHub stars~1.3k tokensUpdated yesterday
    AI & LLM EngineeringAuto-check passed

More from ryokun6/ryos

All 10 skills in this repo
  • Create Ryos App

    ryokun6/ryos

    Create new applications for ryOS following established patterns and conventions.

    1.3k GitHub stars~3.7k tokensUpdated yesterday
    Auto-check passed
  • Create Store

    ryokun6/ryos

    Create or modify ryOS Zustand stores following repo conventions — persist middleware, partialize, versioned migrations, the debounced write-behind storage adapter for large slices, and cloud-sync…

    1.3k GitHub stars~2.1k tokensUpdated yesterday
    Auto-check passed
  • Desktop Release

    ryokun6/ryos

    Cut and publish ryOS Electron desktop releases on GitHub. An agent skill from ryokun6/ryos.

    1.3k GitHub stars~1k tokensUpdated yesterday
    Auto-check: notes
  • Localize

    ryokun6/ryos

    Localize ryOS apps and components by extracting hardcoded strings, replacing with translation keys, and syncing across languages.

    1.3k GitHub stars~1.2k tokensUpdated yesterday
    Auto-check passed
  • React performance optimization guidelines from Vercel Engineering (vercel-labs/agent-skills).

    1.3k GitHub stars~2k tokensUpdated yesterday
    Auto-check passed
  • UI Design Styling

    ryokun6/ryos

    Design and style ryOS UI using the current OS theme token system, Tailwind variants, shared primitives, Aqua Glass, dark mode, and accent conventions.

    1.3k GitHub stars~3.1k tokensUpdated yesterday
    Auto-check passed

Works with

Questions about Add AI Chat Tool

What does Add AI Chat Tool do?

Add or modify an AI chat tool ("Ask Ryo" capability) in ryOS. Add AI Chat Tool is an agent skill from ryokun6/ryos. Add or modify an AI chat tool ("Ask Ryo" capability) in ryOS.

When should I use Add AI Chat Tool?

Add AI Chat Tool fits situations like: giving the AI a new capability; adding a tool to the chat agent; editing chat/tool schemas.

How do I install Add AI Chat Tool in Claude Code?

Run `npx skills add ryokun6/ryos --skill add-ai-chat-tool -a claude-code`. Or copy the skill folder (.cursor/skills/add-ai-chat-tool in ryokun6/ryos) into .claude/skills/add-ai-chat-tool in your project. Claude Code loads it when a task matches its description.

How do I install Add AI Chat Tool in Codex?

Run `npx skills add ryokun6/ryos --skill add-ai-chat-tool -a codex`. Or copy the skill folder (.cursor/skills/add-ai-chat-tool in ryokun6/ryos) into .agents/skills/add-ai-chat-tool in your project. Codex loads it when a task matches its description.

Can I use Add AI Chat Tool in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ryokun6/ryos --skill add-ai-chat-tool -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/add-ai-chat-tool, .gemini/skills/add-ai-chat-tool, .github/skills/add-ai-chat-tool and .opencode/skills/add-ai-chat-tool in your project.

What does Add AI Chat Tool need to run?

SKILL.md names no scripts, command-line tools or credentials: Add AI Chat Tool is instructions for the agent only.

Does Add AI Chat Tool access the network?

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.

Is Add AI Chat Tool safe to install?

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.

What licence does Add AI Chat Tool use?

Add AI Chat Tool is published under the AGPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Add AI Chat Tool use?

About 2.2k tokens (SKILL.md is roughly 8.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Add AI Chat Tool?

Skills that share tags, products or a category with Add AI Chat Tool: AI SDK Development (trypostit/trypost, 691 stars), Spring AI Integration (rrezartprebreza/spring-boot-skills, 301 stars), LLM Generation Workflows (lobehub/lobehub, 83k stars) and Langchain Middleware (langchain-ai/langchain-skills, 1.3k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Add AI Chat Tool?

ryokun6 (a GitHub user) maintains it in ryokun6/ryos, which has 1,263 GitHub stars. The repository holds 10 skills in this directory. The repository was last updated on October 9, 2026.

Source: ryokun6/ryos on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.