Prompt optimizer
268 AI coding assistant skills, organized across 12 workflow layers. Sources include Anthropic official, FRM, SKC, LRN, SKA, and other mainstream AI coding frameworks.
npx -y skills add asong56/skills --skill prompt-optimizerAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- 17 days oldThe repository was created 17 days ago. New is not bad, but a brand new repository carrying a familiar-sounding name is the shape a typosquat arrives in, and there has been no time for anyone else to find a problem with it.
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Analyze and rewrite a draft prompt to maximize effectiveness within the SKC skill ecosystem. Triggers: 'optimize this prompt', 'improve my prompt', 'help me write a better prompt for...', 'how should I use SKC for...', or when the user pastes a draft prompt and asks for feedback. Advisory only — outputs an optimized prompt, never executes the underlying task.
SKILL.md
14.4 KB, as published. Nobody here has run it
Prompt Optimizer
Analyze a draft prompt, critique it, match it to SKC ecosystem components, 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 Claude Code to..."
- User says "prompt", "prompt", "prompt", ""
- 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 SKC for..."
- User explicitly invokes
/prompt-optimize
Do Not Use When
- User wants the task done directly (just execute it)
- User says "", "", "optimize this code", "optimize performance" — these are refactoring tasks, not prompt optimization
- User is asking about SKC configuration (use
configure-eccinstead) - User wants a skill inventory (use
skill-stocktakeinstead) - User says "just do it" or ""
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.
Analysis Pipeline
Phase 0: Project Detection
Before analyzing the prompt, detect the current project context:
- Check if a
CLAUDE.mdexists in the working directory — read it for project conventions - Detect tech stack from project files:
package.json→ Node.js / TypeScript / React / Next.jsgo.mod→ Gopyproject.toml/requirements.txt→ PythonCargo.toml→ Rustbuild.gradle/pom.xml→ Java / Kotlin (then check forquarkusin build file → Quarkus, orspring-boot→ Spring Boot)Package.swift→ SwiftGemfile→ Rubycomposer.json→ PHP*.csproj/*.sln→ .NETMakefile/CMakeLists.txt→ C / C++cpanfile/Makefile.PL→ Perl
- Note detected tech stack for use in Phase 3 and Phase 4
If no project files are found (e.g., the prompt is abstract or for a 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" |
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 |
| LOW | Single component or module | Single command or skill |
| MEDIUM | Multiple components, same domain | Command chain + /verify |
| HIGH | Cross-domain, 5+ files | /plan first, then phased execution |
| EPIC | Multi-session, multi-PR, architectural shift | Use blueprint skill for multi-session plan |
Phase 3: SKC Component Matching
Map intent + scope + tech stack (from Phase 0) to specific SKC components.
By Intent Type
| Intent | Commands | Skills | Agents |
|---|---|---|---|
| New Feature | /plan, /tdd, /code-review, /verify | tdd-workflow, verification-loop | planner, tdd-guide, code-reviewer |
| Bug Fix | /tdd, /build-fix, /verify | tdd-workflow | tdd-guide, build-error-resolver |
| Refactor | /refactor-clean, /code-review, /verify | verification-loop | refactor-cleaner, code-reviewer |
| Research | /plan | search-first, iterative-retrieval | — |
| Testing | /tdd, /e2e, /test-coverage | tdd-workflow, e2e-testing | tdd-guide, e2e-runner |
| Review | /code-review | security-review | code-reviewer, security-reviewer |
| Documentation | /update-docs, /update-codemaps | — | doc-updater |
| Infrastructure | /plan, /verify | docker-patterns, deployment-patterns, database-migrations | architect |
| Design (MEDIUM-HIGH) | /plan | — | planner, architect |
| Design (EPIC) | — | blueprint (invoke as skill) | planner, architect |
By Tech Stack
| Tech Stack | Skills to Add | Agent |
|---|---|---|
| Python / Django | django-patterns, django-tdd, django-security, django-verification, python-patterns, python-testing | python-reviewer |
| Go | golang-patterns, golang-testing | go-reviewer, go-build-resolver |
| Spring Boot / Java | springboot-patterns, springboot-tdd, springboot-security, springboot-verification, java-coding-standards, jpa-patterns | java-reviewer |
| Quarkus / Java | quarkus-patterns, quarkus-tdd, quarkus-security, quarkus-verification, java-coding-standards, jpa-patterns | java-reviewer |
| Kotlin / Android | kotlin-coroutines-flows, compose-multiplatform-patterns, android-clean-architecture | kotlin-reviewer |
| TypeScript / React | frontend-patterns, backend-patterns, coding-standards | code-reviewer |
| Swift / iOS | swiftui-patterns, swift-concurrency-6-2, swift-actor-persistence, swift-protocol-di-testing | code-reviewer |
| PostgreSQL | postgres-patterns, database-migrations | database-reviewer |
| Perl | perl-patterns, perl-testing, perl-security | code-reviewer |
| C++ | cpp-coding-standards, cpp-testing | code-reviewer |
| Other / Unlisted | coding-standards (universal) | code-reviewer |
Phase 4: Missing Context Detection
Scan the prompt for missing critical information. Check each item and mark whether Phase 0 auto-detected it or the user must supply it:
- Tech stack — Detected in Phase 0, or must user specify?
- Target scope — Files, directories, or modules mentioned?
- Acceptance criteria — How to know the task is done?
- Error handling — Edge cases and failure modes addressed?
- Security requirements — Auth, input validation, secrets?
- Testing expectations — Unit, integration, E2E?
- Performance constraints — Load, latency, resource limits?
- UI/UX requirements — Design specs, responsive, a11y? (if frontend)
- Database changes — Schema, migrations, indexes? (if data layer)
- Existing patterns — Reference files or conventions to follow?
- Scope boundaries — What NOT to do?
If 3+ critical items are missing, ask the user up to 3 clarification questions before generating the optimized prompt. Then incorporate the answers into the optimized prompt.
Phase 5: Workflow & Model Recommendation
Determine where this prompt sits in the development lifecycle:
Research → Plan → Implement (TDD) → Review → Verify → Commit
For MEDIUM+ tasks, always start with /plan. For EPIC tasks, use blueprint skill.
Model recommendation (include in output):
| Scope | Recommended Model | Rationale |
|---|---|---|
| TRIVIAL-LOW | Sonnet 4.6 | Fast, cost-efficient for simple tasks |
| MEDIUM | Sonnet 4.6 | Best coding model for standard work |
| HIGH | Sonnet 4.6 (main) + Opus 4.6 (planning) | Opus for architecture, Sonnet for implementation |
| EPIC | Opus 4.6 (blueprint) + Sonnet 4.6 (execution) | Deep reasoning for multi-session planning |
Multi-prompt splitting (for HIGH/EPIC scope):
For tasks that exceed a single session, split into sequential prompts:
- Prompt 1: Research + Plan (use search-first skill, then /plan)
- Prompt 2-N: Implement one phase per prompt (each ends with /verify)
- Final Prompt: Integration test + /code-review across all phases
- Use /save-session and /resume-session to preserve context between sessions
Output Format
Present your analysis in this exact structure. Respond in the same language as the user's input.
Section 1: Prompt Diagnosis
Strengths: List what the original prompt does well.
Issues:
| Issue | Impact | Suggested Fix |
|---|---|---|
| (problem) | (consequence) | (how to fix) |
Needs Clarification: Numbered list of questions the user should answer. If Phase 0 auto-detected the answer, state it instead of asking.
Section 2: Recommended SKC Components
| Type | Component | Purpose |
|---|---|---|
| Command | /plan | Plan architecture before coding |
| Skill | tdd-workflow | TDD methodology guidance |
| Agent | code-reviewer | Post-implementation review |
| Model | Sonnet 4.6 | Recommended for this scope |
Section 3: Optimized Prompt — Full Version
Present the complete optimized prompt inside a single fenced code block. The prompt must be self-contained and ready to copy-paste. Include:
- Clear task description with context
- Tech stack (detected or specified)
- /command invocations at the right workflow stages
- Acceptance criteria
- Verification steps
- Scope boundaries (what NOT to do)
For items that reference blueprint, write: "Use the blueprint skill to..."
(not /blueprint, since blueprint is a skill, not a command).
Section 4: Optimized Prompt — Quick Version
A compact version for experienced SKC users. Vary by intent type:
| Intent | Quick Pattern |
|---|---|
| New Feature | /plan [feature]. /tdd to implement. /code-review. /verify. |
| Bug Fix | /tdd — write failing test for [bug]. Fix to green. /verify. |
| Refactor | /refactor-clean [scope]. /code-review. /verify. |
| Research | Use search-first skill for [topic]. /plan based on findings. |
| Testing | /tdd [module]. /e2e for critical flows. /test-coverage. |
| Review | /code-review. Then use security-reviewer agent. |
| Docs | /update-docs. /update-codemaps. |
| EPIC | Use blueprint skill for "[objective]". Execute phases with /verify gates. |
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.
Examples
Trigger Examples
- "Optimize this prompt for SKC"
- "Rewrite this prompt so Claude Code uses the right commands"
- "How should I prompt SKC for this task?"
Example 1: Vague Chinese Prompt (Project Detected)
User input:
Phase 0 detects: package.json with Next.js 15, TypeScript, Tailwind CSS
Optimized Prompt (Full):
(Next.js 15 + TypeScript + Tailwind CSS)
4. /code-review
- (rate limiting)
- XSS
- CSRF token
Example 2: Moderate English Prompt
User input:
Add a REST API endpoint for user profile updates with validation
Phase 0 detects: go.mod with Go 1.22, Chi router
Optimized Prompt (Full):
Add a REST API endpoint for user profile updates (PATCH /api/users/:id).
Tech stack: Go 1.22 + Chi router (detected from project)
Requirements:
- PATCH /api/users/:id — partial update of user profile
- Input validation for fields: name, email, avatar_url, bio
- Auth: require valid token, users can only update own profile
- Return 200 with updated user on success
- Return 400 with validation errors on invalid input
- Return 401/403 for auth failures
- Follow existing API patterns in the codebase
Workflow:
1. /plan the endpoint structure, middleware chain, and validation logic
2. /tdd — write table-driven tests for success, validation failure, auth failure, not-found
3. Implement following existing handler patterns
4. /go-review
5. /verify — run full test suite, confirm no regressions
Do not:
- Modify existing endpoints
- Change the database schema (use existing user table)
- Add new dependencies without checking existing ones first (use search-first skill)
Example 3: EPIC Project
User input:
Migrate our monolith to microservices
Optimized Prompt (Full):
Use the blueprint skill to plan: "Migrate monolith to microservices architecture"
Before executing, answer these questions in the blueprint:
1. Which domain boundaries exist in the current monolith?
2. Which service should be extracted first (lowest coupling)?
3. Communication pattern: REST APIs, gRPC, or event-driven (Kafka/RabbitMQ)?
4. Database strategy: shared DB initially or database-per-service from start?
5. Deployment target: Kubernetes, Docker Compose, or serverless?
The blueprint should produce phases like:
- Phase 1: Identify service boundaries and create domain map
- Phase 2: Set up infrastructure (API gateway, service mesh, CI/CD per service)
- Phase 3: Extract first service (strangler fig pattern)
- Phase 4: Verify with integration tests, then extract next service
- Phase N: Decommission monolith
Each phase = 1 PR, with /verify gates between phases.
Use /save-session between phases. Use /resume-session to continue.
Use git worktrees for parallel service extraction when dependencies allow.
Recommended: Opus 4.6 for blueprint planning, Sonnet 4.6 for phase execution.
Related Components
| Component | When to Reference |
|---|---|
configure-ecc | User hasn't set up SKC yet |
skill-stocktake | Audit which components are installed (use instead of hardcoded catalog) |
search-first | Research phase in optimized prompts |
blueprint | EPIC-scope optimized prompts (invoke as skill, not command) |
strategic-compact | Long session context management |
cost-aware-llm-pipeline | Token optimization recommendations |