agentic-harness-patterns

Documents harness design patterns for building production coding-agent runtimes.

Updated Jun 22, 2026
One-click install
npx skills add https://github.com/aicodepro/ai-agent-nexi --skill agentic-harness-patterns-aicodepro
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: agentic-harness-patterns
Source: https://github.com/aicodepro/ai-agent-nexi/tree/main/agent/skills/agentic-harness-patterns
Command: npx skills add https://github.com/aicodepro/ai-agent-nexi --skill agentic-harness-patterns-aicodepro

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Building a production AI coding agent requires far more than an LLM calling tools in a loop. This Skill provides distilled architectural patterns for the harness around the agent — memory, skills, tool safety, context engineering, multi-agent coordination, and lifecycle extensibility — so engineers avoid the non-obvious failure modes that separate demos from production systems. ## Core Features & Use Cases - Memory Architecture: Layered instruction memory, auto-memory with a type taxonomy, two-step save invariant, and background session extraction with mutual exclusion. - Tools, Permissions, and Safety: Fail-closed tool registration, per-call concurrency classification, and a single permission gate with layered rule evaluation and bypass-immune checks. - Context Engineering: Four-axis framework (select, write, compress, isolate) covering progressive disclosure, compaction, and context isolation for delegated work. - Multi-Agent Coordination: Coordinator, fork, and swarm delegation patterns with bounded depth, tool filtering, and synthesis-before-implementation rules. - Use Case: An engineer building a custom coding-agent runtime reads the permission-gate and hook-lifecycle references to design a single dispatch point with all-or-nothing trust gating before shipping an auto-approve mode. ## Quick Start Ask the agent to explain how to design a permission gate and memory layer for a coding agent using the agentic harness patterns.

Frequently Asked Questions about agentic-harness-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I design a memory system for a coding agent?

Separate memory into layers: curated instruction memory, agent-written auto-memory with a type taxonomy, and background session extraction. Use a two-step save (topic file, then index) and enforce mutual exclusion between the main agent and the extractor per turn.

How should agent tool permissions be implemented?

Route every tool call through a single permission gate returning allow, deny, or ask. Evaluate layered rules in strict priority order with deny first, and make safety checks for protected paths bypass-immune so auto-approve modes cannot override them.

What is the difference between coordinator, fork, and swarm delegation?

Coordinator workers start with zero context for phased tasks, fork children inherit full parent context but cannot fork again, and swarm peers coordinate through a shared task list with a flat roster. Choose one pattern per session to avoid ownership ambiguity.

When should agent skills be lazy-loaded instead of injected?

Skills should be lazy-loaded when the catalog is large: only metadata enters always-on context, capped near 1% of the window, and the full body loads on activation. This keeps idle token cost near zero at the price of one round-trip on first use.

Why do agent hooks need an all-or-nothing trust gate?

Partial trust creates half-trusted states where some hooks execute and others do not, producing unpredictable behavior. Checking workspace trust once at a single dispatch point and skipping every hook when untrusted prevents remote code execution from untrusted configuration.

When should I not use agentic harness patterns?

These patterns do not apply to prompt engineering, model selection, generic software architecture, chat UI design, or LLM API basics. They address the system around the model, not the model itself.