Version: 1.0.0 Status: ACTIVE
Design reusable production prompts and agent instructions from a task's goals, inputs, constraints, workflow, failure modes, and expected outputs.
This skill is for prompts that will be used repeatedly.
The goal is not:
WRITE A VERY LONG PROMPT
The goal is:
BUILD THE SMALLEST RELIABLE INSTRUCTION SYSTEM
Use this skill when:
Do not create a permanent prompt for every one-time request.
A robust reusable prompt usually needs some combination of:
ROLE
OBJECTIVE
INPUT CONTRACT
CONTEXT
PROCEDURE
CONSTRAINTS
TOOL RULES
OUTPUT CONTRACT
FAILURE HANDLING
VERIFICATION
Not every prompt requires every section.
Include only what materially improves behavior.
Define the task in one sentence.
Example:
Review an ASP Classic endpoint for security, correctness,
maintainability, and consistency with the existing project.
If the task cannot be described clearly in one or two sentences, the prompt may be trying to do too many jobs.
Identify who consumes the result.
Examples:
developer
system administrator
manager
student
end user
technical reviewer
Output quality often depends on the consumer.
Identify what the prompt will receive.
Example:
Required:
- source file
- project instructions
- related configuration
Optional:
- error logs
- test results
A reusable prompt should not depend on hidden context whenever avoidable.
Determine exactly what the prompt should produce.
Weak:
Review the code.
Better:
Return:
1. blocking findings
2. important findings
3. optional improvements
4. verification recommendations
For each finding include:
- location
- issue
- why it matters
- smallest recommended fix
Output contracts reduce ambiguity.
Stable information belongs in the reusable prompt.
Variable information should become placeholders.
Example:
Stable:
Review authentication, input validation, error handling,
data access, and consistency with repository conventions.
Variable:
{{TARGET_FILE}}
{{PROJECT_CONTEXT}}
{{USER_GOAL}}
Do not hard-code temporary details into reusable prompts.
Use a role when expertise or perspective materially changes the work.
Good:
Act as a senior application security reviewer
for a legacy ASP Classic application.
Weak:
You are the world's greatest genius programmer.
Roles should affect behavior, not inflate tone.
State the actual outcome.
Example:
Identify realistic security defects and provide the
smallest maintainable corrections without redesigning
unrelated parts of the application.
This combines:
GOAL
+
SCOPE
+
QUALITY BAR
Tell the agent which evidence matters.
Example:
Before reviewing the target file:
1. read AGENTS.md
2. inspect relevant authentication code
3. inspect at least one analogous endpoint
4. inspect the application's error-handling convention
This is stronger than giving generic advice.
Define observable steps.
Example:
1. inspect the target
2. identify trust boundaries
3. trace user-controlled inputs
4. trace data access
5. inspect output encoding
6. identify findings
7. verify findings against project conventions
8. rank by severity
Do not require hidden chain-of-thought.
Ask for operations that can be performed and verified.
Avoid instructions such as:
Show every reasoning step.
Reveal your complete chain of thought.
Think step by step and print everything.
Instead use:
Inspect the evidence.
Identify assumptions.
Compare alternatives.
State the chosen approach and concise rationale.
Report verification evidence.
The workflow matters more than exposing internal reasoning.
Define explicit boundaries.
Examples:
Do not introduce a new framework.
Do not change public URL behavior.
Do not replace parameterized SQL with string concatenation.
Do not modify unrelated files.
Do not invent APIs not present in the repository.
Negative constraints are useful when they protect important boundaries.
Do not add dozens of arbitrary negative rules unless evidence shows they are needed.
Too many constraints can create:
conflicts
instruction dilution
unexpected refusal
poor prioritization
Prefer high-value constraints.
If tools are available, specify when they matter.
Example:
Search the repository before claiming a class does not exist.
Run the build after code changes.
Inspect the diff before completion.
Do not describe every possible tool call.
Define behavioral rules.
A reusable prompt should define success.
Examples:
Run existing tests.
Validate generated JSON.
Compare imported and expected row counts.
Check all referenced files exist.
Verify commands against the target environment.
Prompt outputs are stronger when verification is part of the task.
Define what should happen when the task cannot proceed normally.
Example:
If a critical project fact cannot be discovered,
ask only the minimum targeted question needed.
If testing cannot be performed,
state exactly what remains unverified.
This prevents silent guessing.
Specify whether the task should be:
AUTONOMOUS
INTERACTIVE
SOCRATIC
REVIEW-ONLY
Example:
For learning:
one concept → one drill → wait.
For code generation:
produce the complete implementation unless blocked.
Choosing the wrong interaction mode is a common prompt failure.
For reviewer or adversarial prompts, define incentives rather than simply saying:
Be critical.
Better:
You are the operations engineer responsible for recovering this deployment at 2 AM.
Your primary concern is recoverability.
Treat any irreversible step without rollback as high risk.
This creates realistic scrutiny.
A general reusable structure:
# Role
[Relevant expertise/perspective]
# Objective
[Exact task outcome]
# Inputs
[Required and optional inputs]
# Context
[What must be inspected or understood]
# Procedure
1. [...]
2. [...]
3. [...]
# Constraints
- [...]
- [...]
# Verification
[How correctness is checked]
# Failure Handling
[What to do if blocked or uncertain]
# Output
[Exact expected structure]
Do not save an important reusable prompt without testing it.
Test at least:
NORMAL CASE
INCOMPLETE CASE
EDGE CASE
For high-impact prompts also test:
ADVERSARIAL OR AMBIGUOUS CASE
Use realistic valid input.
Ask:
Did the prompt produce the intended structure?
Did it follow project constraints?
Was the output useful without manual repair?
Remove important but discoverable context.
Check whether the prompt:
discovers it
asks a precise question
or safely identifies what is missing
It should not hallucinate.
Use unusual but valid input.
Examples:
empty dataset
very large file
legacy version
missing optional field
unusual directory structure
The goal is to expose brittle assumptions.
Give input that could be interpreted multiple ways.
Check whether the prompt:
discovers context
asks a targeted question
or states a safe assumption
rather than arbitrarily choosing.
Try to trigger behavior the prompt forbids.
Example:
If the prompt says:
Do not introduce dependencies.
give it a task where adding a package is tempting.
Verify that it respects the boundary.
Ensure the output contract is useful.
Ask:
Can another person or agent act directly on this output?
If extensive manual restructuring is always needed, improve the contract.
After failure:
PRESERVE FAILED INPUT
PRESERVE FAILED OUTPUT
DIAGNOSE FAILURE
MAKE SMALLEST CHANGE
RERUN SAME TEST
Use:
.ai/skills/prompt-debugger/SKILL.md
Do not rewrite everything immediately.
Useful production prompts should be versioned.
Example:
security-review_v1.0.md
security-review_v1.1.md
Or track version inside the file.
Version changes should reflect meaningful behavior changes.
For important prompts, note:
what changed
why
what failed
how the change was tested
Prompt evolution should be evidence-driven.
A powerful creation method is:
SUCCESSFUL TASK
↓
WHAT PROCEDURE PRODUCED IT?
↓
WHAT INPUTS MATTERED?
↓
WHAT BOUNDARIES MATTERED?
↓
GENERALIZE
↓
PROMPT
Use the reverse-engineer or skill-extractor skill when useful.
Create a prompt when:
the primary need is a repeatable task launch or output format
Create a skill when:
the primary need is a reusable operational procedure
Example:
Prompt:
Review this pull request.
Skill:
How to conduct a security-focused code review.
A prompt may invoke a skill.
Do not put every reusable prompt rule into AGENTS.md.
Root instructions should define broad behavior.
Task-specific behavior belongs in prompts or skills.
Complex tasks may compose:
ROOT INSTRUCTIONS
+
PROJECT CONTEXT
+
SKILL
+
TASK PROMPT
+
CURRENT INPUT
This is usually better than one giant permanent prompt.
Prefer precise instructions with high information value.
Weak:
Be thoughtful, careful, thorough, professional, excellent,
detailed, accurate, helpful, expert, comprehensive.
Better:
Identify blocking defects first.
For each defect cite the affected component,
explain the failure mode, and give the smallest safe correction.
Specific behavior beats adjectives.
Tone rules should be operational.
Example:
Use direct language.
Avoid unnecessary preamble.
Do not use generic praise.
Prefer concrete examples.
Avoid attempting to control every word.
When writing user-facing output, useful defaults include:
start with the answer
use active voice
prefer concrete nouns and verbs
remove redundant summary
avoid generic corporate filler
For a final editing pass use:
.ai/skills/coffee-chat-editor/SKILL.md
Examples can strongly constrain behavior.
Use examples when:
format is unusual
distinctions are subtle
output keeps drifting
failure cases are important
Avoid dozens of examples.
One or two strong examples are often enough.
When examples are useful:
INPUT EXAMPLE
EXPECTED OUTPUT
SECOND DIFFERENT INPUT
EXPECTED OUTPUT
Ensure examples demonstrate the rule rather than accidentally hard-coding one domain case.
Improve a reusable prompt when real use reveals:
Capture evidence before permanent change.
Retire a prompt when:
its workflow is obsolete
a skill replaces it
a better prompt fully supersedes it
technology changes
it repeatedly causes worse outcomes
Do not maintain unused prompts indefinitely.
When using Prompt Architect, produce:
PROMPT PURPOSE
INPUT CONTRACT
REUSABLE PROMPT
TEST CASES
EXPECTED BEHAVIOR
KNOWN LIMITATIONS
VERSION
For simple prompts, compress this.
Initial active version.
Introduced:
Powered by TurnKey Linux.