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 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 oh-my-codex installed skills,
and output a complete optimized prompt the user can paste and run in Codex.
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 explicitly invokes the prompt-optimize skill by name
Do Not Use When
User wants the task done directly (just execute it)
User says "优化代码", "优化性能", "optimize this code", "optimize performance"
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.
Run this pipeline sequentially. Present results using the Output Format below.
Phase 0: Project Detection
Before analyzing the prompt, detect the current project context:
Check if AGENTS.md or CLAUDE.md exists in the working directory — read it for conventions
build.gradle / pom.xml → Java / Kotlin / Spring Boot
Package.swift → Swift / iOS
Gemfile → Ruby
composer.json → PHP
*.csproj / *.sln → .NET
Makefile / CMakeLists.txt → C / C++
Note detected tech stack for Phase 3 and Phase 4
If no project files found, flag "tech stack unknown" in Phase 4.
Phase 0.5: Lightweight Skill Catalog Inventory
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:
Prefer the runtime skill index cache at .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.
Use catalog/manifest data such as src/catalog/manifest.json,
src/catalog/generated/public-catalog.json, or templates/catalog-manifest.json
to confirm source, intent, layer, and conflicts.
If catalog files are missing or stale, inspect only each SKILL.md
frontmatter block (name, description, intent, layer, origin,
version). Do not read every skill body.
Prefer .agent/skills/local/**/SKILL.md over upstream copies when duplicate
names exist.
Include upstream sources under .agent/skills/upstream/**/SKILL.md only as
candidates, using metadata/frontmatter first.
Group available skills by intent/layer instead of dumping a long flat list:
planning, execution, debugging, testing, review, verification, research,
documentation, frontend, backend, security, orchestration, skill-management.
Shortlist at most 2-5 candidate skills or chains, then read full skill bodies
only for the shortlisted skills if the prompt needs precise workflow details.
For short, clear prompts, skip full body reads entirely and use metadata plus
the best-practice chains below.
Recommend only skills that appear in the current project/runtime catalog. If a
well-known capability is absent, name the nearest installed substitute and
state the substitution.
This keeps prompt optimization fast: catalog/frontmatter lookup is cheap, while
full skill loading is reserved for ambiguous or high-risk choices.
"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".
Phase 2: Scope Assessment
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:
Requirements, scope, acceptance criteria, architecture, workflow rules, or
long-lived delivery plan changed -> include conductor refresh/new-track or
reconcile steps in the optimized prompt.
Pure implementation technique, debugging method, review pass, or verification
gate with no intent change -> use the workflow directly and do not add
conductor solely for formality.
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 up to 3 clarification questions before
generating the optimized prompt. Incorporate answers into the output.
Phase 5: Workflow & Model Recommendation
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):
Prompt 1: Research + Plan (research/deepsearch skill, then conductor for HIGH/EPIC or plan for MEDIUM)
Prompt 2–N: Implement one phase per prompt (each ends with verify skill)
Final Prompt: Integration test + code-review across all phases
Use project-session-manager skill to preserve context between sessions
Output Format
Present analysis in this exact structure. Respond in the same language as the user's input.
Section 1: Prompt Diagnosis
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).
Section 2: Recommended oh-my-codex Skills
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.
Section 3: Optimized Prompt — Full Version
Present the complete optimized prompt inside a single fenced code block.
Must be self-contained and ready to copy-paste into Codex. Include:
Clear task description with context
Tech stack (detected or specified)
Skill invocations at the right workflow stages (write as: "Use the plan skill to...")
Acceptance criteria
Verification steps
Scope boundaries (what NOT to do)
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".
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.
Example 3: EPIC Scope
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.
Installed Skills Reference
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
1---2name: prompt-optimizer3description: 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 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 (oh-my-codex Edition)78Analyze a draft prompt, critique it, match it to oh-my-codex installed skills,9and output a complete optimized prompt the user can paste and run in Codex.1011## When to Use1213- 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 enhancement18- User says "I don't know how to prompt for this"19- User explicitly invokes the `prompt-optimize` skill by name2021### Do Not Use When2223- User wants the task done directly (just execute it)24- User says "优化代码", "优化性能", "optimize this code", "optimize performance"25- User says "just do it" or "直接做"2627## How It Works2829**Advisory only — do not execute the user's task.**3031Do NOT write code, create files, run commands, or take any implementation32action. Your ONLY output is an analysis plus an optimized prompt.3334Run this pipeline sequentially. Present results using the Output Format below.3536---3738### Phase 0: Project Detection3940Before analyzing the prompt, detect the current project context:41421. Check if `AGENTS.md` or `CLAUDE.md` exists in the working directory — read it for conventions432. Detect tech stack from project files:44 - `package.json` → Node.js / TypeScript / React / Next.js45 - `go.mod` → Go46 - `pyproject.toml` / `requirements.txt` → Python47 - `Cargo.toml` → Rust48 - `build.gradle` / `pom.xml` → Java / Kotlin / Spring Boot49 - `Package.swift` → Swift / iOS50 - `Gemfile` → Ruby51 - `composer.json` → PHP52 - `*.csproj` / `*.sln` → .NET53 - `Makefile` / `CMakeLists.txt` → C / C++543. Note detected tech stack for Phase 3 and Phase 45556If no project files found, flag "tech stack unknown" in Phase 4.5758---5960### Phase 0.5: Lightweight Skill Catalog Inventory6162Before recommending any skill, build a **lightweight** view of the current63project skill catalog and resolve likely aliases. This phase is a routing index,64not a full skill-body review.6566Token budget rule:67681. Prefer the runtime skill index cache at `.omcodex/cache/skill-index.json`.69 If missing or stale, suggest running `npm run catalog:skill-index` or let70 tooling fall back to catalog/frontmatter lookup.712. Use catalog/manifest data such as `src/catalog/manifest.json`,72 `src/catalog/generated/public-catalog.json`, or `templates/catalog-manifest.json`73 to confirm source, intent, layer, and conflicts.743. If catalog files are missing or stale, inspect only each `SKILL.md`75 frontmatter block (`name`, `description`, `intent`, `layer`, `origin`,76 `version`). Do not read every skill body.774. Prefer `.agent/skills/local/**/SKILL.md` over upstream copies when duplicate78 names exist.795. Include upstream sources under `.agent/skills/upstream/**/SKILL.md` only as80 candidates, using metadata/frontmatter first.816. Group available skills by intent/layer instead of dumping a long flat list:82 planning, execution, debugging, testing, review, verification, research,83 documentation, frontend, backend, security, orchestration, skill-management.847. Shortlist at most 2-5 candidate skills or chains, then read full skill bodies85 only for the shortlisted skills if the prompt needs precise workflow details.868. For short, clear prompts, skip full body reads entirely and use metadata plus87 the best-practice chains below.889. Recommend only skills that appear in the current project/runtime catalog. If a89 well-known capability is absent, name the nearest installed substitute and90 state the substitution.9192This keeps prompt optimization fast: catalog/frontmatter lookup is cheap, while93full skill loading is reserved for ambiguous or high-risk choices.9495Common aliases and substitutes:9697| Capability | Prefer if Installed | Substitute |98|------------|---------------------|------------|99| Durable multi-session delivery | `conductor` | `ralplan`, `planning-with-files`, `project-session-manager` |100| Test-driven implementation | `test-driven-development`, `tdd` | `tdd-workflow`, `tdd-generator` |101| Evidence-based completion | `verification-before-completion`, `verify` | `verification-loop` |102| Root-cause debugging | `systematic-debugging` | `trace`, `analyze`, `debug-analysis` |103| External research | `external-context` | `research`, `deepsearch`, `iterative-retrieval` |104| Code review | `requesting-code-review`, `code-review` | `review`, `aireview` |105106Do not recommend phantom slash commands or unavailable skills. In optimized107prompts, refer to skills in natural language: "Use the `conductor` skill..."108109---110111### Phase 1: Intent Detection112113Classify the user's task into one or more categories:114115| Category | Signal Words | Example |116|----------|-------------|---------|117| New Requirement / Feature | build, create, add, implement, 创建, 实现, 添加, 新需求 | "Build a login page" |118| Bug Fix | fix, broken, not working, error, 修复, 报错 | "Fix the auth flow" |119| Refactor | refactor, clean up, restructure, 重构, 整理 | "Refactor the API layer" |120| Research | how to, what is, explore, investigate, 怎么, 如何 | "How to add SSO" |121| Testing | test, coverage, verify, 测试, 覆盖率 | "Add tests for the cart" |122| Review | review, audit, check, 审查, 检查 | "Review my PR" |123| Documentation | document, update docs, 文档 | "Update the API docs" |124| Infrastructure | deploy, CI, docker, database, 部署, 数据库 | "Set up CI/CD pipeline" |125| Design | design, architecture, plan, 设计, 架构 | "Design the data model" |126| Workflow / Intent Change | change process, update plan, shift scope, 改变意图, 调整方案 | "Change the workflow from direct execution to conductor" |127128If a prompt contains multiple intents, split them instead of flattening them129into one instruction. Preserve explicit order signals such as "先 X 再 Y".130131---132133### Phase 2: Scope Assessment134135| Scope | Heuristic | Orchestration | Conductor Gate |136|-------|-----------|---------------|----------------|137| TRIVIAL | Single file, < 50 lines | Direct execution | Skip |138| LOW | Single component or module | Single skill | Skip |139| MEDIUM | Multiple components, same domain | Skill chain + `verify` | Optional; suggest when future follow-up is likely |140| HIGH | Cross-domain, 5+ files, several phases, or several skills | `conductor` track + phased execution | Default |141| EPIC | Multi-session, multi-PR, architectural shift | `conductor` required; use `ralplan` only if conductor is unavailable | Required |142143For **new requirements**, prefer `conductor` when the work is HIGH/EPIC or when144the prompt asks for durable context, a track, spec/plan/review artifacts, or145multi-session continuity. Do not force `conductor` for TRIVIAL/LOW tasks; that146adds ceremony without improving execution.147148When using grill-me or any other workflow, check whether it changes the149project's durable intent layer:150151- Requirements, scope, acceptance criteria, architecture, workflow rules, or152 long-lived delivery plan changed -> include `conductor` refresh/new-track or153 reconcile steps in the optimized prompt.154- Pure implementation technique, debugging method, review pass, or verification155 gate with no intent change -> use the workflow directly and do not add156 conductor solely for formality.157158---159160### Phase 3: oh-my-codex Skill Matching161162Map intent + scope + tech stack to **installed oh-my-codex skills**.163164#### By Intent Type165166| Intent | Primary Skills | Supporting Skills |167|--------|---------------|------------------|168| New Requirement / Feature (LOW-MEDIUM) | `brainstorming`, `plan`, `tdd`, `verify` | `code-review`, `planning-methodology` |169| New Requirement / Feature (HIGH-EPIC) | `conductor`, `writing-plans`, `test-driven-development`, `verify` | `using-git-worktrees`, `requesting-code-review`, `project-session-manager` |170| Bug Fix | `systematic-debugging`, `tdd`, `verify` | `trace`, `analyze`, `debug-analysis`, `build-fix` |171| Refactor | `refactor-clean`, `code-review`, `verify` | `verification-loop`, `coding-standards` |172| Research | `research`, `deepsearch`, `iterative-retrieval` | `plan`, `multi-model-research` |173| Testing | `tdd`, `e2e`, `test-coverage` | `tdd-workflow`, `tdd-generator`, `test-gen`, `bdd-generator` |174| Review | `code-review`, `security-review`, `aireview` | `requesting-code-review`, `receiving-code-review` |175| Documentation | `update-docs`, `update-codemaps` | `writer-memory` |176| Infrastructure | `plan`, `verify`, `mcp-setup` | `mcp-server-patterns`, `backend-patterns` |177| Design (MEDIUM-HIGH) | `plan`, `brainstorming`, `architect-planner` | `planning-methodology`, `planning-with-files` |178| Design (EPIC) | `conductor`, `ralplan` | `architect-planner`, `team` |179| Workflow / Intent Change | `conductor` | `planning-with-files`, `strategic-compact`, `review` |180181#### Best-Practice Skill Chains182183Use ordered chains in the optimized prompt. Do not output an unprioritized pile184of skills.185186| Scenario | Recommended Chain |187|----------|-------------------|188| New requirement, LOW-MEDIUM | `brainstorming` -> `plan` -> `test-driven-development`/`tdd` -> `verify` -> optional `code-review` |189| New requirement, HIGH-EPIC | `conductor` -> `writing-plans` -> per-phase `test-driven-development` -> `verify` -> `requesting-code-review` |190| Bug fix | `systematic-debugging` -> optional `trace` -> `test-driven-development`/`tdd` -> `verify` -> optional `requesting-code-review` |191| Performance | `analyze` -> `trace` -> `planning-methodology` -> implement one optimization at a time -> `verify` with re-measurement |192| Research then build | `external-context`/`research` -> comparison report -> `conductor` if HIGH+ -> implementation chain |193| Refactor | current-state `code-review` -> `planning-methodology` -> characterization tests via `tdd` -> `refactor-clean` -> `verify` |194| Documentation | `update-docs` -> `update-codemaps` -> `verify` docs/examples |195| Security-sensitive work | domain implementation chain -> `security-review` -> `verify` |196197If a selected workflow changes durable intent, insert `conductor` refresh or198reconcile before implementation and after review.199200#### By Tech Stack201202| Tech Stack | Skills to Add | Notes |203|------------|--------------|-------|204| TypeScript / React | `frontend-patterns`, `frontend-design`, `coding-standards` | Add `nextjs-turbopack` for Next.js projects |205| Node.js / Next.js | `backend-patterns`, `frontend-patterns`, `nextjs-turbopack` | Full-stack pattern coverage |206| Go | `backend-patterns`, `coding-standards` | |207| Python | `backend-patterns`, `coding-standards` | |208| Swift / iOS | `backend-patterns`, `coding-standards` | iOS architecture patterns |209| Rust / C++ | `coding-standards` | Low-level safety focus |210| Any frontend | `frontend-ui-ux`, `ui-ux-pro-max` | Add for UI-heavy tasks |211| API design | `api-design`, `backend-patterns` | REST/GraphQL endpoint work |212| Database | `backend-patterns` | Schema + migration focus |213| Any stack | `coding-standards` | Universal baseline |214215#### By Scope Escalation216217| Scope | Orchestration Skills |218|-------|---------------------|219| MEDIUM | `plan` → implement → `verify` |220| HIGH | `conductor` → phased implement → `code-review` → `verify` |221| EPIC | `conductor` → `ralplan` only if needed for blueprint → `verify` gates between phases |222| Multi-session | `project-session-manager` to save/resume context |223224---225226### Phase 4: Missing Context Detection227228Scan the prompt for missing critical information:229230- [ ] **Tech stack** — Detected in Phase 0, or must user specify?231- [ ] **Target scope** — Files, directories, or modules mentioned?232- [ ] **Acceptance criteria** — How to know the task is done?233- [ ] **Error handling** — Edge cases and failure modes addressed?234- [ ] **Security requirements** — Auth, input validation, secrets?235- [ ] **Testing expectations** — Unit, integration, E2E?236- [ ] **Performance constraints** — Load, latency, resource limits?237- [ ] **UI/UX requirements** — Design specs, responsive, a11y? (if frontend)238- [ ] **Database changes** — Schema, migrations, indexes? (if data layer)239- [ ] **Existing patterns** — Reference files or conventions to follow?240- [ ] **Scope boundaries** — What NOT to do?241242**If 3+ critical items are missing**, ask up to 3 clarification questions before243generating the optimized prompt. Incorporate answers into the output.244245---246247### Phase 5: Workflow & Model Recommendation248249Lifecycle position:250251```252Research → Plan → Implement (TDD) → Review → Verify → Commit253```254255For MEDIUM tasks, start with `plan` unless the task explicitly needs durable256artifacts. For HIGH/EPIC tasks, start with `conductor`; use `ralplan` as a257blueprint helper only when `conductor` is unavailable or the user explicitly258requests it.259260**Model recommendation:**261262| Scope | Model | Rationale |263|-------|-------|-----------|264| TRIVIAL-LOW | Sonnet 4.6 | Fast, cost-efficient |265| MEDIUM | Sonnet 4.6 | Best coding model for standard work |266| HIGH | Sonnet 4.6 (impl) + Opus 4.7 (planning) | Opus for architecture decisions |267| EPIC | Opus 4.7 (conductor/spec planning) + Sonnet 4.6 (execution) | Deep reasoning for multi-session planning |268269**Multi-prompt splitting (for HIGH/EPIC scope):**270271- Prompt 1: Research + Plan (`research`/`deepsearch` skill, then `conductor` for HIGH/EPIC or `plan` for MEDIUM)272- Prompt 2–N: Implement one phase per prompt (each ends with `verify` skill)273- Final Prompt: Integration test + `code-review` across all phases274- Use `project-session-manager` skill to preserve context between sessions275276---277278## Output Format279280Present analysis in this exact structure. **Respond in the same language as the user's input.**281282### Section 1: Prompt Diagnosis283284**Strengths:** What the original prompt does well.285286**Issues:**287288| Issue | Impact | Suggested Fix |289|-------|--------|---------------|290| (problem) | (consequence) | (how to fix) |291292**Needs Clarification:** Numbered list of questions (omit if Phase 0 auto-detected the answer).293294---295296### Section 2: Recommended oh-my-codex Skills297298Start with a compact catalog summary based on catalog/frontmatter metadata, not299full-body reads:300301| Skill Group | Best Matches Found | Why Relevant |302|-------------|--------------------|--------------|303| Orchestration | `conductor` | Durable track/spec/plan/review for HIGH+ new requirements |304305Then list only the selected skill chain. If full skill bodies were read, name306which ones and why; otherwise state "metadata-only routing was sufficient."307308| Type | Skill | Purpose |309|------|-------|---------|310| Planning | `plan` | Architecture before coding |311| Testing | `tdd` | Test-driven implementation |312| Review | `code-review` | Post-implementation review |313| Verification | `verify` | Confirm correctness |314| Model | Sonnet 4.6 | Recommended for this scope |315316Only list skills that are actually useful for this task. Do not pad the table.317State when `conductor` was deliberately skipped because scope is TRIVIAL/LOW.318319---320321### Section 3: Optimized Prompt — Full Version322323Present the complete optimized prompt inside a single fenced code block.324Must be self-contained and ready to copy-paste into Codex. Include:325- Clear task description with context326- Tech stack (detected or specified)327- Skill invocations at the right workflow stages (write as: "Use the `plan` skill to...")328- Acceptance criteria329- Verification steps330- Scope boundaries (what NOT to do)331332**Do NOT use slash-command syntax** — Codex activates skills via conversation, not333slash commands. Write skill references as natural language:334"Use the `plan` skill", "Run `tdd` skill", "Apply `verify` skill".335336---337338### Section 4: Optimized Prompt — Quick Version339340Compact version for experienced users:341342| Intent | Quick Pattern |343|--------|--------------|344| New Feature | `` `plan` → `tdd` → implement → `code-review` → `verify` `` |345| Bug Fix | `` `tdd` — write failing test for [bug]. Fix to green. `verify`. `` |346| Refactor | `` `refactor-clean` [scope]. `code-review`. `verify`. `` |347| Research | `` `deepsearch`/`research` for [topic]. `plan` based on findings. `` |348| Testing | `` `tdd` [module]. `e2e` for critical flows. `test-coverage`. `` |349| Review | `` `code-review`. Then `security-review`. `` |350| Docs | `` `update-docs`. `update-codemaps`. `` |351| HIGH/EPIC New Requirement | `` `conductor` for "[objective]": create/refresh track, write spec + plan, execute phases with `verify` gates. `` |352| Intent Change | `` `conductor` refresh/reconcile for changed requirements/scope/workflow, then run the selected implementation chain. `` |353354---355356### Section 5: Enhancement Rationale357358| Enhancement | Reason |359|-------------|--------|360| (what was added) | (why it matters) |361362---363364### Footer365366> Not what you need? Tell me what to adjust, or make a normal task request367> if you want execution instead of prompt optimization.368369---370371## Examples372373### Example 1: Vague Chinese Prompt (Project Detected)374375**User input:**376```377帮我写一个用户登录页面378```379380**Phase 0 detects:** `package.json` with Next.js 15, TypeScript, Tailwind CSS381382**Optimized Prompt (Full):**383```384使用项目现有技术栈(Next.js 15 + TypeScript + Tailwind CSS)实现用户登录页面。385386技术要求:387- 沿用项目现有组件结构和路由约定388- 表单验证使用项目现有方案(Zod/Yup/其他,先搜索确认)389- 认证方式沿用现有方案(如无则默认 JWT)390- 包含:邮箱/密码表单、验证、错误提示、加载状态、响应式布局391392工作流:3931. 使用 `plan` skill 规划组件结构和认证流程,参考现有页面模式3942. 使用 `tdd` skill 先写失败测试(表单单元测试 + 认证集成测试)3953. 实现登录页面和认证逻辑3964. 使用 `code-review` skill 审查实现3975. 使用 `verify` skill 确认所有测试通过且页面正常渲染398399安全要求:密码不明文传输、防暴力破解、XSS 防护、CSRF token400401验收标准:402- 所有测试通过,覆盖率 80%+403- 移动端和桌面端正常渲染404- 登录成功跳转 dashboard,失败显示错误405406不要做:不实现注册页面、不实现忘记密码、不修改现有路由结构407```408409---410411### Example 2: English Prompt (Go Project)412413**User input:**414```415Add a REST API endpoint for user profile updates with validation416```417418**Phase 0 detects:** `go.mod` with Go 1.22, Chi router419420**Optimized Prompt (Full):**421```422Add a REST API endpoint for user profile updates (PATCH /api/users/:id).423424Tech stack: Go 1.22 + Chi router (detected from project)425426Requirements:427- PATCH /api/users/:id — partial update (name, email, avatar_url, bio)428- Input validation for all fields429- Auth: require valid token, users can only update own profile430- Return 200 with updated user on success; 400 for validation errors; 401/403 for auth431432Workflow:4331. Use `plan` skill to design endpoint structure, middleware chain, and validation logic4342. Use `tdd` skill — write table-driven tests for success, validation failure, auth failure, not-found4353. Implement following existing handler patterns in the codebase4364. Use `code-review` skill + `security-review` skill4375. Use `verify` skill — run full test suite, confirm no regressions438439Do not: modify existing endpoints, change database schema, add new dependencies without440first using `deepsearch` skill to check existing ones.441```442443---444445### Example 3: EPIC Scope446447**User input:**448```449Migrate our monolith to microservices450```451452**Optimized Prompt (Full):**453```454Use the `conductor` skill to create a durable track for:455"Migrate monolith to microservices architecture"456457Before executing, the track spec and plan must answer:4581. Which domain boundaries exist in the current monolith?4592. Which service to extract first (lowest coupling)?4603. Communication pattern: REST, gRPC, or event-driven?4614. Database strategy: shared DB initially or database-per-service?4625. Deployment target: Kubernetes, Docker Compose, or serverless?463464Track phases:465- Phase 1: Identify service boundaries, create domain map466- Phase 2: Set up infrastructure (API gateway, CI/CD per service)467- Phase 3: Extract first service (strangler fig pattern)468- Phase 4: Verify with integration tests, extract next service469- Phase N: Decommission monolith470471Each phase = 1 PR with `verify` skill gate.472Use `project-session-manager` skill between phases to preserve context.473Use `using-git-worktrees` skill for parallel service extraction.474475Recommended: Opus 4.7 for conductor/spec planning, Sonnet 4.6 for phase execution.476```477478---479480## Installed Skills Reference481482Before using this reference, refresh it from `.agent/skills/local` and483`.agent/skills/upstream` and prefer local overrides. Key skill groups commonly484available in this oh-my-codex installation:485486**Planning & Architecture:** `plan`, `brainstorming`, `architect-planner`, `planning-methodology`, `planning-with-files`, `ralplan`, `ultrawork`, `ralph`487488**Implementation:** `tdd`, `tdd-workflow`, `build-fix`, `refactor-clean`, `coding-standards`, `backend-patterns`, `frontend-patterns`, `frontend-design`, `api-design`489490**Testing:** `tdd-generator`, `test-gen`, `test-coverage`, `e2e`, `e2e-testing`, `bdd-generator`, `verify`, `verification-loop`491492**Review & Quality:** `code-review`, `security-review`, `aireview`, `quality-check`, `quality-validation`, `requesting-code-review`, `receiving-code-review`493494**Research:** `research`, `deepsearch`, `iterative-retrieval`, `multi-model-research`, `documentation-lookup`495496**Documentation:** `update-docs`, `update-codemaps`, `writer-memory`497498**Debugging:** `systematic-debugging`, `debug-analysis`, `trace`, `log-analyzer`499500**Orchestration:** `team`, `swarm`, `conductor`, `pipeline`, `autopilot`, `ultraqa`501502**Session Management:** `project-session-manager`, `checkpoint`, `strategic-compact`503504**Frontend:** `frontend-ui-ux`, `ui-ux-pro-max`, `frontend-slides`, `web-clone`, `nextjs-turbopack`505506**Infrastructure:** `mcp-setup`, `mcp-server-patterns`, `start-dev`, `release`, `git-master`507508**Skill Tools:** `skill-create`, `skill-development`, `skill-tester`, `skill-quality-analyzer`
Run npx skillmds@latest add materialofair/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, 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 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. 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.
materialofair (@materialofair) published this skill. Their other Agent Skills are listed on their SkillMD profile.