Best for
- Use when the thing you want to improve is a prompt/policy file (not tools or a skill package).
skillberry-ai/cap-evolve/skills/capabilities/system-prompt/SKILL.md
Optimize an agent's system prompt or policy text — the instructions that shape its behavior. Use when the thing you want to improve is a prompt/policy file (not tools or a skill package). Covers what is safely editable, how prompt wording changes agent behavior, common failure modes (over-long preambles, conflicting instructions, missing output contracts), and what to measure. Provides concrete materialize/apply/validate handlers for prompt artifacts.
Decision brief
The system prompt is the cheapest, highest-leverage parameter of most agents: a few words can flip success on a whole class of tasks. This capability treats one or more prompt/policy text files (prompt.txt, policy.md, SYSTEM.md) as the optimizable artifact.
Compatibility matrix
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/skillberry-ai/cap-evolve --skill "skills/capabilities/system-prompt"Inspect the Agent Skill "system-prompt" from https://github.com/skillberry-ai/cap-evolve/blob/4bb97c4e190c4795326d1834b3a5cea3cd3d499a/skills/capabilities/system-prompt/SKILL.md at commit 4bb97c4e190c4795326d1834b3a5cea3cd3d499a. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
These are how to phrase a prompt edit so it actually changes behavior:
Review the “How to run” section in the pinned source before continuing.
The prompt is HIGH-VALUE to edit, not a last resort. When the traces show the agent doesn't know a rule, a format, or a decision criterion, a sharper prompt is the fastest fix. Each lever below is a safe, bounded edit class — pick the one that fixes the biggest failure cluster.…
Role line — a single sentence stating who the agent is. A known cheap win:
The system prompt is the right lever when a failure is a knowledge gap — the agent doesn't know the required output format, a decision criterion, or a rule. Telling it teaches it, and behavior changes. The prompt is the WRONG lever when a failure is behavioral — the agent alread…
Permission review
The documentation asks the agent to run terminal commands or scripts.
python scripts/check.pyThe documentation asks the agent to run terminal commands or scripts.
python scripts/run.py --path <capability_dir> # prints the candidate + validityEvidence record
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 86/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 36 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
The system prompt is the cheapest, highest-leverage parameter of most agents: a
few words can flip success on a whole class of tasks. This capability treats one
or more prompt/policy text files (prompt.txt, policy.md, SYSTEM.md) as the
optimizable artifact.
The prompt is HIGH-VALUE to edit, not a last resort. When the traces show the
agent doesn't know a rule, a format, or a decision criterion, a sharper prompt is
the fastest fix. Each lever below is a safe, bounded edit class — pick the one
that fixes the biggest failure cluster. (1-line generic examples; depth in
references/concepts.md.)
<example>-tagged exemplars to pin format.
Ex: add one <example> showing the exact JSON envelope expected.{status, reason} — no prose."
If the eval scores COMMUNICATION of computed values (totals, refunds, savings,
counts, balances), the contract must require the agent to STATE each computed figure
explicitly in its final message. The agent often performs the DB action correctly
but never reports the number, and the eval marks the omission as a miss. This is a
KNOWLEDGE / output-contract gap — prose-fixable here — and is DISTINCT from a missing
DB action/write (a behavioral execution failure, which prose cannot fix and is out of
scope for this capability). Ex: "After computing a total/refund/savings, state the exact figure in
your final message (e.g. 'Your refund is $42.00')."CRITICAL/MUST/ALWAYS to "Use …
when …" when a cluster shows over-eagerness/over-triggering on current models.
Ex: "CRITICAL: you MUST call the tool" → "Use the tool when you need live data."NEVER drop a needed rule — change, consolidate, or add; don't delete. When an edit removes text, every distinct constraint that text carried must survive somewhere (rewritten, merged, or relocated). Deletion is legitimate only when the information is genuinely redundant or contradicted by the source — and even then, prefer rewriting the conflicting rule. Consolidation cuts words, never rules.
The good practices, failure modes, and the full never-drop rule are in
references/concepts.md — read it before a non-trivial edit.
<example> tags steer format (caveat: long example dumps can hurt
reasoning models — keep it to a handful).These are how to phrase a prompt edit so it actually changes behavior:
MUST/CRITICAL does not. "Never use ellipses" works far better as "your output
is read by a TTS engine that can't pronounce ellipses." Teach the optimizer to
write the reason, not the command.CRITICAL/MUST/ALWAYS) now causes over-eagerness and over-engineering.
Prefer plain "Use … when …". If a cluster shows over-doing rather than
under-doing, the edit is to cut or soften an instruction, not add one.<xml> tags so the model
doesn't conflate them.<TASK_SPECIFIC_ID>, apply the exact amount that one task expects."
Baking one task's id/value/date/answer into
the prompt overfits, fails the held-out gate, and can mislead other tasks. Use a
failing task's specifics only to understand the class, then write the general rule.The system prompt is the right lever when a failure is a knowledge gap — the agent doesn't know the required output format, a decision criterion, or a rule. Telling it teaches it, and behavior changes. The prompt is the WRONG lever when a failure is behavioral — the agent already "knows" what to do (it analyzes, explains, even confirms) but then skips the action (e.g. stalls before issuing a write and stops). More prose does not fix a behavior the model already agreed to and declined: that class of failure is OUT OF SCOPE for the prompt — only enforcing the action deterministically (outside this capability) fixes it. So before reaching for a prompt edit, classify each cluster as KNOWLEDGE (fix here) vs behavioral (not a prompt fix), and spend prose only on the knowledge gaps.
If a rule is a VIOLATION the agent commits despite knowing it (not a knowledge gap), do NOT add prose. Adding another sentence to a rule the agent already read and broke just grows the prompt without changing behavior — a known-but-broken rule needs deterministic enforcement the prompt cannot provide, so it is out of scope here.
A DECISION / PERMISSION cluster is NOT a knowledge gap — never loosen a global rule to fix it. When a cluster shows the agent making the wrong ACT-vs-REFUSE call, the agent usually already "knows" the rule; the real condition is just more specific than the prose. Relaxing the global rule makes the agent act on the WHOLE class and regresses every task where refusing/escalating was the gold answer (unbounded blast radius). The only safe prompt fix is a NARROWING rule that states the EXACT discriminating predicate that separates the qualifying cases — a prompt edit may only ADD knowledge or NARROW, never broaden a permission or flip a decision the agent currently gets right. If the condition cannot be expressed as a narrowing rule, it is out of scope for the prompt.
Each prompt iteration should also CONSOLIDATE. When a rule is now enforced deterministically elsewhere (no longer dependent on the prompt), REMOVE its now-redundant prose so the prompt stays sharp — the deterministic enforcement is authoritative and the duplicate sentence only dilutes attention. This prevents prose pile-up: the prompt should get shorter as constraints become enforced, not longer. (This is consolidation under the never-drop rule — the constraint still lives, enforced elsewhere, so removing its prose drops no rule.)
The prompt is prepended to context every turn. Agents read it literally and are sensitive to ordering, contradictions, and verbosity. Long preambles dilute attention; conflicting instructions resolve unpredictably.
materialize(dir) -> {file: text} · apply(dir, edits) -> report ·
validate(dir) -> {ok, files, problems}. Edit ops: set, append,
ensure_contains. A project adapter's apply can call these directly.
The optimizer should analyze before editing: from the traces + the current prompt, identify (a) the recurring failures clustered by root cause (the rule the agent keeps breaking) and (b) the good behavior seen only on some trials that should be made consistent; then make prompt edits for EVERY knowledge-gap cluster, paired with the tool-code fixes for the behavioral clusters in the SAME candidate, and reinforce (b) — sharpen or correct the offending rules rather than appending more preamble.
python scripts/check.py
python scripts/run.py --path <capability_dir> # prints the candidate + validity
references/concepts.md — why prompts are high-leverage; what to optimize; pitfalls.