Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

llm-engineering-expert

БесплатноБез исполняемых скриптовНе проверен

Build reliable applications on large language models: prompt design, structured output, evaluation, guardrails, and cost and latency control. Use when the…

personamanagmentlayerот personamanagmentlayer★ 46 звёзд на GitHub

Об этом скилле

LLM Engineering Expert

Building on a language model is engineering against a component that is non-deterministic, occasionally confident and wrong, and priced per token. The discipline is in the surrounding structure, not in the wording of prompts.

Core Concepts

The Model Is a Component, Not the System

A production LLM feature is a pipeline: input validation, context assembly, the model call, output parsing and validation, then a decision about what to do when any of that fails. Treating the model call as the whole feature is the root of most reliability problems.

Determinism Is Not Available

Even at temperature zero, output can vary across model versions, infrastructure and batching. Design for a distribution of outputs, not a fixed one: validate what comes back, and make the failure path as considered as the success path.

Context Is a Budget

Everything competes for the same window: system instructions, examples, retrieved documents, conversation history, the user's input, and room for the answer. Attention is not uniform across a long context — material at the beginning and end is used more reliably than material buried in the middle. Spend the budget deliberately.

Evaluation Precedes Iteration

Without a scored test set, prompt changes are superstition. Ten to fifty representative cases with expected properties are enough to start and will catch most regressions.

Prompt Design

Structure that holds up

Order matters: instructions first, reference material next, the specific request last. Ending with the request keeps it close to generation.

SYSTEM = """You extract structured invoice data.

Rules:
- Return only fields present in the document. Never infer a missing value.
- Amounts are decimal strings with two places, e.g. "1234.50".
- If the document is not an invoice, set "is_invoice" to false and stop.
- Dates are ISO 8601 (YYYY-MM-DD).
"""

USER = """<document>
{document_text}
</document>

Extract the invoice fields defined by the schema."""

What earns its place: an explicit role, hard constraints stated as rules, a defined behaviour for the out-of-scope case, and delimiters that separate untrusted content from instructions.

What does not: politeness, threats, "you are the world's best", and repeated emphasis. They consume budget and do not measurably improve output.

Few-shot examples

Two to five examples usually beat both zero and twenty. Choose them to cover the decision boundaries you care about — especially the case you keep getting wrong, and at least one negative or refusal case. Keep formatting identical across examples; inconsistency is learned as signal.

Give the model somewhere to think

For multi-step reasoning, let it work before it answers, then separate the reasoning from the result so parsing stays simple.

<thinking>Work through the calculation here.</thinking>
<answer>{"total": "1234.50"}</answer>

Reasoning-tuned models do this internally; adding your own scaffold on top of them can hurt. Test rather than assume.

Structured Output

Never parse prose you did not constrain. Use the provider's schema-constrained output where available, and validate regardless.

from pydantic import BaseModel, Field, ValidationError
from decimal import Decimal

class Invoice(BaseModel):
    is_invoice: bool
    invoice_number: str | None = None
    issued_on: str | None = Field(default=None, pattern=r"^\d{4}-\d{2}-\d{2}$")
    total: Decimal | None = None
    currency: str | None = Field(default=None, pattern=r"^[A-Z]{3}$")

def extract(document_text: str) -> Invoice:
    raw = call_model(SYSTEM, USER.format(document_text=document_text),
                     response_schema=Invoice.model_json_schema())
    try:
        return Invoice.model_validate_json(raw)
    except ValidationError as exc:
        # One repair attempt with the error, then fail closed.
        repaired = call_model(SYSTEM, REPAIR_PROMPT.format(raw=raw, errors=exc))
        return Invoice.model_validate_json(repaired)

Validation must be structural and semantic. A well-formed JSON object whose total does not equal the sum of its line items is still wrong; check the invariants your domain requires.

Evaluation

Build the set before tuning

CASES = [
    {"input": "...", "expect": {"is_invoice": True, "currency": "EUR"}},
    {"input": "...", "expect": {"is_invoice": False}},          # negative case
    {"input": "...", "expect": {"total": Decimal("0.00")}},     # edge case
]

def score(case) -> bool:
    got = extract(case["input"])
    return all(getattr(got, k) == v for k, v in case["expect"].items())

Run the set on every prompt or model change and record the score. A change that improves your favourite example and drops the aggregate is a regression.

Choosing a metric

Output kind Metric
Полный SKILL.md на GitHub

Установить llm-engineering-expert в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Read
Write
Edit
Bash(python:*, python3:*, pip:*, pytest:*, npm:*, npx:*)
Grep
Glob
WebSearch

Вложенные файлы

references/EVALUATION.mdreferences/PROMPT_PATTERNS.md

FAQ

Что делает скилл llm-engineering-expert?

Build reliable applications on large language models: prompt design, structured output, evaluation, guardrails, and cost and latency control. Use when the user mentions LLMs, prompts, prompt engineering, few-shot examples, structured or JSON output, function calling, hallucination, model evaluation, token costs, streaming, or when the task involves choosing a model, writing a system prompt, or making model output dependable enough for production.

Как установить скилл llm-engineering-expert?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл llm-engineering-expert запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить llm-engineering-expert с