templates/analytics/.agents/skills/delegate-to-agent/SKILL.md
How to delegate all AI work to the agent chat. Use when delegating AI work from UI or scripts to the agent, when tempted to add inline LLM calls, or when sending messages to the agent from application code.
npx skillsauth add BuilderIO/agent-native delegate-to-agentInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
The UI and server never call an LLM directly. All AI work is delegated to the agent through the chat bridge.
The agent is the single AI interface. It has context about the full project, can read/write the database, and can run scripts. Inline LLM calls bypass this — they create a shadow AI that doesn't know what the agent knows and can't coordinate with it.
From the UI (client):
import { sendToAgentChat } from "@agent-native/core";
sendToAgentChat({
message: "Generate a summary of this document",
context: documentContent, // optional hidden context (not shown in chat UI)
submit: true, // auto-submit to the agent
});
From scripts (Node):
import { agentChat } from "@agent-native/core";
agentChat.submit("Process the uploaded images and create thumbnails");
From the UI, detecting when agent is done:
import { useAgentChatGenerating } from "@agent-native/core";
function MyComponent() {
const isGenerating = useAgentChatGenerating();
// Show loading state while agent is working
}
submit vs PrefillThe submit option controls whether the message is sent automatically or placed in the chat input for user review:
| submit value | Behavior | Use when |
| -------------- | --------------------------------------- | ----------------------------------------------------------------------------------- |
| true | Auto-submits to the agent immediately | Routine operations the user has already approved |
| false | Prefills the chat input for user review | High-stakes operations (deleting data, modifying code, API calls with side effects) |
| omitted | Uses the project's default setting | General-purpose delegation |
// Auto-submit: routine operation
sendToAgentChat({ message: "Update the project summary", submit: true });
// Prefill: let user review before sending
sendToAgentChat({
message: "Delete all projects older than 30 days",
submit: false,
});
import Anthropic from "@anthropic-ai/sdk" in client or server codeimport OpenAI from "openai" in client or server codegenerateText(), streamText(), etc.Scripts may call external APIs (image generation, search, etc.) — but the AI reasoning and orchestration still goes through the agent. A script is a tool the agent uses, not a replacement for the agent.
pnpm action <name> to perform complex operationstools
Public booking flow — the state machine, animations, and URL/app-state sync.
tools
Trigger-based automations — reminders, follow-ups, webhooks — across the booking lifecycle.
tools
Team event types, round-robin assignment, collective bookings, host weights, and no-show calibration.
development
The pure `computeAvailableSlots` function — inputs, outputs, invariants, and debugging guide.