Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
asgard-ai-platform avatar

Tech Prompt Engineering

  • 27 installs
  • 223 repo stars
  • Updated June 6, 2026
  • asgard-ai-platform/skills

tech-prompt-engineering is a Claude skill for debugging and hardening production LLM prompts against injection, format drift, instruction decay, silent regression, and cross-model portability failures.

About

This skill debugs and hardens production LLM prompts against injection, output format drift, instruction forgetting in long contexts, and cross-model portability issues. A developer uses it when an LLM-powered feature ships and outputs become inconsistent, unsafe, or regressed after a model update. It maps six production failure modes to root causes and fixes and gives a four-phase methodology ending in a regression test. It is not for basic prompt-writing questions.

  • Six named production failure modes with symptom, root cause, and fix
  • Four-phase methodology: reproduce, classify, fix, build regression test
  • Focuses on injection, format drift, instruction decay, and silent regression

Tech Prompt Engineering by the numbers

  • 27 all-time installs (skills.sh)
  • Ranked #9,601 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Data as of Aug 2, 2026 (Skillselion catalog sync)
At a glance

tech-prompt-engineering capabilities & compatibility

Capabilities
mcp server development · prompt injection defense · llm regression testing
Use cases
debugging · security audit
From the docs

What tech-prompt-engineering says it does

Debug and harden production LLM prompts — handle prompt injection, output format drift, instruction forgetting in long contexts, and cross-model portability issues.
SKILL.md
In production, user input WILL be used to attempt prompt injection.
SKILL.md
System prompts are a strong hint, not a security boundary.
SKILL.md
npx skills add https://github.com/asgard-ai-platform/skills --skill tech-prompt-engineering

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs27
repo stars223
Last updatedJune 6, 2026
Repositoryasgard-ai-platform/skills

What it does

Diagnose and fix a production LLM feature whose outputs are inconsistent, unsafe, or regressed after a model update.

Who is it for?

Diagnosing why a shipped LLM feature produces inconsistent, unsafe, or regressed output.

Skip if: Basic prompt-writing questions, one-off content generation, or RAG architecture design.

When should I use this skill?

A production LLM feature is misbehaving or regressed after a model version update, or a system prompt needs hardening against injection.

What you get

A prompt debug report identifying the failure mode, root cause, targeted fix, and a regression test to prevent reintroduction.

  • Prompt debug report with failure-mode classification
  • Root cause and targeted before/after prompt fix
  • Regression test added to the suite

By the numbers

  • 6 documented production failure modes
  • 4-phase debugging methodology

Files

SKILL.mdMarkdownGitHub ↗

Production Prompt Engineering

Overview

This skill addresses the failure modes that appear ONLY in production LLM applications: prompt injection, output format drift, silent regression across model versions, instruction decay in long contexts, and hallucination under pressure. It is NOT a tutorial on few-shot or chain-of-thought — assume the agent already knows basic prompting techniques.

When to Use

Trigger conditions:

  • A production LLM feature is misbehaving (inconsistent, unsafe, format-drifting)
  • Designing a system prompt for a multi-tenant application
  • Hardening prompts against injection or jailbreak attempts
  • Diagnosing regression after a model version update

When NOT to use:

  • Basic "how do I write a prompt" — the agent already knows few-shot, CoT, role-play
  • One-off content generation (just write the prompt directly)
  • RAG architecture design (use a RAG-specific skill)

Framework

IRON LAW: Treat User Input as Hostile by Default

In production, user input WILL be used to attempt prompt injection.
The only reliable defense is structural separation:
1. System prompt carries ALL rules and behavior (never trust user input to override)
2. User input is NEVER concatenated directly into instructions
3. Output is validated against an expected schema BEFORE being used downstream
A prompt that works in dev with clean input will fail in production with adversarial input.

Production Failure Modes

Failure ModeObservable SymptomRoot CauseFix
Prompt injectionUser input overrides system instructionsInstructions concatenated with untrusted inputStructural separation: use ChatML roles; validate outputs against schema; never use "ignore previous instructions" susceptible templates
Format driftJSON response breaks 1/1000 callsModel temperature > 0 + unconstrained outputConstrained decoding (JSON mode, grammar), schema validation + retry, lower temperature
Instruction decayRules followed early, ignored after N turnsLong context pushes system prompt out of attentionReinforce critical rules in EACH user message; use model's native tool/system role; shorter contexts
Silent regressionSame prompt, worse output after model updateProvider updated model weightsPin model version; maintain regression test suite; A/B test before rolling upgrades
Hallucination under pressureModel invents facts when uncertainNo explicit "I don't know" escape hatchAdd "If uncertain, respond with {null}. Do not guess." + grounding constraint
Cross-model portabilityWorks on GPT-4, fails on Claude/GeminiModel-specific prompt conventionsTest on all target models; avoid model-specific jailbreaks; use common-denominator patterns

Methodology

Phase 1: Reproduce the Failure

Collect: exact input, exact output, expected output, model + version, temperature. Reproduce in isolation (outside the app) to rule out application bugs. Gate: Failure reproduces consistently in a minimal test case.

Phase 2: Classify the Failure Mode

Match against the table above. Most production failures fall into one of 6 categories. Don't guess — identify which mode applies. Gate: Failure mode classified with evidence.

Phase 3: Apply the Targeted Fix

Fix the SPECIFIC failure mode. Don't rewrite the whole prompt. Generic rewrites often introduce new failure modes. Gate: Fix addresses root cause, not symptom.

Phase 4: Build a Regression Test

Add the failing case to a regression test suite. Run the suite before every prompt change or model version update. Gate: Test suite catches the original failure AND any reintroduction.

Output Format

# Prompt Debug Report: {Feature Name}

## Failure Reproduction
- Input: {exact input}
- Observed: {what happened}
- Expected: {what should have happened}
- Model: {name + version + temperature}

## Failure Mode
{One of: injection, format drift, instruction decay, silent regression, hallucination, cross-model}

## Root Cause
{Specific mechanism, not generic "prompt was bad"}

## Fix
{Targeted change with before/after prompt diff}

## Regression Test
{Test case added to prevent reintroduction}

Gotchas

  • "Ignore previous instructions" is only the beginning: Modern injection uses role-play ("Pretend you are DAN..."), language switching, Unicode tricks, and encoded payloads. Defense requires input validation AND output validation, not just instruction phrasing.
  • Temperature 0 is not deterministic across calls: Even at T=0, outputs can vary across API calls due to backend GPU non-determinism (batch effects). Don't rely on exact string equality in tests; use semantic or schema equality.
  • Few-shot examples override your instructions: If your examples show 500-word responses and you say "be concise", the model follows the examples. Examples are STRONGER than instructions.
  • System prompts are NOT absolute: Even with a system prompt, sufficiently adversarial user input can override behavior. System prompts are a strong hint, not a security boundary. For real security, use output validation and sandboxing.
  • Provider model updates are silent: OpenAI's "gpt-4" alias changes weights without notice. Pin to dated versions (gpt-4-0613) for stability. Rerun regression tests after every update.
  • Context window size ≠ effective context: A 128K context model may only attend well to the first 32K and last 4K. Put critical instructions at START and END, not in the middle ("lost in the middle" effect).

References

  • For prompt injection attack patterns, see references/injection-patterns.md
  • For regression testing frameworks, see references/regression-testing.md
  • For cross-model prompt portability, see references/cross-model-testing.md

Related skills

FAQ

Is a system prompt enough to stop prompt injection?

No. System prompts are a strong hint, not a security boundary; reliable defense requires structural separation plus output validation and sandboxing.

Why does the same prompt behave worse after a model update?

Providers update model weights silently, so pin to a dated model version and maintain a regression test suite that runs after every update.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.