feat(ms22-p2): seed default agent templates (jarvis, builder, medic)
Some checks failed
ci/woodpecker/push/ci Pipeline failed

This commit is contained in:
2026-03-04 19:41:25 -06:00
parent 29cc37f8df
commit 22e08e4ef2
2 changed files with 66 additions and 0 deletions

View File

@@ -7,6 +7,7 @@ import {
EntryStatus, EntryStatus,
Visibility, Visibility,
} from "@prisma/client"; } from "@prisma/client";
import { seedAgentTemplates } from "../src/seed/agent-templates.seed";
const prisma = new PrismaClient(); const prisma = new PrismaClient();
@@ -586,6 +587,9 @@ This is a draft document. See [[architecture-overview]] for current state.`,
console.log(`Created ${links.length} knowledge links`); console.log(`Created ${links.length} knowledge links`);
}); });
// Seed default agent templates (idempotent)
await seedAgentTemplates(prisma);
console.log("Seeding completed successfully!"); console.log("Seeding completed successfully!");
} }

View File

@@ -0,0 +1,62 @@
import type { PrismaClient } from "@prisma/client";
const AGENT_TEMPLATES = [
{
name: "jarvis",
displayName: "Jarvis",
role: "orchestrator",
personality: `# Jarvis - Orchestrator Agent\n\nYou are Jarvis, the orchestrator and COO. You plan, delegate, and coordinate. You never write code directly — you spawn workers. You are direct, capable, and proactive. Your job is to get things done without hand-holding.\n\n## Core Traits\n- Direct and concise\n- Resourceful — figure it out before asking\n- Proactive — find problems to solve\n- Delegator — workers execute, you orchestrate`,
primaryModel: "opus",
fallbackModels: ["sonnet"],
toolPermissions: ["read", "write", "exec", "browser", "web_search", "memory_search"],
discordChannel: "jarvis",
isActive: true,
isDefault: true,
},
{
name: "builder",
displayName: "Builder",
role: "coding",
personality: `# Builder - Coding Agent\n\nYou are Builder, the coding agent. You implement features, fix bugs, and write tests. You work in worktrees, follow the E2E delivery protocol, and never skip quality gates. You are methodical and thorough.\n\n## Core Traits\n- Works in git worktrees (never touches main directly)\n- Runs lint + typecheck + tests before every commit\n- Follows the Mosaic E2E delivery framework\n- Never marks a task done until CI is green`,
primaryModel: "codex",
fallbackModels: ["sonnet", "haiku"],
toolPermissions: ["read", "write", "exec"],
discordChannel: "builder",
isActive: true,
isDefault: true,
},
{
name: "medic",
displayName: "Medic",
role: "monitoring",
personality: `# Medic - Health Monitoring Agent\n\nYou are Medic, the health monitoring agent. You watch services, check deployments, alert on anomalies, and verify system health. You are vigilant, calm, and proactive.\n\n## Core Traits\n- Monitors service health proactively\n- Alerts clearly and concisely\n- Tracks uptime and deployment status\n- Never panics — diagnoses methodically`,
primaryModel: "haiku",
fallbackModels: ["sonnet"],
toolPermissions: ["read", "exec"],
discordChannel: "medic-alerts",
isActive: true,
isDefault: true,
},
];
export async function seedAgentTemplates(prisma: PrismaClient): Promise<void> {
for (const template of AGENT_TEMPLATES) {
await prisma.agentTemplate.upsert({
where: { name: template.name },
update: {},
create: {
name: template.name,
displayName: template.displayName,
role: template.role,
personality: template.personality,
primaryModel: template.primaryModel,
fallbackModels: template.fallbackModels,
toolPermissions: template.toolPermissions,
discordChannel: template.discordChannel,
isActive: template.isActive,
isDefault: template.isDefault,
},
});
}
console.log("✅ Agent templates seeded:", AGENT_TEMPLATES.map((t) => t.name).join(", "));
}