Command Palette

Search for a command to run...

Назад к скиллам
скилл № 87319

prompt-engineering

Crafting effective prompts, CLAUDE.md instructions, rules, agent system prompts, and skill bodies for optimal Claude Code behavior

БесплатноБез исполняемых скриптов
TheLobbiот TheLobbi★ 22 звезды на GitHub

Установить prompt-engineering в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

Prompt Engineering Skill

You help users write instructions that Claude Code follows reliably. Your focus is turning vague intent into precise, actionable directives.

Goal

Enable users to craft system prompts, CLAUDE.md files, rules, agent directives, and skill bodies that consistently produce the desired behavior. Strong prompts reduce misunderstandings, increase adherence, and make cross-session knowledge transfer possible.

Why Prompt Clarity Matters

Claude Code reads instructions at multiple levels:

  • CLAUDE.md — Project-wide workflow and tooling guide (200 lines, stable)
  • Rules — Path-scoped behavioral constraints (short, actionable, domain-specific)
  • Agent system prompts — Role definition and mandatory workflow (50-150 lines)
  • Skill bodies — Reusable workflows with concrete examples (80-200 lines)
  • Task-level instructions — One-shot guidance for a specific session

Ambiguous instructions lead to repeated misunderstandings. Precise instructions compound across sessions into reliable behavior.

CLAUDE.md Writing Best Practices

CLAUDE.md is the stable, long-term reference. It should be boring and reliable.

Keep it under 200 lines per file. If you need more, split into .claude/rules/.

Use markdown headers and bullets for visual hierarchy. Avoid walls of prose.

Write concrete, verifiable instructions. Not "Format code properly" but "Use 2-space indentation for YAML, 4-space for Python."

Use imperative mood. "Run tests before committing" not "Tests should be run."

Avoid contradictions. Review all CLAUDE.md and rules files periodically. If two files say opposite things, merge or clarify.

Use @path imports for large reference material. Example: @.claude/rules/code-style.md loads that file inline.

Split large workflow guides into .claude/rules/. CLAUDE.md is your workflow summary; rules are your enforcement.

Timestamp key decisions. If you record that "We use Sonnet for most tasks, Opus for architecture" add a date. That helps future sessions know if a decision is stale.

Example CLAUDE.md structure:

# Project Name

## Workflow
- When to use which agent/model
- Standard tool order
- When to use orchestration vs single-agent

## Build & Test
- Install: `pnpm install`
- Test: `npm test`

## Key Rules
1. Commit messages: `type(scope): description`
2. No `git add -A` — specific files only
3. Type check before pushing

## Models
| Task | Model | Why |
|------|-------|-----|
| Research | haiku | Fast lookups, cost-efficient |
| Implementation | sonnet | Balance of speed and quality |
| Architecture | opus | Deep reasoning for big decisions |

## When to Use This Plugin
- Need to understand repo structure
- Need multi-agent review or orchestration

Rule File Design

Rules are short, actionable, domain-specific. They are injected as system instructions when Claude Code is working on matching files.

When to use rules vs CLAUDE.md vs skills:

  • CLAUDE.md — Workflow, tooling, when to call which agent
  • Rules — Constraints that must always apply (code style, git workflow, testing requirements)
  • Skills — Reusable workflows users can call on demand

Path scoping with frontmatter. Add a paths: field to apply a rule only to certain files:

---
paths:
  - "**/*.ts"
  - "**/*.tsx"
---

This rule only activates when Claude is editing TypeScript files.

Glob pattern reference:

  • **/*.ts — Any .ts file in any directory
  • src/**/* — Anything under src/
  • *.md — Markdown files in current directory
  • **/tests/** — Anything under a tests/ directory

Keep rules short and actionable. If a rule is longer than 50 lines, you are writing documentation, not a rule. Move it to a skill or agent prompt.

One topic per file. Use descriptive filenames: code-style.md, git-workflow.md, docker-k8s.md.

Avoid contradictions between rules and CLAUDE.md. The rules are injected on top of CLAUDE.md, so both are active. If they conflict, the last injected instruction wins, but that is confusing.

Agent System Prompt Design

Agent prompts are role definitions plus mandatory workflows. They fit in 50-150 lines.

Start with role and specialization. "You are an expert in Go backend architecture with deep knowledge of gRPC, database optimization, and observability."

Define mandatory workflow steps. Not suggestions — steps the agent must follow:

1. Analyze the codebase for existing patterns
2. Build an evidence table (file path, pattern, decision)
3. Propose 3+ options with tradeoff analysis
4. Recommend one option with rollback path
5. Output a markdown summary and a code diff

Specify what to output. "Deliver your answer as: (1) a markdown table comparing approaches, (2) your recommendation with one-line rationale, (3) a code snippet showing the change."

Include anti-patterns and constraints. "Do not suggest a rewrite without first profiling. Do not skip migration

Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

  1. 01Read
  2. 02Glob
  3. 03Grep

FAQ

Что делает скилл prompt-engineering?

Crafting effective prompts, CLAUDE.md instructions, rules, agent system prompts, and skill bodies for optimal Claude Code behavior

Как установить скилл prompt-engineering?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл prompt-engineering запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить prompt-engineering с