MUST be used whenever building a chat UI with Atlas agents in a Flows app. Do NOT manually write useAtlasChat integration code — this skill handles installation, component structure, and hook wiring. Triggers: useAtlasChat, atlas chat, streaming chat, agent chat, chat interface, chat component, chat UI. For a full chat app, run skills in order: (1) integrate-atlas-chat, (2) create-client-tool (per tool), (3) setup-python-tools (if Python tools needed).
71
88%
Does it follow best practices?
Impact
—
No eval scenarios have been run
Critical
Do not install without reviewing
Add a streaming Atlas Agent chat UI to this Flows app.
Agent external ID: $ARGUMENTS
The atlas-agent library files (copied in Step 2) require these npm packages:
| Package | Version |
|---|---|
@sinclair/typebox | ^0.33.0 |
ajv | ^8.17.1 |
ajv-formats | ^2.1.1 |
@cognite/sdk is assumed to already be present in Flows apps.
Complete these steps in order. Read each file before modifying it.
Read these files before touching anything:
package.json — detect package manager (packageManager field or lock file) and existing depssrc/App.tsx (or equivalent entry component) — understand current structureThe atlas-agent library lives in the code/ directory next to this skill file. Read and copy
the following files into src/atlas-agent/ inside the app:
code/types.tscode/validation.tscode/client.tscode/session.tscode/react.tsThe Python-related files (
python.ts,pyodide.ts,pyodide-react.ts,pyodide-runtime.ts) are only needed if the agent uses Python tools. Thesetup-python-toolsskill copies those.
Install the required peer packages (see Dependencies above) using the app's package manager:
pnpm add @sinclair/typebox@^0.33.0 ajv@^8.17.1 ajv-formats@^2.1.1npm install @sinclair/typebox@^0.33.0 ajv@^8.17.1 ajv-formats@^2.1.1yarn add @sinclair/typebox@^0.33.0 ajv@^8.17.1 ajv-formats@^2.1.1Replace (or create) the main App.tsx with a full chat UI. The component must:
useAtlasChat and ChatMessage from ./atlas-agent/react (relative to the component)useDune() from @cognite/dunenull while loading — client: isLoading ? null : sdkmsg.isStreaming with a blinking cursorprogress.startsWith("Executing:"), render it distinctly
(e.g. a ⚙ icon + monospace tool name) so tool calls are clearly visiblemessage.toolCalls (after streaming completes)
should appear as expandable cards beneath the messageisStreaming, wired to abort()reset()import { useAtlasChat } from "./atlas-agent/react";
import type { ChatMessage } from "./atlas-agent/react";
const { messages, send, isStreaming, progress, error, reset, abort } = useAtlasChat({
client: isLoading ? null : sdk, // null-safe — hook waits for a real client
agentExternalId: "...",
tools?: AtlasTool[], // optional client-side tools
});
// messages[n].role — "user" | "assistant"
// messages[n].text — full text (streams chunk-by-chunk via isStreaming)
// messages[n].isStreaming — true while this message is being written
// messages[n].toolCalls — ToolCall[] once response is complete (client + server-side, in call order)
// progress — e.g. "Agent thinking" or "Executing: get_timeseries"
// isStreaming — true for the entire duration of a response// During streaming — show as a distinct "tool call" bubble above the message
{isStreaming && progress?.startsWith("Executing:") && (
<div>⚙ {progress}</div>
)}
// After response — show tool calls on the assistant message
{msg.toolCalls?.map((tc, i) => (
<ToolResult key={i} name={tc.name} output={tc.output} details={tc.details} />
))}If the agent has Python tools (type runPythonCode in its CDF config), run the
setup-python-tools skill to add Pyodide-based client-side execution:
/setup-python-tools $ARGUMENTSThat skill copies the Python-related source files from @skills/integrate-atlas-chat/code,
installs pyodide, sets up usePyodideRuntime, and wires the runtime into
useAtlasChat via pythonRuntime. The library fetches Python tool code from the agent
config automatically — no PythonToolConfig entries needed.
You don't need this if the agent only uses built-in or regular client tools.
Start the app and you should see a streaming chat UI connected to Atlas Agent $ARGUMENTS.
d6af887
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.