Subagents
Define specialist agents with prompts, tools, and per-harness model hints.
On this page
Subagents package a focused prompt under a name so the primary agent can delegate. Claude and OpenCode receive markdown agents, Codex receives developer instructions, and unsupported harnesses emit warnings.
plugin.ts
import { definePlugin, defineSubagent } from "@jalco/ap-sdk";
export default definePlugin({
id: "review-team",
description: "Specialist review agents.",
subagents: [
defineSubagent({
name: "security-reviewer",
description: "Reviews diffs for auth, secrets, and injection risks.",
prompt: "You are a security reviewer. Lead with blockers.",
tools: ["Read", "Grep", "Bash"],
harness: {
claude: { model: "sonnet" },
codex: { model: "gpt-5" },
opencode: { model: "gpt-5", mode: "subagent" },
gemini: { model: "gemini-3-pro", temperature: 0.2, maxTurns: 8 },
copilot: { model: "gpt-5" },
},
}),
],
});Fields
nameanddescriptionidentify and route the agent.promptmaps to Claude/OpenCode body text and Codexdeveloper_instructions.toolsis honored by Claude Code.frontmatteris emitted for YAML-frontmatter harnesses; Codex TOML ignores it.harnesssets target-specific model and behavior hints, including Geminitemperature/maxTurnsand OpenCodemode(primary,subagent,all).
Next: hooks and the support matrix.
On this page