Refine Prompt
Transform rough prompts into clear, actionable instructions grounded in codebase context.
When to Use
Use this skill when:
- A prompt is vague or incomplete
- You need codebase-aware context added to a request
- Complex tasks need decomposition into sub-tasks
- You want persona assignment for task execution
- You need negative constraints (what NOT to do) defined
Quick Start
/refine-prompt "add caching to the api"
Core Workflow
- Context Analysis - Analyze repo structure, find relevant files and patterns
- Intent Extraction - Parse the prompt, expand implicit goals, fix errors
- Persona Assignment - Assign appropriate expertise level and role
- Reference Injection - Add specific file paths, functions, patterns
- Negative Constraints - Define anti-patterns and forbidden approaches
- Decomposition - Break complex requests into ordered sub-tasks
- Validation - Check feasibility, identify risks and edge cases
- Self-Critique - Review for completeness, ambiguity, quality
- Intent Confirmation - Verify understanding with user
- Output - Save refined prompt and execution log
Parameters
Parameters are defined in .octon/framework/capabilities/runtime/skills/registry.yml (single source of truth).
This skill accepts one required parameter (raw_prompt) and three optional parameters for execution mode, context depth, and confirmation behavior.
Output Location
Output paths are defined in .octon/framework/capabilities/runtime/skills/registry.yml (single source of truth).
Outputs are written to .octon/framework/scaffolding/practices/prompts/ (refined prompt) and /.octon/state/evidence/runs/skills/refine-prompt/ (execution log).
Boundaries
- Never change the core intent of the original prompt
- Always preserve explicit user preferences
- State all assumptions explicitly
- Reference only files that actually exist
- Write only to designated output paths
- Always perform self-critique before finalizing
- Confirm intent unless explicitly skipped
When to Escalate
- Unresolvable contradictions in the prompt
- Completely unclear intent
- Referenced files don't exist
- Request conflicts with project constraints
- Scope exceeds 20 files
- Self-critique reveals major issues
References
For detailed documentation:
- Behavior phases - Full phase-by-phase instructions
- I/O contract - Inputs, outputs, dependencies, command-line usage
- Safety policies - Tool and file policies
- Examples - Full refinement examples
- Validation - Acceptance criteria
- Error handling - Error codes, recovery procedures, troubleshooting
