harness-subagent
Skill16 starsChanged 7 months agoMITView on GitHub
Create and manage subagent entities in the agent-harness workspace. Invoke this skill when a user wants to define, scaffold, apply, or remove a subagent across Claude Code, OpenAI Codex, or GitHub Copilot.
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 0 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Use this skill to create and manage subagent entities in the agent-harness workspace.
- Very specific: line 71
When send: true is set, the handoff prompt submits automatically.
- Very specific: line 128
Only name and description are required in the canonical frontmatter.
- Very specific: line 240
After running npx harness apply, this produces:
- Very specific: line 267
Check .claude/agents/, .codex/config.toml, and .github/agents/ to verify the rendered output.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
/harness-subagent
Use this skill to create and manage subagent entities in the agent-harness workspace. A subagent is a specialized agent definition — with a name, description, optional tool restrictions, and an optional model override — that harness renders into provider-native agent configuration files for every enabled provider.
What is a subagent entity?
A subagent entity is a single canonical Markdown source file under .harness/src/subagents/<subagent-id>.md. It contains:
- Required YAML frontmatter:
nameanddescription - Optional frontmatter: provider-specific fields set via override sidecars (model, tools, handoffs)
- Body: Markdown prose that becomes the agent's system prompt
Harness renders one output artifact per enabled provider from that single source file. You edit the source once; all provider files stay in sync.
Provider output mapping
Claude Code
| Item | Value |
| Output path | .claude/agents/<subagent-id>.md |
| Format | Markdown with YAML frontmatter |
| Required frontmatter | name, description |
| Optional frontmatter | tools (string or string[]), model |
Claude Code loads agent files from .claude/agents/ at session start. Each file's description field tells Claude when to delegate to that agent. Claude routes tasks automatically, or the user can invoke an agent explicitly with @agent-<name> or the /agents command. Supported model values: sonnet, opus, haiku, a full model ID such as claude-sonnet-4-6, or inherit (default). Subagents run in isolated context windows and cannot spawn further subagents.
Official docs: https://code.claude.com/docs/en/sub-agents
OpenAI Codex CLI
| Item | Value |
| Output path | .codex/config.toml |
| Format | TOML, section [agents.<subagent-id>] |
| Required fields | description, developer_instructions (body) |
| Optional fields | model, model_reasoning_effort, nickname_candidates |
Harness writes all enabled subagents into .codex/config.toml under [agents.<id>] entries. The description drives when Codex routes to that agent role; the body becomes developer_instructions. Codex also supports standalone TOML agent files in .codex/agents/ (outside of harness management), which are auto-discovered and take precedence over same-named inline entries.
Official docs: https://developers.openai.com/codex/config-reference
GitHub Copilot
| Item | Value |
| Output path | .github/agents/<subagent-id>.agent.md |
| Format | Markdown with YAML frontmatter |
| Required frontmatter | description |
| Optional frontmatter | name, tools (string[]), model, handoffs, mcp-servers, target, disable-model-invocation, user-invocable |
Copilot discovers agent files in .github/agents/ at the repository level. The handoffs field is Copilot-specific and is supported in VS Code agent mode: it defines routing buttons that let users switch to another agent mid-conversation, optionally with a pre-filled prompt. Note: handoffs are currently not supported by the Copilot coding agent on GitHub.com — they are silently ignored there. Example handoff entry (VS Code only):
handoffs:
- label: "Start Implementation"
agent: implementation
prompt: "Now implement the plan outlined above."
send: trueWhen send: true is set, the handoff prompt submits automatically.
Official docs: https://docs.github.com/en/copilot/reference/custom-agents-configuration
Cursor
| Item | Value |
| Output path | .cursor/agents/<subagent-id>.md |
| Format | Markdown with YAML frontmatter |
| Required frontmatter | name, description |
| Optional frontmatter | model, readonly, is_background |
Cursor loads agent files from .cursor/agents/ (project) or ~/.cursor/agents/ (user). For compatibility, it also scans .claude/agents/ and .codex/agents/ (project-level) and their user-level equivalents. Project subagents take precedence when names conflict; .cursor/ takes precedence over .claude/ or .codex/.
The description field determines when the agent delegates to a subagent. Subagents can be invoked explicitly via /name syntax or automatically based on task complexity. The model field supports fast, inherit (default), or a specific model ID. When readonly: true, the subagent runs with restricted write permissions.
Cursor includes three built-in subagents (explore, bash, browser) that run automatically. Custom subagents cannot spawn further subagents (single-level only).
Official docs: https://docs.cursor.com/agent/subagents
Provider-specific frontmatter comparison
| Field | Claude Code | Codex CLI | GitHub Copilot | Cursor |
name | required | via TOML key | optional | required |
description | required | required | required | required |
tools | string or string[] | — | string[] | — |
model | optional | optional | optional | optional (fast, inherit, or model ID) |
readonly | — | — | — | optional (boolean) |
is_background | — | — | — | optional (boolean) |
developer_instructions | — | required (body) | — | — |
handoffs | — | — | optional (VS Code only) | — |
Provider-specific options (model, tools, handoffs) are set through override sidecar files, not in the canonical source frontmatter — see the Override sidecars section below.
Canonical source format
---
name: <human-readable display name>
description: <when this agent should be used — used by all providers>
---
You are a [role description]. When invoked:
1. [Step one]
2. [Step two]
3. [Step three]
Focus on [specific domain]. Do not [out-of-scope actions].Only name and description are required in the canonical frontmatter. The body becomes the agent's system prompt for all providers.
Override sidecars
To set provider-specific options (model, tools, handoffs), create or edit the generated override YAML files:
.harness/src/subagents/<subagent-id>.overrides.claude.yaml.harness/src/subagents/<subagent-id>.overrides.codex.yaml.harness/src/subagents/<subagent-id>.overrides.copilot.yaml
Example Claude override sidecar:
version: 1
options:
model: haiku
tools:
- Read
- Grep
- GlobExample Copilot override sidecar:
version: 1
options:
model: gpt-4o
tools:
- search
- fetch
handoffs:
- label: "Hand off to planner"
agent: planner
prompt: "Now create a plan based on the research above."Harness CLI commands
# Scaffold a new subagent source file and register it in manifest.json
npx harness add subagent <subagent-id>
# Preview what files will be generated (dry run)
npx harness plan
# Write all provider artifacts from current canonical sources
npx harness apply
# Watch sources and auto-apply on changes
npx harness watch
# Remove a subagent entity and its source files
npx harness remove subagent <subagent-id>
# Remove entity but keep source files on disk
npx harness remove subagent <subagent-id> --no-delete-sourceComplete example
Source file: .harness/src/subagents/code-reviewer.md
---
name: code-reviewer
description: Expert code review specialist. Reviews code for quality, security, and maintainability. Use proactively after writing or modifying code.
---
You are a senior code reviewer ensuring high standards of quality and security.
When invoked:
1. Run git diff to see recent changes
2. Focus on modified files
3. Begin review immediately without asking for clarification
Review checklist:
- Code is clear and readable
- Functions and variables are well-named
- No duplicated logic
- Proper error handling and input validation
- No exposed secrets or API keys
- Adequate test coverage
- Performance considerations addressed
Provide feedback organized by priority:
- Critical issues (must fix before merging)
- Warnings (should fix)
- Suggestions (consider improving)
Include specific examples of how to fix each issue. Do not modify files yourself.Override sidecar for Claude (.harness/src/subagents/code-reviewer.overrides.claude.yaml):
version: 1
options:
model: sonnet
tools:
- Read
- Grep
- Glob
- BashAfter running npx harness apply, this produces:
.claude/agents/code-reviewer.md— used by Claude Code- An entry in
.codex/config.tomlunder[agents.code-reviewer]— used by Codex .github/agents/code-reviewer.agent.md— used by GitHub Copilot
Typical workflow
# 1. Scaffold the subagent source
npx harness add subagent code-reviewer
# 2. Edit the source file
# .harness/src/subagents/code-reviewer.md
# 3. (Optional) Edit provider-specific overrides
# .harness/src/subagents/code-reviewer.overrides.claude.yaml
# 4. Preview the plan
npx harness plan
# 5. Generate provider artifacts
npx harness applyCheck .claude/agents/, .codex/config.toml, and .github/agents/ to verify the rendered output.
References
- Claude Code sub-agents: https://code.claude.com/docs/en/sub-agents
- OpenAI Codex agents: https://developers.openai.com/codex/config-reference
- OpenAI Codex config reference: https://developers.openai.com/codex/config-reference
- GitHub Copilot custom agents configuration: https://docs.github.com/en/copilot/reference/custom-agents-configuration
- GitHub Copilot custom agents how-to: https://docs.github.com/en/copilot/how-tos/use-copilot-agents/coding-agent/create-custom-agents
- Cursor subagents: https://docs.cursor.com/agent/subagents
- Agent harness providers overview: docs/providers.md
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- ptmrio/harness-subagent★ 18same name
- realspqrk/harness-subagent★ 18same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository20 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- critical-reviewSkill
- harness-commandSkill
- harness-hookSkill
- harness-mcpSkill
- harness-prompt-sectionSkill
- harness-settingsSkill
- harness-skillSkill
- harness-subagentSkill
- npm-workflow-releaseSkill
- critical-reviewSkill
- harness-commandSkill
- harness-hookSkill
- harness-mcpSkill
- harness-prompt-sectionSkill
- harness-settingsSkill
- harness-skillSkill
- npm-workflow-releaseSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

