Use when the user asks to optimize, improve, or draft a prompt for BosskuAI; identify intent and gaps, select relevant skills, agents, and loops, and return a ready-to-paste prompt without executing it. Do not use for code or performance optimization.
Run bossku memory-path --project <project-root> to resolve <memory-dir> before reading or writing memory. Automatically save verified durable notes with bossku remember --kind decision|plan|learning|project without waiting for the user to ask. When memory_storage is obsidian, all memory including handoffs lives directly in the vault; never create .bossku/memory in a code repo.
Analyze a draft prompt, critique it, match it to BosskuAI workspace components
(skills, agent contracts, loops, memory), and output a complete optimized
prompt the user can paste and run.
When to Use
User says "optimize this prompt", "improve my prompt", "rewrite this prompt"
User says "help me write a better prompt for..."
User says "what's the best way to ask BosskuAI to..."
User pastes a draft prompt and asks for feedback or enhancement
User says "I don't know how to prompt for this"
User says "how should I use BosskuAI for..."
Do Not Use When
User wants the task done directly (just execute it)
User says "optimize this code" or "optimize performance" — these are
refactoring/profiling tasks (bosskuai-code-revamp, bosskuai-performance-profiling)
User is asking about workspace setup (use bosskuai-claude-code-setup)
User wants a skill inventory (use bosskuai-skill-stocktake)
User says "just do it"
How It Works
Advisory only — do not execute the user's task.
Do NOT write code, create files, run commands, or take any implementation
action. Your ONLY output is an analysis plus an optimized prompt.
If the user says "just do it" or "don't optimize, just execute", do not switch
into implementation mode inside this skill. Tell the user this skill only
produces optimized prompts, and instruct them to make a normal task request
if they want execution instead.
Run this 6-phase pipeline sequentially. Present results using the Output
Format below. Respond in the same language as the user's input.
Phase 0: Project Detection
Before analyzing the prompt, detect the current project context:
Check CLAUDE.md / AGENTS.md in the working directory — read for project conventions
If no project files are found (abstract prompt or new project), skip detection
and flag "tech stack unknown" in Phase 4.
Phase 1: Intent Detection
Classify the user's task into one or more categories:
Category
Signal Words
Example
New Feature
build, create, add, implement
"Build a login page"
Bug Fix
fix, broken, not working, error
"Fix the auth flow"
Refactor
refactor, clean up, restructure
"Refactor the API layer"
Research
how to, what is, explore, investigate
"How to add SSO"
Testing
test, coverage, verify
"Add tests for the cart"
Review
review, audit, check
"Review my PR"
Documentation
document, update docs
"Update the API docs"
Infrastructure
deploy, CI, docker, database
"Set up CI/CD pipeline"
Design
design, architecture, plan
"Design the data model"
Decision
should we, which option, go/no-go
"Monorepo or polyrepo?"
Business
pricing, GTM, leads, investors
"Plan the launch"
Phase 2: Scope Assessment
If Phase 0 detected a project, use codebase size as a signal. Otherwise,
estimate from the prompt description alone and mark the estimate as uncertain.
Scope
Heuristic
Orchestration
TRIVIAL
Single file, < 50 lines
Direct execution (indicator still shown)
LOW
Single component or module
Single skill + executor
MEDIUM
Multiple components, same domain
Plan → execute → audit, verification gate
HIGH
Cross-domain, 5+ files
Planner agent first (reasoning model), then phased execution
EPIC
Multi-session, multi-PR, architectural shift
bosskuai-planning-execution multi-session plan + bosskuai-handoff between sessions
Phase 3: BosskuAI Component Matching
Map intent + scope + tech stack (from Phase 0) to specific workspace components.
When unsure what exists, check skills/skill-index.json (the live roster) instead of
guessing — bosskuai-skill-stocktake audits it.
Database changes — schema, migrations, indexes? (if data layer)
Existing patterns — reference files or conventions to follow?
Scope boundaries — what NOT to do?
Source of truth — which files, docs, or data must the answer be grounded in, and may the model use general knowledge?
If 3+ critical items are missing, ask the user up to 3 clarification
questions before generating the optimized prompt. Then incorporate the answers.
Phase 5: Workflow & Model Recommendation
Determine where this prompt sits in the lifecycle:
Research → Plan → Implement (TDD) → Review → Verify → Commit
This maps onto the BosskuAI pipeline: orchestrator/planner → executor →
auditor (+ bosskuai-cybersecurity-risk when risky) → final-reviewer.
Model recommendation (follow the workspace model split — reasoning model
to plan, coding model to execute; see bosskuai-ai-model-selection):
Scope
Recommended split
Rationale
TRIVIAL-LOW
Coding model only
Fast, cost-efficient; indicator still required
MEDIUM
Coding model + reasoning model for the plan step
Standard plan-first discipline
HIGH
Reasoning model (plan + audit) + coding model (execute)
Architecture and risk need the stronger model
EPIC
Reasoning model for the multi-session plan; coding model per phase
Deep decomposition once, cheap execution per slice
Escalate execution to the high-risk route when the task touches auth,
payments, privacy, tenant isolation, migrations, production, or secrets.
Multi-prompt splitting (for HIGH/EPIC scope):
Prompt 1: research + plan (bosskuai-search-first, then planner agent)
Prompt 2-N: implement one phase per prompt, each ending with the
verification gate (the stack's verification gate)
Final prompt: integration test + bosskuai-rigorous-code-review across phases
Between sessions: bosskuai-handoff writes the pickup doc;
bosskuai-context-limit-continuation + <memory-dir>/handoff.md
preserve state for the next tool/session
Output Format
Present your analysis in this exact structure.
Section 1: Prompt Diagnosis
Strengths: what the original prompt does well.
Issues:
Issue
Impact
Suggested Fix
(problem)
(consequence)
(how to fix)
Needs Clarification: numbered questions. If Phase 0 auto-detected the
answer, state it instead of asking.
Section 2: Recommended BosskuAI Components
Type
Component
Purpose
Skill
bosskuai-tdd-loop
red→green→refactor discipline
Agent
auditor
post-implementation review
Model
reasoning model (plan) + coding model (execute)
scope-appropriate split
Section 3: Optimized Prompt — Full Version
The complete optimized prompt inside a single fenced code block,
self-contained and ready to copy-paste. Include:
Clear task description with context
Tech stack (detected or specified)
Which skills/agents to load at each workflow stage
Acceptance criteria
Verification steps
Scope boundaries (what NOT to do)
Grounding: sources to quote from, and permission to say "not enough information"
Section 4: Optimized Prompt — Quick Version
A compact version for experienced users:
Intent
Quick Pattern
New Feature
Plan first (planner agent), implement via bosskuai-tdd-loop, review, run the verification gate.
Bug Fix
bosskuai-diagnose-loop: failing repro first, fix to green, regression test.
Refactor
bosskuai-code-revamp on [scope]; review; verify.
Research
bosskuai-search-first on [topic]; plan from findings.
Review
bosskuai-rigorous-code-review, then bosskuai-cybersecurity-risk if risky.
Decision
Convene bosskuai-council on: [question].
EPIC
bosskuai-planning-execution multi-session plan for "[objective]"; bosskuai-handoff between sessions.
Section 5: Enhancement Rationale
Enhancement
Reason
(what was added)
(why it matters)
Footer
Not what you need? Tell me what to adjust, or make a normal task request
if you want execution instead of prompt optimization.
Example
User input:
Add a REST API endpoint for user profile updates with validation
Phase 0 detects:composer.json, Laravel 12 backend
Optimized Prompt (Full):
Add a REST API endpoint for user profile updates (PATCH /api/users/{id}).
Tech stack: Laravel 12 (detected from project)
Requirements:
- PATCH /api/users/{id} — partial update of user profile
- Form Request validation for: name, email, avatar_url, bio
- Auth: Sanctum token required; users can only update their own profile (policy)
- 200 with updated user on success; 422 with validation errors; 401/403 for auth failures
- Follow existing controller/resource patterns in app/Http/
- Ground in: existing controllers under app/Http/ and the users migration; say so if a rule cannot be confirmed from them.
Workflow:
1. Plan the endpoint structure, policy, and validation rules (planner agent, reasoning model)
2. bosskuai-laravel-tdd — write feature tests first: success, validation failure,
auth failure, updating another user's profile (must 403)
3. Implement following existing patterns
4. bosskuai-rigorous-code-review; load bosskuai-laravel-security for the policy/mass-assignment check
5. bosskuai-laravel-verification — pint, phpstan, full test suite, composer audit
Do not:
- Modify existing endpoints or the users migration
- Add new dependencies without bosskuai-search-first
Related Components
Component
When to Reference
cofounder
User hasn't routed the task yet
bosskuai-skill-stocktake
Audit which components exist (use instead of a hardcoded catalog)
1---2name: bosskuai-prompt-optimizer3description: "Use when the user asks to optimize, improve, or draft a prompt for BosskuAI; identify intent and gaps, select relevant skills, agents, and loops, and return a ready-to-paste prompt without executing it. Do not use for code or performance optimization."4license: MIT5metadata:6 author: affaan-m/ECC (community contribution by YannJY02)7 source: https://skillmd.com/skills/wankimmy/bosskuai-prompt-optimizer8 upstream: prompt-optimizer9---1011# Prompt Optimizer1213## Configured memory location1415Run `bossku memory-path --project <project-root>` to resolve `<memory-dir>` before reading or writing memory. Automatically save verified durable notes with `bossku remember --kind decision|plan|learning|project` without waiting for the user to ask. When memory_storage is obsidian, all memory including handoffs lives directly in the vault; never create .bossku/memory in a code repo.1617Analyze a draft prompt, critique it, match it to BosskuAI workspace components18(skills, agent contracts, loops, memory), and output a complete optimized19prompt the user can paste and run.2021## When to Use2223- User says "optimize this prompt", "improve my prompt", "rewrite this prompt"24- User says "help me write a better prompt for..."25- User says "what's the best way to ask BosskuAI to..."26- User pastes a draft prompt and asks for feedback or enhancement27- User says "I don't know how to prompt for this"28- User says "how should I use BosskuAI for..."2930### Do Not Use When3132- User wants the task done directly (just execute it)33- User says "optimize this code" or "optimize performance" — these are34 refactoring/profiling tasks (`bosskuai-code-revamp`, `bosskuai-performance-profiling`)35- User is asking about workspace setup (use `bosskuai-claude-code-setup`)36- User wants a skill inventory (use `bosskuai-skill-stocktake`)37- User says "just do it"3839## How It Works4041**Advisory only — do not execute the user's task.**4243Do NOT write code, create files, run commands, or take any implementation44action. Your ONLY output is an analysis plus an optimized prompt.4546If the user says "just do it" or "don't optimize, just execute", do not switch47into implementation mode inside this skill. Tell the user this skill only48produces optimized prompts, and instruct them to make a normal task request49if they want execution instead.5051Run this 6-phase pipeline sequentially. Present results using the Output52Format below. Respond in the same language as the user's input.5354### Phase 0: Project Detection5556Before analyzing the prompt, detect the current project context:57581. Check `CLAUDE.md` / `AGENTS.md` in the working directory — read for project conventions592. Detect tech stack from project files:60 - `composer.json` + `artisan` → Laravel / PHP61 - `nuxt.config.*` → Nuxt / Vue62 - `package.json` → Node.js / TypeScript / React / Next.js63 - `docker-compose.yml` → containerized stack (note services: db, redis, queue workers)64 - `pyproject.toml` / `requirements.txt` → Python65 - `go.mod` → Go; `Cargo.toml` → Rust; `build.gradle` / `pom.xml` → Java/Kotlin663. Note detected tech stack for Phase 3 and Phase 46768If no project files are found (abstract prompt or new project), skip detection69and flag "tech stack unknown" in Phase 4.7071### Phase 1: Intent Detection7273Classify the user's task into one or more categories:7475| Category | Signal Words | Example |76|----------|-------------|---------|77| New Feature | build, create, add, implement | "Build a login page" |78| Bug Fix | fix, broken, not working, error | "Fix the auth flow" |79| Refactor | refactor, clean up, restructure | "Refactor the API layer" |80| Research | how to, what is, explore, investigate | "How to add SSO" |81| Testing | test, coverage, verify | "Add tests for the cart" |82| Review | review, audit, check | "Review my PR" |83| Documentation | document, update docs | "Update the API docs" |84| Infrastructure | deploy, CI, docker, database | "Set up CI/CD pipeline" |85| Design | design, architecture, plan | "Design the data model" |86| Decision | should we, which option, go/no-go | "Monorepo or polyrepo?" |87| Business | pricing, GTM, leads, investors | "Plan the launch" |8889### Phase 2: Scope Assessment9091If Phase 0 detected a project, use codebase size as a signal. Otherwise,92estimate from the prompt description alone and mark the estimate as uncertain.9394| Scope | Heuristic | Orchestration |95|-------|-----------|---------------|96| TRIVIAL | Single file, < 50 lines | Direct execution (indicator still shown) |97| LOW | Single component or module | Single skill + executor |98| MEDIUM | Multiple components, same domain | Plan → execute → audit, verification gate |99| HIGH | Cross-domain, 5+ files | Planner agent first (reasoning model), then phased execution |100| EPIC | Multi-session, multi-PR, architectural shift | `bosskuai-planning-execution` multi-session plan + `bosskuai-handoff` between sessions |101102### Phase 3: BosskuAI Component Matching103104Map intent + scope + tech stack (from Phase 0) to specific workspace components.105When unsure what exists, check `skills/skill-index.json` (the live roster) instead of106guessing — `bosskuai-skill-stocktake` audits it.107108#### By Intent Type109110| Intent | Skills | Agent contracts |111|--------|--------|-----------------|112| New Feature | bosskuai-engineering-delivery, bosskuai-tdd-loop | planner, executor, auditor |113| Bug Fix | bosskuai-diagnose-loop | executor, auditor |114| Refactor | bosskuai-code-revamp, bosskuai-architecture-deepening | executor, auditor |115| Research | bosskuai-search-first, bosskuai-documentation-lookup, bosskuai-deep-research, bosskuai-grounding | — |116| Testing | bosskuai-tdd-loop, bosskuai-integration-testing, bosskuai-qa-automation-strategy | executor |117| Review | bosskuai-rigorous-code-review, bosskuai-greptile-review-loop, bosskuai-pr-check, bosskuai-grounding | auditor, final-reviewer |118| Documentation | bosskuai-claude-md-management (instruction files) | executor |119| Infrastructure | bosskuai-docker, bosskuai-devops-iac, bosskuai-vps-docker-deployment | — |120| Design (MEDIUM-HIGH) | bosskuai-software-architecture | planner |121| Design (EPIC) | bosskuai-planning-execution, bosskuai-grill-with-docs | planner, orchestrator |122| Decision | bosskuai-council | orchestrator |123| Business | cofounder + the matching growth/startup specialist | — |124125#### By Tech Stack126127| Tech Stack | Skills to Add |128|------------|--------------|129| Laravel / PHP | bosskuai-laravel-development, bosskuai-laravel-tdd, bosskuai-laravel-security, bosskuai-laravel-verification |130| Nuxt / Vue | bosskuai-nuxt-development |131| 3D / animation web | bosskuai-3d-web-development, bosskuai-gsap-animation, bosskuai-lenis-smooth-scroll |132| MongoDB | bosskuai-mongodb |133| Redis / queues | bosskuai-redis-caching-queues |134| SQL / schema design | bosskuai-database-engineering, bosskuai-data-architecture |135| Docker / VPS deploy | bosskuai-docker, bosskuai-vps-docker-deployment |136| Agent/LLM systems | bosskuai-agent-architecture-audit, bosskuai-eval-driven-agent-improvement |137| Other / unlisted | bosskuai-polyglot-engineering, bosskuai-coding-best-practices |138139### Phase 4: Missing Context Detection140141Scan the prompt for missing critical information. Check each item and mark142whether Phase 0 auto-detected it or the user must supply it:143144- [ ] **Tech stack** — detected in Phase 0, or must user specify?145- [ ] **Target scope** — files, directories, or modules mentioned?146- [ ] **Acceptance criteria** — how to know the task is done?147- [ ] **Error handling** — edge cases and failure modes addressed?148- [ ] **Security requirements** — auth, input validation, secrets, tenant isolation?149- [ ] **Testing expectations** — unit, integration, E2E?150- [ ] **Performance constraints** — load, latency, resource limits?151- [ ] **UI/UX requirements** — design specs, responsive, a11y? (if frontend)152- [ ] **Database changes** — schema, migrations, indexes? (if data layer)153- [ ] **Existing patterns** — reference files or conventions to follow?154- [ ] **Scope boundaries** — what NOT to do?155- [ ] **Source of truth** — which files, docs, or data must the answer be grounded in, and may the model use general knowledge?156157**If 3+ critical items are missing**, ask the user up to 3 clarification158questions before generating the optimized prompt. Then incorporate the answers.159160### Phase 5: Workflow & Model Recommendation161162Determine where this prompt sits in the lifecycle:163164```165Research → Plan → Implement (TDD) → Review → Verify → Commit166```167168This maps onto the BosskuAI pipeline: orchestrator/planner → executor →169auditor (+ `bosskuai-cybersecurity-risk` when risky) → final-reviewer.170171**Model recommendation** (follow the workspace model split — reasoning model172to plan, coding model to execute; see `bosskuai-ai-model-selection`):173174| Scope | Recommended split | Rationale |175|-------|------------------|-----------|176| TRIVIAL-LOW | Coding model only | Fast, cost-efficient; indicator still required |177| MEDIUM | Coding model + reasoning model for the plan step | Standard plan-first discipline |178| HIGH | Reasoning model (plan + audit) + coding model (execute) | Architecture and risk need the stronger model |179| EPIC | Reasoning model for the multi-session plan; coding model per phase | Deep decomposition once, cheap execution per slice |180181Escalate execution to the high-risk route when the task touches auth,182payments, privacy, tenant isolation, migrations, production, or secrets.183184**Multi-prompt splitting** (for HIGH/EPIC scope):185186- Prompt 1: research + plan (`bosskuai-search-first`, then planner agent)187- Prompt 2-N: implement one phase per prompt, each ending with the188 verification gate (the stack's verification gate)189- Final prompt: integration test + `bosskuai-rigorous-code-review` across phases190- Between sessions: `bosskuai-handoff` writes the pickup doc;191 `bosskuai-context-limit-continuation` + `<memory-dir>/handoff.md`192 preserve state for the next tool/session193194## Output Format195196Present your analysis in this exact structure.197198### Section 1: Prompt Diagnosis199200**Strengths:** what the original prompt does well.201202**Issues:**203204| Issue | Impact | Suggested Fix |205|-------|--------|---------------|206| (problem) | (consequence) | (how to fix) |207208**Needs Clarification:** numbered questions. If Phase 0 auto-detected the209answer, state it instead of asking.210211### Section 2: Recommended BosskuAI Components212213| Type | Component | Purpose |214|------|-----------|---------|215| Skill | bosskuai-tdd-loop | red→green→refactor discipline |216| Agent | auditor | post-implementation review |217| Model | reasoning model (plan) + coding model (execute) | scope-appropriate split |218219### Section 3: Optimized Prompt — Full Version220221The complete optimized prompt inside a single fenced code block,222self-contained and ready to copy-paste. Include:223224- Clear task description with context225- Tech stack (detected or specified)226- Which skills/agents to load at each workflow stage227- Acceptance criteria228- Verification steps229- Scope boundaries (what NOT to do)230- Grounding: sources to quote from, and permission to say "not enough information"231232### Section 4: Optimized Prompt — Quick Version233234A compact version for experienced users:235236| Intent | Quick Pattern |237|--------|--------------|238| New Feature | `Plan first (planner agent), implement via bosskuai-tdd-loop, review, run the verification gate.` |239| Bug Fix | `bosskuai-diagnose-loop: failing repro first, fix to green, regression test.` |240| Refactor | `bosskuai-code-revamp on [scope]; review; verify.` |241| Research | `bosskuai-search-first on [topic]; plan from findings.` |242| Review | `bosskuai-rigorous-code-review, then bosskuai-cybersecurity-risk if risky.` |243| Decision | `Convene bosskuai-council on: [question].` |244| EPIC | `bosskuai-planning-execution multi-session plan for "[objective]"; bosskuai-handoff between sessions.` |245246### Section 5: Enhancement Rationale247248| Enhancement | Reason |249|-------------|--------|250| (what was added) | (why it matters) |251252### Footer253254> Not what you need? Tell me what to adjust, or make a normal task request255> if you want execution instead of prompt optimization.256257## Example258259**User input:**260261```262Add a REST API endpoint for user profile updates with validation263```264265**Phase 0 detects:** `composer.json`, Laravel 12 backend266267**Optimized Prompt (Full):**268269```270Add a REST API endpoint for user profile updates (PATCH /api/users/{id}).271272Tech stack: Laravel 12 (detected from project)273274Requirements:275- PATCH /api/users/{id} — partial update of user profile276- Form Request validation for: name, email, avatar_url, bio277- Auth: Sanctum token required; users can only update their own profile (policy)278- 200 with updated user on success; 422 with validation errors; 401/403 for auth failures279- Follow existing controller/resource patterns in app/Http/280- Ground in: existing controllers under app/Http/ and the users migration; say so if a rule cannot be confirmed from them.281282Workflow:2831. Plan the endpoint structure, policy, and validation rules (planner agent, reasoning model)2842. bosskuai-laravel-tdd — write feature tests first: success, validation failure,285 auth failure, updating another user's profile (must 403)2863. Implement following existing patterns2874. bosskuai-rigorous-code-review; load bosskuai-laravel-security for the policy/mass-assignment check2885. bosskuai-laravel-verification — pint, phpstan, full test suite, composer audit289290Do not:291- Modify existing endpoints or the users migration292- Add new dependencies without bosskuai-search-first293```294295## Related Components296297| Component | When to Reference |298|-----------|------------------|299| `cofounder` | User hasn't routed the task yet |300| `bosskuai-skill-stocktake` | Audit which components exist (use instead of a hardcoded catalog) |301| `bosskuai-search-first` | Research phase in optimized prompts |302| `bosskuai-planning-execution` | EPIC-scope multi-session plans |303| `bosskuai-context-limit-continuation` | Long session context management |304| `bosskuai-ai-model-selection` / `bosskuai-cost-optimization` | Model and token-cost recommendations |
Run npx get-skill add wankimmy/bosskuai-prompt-optimizer in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Use when the user asks to optimize, improve, or draft a prompt for BosskuAI; identify intent and gaps, select relevant skills, agents, and loops, and return a ready-to-paste prompt without executing it. Do not use for code or performance optimization. It is listed under AI & ML on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Independent scanners report: Skill Scanner: PASS. Capability flags: reads secrets. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free. This skill is licensed under MIT.
wankimmy (@wankimmy) published this skill. Their other Agent Skills are listed on their SkillMD profile.