Chapter 8

Skills, Instructions, and Sharp Agents

Two agents can run the same model, share the same tools, and live on the same machine — yet produce wildly different results. The difference is not the model. It is how clearly the agent is defined. A vague agent with a general-purpose prompt meanders between tasks and requires constant adjustment. A sharp agent with a narrow role, clear instructions, and matched tools does one thing well — predictably and repeatedly.

In Chapter 7, you saw the agent loop: how context assembles, the model reasons, tools are picked, and actions execute. The loop is the engine. This chapter is the steering — the four instruction sources that determine what the engine actually produces.

Four layers

Where instructions come from

Every agent-loop cycle, the model receives instructions from four sources. Understanding the hierarchy tells you where to put each piece of guidance.

  1. Profile prompt — the system prompt defining the agent's role and boundaries. Loaded every session, first.
  2. Skills — procedural documents loaded when relevant to the current task. Standard operating procedures.
  3. Memory — persistent facts and preferences carried across sessions. Loaded at session start.
  4. Project context — files like AGENTS.md describing project conventions. Loaded if present.

Layers stack in order: profile prompt → memory → skills → context files → conversation history (Ch7). More specific layers override general ones.

Design principle

Narrow roles produce reliable output

The most common design mistake is giving one agent too many responsibilities. A "do everything" agent sounds convenient — until it tries to research keywords and draft content and publish articles in the same session, producing mediocre output on each because its context is scattered. A narrow role means three things: a single area of responsibility, a limited set of tools, and a clear boundary where this agent stops and another takes over.

In your SEO workflow from Chapter 3, the research specialist finds and filters keyword data; the SEO manager drafts content and manages strategy. The specialist does not draft; the manager does not search. The boundary is clear: research produces data, the manager consumes it. Narrowness matters because every instruction, skill, and memory entry competes for space in the context window. Focused agents load only what they need — faster, more consistent, easier to debug.

Procedures

Skills: reusable procedures that guide the loop

A has three parts: a trigger (when to use it), a procedure (what to do), and an output contract (what the result looks like). Without a trigger, the skill loads at the wrong time — or not at all. Without a procedure, the agent improvises. Without an output contract, the next step may not be able to consume the result.

Here is the research specialist's keyword research skill — truncated to show structure:

yamlVerified
---
name: keyword-research
description: "Use when the user asks for keyword ideas, search volume data, or content topic research."
version: 1.0.0
metadata:
  hermes:
    tags: [seo, keywords, research]
---

# Keyword Research Procedure

## Steps
1. Clarify the topic and target audience if not specified
2. Search for the core topic using the web search tool
3. Search for 2-3 long-tail variations
  …
7. Save the top results to a keyword file
8. Return a summary (top 5 only) to the user

## Output Contract
- Keyword (string)
- Estimated relevance (high/medium/low)
- Competition level (high/medium/low)
- Angle (brief description of the content angle)

Save full list to file. Return only top 5 in conversation.

Your SEO workflow

Writing procedures: research and content

In Chapter 7, you saw the research specialist run through the agent loop to find keywords, then wait for your review before the SEO manager started drafting. That review step is a judgment gate — a point where you decide whether the output is good enough to proceed. Skills make judgment gates possible because they define what "good enough" looks like.

Research specialist — keyword research skill

Finds keywords via web search, filters by relevance and competition, returns a structured list (keyword, relevance, competition, angle). Saves the full list to file; returns only top 5 in conversation. Does not draft — that is the manager's job.

SEO manager — content brief skill

Reads the keyword file, selects top keywords for the cycle, and drafts a structured brief: target keyword, secondary keywords, proposed title, content angle, word count range, internal links. The skill follows the same structure — trigger, steps, output contract — with "Do NOT publish" as the final instruction. Waits for your approval before content moves to production.

That last line — Do NOT publish — is a judgment gate encoded directly into the skill. The approval system catches dangerous actions (shell commands, deletions). Skills catch process violations (publishing without review). Output contracts catch format problems (missing fields, wrong structure). Three layers of quality control, each checking a different dimension.

Tool access

Match tools to the role, not the agent

In Chapter 3, you saw that toolsets are enabled or disabled per profile. This is a design tool, not just a security feature. The tools available to an agent shape what the loop can do. If the research specialist has no web search toolset, it cannot research — no matter how detailed the skill. If the SEO manager has shell execution enabled, it might publish without waiting for approval.

Give each profile only the toolsets it needs. The research specialist needs web search, file read/write. The SEO manager needs file read/write only — the specialist provides the data. Fewer tools with clear descriptions produce more consistent tool selection than a long list of options the agent does not need.

Quality loops

Feedback loops: how agents get better over time

A sharp agent is not built in one pass. It starts with reasonable design and gets sharper through three feedback mechanisms:

  1. Skill patching — when you correct the agent on a procedure, it patches the skill document. Next time the skill loads, the patched version is used. The agent follows instructions to persist your feedback; it does not independently become smarter.
  2. Memory updates — when you tell the agent to remember a preference, it stores that in memory. Future sessions load it automatically. "Always exclude competitor brand names from keyword lists" becomes a standing rule.
  3. Output contract enforcement — when output does not match the contract, the gap is visible immediately. A missing field is obvious; a wrong format is obvious. You correct the output, and update the skill if the contract was unclear.

These form a loop: the agent produces output, you review it, you give feedback, the agent incorporates it into skills and memory, the next output is better. Over time, the agent sharpens — not because the model changed, but because instructions, procedures, and preferences accumulated through real use.

Your SEO workflow

Sharp agents, clear handoffs

Here is how the pieces combine for your SEO team:

Research specialist

Narrow role: find and filter keyword data. Skill: search, filter, score, save, return top 5. Memory: which sources worked, preferred filters. Tools: web search, file read/write. Output: structured list with keyword, relevance, competition, angle.

SEO manager

Narrow role: draft briefs, manage standards. Skill: read keyword file, select top keywords, draft brief, wait for approval. Memory: brand voice, word count preferences, style rules. Tools: file read/write. Output: brief with target keyword, secondary keywords, title, angle, word count, internal links.

The specialist saves keywords to a file; the manager reads that file. The judgment gate sits between them: you review before the manager drafts. When output falls short, you patch skills or update memory — and both agents start sharper next session. Same model, different steering. Good steering produces sharp agents.

Your research specialist consistently returns too many keywords (50 instead of 20), filling the context window and making it hard for the SEO manager to pick the best ones. Where would you fix this — in the profile prompt, the skill, memory, or the output contract? Why?