Analyze raw prompts, identify intent and gaps, match ECC components (skills/commands/agents/hooks), and output a ready-to-paste optimized prompt. Advisory role only — never executes the task itself. TRIGGER when: user says "optimize prompt", "improve my prompt", "how to write a prompt for", "help me prompt", "rewrite this prompt", or explicitly asks to enhance prompt quality. Also triggers on Chinese equivalents: "优化prompt", "改进prompt", "怎么写prompt", "帮我优化这个指令". DO NOT TRIGGER when: user wants the task executed directly, or says "just do it" / "直接做". DO NOT TRIGGER when user says "优化代码", "优化性能", "optimize performance", "optimize this code" — those are refactoring/performance tasks, not prompt optimization.
Analyze a draft prompt, critique it, match it to ECC 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 Codex 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 ECC 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 ECC configuration (use configure-ecc instead)
User wants a skill inventory (use skill-stocktake instead)
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 AGENTS.md exists in the working directory — read it for project conventions
build.gradle / pom.xml → Java / Kotlin / Spring Boot
Package.swift → Swift
Gemfile → Ruby
composer.json → PHP
*.csproj / *.sln → .NET
Makefile / 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: ECC Component Matching
Map intent + scope + tech stack (from Phase 0) to specific ECC components.
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 ECC 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 ECC 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 ECC"
"Rewrite this prompt so Codex uses the right commands"
"帮我优化这个指令"
"How should I prompt ECC for this task?"
Example 1: Vague Chinese Prompt (Project Detected)
User input:
帮我写一个用户登录页面
Phase 0 detects:package.json with Next.js 15, TypeScript, Tailwind CSS
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 ECC 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
1---2name: prompt-optimizer3description: Analyze raw prompts, identify intent and gaps, match ECC components (skills/commands/agents/hooks), and output a ready-to-paste optimized prompt. Advisory role only — never executes the task itself. TRIGGER when: user says "optimize prompt", "improve my prompt", "how to write a prompt for", "help me prompt", "rewrite this prompt", or explicitly asks to enhance prompt quality. Also triggers on Chinese equivalents: "优化prompt", "改进prompt", "怎么写prompt", "帮我优化这个指令". DO NOT TRIGGER when: user wants the task executed directly, or says "just do it" / "直接做". DO NOT TRIGGER when user says "优化代码", "优化性能", "optimize performance", "optimize this code" — those are refactoring/performance tasks, not prompt optimization.4---56# Prompt Optimizer
78Analyze a draft prompt, critique it, match it to ECC ecosystem components,
9and output a complete optimized prompt the user can paste and run.
1011## When to Use
1213- User says "optimize this prompt", "improve my prompt", "rewrite this prompt"
14- User says "help me write a better prompt for..."
15- User says "what's the best way to ask Codex to..."
16- User says "优化prompt", "改进prompt", "怎么写prompt", "帮我优化这个指令"
17- User pastes a draft prompt and asks for feedback or enhancement
18- User says "I don't know how to prompt for this"
19- User says "how should I use ECC for..."
20- User explicitly invokes `/prompt-optimize`
2122### Do Not Use When
2324- User wants the task done directly (just execute it)
25- User says "优化代码", "优化性能", "optimize this code", "optimize performance" — these are refactoring tasks, not prompt optimization
26- User is asking about ECC configuration (use `configure-ecc` instead)
27- User wants a skill inventory (use `skill-stocktake` instead)
28- User says "just do it" or "直接做"
2930## How It Works
3132**Advisory only — do not execute the user's task.**
3334Do NOT write code, create files, run commands, or take any implementation
35action. Your ONLY output is an analysis plus an optimized prompt.
3637If the user says "just do it", "直接做", or "don't optimize, just execute",
38do not switch into implementation mode inside this skill. Tell the user this
39skill only produces optimized prompts, and instruct them to make a normal
40task request if they want execution instead.
4142Run this 6-phase pipeline sequentially. Present results using the Output Format below.
4344### Analysis Pipeline
4546### Phase 0: Project Detection
4748Before analyzing the prompt, detect the current project context:
49501. Check if a `AGENTS.md` exists in the working directory — read it for project conventions
512. Detect tech stack from project files:
52 - `package.json` → Node.js / TypeScript / React / Next.js
53 - `go.mod` → Go
54 - `pyproject.toml` / `requirements.txt` → Python
55 - `Cargo.toml` → Rust
56 - `build.gradle` / `pom.xml` → Java / Kotlin / Spring Boot
57 - `Package.swift` → Swift
58 - `Gemfile` → Ruby
59 - `composer.json` → PHP
60 - `*.csproj` / `*.sln` → .NET
61 - `Makefile` / `CMakeLists.txt` → C / C++
62 - `cpanfile` / `Makefile.PL` → Perl
633. Note detected tech stack for use in Phase 3 and Phase 4
6465If no project files are found (e.g., the prompt is abstract or for a new project),
66skip detection and flag "tech stack unknown" in Phase 4.
6768### Phase 1: Intent Detection
6970Classify the user's task into one or more categories:
7172| Category | Signal Words | Example |
73|----------|-------------|---------|
74| New Feature | build, create, add, implement, 创建, 实现, 添加 | "Build a login page" |
75| Bug Fix | fix, broken, not working, error, 修复, 报错 | "Fix the auth flow" |
76| Refactor | refactor, clean up, restructure, 重构, 整理 | "Refactor the API layer" |
77| Research | how to, what is, explore, investigate, 怎么, 如何 | "How to add SSO" |
78| Testing | test, coverage, verify, 测试, 覆盖率 | "Add tests for the cart" |
79| Review | review, audit, check, 审查, 检查 | "Review my PR" |
80| Documentation | document, update docs, 文档 | "Update the API docs" |
81| Infrastructure | deploy, CI, docker, database, 部署, 数据库 | "Set up CI/CD pipeline" |
82| Design | design, architecture, plan, 设计, 架构 | "Design the data model" |
8384### Phase 2: Scope Assessment
8586If Phase 0 detected a project, use codebase size as a signal. Otherwise, estimate
87from the prompt description alone and mark the estimate as uncertain.
8889| Scope | Heuristic | Orchestration |
90|-------|-----------|---------------|
91| TRIVIAL | Single file, < 50 lines | Direct execution |
92| LOW | Single component or module | Single command or skill |
93| MEDIUM | Multiple components, same domain | Command chain + /verify |
94| HIGH | Cross-domain, 5+ files | /plan first, then phased execution |
95| EPIC | Multi-session, multi-PR, architectural shift | Use blueprint skill for multi-session plan |
9697### Phase 3: ECC Component Matching
9899Map intent + scope + tech stack (from Phase 0) to specific ECC components.
100101#### By Intent Type
102103| Intent | Commands | Skills | Agents |
104|--------|----------|--------|--------|
105| New Feature | /plan, /tdd, /code-review, /verify | tdd-workflow, verification-loop | planner, tdd-guide, code-reviewer |
106| Bug Fix | /tdd, /build-fix, /verify | tdd-workflow | tdd-guide, build-error-resolver |
107| Refactor | /refactor-clean, /code-review, /verify | verification-loop | refactor-cleaner, code-reviewer |
108| Research | /plan | search-first, iterative-retrieval | — |
109| Testing | /tdd, /e2e, /test-coverage | tdd-workflow, e2e-testing | tdd-guide, e2e-runner |
110| Review | /code-review | security-review | code-reviewer, security-reviewer |
111| Documentation | /update-docs, /update-codemaps | — | doc-updater |
112| Infrastructure | /plan, /verify | docker-patterns, deployment-patterns, database-migrations | architect |
113| Design (MEDIUM-HIGH) | /plan | — | planner, architect |
114| Design (EPIC) | — | blueprint (invoke as skill) | planner, architect |
115116#### By Tech Stack
117118| Tech Stack | Skills to Add | Agent |
119|------------|--------------|-------|
120| Python / Django | django-patterns, django-tdd, django-security, django-verification, python-patterns, python-testing | python-reviewer |
121| Go | golang-patterns, golang-testing | go-reviewer, go-build-resolver |
122| Spring Boot / Java | springboot-patterns, springboot-tdd, springboot-security, springboot-verification, java-coding-standards, jpa-patterns | code-reviewer |
123| Kotlin / Android | kotlin-coroutines-flows, compose-multiplatform-patterns, android-clean-architecture | kotlin-reviewer |
124| TypeScript / React | frontend-patterns, backend-patterns, coding-standards | code-reviewer |
125| Swift / iOS | swiftui-patterns, swift-concurrency-6-2, swift-actor-persistence, swift-protocol-di-testing | code-reviewer |
126| PostgreSQL | postgres-patterns, database-migrations | database-reviewer |
127| Perl | perl-patterns, perl-testing, perl-security | code-reviewer |
128| C++ | cpp-coding-standards, cpp-testing | code-reviewer |
129| Other / Unlisted | coding-standards (universal) | code-reviewer |
130131### Phase 4: Missing Context Detection
132133Scan the prompt for missing critical information. Check each item and mark
134whether Phase 0 auto-detected it or the user must supply it:
135136- [ ] **Tech stack** — Detected in Phase 0, or must user specify?
137- [ ] **Target scope** — Files, directories, or modules mentioned?
138- [ ] **Acceptance criteria** — How to know the task is done?
139- [ ] **Error handling** — Edge cases and failure modes addressed?
140- [ ] **Security requirements** — Auth, input validation, secrets?
141- [ ] **Testing expectations** — Unit, integration, E2E?
142- [ ] **Performance constraints** — Load, latency, resource limits?
143- [ ] **UI/UX requirements** — Design specs, responsive, a11y? (if frontend)
144- [ ] **Database changes** — Schema, migrations, indexes? (if data layer)
145- [ ] **Existing patterns** — Reference files or conventions to follow?
146- [ ] **Scope boundaries** — What NOT to do?
147148**If 3+ critical items are missing**, ask the user up to 3 clarification
149questions before generating the optimized prompt. Then incorporate the
150answers into the optimized prompt.
151152### Phase 5: Workflow & Model Recommendation
153154Determine where this prompt sits in the development lifecycle:
155156```
157Research → Plan → Implement (TDD) → Review → Verify → Commit
158```
159160For MEDIUM+ tasks, always start with /plan. For EPIC tasks, use blueprint skill.
161162**Model recommendation** (include in output):
163164| Scope | Recommended Model | Rationale |
165|-------|------------------|-----------|
166| TRIVIAL-LOW | Sonnet 4.6 | Fast, cost-efficient for simple tasks |
167| MEDIUM | Sonnet 4.6 | Best coding model for standard work |
168| HIGH | Sonnet 4.6 (main) + Opus 4.6 (planning) | Opus for architecture, Sonnet for implementation |
169| EPIC | Opus 4.6 (blueprint) + Sonnet 4.6 (execution) | Deep reasoning for multi-session planning |
170171**Multi-prompt splitting** (for HIGH/EPIC scope):
172173For tasks that exceed a single session, split into sequential prompts:
174- Prompt 1: Research + Plan (use search-first skill, then /plan)
175- Prompt 2-N: Implement one phase per prompt (each ends with /verify)
176- Final Prompt: Integration test + /code-review across all phases
177- Use /save-session and /resume-session to preserve context between sessions
178179---
180181## Output Format
182183Present your analysis in this exact structure. Respond in the same language
184as the user's input.
185186### Section 1: Prompt Diagnosis
187188**Strengths:** List what the original prompt does well.
189190**Issues:**
191192| Issue | Impact | Suggested Fix |
193|-------|--------|---------------|
194| (problem) | (consequence) | (how to fix) |
195196**Needs Clarification:** Numbered list of questions the user should answer.
197If Phase 0 auto-detected the answer, state it instead of asking.
198199### Section 2: Recommended ECC Components
200201| Type | Component | Purpose |
202|------|-----------|---------|
203| Command | /plan | Plan architecture before coding |
204| Skill | tdd-workflow | TDD methodology guidance |
205| Agent | code-reviewer | Post-implementation review |
206| Model | Sonnet 4.6 | Recommended for this scope |
207208### Section 3: Optimized Prompt — Full Version
209210Present the complete optimized prompt inside a single fenced code block.
211The prompt must be self-contained and ready to copy-paste. Include:
212- Clear task description with context
213- Tech stack (detected or specified)
214- /command invocations at the right workflow stages
215- Acceptance criteria
216- Verification steps
217- Scope boundaries (what NOT to do)
218219For items that reference blueprint, write: "Use the blueprint skill to..."
220(not `/blueprint`, since blueprint is a skill, not a command).
221222### Section 4: Optimized Prompt — Quick Version
223224A compact version for experienced ECC users. Vary by intent type:
225226| Intent | Quick Pattern |
227|--------|--------------|
228| New Feature | `/plan [feature]. /tdd to implement. /code-review. /verify.` |
229| Bug Fix | `/tdd — write failing test for [bug]. Fix to green. /verify.` |
230| Refactor | `/refactor-clean [scope]. /code-review. /verify.` |
231| Research | `Use search-first skill for [topic]. /plan based on findings.` |
232| Testing | `/tdd [module]. /e2e for critical flows. /test-coverage.` |
233| Review | `/code-review. Then use security-reviewer agent.` |
234| Docs | `/update-docs. /update-codemaps.` |
235| EPIC | `Use blueprint skill for "[objective]". Execute phases with /verify gates.` |
236237### Section 5: Enhancement Rationale
238239| Enhancement | Reason |
240|-------------|--------|
241| (what was added) | (why it matters) |
242243### Footer
244245> Not what you need? Tell me what to adjust, or make a normal task request
246> if you want execution instead of prompt optimization.
247248---
249250## Examples
251252### Trigger Examples
253254- "Optimize this prompt for ECC"
255- "Rewrite this prompt so Codex uses the right commands"
256- "帮我优化这个指令"
257- "How should I prompt ECC for this task?"
258259### Example 1: Vague Chinese Prompt (Project Detected)
260261**User input:**
262```
263帮我写一个用户登录页面
264```
265266**Phase 0 detects:** `package.json` with Next.js 15, TypeScript, Tailwind CSS
267268**Optimized Prompt (Full):**
269```
270使用项目现有技术栈(Next.js 15 + TypeScript + Tailwind CSS)实现用户登录页面。
271272技术要求:
273- 沿用项目现有的组件结构和路由约定
274- 表单验证使用项目中已有的验证方案(检查是否已用 Zod/Yup/其他)
275- 认证方式:沿用项目现有认证方案(如无,默认 JWT)
276- 包含:邮箱/密码登录表单、表单验证、错误提示、加载状态、响应式布局
277278工作流:
2791. /plan 先规划组件结构和认证流程,参考现有页面的模式
2802. /tdd 测试先行:编写登录表单的单元测试和认证流程的集成测试
2813. 实现登录页面和认证逻辑
2824. /code-review 审查实现
2835. /verify 验证所有测试通过且页面正常渲染
284285安全要求:
286- 密码不明文传输
287- 防止暴力破解(rate limiting)
288- XSS 防护
289- CSRF token
290291验收标准:
292- 所有测试通过,覆盖率 80%+
293- 页面在移动端和桌面端正常渲染
294- 登录成功跳转到 dashboard,失败显示错误信息
295296不要做:
297- 不要实现注册页面
298- 不要实现忘记密码功能
299- 不要修改现有的路由结构
300```
301302### Example 2: Moderate English Prompt
303304**User input:**
305```
306Add a REST API endpoint for user profile updates with validation
307```
308309**Phase 0 detects:** `go.mod` with Go 1.22, Chi router
310311**Optimized Prompt (Full):**
312```
313Add a REST API endpoint for user profile updates (PATCH /api/users/:id).
314315Tech stack: Go 1.22 + Chi router (detected from project)
316317Requirements:
318- PATCH /api/users/:id — partial update of user profile
319- Input validation for fields: name, email, avatar_url, bio
320- Auth: require valid token, users can only update own profile
321- Return 200 with updated user on success
322- Return 400 with validation errors on invalid input
323- Return 401/403 for auth failures
324- Follow existing API patterns in the codebase
325326Workflow:
3271. /plan the endpoint structure, middleware chain, and validation logic
3282. /tdd — write table-driven tests for success, validation failure, auth failure, not-found
3293. Implement following existing handler patterns
3304. /go-review
3315. /verify — run full test suite, confirm no regressions
332333Do not:
334- Modify existing endpoints
335- Change the database schema (use existing user table)
336- Add new dependencies without checking existing ones first (use search-first skill)
337```
338339### Example 3: EPIC Project
340341**User input:**
342```
343Migrate our monolith to microservices
344```
345346**Optimized Prompt (Full):**
347```
348Use the blueprint skill to plan: "Migrate monolith to microservices architecture"
349350Before executing, answer these questions in the blueprint:
3511. Which domain boundaries exist in the current monolith?
3522. Which service should be extracted first (lowest coupling)?
3533. Communication pattern: REST APIs, gRPC, or event-driven (Kafka/RabbitMQ)?
3544. Database strategy: shared DB initially or database-per-service from start?
3555. Deployment target: Kubernetes, Docker Compose, or serverless?
356357The blueprint should produce phases like:
358- Phase 1: Identify service boundaries and create domain map
359- Phase 2: Set up infrastructure (API gateway, service mesh, CI/CD per service)
360- Phase 3: Extract first service (strangler fig pattern)
361- Phase 4: Verify with integration tests, then extract next service
362- Phase N: Decommission monolith
363364Each phase = 1 PR, with /verify gates between phases.
365Use /save-session between phases. Use /resume-session to continue.
366Use git worktrees for parallel service extraction when dependencies allow.
367368Recommended: Opus 4.6 for blueprint planning, Sonnet 4.6 for phase execution.
369```
370371---
372373## Related Components
374375| Component | When to Reference |
376|-----------|------------------|
377| `configure-ecc` | User hasn't set up ECC yet |
378| `skill-stocktake` | Audit which components are installed (use instead of hardcoded catalog) |
379| `search-first` | Research phase in optimized prompts |
380| `blueprint` | EPIC-scope optimized prompts (invoke as skill, not command) |
381| `strategic-compact` | Long session context management |
382| `cost-aware-llm-pipeline` | Token optimization recommendations |
Run npx skillmds add tangchunwu/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.
Analyze raw prompts, identify intent and gaps, match ECC components (skills/commands/agents/hooks), and output a ready-to-paste optimized prompt. Advisory role only — never executes the task itself. TRIGGER when: user says "optimize prompt", "improve my prompt", "how to write a prompt for", "help me prompt", "rewrite this prompt", or explicitly asks to enhance prompt quality. Also triggers on Chinese equivalents: "优化prompt", "改进prompt", "怎么写prompt", "帮我优化这个指令". DO NOT TRIGGER when: user wants the task executed directly, or says "just do it" / "直接做". DO NOT TRIGGER when user says "优化代码", "优化性能", "optimize performance", "optimize this code" — those are refactoring/performance tasks, not prompt optimization. It is listed under AI & ML on SkillMD.
This skill has not completed SkillMD's automated safety review yet. 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, and the skill stays under its author's original license.
tangchunwu (@tangchunwu) published this skill. Their other Agent Skills are listed on their SkillMD profile.