import { Agent } from "oncell";
const agent = new Agent("engineer", {
instructions: "You are a senior software engineer.",
model: "kimi-k3",
skills: {
design: {
when: "Architecture or system design needed",
guide: "Think step by step. Write a design doc before code.",
model: "claude-opus",
},
code: {
when: "Writing or editing code",
guide: "Write clean code. Run tests after every change.",
},
review: {
when: "Reviewing code for correctness",
guide: "Read carefully. Check edge cases.",
model: "claude-opus",
},
},
tools: ["files", "shell"],
});
agent.task("build", async ({ prompt }) => {
return agent.llm(prompt, { maxSteps: 50, maxCost: 5.00 });
});
agent.task("fix", async ({ repo, issue }) => {
await agent.shell(`git clone https://github.com/${repo}.git .`);
return agent.llm(issue, { maxSteps: 50, maxCost: 5.00 });
});
export default agent;