AgentSkillsCN

prompt-craft

运用Claude 4的最佳实践,从待办事项中提炼出高效的工作者提示词。 在为工作者准备问题、撰写提示词,或优化提示词质量时使用此功能。可通过“提炼提示词”“撰写提示词”“准备问题”“做好准备”等短语触发。

SKILL.md
--- frontmatter
name: prompt-craft
description: |
  Craft effective worker prompts from backlog issues using Claude 4 best practices.
  Use when preparing issues for workers, writing prompts, or optimizing prompt quality.
  Trigger with "craft prompt", "write prompt", "prepare issue", "make ready".
model: haiku
allowed-tools: Read, Grep, Glob, Bash

Prompt Craft - Claude 4 Best Practices

Craft effective prompts for Claude workers using proven patterns.

Core Principles

1. Be Explicit

Claude 4.x follows instructions precisely. Use action verbs.

Less EffectiveMore Effective
"Can you suggest improvements?""Update the function to improve performance."
"Look at this code""Find and fix the null check bug"
"Help with testing""Write unit tests for the auth module"

2. Add Context/Motivation

Explain WHY, not just WHAT. Claude generalizes from explanations.

Less EffectiveMore Effective
"NEVER use ellipses""Never use ellipses since the TTS engine won't pronounce them correctly."
"Always add error handling""Add error handling so users see helpful messages instead of stack traces."

3. Natural Skill Triggers

Use natural language, avoid aggressive markers.

AvoidUse
"CRITICAL: You MUST use this tool when...""Use the X skill for Y."
"ALWAYS: This is REQUIRED""Use this approach when..."
"IMPORTANT!!!: Never forget to...""Remember to..."

4. Positive Framing

Tell Claude what TO do, not just what to avoid.

Less EffectiveMore Effective
"Don't write long functions""Keep functions under 20 lines"
"Avoid complex logic""Use simple, readable patterns"

Prompt Structure

markdown
## Context
[1-2 sentences: Why this work matters, what problem it solves]

## Task
[Clear, explicit action instruction using action verbs]

## Approach
[Optional: Skill hints, patterns to follow, key considerations]
Use the [skill] skill for [specific purpose].

## Key Files
[3-5 most relevant files to start with]
- path/to/main/file.ts
- path/to/related/file.ts

## When Done
[How to complete: close issue, what to include in summary]
Close issue: bd close ISSUE-ID --reason "summary"

Skill Matching

Match skills based on content:

Content SignalSuggested Skill
.tsx, .jsx, Reactfrontend-development
terminal, xterm, resizexterm-js
auth, login, sessionbetter-auth
database, SQL, querydatabases
API, REST, endpointbackend-development
CSS, styling, themeui-styling
docs, markdowndocs-seeker

Subagent Hints

Claude 4.5 naturally delegates. Add hints when beneficial:

markdown
Use subagents in parallel to scaffold Dashboard, Settings, and Profile pages.
markdown
Use an Explore agent to find the relevant authentication files first.

Parallelization Hints

For tasks with independent subtasks:

markdown
These components can be developed in parallel:
- HeaderComponent
- FooterComponent
- SidebarComponent

Complexity Guidelines

Prompt LengthWhen to Use
Short (3-5 lines)Simple bug fixes, single-file changes
Medium (10-15 lines)Feature work, multi-file changes
Long (20+ lines)Complex features, architectural changes

Rule: If you need more than 20 lines, the issue might need breaking down.

Anti-Patterns

Avoid these common mistakes:

  1. Overloading: Too many skills, too many files, too much context
  2. Vague tasks: "Make it better" without specific criteria
  3. All caps: CRITICAL, IMPORTANT, MUST - creates anxiety, not clarity
  4. Negative framing: Lists of don'ts without corresponding dos
  5. No completion criteria: Worker doesn't know when they're done

References