Logo: Prompt Engineering

Prompt Engineering

Communautéit
liqiongyu
prompt-engineering

Manual-first workflow skill for redesigning, debugging, hardening, or productionizing LLM prompts and system prompts. Use when the user needs end-to-end prompt work such as stabilizing behavior, migrating across models, or preparing a prompt for production. Do not use for quick technique lookup or for general LLM-powered coding tasks.

Iwwersiicht

Editeurliqiongyu
Repositorymy-agents
Skill-Nummprompt-engineering
Stären
29
Forks
3
Matgeliwwert Dateien
8
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 8 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    liqiongyu huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Prompt Engineering an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/liqiongyu/my-agents/tree/main/skills/prompt-engineering
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/liqiongyu/my-agents.git /tmp/my-agents
mkdir -p .claude/skills
cp -r /tmp/my-agents/skills/prompt-engineering .claude/skills/prompt-engineering
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Prompt Engineering an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Prompt Engineering automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Prompt Engineering net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

Prompt Engineering

Use this skill when prompt work needs an actual workflow: define success, draft or repair the prompt, test it on real inputs, and harden it for the target model and operating environment.

This skill is intentionally workflow-first. It is for prompt jobs with real tradeoffs, failure modes, or rollout concerns. It is not meant to be a general prompt encyclopedia.

Invocation posture: manual-first. This skill is broad and relatively heavy, so false positives are more harmful than occasional misses.

When Not To Use

  • Quick technique lookup such as "what is chain-of-thought?" or "show me a few-shot template"
  • Explaining an existing prompt line by line without redesigning or validating it
  • General coding, product, or research work that only happens to involve an LLM somewhere in the stack
  • Tiny one-off prompt tweaks where no real evaluation, migration, or hardening decision is needed

When To Activate

  • Drafting a new prompt or system prompt from requirements
  • Debugging a prompt that is inconsistent, verbose, unsafe, or hard to steer
  • Migrating prompt behavior between Claude, GPT, Gemini, or open-source models
  • Hardening an agent prompt against injection, tool misuse, or output drift
  • Turning an ad hoc prompt into a reusable template, chain, or production asset
  • Setting up a realistic evaluation plan for prompt quality, format adherence, latency, or cost

Outputs

Depending on the request, produce one or more of:

  • a revised prompt or system prompt
  • a failure-mode diagnosis with targeted fixes
  • a cross-model migration checklist
  • a prompt evaluation plan with representative test cases
  • a production hardening checklist for output control, safety, and monitoring

Reference Files

Keep the main workflow lean. Read deeper references only when the task needs them.

ReferenceWhen to read
references/advanced-reasoning.mdYou need structured reasoning patterns such as CoT, ToT, ReAct, self-consistency, or self-refine
references/cross-model-guide.mdYou are migrating prompts across Claude, GPT, Gemini, or open-source models
references/production-patterns.mdYou need versioning, evaluation, caching, rollout, monitoring, or prompt-chain design
references/security-patterns.mdYou are handling untrusted input, tool use, prompt injection, or output validation

Core Workflow

Workflow 1: Scope The Prompt Job

Before rewriting anything, pin down:

  1. The task and the exact output shape
  2. What "good" looks like with 3-5 representative examples
  3. The constraints: model, context budget, latency, cost, determinism, safety
  4. The current failure modes: wrong format, wrong content, instability, unsafe behavior, or cross-model drift

Always collect at least:

  • one happy-path input
  • one edge case
  • one adversarial or malformed case

If you cannot explain what success means, do not jump into fancy prompting techniques yet.

Workflow 2: Draft Or Repair With Minimum Necessary Complexity

Start with the smallest change that could plausibly fix the problem, then escalate only if the evidence says you need more structure.

LevelDefault moveUse when
L1Clear direct instructionFirst pass for almost every task
L2Add explicit constraints and output formatThe model drifts on brevity, style, or schema
L3Add examplesThe model still misclassifies, misformats, or misses edge cases
L4Add reasoning scaffoldThe task needs multi-step analysis or error checking
L5Split into a chain or reusable templateIntermediate validation or multi-stage processing matters

Use this structure by default:

text
[Role or system context]
[Task instructions]
[Examples, if needed]
[Input data]
[Output format]

Keep model-specific features explicit and removable. Do not bury XML tags, prefilling tricks, or vendor-specific schema APIs inside a supposedly model-agnostic prompt.

Workflow 3: Evaluate On Real Work

Treat prompt changes like code changes:

  1. Record a baseline on representative inputs
  2. Change one variable at a time when possible
  3. Re-run the same cases on the revised prompt
  4. Compare:
    • task accuracy or usefulness
    • format compliance
    • consistency across repeated runs
    • latency and token cost
  5. Keep notes on what changed, why, and what improved

If the task involves model migration, re-test on the target model directly. Do not assume prompt portability just because two models are both strong.

Workflow 4: Productionize And Harden

When the prompt is headed toward repeated or user-facing use:

  • version the prompt and template variables
  • prefer API-level structure enforcement when the platform supports it
  • isolate untrusted input from instructions
  • restate critical boundaries when injection risk exists
  • validate outputs before downstream actions depend on them
  • define rollback or fallback behavior for high-impact uses
  • monitor drift, edge cases, and cost regressions over time

Technique Selection Guide

Use the lightest tool that matches the problem.

NeedDefault moveRead next
Reliable structured outputShow the exact format first; use schema enforcement when availablereferences/production-patterns.md, references/cross-model-guide.md
Stronger analytical reasoningPrefer model-native reasoning first; add a structured scaffold only if neededreferences/advanced-reasoning.md
Cross-model migrationRemove vendor-specific tricks, normalize delimiters, then re-test on the target modelreferences/cross-model-guide.md
Injection resistanceIsolate data, repeat critical constraints, and validate outputsreferences/security-patterns.md
Multi-step pipelineSplit into a chain only when intermediate validation adds valuereferences/production-patterns.md

Validate And Evaluate

This canonical package ships a lightweight eval suite under eval/ for realistic prompt-work scenarios.

When updating the canonical skill in this repo, validate the package and eval fixture before projecting:

bash
uv run python skills/skill-lifecycle-manager/scripts/quick_validate.py skills/prompt-engineering
uv run python skills/skill-lifecycle-manager/scripts/validate_eval_suite.py skills/prompt-engineering/eval/eval-cases.json

For behavioral review, run the cases in eval/eval-cases.json as realistic tasks and check whether the response:

  • defines success before rewriting
  • proposes the smallest effective prompt change
  • calibrates advice to the target model or runtime
  • includes a concrete validation plan
  • treats safety and output control explicitly when risk is present

Projection And Install Notes

Treat skills/prompt-engineering/ as the canonical package. Generate runtime surfaces from it rather than hand-editing copies:

bash
uv run python skills/skill-lifecycle-manager/scripts/project_skill.py skills/prompt-engineering --platform all
uv run python skills/skill-lifecycle-manager/scripts/validate_projection.py skills/prompt-engineering --platform all

projection.json excludes author-only evaluation artifacts from runtime projections so Codex and Claude Code only receive the execution-relevant package.

Best Practices

  1. Start with the smallest prompt change that could fix the failure.
  2. Measure on representative inputs before and after edits.
  3. Keep model-specific tricks explicit and easy to remove.
  4. Prefer API-level structure enforcement over prompt-only formatting when the platform supports it.
  5. Treat prompts as versioned artifacts, not disposable chat snippets.

Common Pitfalls

PitfallWhy it hurtsFix
Jumping to exotic techniques too earlyComplexity hides the real failure modeDefine success and start at the lowest effective level
Shipping without negative casesEdge failures appear only in productionTest happy-path, edge, and adversarial inputs
Assuming prompt portabilityVendor behaviors diverge in subtle waysRe-test on the target model and remove model-specific tricks
Mixing trusted instructions with untrusted dataInjection risk rises sharplyDelimit, isolate, and restate boundaries
Changing many variables at onceYou cannot tell what improvedRun one targeted fix at a time where practical

Matgeliwwert Dateien

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill Prompt Engineering?

Manual-first workflow skill for redesigning, debugging, hardening, or productionizing LLM prompts and system prompts. Use when the user needs end-to-end prompt work such as stabilizing behavior, migrating across models, or preparing a prompt for production. Do not use for quick technique lookup or for general LLM-powered coding tasks.

Firwat Prompt Engineering op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Prompt Engineering besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Prompt Engineering an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/liqiongyu/my-agents/tree/main/skills/prompt-engineering an. TypingMind liest d'Datei SKILL.md, bëndelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Prompt Engineering benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Prompt Engineering benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Prompt Engineering domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Prompt Engineering gratis?

Jo. liqiongyu huet de Skill ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇