☰
VSuite

@vsuite/targets

Per-target adapters that turn a rendered agent body into the agent file format of OpenCode, Claude Code, or GitHub Copilot, plus the OpenCode config merge. Non-goals: body content (@vsuite/templates), skill and MCP file output, and writing to disk (both in @vsuite/core).

This is a private, source-only workspace package (exports → ./src/index.ts). It is bundled into the @krizic/vsuite CLI and is not published to npm. Workspace consumers depend on it with "@vsuite/targets": "workspace:*".

Public API

Export Kind Signature Description
TargetAdapter type interface { id: TargetId; agentPath(agentId: string): string; render(input: AgentRenderInput): RenderResult } Adapter contract.
AgentRenderInput type interface { agent; body; model: ModelSettings; delegates; handoffs?; extraTools?; existingTools?; existingAgents? } Everything an adapter needs to render one agent.
ModelSettings type { model: string; effort?: string; reasoning?: string } Per-agent model settings.
RenderedOutput type A file to write, relative to the project root.
adapters const Record<TargetId, TargetAdapter> Adapter lookup by target id.
claudeCodeAdapter const TargetAdapter Claude Code agent files.
githubCopilotAdapter const TargetAdapter GitHub Copilot agent files.
openCodeAdapter const TargetAdapter OpenCode agent files.
openCodeTools const Partial<Record<AgentTool, readonly string[]>> Catalog tool → OpenCode tool names.
claudeCodeTools, githubCopilotTools, copilotMcpToolNames consts, function Neutral tool → target tool names.
targetWarningCodes const Codes of the named warnings adapters emit when a target cannot express a graph field.
mergeOpenCodeConfig function (existing: unknown, models: Record<string, ModelSettings>, instructions?: readonly string[], removedInstructions?: readonly string[]) => JsonObject Deep-merges agent.<id>.model (and reasoningEffort when reasoning is set) and pack instruction paths into an existing .opencode/opencode.json object; throws on non-object values.

Dependencies

  • Workspace: @vsuite/catalog, @vsuite/json.
  • Third-party: none.
  • Used by: @vsuite/core.

Output paths

Output paths per target (targetDirectories from @vsuite/catalog; agent paths from the adapters; the rest are produced by @vsuite/core):

Target Directory Agent file (adapter) Skill file Native / MCP config
opencode .opencode .opencode/agents/<id>.md .opencode/skills/<id>/SKILL.md .opencode/opencode.json
claude-code .claude .claude/agents/<id>.md .claude/skills/<id>/SKILL.md .mcp.json
github-copilot .github .github/agents/<id>.agent.md .github/skills/<id>/SKILL.md .vscode/mcp.json

Usage

import { adapters } from "@vsuite/targets";
 
const outputs = adapters["claude-code"].render({
  agent: { id: "docs-steward", description: "…", tools: ["read", "edit"], argumentHint: "…" },
  body: "## Identity\n…",
  model: { model: "sonnet" },
  delegates: [],
});

Testing

pnpm vitest run --project @vsuite/targets