prompt-engineering · spencerpauly — скилл для Claude Code: установка
Скилл помогает проектировать промпты для LLM: задавать формат, добавлять примеры и ограничения. Пригодится для кода, классификации и разбора ответов.
npx skills add spencerpauly/awesome-cursor-skills --skill prompt-engineering -a claude-codeЧто делает prompt-engineering
Скилл разбирает базовые принципы prompt engineering: точную постановку задачи, примеры вместо длинных объяснений, явное описание формата и итеративную проверку промптов. Отдельные разделы посвящены system prompts, few-shot, chain-of-thought, структурированному выводу и защитным ограничениям.
Для задач с кодом есть шаблоны генерации, преобразования и исправления ошибок. Также описаны анти-паттерны: расплывчатые и противоречивые инструкции, слишком длинные запросы, отсутствие примеров и риск prompt injection при передаче пользовательского ввода.
Для программного разбора ответа JSON-схема здесь практичнее свободного текста: скилл показывает, как задать поля и допустимые значения заранее. Он доступен для Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI и OpenCode.
Какие задачи решает
- составить system prompt с ролью и ограничениями
- добавить few-shot примеры к запросу
- задать JSON-формат ответа для парсинга
- подготовить промпт для генерации TypeScript-кода
- разобрать причины ошибки и попросить исправление
Примеры запросов агенту
- Составь system prompt для ревью TypeScript-кода с уровнями серьёзности и форматом ответа.
- Переделай этот запрос в few-shot промпт для преобразования естественного языка в SQL.
- Задай JSON-схему для классификации сообщений и добавь ограничения на использование контекста.
Как установить prompt-engineering
1Через Skills CLI (Vercel)
npx skills add spencerpauly/awesome-cursor-skills --skill prompt-engineering -a claude-code2Вручную: положить файлы
~/.claude/skills/prompt-engineering/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/prompt-engineering/
1Через Skills CLI (Vercel)
npx skills add spencerpauly/awesome-cursor-skills --skill prompt-engineering -a codex2Вручную: положить файлы
.agents/skills/prompt-engineering/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add spencerpauly/awesome-cursor-skills --skill prompt-engineering -a cursor2Вручную: положить файлы
.cursor/skills/prompt-engineering/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install spencerpauly/awesome-cursor-skills prompt-engineering2Вручную: положить файлы
.github/skills/prompt-engineering/SKILL.md1Через Skills CLI (Vercel)
npx skills add spencerpauly/awesome-cursor-skills --skill prompt-engineering -a gemini-cli2Командой платформы
gemini skills install https://github.com/spencerpauly/awesome-cursor-skills --path resources/prompt-engineeringВручную: положить файлы
.devin/skills/prompt-engineering/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add spencerpauly/awesome-cursor-skills --skill prompt-engineering -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о prompt-engineering
Как установить prompt-engineering в Claude Code?
Выполните npx skills add spencerpauly/awesome-cursor-skills --skill prompt-engineering -a claude-code. После установки файл скилла находится в ~/.claude/skills/prompt-engineering/SKILL.md.
Что делает prompt-engineering?
Скилл учит писать промпты с чёткими требованиями, примерами, ограничениями и заданным форматом результата. Он также даёт шаблоны для генерации, преобразования и исправления кода.
С какими платформами работает prompt-engineering?
Скилл предназначен для Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI и OpenCode.
Исходный текст
SKILL.md · CC0-1.0
---
name: prompt-engineering
description: Write effective prompts for LLMs — structure, few-shot examples, chain-of-thought, system prompts, and output parsing.
user-invocable: true
---
# Prompt Engineering
Write prompts that get reliable, high-quality output from LLMs.
## Core Principles
1. **Be specific** — vague prompts get vague results
2. **Show, don't tell** — examples beat instructions
3. **Structure the output** — tell the model exactly what format you want
4. **Iterate** — prompts are code; test and refine them
## Techniques
### System Prompts
Set the model's role and constraints:
```
You are a senior code reviewer. Review the provided code for:
1. Security vulnerabilities
2. Performance issues
3. Readability problems
For each issue found, provide:
- Severity (critical/warning/info)
- Line number
- Description
- Suggested fix
If no issues are found, respond with "No issues found."
```
### Few-Shot Examples
Provide 2-3 examples of input → output:
```
Convert the user's natural language query to a SQL query.
Example 1:
Input: "How many users signed up last month?"
Output: SELECT COUNT(*) FROM users WHERE created_at >= DATE_TRUNC('month', NOW() - INTERVAL '1 month') AND created_at < DATE_TRUNC('month', NOW());
Example 2:
Input: "Show me the top 5 products by revenue"
Output: SELECT p.name, SUM(o.amount) as revenue FROM products p JOIN orders o ON o.product_id = p.id GROUP BY p.name ORDER BY revenue DESC LIMIT 5;
Now convert this query:
Input: "{user_query}"
Output:
```
### Chain-of-Thought
Ask the model to reason step by step:
```
Analyze this error and suggest a fix. Think step by step:
1. What does the error message mean?
2. What could cause this error?
3. What is the most likely root cause given the code context?
4. What is the fix?
```
### Structured Output
Request JSON or a specific format:
```
Respond with a JSON object matching this schema:
{
"summary": "string - one sentence summary",
"sentiment": "positive | negative | neutral",
"key_topics": ["string"],
"confidence": 0.0-1.0
}
```
### Constraints and Guardrails
```
Rules:
- Only use information from the provided context
- If you don't know the answer, say "I don't know" — do not guess
- Keep responses under 200 words
- Do not include any PII in your response
```
## Patterns for Code
**Code generation:**
```
Write a TypeScript function that {description}.
Requirements:
- {requirement 1}
- {requirement 2}
Use these libraries: {libraries}
Follow this pattern from the codebase: {example}
```
**Code transformation:**
```
Refactor this code to {goal}. Keep the same behavior.
Do not change the public API (function signatures, exports).
```
**Bug fixing:**
```
This code has a bug: {description of bug}
Error: {error message}
Fix the bug. Explain what caused it in a comment.
```
## Anti-Patterns
- **Too vague**: "Make this better" → Be specific about what "better" means
- **Too long**: Giant prompts with everything → Split into focused prompts
- **Contradictory**: "Be concise but thorough" → Pick one or define the tradeoff
- **No examples**: Complex formatting without showing what you want → Add 1-2 examples
- **Prompt injection risk**: Including raw user input without delimiting → Use clear delimiters like `<user_input>...</user_input>`
## Tips
- Temperature 0 for deterministic tasks (code, classification), 0.7+ for creative tasks
- Test prompts with edge cases, not just the happy path
- Version control your prompts — they're as important as code
- Use structured output (JSON) when parsing the response programmatically
- Shorter prompts often outperform longer ones if they're precise enough
© spencerpauly · CC0-1.0 · spencerpauly/awesome-cursor-skills
Похожие скиллы
Все скиллы по теме «ИИ и ML» →Сначала — prompt-engineering от других авторов.