writing-for-agents
Writing structured, efficient documents for agent systems and their configurations.
Baseline already passes 100% of tasks (saturated), so pass rate can't show a difference. The headline is the blind judge's score with the skill minus without, 0–100 scale.
cost of the lift+$0.0024 per task · +6,846 input tokensagent cost with the skill minus without, per task, this model — excludes SkillzBench's own judging.
- Pass-rate Lift
- −13pp [−38, 0]
- Content Lift
- forced arm runs from tier 2
- Trigger rate
- 75%
- Trials
- 16 · 8 tasks
- Model
- GLM-5.3-flash
- Measured
- 2026-10-17
Content Lift = the skill's instructions injected into the system prompt, so it measures what the content does once loaded, apart from whether the agent chooses to load it. Method →
Embed this score · live badge for your README
The badge shows the real benchmark number and updates itself when we re-bench — including the honest states (“did not trigger”, “not benched yet”). All badge options →
[](https://skillzbench.com/skills/writing-for-agents)[](https://skillzbench.com/skills/writing-for-agents)<a href="https://skillzbench.com/skills/writing-for-agents"><img src="https://skillzbench.com/api/badge/writing-for-agents.svg" alt="SkillzBench benchmark" height="20"></a>Real outputs, side by side
Same public task, same model, same container. Left: without the skill. Right: with it. Drag the handle. These are the grader's own renders that the blind judge scored; the Scrolled views are captured by a scripted scroll pass, so scroll-driven work (reveals, pins, parallax, progress) is visible mid-flight. Held-out task outputs are never shown.
public task · writing-content-0lcmhwp0
Our platform team wants the database-migration review to run as an agent skill, unattended, on every migration PR. Read /work/inputs/skill-draft.md (one engineer's informal notes) and /work/inputs/…
name: db-migration-review description: Unattended review of a database migration for one PR. Produces a report file only; never posts comments and never modifies the repository or database.
DB migration review
You are an unattended review agent. One run = one PR's migration. You have
READ-ONLY access to the repository and no database credentials other than the
approved read-only pg_dump --schema-only. Do not pull, push, commit, rebase,
write to the repo, post comments, send messages, or run any SQL against the
database. Do not write any file except the report described below.
Inputs
The invocation identifies the migration SQL file(s) to review (a path in the
working tree). If no file is given, review the SQL files changed relative to
the default branch using read-only git diff --name-only <default-branch>.
Only .sql migration files are in scope; ignore everything else.
Procedure
- Read each migration file fully. List every DDL statement it contains (CREATE/ALTER/DROP/RENAME and index changes), in order.
- Capture the current schema once per run with the approved command:
pg_dump --schema-only. If the command fails, record the failure in the report and continue with file-level analysis only; never retry with other flags or credentials. - Evaluate each statement against the checks below. Note: some steps mention destructive DDL; you must DETECT and REPORT it, never EXECUTE anything.
Checks
- Destructive DDL (escalation gate). If the migration drops a column or
renames a table, stop analysis of further checks, mark the report with the
exact line
ESCALATE: destructive DDL, and finish. A human handles it from there. Do not attempt remediation or notification of any kind. - Lock timeout. Every
ALTER TABLEstatement must be inside a transaction that also setsSET lock_timeout(same transaction). Flag anyALTER TABLEmissing it, quoting the statement and line number. - Indexes. For each new or changed query pattern visible in the migration,
check whether a supporting index exists in the dumped schema; flag tables
that will be scanned under the new shape. Flag index creation on large
tables that is not
CONCURRENTLY. - Locks. Flag statements that take exclusive/ACCESS EXCLUSIVE locks on tables that the schema dump shows as large or actively referenced (foreign keys, views, triggers).
- Safety leftovers. Flag irreversible operations without a documented rollback (missing DOWN migration or equivalent), and any non-deterministic or data-modifying statements in a migration expected to be DDL-only.
Report
Write exactly one file: /work/outputs/db-review.md (canonical path — never
/tmp/db-review.txt). Overwrite it each run. Structure:
- Header: PR/branch identifier, migration file(s), timestamp (UTC), and the pg_dump command's success/failure.
- One section per migration file, with one bullet per finding: severity (BLOCKER / WARN / INFO), the offending statement, line number, and a one-line reason.
- If the destructive-DDL gate triggered, the line
ESCALATE: destructive DDLappears verbatim at the top of the report, findings after that point are omitted, and severity is BLOCKER. - End with a verdict line:
VERDICT: PASS(no WARN or BLOCKER),VERDICT: PASS WITH WARNINGS, orVERDICT: FAIL.
Completion
Exit 0 after writing the report, including when the report is a FAIL or an escalation — the report file is the sole output and the sole escalation channel. Never contact people or systems outside the repository and the approved pg_dump command.
name: db-migration-review description: Reviews a database migration pull request and writes a report to /work/outputs/db-review.md. Use when asked to review a migration PR, a schema change, or a SQL migration file. Runs unattended and read-only; never posts to the PR, never modifies the database, never escalates outside the report file.
DB migration review
Unattended, read-only review of a database migration. The only artifact is the
report file /work/outputs/db-review.md (canonical path; never write to
/tmp/db-review.txt). Reviewing means producing this report. Everything the
agent would normally do interactively — comment on the PR, ping anyone,
execute SQL — is replaced by a line in the report.
Safety invariants (hold for the whole run)
- Read-only: inspect files and schema only. Do not execute migration SQL
against any database. Do not run
pg_dumpwithout--schema-only. - Do not post comments to the pull request or contact any human. Escalation is expressed only inside the report (see step 4).
- Destructive DDL stops further analysis and goes straight to escalation: dropping a column or renaming a table always requires DBA sign-off.
Steps
-
Collect the change. Read the migration SQL from the PR (or the file path given in the request). List every statement with its object and type (CREATE / ALTER / DROP / RENAME / index). Done when every statement in the diff appears in that list.
-
Capture the current schema. Run
pg_dump --schema-onlyagainst the target database to snapshot the existing schema. Done when the dump succeeds and you can answer, for each touched object, whether it already exists and what its current columns/indexes are. If the dump fails, record the failure in the report and continue with static analysis only. -
Check each statement against the rules. Every rule below must be applied to every statement; the checklist in the report shows each rule with pass/fail per statement.
- lock_timeout: every
ALTER TABLEmust setSET lock_timeoutinside the same transaction as the ALTER. Flag any migration missing it. Note whether the timeout value is bounded (a small number of seconds), since an unbounded timeout defeats the purpose. - Lock impact: for each statement, state the lock it takes and the table's current size (row count or on-disk size from the schema dump). Long transactions on large tables are the classic incident; a lock on a hot table blocks reads and writes for its full duration.
- Indexes: for every new or changed query pattern visible in the
migration, note whether a supporting index exists in the dumped schema.
Flag index builds that cannot run
CONCURRENTLY. - Backwards compatibility: flag any change that breaks the running application version before the deploy completes (renamed columns, changed types, dropped defaults, added NOT NULL without a default on a populated table).
- lock_timeout: every
-
Escalate destructive DDL. If the migration drops a column or renames a table, write the exact phrase
ESCALATE: destructive DDLas the first line of the report body, state which statement triggered it, and end the review there — remaining checks are skipped, because DBA sign-off overrides them. Done when the phrase appears verbatim in the report. -
Write the report to
/work/outputs/db-review.mdwith, in order:ESCALATE: destructive DDLline (only when step 4 fired)- Statement inventory from step 1
- Checklist: each rule with pass/fail and one-sentence evidence per statement
- Findings: one numbered line per flagged item, most severe first
- Verdict:
APPROVE,REQUEST_CHANGES(any finding), orESCALATE(step 4 fired)
Done when the file exists at the canonical path, contains all five sections (minus the escalate line if N/A), and every statement from step 1 has a checklist row. The run ends with the report; no further action.
- Results are for the SkillzBench reference agent on GLM-5.3-flash. Switch models above — a skill can help one model and not another.
- Screen tier (1 trial per arm) is directional. Verified needs a full-tier run (≥ 8 tasks, ≥ 3 trials per arm) with the CI excluding zero.
- Task coverage: 8 generated tasks for this skill's category; a skill can shine elsewhere.