Agent skill
prompt-enhance
[Skill Management] Enhance any prompt/doc/skill file with AI attention anchoring — summary at top+bottom, inline summaries for READ references, progressive disclosure structure. Use for prompt engineering, skill refactoring, doc optimization.
Install this agent skill to your Project
npx add-skill https://github.com/duc01226/EasyPlatform/tree/main/.claude/skills/prompt-enhance
SKILL.md
[IMPORTANT] Use
TaskCreateto break ALL work into small tasks BEFORE starting.
Quick Summary
Goal: Refactor any markdown prompt file (skill, doc, protocol, agent definition) to follow AI attention anchoring best practices — ensuring AI actually reads and follows all instructions.
Workflow:
- Read — Read the target file completely
- Analyze — Identify READ references, missing summaries, weak top/bottom anchoring
- Refactor — Apply the 3 transformations below
- Verify — Check formatting, no content loss, correct structure
Key Rules:
- AI attention is strongest at TOP and BOTTOM of prompt, weakest in middle
- Every READ instruction MUST include an inline summary of the referenced file's key rules
- Top section = concise summary + key rules. Bottom section = closing reminders echoing top rules
- Middle section = detailed steps. Accept intentional duplication between top and bottom.
- Prompt quality > token count — but verbose/repetitive prompts degrade quality too. Optimize for clarity-per-token.
- Never remove meaningful content — but DO tighten prose, merge redundant sections, and cut filler
Target File
Enhance this file: $ARGUMENTS
If no file specified, ask via AskUserQuestion.
The 3 Transformations
Transformation 1: Inline Summaries for READ References
Problem: AI sees "MUST READ file.md" and skips reading it.
Solution: Add 2-3 line summary of the file's key rules BEFORE the read instruction.
Before:
**MUST READ** `.claude/skills/shared/evidence-based-reasoning-protocol.md` before executing.
After:
> **Evidence-Based Reasoning** — Speculation is FORBIDDEN. Every claim needs `file:line` proof.
> Confidence: >95% recommend freely, 80-94% with caveats, <80% DO NOT recommend.
> MUST READ `.claude/skills/shared/evidence-based-reasoning-protocol.md` for full protocol and checklists.
How to create the summary:
- Read the referenced file
- Extract the 2-3 most critical rules (what AI MUST do/not do)
- Write as a blockquote with bold label + em dash + rules
- Keep the MUST READ instruction on the next line (still tells AI to read for details)
Scope rules:
.claude/protocol files → YES, always add inline summary (content is stable, belongs to the framework)docs/project-reference/files → NO inline summary (content varies per project, auto-injected by hooks)- For project-reference docs, add:
(content auto-injected by hook — check for [Injected: ...] header before reading)
Transformation 2: Top Summary Section
Required structure (first 20 lines after frontmatter):
> **[IMPORTANT]** TaskCreate instruction...
> **Protocol Name** — [inline summary]. MUST READ `path` for details.
> **Another Protocol** — [inline summary]. MUST READ `path` for details.
## Quick Summary
**Goal:** [One sentence — what this skill achieves]
**Workflow:**
1. **[Step]** — [description]
2. **[Step]** — [description]
**Key Rules:**
- [Most critical constraint]
- [Second constraint]
Transformation 3: Bottom Closing Reminders
Add at the very end of the file:
---
## Closing Reminders
- **MUST** [echo the #1 most important rule from the top]
- **MUST** [echo the #2 most important rule]
- **MUST** [echo the #3 most important rule]
- **MUST** add a final review task to verify work quality
Pick 3-5 rules from the top that AI most commonly violates. The bottom section exists purely to re-anchor attention after the long middle section.
Transformation 4: Token Optimization (Conciseness Pass)
Principle: Prompt quality is FIRST priority. But verbose prompts degrade quality too — AI attention dilutes across unnecessary tokens. Optimize for clarity-per-token: maximum signal, minimum noise.
What to cut:
- Filler phrases — "It is important to note that", "Please make sure to", "You should always" → just state the rule
- Redundant explanations — if the heading says it, the body doesn't need to re-explain. Tables > paragraphs for structured data
- Duplicate content — merge sections that say the same thing differently (except intentional top/bottom anchoring)
- Overly verbose examples — trim examples to minimum lines that demonstrate the pattern. Replace paragraph explanations with
// commentin code - Prose paragraphs for rules — convert to bullet lists or tables (AI parses structured formats faster)
What to KEEP:
- Code examples with actual file paths/patterns (AI copies these directly)
- Decision tables and lookup references
- Anti-pattern examples (before/after pairs)
- All
file:lineevidence and concrete paths - Top/bottom anchoring (intentional duplication)
Evaluation metrics per doc:
- Density score — useful rules per 100 lines (higher = better)
- Savings estimate — % tokens saveable without losing information
- Risk — what breaks if cut too aggressively (e.g., AI misses a pattern)
Process
Step 1: Read and Analyze
- Read the target file completely
- List all READ/MUST READ references found
- For each: classify as
.claude/(needs inline summary) ordocs/(skip, project-specific) - Check: does it have a Quick Summary section? Closing Reminders?
- Report findings before making changes
Step 2: Create Inline Summaries
For each .claude/ protocol reference:
- Read the referenced file
- Extract 2-3 key rules
- Write the inline summary blockquote
- Replace the bare MUST READ with summary + read instruction
Step 3: Add/Fix Top Section
- If Quick Summary missing → create one from the file's content
- If present but weak → strengthen with Goal, Workflow, Key Rules
- Ensure protocol summaries appear before Quick Summary
Step 4: Add/Fix Bottom Section
- If Closing Reminders missing → add standard section
- Pick rules that AI most commonly skips (evidence-based, task creation, pattern search)
- Remove old "IMPORTANT Task Planning Notes" if superseded by Closing Reminders
Step 5: Verify
- No YAML frontmatter corruption
- No content loss (diff check)
- Correct markdown formatting (blank lines between sections)
- READ references correctly classified (
.claude/vsdocs/)
Closing Reminders
- MUST read target file completely before any changes
- MUST read each referenced protocol file to write accurate inline summaries — never guess content
- MUST keep all original content — only restructure, never delete instructions
- MUST add inline summaries only for
.claude/protocol files, not project-specificdocs/files - MUST verify no YAML frontmatter corruption after changes MANDATORY IMPORTANT MUST READ the following files before starting:
- MUST READ
file.mdbefore starting - MUST READ
.claude/skills/shared/evidence-based-reasoning-protocol.mdbefore starting
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
fix-parallel
[Implementation] Analyze & fix issues with parallel fullstack-developer agents
ask
[Utilities] Answer technical and architectural questions.
claude-code
[Utilities] Claude Code CLI setup, configuration, troubleshooting, and feature guidance. Triggers on claude code setup, hook not firing, MCP connection, context limit, skill creation, slash command setup.
workflow-deployment
[Workflow] Trigger Deployment & Infrastructure workflow — CI/CD pipelines, Docker, Kubernetes setup and deployment.
workflow-idea-to-pbi
[Workflow] Trigger Idea to PBI workflow — po/ba workflow: capture idea, refine to pbi, create stories, prioritize.
easy-claude-help
[Utilities] Configuration guide for the easy-claude framework — explain settings, guide users through configuring .ck.json.
Didn't find tool you were looking for?