← ClaudeAtlas

ai-agentlisted

Write, wire and test an in-process AI agent with @guren/plugin-ai (an Agent class that calls a language model and reaches the app through its .agent() routes). Use when the user asks to "add an AI feature", "call Claude/OpenAI from the app", "summarize/classify/triage with an LLM", "make an AI agent", "add a chat", or mentions app/Ai/Agents, config/ai.ts, appTools(), fakeAi() or make:ai-agent. Not for durable Workers agents (make:agent) or for exposing routes to external agents (agent-interface).
gurenjs/guren · ★ 30 · AI & Automation · score 77
Install: claude install-skill gurenjs/guren
# AI Agent Skill An in-process agent is a class under `app/Ai/Agents` that calls a model configured in `config/ai.ts`. It reaches the application **only** through `appTools()`, which turns the app's `.agent()` routes into model tools and runs every call through the same pipeline as the MCP endpoint: scopes, the route's validation and policies, approvals, and the audit trail. Nothing about a route is written twice. ## Setup (once per app) ```bash bunx guren add ai # config/ai.ts, the key in config/env.ts, aiPlugin(), conversation tables bunx guren add ai --provider openai # or gateway ``` It needs `config/env.ts`. The key is optional: the app boots without it and the first prompt fails. Do not remove the `if (!env.ANTHROPIC_API_KEY) throw` guard in `config/ai.ts`; without a key the provider SDK reads `process.env` and sends a blank key. ## Writing an agent ```bash bunx guren make:ai-agent TicketDigest --tools tickets_index --output --test ``` `--tools` fails if no route derives a name, so expose the route first (the `agent-interface` skill). Then check the generated class: ```typescript import { Agent, Output } from '@guren/plugin-ai' import { z } from 'zod' export class TicketDigest extends Agent<typeof TicketDigest.scopes> { static override agentName = 'ticket-digest' static override scopes = ['tool:tickets_index'] as const instructions = 'You write a short digest of the open support tickets for an operator.' output = Output.object