Agent skill

System Prompt Writing Guide

by cashew-labs in cashew-labs/libretto

Lays out a minimal, iteration-first approach to writing system prompts for LLM agents, with model-specific notes for Claude, GPT, Gemini, and Codex.

MITAuto-check passedAI & LLM Engineering

Install System Prompt Writing Guide

skills CLI
$ npx skills add cashew-labs/libretto --skill prompting -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install cashew-labs/libretto prompting --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/cashew-labs/libretto.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/prompting .claude/skills/prompting && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
prompting
GitHub stars
904
Token cost
~570 tokens
SKILL.md length
226 words
Files
5 (incl. references)
Skills in repo
21
Repo updated
First seen
Licence
MIT

At a glance

Lays out a minimal, iteration-first approach to writing system prompts for LLM agents, with model-specific notes for Claude, GPT, Gemini, and Codex.

  • Writing a new system prompt for an LLM-powered application
  • SKILL.md covers Philosophy, Structure, Examples and Include, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Debugging why an agent keeps making the same mistake

What it does

This skill treats a system prompt as setting direction and constraints rather than explaining reasoning, and pushes starting minimal, observing real failures, and adding only targeted fixes, each one justified by a specific problem it solves. It bans explaining existing capabilities, listing obvious practices, or repeating information.

It prescribes a markdown structure with one behavior or constraint per section, example pairs wrapped in tagged user and assistant blocks, and bracketed placeholders for tool actions instead of real invocations. Separate reference files cover model-specific patterns, from countering sycophancy and XML structure for Claude to contradiction sensitivity and verbosity control for GPT, conciseness and context placement for Gemini, and autonomy patterns for Codex.

When your agent uses it

  • Writing a new system prompt for an LLM-powered application
  • Debugging why an agent keeps making the same mistake
  • Trimming an overgrown system prompt down to what actually matters

Example prompts

  • “Write a minimal system prompt for a customer-support agent.”
  • “This agent keeps hedging, tighten the system prompt for Claude.”
  • “Review this GPT system prompt for instructions that don't solve a real problem.”

What it can do on your machine

Read from SKILL.md and the folder at commit 41ab782. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

System Prompt Writing Guide loads about 570 tokens when it runs, and up to ~11k if it reads all its reference files. Until then it costs about 44 tokens; SKILL.md has 226 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~44
When it runs · the whole SKILL.md, loaded when a task matches
~570
With references · SKILL.md plus every file in references/, read only if the agent opens them
~11k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from cashew-labs/libretto at commit 41ab782, republished under its MIT licence (© cashew-labs). 226 words, ~570 tokens.

Download SKILL.mdSave it as .claude/skills/prompting/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
prompting
description
Guide for writing effective system prompts for LLM agents. Use when creating or editing system prompts for applications, agent configurations, or development tools.

Prompting

Philosophy

LLMs are intelligent by default. System prompts set direction and impose constraints, not explain reasoning.

Start minimal. Observe failures. Add targeted fixes. Every instruction must justify its token cost by solving a real problem.

Do not explain existing capabilities, list obvious practices, add preventive instructions, or repeat information.

Structure

Use markdown sections and paragraphs. Each section describes one behavior or constraint.

State what to do or avoid. Explain why if non-obvious. Show correct behavior with examples.

Formatting

Headings up to level 3. Plain paragraphs. No bold, italics, or emojis. Code blocks for commands. Lists only for distinct enumerable items.

Examples

Wrap examples in <example> tags with user/assistant prefixes. One pair per tag.

<example>
user: What's the capital of France?
assistant: Paris
</example>

Use brackets for tool actions instead of showing invocations:

<example>
user: Find all TODO comments
assistant: [searches codebase]
Found 3 TODOs: ...
</example>

Include

Behaviors the model gets wrong by default. Domain constraints. Output format requirements. Safety boundaries. Tool integrations.

Omit

Reasoning instructions. Problem-solving approaches. Common sense behaviors. Ethical guidelines. Capability descriptions.

Iteration

Start minimal. Test with real inputs. Identify failures. Add targeted fixes. Remove unnecessary instructions.

Track which instructions prevent which failures. If you cannot identify the specific problem an instruction solves, remove it.

Model-Specific Guidance

Consult references/ for model-specific patterns:

  • references/claude.md - XML structure, countering sycophancy, trigger words, parallel execution
  • references/gpt.md - Contradiction sensitivity, role hierarchy, verbosity control, metaprompting
  • references/gemini.md - Conciseness, tool explanations, library checks, context placement
  • references/codex.md - OpenAI Codex models, tool implementations, autonomy patterns, compaction

© cashew-labs, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 4 other files (references) in .agents/skills/prompting of cashew-labs/libretto.

  • SKILL.md
  • references/claude.md
  • references/codex.md
  • references/gemini.md
  • references/gpt.md

Open the folder on GitHubat commit 41ab782

Compare with similar skills

System Prompt Writing Guide next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

System Prompt Writing Guide compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
System Prompt Writing Guide this skillcashew-labs/libretto904—~570Automated safety check: PassMIT
Image Ad Clonekrusemediallc/arcads-claude-code1.6k—~2.4kAutomated safety check: NotesMIT
AI Image Prompts SkillLeoYeAI/openclaw-master-skills2.2k—~4.3kAutomated safety check: PassMIT
Codebase Managementgiancarloerra/SocratiCode3.3k1 repos~1.8kAutomated safety check: PassAGPL-3.0
Codex Fable5baskduf/FableCodex437—~1.6kAutomated safety check: PassAGPL-3.0
Bananahubbananahub-ai/bananahub-skill118—~7.1kAutomated safety check: PassMIT

Similar skills

  • Image Ad Clone

    krusemediallc/arcads-claude-code

    A skill your agent uses when the user wants to reverse-engineer an existing image ad into a reusable prompt template.

    1.6k GitHub stars~2.4k tokensUpdated 18 days ago
    Media & CreativeAuto-check: notes
  • AI Image Prompts Skill

    LeoYeAI/openclaw-master-skills

    Recommend curated prompts from a 10,000+ real-world image generation prompt library.

    2.2k GitHub stars~4.3k tokensUpdated 2 mo ago
    Media & CreativeAuto-check passed
  • Codebase Management

    giancarloerra/SocratiCode

    Set up, index, and manage SocratiCode codebase indexing. An agent skill from giancarloerra/SocratiCode.

    3.3k GitHub starsUsed in 1 repo~1.8k tokens
    AI & LLM EngineeringAuto-check passed
  • Codex Fable5

    baskduf/FableCodex

    Apply a Claude Fable 5 inspired operating style inside Codex.

    437 GitHub stars~1.6k tokensUpdated 2 mo ago
    AI & LLM EngineeringAuto-check passed
  • Bananahub

    bananahub-ai/bananahub-skill

    Agent-native image workflow and optional prompt optimizer for /bananahub and generic agent image generation requests.

    118 GitHub stars~7.1k tokensUpdated 4 mo ago
    Media & CreativeAuto-check passed
  • AI Wrapper Product

    davila7/claude-code-templates

    Expert in building products that wrap AI APIs (OpenAI, Anthropic, etc.) into focused tools people will pay for.

    33k GitHub starsUsed in 4 repos~1.7k tokens
    AI & LLM EngineeringAuto-check passed

More from cashew-labs/libretto

All 21 skills in this repo
  • Address PR Review Comments

    cashew-labs/libretto

    Works through the review comments on a pull request one by one: fetches the threads, makes the fixes, runs type-check, build and lint, pushes, and resolves the threads.

    904 GitHub stars~532 tokensUpdated 1 mo ago
    Auto-check passed
  • CLI Development

    cashew-labs/libretto

    Design rules for command-line tools: subcommand-scoped help, actionable success output, debuggable failures, stable output, meaningful exit codes and a --json mode.

    904 GitHub stars~781 tokensUpdated 1 mo ago
    Auto-check passed
  • Drives desktop Electron apps already installed on your machine, such as Slack, Discord or VS Code, by relaunching them with a debugging port and using the Libretto CLI.

    904 GitHub stars~967 tokensUpdated 1 mo ago
    Auto-check passed
  • Merge Conflict Resolver

    cashew-labs/libretto

    Resolves Git merge, rebase and cherry-pick conflicts by reading the PRs behind each side, keeping both intents and asking you when they truly clash.

    904 GitHub stars~1.1k tokensUpdated 1 mo ago
    Auto-check passed
  • Feature Spec Generator

    cashew-labs/libretto

    Researches the codebase and relevant docs, asks clarifying questions, then writes a spec sheet in specs/ for a significant feature or complex fix.

    904 GitHub stars~2.4k tokensUpdated 1 mo ago
    Auto-check passed
  • Glimpse Changes Walkthrough

    cashew-labs/libretto

    Turns the current session's code changes into a Markdown walkthrough shown in a native Glimpse window, with highlighted code, rendered diffs and review feedback.

    904 GitHub stars~1.5k tokensUpdated 1 mo ago
    Auto-check passed

Questions about System Prompt Writing Guide

What does System Prompt Writing Guide do?

Lays out a minimal, iteration-first approach to writing system prompts for LLM agents, with model-specific notes for Claude, GPT, Gemini, and Codex. This skill treats a system prompt as setting direction and constraints rather than explaining reasoning, and pushes starting minimal, observing real failures, and adding only targeted fixes, each one justified by a specific problem it solves. It bans explaining existing capabilities, listing obvious practices, or repeating information.

When should I use System Prompt Writing Guide?

System Prompt Writing Guide fits situations like: writing a new system prompt for an LLM-powered application; debugging why an agent keeps making the same mistake; trimming an overgrown system prompt down to what actually matters.

How do I install System Prompt Writing Guide in Claude Code?

Run `npx skills add cashew-labs/libretto --skill prompting -a claude-code`. Or copy the skill folder (.agents/skills/prompting in cashew-labs/libretto) into .claude/skills/prompting in your project. Claude Code loads it when a task matches its description.

How do I install System Prompt Writing Guide in Codex?

Run `npx skills add cashew-labs/libretto --skill prompting -a codex`. Or copy the skill folder (.agents/skills/prompting in cashew-labs/libretto) into .agents/skills/prompting in your project. Codex loads it when a task matches its description.

Can I use System Prompt Writing Guide in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add cashew-labs/libretto --skill prompting -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/prompting, .gemini/skills/prompting, .github/skills/prompting and .opencode/skills/prompting in your project.

What does System Prompt Writing Guide need to run?

SKILL.md names no scripts, command-line tools or credentials: System Prompt Writing Guide is instructions for the agent only.

Does System Prompt Writing Guide access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is System Prompt Writing Guide safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does System Prompt Writing Guide use?

System Prompt Writing Guide is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does System Prompt Writing Guide use?

About 570 tokens (SKILL.md is roughly 2.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 10k tokens, read only when the agent opens those files.

What are the alternatives to System Prompt Writing Guide?

Skills that share tags, products or a category with System Prompt Writing Guide: Image Ad Clone (krusemediallc/arcads-claude-code, 1.6k stars), AI Image Prompts Skill (LeoYeAI/openclaw-master-skills, 2.2k stars), Codebase Management (giancarloerra/SocratiCode, 3.3k stars) and Codex Fable5 (baskduf/FableCodex, 437 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains System Prompt Writing Guide?

cashew-labs (a GitHub organization) maintains it in cashew-labs/libretto, which has 904 GitHub stars. The repository holds 21 skills in this directory. The repository was last updated on August 21, 2026.

Source: cashew-labs/libretto on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.