Harness Intelligence Wiki
HarnessSkills and Packs

Subagent Templates

How the authored subagent manifest defines scoped specialists and how hi update renders them for four harnesses

Subagent templates follow the project shape.

A useful specialist replaces job-title prompting with repository facts: which workspace it owns, which skills it must use, which scoped guidance it reads first, and which boundaries it keeps. The specialist starts from the detected workspaces, not from an imaginary org chart.

The Manifest Is The Source

One authored file defines every specialist: .agents/subagents/manifest.mjs.

  • hi init writes a starter manifest once, only when it is absent. hi never overwrites it.
  • hi update also writes a built tailoring guide, .agents/subagents/manifest.prompt.md. Its only inputs are the detected workspaces (shape.workspaces) and the selected packs (settings.packs).
  • The agent tailors the manifest from that guide. Step 1 of the guide, and of the post-command handoff, activates writing-for-agents before any edit.
  • The tailoring steps add one specialist per workspace, keep the shipped workflow and review specialists, and include simplify in every implementation specialist.

The manifest must be one self-contained module that exports agents and capabilityPacks. It cannot use relative imports.

Generated Agent Files

hi update renders every specialist into an agent file for each of four harnesses. The fixed set is always all four:

HarnessAgent fileSkills field
Claude.claude/agents/<name>.mdskills: list
Codex.codex/agents/<name>.tomlone [[skills.config]] path per skill
Cursor.cursor/agents/<name>.mdnone
OpenCode.opencode/agents/<name>.mdnone

Each file carries a "Generated by hi ... Edit manifest.mjs, then run hi update" marker. The body inlines the specialist's ownership, capability packs, boundaries, activation instructions, and the full text of each guidanceFiles entry. A missing guidance file becomes a placeholder that tells the agent to author that scoped AGENTS.md and its CLAUDE.md link, then run hi update.

Skills install once, under .agents/skills/. Only Claude gets a skills symlink (.claude/skills); Codex, Cursor, and OpenCode read .agents/skills directly.

Template Contract

Each entry in agents uses these fields:

FieldPurpose
nameFile-name-safe id; it names the four agent files.
descriptionWhen the parent should delegate to this specialist.
ownedPathsThe paths it may edit, or its readonly research boundary.
guidanceFilesScoped AGENTS.md files that the agent file inlines.
activationInstructionsA flat list of instructions, for example how to activate skills from scoped ## Skills tables.
boundariesWhat the specialist must not do, and when to hand back to the parent.
packsCapability packs from the manifest's own capabilityPacks.
skillsOptional. When present, it replaces the skills of its packs; it does not extend them.

capabilityPacks is a top-level map in the manifest. These capability packs are local to the manifest and are not the HI packs that hi init selects. The starter defines review-core, workflow-planning, workflow-requirements, and workflow-review.

For readonly work, specialists can support aggressive parallel research, because the output is evidence and findings. For write work, ownership must be narrow enough that two workers cannot silently edit the same surface from different assumptions.

Specialists Follow Surfaces

Repository facts determine the specialist set. Some repositories need Next.js UI workers, Effect backend workers, docs workers, or validation support. Other repositories leave those specialists out.

Expertise has to be backed by context. "Next.js worker" is useful only when it carries Next.js skills, owned Next.js paths, and relevant scoped guidance. Without that context it collapses back into persona prompting.

The starter code-review specialist is readonly for the same reason. It can range across changed code because it produces findings, risks, missing tests, and scoped-guidance violations, not edits.

Root prompt guidance also routes split-friendly readonly orientation through parallel-research. Use it when independent evidence sources, subsystems, docs, backlog items, or hypotheses can be inspected in parallel. Keep code-writing and tightly coupled debugging in the main thread unless ownership can be split cleanly.

Default Workflow Archetypes

The starter manifest ships specialists that support repeated inner steps of Harness skills rather than repo-specific implementation surfaces. They keep the parent thread small, while the parent keeps decisions, user interaction, artifact writes, and provider sync.

ArchetypeUsed for
code-reviewReadonly findings-first review of changed code, simplification, and architecture friction.
planning-discoveryReadonly orientation before spec or plan writing.
requirements-synthesizerReadonly compression of grill status and log artifacts into accepted and unresolved choices.
backlog-shaperDraft-only shaping of Epics, Stories, and Tasks from closed requirements. The starter text still says "module, epic, and story".
spec-reviewerReadonly review of drafted specs before the spec is retained.
plan-reviewerReadonly review of plan dependencies, task shape, validation, and assigned skills.

These archetypes are not substitutes for phase skills. swarm-planner remains a planner skill that create-plan composes, not a subagent template. UX research is not a default archetype; design and product research belong to the relevant frontend or product-specific pack when a repository has that surface.

Drift And Safety

To change specialists, edit manifest.mjs (follow manifest.prompt.md), keep it import-free, and run hi update. Do not edit the files under .claude/agents, .codex/agents, .cursor/agents, or .opencode/agents; the next hi update overwrites them. Until then, hi diff reports an agent file that differs from the manifest render as stale.

Template drift is also visible when workers overlap in write ownership, stop citing evidence, ignore required skills, or match no workspace. Fix the manifest or the scoped guidance, then run hi update.

Spawn fewer, better-scoped workers. Each one should carry the right local context before it starts.

On this page