import { Agent } from "oncell";
const agent = new Agent("builder", {
instructions: `You are a fullstack app builder.
Use Vite + React. Write clean, working code.
Always run the dev server so the user can preview.`,
model: "kimi-k3",
image: "oncell/vite-react",
skills: {
design: {
when: "Planning the app structure or UI",
guide: "Think about UX. Plan components before coding.",
model: "claude-opus",
},
code: {
when: "Writing code",
guide: "Write working code. Use TypeScript. Test in browser.",
},
},
tools: ["files", "shell"],
});
agent.task("build", async ({ prompt }) => {
await agent.shell("npm create vite@latest app -- --template react-ts");
await agent.shell("cd app && npm install");
const result = await agent.llm(prompt, {
maxSteps: 50,
maxCost: 5.00,
});
await agent.shell("cd app && npm run dev");
return result;
});
export default agent;