prompt-optimizer
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePrompt Optimizer
提示词优化器
Analyze a draft prompt, critique it, match it to ECC ecosystem components,
and output a complete optimized prompt the user can paste and run.
分析草稿提示词,给出评估意见,匹配ECC生态系统组件,
并输出完整的优化后提示词,用户可直接粘贴使用。
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 ECC for..."
- User explicitly invokes
/prompt-optimize
- 用户说出“optimize this prompt”“improve my prompt”“rewrite this prompt”
- 用户说出“help me write a better prompt for...”
- 用户说出“what's the best way to ask Claude Code to...”
- 用户说出“优化prompt”“改进prompt”“怎么写prompt”“帮我优化这个指令”
- 用户粘贴草稿提示词并请求反馈或优化
- 用户说出“I don't know how to prompt for this”
- 用户说出“how should I use ECC for...”
- 用户显式调用
/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 instead)
configure-ecc - User wants a skill inventory (use instead)
skill-stocktake - User says "just do it" or "直接做"
- 用户要求直接完成任务(仅执行即可)
- 用户说出“优化代码”“优化性能”“optimize this code”“optimize performance”——这些属于重构任务,而非提示词优化
- 用户询问ECC配置问题(请使用)
configure-ecc - 用户需要技能清单(请使用)
skill-stocktake - 用户说出“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.
仅提供咨询——不要执行用户的任务。
请勿编写代码、创建文件、运行命令或采取任何实现类操作。你唯一的输出是分析结果加上优化后的提示词。
如果用户说“just do it”“直接做”或“不要优化,直接执行”,请勿在此技能内切换到实现模式。请告知用户本技能仅生成优化后的提示词,如果需要执行任务,请发起常规任务请求。
按顺序执行以下6阶段流程。按照以下输出格式呈现结果。
Analysis Pipeline
分析流程
Phase 0: Project Detection
阶段0:项目检测
Before analyzing the prompt, detect the current project context:
- Check if a exists in the working directory — read it for project conventions
CLAUDE.md - Detect tech stack from project files:
- → Node.js / TypeScript / React / Next.js
package.json - → Go
go.mod - /
pyproject.toml→ Pythonrequirements.txt - → Rust
Cargo.toml - /
build.gradle→ Java / Kotlin / Spring Bootpom.xml - → Swift
Package.swift - → Ruby
Gemfile - → PHP
composer.json - /
*.csproj→ .NET*.sln - /
Makefile→ C / C++CMakeLists.txt - /
cpanfile→ PerlMakefile.PL
- 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.
在分析提示词之前,先检测当前项目上下文:
- 检查工作目录中是否存在——读取该文件以了解项目约定
CLAUDE.md - 从项目文件中检测技术栈:
- → Node.js / TypeScript / React / Next.js
package.json - → Go
go.mod - /
pyproject.toml→ Pythonrequirements.txt - → Rust
Cargo.toml - /
build.gradle→ Java / Kotlin / Spring Bootpom.xml - → Swift
Package.swift - → Ruby
Gemfile - → PHP
composer.json - /
*.csproj→ .NET*.sln - /
Makefile→ C / C++CMakeLists.txt - /
cpanfile→ PerlMakefile.PL
- 记录检测到的技术栈,供阶段3和阶段4使用
如果未找到项目文件(例如提示词是抽象的或针对新项目),
则跳过检测,并在阶段4标记“技术栈未知”。
Phase 1: Intent Detection
阶段1:意图检测
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" |
将用户的任务分类为一个或多个类别:
| 类别 | 关键词 | 示例 |
|---|---|---|
| 新功能开发 | build, create, add, implement, 创建, 实现, 添加 | "Build a login page" |
| Bug修复 | fix, broken, not working, error, 修复, 报错 | "Fix the auth flow" |
| 重构 | refactor, clean up, restructure, 重构, 整理 | "Refactor the API layer" |
| 调研 | how to, what is, explore, investigate, 怎么, 如何 | "How to add SSO" |
| 测试 | test, coverage, verify, 测试, 覆盖率 | "Add tests for the cart" |
| 审查 | review, audit, check, 审查, 检查 | "Review my PR" |
| 文档编写 | document, update docs, 文档 | "Update the API docs" |
| 基础设施 | deploy, CI, docker, database, 部署, 数据库 | "Set up CI/CD pipeline" |
| 设计 | design, architecture, plan, 设计, 架构 | "Design the data model" |
Phase 2: Scope Assessment
阶段2:范围评估
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 |
如果阶段0检测到项目,以代码库规模作为参考信号。否则,仅根据提示词描述估算范围,并标记该估算为不确定。
| 范围 | 评估依据 | 编排方式 |
|---|---|---|
| 极小(TRIVIAL) | 单个文件,少于50行 | 直接执行 |
| 低(LOW) | 单个组件或模块 | 单个命令或技能 |
| 中(MEDIUM) | 多个组件,同一领域 | 命令链 + /verify |
| 高(HIGH) | 跨领域,5个以上文件 | 先执行/plan,再分阶段执行 |
| 大型(EPIC) | 多会话、多PR、架构变更 | 使用blueprint技能制定多会话计划 |
Phase 3: ECC Component Matching
阶段3:ECC组件匹配
Map intent + scope + tech stack (from Phase 0) to specific ECC components.
将意图+范围+技术栈(来自阶段0)映射到具体的ECC组件。
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 |
| 意图 | 命令 | 技能 | Agent |
|---|---|---|---|
| 新功能开发 | /plan, /tdd, /code-review, /verify | tdd-workflow, verification-loop | planner, tdd-guide, code-reviewer |
| Bug修复 | /tdd, /build-fix, /verify | tdd-workflow | tdd-guide, build-error-resolver |
| 重构 | /refactor-clean, /code-review, /verify | verification-loop | refactor-cleaner, code-reviewer |
| 调研 | /plan | search-first, iterative-retrieval | — |
| 测试 | /tdd, /e2e, /test-coverage | tdd-workflow, e2e-testing | tdd-guide, e2e-runner |
| 审查 | /code-review | security-review | code-reviewer, security-reviewer |
| 文档编写 | /update-docs, /update-codemaps | — | doc-updater |
| 基础设施 | /plan, /verify | docker-patterns, deployment-patterns, database-migrations | architect |
| 设计(中-高范围) | /plan | — | planner, architect |
| 设计(大型范围) | — | blueprint(作为技能调用) | 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 | code-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 |
| 技术栈 | 需添加的技能 | 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 | code-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 |
| 其他/未列出 | coding-standards(通用) | code-reviewer |
Phase 4: Missing Context Detection
阶段4:缺失上下文检测
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.
扫描提示词,查找缺失的关键信息。检查每一项,并标记是阶段0自动检测到的,还是需要用户提供的:
- 技术栈 — 阶段0已检测到,还是需要用户指定?
- 目标范围 — 是否提到了文件、目录或模块?
- 验收标准 — 如何判断任务已完成?
- 错误处理 — 是否涵盖了边缘情况和故障模式?
- 安全要求 — 认证、输入验证、密钥管理?
- 测试预期 — 单元测试、集成测试、端到端测试?
- 性能约束 — 负载、延迟、资源限制?
- UI/UX要求 — 设计规范、响应式、无障碍?(如果是前端任务)
- 数据库变更 — schema、迁移、索引?(如果是数据层任务)
- 现有模式 — 是否有需要遵循的参考文件或约定?
- 范围边界 — 哪些是不能做的?
如果缺失3项以上关键信息,在生成优化提示词之前,最多向用户提出3个澄清问题。然后将用户的回答整合到优化后的提示词中。
Phase 5: Workflow & Model Recommendation
阶段5:工作流与模型推荐
Determine where this prompt sits in the development lifecycle:
Research → Plan → Implement (TDD) → Review → Verify → CommitFor 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
确定该提示词在开发生命周期中的位置:
调研 → 规划 → 实现(TDD)→ 审查 → 验证 → 提交对于中及以上范围的任务,始终从/plan开始。对于大型任务,使用blueprint技能。
模型推荐(包含在输出中):
| 范围 | 推荐模型 | 理由 |
|---|---|---|
| 极小-低 | Sonnet 4.6 | 速度快,简单任务成本低 |
| 中 | Sonnet 4.6 | 标准工作场景下最佳的编码模型 |
| 高 | Sonnet 4.6(主模型) + Opus 4.6(规划阶段) | Opus用于架构设计,Sonnet用于实现 |
| 大型 | Opus 4.6(蓝图规划) + Sonnet 4.6(执行阶段) | 深度推理能力适合多会话规划 |
多提示词拆分(针对高/大型范围):
对于超出单一会话的任务,拆分为顺序提示词:
- 提示词1:调研 + 规划(使用search-first技能,然后执行/plan)
- 提示词2至N:分阶段实现(每个阶段以/verify结束)
- 最终提示词:集成测试 + 跨阶段/code-review
- 使用/save-session和/resume-session在会话之间保存上下文
Output Format
输出格式
Present your analysis in this exact structure. Respond in the same language
as the user's input.
按照以下精确结构呈现分析结果。使用与用户输入相同的语言回复。
Section 1: Prompt Diagnosis
第1部分:提示词诊断
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.
优点: 列出原始提示词做得好的地方。
问题:
| 问题 | 影响 | 建议修复方案 |
|---|---|---|
| (问题描述) | (后果) | (修复方式) |
需要澄清的问题: 编号列表,列出用户需要回答的问题。如果阶段0自动检测到答案,请直接说明,不要提问。
Section 2: Recommended ECC Components
第2部分:推荐的ECC组件
| 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 |
| 类型 | 组件 | 用途 |
|---|---|---|
| 命令 | /plan | 编码前规划架构 |
| 技能 | tdd-workflow | TDD方法论指导 |
| Agent | code-reviewer | 实现后审查 |
| 模型 | Sonnet 4.6 | 此范围任务的推荐模型 |
Section 3: Optimized Prompt — Full Version
第3部分:优化后提示词——完整版
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 , since blueprint is a skill, not a command).
/blueprint将完整的优化后提示词放在单个代码块中。提示词必须是自包含的,可直接复制粘贴。包含:
- 清晰的任务描述和上下文
- 技术栈(检测到的或用户指定的)
- 在合适的工作流阶段调用/command
- 验收标准
- 验证步骤
- 范围边界(不能做的事)
如果涉及blueprint,请写:"Use the blueprint skill to..."(不要写/blueprint,因为blueprint是技能,不是命令)。
Section 4: Optimized Prompt — Quick Version
第4部分:优化后提示词——精简版
A compact version for experienced ECC users. Vary by intent type:
| Intent | Quick Pattern |
|---|---|
| New Feature | |
| Bug Fix | |
| Refactor | |
| Research | |
| Testing | |
| Review | |
| Docs | |
| EPIC | |
为有经验的ECC用户提供的紧凑版本。根据意图类型有所不同:
| 意图 | 精简模板 |
|---|---|
| 新功能开发 | |
| Bug修复 | |
| 重构 | |
| 调研 | |
| 测试 | |
| 审查 | |
| 文档 | |
| 大型任务 | |
Section 5: Enhancement Rationale
第5部分:优化理由
| 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 Claude Code uses the right commands"
- "帮我优化这个指令"
- "How should I prompt ECC for this task?"
- "Optimize this prompt for ECC"
- "Rewrite this prompt so Claude Code uses the right commands"
- "帮我优化这个指令"
- "How should I prompt ECC for this task?"
Example 1: Vague Chinese Prompt (Project Detected)
示例1:模糊的中文提示词(已检测到项目)
User input:
帮我写一个用户登录页面Phase 0 detects: with Next.js 15, TypeScript, Tailwind CSS
package.jsonOptimized Prompt (Full):
使用项目现有技术栈(Next.js 15 + TypeScript + Tailwind CSS)实现用户登录页面。
技术要求:
- 沿用项目现有的组件结构和路由约定
- 表单验证使用项目中已有的验证方案(检查是否已用 Zod/Yup/其他)
- 认证方式:沿用项目现有认证方案(如无,默认 JWT)
- 包含:邮箱/密码登录表单、表单验证、错误提示、加载状态、响应式布局
工作流:
1. /plan 先规划组件结构和认证流程,参考现有页面的模式
2. /tdd 测试先行:编写登录表单的单元测试和认证流程的集成测试
3. 实现登录页面和认证逻辑
4. /code-review 审查实现
5. /verify 验证所有测试通过且页面正常渲染
安全要求:
- 密码不明文传输
- 防止暴力破解(rate limiting)
- XSS 防护
- CSRF token
验收标准:
- 所有测试通过,覆盖率 80%+
- 页面在移动端和桌面端正常渲染
- 登录成功跳转到 dashboard,失败显示错误信息
不要做:
- 不要实现注册页面
- 不要实现忘记密码功能
- 不要修改现有的路由结构用户输入:
帮我写一个用户登录页面阶段0检测到: 包含Next.js 15、TypeScript、Tailwind CSS
package.json优化后提示词(完整版):
使用项目现有技术栈(Next.js 15 + TypeScript + Tailwind CSS)实现用户登录页面。
技术要求:
- 沿用项目现有的组件结构和路由约定
- 表单验证使用项目中已有的验证方案(检查是否已用 Zod/Yup/其他)
- 认证方式:沿用项目现有认证方案(如无,默认 JWT)
- 包含:邮箱/密码登录表单、表单验证、错误提示、加载状态、响应式布局
工作流:
1. /plan 先规划组件结构和认证流程,参考现有页面的模式
2. /tdd 测试先行:编写登录表单的单元测试和认证流程的集成测试
3. 实现登录页面和认证逻辑
4. /code-review 审查实现
5. /verify 验证所有测试通过且页面正常渲染
安全要求:
- 密码不明文传输
- 防止暴力破解(rate limiting)
- XSS 防护
- CSRF token
验收标准:
- 所有测试通过,覆盖率 80%+
- 页面在移动端和桌面端正常渲染
- 登录成功跳转到 dashboard,失败显示错误信息
不要做:
- 不要实现注册页面
- 不要实现忘记密码功能
- 不要修改现有的路由结构Example 2: Moderate English Prompt
示例2:中等复杂度的英文提示词
User input:
Add a REST API endpoint for user profile updates with validationPhase 0 detects: with Go 1.22, Chi router
go.modOptimized 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)用户输入:
Add a REST API endpoint for user profile updates with validation阶段0检测到: 包含Go 1.22、Chi router
go.mod优化后提示词(完整版):
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
示例3:大型项目
User input:
Migrate our monolith to microservicesOptimized 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.用户输入:
Migrate our monolith to microservices优化后提示词(完整版):
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 |
|---|---|
| User hasn't set up ECC yet |
| Audit which components are installed (use instead of hardcoded catalog) |
| Research phase in optimized prompts |
| EPIC-scope optimized prompts (invoke as skill, not command) |
| Long session context management |
| Token optimization recommendations |
| 组件 | 参考场景 |
|---|---|
| 用户尚未设置ECC时 |
| 审计已安装的组件(替代硬编码目录) |
| 优化提示词中的调研阶段 |
| 大型范围的优化提示词(作为技能调用,而非命令) |
| 长会话上下文管理 |
| Token优化建议 |