askill
prompt-writing

prompt-writingSafety 85Repository

Creates effective prompts for AI coding agents and subagent delegation. Use PROACTIVELY when writing prompts for Task tool delegation, creating agent instructions, or designing multi-step workflows. MUST BE USED when delegating complex tasks to subagents or writing system prompts.

0 stars
1.2k downloads
Updated 2/5/2026

Package Files

Loading files...
SKILL.md

Prompt Writing Skill

Overview

Core Principle: Context completeness over brevity. Agents cannot infer what you don't provide.

Target Users:

  • Claude Code delegating to subagents via Task tool
  • UI agents that need to generate prompts
  • Engineers writing system prompts or agent instructions

The CLEAR Framework

Use this mnemonic for every prompt you write:

LetterComponentPurposeKey Question
CContextBackground informationWhat does the agent need to know?
LLimitationsConstraints, prohibitionsWhat should NOT be done?
EExpectationsOutput format, success criteriaWhat exactly should be returned?
AActionsStep-by-step instructionsWhat steps to follow?
RResourcesFiles, tools, referencesWhat materials are available?

C - Context

Complete background: project state, environment, history. Include file paths, versions, prior decisions.

L - Limitations

Explicit boundaries: DO NOT modify X, use only Y, forbidden patterns, compliance requirements.

E - Expectations

Exact output format: markdown structure, JSON schema, where to save, success criteria checklist.

A - Actions

Numbered steps, validation checkpoints, decision points, error handling guidance.

R - Resources

Required reading (file paths), available tools, reference implementations, examples.

Full guide with examples: reference/prompt-anatomy.md


Context Patterns

Critical Insight

Subagents have NO conversation history. Each invocation is completely fresh. They cannot infer context.

Three Strategies

StrategyWhen to UseHow
File-BasedMulti-step workflowsSave to file, pass path to next agent
EmbeddedSmall contextsInclude all info directly in prompt
LayeredLarge contextsSummary + references for deep-dive

State Transfer Pattern

Agent 1 → Save results to `.claude/state/results/agent-{timestamp}.md`
Agent 2 → Read from that file path

Full patterns: reference/context-patterns.md


Output Format Quick Reference

PatternUse CaseKey Feature
Structured MarkdownComprehensive resultsTables, sections, test output
Binary VerdictReview/validationPASS/FAIL first, then details
ChecklistMulti-requirementProgress tracking with status
CondensedSubagent responsesMax 3 findings, no verbose output

Delivery Patterns

  • State directory: .claude/state/results/[agent]-[timestamp].md
  • Project output: output/[task-id]/[artifact].md
  • Inline: Return directly (use for summaries only)

Full templates: reference/output-specifications.md


Quality Checklist

Before sending any prompt, verify:

Context (C)

  • All background information included?
  • File paths explicit and complete?
  • No assumptions about prior knowledge?

Limitations (L)

  • Constraints clearly stated?
  • Prohibited actions explicit?
  • Scope boundaries defined?

Expectations (E)

  • Output format specified exactly?
  • Success criteria measurable?
  • Delivery location defined?

Actions (A)

  • Steps numbered and sequential?
  • Validation checkpoints included?
  • Error handling guidance provided?

Resources (R)

  • Required files listed with paths?
  • Available tools mentioned?
  • Examples provided where helpful?

Subagent-Specific

  • No implicit context assumptions?
  • State transfer mechanism defined?
  • Output format prevents overload?

Anti-Patterns Quick Reference

Anti-PatternProblemSolution
Context AmnesiaAssumes agent remembersEmbed all context explicitly
Vague Expectations"Give me a good result"Specify exact format
Implicit Constraints"Follow best practices"List specific requirements
Unbounded Scope"Improve the code"Define precise boundaries
Missing Resources"Check the docs"Provide file paths
Output OverloadNo format limitsRequest condensed response

Full examples with solutions: reference/anti-patterns.md


Templates

Ready-to-use templates for common scenarios:

TemplatePurpose
templates/subagent-delegation.mdTask tool delegation
templates/code-task.mdImplementation tasks
templates/research-task.mdResearch/exploration
templates/review-task.mdCode review/validation

Quick Start

  1. Choose template from templates/ matching your task type
  2. Fill CLEAR sections systematically
  3. Run checklist to verify completeness
  4. Execute the prompt
  5. Iterate if results don't match expectations

Remember: More context is almost always better. When in doubt, include it.


Troubleshooting

ProblemLikely CauseSolution
Irrelevant resultsInsufficient contextAdd explicit file references, examples
Wrong formatVague specificationProvide template with placeholders
Unwanted changesMissing constraintsAdd explicit DO NOT statements
Incomplete taskUnclear success criteriaAdd specific acceptance criteria
Agent asks questionsAmbiguous requirementsMake all decisions upfront

Reference Documentation

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

95/100Analyzed 2/11/2026

An exceptionally well-structured and comprehensive guide for prompt engineering in agentic workflows, featuring a clear framework (CLEAR), actionable checklists, and troubleshooting guides.

85
98
90
95
95

Metadata

Licenseunknown
Version-
Updated2/5/2026
Publishermajiayu000

Tags

llmpromptingtesting