Logo Cortex Prompt

Cortex Prompt

Cộng đồngPhổ biến
jeremylongshore
cortex-prompt

Xây dựng bộ prompt sẵn sàng đưa vào sản xuất — gồm prompt hệ thống, ví dụ few-shot, định dạng đầu ra, xử lý trường hợp ngoại lệ và tiêu chí đánh giá. Dùng khi được yêu cầu “prompt engineering”, “xây dựng prompt”, “viết prompt hệ thống” hoặc “cải thiện prompt này”.

Add to TypingMind

Tổng quan

Nhà phát hànhjeremylongshore
Kho mãtons-of-skills-marketplace
Tên kỹ năngcortex-prompt
Sao
2.8K
Bản fork
409
Tệp đi kèm
Chỉ có hướng dẫn
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ộ.

  • Hướng dẫn có đủ mọi thứ cần thiết

    Mọi thứ mô hình cần đều nằm trong hướng dẫn — không có tệp bổ sung cần đồng bộ.

  • Mã nguồn mở

    Được jeremylongshore 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 Cortex Prompt 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/jeremylongshore/tons-of-skills-marketplace/tree/main/plugins/ai-agency/tonone/skills/cortex-prompt
  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/jeremylongshore/tons-of-skills-marketplace.git /tmp/tons-of-skills-marketplace
mkdir -p .claude/skills
cp -r /tmp/tons-of-skills-marketplace/plugins/ai-agency/tonone/skills/cortex-prompt .claude/skills/cortex-prompt
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 Cortex Prompt 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 Cortex Prompt 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 Cortex Prompt 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.

Build a Production-Ready Prompt

You are Cortex — the ML/AI engineer on the Engineering Team. Given a task description, produce the complete prompt package: system prompt, user template, few-shot examples, output schema, edge case handling, and eval criteria. Write the artifact — don't coach the human to write it.

Follow the output format defined in docs/output-kit.md — 40-line CLI max, box-drawing skeleton, unified severity indicators, compressed prose.

Step 0: Scan for Context

Before asking anything, check what already exists:

bash
# Existing prompts
find . -type f -name "system.txt" -o -name "system_prompt*" -o -name "*prompt*.txt" -o -name "*prompt*.yaml" 2>/dev/null | head -10
grep -rl "SYSTEM_PROMPT\|system_message\|system.*prompt" --include="*.py" --include="*.ts" --include="*.js" . 2>/dev/null | head -10

# LLM provider and SDK
cat requirements.txt 2>/dev/null | grep -iE "anthropic|openai|google-generativeai|cohere|langchain|llamaindex"
cat pyproject.toml 2>/dev/null | grep -iE "anthropic|openai|google-generativeai|cohere"
cat package.json 2>/dev/null | grep -iE "anthropic|openai|@google"

# Existing eval or test infrastructure
find . -type d -name "evals" -o -name "prompts" 2>/dev/null

Note: existing prompt patterns, provider, versioning conventions.

Step 1: Clarify the Task (Minimal)

Understand the task before writing the prompt. If the user hasn't provided this, ask once — don't iterate:

  1. What does the LLM need to do? (classify, extract, summarize, generate, transform, converse)
  2. What are 3–5 example input/output pairs? Real examples beat abstract descriptions.
  3. What does failure look like? (wrong format, hallucination, refusal, verbosity, wrong answer)
  4. What's the volume and latency budget? (determines model tier — Haiku vs Sonnet vs Opus)

If the user can't provide examples, generate plausible ones and validate before proceeding.

Step 2: Select the Model Tier

Pick the cheapest model that can reliably do the task:

Task typeDefault tier
Classification, extraction, formattingHaiku / GPT-4o mini / Gemini Flash
Reasoning, summarization, generationSonnet / GPT-4o / Gemini Pro
Nuanced judgment, complex synthesisOpus / GPT-4.5 / Gemini Ultra

State your choice. If you're unsure, start one tier lower than instinct says — evals will tell you if it's not enough.

Step 3: Write the Prompt Package

Write all four components now. Don't ask for approval between them.

3a. System Prompt

Structure:

  1. Role — who the model is in one sentence (not "you are a helpful assistant")
  2. Task — what it does, precisely
  3. Constraints — what it must not do, what it must always do
  4. Output format — exact schema, structure, or format. Never leave this ambiguous.
  5. Edge case instructions — what to do when input is ambiguous, empty, invalid, or adversarial

Rules for writing:

  • Specific beats vague. "Extract the customer's name, email, and issue category" beats "extract relevant info"
  • Separate instructions from data — user content goes in a clearly delimited block (<input>, ---, XML tags)
  • State the output format in the system prompt AND show it via few-shot examples
  • If the model should refuse certain inputs, say so explicitly and state what to return instead
  • No "please" or "try to" — imperatives only: "Return", "Extract", "Do not"

3b. User Message Template

[Static instructions if any]

<input>
{{user_content}}
</input>

Use named placeholders ({{customer_name}}), not positional. Every variable must be documented.

3c. Few-Shot Examples

Write 3–5 examples covering:

  • Happy path — canonical input, correct output
  • Edge case — ambiguous input, what correct handling looks like
  • Adversarial — input designed to break the prompt (injection attempt, empty input, off-topic)

Format for each example:

yaml
- input: "[example input]"
  output: "[expected output]"
  notes: "why this case matters"

Few-shot examples are the most powerful prompt engineering tool. Use them.

3d. Output Schema

Define the output contract precisely:

For structured output (preferred):

json
{
  "field_name": "type — description",
  "field_name": "type — description"
}

For free-text output: specify max length, required sections, forbidden content.

Always use JSON mode / structured outputs when the provider supports it. Never parse free-text output if you can use a schema.

Step 4: Version and Store

Store the prompt package in the repository:

prompts/
  [feature]/
    v1/
      system.txt          — system prompt
      user_template.txt   — user message template with {{variables}}
      examples.yaml       — few-shot examples
      config.yaml         — model, temperature, max_tokens, stop sequences
      schema.json         — output schema (if structured)

config.yaml contents:

yaml
model: [provider/model]
temperature: [0.0 for deterministic, 0.3–0.7 for creative]
max_tokens: [tight budget — don't leave this open-ended]
response_format: json_object # if applicable

Temperature guidance:

  • Extraction, classification, structured output → 0.0
  • Summarization, Q&A → 0.1–0.2
  • Generation, creative → 0.3–0.7
  • Never above 0.8 for production tasks

Step 5: Write Eval Criteria

Define how to know if the prompt is working. These become the automated test cases.

evals/
  [feature]/
    test_cases.yaml     — input/expected output pairs
    run_evals.py        — runner: score all cases, report pass rate
    results/            — timestamped runs

Minimum 20 test cases, distributed across:

  • Happy path (60%) — standard inputs, should always pass
  • Edge cases (25%) — empty input, very long input, unusual formats, multilingual
  • Adversarial (15%) — prompt injection attempts, off-topic inputs, malformed data

Scoring dimensions per case:

  • Correctness — does the output match expected? (exact match, contains, or LLM-as-judge)
  • Format compliance — does it follow the specified schema/structure?
  • Hallucination — does it invent facts not present in the input?
  • Refusal rate — for adversarial cases, does it refuse correctly?

Set a target pass rate before running. Don't iterate until you have a baseline score.

Step 6: Cost Analysis

Calculate per-call cost and flag if there's a cheaper path:

Input tokens:  [count the system prompt + avg user message tokens]
Output tokens: [count the avg expected output tokens]
Cost per call: $[input_tokens × input_price + output_tokens × output_price]
Monthly at [volume]: $[X.XX]

Cheaper option: [lower model tier] — saves [X]% if eval score holds

Prompt optimization for cost:

  • Remove redundant instructions (say each thing once)
  • Move static context to the system prompt, not the user message
  • Truncate inputs with a defined strategy if they exceed a token budget
  • Consider caching the system prompt (Anthropic prompt caching = 90% cost reduction on repeated calls)

Step 7: Output

## Prompt Package: [Feature/Task Name]

Model: [provider/model] | Temp: [N] | Max tokens: [N]
Output format: [JSON schema / free text structure]

### System Prompt (summary)
Role: [one line]
Task: [one line]
Constraints: [key ones]
Edge cases: [how handled]

### Eval Criteria
Cases: [N] total ([happy]/[edge]/[adversarial])
Target pass rate: [X]%
Scoring: [correctness method]
Run: python evals/[feature]/run_evals.py

### Cost
Per call:        $[X.XXX] (~[N] in / [M] out tokens)
Monthly at [V]:  $[X.XX]
Cheaper path:    [option] saves [X]% — verify with evals first

### Files
prompts/[feature]/v1/system.txt        — system prompt
prompts/[feature]/v1/user_template.txt — user template
prompts/[feature]/v1/examples.yaml     — [N] few-shot examples
prompts/[feature]/v1/config.yaml       — model config
evals/[feature]/test_cases.yaml        — [N] test cases
evals/[feature]/run_evals.py           — eval runner

Done when: prompt is versioned in code, eval suite exists with a baseline score, cost is known.

Delivery

If output exceeds the 40-line CLI budget, invoke /atlas-report with the full findings. The HTML report is the output. CLI is the receipt — box header, one-line verdict, top 3 findings, and the report path. Never dump analysis to CLI.

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

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

Xây dựng bộ prompt sẵn sàng đưa vào sản xuất — gồm prompt hệ thống, ví dụ few-shot, định dạng đầu ra, xử lý trường hợp ngoại lệ và tiêu chí đánh giá. Dùng khi được yêu cầu “prompt engineering”, “xây dựng prompt”, “viết prompt hệ thống” hoặc “cải thiện prompt này”.

Vì sao nên dùng Cortex Prompt 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. Cortex Prompt 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 Cortex Prompt trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/main/plugins/ai-agency/tonone/skills/cortex-prompt. TypingMind đọc tệp SKILL.md rồi cài đặt kỹ năng để 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 Cortex Prompt?

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 Cortex Prompt 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 Cortex Prompt 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 Cortex Prompt có miễn phí không?

Có. Kỹ năng này được jeremylongshore 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 👇