ardurai/god-skill-suite/god-ai-prompting

Claude Code and agent skill by ardurai/god-skill-suite

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

God-level prompt engineering and LLM interaction skill. Covers systematic prompt design, chain-of-thought (CoT) and its variants (zero-shot CoT, few-shot CoT, self-consistency, tree of thought, graph of thought), structured output extraction, few-shot example design, instruction following optimization, prompt robustness testing, DSPy for programmatic prompt optimization, meta-prompting, system prompt design for production, prompt injection defense at the prompt level, evaluation of prompt quality, and the mindset that prompt engineering is applied ML research — not trial and error.

Install

npx vskill@latest install ardurai/god-skill-suite/god-ai-prompting

SKILL.md

The same SKILL.md was published earlier as ardurai/god-skill-suite/god-ai-prompting.

God-Level Prompt Engineering

A prompt that "seems to work" is not a prompt. It is a hypothesis. Your job is to design, measure, break, rebuild, and prove. Prompt engineering is applied ML research. Treat it like one.

Researcher-Warrior Mindset

You do not write prompts by feel. You define a success criterion, build an evaluation set, run experiments, measure results, and iterate based on data. You try to break your own prompts before the model's users do. You document what you tried, what failed, and why. When a prompt works for the happy path but fails on edge cases, that is not a success — that is a partial success that will become a production incident.

Anti-hallucination rules for this domain:

  • The paper citation for zero-shot CoT ("Let's think step by step") is: Kojima et al. "Large Language Models are Zero-Shot Reasoners" (NeurIPS 2022). Cite it correctly or not at all.
  • Tree of Thought is from: Yao et al. "Tree of Thoughts: Deliberate Problem Solving with Large Language Models" (NeurIPS 2023).
  • DSPy is from: Khattab et al. "DSPy: Compiling Declarative Language Model Calls into Self-Improving Pipelines" (ICLR 2024).
  • Never claim a prompting technique "always works." Every technique has failure modes and model-dependent behavior.
  • Never describe a specific model's behavior as universal. Prompting techniques generalize imperfectly across models and versions.

1. Prompt Engineering Is Not Magic

The Core Principle

Prompt engineering is systematic experimentation. The process is:

  1. Define the task precisely: what is the input? What is the output? What does "correct" mean?
  2. Define the success metric: accuracy on a test set? Human preference? Latency? Cost?
  3. Build an evaluation set: at minimum 50 examples covering the distribution of inputs, including edge cases. (More is better. 200+ for production prompts.)
  4. Establish a baseline: even "summarize this text" with no additional instructions is a baseline.
  5. Experiment: change one thing at a time. Measure on the eval set.
  6. Document: what you tried, what changed, what the delta was.
  7. Ship the best measured prompt, not the most clever prompt.
What "Seems to Work" Actually Means

If you test your prompt on 5 examples and it works on 4, you have n=5 data points. You do not know how it performs on the actual distribution of inputs. You have a hypothesis, not a result. The production system will give you the real distribution, but by then it's too late to be careful.

Build your eval set from real user inputs (or sampled synthetic inputs that match the real distribution) before shipping.


2. The Anatomy of a Production System Prompt

Order matters. Models attend differently to different positions in the context. The structure below is battle-tested for instruction-following models:

[1. ROLE DEFINITION]
You are a customer support specialist for Acme Corp, an e-commerce company.
You have access to order management and shipping tools.
[2. CONTEXT SETTING]
Today's date: {{current_date}}
User's account status: {{account_status}}
Recent orders: {{recent_orders}}
[3. TASK SPECIFICATION]
Your job is to help customers resolve issues with their orders.
You can: look up order status, initiate refunds for orders under $200, escalate to human agents.
You cannot: modify order contents, approve refunds over $200, access payment information.
[4. OUTPUT FORMAT SPECIFICATION]
Respond in this format:
- First, acknowledge the customer's issue in one sentence.
- Then provide the resolution or next step.
- If escalating, explain why and what to expect.
Keep responses under 150 words.
[5. EXAMPLES]
<example>
Customer: Where is my order #12345?
Assistant: Your order #12345 was shipped on Jan 10th and is currently in transit with UPS (tracking: 1Z999...). Expected delivery is Jan 14th.
</example>
[6. SAFETY / CONSTRAINT INSTRUCTIONS]
Do not discuss competitor products. Do not make promises about delivery dates beyond what the tracking system shows. Do not share any customer's order information with a different customer.
Why Order Matters

Models (especially older ones) show recency bias — content near the end of the prompt has disproportionate influence. Put the most important constraints and output format specifications both early (in the role/task section) AND late (in the safety section). Repeat critical instructions.


3. Chain-of-Thought and Its Variants

Why Chain-of-Thought Works

CoT prompting causes the model to generate intermediate reasoning steps before producing the final answer. This works because:

  1. The model's "computation" is proportional to the tokens it generates before the answer.
  2. Generating intermediate steps reduces the logical distance between the problem and the answer.
  3. Errors in individual steps are more visible and can be caught by the model itself.

Empirical result: CoT significantly improves performance on multi-step reasoning tasks (arithmetic, commonsense reasoning, symbolic reasoning). It does NOT consistently help on tasks that don't require multi-step reasoning (simple classification, pattern matching).

Zero-Shot CoT

Append "Let's think step by step." (or equivalent) to the prompt. Verified to work by Kojima et al. "Large Language Models are Zero-Shot Reasoners" (NeurIPS 2022).

Prompt: Roger has 5 tennis balls. He buys 2 more cans of tennis balls. Each can has 3 tennis balls.
How many tennis balls does he have now? Let's think step by step.
Model output: Roger starts with 5 balls. He buys 2 cans × 3 balls = 6 balls. 5 + 6 = 11 balls.
Answer: 11

Without "Let's think step by step": models often answer 8 (incorrectly, by ignoring the multiplication).

Variants: "Think this through step by step." / "Work through this carefully." / "Reason through this before answering." All work similarly.

Few-Shot CoT

Provide examples that include full reasoning chains, not just input-output pairs.

<example>
Q: There are 15 trees in a grove. Grove workers will plant more trees today. After they are done, there will be 21 trees. How many trees did workers plant?
A: We start with 15 trees. After planting, there are 21. So workers planted 21 - 15 = 6 trees.
Answer: 6
</example>
<example>
Q: Shawn has 5 toys. For Christmas he got 2 toys from Mom and 3 toys from Dad. How many toys does he have?
A: Shawn starts with 5. Mom gives 2: 5 + 2 = 7. Dad gives 3: 7 + 3 = 10.
Answer: 10
</example>
Q: {{target_question}}
A:

Few-shot CoT outperforms zero-shot CoT on complex tasks, at the cost of more tokens and the need for curated examples.

Self-Consistency

Run the same CoT prompt N times (N = 5-40 depending on task). Collect all answers. Return the majority vote answer.

Why it works: different reasoning paths may reach the same correct answer from different directions. Errors tend to produce diverse wrong answers. The correct answer has higher probability of being the plurality.

When to use: high-stakes reasoning tasks where accuracy is worth the cost of N calls. N=10 is a common sweet spot.

Cost: N × (single call cost). Only justified when accuracy improvement is worth the cost increase. Measure the accuracy improvement on your eval set before committing.

Tree of Thought (ToT)

Source: Yao et al. "Tree of Thoughts: Deliberate Problem Solving with Large Language Models" (NeurIPS 2023).

At each step, the model generates multiple candidate next thoughts (branches). Each branch is evaluated (by the model itself or by a separate evaluator). The most promising branches are expanded further. Search strategies: breadth-first (explore all branches at depth d before going deeper), depth-first with backtracking.

Problem: Write a coherent short story in 4 sentences.
Thought 1a: "A detective arrives at a crime scene..." [eval: 8/10, continue]
Thought 1b: "A dragon woke up from a long sleep..." [eval: 6/10, prune]
Thought 1c: "In a city of glass towers..." [eval: 7/10, continue]
→ Expand 1a:
Thought 2a: "The detective notices a muddy footprint..." [eval: 9/10, continue]
...

When to use: creative tasks requiring exploration (story writing, puzzle solving); mathematical reasoning where early wrong turns need correction; any task with many valid intermediate states.

Cost: very high (branching factor × depth × eval calls). Profile cost before using in production. Often best reserved for offline processing, not real-time interaction.


4. Few-Shot Example Design

Diversity of Examples

Examples should cover the distribution of inputs the model will see:

  • Different lengths (short and long inputs)
  • Different complexity levels (easy and hard cases)
  • Different edge cases (empty input, malformed input, unusual input)
  • Failure modes you want to avoid (include an example of a wrong approach followed by the correct one)
Avoiding Bias in Example Selection

The model learns the pattern from your examples. If all your examples use formal language, it will use formal language. If all your classification examples come from one category, it will be biased toward that category. Balance your examples deliberately.

Format Consistency

Every example must follow the exact same format. Inconsistent formatting in examples produces inconsistent output. The model is a pattern matcher at its core — give it a consistent pattern.

Example Count
  • 1-3 examples: minimal improvement, low token cost
  • 5-10 examples: significant improvement for most tasks
  • 20+ examples: diminishing returns for prompting (consider fine-tuning at this point)
  • The "sweet spot" depends on the task and model. Measure on your eval set.

5. Structured Output Extraction

JSON Mode

OpenAI and most modern LLMs support a "JSON mode" or "response_format: json_object" parameter that forces the output to be valid JSON. Always use this when you need structured output.

python
response = openai_client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": prompt}],
response_format={"type": "json_object"}
)

Important: JSON mode does not enforce a schema — it only ensures valid JSON. The model may still include or exclude fields. Use function calling or Structured Outputs (OpenAI) for schema enforcement.

Function Calling for Structured Extraction
python
tools = [{
"type": "function",
"function": {
"name": "extract_entities",
"description": "Extract named entities from the text",
"parameters": {
"type": "object",
"properties": {
"people": {"type": "array", "items": {"type": "string"}},
"organizations": {"type": "array", "items": {"type": "string"}},
"locations": {"type": "array", "items": {"type": "string"}}
},
"required": ["people", "organizations", "locations"]
}
}
}]
Pydantic Schema Enforcement with Retry
python
from pydantic import BaseModel, ValidationError
import json
class ExtractedData(BaseModel):
name: str
age: int
email: str
def extract_with_retry(text: str, max_retries: int = 3) -> ExtractedData:
for attempt in range(max_retries):
response = call_llm(f"Extract: {text}. Return JSON.")
try:
data = json.loads(response)
return ExtractedData(**data)
except (json.JSONDecodeError, ValidationError) as e:
if attempt == max_retries - 1:
raise
# Feed the error back to the model
text = f"{text}\n\nPrevious attempt failed: {e}. Try again with valid JSON matching the schema."

Feeding the validation error back to the model in the retry prompt is highly effective. The model understands its own error messages.


6. Instruction Following Optimization

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/ardurai/god-skill-suite/god-ai-prompting/badge)](https://verified-skill.com/skills/ardurai/god-skill-suite/god-ai-prompting)

Something wrong with this skill or its page? Tell us.