This skill helps you design and build a production-grade AI agent harness. It applies the architecture patterns in SPEC.md to your specific use case — either scaffolding a new project or auditing an existing one.
Before anything else, read SPEC.md. Look for it at:
agent-harness-kit/SPEC.md (if the kit folder is in the project)SPEC.md at the project root (if it was copied there)Do not proceed until you have read the spec. All design guidance lives there.
Ask the following questions before making any recommendations:
If starting fresh → Scaffold Mode If existing code → Audit Mode
Walk through the six components in dependency order. For each component, apply the relevant spec section before generating any code.
Step 1 — Dialog Loop Read: Spec § Component 1
AsyncGenerator<StreamEvent>AbortController threadingStep 2 — Tool System Read: Spec § Component 2
buildTool() factory and one complete tool as a templateStep 3 — Permission Pipeline Read: Spec § Component 3
Step 4 — Context Management Read: Spec § Component 6
Step 5 — Memory System (if the agent needs cross-session persistence) Read: Spec § Component 5
Step 6 — Hook System (if operators need to customize behavior) Read: Spec § Component 7
Read the existing agent code, then check it against the spec. Generate a gap report.
For each component in the spec:
Output format for each finding:
Component: [name]
Status: [✅ compliant | ⚠️ partial | ❌ missing | 🔴 anti-pattern]
Finding: [one sentence]
Spec reference: § Component N
Action: [what to fix, or "none required"]
Prioritize findings: 🔴 anti-patterns first, ❌ missing components second, ⚠️ partial implementations third.
After scaffold or audit mode completes, run through this list explicitly:
Loop
Tools
Promise.all on writes)?Permissions
Context
Memory
Multi-Agent (if sub-agents are used)
Report any violations with spec section reference and suggested fix.
Example:
// Spec § Component 1: AsyncGenerator as loop signature
async function* dialogLoop(
initialMessage: string,
deps: QueryDeps
): AsyncGenerator<StreamEvent> {
// ...
}