Agents best practices

From teknokomo/universo-platformo-react · View interactive version

Agents best practices is an AI agent skill from the GitHub repository teknokomo/universo-platformo-react. Use this skill when designing, generating an MVP blueprint for, auditing, refactoring, or explaining an agentic harness for any domain. Covers provider-neutral agent architecture for OpenAI, Anthropic, and OpenAI-compatible APIs: agent loops, tool design, permissions, system prompts, planning, goals

How to use this skill

Skill file

Agents Best Practices

Use this skill when the user asks how to build, improve, debug, or evaluate an agentic harness. This is a general-purpose agent architecture skill. Coding agents are one subdomain only; apply the same principles to research, finance, legal, support, operations, sales, healthcare, education, data analysis, procurement, and workflow automation agents.

Core stance

An agent harness is the control plane around a model. The model proposes actions; the harness validates, authorizes, executes, records, summarizes, and returns observations. Keep the loop simple and make the runtime rigorous.

Default architecture:

user/task
  -> instruction and context builder
  -> model call
  -> tool/action proposal
  -> schema validation
  -> permission decision
  -> execution or approval pause
  -> structured observation
  -> context update
  -> repeat within budget or finish

When to activate this skill

Use this skill for prompts involving any of these intents:

Do not use this skill for ordinary single-turn writing, translation, or Q&A unless the user is asking about the design of an agent that will perform those tasks.

How to use this skill

First, identify the user's design problem:

  1. Domain: what work the agent performs.
  2. Autonomy level: answer-only, draft-only, approval-gated action, or autonomous action within policy.
  3. Risk level: read-only, internal write, external communication, financial, legal, healthcare, security, destructive, or privileged.
  4. State duration: single turn, multi-turn session, resumable workflow, or long-running goal.
  5. Tool surface: internal APIs, hosted tools, MCP/external connectors, browser, sandbox, filesystem, database, communication, or computation.
  6. Validation: what proves the task is complete.

Then load the most relevant reference files, not all files by default. If the user asks to make or build an agent for a domain, default to MVP Builder Mode.

MVP Builder Mode

When the user asks to make, build, design, scaffold, or specify an agent for a domain, produce a concrete domain-specific MVP harness blueprint, not only advice. Use mvp-agent-blueprint.md as the primary reference and load other references as needed.

Default behavior:

  1. Infer a reasonable first version from the user's domain and stated constraints.
  2. State assumptions briefly instead of blocking on missing details.
  3. Design the smallest safe harness that can accomplish useful work.
  4. Include the core agentic loop, tool registry, permission matrix, context/memory/compaction, planning mode, goal-like loop criteria, skills/connectors, prompt-cache/cost strategy, observability, evals, and launch path.
  5. Mark high-risk actions as draft-only or approval-gated by default.
  6. Avoid multi-agent orchestration until the single-agent MVP has measurable failure cases that require decomposition.

Reference map

Default answer structure when advising a user

When the user asks for guidance, produce a concrete architecture, not generic principles:

  1. MVP boundary: smallest useful version, assumptions, non-goals, and launch criteria.
  2. Harness boundary: what the model does versus what application code does.
  3. Loop: how model calls, tool calls, tool results, stopping, and retries work.
  4. Instructions: system/developer/user instruction hierarchy and scoped memory.
  5. Tools: tool registry, schemas, outputs, risk classes, permissions, and approval points.
  6. Context: retrieval, memory, summarization, cache-aware ordering, compaction triggers, and rehydration.
  7. Planning/goals: when to enter planning mode, when to run a goal-like loop, and how to stop.
  8. Skills/connectors: how skills and MCP/external connectors are discovered, loaded, permissioned, and audited.
  9. Safety: prompt injection boundaries, secrets, sandboxing, data access, and guardrails.
  10. Observability/evals: traces, metrics, test cases, and failure probes.
  11. Rollout: minimal viable harness first, then add autonomy only when measured results justify it.
  12. Legibility loop: source-of-truth artifacts, validation signals, feedback capture, and recurring cleanup.

Non-negotiable principles

Common output template

Use this template when the user wants a harness design. If the user asks to make/build an agent, use this as an MVP blueprint, not a purely conceptual answer:

# MVP Agent Harness Blueprint: [domain/use case]

## Objective
[What the agent must accomplish and for whom.]

## MVP scope and assumptions
[Smallest useful version, explicit assumptions, non-goals, and what is intentionally deferred.]

## Autonomy and risk level
[Answer-only, draft-only, approval-gated, or autonomous within policy.]

## Core loop
[How the model, tools, observations, retries, and stopping rules work.]

## Instruction architecture
[System/developer/user/scoped memory layout.]

## Tool registry
[Tools, schemas, risk classes, permissions, and result format.]

## Planning and goal behavior
[When to plan, when to ask, when to continue, when to stop.]

## Context and memory
[Retrieval, durable state, compaction, and rehydration.]

## Skills and connectors
[Reusable skills, MCP/external connector policy, tool search, attachment rules.]

## Safety and approvals
[Guardrails, prompt injection treatment, secrets, sandboxing, human review.]

## Observability and evals
[Trace events, eval cases, launch criteria, failure probes.]

## Minimal implementation path
[Smallest safe version first, implementation skeleton, validation path, then measured expansion.]

Gotchas

Source links for further reading

Use these links when provider-specific detail is needed:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.