Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计通过

prompt-optimizer提示优化器

Agent Skill

用于辅助提示词、系统指令、Agent 行为约束和工作流模板的整理。它适合让 Agent 规范任务边界、统一输出格式、拆分操作步骤或优化提示词可复用性。使用时需要保留真实业务约束,不要把示例当硬规则;涉及自动执行、外部工具或高风险操作时,应在提示词中明确确认步骤、权限边界和失败处理方式。

总安装

65,184

周安装

2,762

GitHub Stars

170,315

下载量

22,848
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:prompt-optimizer(提示优化器)
来源仓库:https://github.com/affaan-m/everything-claude-code
仓库路径:skills/prompt-optimizer
安装命令:
npx skills add https://github.com/affaan-m/everything-claude-code --skill prompt-optimizer
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/affaan-m/everything-claude-code --skill prompt-optimizer

简介

提示优化器用于分析、改进和重构提示词与 Agent 工作流模板。

  • 适合需要规范任务边界、统一输出格式或提升提示词复用性的场景。
  • 可匹配 ECC 生态组件并输出可直接运行的优化后提示,支持中英文输入。
  • 安装后可在 Codex、Claude、Cursor、Gemini CLI 中使用,不涉及自动执行高风险操作。
  • 建议保留真实业务约束,避免将示例当作硬性规则,复杂流程需人工确认步骤。

SKILL.md

Prompt 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.

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

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:

  1. Check if a CLAUDE.md exists in the working directory — read it for project conventions
  2. Detect tech stack from project files:

- package.json → Node.js / TypeScript / React / Next.js - go.mod → Go - pyproject.toml / requirements.txt → Python - Cargo.toml → Rust - 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

  1. 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:

CategorySignal WordsExample
New Featurebuild, create, add, implement, 创建, 实现, 添加"Build a login page"
Bug Fixfix, broken, not working, error, 修复, 报错"Fix the auth flow"
Refactorrefactor, clean up, restructure, 重构, 整理"Refactor the API layer"
Researchhow to, what is, explore, investigate, 怎么, 如何"How to add SSO"
Testingtest, coverage, verify, 测试, 覆盖率"Add tests for the cart"
Reviewreview, audit, check, 审查, 检查"Review my PR"
Documentationdocument, update docs, 文档"Update the API docs"
Infrastructuredeploy, CI, docker, database, 部署, 数据库"Set up CI/CD pipeline"
Designdesign, 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.

ScopeHeuristicOrchestration
TRIVIALSingle file, < 50 linesDirect execution
LOWSingle component or moduleSingle command or skill
MEDIUMMultiple components, same domainCommand chain + /verify
HIGHCross-domain, 5+ files/plan first, then phased execution
EPICMulti-session, multi-PR, architectural shiftUse blueprint skill for multi-session plan

Phase 3: ECC Component Matching

Map intent + scope + tech stack (from Phase 0) to specific ECC components.

By Intent Type

IntentCommandsSkillsAgents
New Feature/plan, /tdd, /code-review, /verifytdd-workflow, verification-loopplanner, tdd-guide, code-reviewer
Bug Fix/tdd, /build-fix, /verifytdd-workflowtdd-guide, build-error-resolver
Refactor/refactor-clean, /code-review, /verifyverification-looprefactor-cleaner, code-reviewer
Research/plansearch-first, iterative-retrieval
Testing/tdd, /e2e, /test-coveragetdd-workflow, e2e-testingtdd-guide, e2e-runner
Review/code-reviewsecurity-reviewcode-reviewer, security-reviewer
Documentation/update-docs, /update-codemapsdoc-updater
Infrastructure/plan, /verifydocker-patterns, deployment-patterns, database-migrationsarchitect
Design (MEDIUM-HIGH)/planplanner, architect
Design (EPIC)blueprint (invoke as skill)planner, architect

By Tech Stack

Tech StackSkills to AddAgent
Python / Djangodjango-patterns, django-tdd, django-security, django-verification, python-patterns, python-testingpython-reviewer
Gogolang-patterns, golang-testinggo-reviewer, go-build-resolver
Spring Boot / Javaspringboot-patterns, springboot-tdd, springboot-security, springboot-verification, java-coding-standards, jpa-patternscode-reviewer
Kotlin / Androidkotlin-coroutines-flows, compose-multiplatform-patterns, android-clean-architecturekotlin-reviewer
TypeScript / Reactfrontend-patterns, backend-patterns, coding-standardscode-reviewer
Swift / iOSswiftui-patterns, swift-concurrency-6-2, swift-actor-persistence, swift-protocol-di-testingcode-reviewer
PostgreSQLpostgres-patterns, database-migrationsdatabase-reviewer
Perlperl-patterns, perl-testing, perl-securitycode-reviewer
C++cpp-coding-standards, cpp-testingcode-reviewer
Other / Unlistedcoding-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):

ScopeRecommended ModelRationale
TRIVIAL-LOWSonnet 4.6Fast, cost-efficient for simple tasks
MEDIUMSonnet 4.6Best coding model for standard work
HIGHSonnet 4.6 (main) + Opus 4.6 (planning)Opus for architecture, Sonnet for implementation
EPICOpus 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:

IssueImpactSuggested 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

TypeComponentPurpose
Command/planPlan architecture before coding
Skilltdd-workflowTDD methodology guidance
Agentcode-reviewerPost-implementation review
ModelSonnet 4.6Recommended 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:

IntentQuick 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.
ResearchUse 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.
EPICUse blueprint skill for "[objective]". Execute phases with /verify gates.

Section 5: Enhancement Rationale

EnhancementReason
(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?"

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)实现用户登录页面。

技术要求:
- 沿用项目现有的组件结构和路由约定
- 表单验证使用项目中已有的验证方案(检查是否已用 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

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

ComponentWhen to Reference
configure-eccUser hasn't set up ECC yet
skill-stocktakeAudit which components are installed (use instead of hardcoded catalog)
search-firstResearch phase in optimized prompts
blueprintEPIC-scope optimized prompts (invoke as skill, not command)
strategic-compactLong session context management
cost-aware-llm-pipelineToken optimization recommendations

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

38.25%
按下载量换算8,739

Claude

28.3%
按下载量换算6,466

Cursor

19.14%
按下载量换算4,373

Gemini CLI

10.05%
按下载量换算2,296

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills