create-headless-agent
БесплатноЗапускает вложенные скриптыНе проверенScaffolds a headless agent in TypeScript using @openrouter/agent and Bun — for CLI tools, API servers, queue workers, and pipelines. No terminal UI. Use when…
от OpenRouterTeam★ 334 звезды на GitHubОб этом скилле
Create Headless Agent
Scaffolds a headless agent in TypeScript targeting OpenRouter. The generated project uses @openrouter/agent for the inner loop (model calls, tool execution, stop conditions) and provides a clean programmatic shell: configuration, session management, tool definitions, and one or more entry points (CLI, HTTP server, MCP server, or library import). No terminal UI, no readline, no ANSI — just input in, result out.
Prerequisites
- Bun 1.1+
OPENROUTER_API_KEYfrom openrouter.ai/settings/keys- For full SDK reference, see the
openrouter-typescript-sdkskill
Decision Tree
| User wants to... | Action |
|---|---|
| Build a new headless agent | Present checklist below, follow Generation Workflow |
| Add tools to an existing agent | Read references/tools.md, present tool checklist only |
| Add a module | Read references/modules.md, generate the module |
| Add an entry point | Read references/entry-points.md, generate it |
Interactive Feature Checklist
Present this as a multi-select checklist. Items marked ON are pre-selected defaults.
Entry Points (pick one or more)
| Entry Point | Default | Description |
|---|---|---|
| CLI | ON | args/stdin to agent to stdout, --json for NDJSON |
| Library module | ON | import { runAgent } from './agent' |
| HTTP server | OFF | Bun.serve() with SSE streaming |
| MCP server | OFF | Expose as MCP tool via stdio |
OpenRouter Server Tools (server-side, zero implementation)
| Tool | Type string | Default |
|---|---|---|
| Web Search | openrouter:web_search |
ON |
| Web Fetch | openrouter:web_fetch |
ON |
| Datetime | openrouter:datetime |
ON |
| Image Generation | openrouter:image_generation |
OFF |
Server tools go in the tools array alongside user-defined tools. No client code needed — OpenRouter executes them. Docs: openrouter.ai/docs/guides/features/server-tools.
User-Defined Tools (client-side, generated into src/tools/)
| Tool | Default | Description |
|---|---|---|
| File Read | ON | Read files with offset/limit |
| File Write | ON | Write/create files inside the working directory, auto-create directories |
| File Edit | ON | Search-and-replace with diff validation, inside the working directory |
| Glob/Find | ON | File discovery by glob pattern |
| Grep/Search | ON | Content search by regex |
| Directory List | ON | List directory contents |
| Shell/Bash | ON | Execute commands with timeout and output capture; refuses unless run with --allow-shell, and is not confined to the working directory once allowed |
| Custom Tool Template | ON | Empty skeleton for domain-specific tools |
| JS/TS REPL | OFF | Persistent Bun REPL |
| Sub-agent Spawn | OFF | Delegate tasks to child agents |
| View Image | OFF | Read local images as base64 |
Agent Modules (architectural components)
| Module | Default | Description |
|---|---|---|
| Session Persistence | ON | JSONL conversation log, --no-session to disable |
| Retry with Backoff | ON | Built into agent.ts |
| Context Compaction | OFF | Summarize when context is long |
| Tool Result Offload | OFF | Persist oversized tool outputs to disk, keep preview in context |
| System Prompt Composition | OFF | Dynamic instructions from context files |
| Tool Approval Flow | OFF | Programmatic approve/reject |
| Structured Event Logging | OFF | JSON events to stderr |
| Output Schema Validation | OFF | Zod schema constraining response |
| Webhook Notifications | OFF | POST on completion |
CLI Output Mode (single-select, if CLI entry point is ON)
| Mode | Default | Description |
|---|---|---|
| Text | ON | Final response text to stdout |
| JSON | OFF | NDJSON event stream |
| Quiet | OFF | Exit code only |
Generation Workflow
Before generating, ask the user what to name their agent. This name is used as:
- the
"name"field inpackage.json - the
"bin"command (sobun linkmakes it a globally-invokable CLI) - the project directory name (if creating a new directory)
Suggested question: "What would you like to call your agent? (short kebab-case, e.g. research-bot or docs-helper)". Validate the answer is a valid npm package name (lowercase, kebab-case, no spaces). Default to my-agent if the user has no preference. Use the chosen name everywhere the workflow below shows <agent-name>.
After getting the name and checklist selections, follow this workflow:
- [ ] Generate package.json with name=<agent-name> and bin={"<agent-name>": "src/cli.ts"}
- [ ] Generate tsconfig.json (Bun-native)
- [ ] Generate src/config.ts
- [ ] Generate src/tools/index.ts wiring selected tools
- [ ] Generate selected tool files in src/tools/ (specs in references
Установить create-headless-agent в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл create-headless-agent?
Scaffolds a headless agent in TypeScript using @openrouter/agent and Bun — for CLI tools, API servers, queue workers, and pipelines. No terminal UI. Use when building a headless agent, programmatic agent, CLI tool that uses AI, batch agent, pipeline agent, API agent, agent without a UI, or agent service.
Как установить скилл create-headless-agent?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл create-headless-agent запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic