Agent skill

prompting

Guide for writing effective system prompts for LLM agents. Use when creating or editing system prompts for applications, agent configurations, or development tools.

Stars 0
Forks 0

Install this agent skill to your Project

npx add-skill https://github.com/tanishqkancharla/boilerplate/tree/main/.opencode/skill/prompting

SKILL.md

Prompting

Write effective system prompts for LLM agents and applications.

Core Philosophy

LLMs are intelligent by default. They will take reasonable steps without explicit instruction. A system prompt exists to set direction and impose constraints, not to explain how to think or reason.

Start with an empty or minimal prompt. Observe what the agent does wrong. Add instructions only for behaviors that need correction. Every line in a prompt should justify its presence by fixing a real observed problem.

Avoid:

  • Explaining capabilities the model already has
  • Listing obvious best practices
  • Adding instructions "just in case"
  • Repeating information in multiple ways

Structure

Use markdown with sections and paragraphs. Each section describes a specific behavior or constraint.

Formatting rules

  • Use headings up to level 3 only
  • Use plain paragraphs for explanations
  • Do not use bold or italics
  • Do not use emojis
  • Use code blocks for commands or code examples
  • Use lists sparingly, only when enumerating distinct items

Section organization

Each section should:

  1. State what the agent should do or avoid
  2. Explain why, if the reason is non-obvious
  3. Provide examples showing correct behavior

Examples

Examples are the most effective way to communicate behavior. Wrap each example in <example> tags with user: and assistant: prefixes.

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

For complex behaviors, use separate example tags for each case:

<example>
user: Explain how authentication works in this codebase
assistant: [reads relevant files, then provides explanation]
</example>

<example>
user: Fix the bug in the login form
assistant: [investigates the issue, makes the fix, verifies it works]
</example>

When behavior involves tool use or multiple steps, describe actions in brackets rather than showing tool invocations:

<example>
user: Find all TODO comments
assistant: [searches codebase for TODO patterns]
Found 3 TODOs:
- src/auth.ts:45: TODO: add rate limiting
- src/api.ts:120: TODO: handle edge case
- src/db.ts:89: TODO: add index
</example>

Each user/assistant pair gets its own example tag:

<example>
user: 4 + 4
assistant: 8
</example>

<example>
user: What's the time complexity of binary search?
assistant: O(log n)
</example>

What to Include

Include instructions for:

  • Behaviors the model gets wrong by default
  • Domain-specific constraints or requirements
  • Output format requirements when they matter
  • Safety or security boundaries
  • Integration with specific tools or systems

What to Omit

Do not include:

  • General reasoning or thinking instructions
  • Explanations of how to approach problems
  • Common sense behaviors
  • Obvious ethical guidelines
  • Verbose descriptions of capabilities

Iteration

Prompt development is empirical:

  1. Start minimal
  2. Test with real inputs
  3. Identify failures
  4. Add targeted fixes
  5. Remove instructions that prove unnecessary

Track which instructions address which problems. If you cannot point to a specific failure that an instruction prevents, consider removing it.

Model-Specific Guidance

Different models have different default behaviors and respond to different prompting patterns. Consult the relevant guide when writing prompts for a specific model:

  • claude.md - XML structure, countering list overuse and sycophancy, trigger words, parallel execution
  • openai.md - Contradiction sensitivity, message role hierarchy, verbosity control, metaprompting
  • gemini.md - Conciseness instructions, tool call explanations, library assumptions, context placement

Expand your agent's capabilities with these related and highly-rated skills.

tanishqkancharla/boilerplate

dev-browser

Browser automation with persistent page state. Use when users ask to navigate websites, fill forms, take screenshots, extract web data, test web apps, or automate browser workflows. Trigger phrases include "go to [url]", "click on", "fill out the form", "take a screenshot", "scrape", "automate", "test the website", "log into", or any browser interaction request.

0 0
Explore
mattpocock/skills

handoff

Compact the current conversation into a handoff document for another agent to pick up.

111,310 9,758
Explore
mattpocock/skills

obsidian-vault

Search, create, and manage notes in the Obsidian vault with wikilinks and index notes. Use when user wants to find, create, or organize notes in Obsidian.

111,310 9,758
Explore
mattpocock/skills

git-guardrails-claude-code

Set up Claude Code hooks to block dangerous git commands (push, reset --hard, clean, branch -D, etc.) before they execute. Use when user wants to prevent destructive git operations, add git safety hooks, or block git push/reset in Claude Code.

111,310 9,758
Explore
mattpocock/skills

edit-article

Edit and improve articles by restructuring sections, improving clarity, and tightening prose. Use when user wants to edit, revise, or improve an article draft.

111,310 9,758
Explore
mattpocock/skills

setup-pre-commit

Set up Husky pre-commit hooks with lint-staged (Prettier), type checking, and tests in the current repo. Use when user wants to add pre-commit hooks, set up Husky, configure lint-staged, or add commit-time formatting/typechecking/testing.

111,310 9,758
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results