Skip to content
agentform logo

agentform

Create and debug Agentform AI agent configurations (.af files). Use when: (1) Creating new agentform projects or workflows (2) Debugging agentform syntax errors (3) Adding MCP server integrations (4) Configuring agents, models, policies, or capabilities (5) Writing workflow steps with routing and...

NeverSight/skills_feed0installs213stars

SKILL.md

Full skill instructions

Agentform Skill

Create declarative AI agent configurations using Agentform's .af syntax.

File Structure

Number files for alphabetical processing order:

project/
├── 00-project.af      # Project metadata
├── 01-variables.af    # API keys, secrets
├── 02-providers.af    # LLM providers + models
├── 03-servers.af      # MCP servers (optional)
├── 04-capabilities.af # Server capabilities (optional)
├── 05-policies.af     # Cost/​timeout limits
├── 06-agents.af       # Agent definitions
├── 07-workflows.af    # Workflow definitions
└── input.yaml         # Example inputs

Block Types Quick Reference

agentform (required)

agentform {
  version = "0.1"
  project = "my-project"
}

variable

variable "api_key" {
  type        = string
  description = "API key"
  sensitive   = true
}

Reference: var.api_key

provider

Format: provider "type.vendor" "name" { ... }

provider "llm.anthropic" "default" {
  api_key = var.anthropic_api_key
}

provider "llm.openai" "default" {
  api_key = var.openai_api_key
  default_params {
    temperature = 0.7
    max_tokens  = 2000
  }
}

Reference: provider.llm.anthropic.default

model

model "claude_sonnet" {
  provider = provider.llm.anthropic.default
  id       = "claude-sonnet-4-5-20250929"
}

model "gpt4o" {
  provider = provider.llm.openai.default
  id       = "gpt-4o"
  params {
    temperature = 0.5
  }
}

Reference: model.claude_sonnet

Model IDs

Do not hardcode model IDs. Always fetch current model names from the provider's API documentation:

Model IDs change with new releases. Example workflow:

  1. Check provider docs for current model ID
  2. Use exact ID string in your config
  3. Test with agentform validate

server (MCP integration)

server "github" {
  type      = "mcp"
  transport = "stdio"
  command   = ["npx", "-y", "@modelcontextprotocol/​server-github"]

  auth {
    token = var.github_token
  }
}

Reference: server.github

capability

capability "get_pr" {
  server      = server.github
  method      = "get_pull_request"
  side_effect = "read"
}

capability "create_review" {
  server            = server.github
  method            = "create_pull_request_review"
  side_effect       = "write"
  requires_approval = true
}

Reference: capability.get_pr

policy

Each budget needs its own budgets {} block:

policy "review_policy" {
  budgets { max_cost_usd_per_run = 0.50 }
  budgets { max_capability_calls = 15 }
  budgets { timeout_seconds = 300 }
}

Reference: policy.review_policy

agent

agent "reviewer" {
  model           = model.claude_sonnet
  fallback_models = [model.gpt4o]
  policy          = policy.review_policy
  allow           = [capability.get_pr, capability.create_review]

  instructions = <<EOF
You are a code reviewer.
Focus on security and performance.
EOF
}

Reference: agent.reviewer

Heredoc Syntax (CRITICAL)

Multi-line strings use heredoc. The closing marker MUST be at column 0 (no indentation):

instructions = <<EOF
Line 1
Line 2
EOF

WRONG (will fail validation):

  instructions = <<EOF
    Line 1
  EOF

The EOF has leading spaces - this breaks parsing.

Expression Syntax

References

TypeSyntaxExample
Variablevar.namevar.api_key
Providerprovider.type.nameprovider.llm.openai.default
Modelmodel.namemodel.gpt4o
Agentagent.nameagent.reviewer
Capabilitycapability.namecapability.get_pr
Serverserver.nameserver.github
Policypolicy.namepolicy.default
Stepstep.namestep.fetch_pr

State References (in workflows)

ContextSyntax
Workflow inputinput.field
Step outputstate.step_output
Nested fieldstate.review.response
Result in stepresult.text, result.data

Operators

// Comparison
condition = state.value == "expected"
condition = state.count > 10

// Logical
condition = state.a && state.b
condition = !state.flag

// Ternary
value = state.premium ? "gold" : "standard"

NO FUNCTION CALLS - contains(), length() etc. are NOT supported.

Workflow Reference

See references/​workflows.md for complete workflow patterns.

CLI Commands

# Validate
agentform validate --var api_key=$API_KEY

# Run workflow
agentform run workflow_name \
  --var api_key=$API_KEY \
  --input '{"field": "value"}'

# Verbose
agentform run workflow_name --verbose

Troubleshooting

ErrorCauseFix
Unexpected token <Heredoc EOF indentedMove EOF to column 0
Unexpected token (Function call usedUse comparison operators
Variable has no valueMissing runtime varAdd --var name=value
MCP server not foundWrong package nameCheck npm package exists

Common MCP Servers

  • @modelcontextprotocol/​server-github
  • @modelcontextprotocol/​server-filesystem

Templates

Copy these pre-validated templates as starting points:

Simple Agent (no MCP)

cp -r ~/​.claude/​skills/​agentform/​assets/​templates/​simple-agent ./​my-agent

MCP Agent (GitHub PR reviewer)

cp -r ~/​.claude/​skills/​agentform/​assets/​templates/​mcp-agent ./​my-pr-reviewer