做什么
官方 description 用英文写明「Prompt Optimizer」做什么。中文介绍不改写这段原文,能力边界以文件结构与下方原文为准。
技能库 智客分类:Agent 工作流 prompt-optimizer
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.
官方网址:skills.sh
先看中文介绍;官方 description 原文单独保留,不改写 SKILL.md。
官方 description 用英文写明「Prompt Optimizer」做什么。中文介绍不改写这段原文,能力边界以文件结构与下方原文为准。
- 用户说"优化这个提示","改进我的提示","重写这个提示"
按 Agent Skills 渐进披露:启动时只加载 name 与 description(约 100 token);任务匹配后才读入整份 SKILL.md 正文;scripts/、references/、assets/ 仅在需要时再读。 本文件正文结构:Prompt Optimizer、When to Use、Do Not Use When、How It Works、Analysis Pipeline、Phase 0: Project Detection。 其中含规范建议的小节:分步指令。
文件分析:这是一份仅含 SKILL.md 的指令型技能,代理激活后整份正文进入上下文。
Prompt OptimizerWhen to UseDo Not Use WhenHow It WorksAnalysis PipelinePhase 0: Project DetectionPhase 1: Intent DetectionPhase 2: Scope AssessmentPhase 3: ECC Component MatchingPhase 4: Missing Context DetectionPhase 5: Workflow & Model RecommendationOutput Format
来源分类:skills.sh agent-skill
nameprompt-optimizerdescription具体调用语法与可用工具以目标 Agent 客户端为准。 查看调用机制说明 ↗
先选择目标 Agent 和安装范围,保留技能包的附属文件,安装后检查客户端能否发现该技能。
复制安装指令给支持 Agent Skills 的代理,确认其中的目标目录与客户端匹配。
把 Agent Skill「prompt-optimizer」安装到我的项目:SKILL.md 原文与官方 description 见 https://zicq.com/zh/skills/skl-eedb9983ca1238f5-%E6%8F%90%E7%A4%BA%E4%BC%98%E5%8C%96%E5%99%A8.html 请存为 .cursor/skills/prompt-optimizer/SKILL.md 或 .claude/skills/prompt-optimizer/SKILL.md,frontmatter 的 name 与 description 保持原样,不要改写。
需要 Node.js 与 npx。先查看仓库技能列表,确认实际名称。
npx skills add 'https://github.com/affaan-m/ecc' --list
npx skills add 'https://github.com/affaan-m/ecc' --skill 'prompt-optimizer'
CLI 会交互选择目标 Agent,默认安装到项目;用户级安装使用 -g。先通过查看命令核对仓库内容,再用 npx skills list 检查已安装技能。
Analyze a draft prompt, critique it, match it to ECC ecosystem components, and output a complete optimized prompt the user can paste and run.
/prompt-optimizeconfigure-ecc instead)skill-stocktake instead)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.
Before analyzing the prompt, detect the current project context:
CLAUDE.md exists in the working directory — read it for project conventionspackage.json → Node.js / TypeScript / React / Next.jsgo.mod → Gopyproject.toml / requirements.txt → PythonCargo.toml → Rustbuild.gradle / pom.xml → Java / Kotlin (then check for quarkus in build file → Quarkus, or spring-boot → Spring Boot)Package.swift → SwiftGemfile → Rubycomposer.json → PHP*.csproj / *.sln → .NETMakefile / CMakeLists.txt → C / C++cpanfile / Makefile.PL → PerlIf 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.
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" |
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 |
Map intent + scope + tech stack (from Phase 0) to specific ECC components.
| 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 |
| 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 |
Scan the prompt for missing critical information. Check each item and mark whether Phase 0 auto-detected it or the user must supply it:
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.
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 5 | Fast, cost-efficient for simple tasks | | MEDIUM | Sonnet 5 | Best coding model for standard work | | HIGH | Sonnet 5 (main) + Opus 5 (planning) | Opus for architecture, Sonnet for implementation | | EPIC | Opus 5 (blueprint) + Sonnet 5 (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:
Present your analysis in this exact structure. Respond in the same language as the user's input.
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.
| Type | Component | Purpose | |------|-----------|---------| | Command | /plan | Plan architecture before coding | | Skill | tdd-workflow | TDD methodology guidance | | Agent | code-reviewer | Post-implementation review | | Model | Sonnet 5 | Recommended for this scope |
Present the complete optimized prompt inside a single fenced code block. The prompt must be self-contained and ready to copy-paste. Include:
For items that reference blueprint, write: "Use the blueprint skill to..."
(not /blueprint, since blueprint is a skill, not a command).
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. |
| Enhancement | Reason | |-------------|--------| | (what was added) | (why it matters) |
Not what you need? Tell me what to adjust, or make a normal task request if you want execution instead of prompt optimization.
User input:
帮我写一个用户登录页面
Phase 0 detects: package.json with Next.js 15, TypeScript, Tailwind CSS
Optimized 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,失败显示错误信息
不要做:
- 不要实现注册页面
- 不要实现忘记密码功能
- 不要修改现有的路由结构
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)
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 5 for blueprint planning, Sonnet 5 for phase execution.
| 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 |
Agent 工作流
创造有效技能指南。 当用户想创造出新的技能(或更新现有的技能),以专业知识,工作流程,或工具集成来扩展克洛德的能力时,应该使用这种技能.
Agent 工作流
使用ClawdHub CLI搜索,安装,更新并发布从taladhub.com的代理技能. 需要获取苍蝇上的新技能时使用,将安装的技能同步到最新版本或特定版本,或者发布 npm-instainddhub CLI 的新/更新的技能文件夹.
Agent 工作流
管弦乐团多代理团队,任务设定周期,交接协议,审查工作流程. 使用时间: (1)建立2+特派员队伍,具有不同专业,(2)确定任务路线和生命周期(收录框_ spec_建设_审查_完成),(3)在特派员之间制定交接协议,(4)建立审查和质量关口,(5)管理特派员之间的交流和文物共享.
Agent 工作流
Spec-first,TDD,子代理驱动的软件开发工作流程. 当:(1)构建任何新功能或应用——触发脑暴_计划_子代理执行回路,(2)调试出一个bug或测试失败——触发系统性的根起过程,(3)用户说"让我们构建","帮助我计划","我想添加X",或"这个被打破",(4)完成一个功…