协作头脑风暴
brainstorming
在实现前澄清需求、探索设计选择,并形成清晰的开发方向。
prompt-optimizer【开发与工程】Analyze raw prompts, identify intent and gaps, inventory the current oh-my-codex skill catalog across local/upstream sources, choose the best-fit skill chain, and output a ready-to-paste optimized prompt for Codex. Advisory role only — never executes the task itself. TRIGGER when: user says "optimize prompt", "improve my prompt", "how to write a prom…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Analyze a draft prompt, critique it, match it to oh-my-codex installed skills, and output a complete optimized prompt the user can paste and run in Codex.
prompt-optimize skill by nameAdvisory 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.
Run this pipeline sequentially. Present results using the Output Format below.
Before analyzing the prompt, detect the current project context:
AGENTS.md or CLAUDE.md exists in the working directory — read it for conventionspackage.json → Node.js / TypeScript / React / Next.jsgo.mod → Gopyproject.toml / requirements.txt → PythonCargo.toml → Rustbuild.gradle / pom.xml → Java / Kotlin / Spring BootPackage.swift → Swift / iOSGemfile → Rubycomposer.json → PHP*.csproj / *.sln → .NETMakefile / CMakeLists.txt → C / C++If no project files found, flag "tech stack unknown" in Phase 4.
Before recommending any skill, build a lightweight view of the current project skill catalog and resolve likely aliases. This phase is a routing index, not a full skill-body review.
Token budget rule:
.omcodex/cache/skill-index.json.
If missing or stale, suggest running npm run catalog:skill-index or let
tooling fall back to catalog/frontmatter lookup.src/catalog/manifest.json,
src/catalog/generated/public-catalog.json, or templates/catalog-manifest.json
to confirm source, intent, layer, and conflicts.SKILL.md
frontmatter block (name, description, intent, layer, origin,
version). Do not read every skill body..agent/skills/local/**/SKILL.md over upstream copies when duplicate
names exist..agent/skills/upstream/**/SKILL.md only as
candidates, using metadata/frontmatter first.This keeps prompt optimization fast: catalog/frontmatter lookup is cheap, while full skill loading is reserved for ambiguous or high-risk choices.
Common aliases and substitutes:
| Capability | Prefer if Installed | Substitute |
|---|---|---|
| Durable multi-session delivery | conductor | ralplan, planning-with-files, project-session-manager |
| Test-driven implementation | test-driven-development, tdd | tdd-workflow, tdd-generator |
| Evidence-based completion | verification-before-completion, verify | verification-loop |
| Root-cause debugging | systematic-debugging | trace, analyze, debug-analysis |
| External research | external-context | research, deepsearch, iterative-retrieval |
| Code review | requesting-code-review, code-review | review, aireview |
Do not recommend phantom slash commands or unavailable skills. In optimized
prompts, refer to skills in natural language: "Use the conductor skill..."
Classify the user's task into one or more categories:
| Category | Signal Words | Example |
|---|---|---|
| New Requirement / 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" |
| Workflow / Intent Change | change process, update plan, shift scope, 改变意图, 调整方案 | "Change the workflow from direct execution to conductor" |
If a prompt contains multiple intents, split them instead of flattening them into one instruction. Preserve explicit order signals such as "先 X 再 Y".
| Scope | Heuristic | Orchestration | Conductor Gate |
|---|---|---|---|
| TRIVIAL | Single file, < 50 lines | Direct execution | Skip |
| LOW | Single component or module | Single skill | Skip |
| MEDIUM | Multiple components, same domain | Skill chain + verify | Optional; suggest when future follow-up is likely |
| HIGH | Cross-domain, 5+ files, several phases, or several skills | conductor track + phased execution | Default |
| EPIC | Multi-session, multi-PR, architectural shift | conductor required; use ralplan only if conductor is unavailable | Required |
For new requirements, prefer conductor when the work is HIGH/EPIC or when
the prompt asks for durable context, a track, spec/plan/review artifacts, or
multi-session continuity. Do not force conductor for TRIVIAL/LOW tasks; that
adds ceremony without improving execution.
When using grill-me or any other workflow, check whether it changes the project's durable intent layer:
conductor refresh/new-track or
reconcile steps in the optimized prompt.Map intent + scope + tech stack to installed oh-my-codex skills.
| Intent | Primary Skills | Supporting Skills |
|---|---|---|
| New Requirement / Feature (LOW-MEDIUM) | brainstorming, plan, tdd, verify | code-review, planning-methodology |
| New Requirement / Feature (HIGH-EPIC) | conductor, writing-plans, test-driven-development, verify | using-git-worktrees, requesting-code-review, project-session-manager |
| Bug Fix | systematic-debugging, tdd, verify | trace, analyze, debug-analysis, build-fix |
| Refactor | refactor-clean, code-review, verify | verification-loop, coding-standards |
| Research | research, deepsearch, iterative-retrieval | plan, multi-model-research |
| Testing | tdd, e2e, test-coverage | tdd-workflow, tdd-generator, test-gen, bdd-generator |
| Review | code-review, security-review, aireview | requesting-code-review, receiving-code-review |
| Documentation | update-docs, update-codemaps | writer-memory |
| Infrastructure | plan, verify, mcp-setup | mcp-server-patterns, backend-patterns |
| Design (MEDIUM-HIGH) | plan, brainstorming, architect-planner | planning-methodology, planning-with-files |
| Design (EPIC) | conductor, ralplan | architect-planner, team |
| Workflow / Intent Change | conductor | planning-with-files, strategic-compact, review |
Use ordered chains in the optimized prompt. Do not output an unprioritized pile of skills.
| Scenario | Recommended Chain |
|---|---|
| New requirement, LOW-MEDIUM | brainstorming -> plan -> test-driven-development/tdd -> verify -> optional code-review |
| New requirement, HIGH-EPIC | conductor -> writing-plans -> per-phase test-driven-development -> verify -> requesting-code-review |
| Bug fix | systematic-debugging -> optional trace -> test-driven-development/tdd -> verify -> optional requesting-code-review |
| Performance | analyze -> trace -> planning-methodology -> implement one optimization at a time -> verify with re-measurement |
| Research then build | external-context/research -> comparison report -> conductor if HIGH+ -> implementation chain |
| Refactor | current-state code-review -> planning-methodology -> characterization tests via tdd -> refactor-clean -> verify |
| Documentation | update-docs -> update-codemaps -> verify docs/examples |
| Security-sensitive work | domain implementation chain -> security-review -> verify |
If a selected workflow changes durable intent, insert conductor refresh or
reconcile before implementation and after review.
| Tech Stack | Skills to Add | Notes |
|---|---|---|
| TypeScript / React | frontend-patterns, frontend-design, coding-standards | Add nextjs-turbopack for Next.js projects |
| Node.js / Next.js | backend-patterns, frontend-patterns, nextjs-turbopack | Full-stack pattern coverage |
| Go | backend-patterns, coding-standards | |
| Python | backend-patterns, coding-standards | |
| Swift / iOS | backend-patterns, coding-standards | iOS architecture patterns |
| Rust / C++ | coding-standards | Low-level safety focus |
| Any frontend | frontend-ui-ux, ui-ux-pro-max | Add for UI-heavy tasks |
| API design | api-design, backend-patterns | REST/GraphQL endpoint work |
| Database | backend-patterns | Schema + migration focus |
| Any stack | coding-standards | Universal baseline |
| Scope | Orchestration Skills |
|---|---|
| MEDIUM | plan → implement → verify |
| HIGH | conductor → phased implement → code-review → verify |
| EPIC | conductor → ralplan only if needed for blueprint → verify gates between phases |
| Multi-session | project-session-manager to save/resume context |
Scan the prompt for missing critical information:
If 3+ critical items are missing, ask up to 3 clarification questions before generating the optimized prompt. Incorporate answers into the output.
Lifecycle position:
Research → Plan → Implement (TDD) → Review → Verify → Commit
For MEDIUM tasks, start with plan unless the task explicitly needs durable
artifacts. For HIGH/EPIC tasks, start with conductor; use ralplan as a
blueprint helper only when conductor is unavailable or the user explicitly
requests it.
Model recommendation:
| Scope | Model | Rationale |
|---|---|---|
| TRIVIAL-LOW | Sonnet 4.6 | Fast, cost-efficient |
| MEDIUM | Sonnet 4.6 | Best coding model for standard work |
| HIGH | Sonnet 4.6 (impl) + Opus 4.7 (planning) | Opus for architecture decisions |
| EPIC | Opus 4.7 (conductor/spec planning) + Sonnet 4.6 (execution) | Deep reasoning for multi-session planning |
Multi-prompt splitting (for HIGH/EPIC scope):
research/deepsearch skill, then conductor for HIGH/EPIC or plan for MEDIUM)verify skill)code-review across all phasesproject-session-manager skill to preserve context between sessionsPresent analysis in this exact structure. Respond in the same language as the user's input.
Strengths: What the original prompt does well.
Issues:
| Issue | Impact | Suggested Fix |
|---|---|---|
| (problem) | (consequence) | (how to fix) |
Needs Clarification: Numbered list of questions (omit if Phase 0 auto-detected the answer).
Start with a compact catalog summary based on catalog/frontmatter metadata, not full-body reads:
| Skill Group | Best Matches Found | Why Relevant |
|---|---|---|
| Orchestration | conductor | Durable track/spec/plan/review for HIGH+ new requirements |
Then list only the selected skill chain. If full skill bodies were read, name which ones and why; otherwise state "metadata-only routing was sufficient."
| Type | Skill | Purpose |
|---|---|---|
| Planning | plan | Architecture before coding |
| Testing | tdd | Test-driven implementation |
| Review | code-review | Post-implementation review |
| Verification | verify | Confirm correctness |
| Model | Sonnet 4.6 | Recommended for this scope |
Only list skills that are actually useful for this task. Do not pad the table.
State when conductor was deliberately skipped because scope is TRIVIAL/LOW.
Present the complete optimized prompt inside a single fenced code block. Must be self-contained and ready to copy-paste into Codex. Include:
plan skill to...")Do NOT use slash-command syntax — Codex activates skills via conversation, not
slash commands. Write skill references as natural language:
"Use the plan skill", "Run tdd skill", "Apply verify skill".
Compact version for experienced users:
| Intent | Quick Pattern |
|---|---|
| New Feature | `plan` → `tdd` → implement → `code-review` → `verify` |
| Bug Fix | `tdd` — write failing test for [bug]. Fix to green. `verify`. |
| Refactor | `refactor-clean` [scope]. `code-review`. `verify`. |
| Research | `deepsearch`/`research` for [topic]. `plan` based on findings. |
| Testing | `tdd` [module]. `e2e` for critical flows. `test-coverage`. |
| Review | `code-review`. Then `security-review`. |
| Docs | `update-docs`. `update-codemaps`. |
| HIGH/EPIC New Requirement | `conductor` for "[objective]": create/refresh track, write spec + plan, execute phases with `verify` gates. |
| Intent Change | `conductor` refresh/reconcile for changed requirements/scope/workflow, then run the selected implementation chain. |
| 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` skill 规划组件结构和认证流程,参考现有页面模式
2. 使用 `tdd` skill 先写失败测试(表单单元测试 + 认证集成测试)
3. 实现登录页面和认证逻辑
4. 使用 `code-review` skill 审查实现
5. 使用 `verify` skill 确认所有测试通过且页面正常渲染
安全要求:密码不明文传输、防暴力破解、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 (name, email, avatar_url, bio)
- Input validation for all fields
- Auth: require valid token, users can only update own profile
- Return 200 with updated user on success; 400 for validation errors; 401/403 for auth
Workflow:
1. Use `plan` skill to design endpoint structure, middleware chain, and validation logic
2. Use `tdd` skill — write table-driven tests for success, validation failure, auth failure, not-found
3. Implement following existing handler patterns in the codebase
4. Use `code-review` skill + `security-review` skill
5. Use `verify` skill — run full test suite, confirm no regressions
Do not: modify existing endpoints, change database schema, add new dependencies without
first using `deepsearch` skill to check existing ones.
User input:
Migrate our monolith to microservices
Optimized Prompt (Full):
Use the `conductor` skill to create a durable track for:
"Migrate monolith to microservices architecture"
Before executing, the track spec and plan must answer:
1. Which domain boundaries exist in the current monolith?
2. Which service to extract first (lowest coupling)?
3. Communication pattern: REST, gRPC, or event-driven?
4. Database strategy: shared DB initially or database-per-service?
5. Deployment target: Kubernetes, Docker Compose, or serverless?
Track phases:
- Phase 1: Identify service boundaries, create domain map
- Phase 2: Set up infrastructure (API gateway, CI/CD per service)
- Phase 3: Extract first service (strangler fig pattern)
- Phase 4: Verify with integration tests, extract next service
- Phase N: Decommission monolith
Each phase = 1 PR with `verify` skill gate.
Use `project-session-manager` skill between phases to preserve context.
Use `using-git-worktrees` skill for parallel service extraction.
Recommended: Opus 4.7 for conductor/spec planning, Sonnet 4.6 for phase execution.
Before using this reference, refresh it from .agent/skills/local and
.agent/skills/upstream and prefer local overrides. Key skill groups commonly
available in this oh-my-codex installation:
Planning & Architecture: plan, brainstorming, architect-planner, planning-methodology, planning-with-files, ralplan, ultrawork, ralph
Implementation: tdd, tdd-workflow, build-fix, refactor-clean, coding-standards, backend-patterns, frontend-patterns, frontend-design, api-design
Testing: tdd-generator, test-gen, test-coverage, e2e, e2e-testing, bdd-generator, verify, verification-loop
Review & Quality: code-review, security-review, aireview, quality-check, quality-validation, requesting-code-review, receiving-code-review
Research: research, deepsearch, iterative-retrieval, multi-model-research, documentation-lookup
Documentation: update-docs, update-codemaps, writer-memory
Debugging: systematic-debugging, debug-analysis, trace, log-analyzer
Orchestration: team, swarm, conductor, pipeline, autopilot, ultraqa
Session Management: project-session-manager, checkpoint, strategic-compact
Frontend: frontend-ui-ux, ui-ux-pro-max, frontend-slides, web-clone, nextjs-turbopack
Infrastructure: mcp-setup, mcp-server-patterns, start-dev, release, git-master
Skill Tools: skill-create, skill-development, skill-tester, skill-quality-analyzer