"The model proposes actions; the harness validates, authorizes, executes, records, and returns observations." A provider-neutral Agent Skill for designing, generating MVP blueprints for, auditing, refactoring, and explaining agentic harnesses.
$ npx -y skills add DenisSergeevitch/agents-best-practices --agent claude-code
Run the curl in your terminal, the rest in Claude Code.
What's inside
"The model proposes actions; the harness validates, authorizes, executes, records, and returns observations."
A provider-neutral Agent Skill for designing, generating MVP blueprints for, auditing, refactoring, and explaining agentic harnesses.
It applies beyond coding agents: research, support, operations, sales, finance, data analysis, procurement, legal workflows, healthcare workflows, education, and workflow automation agents all need the same core runtime discipline.
Install - pick one:
A. With skills (any compatible agent):
npx skills add DenisSergeevitch/agents-best-practices -g
The -g flag installs globally at user level so every project can discover it.
B. Or paste this prompt to your AI agent:
Install the agents-best-practices skill for me:
1. Clone https://github.com/DenisSergeevitch/agents-best-practices into my
user-level skills directory as `agents-best-practices/`.
Use the skill directory my agent reads on this machine, for example:
- Codex: ~/.codex/skills/
- Claude Code: ~/.claude/skills/
2. Verify that SKILL.md, icon.jpeg, and the references/ directory are present.
3. Confirm the install path when done.
C. Manual install paths:
# Codex
mkdir -p "${CODEX_HOME:-$HOME/.codex}/skills"
git clone https://github.com/DenisSergeevitch/agents-best-practices.git \
"${CODEX_HOME:-$HOME/.codex}/skills/agents-best-practices"
# Claude Code, user-level
mkdir -p "$HOME/.claude/skills"
git clone https://github.com/DenisSergeevitch/agents-best-practices.git \
"$HOME/.claude/skills/agents-best-practices"
# Claude Code, project-level
mkdir -p .claude/skills
git clone https://github.com/DenisSergeevitch/agents-best-practices.git \
.claude/skills/agents-best-practices
Use cases ยท What this is ยท Philosophy ยท Layout ยท Sources
Once installed, the skill activates when a conversation touches agent architecture, harness design, tool permissions, planning mode, workflow orchestration, context and memory, skills, connectors, observability, evals, prompt caching, or production readiness. Four common ways to use it:
You have a domain and need the smallest useful production-safe agent harness, not a vague list of best practices.
You > Build an agent for account renewal risk. It should read CRM,
support tickets, and usage data, then draft renewal actions.
Agent > Start with an approval-gated Level 2 harness.
The MVP has one job: produce a renewal-risk brief plus draft
next actions for a human account owner.
Core loop:
user/task -> context builder -> model call -> typed tool call
-> schema validation -> permission check -> execution or pause
-> structured observation -> next step or final brief
Minimal tools:
- read_account_profile read_private_data
- list_support_tickets read_private_data
- fetch_usage_summary read_private_data
- draft_customer_email draft_external_message
- request_approval approval_gate
Launch gate:
20 historical accounts, trace review, no unapproved external
sends, and human acceptance on at least 80% of draft actions.
The primary reference is references/mvp-agent-blueprint.md.
You already have a working agent, but it is brittle, expensive, too broad, or hard to debug.
You > Our research agent sometimes runs tools forever and forgets why
it made a decision after context compaction. Audit the harness.
Agent > The failure points are runtime-level, not prompt-level:
- no hard step/tool/time/cost budget
- compaction preserves prose but loses active approvals
- tool results are unbounded and mix trusted/untrusted data
- no event trace for model output -> tool call -> observation
Fix order:
1. Add loop budgets and termination reasons.
2. Store plan, approvals, todos, and artifacts outside the prompt.
3. Make compaction rehydrate active state, not chat history.
4. Add evals for injection, missing tool result, timeout, and
budget exhaustion.
Start with references/agentic-loop.md, references/context-memory-compaction.md, references/security-observability.md, and references/evals.md.
You need an agent to work with real systems without turning every API into an unsafe broad tool.
You > The ops agent needs Slack, Linear, Google Drive, and our internal
deploy API. How should tools and permissions work?
Agent > Split by risk class. Reads can be autonomous when scoped.
Drafts can be autonomous when labeled. External writes, deploys,
destructive actions, privileged access, and financial operations
require an approval record outside the model.
Do not expose generic send_message, write_database, or run_command.
Wrap each action as a narrow typed tool with structured results and
deterministic permission checks.
Use references/tools-and-permissions.md and references/skills-and-connectors.md.
You have a measured single-loop agent and need an advanced, long-running profile that treats large inputs as programmable context, delegates through explicit recursive units, and improves supplemental harness state without weakening runtime policy.
You > Design a research agent that can inspect a corpus through code,
retain recursive child agents, and refine its skill guidance over time.
Agent > Treat this as a post-MVP architecture. Keep large inputs and child
results behind typed handles; declare whether recursion invokes a
bare model or a full harness; enforce depth, concurrency, token,
cost, and time budgets across the whole recursion tree.
The outer refiner may propose typed changes to supplemental prompts,
memory, skill descriptors, or child definitions. Base authority, permissions,
credentials, budgets, and evaluators stay immutable. Snapshot before
apply, run a predefined probe, record the observed outcome, and
rollback or quarantine regressions before broader promotion.
Use references/self-refining-recursive-harnesses.md with the context, workflow, permissions, security, and eval references.
references/planning-and-goals.md.references/workflow-orchestration.md.references/self-refining-recursive-harnesses.md.references/context-memory-compaction.md.references/coding-agents.md.references/evals.md.references/prompt-caching-and-cost.md.references/provider-api-patterns.md.references/checklists.md."Keep the loop simple and make the runtime rigorous."
A reference for people building agentic systems where the model is only one part of the runtime. It helps design a harness that includes:
This is the control plane around an agent: instructions -> context builder -> model call -> tool proposal -> validation -> permission decision -> execution or approval pause -> observation -> next step or final answer.
execute_anything, send_message, or write_database.Use the single-agent MVP first. Add goal loops, connectors, and broader autonomy only after measured failures justify them.
agents-best-practices/
โโโ README.md # public-facing overview and install notes
โโโ SKILL.md # skill entry point and trigger rules
โโโ icon.jpeg # skill image used by the README
โโโ references/
โโโ mvp-agent-blueprint.md # domain-specific MVP harness blueprint
โโโ coding-agents.md # repository-facing coding-agent harness overlay
โโโ architecture.md # component model and harness boundaries
โโโ agentic-loop.md # loop invariants, retries, budgets, stopping
โโโ tools-and-permissions.md # typed tools, risk classes, approvals
โโโ planning-and-goals.md # planning mode and long-running goals
โโโ workflow-orchestration.md # decomposed workflows, packets, verification
โโโ self-refining-recursive-harnesses.md # programmable context, recursion, refinement
โโโ context-memory-compaction.md # context, memory, retrieval, compaction
โโโ prompt-caching-and-cost.md # stable prefixes and cost-aware context
โโโ skills-and-connectors.md # Agent Skills, MCP, connectors, tool search
โโโ system-prompts-instructions.md # instruction hierarchy and templates
โโโ provider-api-patterns.md # OpenAI, Anthropic, compatible APIs
โโโ security-observability.md # guardrails, tracing, launch gates
โโโ evals.md # eval strategy, test cases, trace grading
โโโ agent-legibility-feedback-loops.md # source-of-truth artifacts and cleanup
โโโ checklists.md # implementation and audit checklists
โโโ coverage-audit.md # topic coverage verification
โโโ source-links.md # official references and further reading
The central tension this skill resolves: how can an agent do useful work in real systems without turning the model into an unaudited operator? The answer is a small set of runtime rules:
Read SKILL.md first. Use references/mvp-agent-blueprint.md when the user asks to make or build an agent.
Agent Skills package reusable domain knowledge so compatible agents can discover, load, and apply a workflow only when it is relevant. This repository uses the portable SKILL.md entrypoint and works as a Codex skill, a Claude Code skill, or a skill for other Agent-Skill-aware runtimes.
references/source-links.md.references/source-links.md.references/source-links.md.MIT - see LICENSE.
Authored as an Agent Skill for provider-neutral agent harness design. The recommendations synthesize common production harness patterns across OpenAI, Anthropic, OpenAI-compatible APIs, Agent Skills, MCP, and external connector workflows.
.gitignore
assets/
agents-best-practices-illustrations/
01-use-cases.jpg
02-workflow-orchestration-schema.svg
icon.jpeg
LICENSE
README.md
references/
agent-legibility-feedback-loops.md
agentic-loop.md
architecture.md
checklists.md
coding-agents.md
context-memory-compaction.md
coverage-audit.md
evals.md
mvp-agent-blueprint.md
planning-and-goals.md
prompt-caching-and-cost.md
provider-api-patterns.md
security-observability.md
self-refining-recursive-harnesses.md
skills-and-connectors.md
source-links.md
system-prompts-instructions.md
tools-and-permissions.md
workflow-orchestration.md
SKILL.mdFAQ
agents-best-practices is a Claude Code plugin with 1 hand-picked skill for development work, indexed on Flowy. Install it with the command on its page. It includes agents-best-practices. Its skills do not fire on their own yet. Request auto-invocation to have Flowy route them as you prompt. Free and open source.