skills/aisdkagents.com/write-agent-prompts

write-agent-prompts

Installation
SKILL.md

Write Agent Prompts

Rewrite the prompts an existing TypeScript or JavaScript AI SDK agent actually runs on. The unit of work is the effective prompt: every instruction the model receives in one merged context (system prompt, tool names and descriptions, schema and parameter descriptions, few-shot examples, and inline template strings). Inventory first, audit before any rewrite, restructure as versioned code the repo owns, then prove each meaningful change with before and after evals.

inventory -> audit -> baseline -> prompts-as-code -> rewrite system ->
rewrite tools/examples -> frame untrusted content -> ship with gates

Scope and hard guards

Work on an existing AI SDK agent or agent-backed chat feature. Change prompt modules, tool and schema description strings, example selection, and the smallest eval or CI seams needed to measure those changes. For writing first contracts or tightening weak descriptions without an audit-and-eval loop, use write-prompt-contracts. Do not redesign tool APIs (granularity, input schemas that prevent bad calls, error taxonomies). That work belongs to a future design-agent-tools skill: rewrite the words on existing tools; route API redesign in one paragraph and stop. Do not redesign context-window policy (truncation, compaction, subagent isolation). That belongs to a future context-engineering skill: decide how to say it; defer what belongs in the window.

Keep these guards active throughout the run:

Installs
26
First Seen
Jul 27, 2026