Create and update Harness AI agent instances - standalone templates used as building blocks in pipelines. Agents contain a single agent step with connector-driven architecture requiring llmConnector (LLM access) and optional mcpConnectors (GitHub, Slack, Harness platform). Supports runtime inputs and task/rules-based instruction. Use when asked to create an agent, update agent spec, modify agent configuration, automate tasks, perform agentic workflows, build autonomous systems, or work with AI agents. Trigger phrases: create agent, update agent, modify agent spec, AI agent, autonomous agent, agentic pipeline, automation task, automate workflow, Harness agent, code coverage agent, review agent, agentic task.
82
73%
Does it follow best practices?
Impact
96%
3.42xAverage score across 3 eval scenarios
Advisory
Suggest reviewing before use
Optimize this skill with Tessl
npx tessl skill review --optimize ./plugins/claude/skills/create-agent/SKILL.mdCreate and update Harness AI agent instances - standalone templates used as building blocks in pipelines for automated code, agentic workflows, and infrastructure tasks.
Follow this workflow to create or update an agent. This is INTERACTIVE — show YAML for review and wait for confirmation before creating/updating the agent.
IMPORTANT: Before creating a new agent, check if an existing one can solve the use case.
harness_list with resource_type="agent" (include org_id and project_id if scoped to a project)
harness_get with resource_type="agent" and agent_id to retrieve the current agent configuration
spec, name, description, and other fieldsharness_update (not harness_create) to update the agent with only the fields that need modificationIf creating a new agent or updating an existing one, collect the following before generating YAML:
This is an INTERACTIVE requirements gathering process. Ask clarifying questions and verify understanding with the user before proceeding.
Ask and clarify the following with the user:
Agent's exact goal: What specific outcome should the agent achieve?
Inputs the agent needs: What data or context does the agent require to start?
Outputs the agent produces: What artifacts, reports, or actions should result?
What the agent works on: What files, services, or systems does it interact with?
pkg/**/*.go, src/services/)Task workflow: Understand the user's workflow for the task — what should happen step-by-step (do 1, then 2, then 3, etc.)
Constraints and preferences: Any user preferences for completing the task — limitations, rules, or coding standards the agent should follow
Definition of done: How do you know the agent succeeded?
Based on the requirements gathered in Step 1, recommend specific configurations and verify with the user:
Task instructions (task field):
<+inputs.fieldName> syntaxgo test -cover ./... to measure coverage\n2. Identify functions below 80% coverage\n3. Generate tests for uncovered functions\n4. Create PR with new tests"Runtime inputs (inputs section in spec):
repo (string), coverageThreshold (string), llmKey (secret)User preferences (RULES section in task field):
## RULES\n- Use idiomatic Go code\n- Do not modify existing tests\n- Keep COVERAGE.md under 10000 characters at the end of the taskConnectors:
Present this recommended configuration to the user and iterate until confirmed.
Agent Structure: Agents use agent.step.run format with a single step.
Default container image:
container:
image: pkg.harness.io/vrvdt5ius7uwygso8s0bia/harness-agents/harness-ai-agent:latestRequired environment variables:
env:
ANTHROPIC_MODEL: <+inputs.anthropicModel> # Points to anthropicModel input field
PLUGIN_HARNESS_CONNECTOR: <+inputs.llmConnector.id> # Points to llmConnector input's id propertyDefault max_turns:
max_turns: 150 # Adjust 100-200 based on task complexityMCP configuration (only if external services needed):
mcp_format: harness
mcp_servers: <+connectorInputs.resolveList(<+inputs.mcpConnectors>)> # Points to mcpConnectors input fieldRequired inputs (always include):
agent:
inputs:
llmConnector:
type: connector
required: true
default: your_llm_connector_id # User must replace with actual connector ID
anthropicModel:
type: string
required: true
default: arn:aws:bedrock:us-east-1:587817102444:application-inference-profile/7p8sn93lhspw # User may replace with their preferred modelOptional inputs (add as needed):
# MCP connectors - only if agent needs external services
mcpConnectors:
type: array
default:
- your_github_mcp_connector # User must replace
- your_slack_mcp_connector # User must replace
# Custom parameters
repo_name:
type: string
default: my-org/my-repoSupported input types: string, secret, boolean, connector, array
IMPORTANT: Users must create connectors via Harness UI or harness_create with resource_type="connector" before running the agent.
Assemble the complete agent YAML specification (spec field):
version: 1 and agent: structureagent.step.run block with:
container.image: pkg.harness.io/vrvdt5ius7uwygso8s0bia/harness-agents/harness-ai-agent:latestwith section:
task: with step-by-step instructions and ## RULES sectionmax_turns: 150 (adjust 100-200 based on complexity)mcp_format: harness (only if MCPs needed)mcp_servers: <+connectorInputs.resolveList(<+inputs.mcpConnectors>)> (only if MCPs needed)env section:
ANTHROPIC_MODEL: <+inputs.anthropicModel>PLUGIN_HARNESS_CONNECTOR: <+inputs.llmConnector.id>agent.inputs section with:
llmConnector (required - use placeholder ID)anthropicModel (required - use default ARN, but user may update)mcpConnectors (optional - only if needed)Always notify users to create connectors and replace placeholder IDs before running the agent.
Present the complete agent configuration to the user:
Wait for explicit confirmation before creating/updating the agent.
Only after confirmation, use harness_create to create a new agent or harness_update to update an existing one:
Call MCP tool: harness_create
Parameters:
resource_type: "agent"
org_id: "<organization>"
project_id: "<project>"
body: {
uid: "<agent_identifier>",
name: "<Agent Display Name>",
description: "<Brief description of agent purpose>",
spec: "<agent YAML spec as a string>",
wiki: "<optional: markdown documentation>"
}Key fields for creation:
uid (required): Unique identifier. Auto-generated from name if not provided (e.g. "Code Coverage Agent" → "code_coverage_agent")name (required): Display name for the agentdescription (optional): Brief descriptionspec (required): The full agent YAML specification as a string (includes version: 1, agent:, stages:, etc.)wiki (optional): Markdown documentation for the agentCall MCP tool: harness_update
Parameters:
resource_type: "agent"
agent_id: "<agent_identifier>"
org_id: "<organization>"
project_id: "<project>"
body: {
name: "<Updated Display Name>", # optional
description: "<Updated description>", # optional
spec: "<updated agent YAML spec>", # optional
wiki: "<updated markdown docs>" # optional
}Key notes for updates:
spec field replaces the entire agent specification when providedharness_get first to retrieve the current agent configuration before updatingversion: 1
agent:
step:
run:
container:
image: pkg.harness.io/vrvdt5ius7uwygso8s0bia/harness-agents/harness-ai-agent:latest
with:
task: |
Review the pull request for repository <+inputs.repo_name> on branch <+inputs.branch>.
1. Analyze code changes for security vulnerabilities
2. Check for code quality issues
3. Verify test coverage
4. Post review comments using GitHub MCP tools
## RULES
- Focus on critical security issues first
- Be constructive in feedback
- Suggest specific code improvements
max_turns: 150
mcp_format: harness
mcp_servers: <+connectorInputs.resolveList(<+inputs.mcpConnectors>)>
env:
ANTHROPIC_MODEL: <+inputs.anthropicModel>
PLUGIN_HARNESS_CONNECTOR: <+inputs.llmConnector.id>
inputs:
llmConnector:
type: connector
required: true
default: your_llm_connector_id # User must replace with actual connector ID
anthropicModel:
type: string
required: true
default: arn:aws:bedrock:us-east-1:587817102444:application-inference-profile/7p8sn93lhspw
mcpConnectors:
type: array
default:
- your_github_mcp_connector # User must replace with actual connector ID
repo_name:
type: string
default: my-org/my-repo
branch:
type: string
default: mainThese are essential rules you MUST follow when creating/updating agents:
| Guideline | Rule |
|---|---|
| Check existing first | Always call harness_list(resource_type="agent") to see if an existing agent can solve the use case before creating new |
| Updating agents | Use harness_get to retrieve current config, then harness_update (not harness_create) to modify. Only custom agents can be updated. |
| Agent spec format | The spec field contains standalone agent YAML (version: 1, agent:, stages:, steps:, inputs:) |
| Connectors required | All agents require llmConnector (required) and optional mcpConnectors (array) in the inputs section — users must create these first |
| Connector placeholders | Always use placeholders like your_llm_connector_id and notify users to replace with actual connector IDs |
| Prefer inputs | Use inputs for configuration instead of environment variables — reference with ${{ inputs.variableName }} |
| No clone/platform | Do NOT add clone, platform, os, arch, or allowed_tools sections — agents are standalone with simplified structure |
| Quality first | Agent quality is paramount — verify YAML structure, validate all references, ensure complete task instructions before creating |
harness_createharness_get, modify spec, update via harness_updateharness_create with resource_type="connector" if it doesn't existmcpConnectors input includes the correct connector IDsmax_turns is sufficient for task complexity (increase if needed)${{ inputs.variableName }}type: connector for LLM and MCP accesstask field with ## RULES sectionmax_turns based on task complexity (100-200)harness_create with resource_type="connector"a000afa
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.