01 — Fundamentals & harness
Goal
↓
Context
↓
Model
↓
Policy
↓
Action
↓
Observation
↓
Stop or repeat
Agent
A system that selects actions toward a goal using feedback.
Example: Find a failing test, inspect code, fix it and rerun tests.
Common mistake: A single model call need not be an agent.
Autonomy
The extent to which a system selects its own actions.
Example: Choose which tests to run within a fixed budget.
Common mistake: More autonomy is not inherently better.
Workflow
A predefined sequence or graph of operations.
Example: Lint, test, then publish a report.
Common mistake: A workflow can contain agents.
Agent harness
Software that manages model-driven execution.
Example: Build context, validate tool calls and record results.
Common mistake: The model is not the entire harness.
Runtime
The machinery and environment executing an agent.
Example: A worker process with a tool dispatcher.
Common mistake: Runtime and harness overlap; terminology varies.
Agent loop
Repeated decision, action and observation until termination.
Example: Inspect a test failure and revise a patch.
Common mistake: Always bound the loop.
Orchestration
Coordination of steps, tools and agents.
Example: Run review after implementation.
Common mistake: It can be deterministic.
Provider abstraction
A common interface for model providers.
Example: Swap model adapters while keeping task logic.
Common mistake: Capabilities and behavior are not interchangeable.
02 — Domain-specific agents
Domain goal
↓
Relevant data + skills
↓
Restricted tools
↓
Domain evals
Domain specialization
Configure knowledge, capabilities and constraints for a field.
Example: A Vue repository assistant knows local conventions.
Common mistake: Fine-tuning is optional.
Data
Information available to the agent.
Example: Repository files and approved documentation.
Common mistake: Access does not imply correctness.
Domain evals
Cases and criteria tailored to the domain.
Example: Check that patches pass tests and follow conventions.
Common mistake: Generic benchmarks cannot establish local usefulness.
Schedules
Time-based triggers for execution.
Example: Run dependency review each Monday.
Common mistake: A schedule is not an agent loop.
Channels
Interfaces for interacting with an agent.
Example: Web, Slack or Discord.
Common mistake: Channels are not model providers.
Connections
Configured access to external services.
Example: An authenticated issue tracker integration.
Common mistake: A connection must have scoped credentials.
03 — Context & memory
Sources
↓
Select relevant information
↓
Context window
↓
Model
↓
Update state
Context
Information supplied to the model for a particular call.
Example: Current issue, selected files and tool schemas.
Common mistake: Not all stored information is in context.
Context engineering
Select, structure and prioritize context.
Example: Retrieve only relevant repository conventions.
Common mistake: More context can reduce quality.
State
Current execution information.
Example: Task ID, pending tests and remaining budget.
Common mistake: State is not necessarily long-term memory.
Working memory
Temporary information used during a task.
Example: A list of files already inspected.
Common mistake: May live outside the context window.
Episodic memory
Records of prior events or experiences.
Example: A previous failed migration and its outcome.
Common mistake: Past success does not guarantee future success.
Semantic memory
Stored facts or generalized knowledge.
Example: The project uses Vue 3.
Common mistake: Facts can become stale.
Progressive disclosure
Load details only when relevant.
Example: Read skill metadata first, then its instructions.
Common mistake: Do not assume every framework loads skills identically.
Context inheritance
Passing selected parent context to another execution.
Example: Give a reviewer the patch and requirements.
Common mistake: Do not blindly copy all parent messages or secrets.
04 — Tools, skills, rules & hooks
Model proposes
↓
Pre-tool hook
↓
Permission check
↓
Tool
↓
Post-tool hook
↓
Observation
Tool
Callable operation with an input/output contract.
Example: read_file(path) returns file content.
Common mistake: A tool is not a procedure.
Function calling
Structured model request to invoke a callable operation.
Example: Request run_tests with a suite name.
Common mistake: The runtime executes it, not the model itself.
Skill
Reusable task guidance and supporting resources.
Example: A code-review procedure with scripts and references.
Common mistake: A skill is not necessarily executable.
Project instructions
Repository-specific guidance, often in AGENTS.md or framework-specific files.
Example: Use TypeScript and run lint before review.
Common mistake: File names and precedence vary.
System prompt
High-priority model instructions.
Example: Act as a repository assistant.
Common mistake: Not a hard security boundary.
Rules & policies
Constraints on permitted behavior.
Example: Deny writes outside the workspace.
Common mistake: Enforce hard rules in software.
Hook
Callback triggered at a lifecycle event.
Example: Validate arguments before a tool call.
Common mistake: Function, prompt and agent hooks are framework-specific.
Sandbox
Restricted execution environment.
Example: Run tests without access to production credentials.
Common mistake: Isolation requires explicit configuration.
Computer use
Interaction through graphical interfaces.
Example: Inspect a rendered application in a browser.
Common mistake: Treat page content as untrusted.
Skill directory
code-review/
SKILL.md
scripts/
references/
assets/
Skill directory: code-review/SKILL.md (metadata and instructions), scripts/ (helpers), references/ (supporting knowledge), assets/ (templates). Optional folders; load relevant resources progressively.
05 — MCP, A2A & interoperability
Agent host
↓
MCP client
↓
MCP server
↓
External service
MCP
Model Context Protocol: standardized interaction between hosts/clients and servers.
Example: Discover and call an issue tracker tool.
Common mistake: MCP is not an agent runtime.
MCP server primitives
Tools, resources and prompts exposed by a server.
Example: Read a document resource or invoke search.
Common mistake: These have distinct semantics.
MCP client capabilities
Client-side capabilities can include sampling and roots, depending on negotiation.
Example: A server requests model sampling from a supporting client.
Common mistake: Roots are not a security sandbox.
Discovery
Discover supported capabilities and available operations.
Example: List server tools before selecting one.
Common mistake: Discovery does not grant permission.
A2A
Agent-to-Agent protocol for interoperable agent communication.
Example: Send a task to a separately deployed reviewer.
Common mistake: Not required for local delegation.
Agent Card
Machine-readable agent discovery and capability metadata.
Example: Advertise review skills, endpoint and authentication.
Common mistake: Metadata is not proof of competence.
Protocol boundary
Separate service integration from agent coordination.
Example: Use MCP for repository access and A2A for remote review.
Common mistake: They can coexist.
A2A versus local delegation
A2A connects independent agent services; local subagents can use ordinary function calls or queues.
06 — Composition & multi-agent architectures
Orchestrator
↓
Specialist agents
↓
Structured results
↓
Integration
Composition
Assemble independent modules with defined responsibilities.
Example: Combine retrieval, testing and review modules.
Common mistake: Can occur within one agent.
Inheritance
Reuse or extend configuration or behavior from a base.
Example: A reviewer inherits shared coding conventions.
Common mistake: Context accumulation is not identical to software inheritance.
Subagent
Delegated agent with a scoped task.
Example: Review only security-sensitive changes.
Common mistake: Delegation need not use A2A.
Routing
Select a suitable model, tool or agent.
Example: Route database questions to a SQL specialist.
Common mistake: Routing errors need evaluation.
Planning
Choose or revise a sequence of actions.
Example: Inspect, patch, test, review.
Common mistake: Plans may fail and need revision.
ReAct
Pattern interleaving reasoning and actions with observations.
Example: Search, inspect evidence, then search again.
Common mistake: Does not require exposing private reasoning.
Reflection
Review an output and propose improvements.
Example: Inspect a patch against requirements.
Common mistake: Self-review is not independent evidence.
Consensus
Combine multiple agent judgments under a decision rule.
Example: Vote on whether a patch is acceptable.
Common mistake: Agreement is not proof of correctness.
Handoff contract
Structured input and output for delegation.
Example: Pass patch, scope, budget and expected report schema.
Common mistake: Avoid unrestricted context sharing.
07 — Durable execution & reliability
Execute
↓
Persist checkpoint
↓
Failure?
↓
Resume safely or finish
Durable execution
Persist progress so work can recover after interruption.
Example: Resume a review after worker restart.
Common mistake: Persistence alone does not prevent duplicate effects.
Checkpoint
Saved recoverable execution state.
Example: Record completed tests and pending actions.
Common mistake: Checkpoint before consequential transitions.
Idempotency
Repeated operation has the same intended effect.
Example: Use an idempotency key when creating a ticket.
Common mistake: Retries are not automatically safe.
Retry
Bounded repeat after a recoverable failure.
Example: Retry a temporary API timeout with backoff.
Common mistake: Do not blindly retry irreversible actions.
Fallback
Alternative when the preferred operation fails.
Example: Use cached documentation and disclose its age.
Common mistake: Fallback may reduce quality.
Budget
Limits on cost, tokens, time or actions.
Example: Stop after 20 tool calls or a fixed spend.
Common mistake: Budget exhaustion is not task success.
Termination
Explicit success, failure or stop conditions.
Example: Return when tests pass or report unresolved failures.
Common mistake: Never equate a final message with completion.
Human approval
Explicit authorization before consequential actions.
Example: Ask before merging a patch.
Common mistake: Approval should bind to the specific action.
Least privilege
Grant only necessary access.
Example: Read-only production credentials for diagnosis.
Common mistake: Prompt instructions cannot replace permissions.
08 — Agent evaluation & observability
Eval cases
↓
Agent harness
↓
Output + trace
↓
Graders
↓
Metrics
↓
Improvement
Trace
Recorded execution events and relationships.
Example: Tool calls, timings and outcomes.
Common mistake: Not a transcript of hidden reasoning.
Observability
Ability to understand system behavior from telemetry.
Example: Locate a slow retrieval call.
Common mistake: Logs alone do not establish quality.
Task success
Whether the requested outcome was achieved.
Example: Patch passes acceptance tests.
Common mistake: Fluent answers can still fail.
Trajectory evaluation
Assess the sequence of observable actions.
Example: Check that no unauthorized tool was called.
Common mistake: A valid final result can hide unsafe actions.
Cost and latency
Resources and elapsed time consumed.
Example: Measure tokens, API charges and wall-clock time.
Common mistake: Compare under equivalent conditions.
Regression evaluation
Detect degradation against prior behavior.
Example: Rerun a frozen golden set after a skill change.
Common mistake: Avoid tuning on the holdout.
Failure analysis
Classify failures to identify improvements.
Example: Distinguish retrieval failure from reasoning failure.
Common mistake: Do not blame the model by default.
09 — Decision-making & uncertainty
Uncertainty
↓
Compare evidence value and cost
↓
Choose action
↓
Observe
↓
Reassess
Epistemic action
Action intended to improve knowledge or reduce uncertainty.
Example: Inspect test results before claiming a fix.
Common mistake: Not every action is epistemic.
COMPUTE
Further internal computation or reasoning.
Example: Compare two candidate fixes.
Common mistake: Reasoning cannot create independent evidence.
RETRIEVE
Acquire existing information.
Example: Read API documentation.
Common mistake: Retrieved sources may be stale.
OBSERVE
Measure the current environment.
Example: Inspect actual test output.
Common mistake: Observations can be noisy.
INTERVENE
Change a controlled condition to learn its effect.
Example: Run an isolated experiment with a feature flag.
Common mistake: Requires authorization and safe isolation.
PREFERENCE
Elicit user priorities or constraints.
Example: Ask whether speed or compatibility matters more.
Common mistake: Preferences are not factual evidence.
ACT
Execute an outcome-directed action.
Example: Apply an approved patch.
Common mistake: Separate learning from consequential execution.
Stopping criterion
Decide when further information is not worth its cost or risk.
Example: Stop when acceptance criteria pass and residual risk is acceptable.
Common mistake: Confidence alone is insufficient.
Value of information
Expected decision improvement from acquiring evidence.
Example: Run a cheap test before an expensive deployment.
Common mistake: Estimates are uncertain; this is a research framing.
Quotes & Key Insights
Harnesses are deterministic software that harnesses the non-deterministic results produced by models in pursuit of a desired objective.
Handwritten quotation; attribution unverified.
Specialize the system, not necessarily the model.
Synthesized principle.
Do not assume a model failure until you have investigated the harness.
Synthesized principle.
End-to-end example: repository agent
Receive issue → load project instructions and relevant skill → inspect repository through scoped tools → propose patch → run sandboxed tests → delegate review if useful → request approval before merge → record trace and evaluate outcome.
Example acceptance criteria: tests pass, no unauthorized writes, requirements met, cost within budget. If evidence is insufficient, report the unresolved issue instead of claiming success.
Back to contents ↑