agent-prompt-engineering

agent-prompt-engineering is a skill for Claude Code, Codex from agentailor/fullstack-langgraph-nextjs-agent. It costs 111 tokens per session (2,997 once invoked), scanned C, original, MIT.

A guide for writing and reviewing instructions for autonomous AI agents, systems that decide and act through repeated tool-using steps. It covers how to define their role, inputs, rules, and decision-making approach.

In plain words
What is it for?
Use it to create or improve system prompts for coding agents and other tool-using agents that work in loops.
Why use it?
It addresses the difficulty of making agents behave reliably without relying on rigid instructions or unexplained assumptions. It provides production-oriented principles for refining prompts based on observed behavior.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions Claude Code; installed under .agents/ (shared by several agents).

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 skills/agentailor/fullstack-langgraph-nextjs-agent/agent-prompt-engineering
Any agent
npx skills add agentailor/fullstack-langgraph-nextjs-agent --skill agent-prompt-engineering
Clone the repo
git clone --depth 1 https://github.com/agentailor/fullstack-langgraph-nextjs-agent

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 agent-prompt-engineering

README.md
[![agentmods](https://agentmods.dev/badge/skills/agentailor/fullstack-langgraph-nextjs-agent/agent-prompt-engineering.svg)](https://agentmods.dev/skills/agentailor/fullstack-langgraph-nextjs-agent/agent-prompt-engineering)
Your own site
<a href="https://agentmods.dev/skills/agentailor/fullstack-langgraph-nextjs-agent/agent-prompt-engineering"><img src="https://agentmods.dev/badge/skills/agentailor/fullstack-langgraph-nextjs-agent/agent-prompt-engineering.svg" alt="Measured on agentmods" height="20"></a>
Per session 111 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,997 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. 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.1 $0.00111 $0.02997
Opus 5 $0.00056 $0.01499
Sonnet 5 $0.00022 $0.00599
Haiku 4.5 $0.00011 $0.00300

Measured yesterday against content hash 6583d16f0e99, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade C, and why

agent-prompt-engineering scanned grade C with 1 finding 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 yesterday.

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.

Hidden instructionshighPrompt injection

Directives inside HTML comments, invisible characters or bidirectional overrides are read by the model and not by the person reviewing the file.

<!-- Instructions -->
.agents/skills/agent-prompt-engineering/SKILL.md · 394 lines

How it starts

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

Agent Prompt Engineering

Overview

Agent prompt engineering differs fundamentally from traditional prompt engineering. Agents operate autonomously in loops, making decisions and using tools without human intervention. This requires conceptual engineering: providing heuristics, principles, and decision-making frameworks rather than rigid templates.

This skill distills Anthropic's production experience building agents like Claude Code into actionable principles for creating reliable, production-ready agent prompts.

Core Principles

1. Start Simple, Iterate Based on Reality

Begin with a straightforward prompt defining role and core task. Avoid premature optimization.

Initial structure:

<!-- Role -->
You are [Agent Name], a [domain] assistant.
Your task is to [primary objective].

<!-- Dynamic Content -->
You will be provided with [data sources].
<data_source>
{{VARIABLE}}
</data_source>

<!-- Instructions -->
When [handling requests], follow these steps:
1. [Step 1]
2. [Step 2]
3. [Step 3]

<!-- Repeat Critical Instructions — only in long prompts, see note below -->
Remember to [most important constraint].

On repeating the critical instruction: this earns its place in a long prompt, where the constraint would otherwise sit hundreds of lines from the decision it governs. On a frontier model with a short prompt it's unnecessary by default — the instruction was already read, and the restatement just spends tokens. Start without it and add it back if a constraint is actually being missed.

Perfect prompts emerge through iteration. Use AI to draft initial versions, then refine through testing.

2. Think Like Your Agent

Critical rule: If a human cannot follow your instructions with only the tools provided, neither can the agent.

Simulate being the agent: given only your prompt and tool descriptions, can you accomplish tasks?

Common gaps to check:

  • Missing tool usage instructions: "To access [data], use the tool_name(params) tool"
  • Unclear data locations: Specify where information lives and how to retrieve it
  • Ambiguous decision criteria: Define when to use which approach
  • Undefined success conditions: Clarify what "complete" means

Read the full file on GitHub · 394 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. yesterday First seen · 394 lines · 111 tokens per session scan C 6583d16f0e99

Subscribe to this mod's changes

agent-prompt-engineering is a skill published in the GitHub repository agentailor/fullstack-langgraph-nextjs-agent (131 stars, last pushed 2d ago), licensed MIT. It adds 111 tokens to every session and 2,997 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it C with 1 finding (hidden instructions). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-05.

Related

Other skills, from other repositories

using-superpowers

Use when starting any conversation - establishes how to find and use skills, requiring Skill tool invocation before ANY response including clarifying questions.

Onelevenvy/flock · 29 tokens

code-review

This skill should be used when the user asks for a code review of a change — a pull request, merge request, branch, commit range, working-tree change, or pasted diff — covering correctness, security, performance, structure, and repository-specific rules. Trigger on phrases like "review this PR", "review this MR"…

srtab/daiv · 164 tokens

plan

This skill should be used when the user asks to explore a codebase and design implementation plans without making any changes. Trigger when users say 'plan how to implement X', 'design an approach for Y', 'explore the codebase before changing Z', 'create an implementation strategy', 'analyze how to refactor X', 'map…

srtab/daiv · 90 tokens

security-audit

This skill should be used when the user asks to review code for security vulnerabilities, audit a pull request or merge request for risks, check if code is safe, find injection flaws or hardcoded secrets, or assess the security posture of a feature or codebase area. Use this skill even when the user doesn't say…

srtab/daiv · 153 tokens

init

This skill should be used when a user asks to initialize a repository for AI agents, create or update an AGENTS.md file, scaffold agent instructions for a codebase, or improve existing agent guidance. Triggers include phrases like 'create an AGENTS.md', 'set up agent instructions', 'initialize this repo for coding…

srtab/daiv · 86 tokens

skill-creator

Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.

Onelevenvy/flock · 64 tokens