mcpField
W
write-prompt

write-prompt

github.com/normanderwan其他18 次安装1 天前更新
代码仓库

关于 write-prompt

编写或编辑 AI 模型将遵循的指令文本时使用:CLAUDE.md 或 AGENTS.md 规则、SKILL.md、斜杠命令、钩子消息、子 Agent 或系统提示词、带变量的提示词模板,或用于 LLM API 调用的提示词。当这类提示词产生不一致或错误结果时也使用。起草前加载,即使只是编写一行规则也要加载。

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/normanderwan/claude-casebook --skill write-prompt

安装后在 Claude Code 中输入/write-prompt确认已加载。

包含的文件

除 SKILL.md 外,安装时一起下载的参考资料和脚本。

SOURCES.md
LICENSES/
MIT-obra-superpowers.txt
MIT-wshobson-agents.txt
references/
persuasion-principles.md

README 原文English

来自项目 README

README 暂无中文译文,以下为英文原文;中文介绍见上方。

Write Prompt

Covers what Claude skips without this skill. Everything else about prompt writing, Claude already does: do not pad a prompt with it.

Prompts run in production (LLM API, templates)

A prompt that processes inputs nobody reviews one by one needs all three:

  • A worked example. At least one input with its exact expected output. Pick it from the hard cases (messy, multilingual, several items), never a clean one: "Show, Don't Tell: Examples are more effective than descriptions" [1], and an example that does not match the target task misleads ("Example pollution" [1]).
  • The exact output schema. Field names, types, formats (ISO 8601, ISO 4217...), allowed values. Say what to output when a field cannot be found (null, never a guess).
  • A rule for each edge case the input can produce. None, several, ambiguous, malformed: state the output for each, such as an empty list, one entry per item, or a review flag. "No error handling: Assuming outputs will always be well-formed" is a named pitfall [1].

Rules an agent reads (CLAUDE.md, hooks, skills, commands)

Claude scans bullet and tree structure more reliably than it parses paragraphs. Default to lists over prose for rules, steps, or conditions.

  • One item per condition, each stating the trigger and the action, or what is blocked and what to do instead.
  • Don't restate what Claude already knows. No explanation of what git, a branch, JSON or a tool Claude already understands is (e.g. what AskUserQuestion does): the reader is a model that knows them.

Persuasion principles

Writing a rule that must hold under pressure (a skill, a hook message, a sub-agent prompt) -> read references/persuasion-principles.md: seven principles (authority, commitment, scarcity, social proof, unity, reciprocity, liking), which to combine per skill type, and their ethical limits.


[1] wshobson/agents, prompt-engineering-patterns (MIT). Sources: SOURCES.md.

评论

支持 Markdown