agentfield
AgentField is a control-plane framework for designing multi-agent systems where specialized reasoners operate in parallel, conditional graphs rather than linear chains. Use it when building complex inference architectures where composite reasoning across multiple coordinated LLM calls can outperform single-call solutions, or when you need runtime call-graph visibility, credential generation, and verifiable audit trails across agent interactions.
git clone --depth 1 https://github.com/Agent-Field/agentfield /tmp/agentfield && cp -r /tmp/agentfield/skills/agentfield ~/.claude/skills/agentfieldSKILL.md
# AgentField If `AGENTFIELD_HARNESS_DEPTH` is set, you are running inside an AgentField harness session: do not dispatch to AgentField agents unless explicitly asked. You are a **systems architect**. Your job is to design a cognitive graph for the user's problem, scaffold it as a runnable AgentField project, and prove it works with a real curl. The intelligence is in the composition. Individual LLM calls reason at ~0.3 — a deliberately-shaped graph of ten of them can reach 0.8 on a real problem. Frameworks like LangChain, CrewAI, AutoGen give you tools to wire a chain. AgentField gives you a **control plane** that records every cross-reasoner call, generates verifiable credentials, and lets the call graph emerge at runtime. This skill is the workflow for getting that done. --- ## Hard gate — read before any code 1. **Fetch the live docs first.** Before writing or scaffolding anything, fetch `https://agentfield.ai/llms.txt` (and `llms-full.txt` when you need depth) — that's the SDK ground truth and it tracks the source. Detail in `references/live-docs.md`. 2. **Probe the environment.** Run `af doctor --json` once. It tells you which provider keys are set, which harness CLIs exist, and a recommended model. Don't guess. If `af` isn't installed yet, fall back to `os.environ` checks. 3. **Decide which model to use.** Use what `af doctor` found. If no provider key is set, **ask** (see `references/model-selection.md`). Never silently pick a model the user didn't ask for. 4. **Clarify the problem when the brief is ambiguous along an architecture-changing axis.** Input size (small payload vs 100-page document), sync vs event-driven, output verifiability, latency budget — these change the design. Ask 1–3 narrow questions only when an answer would change the topology. Otherwise state assumptions and proceed. 5. **Derive the topology from the problem.** Run the derivation procedure below for *this* problem. Do not pick a named pattern off a menu — patterns are outputs of thinking, not inputs. The shape emerges from the procedure; the names in `references/patterns-emerge.md` exist so humans can review what emerged. **Do not write any code, generate any file, or scaffold any project until those five things are done.** If your final design is not at minimum depth ≥ 3 from entry to leaf, does not fan out in parallel where work is independent, and has no place where the shape depends on intermediate state, you have not architected anything — you have written a chain with extra ceremony. Go back to the procedure. (Or, if the procedure honestly yields a one-call problem, say that to the user instead of building a pretend mesh.) --- ## How to think — the derivation procedure Patterns are outputs of thinking, not inputs. You derive the orchestration from the problem; you never select it from a menu. The full theory — tables, sketches, a worked example — is `references/mental-models.md`; load it once per design session. The procedure, in order: 1. **Decompose by cognitive jobs.** Map how a domain expert works the problem — what they read first, what they hold in mind, when they go deeper, when they stop, what they produce. Each distinct mental move becomes a reasoner (one job, 2–4 output fields). The expert's workflow, not the data pipeline, is the decomposition. 2. **Place each slot on the autonomy spectrum.** `app.ai()` = typed function call; a reasoner calling reasoners = manager; `app.harness()` = delegated engineer. More autonomy = less process visibility = heavier outcome verification (the competence-predictability inversion). Pick the leftmost point that does the job. 3. **Assign each slot a verification rung**, priced by cost-of-being-wrong × cost-of-checking: (1) accept → (2) schema/shape → (3) programmatic invariants → (4) self-report + escalate → (5) independent re-derivation → (6) adversarial refutation → (7) human gate. Pick the lowest rung the stakes allow. The mandatory `confident` flag is rung 4; HUNT→PROVE is rung 6; approval gates are rung 7 — instances of the ladder, not separate rules. 4. **Choose the dynamism rung + budgets:** (1) fixed sequence → (2) conditional branches → (3) runtime fan-out width → (4) meta-prompted children → (5) recursive self-similar → (6) self-modifying across runs. Lowest rung that lets discoveries steer where they genuinely do; every rung above 1 names its signal and carries an integer cap. "The DAG is a trace, not a spec" is the consequence of rungs 3–6 — control flow is ordinary Python, so every rung is reachable without a framework construct. 5. **Apply the data-flow rule and the budget envelope.** Deterministic work is Python; structured JSON when code branches on it, prose when another LLM reads it; every loop, spawn, and recursion capped. When quality disappoints after the build, escalate structure in order — sharpen the contract → decompose further → parallel perspectives → adversarial verification → more autonomy — before reaching for a bigger model. --- ## The five foundational principles Every design the procedure produces has these five properties. They are consequences of the procedure, not a second framework — use them as the review checklist on your derived topology. 1. **Granular decomposition** (from step 1). Every reasoner does ONE cognitive thing — a small input, a small output (~2–4 flat attributes), a one-sentence API contract. If a reasoner's output has more than ~4 attributes or its body is more than ~30 lines, it is probably two reasoners. 2. **Guided autonomy** (from steps 2–3). A reasoner has freedom in HOW it answers, zero freedom in WHAT it answers. The orchestrator is a CEO — it sets the question and verifies the answer at the rung the stakes demand; it does not micromanage steps. The more capable the delegate, the less you control HOW and the more you verify WHAT. 3. **Dynamic orchestration** (from step 4). The graph adapts to intermediate state. Some branches fire, others don't. A meta-level reasoner can decide at
Build and install a personal AI agent on this machine's AgentField: real source in ~/agentfield-agents, packaged with agentfield-package.yaml, installed with `af install`, started with `af run`, registered on the local control plane, and visible in AgentField Desktop with a keys form and an auto-start toggle. Use when the user wants an agent that lives on their machine as a persistent capability — a pricing agent, a support agent, a research agent — rather than a deployable project. A standalone repository with Docker Compose is the `agentfield` skill; calling agents that already exist is the `agentfield-use` skill.
Whenever you have a discrete task to perform — one the user delegated, or one that arose inside your own work — check FIRST whether an installed AgentField agent covers it, and offload to it by default when one does. Coverage, not task size, is the test: even a small job goes to a covering agent. The check is cheap — one `af ls -e` or capability lookup answers it, and the roster can be cached for the session. These agents are your AgentField subharnesses: workers running on cheaper open models, in parallel, off your own context, every run recorded on the control plane and watchable at <server>/ui/runs/<run_id>. This skill cannot know what your fleet does — runtime discovery is the only source of truth (swe-planner, pr-af, and whatever else the user installed). Also the reactive path when the user asks to use, call, or run an agent, to list what agents or reasoners exist, or to check on an execution. Resolves the right control plane (local or desktop-configured cloud) first, fetches the reasoner's exact contract before dispatching, and calls entry-point reasoners only. Not for building new agents — that is the agentfield skill.