Optimizes AI prompts, code, database queries, documentation, commit messages, and communication using research-backed techniques with content-type detection and step-by-step approval.
npx claudepluginhub v1truv1us/ai-eng-system --plugin ai-eng-learningThis skill uses the workspace's default tool permissions.
Systematically enhance any type of content using research-backed techniques and best practices. This skill:
Creates isolated Git worktrees for feature branches with prioritized directory selection, gitignore safety checks, auto project setup for Node/Python/Rust/Go, and baseline verification.
Executes implementation plans in current session by dispatching fresh subagents per independent task, with two-stage reviews: spec compliance then code quality.
Dispatches parallel agents to independently tackle 2+ tasks like separate test failures or subsystems without shared state or dependencies.
Systematically enhance any type of content using research-backed techniques and best practices. This skill:
Without systematic optimization:
With this skill:
| Type | Purpose | Techniques |
|---|---|---|
prompt | AI prompt optimization | Expert personas, step-by-step reasoning, stakes language, challenge framing |
code | Source code improvement | Performance, readability, error handling, best practices |
query | Database/search query | Indexes, execution plans, caching, pagination |
commit | Git commit messages | Conventional commits, clarity, intent description |
docs | Documentation | Structure, examples, clarity, accessibility |
email | Communication | Tone, clarity, call-to-action, effectiveness |
Assigns detailed expert role with relevant background.
Instead of: "Help me debug this"
Optimized: "As a senior backend engineer with 10 years of experience debugging distributed systems..."
Impact: +60% accuracy (Kong et al., 2023)
Instructs systematic analysis approach.
"Take a deep breath and think step by step. First, identify the symptoms..."
Impact: +46% accuracy (Yang et al., 2023)
Frames importance and consequences.
"This is critical for production. Incorrect analysis could cause service outage."
Impact: +45% quality (Bsharat et al., 2023)
Positions as difficult problem worth solving.
"This is a tricky optimization problem. I bet you can't find the perfect balance."
Impact: +115% on hard tasks (Li et al., 2023)
Requests confidence ratings and uncertainty identification.
"Rate your confidence in this solution (0.0-1.0) and identify any uncertainties."
Impact: +10% calibration
/optimize "Help me debug auth" --prompt
# Interactive approval workflow:
# - Shows detected domain (security)
# - Suggests optimization steps
# - Asks approve/reject/modify for each step
# - Calculates expected improvement
/optimize "Help me debug auth" --prompt --verbose
# Detailed walkthrough with reasoning for each optimization
/optimize "Help me debug auth" --prompt --mode=aggressive
# Apply maximum optimization (more aggressive than default)
/optimize "Help me debug auth" --prompt --mode=conservative
# Minimal changes, preserve original intent
# Skip optimization
/optimize "! Help me debug auth" --prompt
# Exclamation mark prefix bypasses optimization
/optimize src/auth.js --code
# Suggests: performance improvements, readability, error handling
/optimize src/auth.js --code --preview
# Show changes before applying
/optimize src/auth.js --code --apply
# Automatically apply optimizations
/optimize src/auth.js --code --mode=aggressive
# Maximum optimization (may add complexity)
/optimize "SELECT * FROM users WHERE status = 'active'" --query
# Suggests: add indexes, pagination, caching, execution plan
/optimize "SELECT * FROM users WHERE status = 'active'" --query --preview
# Preview query optimization without applying
/optimize "fix: resolve login bug" --commit
# Suggests: add scope, detail, follow conventional commits
/optimize "fix: resolve login bug" --commit --apply
# Apply optimized message
/optimize "README.md" --docs
# Suggests: structure improvements, add examples, clarify sections
/optimize "README.md" --docs --interactive
# Ask clarifying questions about audience and purpose
/optimize "Hey, can you review my code?" --email
# Suggests: professional tone, clear request, timeline
/optimize "Hey, can you review my code?" --email --apply
# Apply professional version
/optimize "help me optimize this database query"
# Automatically detects as prompt, applies optimization
# (Or specify --type if auto-detection fails)
| Option | Description | Values | Default |
|---|---|---|---|
--type <type> | Content type | prompt/code/query/commit/docs/email | auto |
--mode <mode> | Optimization intensity | conservative/moderate/aggressive | moderate |
--preview | Show changes before applying | flag | false |
--apply | Apply optimizations automatically | flag | false |
--interactive | Ask clarifying questions | flag | false |
--verbose | Show detailed process | flag | false |
--force | Apply without confirmation | flag | false |
--output <file> | Save to file instead of stdout | path | stdout |
--source <sources> | Research sources | anthropic/openai/opencode/all | all |
When optimizing prompts, you get step-by-step approval:
Domain detected: Security (authentication/debugging)
Complexity: Medium (moderate ambiguity)
Suggested techniques:
✓ Expert Persona (security engineer with 10yr exp)
✓ Step-by-Step Reasoning (systematic debugging approach)
✓ Stakes Language (production impact)
✓ Self-Evaluation (confidence rating)
For each technique, choose:
[A] Approve - Use this technique
[R] Reject - Skip this technique
[M] Modify - Change the wording
[E] Edit - Full edit mode
[C] Cancel - Don't optimize
Original: "Help me debug auth"
Optimized: "As a senior security engineer with 10 years of experience
debugging distributed authentication systems, help me systematically
debug this login issue. This is production-critical - incorrect analysis
could cause service outage. Walk through your reasoning step by step.
Rate your confidence (0.0-1.0) and identify any uncertainties."
Expected improvement: +78% response quality
Confidence: 0.92
After optimization, receive:
| Metric | Range | Interpretation |
|---|---|---|
| Improvement Score | 0-100 | Expected % improvement |
| Confidence | 0-1.0 | Certainty in optimization |
| Risk Level | Low/Medium/High | Potential for introducing issues |
| Estimated Impact | Brief | What users will notice |
For Prompts:
For Code/Queries/Docs/Etc:
This skill wraps and extends:
incentive-prompting: Core prompt optimization techniquesprompt-refinement: For clarifying vague prompts before optimizingUsed together:
prompt-refinement to clarify intent (Phase 0)content-optimization to enhance (Phase 1)Prompt detected: "debug auth"
Simplicity: Very high (2 words, clear intent)
Action: Skip optimization, proceed with original
Content type unclear. Assume:
[P] Prompt
[C] Code
[Q] Query
[D] Docs
[E] Email
Select type [P/C/Q/D/E]:
⚠️ Warning: Proposed changes remove error handling
Original: try { ... } catch { ... }
Optimized: ... (no error handling)
Action: Proceed? [Y/N]
After using this skill:
/optimize src/newfeature.js --code --preview
# Preview improvements before submitting PR
/optimize "SELECT users FROM..." --query --apply
# Ensure queries are optimized before production
/optimize "README.md" --docs --interactive
# Get suggestions specific to new team members
/optimize "help me" --prompt --verbose --mode=aggressive
# See aggressive techniques to learn from
--preview before --apply to review changes--mode=conservative to see minimal changes--interactive to guide optimizationprompt-refinement skill first, then optimize--mode=aggressive output to understand patternsHow to interpret confidence scores:
For power users, extend with custom techniques:
This skill provides the framework; you customize the techniques.