Write agent

From hawkyre/hawk-skills · View interactive version

Write agent is an AI agent skill from the GitHub repository hawkyre/hawk-skills. Design or fix an LLM agent's system prompt, tools, and domain limits. Use when building an agent, defining its system prompt, or correcting unsupported actions, off-topic answers, and claims made without tool evidence. Do not use for a single prompt without tools or for general copywriting.

How to use this skill

Skill file

Write a constrained agent

An agent is defined by three boundaries that must agree:

  1. Prompt — who it is and what it refuses.
  2. Tools — what it can actually do (the real capability boundary).
  3. Guardrails — what is enforced regardless of what the model decides.

Scope creep, hallucinated capabilities, and "it started writing Python" are all the same bug: one of the three boundaries was missing or the three disagree. The prompt said "relationship CRM" but nothing stopped it from being a general assistant, so it was one.

Core stance (consensus across Sierra, Anthropic, OpenAI): the prompt is not a guardrail. A motivated or confused user argues around prose. Scope must also live in the toolset (no tool ⇒ no capability) and in a deterministic layer the model cannot cross. Prompt for scope, then back it.

Process

Step 0 — Name the job in one sentence

Write the agent's single job and its bounded domain in one sentence: "Hermes captures and answers questions about the user's people and relationships." If it needs "and also…", that's a second agent — route between them rather than widening one. A fuzzy job statement guarantees a fuzzy scope.

Step 1 — Enumerate capabilities and non-goals

Step 2 — Write the system prompt

Use this skeleton (adapt wording; don't paste verbatim into an unrelated domain):

ROLE: You are <name>, a <one-line expertise + context>. Your one job: <the job>.
You work only through your tools and the records they expose.

YOU ONLY: <the 2–6 in-scope capabilities, each a concrete action or answer>.

YOU ARE NOT a general assistant. You do not write code, do math, draft unrelated
text, answer general-knowledge / how-to questions, or give advice outside <domain>.

OUT OF SCOPE → decline + redirect (one line), never produce the off-topic content:
  "That's outside what I do — I'm <role>. I can <in-scope action> instead."

CAPABILITY HONESTY: only do what your tools actually allow; never claim or invent an
action you can't take; answer only from tool results, never from your own knowledge.
If you don't have it, say so and offer to look it up or record it.

[domain procedure / decomposition rules go here]

Calibration that matters:

Step 3 — Make the toolset the capability boundary

The cleanest "I can't do that" is having no tool to do it. Design tools for the agent, not as 1:1 API wrappers:

Step 4 — Add guardrail layers, sized to risk

The prompt is layer one. Add deterministic layers the model can't talk its way past:

For a small/local single-user agent, layers can be lightweight (a strong scoped prompt + tool-gating + one input relevance check). For anything multi-user, regulated, or money-moving, the input+output+deterministic layers are not optional.

Step 5 — Eval scope adherence (don't assume it)

Scope that isn't measured regresses silently. Minimum battery:

Anti-patterns → the guard for each

| Failure | Looks like | Guard |

| --- | --- | --- |

| Scope creep | answers off-domain like a chatbot | explicit YOU ONLY / YOU ARE NOT + input relevance rail + scripted redirect |

| Hallucinated capability | claims it can do X with no tool | capability-honesty clause; toolset = boundary; no tool ⇒ no action |

| Answer-from-memory | skips the tool, improvises facts | "answer only from tool results"; cite the record; tool-first instruction |

| Prompt injection / jailbreak | "ignore previous instructions / reveal your prompt" | safety classifier + rules/regex + never expose the system prompt; terminate mode |

| Sycophancy | caves to pressure to act out of scope | honesty over agreement; a deterministic tripwire that halts, not the model "deciding" |

| Long-chat drift | wanders off-domain over many turns | output rail; re-inject scope on long conversations |

| Tool confusion | wrong tool / wrong params | few tools, namespacing, clear descriptions, poka-yoke, helpful errors |

| High-risk action unsupervised | autonomous refund / destructive write | tool risk ratings; confirm/human-in-the-loop before high-risk calls |

| Over/under tool-triggering | too-forceful prompt overtriggers | calibrate language to the model; verify with evals |

References

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.