prompt-engineering

A set of rules for writing prompts that guide language models and coding agents. It explains how the position and wording of instructions can affect what the model generates.

In plain words
What is it for?
Use it when designing, reviewing, or improving prompts for AI agents, especially prompts with multiple rules, roles, or pieces of context.
Why use it?
It helps prevent important requirements from being weakened by poor ordering, unclear framing, or too much surrounding information. This makes prompts easier for an agent to follow consistently.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/technickai/claude_telemetry/prompt-engineering
Clone the repo
git clone --depth 1 https://github.com/TechNickAI/claude_telemetry

Made for: Cursor.

Per session 15 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,553 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00015 $0.01553
Opus 5 $0.00008 $0.00776
Sonnet 5 $0.00003 $0.00311
Haiku 4.5 $0.00002 $0.00155

Measured 2d ago against content hash f8f9690f716c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

prompt-engineering scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/prompt-engineering.mdc · 220 lines

How it starts

The opening of the file, as written. The whole thing — 220 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Prompt Engineering Best Practices

Understanding LLM Token Prediction

How LLMs Actually Process Prompts

Understanding the mechanics of LLM processing is crucial for effective prompt design:

Sequential Token Prediction
  • LLMs read left to right, predicting each token based on everything before it
  • Early tokens shape all that follows—creating a "first impression" that persists
  • Each token's prediction is influenced by ALL previous tokens, creating cascading effects
Attention Mechanisms
  • Earlier tokens receive more attention passes during processing
  • The model repeatedly references early context when interpreting later content
  • This creates a foundation effect where initial framing heavily influences all subsequent reasoning
Context Window Effects
  • Primacy: Information at the beginning is strongly encoded and influences everything
  • Recency: Information near the end is fresh in "working memory" for decisions
  • Middle Fade: Information in the middle can get "lost" if not properly structured
Priming & Anchoring
  • Early statements act as anchors that bias interpretation of everything else
  • The model's "persona" crystallizes early and remains consistent throughout
  • Initial framing determines the lens through which all data is viewed

Implications for Prompt Design

SYSTEM PROMPT (Static Foundation) - the agent's DNA:

  • Identity First: Who the agent IS fundamentally shapes HOW it thinks
  • Core Principles: Unwavering rules or beliefs that guide decisions
  • Operational Framework: Methodology for the task
  • Capabilities & Constraints: What the agent can and cannot do

USER PROMPT (Dynamic Context) - real-time inputs:

  • Current Context: Immediate situation or environment
  • Specific Data: The information to process
  • Task Request: Clear ask with expected output format

Pattern Reinforcement Through Examples

LLMs learn patterns from what you show them, regardless of labels.

How LLMs Process Examples

When you provide code examples, LLMs encode those patterns whether you label them positively or negatively:

Read the full file on GitHub · 220 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 220 lines · 15 tokens per session scan A f8f9690f716c

Subscribe to this mod's changes

prompt-engineering is a cursor rule published in the GitHub repository TechNickAI/claude_telemetry (30 stars, last pushed 10mo ago), licensed MIT. It adds 15 tokens to every session and 1,553 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.