prompt-refinement
Transform prompts into structured TCRO format with phase-specific clarification. Automatically invoked by /ai-eng/research, /ai-eng/plan, /ai-eng/work, and /ai-eng/specify commands. Use when refining vague prompts, structuring requirements, or enhancing user input quality before execution.
What this skill does
# Prompt Refinement Skill
## Critical Importance
**Proper prompt refinement is critical for achieving optimal AI response quality.** Vague or ambiguous prompts lead to inconsistent results, wasted iterations, and frustration. A well-structured prompt with clear task definition, rich context, explicit requirements, and specific output format dramatically improves AI performance. Each refinement iteration compounds the quality improvement—investing time upfront saves countless back-and-forth cycles later. Poor prompt quality is the #1 cause of unsatisfactory AI interactions.
## Systematic Approach
** approach prompt refinement systematically.** Prompt refinement requires active listening, clarifying questions, and structured thinking. Don't assume understanding—ask targeted questions to uncover implicit requirements, constraints, and expectations. Use the TCRO framework as your organizing principle: Task (what), Context (why), Requirements (how), Output (what it looks like). Iterate until all four elements are clear, specific, and actionable. Patience in refinement pays off in execution.
## The Challenge
**The transform vague user input into perfectly structured prompts without over-constraining creativity or missing the true intent, but if you can:**
- Your AI responses will be consistently excellent
- Users will get what they actually want
- Iteration cycles will shrink dramatically
- You'll establish trust in AI-assisted workflows
The challenge is extracting enough detail to guide the AI without boxing in the solution or asking too many exhausting questions. Can you find the sweet spot between clarity and efficiency?
## Prompt Refinement Confidence Assessment
After refining a prompt, rate your confidence from **0.0 to 1.0**:
- **0.8-1.0**: Prompt perfectly structured, all ambiguities resolved, constraints explicit, output format clear
- **0.5-0.8**: Prompt well-structured but minor uncertainties remain, some assumptions documented
- **0.2-0.5**: Prompt partially structured, several ambiguities, risk of misalignment with user intent
- **0.0-0.2**: Prompt still vague, missing critical information, high likelihood of poor results
Identify uncertainty areas: What aspects of the task are still unclear? Which requirements are assumed rather than explicit? What could go wrong based on the current prompt structure?
## Purpose
Transform messy, incomplete prompts into well-structured specifications using the TCRO framework (Task, Context, Requirements, Output) with phase-specific clarifying questions. This skill ensures all user prompts to ai-eng-system commands are properly structured before execution, reducing ambiguity, increasing reproducibility, and improving AI response quality.
## When This Skill is Invoked
This skill is **ALWAYS** invoked at the start of:
- `/ai-eng/research`
- `/ai-eng/specify`
- `/ai-eng/plan`
- `/ai-eng/work`
Commands should include this directive:
```markdown
Use skill: prompt-refinement
Phase: [research|specify|plan|work]
```
## The TCRO Framework
| Element | Purpose | Key Question |
|---------|---------|--------------|
| **Task** | What's the job to be done? | "What specific outcome do you need?" |
| **Context** | Why does this matter? | "What's the broader system/goal?" |
| **Requirements** | What are the constraints? | "What are the must-haves vs nice-to-haves?" |
| **Output** | What format is needed? | "What should the deliverable look like?" |
## Process
### Step 1: Read Project Context
Load `CLAUDE.md` from the project root to understand:
- Project philosophy and core principles
- Tech stack preferences
- Quality standards and conventions
- Naming conventions
- Architectural patterns
### Step 2: Detect Phase
Determine which phase based on:
- The command being invoked
- Keywords in the prompt (research, learn, investigate → research)
- Explicit phase markers in user input
### Step 3: Load Phase Template
Based on detected phase, load the appropriate template:
- `templates/research.md` for `/ai-eng/research`
- `templates/specify.md` for `/ai-eng/specify`
- `templates/plan.md` for `/ai-eng/plan`
- `templates/work.md` for `/ai-eng/work`
### Step 4: Ask Clarifying Questions
Use phase-specific questions from the loaded template.
**Minimum required questions:**
- 1 Task question
- 1 Context question
- 1-2 Requirements questions
- 1 Output question
**Present questions interactively:**
1. Display original user prompt
2. Ask clarifying questions one at a time or in small groups
3. Collect user responses
4. Use responses to structure refined prompt
### Step 5: Structure into TCRO
Format the refined prompt using the TCRO structure:
```text
Task: [Specific, actionable task statement]
Context: [Broader system, goals, constraints from CLAUDE.md]
Requirements:
- [Must-have requirement 1]
- [Must-have requirement 2]
- [Nice-to-have if mentioned]
Output: [Expected deliverable format and location]
```
### Step 6: Apply Incentive Prompting
Enhance the TCRO-structured prompt with techniques from the `incentive-prompting` skill:
- **Expert Persona**: Assign appropriate role based on task
- **Stakes Language**: Add "This is critical..." for high-importance tasks
- **Step-by-Step Reasoning**: Add " solve step by step"
- **Self-Evaluation**: Add "Rate your confidence 0-1" request
### Step 7: Confirm with User
Display the refined prompt and ask for confirmation:
```markdown
## Refined Prompt
[The TCRO-structured, incentive-enhanced prompt]
Proceed with this refined prompt? (y/n/edit)
```
- **y**: Proceed with refined prompt
- **n**: Ask more clarifying questions
- **edit**: Allow user to manually refine the prompt
## Integration with Commands
Commands should reference this skill with:
```markdown
---
name: ai-eng/[command-name]
description: [Description]
agent: [agent]
---
Use skill: prompt-refinement
Phase: [research|specify|plan|work]
# [Command Name]
[Rest of command definition...]
```
## Template Structure
Phase-specific templates are located in `templates/`:
```
skills/prompt-refinement/
├── SKILL.md
└── templates/
├── research.md
├── specify.md
├── plan.md
└── work.md
```
Each template includes:
- Phase-specific clarifying questions
- TCRO structure for that phase
- Examples of vague → refined transformations
- Phase-specific requirements and considerations
## Example Transformation
### Input (Vague)
> "need auth"
### Phase Detection
Detected phase: `specify` (feature request)
### Clarifying Questions
1. **Task**: What type of authentication capability do you need?
- [ ] User login/logout
- [ ] OAuth/SSO integration
- [ ] API key management
- [ ] Multi-factor authentication (MFA)
- Other: _________
2. **Context**: What's the broader system this fits into?
- New greenfield project or adding to existing codebase?
- What's the tech stack?
- Are there existing authentication patterns to follow?
3. **Requirements**: What are the must-have requirements?
- Security/compliance needs (SOC2, GDPR, etc.)?
- User experience expectations?
- Rate limiting requirements?
4. **Output**: What should the specification include?
- [ ] User stories only
- [ ] Full spec with acceptance criteria
- [ ] Include non-functional requirements
- [ ] Include UI/UX considerations
### Refined TCRO
```text
Task: Create specification for JWT-based user authentication system
Context:
Adding to existing Next.js application with PostgreSQL database.
Project follows CLAUDE.md philosophy of simplicity and pragmatism.
Existing authentication middleware pattern in src/lib/auth/ can be extended.
Requirements:
Must-have:
- Email/password login with secure password hashing (bcrypt, cost factor 12)
- JWT token-based session management with configurable expiry
- Password reset flow via email delivery
- Rate limiting on authentication endpoints (5 attempts/minute)
Nice-to-have:
- Email verification for new accounts
- Session persistence acrosRelated in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.