Loading...
Loading...
MUST be used whenever adding a task/todo list feature to a Dune app with Atlas chat. Do NOT manually create todo state management or tool definitions — this skill handles the full module (context, provider, tool, hooks, UI components) and all integration wiring. Prerequisite: integrate-atlas-chat must already be set up. Triggers: todo list, task list, task tracking, TodoWrite, todo panel, task panel, progress tracking, add todos, add tasks.
npx skill4agent add cognitedata/dune-skills integrate-todo-listTodoWriteintegrate-atlas-chatuseAtlasChat@cognite/dune-industrial-components@sinclair/typeboxajvajv-formatspackage.json@tabler/icons-reactsrc/App.tsxTodoProvideruseAtlasChatsrc/chat/useChatViewModel.tssrc/App.tsxTodoPanelTodoToolResultCardsrc/todo/find . -path "*/.agents/skills/integrate-todo-list/code" -type d<skill-dir>/code/src/todo/| File | Purpose |
|---|---|
| |
| React context + |
| Hook to read/write the todo list |
| |
| Hook that memoizes the tool with current state access |
| Card UI: progress bar + task rows |
| Single row with animated status icons |
| Compact summary card for tool call display |
./types./TodoContextTodoProvidersrc/App.tsx<TodoProvider>import { TodoProvider } from './todo/TodoContext'; // adjust path to match app conventions
function App() {
return (
<TodoProvider>
{/* existing children */}
</TodoProvider>
);
}useAtlasChatuseAtlasChatimport { useRef, useCallback } from 'react';
import { useTodoList } from './todo/useTodoList';
import { useTodoWriteTool } from './todo/useTodoWriteTool';
// Inside the hook/component:
const { todos, setTodos } = useTodoList();
const todoWriteTool = useTodoWriteTool();
// Keep a ref so getAppContext always reads fresh state without re-creating the callback.
const todosRef = useRef(todos);
todosRef.current = todos;
const getAppContext = useCallback(() => {
const t = todosRef.current;
if (t.length === 0) return undefined;
const lines = t.map((item, i) => `${i + 1}. [${item.status}] ${item.content}`);
return `Current todo list:\n${lines.join('\n')}`;
}, []);
// Add to useAtlasChat options:
const { messages, send, isStreaming, progress, error, reset, abort } = useAtlasChat({
client: isLoading ? null : sdk,
agentExternalId: AGENT_EXTERNAL_ID,
tools: [todoWriteTool], // add alongside any existing tools
getAppContext,
});
// In the reset handler, clear the todo list:
const handleReset = useCallback(() => {
reset();
setTodos([]);
}, [reset, setTodos]);
// Expose todos in the return value so the view can render TodoPanel:
return { ..., todos };TodoPanel<TodoPanel>import { TodoPanel } from './todo/TodoPanel'; // adjust path
// In the render:
<TodoPanel todos={todos} />
<YourChatInput ... />TodoPanelnullTodoToolResultCardimport { TodoToolResultCard } from './todo/TodoToolResultCard'; // adjust path
{toolCalls.map((tc, i) =>
tc.name === 'TodoWrite' ? (
<TodoToolResultCard key={i} toolCall={tc} />
) : (
<YourDefaultToolCallCard key={i} toolCall={tc} />
)
)}pnpm tsc --noEmitTodoWritependingin_progresscompletedgetAppContext