create-agent

Scaffolds a modular TypeScript AI agent using the OpenRouter SDK with hooks and optional Ink TUI.

2|1|Updated Jun 9, 2026
One-click install
npx skills add https://github.com/zester4/zilmate --skill create-agent-zester4
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: create-agent
Source: https://github.com/zester4/zilmate/tree/main/.agents/skills/create-agent
Command: npx skills add https://github.com/zester4/zilmate --skill create-agent-zester4

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @openrouter/sdk, zod, eventemitter3, ink, react, typescript, tsx.

What problem does it solve? Building an AI agent from scratch requires wiring together model access, streaming, tool calling, and UI layers, which is repetitive and error-prone. This Skill provides a complete, working architecture so you can bootstrap a functional agent in minutes instead of assembling boilerplate yourself. ## Core Features & Use Cases - Standalone Agent Core: An EventEmitter-based Agent class with lifecycle hooks (stream, tool calls, reasoning, errors) that runs independently of any UI. - OpenRouter SDK Integration: Unified access to 300+ language models with items-based streaming, tool definitions via Zod schemas, and dynamic model discovery through the Models API. - Optional Ink TUI and Headless Modes: Includes a terminal chat interface built with Ink/React plus a headless example for programmatic use, HTTP servers, or Discord bots. - Use Case: You want to build a Discord support bot backed by Claude. Use this Skill to generate the agent core, register custom tools, and connect the sendSync method to Discord message events. ## Quick Start Ask the agent to scaffold a new OpenRouter-powered TypeScript agent project with tools and a terminal chat interface in a folder called my-agent.

Frequently Asked Questions about create-agent

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build an AI agent with the OpenRouter SDK?

Create an Agent class wrapping the OpenRouter client's callModel method, pass tools defined with Zod schemas, and consume responses via getItemsStream for streaming. This Skill provides the complete agent.ts, tools.ts, and interface implementations.

How does items-based streaming work in the OpenRouter SDK?

Items are emitted multiple times with the same ID but progressively updated content, so you replace items by ID in a Map rather than accumulating chunks. This handles concurrent outputs like function calls and messages streaming in parallel.

Can I use the agent without a terminal UI?

Yes, the agent core runs independently of any interface. Use the headless example or the sendSync method to integrate it with Express HTTP servers, Discord bots, or any Node.js application.

How do I add custom tools to an OpenRouter agent?

Define tools with the SDK's tool function using a Zod input schema and an async execute function, then pass them in the agent config or register them at runtime with addTool. The agent emits tool:call and tool:result events during execution.

Which OpenRouter model should I use for my agent?

Avoid hardcoding model IDs since they change frequently. Query the Models API at openrouter.ai/api/v1/models to filter by author, context length, or price, or use openrouter/auto to automatically select a suitable model.