匠人学院 JR Academy
Skip to article
Learning guide
Claude Guide

Use Claude for writing, analysis, coding support, and longer-context AI workflows with better control.

3 chapters·16 guides·Access varies by chapter
Prompt Techniques
On this page

Claude Prompt Techniques

Define the goal, relevant context and output structure before choosing stylistic language.

#Make the task observable

Instead of “write a program,” specify a Python function taking a list of strings, retaining items longer than five characters and sorting them alphabetically, with type hints and a docstring.

Explain the situation, source materials, audience and constraints. Request JSON, a table, bullets, code or a plan-before-implementation explicitly.

#Separate complex inputs

XML tags or clearly named sections can distinguish background, data, constraints and output format. A relevant role narrows the task:

text
You are a frontend reviewer. Prioritize bugs, regressions and accessibility issues.

Examples are useful for fixed output formats, labels and rewriting patterns.

#Engineering requests

Provide environment/framework details, say whether the task is explanation/review/implementation, list assumptions and request a plan for complex work.

text
First explain the current state. Then propose a plan. List the files you expect to touch. Only after that, write the code.

#Problem-solving brief

text
Problem: [observed behavior] Environment: [relevant versions] Already tried: [attempts and results] Please identify likely causes, propose a bounded solution and explain how to verify it.

#Learning brief

text
Explain [concept] for someone with [background]. Include a one-sentence definition, the problem it solves, a basic example and important limitations.

#Common failures

Too many unrelated goals, missing constraints, abstract acceptance criteria and unspecified format weaken the result. Do not assume earlier conversations are available: provide the relevant code and the requested next change. State edge cases and performance requirements where they matter.

#References and next steps

Published by
JR Academy
Learning resources

Individual authors and reviewers are credited where recorded.

Prompt Master

Master prompting before you push AI tools harder

Learn prompt structure and control patterns for more stable output.

Open Prompt Master →

FAQ

Claude 3.5 Sonnet 和 GPT-4o 哪个写代码更好?
目前社区公认 Claude 3.5 Sonnet 在代码逻辑、复杂重构和 Artifacts 交互体验上略胜一筹,尤其是在配合 Cursor 使用时。
Claude Projects 是什么功能?
Claude Projects 允许你上传特定的文档(如 API 文档、代码库)作为上下文知识库,让 Claude 在对话中始终基于这些资料回答,非常适合项目级开发。
如何使用 Claude Artifacts?
在对话中让 Claude 生成代码(如 React 组件、HTML/CSS),它会自动触发 Artifacts 预览窗口,你可以直接看到运行效果并进行迭代修改。

Done reading? Next steps