TEMPLATE

AutoWorker

Your 24/7 AI employee. Connects to GitHub, Slack, Jira, Email. Delivers finished work — PRs, docs, tickets, emails, reports. Like OpenWorker, but cloud-native.

agent.ts
import { Agent } from "oncell";
const agent = new Agent("autoworker", {
instructions: `You are AutoWorker — an AI employee that delivers
finished work. PRs, emails, tickets, docs, reports.
Ask for approval before anything consequential.`,
model: "kimi-k3",
skills: {
plan: { when: "Breaking down a task", model: "claude-opus",
guide: "Think step by step. Identify tools needed." },
write: { when: "Writing docs, emails, reports", model: "claude-opus",
guide: "Write clearly. Match team tone." },
code: { when: "Writing or editing code",
guide: "Minimal correct fix. Run tests." },
},
tools: ["files", "shell", "memory"],
});
// Universal task entry — describe what you want
agent.task("do", async ({ task }) => {
return agent.llm(task, { maxSteps: 50, maxCost: 5.00 });
});
// GitHub: fix bugs, review PRs, create issues
agent.task("github", async ({ action, repo, issue }) => {
if (action === "fix") {
await agent.shell(`git clone https://github.com/${repo}.git workspace`);
await agent.llm(`Fix: ${issue}. Repo at ./workspace.`,
{ maxSteps: 40, maxCost: 4.00 });
const ok = await agent.askHuman({ question: "Approve PR?" });
if (ok.approved) await agent.shell("cd workspace && gh pr merge --squash");
}
if (action === "review") {
const diff = await agent.shell(`gh pr diff ${issue} --repo ${repo}`);
const review = await agent.llm(`Review:\n${diff.stdout}`);
await agent.shell(`gh pr review ${issue} --repo ${repo} --comment --body "${review.text}"`);
}
});
// Morning brief — daily at 8am
agent.schedule("morning-brief", "daily 8am", async () => {
const tasks = await agent.memory.get("completed_tasks") || [];
return agent.llm("Generate morning brief from recent activity.",
{ maxSteps: 5, maxCost: 0.50 });
}, { maxCost: 1.00 });
// Auto-review new PRs via webhook
agent.onWebhook("/github", async ({ payload }) => {
if ((payload as any).action === "opened" && (payload as any).pull_request) {
const pr = (payload as any).pull_request;
const diff = await agent.shell(`gh pr diff ${pr.number}`);
await agent.llm(`Review this PR:\n${diff.stdout}`);
}
});
export default agent;

DEPLOY

$ npx oncell deploy autoworker
DEPLOY NOW

WHAT YOU GET

GitHub: fix, review, issue, PR
Slack: post, read, summarize
Email: draft and send
Daily morning brief
Weekly report
Webhook auto-triggers
Approval before anything consequential
$0 when idle