convez.ai
SkillProdutividadeIniciante
bratpreneur

Prompting 101 para Claude

bratpreneur/prompting-101-for-claude

Templates e método estruturado para prompts de alta qualidade

Ver no GitHub
InicialPluginScore · de 0 a 100

Kit comunitário prático com método estruturado, templates XML reutilizáveis, meta-prompt, checklist de qualidade e skill instalável para escrever prompts mais efetivos para Claude. Baseado nos princípios educacionais da Anthropic, traduzido em ferramentas e vocabulário compartilhado.

Instalação

$npx convez-ai bratpreneur/prompting-101-for-claude

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
1
Forks
0
Acompanhando
0
Saúde
42%
Último commit
há 5 meses
Versão
—
Issues abertas
0
Contribuidores
1

Casos de uso

  • Padronizar escrita de prompts em equipes
  • Construir aplicações mais confiáveis com Claude
  • Automatizar tarefas repetidas de extração, classificação e sumarização
  • Reduzir erros causados por ambiguidade em instruções

Veredito

Recurso educacional prático e bem estruturado que democratiza boas práticas de prompting. Excelente para quem quer resultados mais previsíveis, mas é comunitário (não oficial Anthropic) — considere como referência complementar, não substituta, à documentação original.

README

A tradução para o português deste README ainda está na fila.

prompting-101-for-claude

A community distillation of Anthropic's "Prompting 101" method — practical building blocks, a reusable template, a meta-prompt, checklists, and an installable skill for writing better prompts for Claude.

What is this?

This repository is a hands-on, copy-pasteable toolkit for writing high-quality prompts for Claude. It takes the ideas from Anthropic's "Prompting 101" educational material, explains the reasoning behind each one in plain language, and packages them into things you can actually use:

  • A written explanation of the method (the why, not just the rules).
  • A reusable XML prompt scaffold you can fill in.
  • A meta-prompt that asks Claude to draft a structured prompt for you.
  • A quality checklist and a list of common mistakes.
  • A ready-to-install Claude skill that triggers automatically when you ask Claude to write or improve a prompt.

Who it is for: anyone who writes prompts and wants more reliable results — developers building Claude into apps, people doing repeated extraction/classification/summarization tasks, and prompt authors who want a shared vocabulary and a repeatable structure instead of guesswork.

Attribution

This repository is an unofficial, community-made distillation of the prompting principles taught in Anthropic's "Prompting 101" educational material. The method described here is credited to Anthropic; this repo simply explains it in the community's own words and provides tooling around it.

  • This project is NOT affiliated with, sponsored by, or endorsed by Anthropic. It is maintained independently by the community.
  • All principles are paraphrased in our own words. No copyrighted text from Anthropic's material is reproduced here. If you want the original source, search for Anthropic "Prompting 101" in Anthropic's documentation and educational resources.
  • "Claude" and "Anthropic" are trademarks of Anthropic, PBC. They are used here only to refer to the product and the source material, not to imply any endorsement.

If you are the rights holder and have concerns about anything in this repo, please open an issue.

The core idea

Most weak prompts fail for the same reason: the model has to guess. It guesses what you want, what world it is operating in, which parts of the text are instructions versus data, and what the answer should look like. Every guess is a chance to be wrong.

A strong prompt removes the guessing. The method boils down to a single shape:

A good prompt = a clear role + the right context + data kept separate from instructions + an explicit reasoning order + a fixed output format + an escape hatch for uncertainty.

In a bit more detail, ten building blocks make that shape concrete. You don't need all of them every time — use the ones that earn their place.

  1. State the task up front. Begin with exactly what you want. "Analyze this" makes the model invent a goal; "Classify this support ticket into one of these five categories and explain why" does not. The model commits to the right objective from the first token.

  2. Give the domain/business context. Explain why the task exists and the world it lives in (who the user is, what the document is, what decision the answer feeds). Context lets the model resolve ambiguity the way you would.

  3. Set the tone and level of caution. Say whether you want factual and careful, concise, or confident. Without this, the model picks a default that may over-claim or hedge too much. Telling it the posture prevents both.

  4. Put stable information first. Things that rarely change — document structure, business rules, definitions, scoring grids, conventions — go into the context before the variable data. This is cache-friendly and it reduces guessing, because the rules are established before the model ever sees the case it must judge.

  5. Separate the dynamic data from the instructions. Never blend the thing-to-process with the how-to-process-it in one block. Keeping them apart improves clarity and is a key defense against prompt injection (text in the data can't be mistaken for new instructions).

  6. Use explicit XML-style tags. Wrap each part so the model knows where to look: <role>, <context>, <task>, <background>, <input_data>, <instructions>, <constraints>, <examples>, <output_format>, <final_reminder>. Include only the tags that pull their weight — empty ceremony just adds noise.

  7. Give an explicit order of analysis. Tell the model what to look at first, then next ("first read the header, then the line items, then reconcile the total"). A stated order measurably improves accuracy, especially on documents, images, and extraction tasks.

  8. Add examples when they earn it. Few-shot examples are powerful when the task is subjective, has tricky edge cases, or the output style matters. They are also token-costly, so use a couple of well-chosen examples rather than a pile of them.

  9. Restate the one or two critical rules at the end. Just before the answer, repeat the rules that matter most. Recency helps — the model is least likely to forget the last thing it read.

  10. Impose the exact output format, with an uncertainty escape hatch. Whenever code or a hurried human consumes the output, fix the shape (a JSON schema, a Markdown template, a single verdict, a table). And always allow the model to say "undetermined / low confidence / missing info" instead of forcing a confident answer it can't support.

The method is empirical: prompting is iterative. When the model gets something wrong, find the instruction that was ambiguous, add a rule or an example to pin it down, and test again. Read method/prompting-101.md for the full treatment.

What is in this repo

prompting-101-for-claude/
├── README.md                       You are here — the whole approach and where it comes from.
├── LICENSE                         MIT license.
├── method/
│   └── prompting-101.md            The method in depth: each building block, the why behind it, examples.
├── templates/
│   ├── prompt-template.xml         The reusable XML scaffold — copy it and fill in the tags.
│   └── meta-prompt.md              A meta-prompt: paste it into Claude to have it draft a prompt for you.
├── checklist.md                    Quality checklist to run over a prompt before you ship it.
├── common-mistakes.md              Errors to avoid, with the fix for each.
└── skills/
    └── prompt-builder/
        └── SKILL.md                An installable Claude skill that helps you write/improve prompts.

How to use

Use the template

Open templates/prompt-template.xml, copy it, and fill in the tags that apply to your task. Delete the tags you don't need — an empty <examples> block is worse than no block. Keep stable rules above your variable data, and put your one or two non-negotiable rules into <final_reminder> at the bottom.

Use the meta-prompt

If you'd rather not hand-build the structure, open templates/meta-prompt.md, paste it into a conversation with Claude, and describe your task in your own words. Claude will produce a structured prompt following the method, which you can then refine.

Run the checklist

Before you depend on a prompt, run it through checklist.md. It catches the usual gaps: no task stated up front, instructions tangled with data, no output format, no escape hatch for uncertainty. Pair it with common-mistakes.md when something is going wrong.

Install the skill

The repo ships a Claude skill in skills/prompt-builder/ so that Claude applies this method without you pasting anything. Copy the whole prompt-builder/ folder into your skills directory:

  • Personal (all your projects): copy it into ~/.claude/skills/ → ~/.claude/skills/prompt-builder/SKILL.md
  • Project-scoped (shared with a repo): copy it into that repo's .claude/skills/ → .claude/skills/prompt-builder/SKILL.md
# personal install
mkdir -p ~/.claude/skills
cp -r skills/prompt-builder ~/.claude/skills/

# or project-scoped install (run from your project root)
mkdir -p .claude/skills
cp -r /path/to/prompting-101-for-claude/skills/prompt-builder .claude/skills/

Once installed, the skill triggers when you ask Claude to write, build, or improve a prompt — Claude will structure it using the building blocks above. (Note: the skill file includes both English and French trigger phrases so it activates in either language; everything else in this repo is in English.)

Quickstart example

A rough request:

Look at this invoice and tell me if it's okay to pay.

The same request, restructured with the method:

<role>
You are an accounts-payable assistant that reviews supplier invoices before payment.
</role>

<task>
Decide whether the invoice in <input_data> is APPROVED, HOLD, or REJECTED for payment,
and justify the decision against the rules below.
</task>

<context>
We only pay invoices that match an existing purchase order and arrive within their
payment terms. A mismatch in amount over 2% must be held for human review.
</context>

<instructions>
Work in this order:
1. Read the supplier name, invoice number, total, and due date.
2. Check the total against the PO amount and compute the percentage difference.
3. Check the due date against today's date.
4. Apply the rules and choose one verdict.
</instructions>

<constraints>
- If the PO number is missing or unreadable, do NOT guess — use "UNDETERMINED".
- Currency figures must be reported exactly as written.
</constraints>

<input_data>
{{ paste the invoice text or extracted fields here — data only, no instructions }}
</input_data>

<output_format>
Return JSON only:
{ "verdict": "APPROVED | HOLD | REJECTED | UNDETERMINED",
  "amount_diff_pct": number | null,
  "reason": "one short sentence" }
</output_format>

<final_reminder>
Choose exactly one verdict. If a required field is missing, return "UNDETERMINED" rather than assuming.
</final_reminder>

Same goal — but now the task is stated up front, the rules sit above the data, the data can't be mistaken for instructions, the analysis has an order, the output is machine-readable, and uncertainty has somewhere to go.

Contributing

Contributions are welcome. If you have a clearer explanation, a better example, an additional common mistake, or an improvement to the template or skill, please open an issue or a pull request. Please keep contributions:

  • In English (the bundled skill's bilingual trigger phrases are the only exception).
  • Portable — no company-specific, proprietary, or private content; nothing that ties the repo to one organization.
  • Faithful to the source — paraphrase Anthropic's principles in your own words; do not paste in copyrighted text.

License

Released under the MIT License.

This repository is unofficial and is not affiliated with, sponsored by, or endorsed by Anthropic. "Claude" and "Anthropic" are trademarks of Anthropic, PBC.

Ver o original no GitHub

Bom para

Relacionados