Logo Prompt Engineering

Prompt Engineering

Cộng đồng
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.

Tổng quan

Nhà phát hànhliqiongyu
Kho mãmy-agents
Tên kỹ năngprompt-engineering
Sao
29
Bản fork
3
Tệp đi kèm
8
Giấy phépMIT
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 8 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được liqiongyu công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Prompt Engineering trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/liqiongyu/my-agents/tree/main/skills/prompt-engineering
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

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
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Prompt Engineering trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Prompt Engineering ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Prompt Engineering với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

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

Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Prompt Engineering làm được gì?

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.

Vì sao nên dùng Prompt Engineering trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Prompt Engineering là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Prompt Engineering trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/liqiongyu/my-agents/tree/main/skills/prompt-engineering. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Prompt Engineering?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Prompt Engineering với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Prompt Engineering với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Prompt Engineering có miễn phí không?

Có. Kỹ năng này được liqiongyu phát hành trên GitHub theo giấy phép MIT. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇