Agent skill

Prompt Engineering

by trycompai in trycompai/comp

Prompt engineering best practices - invoke with @prompt-engineering

AGPL-3.0Auto-check passedAI & LLM Engineering

Install Prompt Engineering

skills CLI
$ npx skills add trycompai/comp --skill prompt-engineering -a claude-code

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

GitHub CLI
$ gh skill install trycompai/comp prompt-engineering --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/trycompai/comp.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/prompt-engineering .claude/skills/prompt-engineering && 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
prompt-engineering
GitHub stars
2k
Token cost
~1.4k tokens
SKILL.md length
363 words
Files
1
Skills in repo
31
Repo updated
First seen
Licence
AGPL-3.0

At a glance

Prompt engineering best practices - invoke with @prompt-engineering

  • Works in 8 steps: Define Success Criteria First → When to Use Prompt Engineering vs… → Be Clear and Direct → …
  • Tasks that involve Prompt engineering
  • SKILL.md covers Core Principles and The 6 Core Techniques
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Prompt Engineering is an agent skill from trycompai/comp. Prompt engineering best practices - invoke with @prompt-engineering

Its SKILL.md is about 1.4k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in AI & LLM Engineering, covering Prompt engineering. The repository describes itself as: AI Native platform to get companies compliant - Vanta & Drata Alternative. The licence is AGPL-3.0.

When your agent uses it

  • Tasks that involve Prompt engineering

Example prompts

  • “/prompt-engineering”

Requirements

  • Python 3

Workflow steps

8 steps, taken from the step headings in SKILL.md.

  1. Define Success Criteria First
  2. When to Use Prompt Engineering vs Fine-tuning
  3. Be Clear and Direct
  4. Use Examples (Multishot Prompting)
  5. Let Claude Think (Chain of Thought)
  6. Use XML Tags
  7. Give Claude a Role (System Prompts)
  8. Prefill Claude's Response

What it can do on your machine

Read from SKILL.md and the folder at commit 1bf4d52. 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 (its code samples are xml).

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

  • Network

    Links to these hosts (documentation or services it may open):

    • platform.claude.com

    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

Prompt Engineering loads about 1.4k tokens when it runs. Until then it costs about 22 tokens; SKILL.md has 363 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~22
When it runs · the whole SKILL.md, loaded when a task matches
~1.4k

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 trycompai/comp at commit 1bf4d52, republished under its AGPL-3.0 licence (© trycompai). 363 words, ~1,351 tokens.

Download SKILL.mdSave it as .claude/skills/prompt-engineering/SKILL.md (or your agent's skills folder).
name
prompt-engineering
description
Prompt engineering best practices - invoke with @prompt-engineering

Source Cursor rule: .cursor/rules/prompt-engineering.mdc. Original file scope: .cursor/rules/*.mdc. Original Cursor alwaysApply: false.

Prompt Engineering Best Practices

Based on Claude's Prompt Engineering Documentation

Core Principles

1. Define Success Criteria First

Before writing prompts:

  • Establish clear objectives: What constitutes a successful response?
  • Create evaluation metrics: How will you measure prompt effectiveness?
  • Draft and iterate: Start with a first draft and refine based on results
2. When to Use Prompt Engineering vs Fine-tuning

Prompt engineering is preferred because:

  • Resource efficient: Only requires text input, no GPUs
  • Cost effective: Uses base model pricing
  • Maintains updates: Works across model versions
  • Time saving: Instant results vs hours/days for fine-tuning
  • Minimal data needs: Works with zero-shot or few-shot
  • Flexible iteration: Quick experimentation cycle
  • Preserves knowledge: No catastrophic forgetting
  • Transparent: Human-readable, easy to debug

The 6 Core Techniques

1. Be Clear and Direct

Principle: Provide explicit, unambiguous instructions.

❌ Bad: "Tell me about it"
✅ Good: "Summarize the following article in three bullet points, focusing on key findings"

❌ Bad: "Help with code"
✅ Good: "Debug this Python function that should return the sum of even numbers in a list"

Tips:

  • State the task explicitly at the start
  • Specify the desired output format (bullet points, JSON, paragraphs)
  • Include constraints (word count, tone, audience)
  • Mention what to include AND what to exclude
2. Use Examples (Multishot Prompting)

Principle: Show the model what you want through examples.

xml
<examples>
  <example>
    <input>The movie was absolutely terrible, waste of time</input>
    <output>{"sentiment": "negative", "confidence": 0.95}</output>
  </example>
  <example>
    <input>Decent film, not great but watchable</input>
    <output>{"sentiment": "neutral", "confidence": 0.7}</output>
  </example>
  <example>
    <input>Best movie I've seen this year!</input>
    <output>{"sentiment": "positive", "confidence": 0.9}</output>
  </example>
</examples>

Now analyze: "The special effects were amazing but the plot was confusing"

Tips:

  • Include 3-5 diverse examples covering edge cases
  • Show examples of BOTH good and bad outputs
  • Match example complexity to your actual use case
  • Order examples from simple to complex
Show full SKILL.md (148 more words)Show less
3. Let Claude Think (Chain of Thought)

Principle: Encourage step-by-step reasoning for complex tasks.

xml
<instruction>
Solve this problem step by step. Show your reasoning before giving the final answer.
</instruction>

<problem>
A train leaves Station A at 9:00 AM traveling at 60 mph. Another train leaves
Station B at 10:00 AM traveling at 80 mph toward Station A. The stations are
280 miles apart. When will the trains meet?
</problem>

<thinking>
[Let Claude work through the problem here]
</thinking>

<answer>
[Final answer after reasoning]
</answer>

Tips:

  • Use phrases like "Think step by step" or "Explain your reasoning"
  • For complex tasks, explicitly request a thinking section
  • Chain of thought improves accuracy on math, logic, and multi-step problems
  • Can use <thinking> tags to separate reasoning from output
4. Use XML Tags

Principle: Structure prompts with clear delimiters for better parsing.

xml
<context>
You are helping debug a penetration testing tool that automates security scans.
</context>

<task>
Analyze the following error log and identify the root cause.
</task>

<error_log>
[2024-01-15 10:23:45] ERROR: Connection timeout after 30s
[2024-01-15 10:23:45] DEBUG: Target: 192.168.1.1:443
[2024-01-15 10:23:45] DEBUG: Retry attempt 3 of 3
</error_log>

<output_format>
Provide your analysis in this format:
- Root cause: [one sentence]
- Evidence: [relevant log lines]
- Recommended fix: [actionable steps]
</output_format>

Common XML Tags:

  • <context> - Background information
  • <task> or <instruction> - What to do
  • <examples> - Sample inputs/outputs
  • <constraints> - Limitations or rules
  • <output_format> - Expected response structure
  • <thinking> - Reasoning section
  • <answer> - Final response
5. Give Claude a Role (System Prompts)

Principle: Assign a persona to influence response style and expertise.

xml
<role>
You are a senior security researcher with 15 years of experience in penetration
testing. You specialize in web application security and have discovered multiple
CVEs. You communicate findings clearly and prioritize actionable recommendations.
</role>

<task>
Review this HTTP response and identify potential security vulnerabilities.
</task>

Effective Role Elements:

  • Expertise level (senior, expert, specialist)
  • Domain knowledge (security, finance, medicine)
  • Communication style (technical, friendly, formal)
  • Priorities (accuracy, brevity, thoroughness)
6. Prefill Claude's Response

Principle: Start the response to guide format and direction.

Human: List the top 3 security vulnerabilities in this code.

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

Files

Just SKILL.md in .agents/skills/prompt-engineering of trycompai/comp.

Open the folder on GitHubat commit 1bf4d52

Compare with similar skills

Prompt Engineering 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.

Prompt Engineering compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Prompt Engineering this skilltrycompai/comp2k—~1.4kAutomated safety check: PassAGPL-3.0
Prompt Improverseverity1/claude-code-prompt-improver1.9k2 repos~1.7kAutomated safety check: PassMIT
Prompt Engineering Patternsynulihao/AgentSkillOS61714 repos~1.7kAutomated safety check: PassNone
Patch CreationPiebald-AI/tweakcc2.5k—~1.6kAutomated safety check: PassMIT
LLM Application DevMoizIbnYousaf/ai-agent-skills1.1k2 repos~1.3kAutomated safety check: PassMIT
Senior Prompt Engineermaslennikov-ig/claude-code-orchestrator-kit2594 repos~1.4kAutomated safety check: PassCustom licence

Similar skills

  • Prompt Improver

    severity1/claude-code-prompt-improver

    This skill enriches vague prompts with targeted research and clarification before execution.

    1.9k GitHub starsUsed in 2 repos~1.7k tokens
    AI & LLM EngineeringAuto-check passed
  • Prompt Engineering Patterns

    ynulihao/AgentSkillOS

    Master advanced prompt engineering techniques to maximize LLM performance, reliability, and controllability in production.

    617 GitHub starsUsed in 14 repos~1.7k tokens
    AI & LLM EngineeringAuto-check passed
  • Patch Creation

    Piebald-AI/tweakcc

    Create and register new patches for tweakcc. An agent skill from Piebald-AI/tweakcc.

    2.5k GitHub stars~1.6k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • LLM Application Dev

    MoizIbnYousaf/ai-agent-skills

    Building applications with Large Language Models - prompt engineering, RAG patterns, and LLM integration.

    1.1k GitHub starsUsed in 2 repos~1.3k tokens
    AI & LLM EngineeringAuto-check passed
  • Senior Prompt Engineer

    maslennikov-ig/claude-code-orchestrator-kit

    Provides reference guides and Python scripts for prompt optimization, RAG evaluation, and agent orchestration when building or tuning LLM systems.

    259 GitHub starsUsed in 4 repos~1.4k 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

More from trycompai/comp

All 31 skills in this repo
  • API Endpoint Contract

    trycompai/comp

    The contract every new or modified API endpoint must follow so it is correct for the public OpenAPI spec, the MCP server (npm @trycompai/mcp-server), the ValidationPipe, and the docs.

    2k GitHub stars~2.7k tokensUpdated 5 days ago
    Auto-check passed
  • Check Results Service

    trycompai/comp

    How to reuse ANY integration check's results in a feature via the universal CheckResultsService (apps/api integration-platform).

    2k GitHub stars~2.1k tokensUpdated 5 days ago
    Auto-check passed
  • Data

    trycompai/comp

    A skill your agent uses when implementing data fetching, API calls, server/client components, or SWR hooks

    2k GitHub stars~955 tokensUpdated 5 days ago
    Auto-check passed
  • A skill your agent uses when SDK generation failed or seeing errors.

    2k GitHub stars~938 tokensUpdated 5 days ago
    Auto-check passed
  • Forms

    trycompai/comp

    A skill your agent uses when building forms - covers React Hook Form, Zod validation, and form patterns

    2k GitHub stars~1k tokensUpdated 5 days ago
    Auto-check passed
  • Code

    trycompai/comp

    A skill your agent uses when writing TypeScript/React code - covers type safety, component patterns, and file organization

    2k GitHub stars~909 tokensUpdated 5 days ago
    Auto-check: warnings

Questions about Prompt Engineering

What does Prompt Engineering do?

Prompt engineering best practices - invoke with @prompt-engineering. Prompt Engineering is an agent skill from trycompai/comp.

When should I use Prompt Engineering?

Prompt Engineering fits situations like: tasks that involve Prompt engineering.

How do I install Prompt Engineering in Claude Code?

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

How do I install Prompt Engineering in Codex?

Run `npx skills add trycompai/comp --skill prompt-engineering -a codex`. Or copy the skill folder (.agents/skills/prompt-engineering in trycompai/comp) into .agents/skills/prompt-engineering in your project. Codex loads it when a task matches its description.

Can I use Prompt Engineering 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 trycompai/comp --skill prompt-engineering -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/prompt-engineering, .gemini/skills/prompt-engineering, .github/skills/prompt-engineering and .opencode/skills/prompt-engineering in your project.

What does Prompt Engineering need to run?

SKILL.md names no scripts, command-line tools or credentials: Prompt Engineering is instructions for the agent only. Our summary lists: Python 3.

Does Prompt Engineering access the network?

SKILL.md names 1 domain. As links in the text: platform.claude.com. This is read from the text; nothing was executed.

Is Prompt Engineering 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 Prompt Engineering use?

Prompt Engineering is published under the AGPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Prompt Engineering use?

About 1.4k tokens (SKILL.md is roughly 5.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Prompt Engineering?

Skills that share tags, products or a category with Prompt Engineering: Prompt Improver (severity1/claude-code-prompt-improver, 1.9k stars), Prompt Engineering Patterns (ynulihao/AgentSkillOS, 617 stars), Patch Creation (Piebald-AI/tweakcc, 2.5k stars) and LLM Application Dev (MoizIbnYousaf/ai-agent-skills, 1.1k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Prompt Engineering?

trycompai (a GitHub organization) maintains it in trycompai/comp, which has 2,016 GitHub stars. The repository holds 31 skills in this directory. The repository was last updated on October 2, 2026.

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