ai-prompting-patterns

ai-prompting-patterns is a skill for Claude Code, Codex from jamestorrevillas/dev-skills. It costs 92 tokens per session (2,105 once invoked), scanned A, original, MIT.

A guide for designing how an AI coding agent communicates and makes decisions while working with developers. It covers asking for missing details, reporting progress, handling errors, and requesting confirmation before risky actions.

In plain words
What is it for?
Use it to define agent behavior, create plans for complex tasks, handle ambiguity, explain failures, track work, and decide when confirmation is needed.
Why use it?
It reduces mistakes caused by an agent acting on unclear assumptions. It helps balance independent work with appropriate pauses for developer approval.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to define agent behavior, create plans for complex tasks, handle ambiguity, explain failures, track work, and decide when confirmation is needed.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/jamestorrevillas/dev-skills/ai-prompting-patterns
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.

Any agent
npx skills add jamestorrevillas/dev-skills --skill ai-prompting-patterns
Clone the repo
git clone --depth 1 https://github.com/jamestorrevillas/dev-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ai-prompting-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/jamestorrevillas/dev-skills/ai-prompting-patterns/github.svg)](https://agentmods.dev/skills/jamestorrevillas/dev-skills/ai-prompting-patterns)
Your own site
<a href="https://agentmods.dev/skills/jamestorrevillas/dev-skills/ai-prompting-patterns"><img src="https://agentmods.dev/badge/skills/jamestorrevillas/dev-skills/ai-prompting-patterns/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for ai-prompting-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/jamestorrevillas/dev-skills/ai-prompting-patterns"><img src="https://agentmods.dev/badge/skills/jamestorrevillas/dev-skills/ai-prompting-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 92 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,105 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00092 $0.02105
Opus 5 $0.00046 $0.01052
Sonnet 5 $0.00018 $0.00421
Haiku 4.5 $0.00009 $0.00211

Measured 10d ago against content hash 7464b99c397d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

ai-prompting-patterns 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 10d 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.

.github/skills/ai-prompting-patterns/SKILL.md · 313 lines

How it starts

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

AI Prompting Patterns & Agent Communication

Core Principle

An agent that acts confidently on wrong assumptions costs more than an agent that pauses to ask.

The goal is not maximum autonomy — it's maximum useful autonomy. An agent should be autonomous enough to not constantly interrupt, but disciplined enough to catch itself before doing something irreversible or wrong.


The Autonomy Dial

Set the right autonomy level based on task risk:

Level Mode When to Use
1 Observe & Suggest High-risk environment, new agent, first interactions
2 Plan & Propose Complex tasks — agent creates plan, every step needs approval
3 Act with Confirmation Agent prepares full action sequence, asks for final go/no-go
4 Act Autonomously Pre-approved, low-risk, reversible tasks only

Default: Level 2 for complex tasks, Level 3 for well-defined tasks, Level 4 only for formatting/style changes.


Intent Clarification

When to Ask (Ask-when-Needed Protocol)

Ask before acting when:

  • A key parameter is missing
  • There are multiple valid interpretations
  • The task spans multiple files or systems
  • The action could be hard to reverse
  • Confidence in understanding is below threshold

Don't ask when:

  • The task is simple and single-responsibility
  • Context makes intent obvious
  • The question can be answered by reading the codebase

How to Ask

Use the Binary/Choice pattern — propose specific options instead of open-ended questions:

❌ Bad: "What do you want me to do?"
✅ Good: "I can implement auth using either JWT or OAuth2. 
          Given oauthlib is already in your requirements.txt, 
          I recommend OAuth2. Should I proceed with that?"

Clarification Template

Before I proceed, I want to confirm my understanding:
- I interpret this task as: [your interpretation]
- Key assumption I'm making: [assumption]
- If this is correct, I'll [action]. If not, please clarify.

Read the full file on GitHub · 313 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. 10d ago First seen · 313 lines · 0 tokens per session scan A 7464b99c397d

Subscribe to this mod's changes

ai-prompting-patterns is a skill published in the GitHub repository jamestorrevillas/dev-skills (3 stars, last pushed 5mo ago), licensed MIT. It adds 92 tokens to every session and 2,105 once invoked, about $0.0005 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-31.