一键导入
codex-master-instructions
Use as the top-priority baseline for Codex request classification, coding quality, dependency awareness, and completion checks.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use as the top-priority baseline for Codex request classification, coding quality, dependency awareness, and completion checks.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use for project memory, decisions, handoffs, genome, knowledge index, changelog, and patterns that must persist across sessions.
Use for frontend, backend, mobile, debugging, security, or specialized engineering work that needs focused domain references and strict boundaries.
Use for prototype, MVP, fullstack feature, from-scratch feature, or multi-domain work that needs a SPEC.md before planning or implementation. Do not use for tiny one-file edits.
Use when code changes may require documentation updates; maps git diff to candidate docs without auto-editing documentation.
Use before completion, PR, deploy, handoff, or when verifying code changes. Runs advisory or blocking checks and reports evidence.
Use when the task involves reading, creating, or editing `.docx` documents, especially when formatting or layout fidelity matters; prefer `python-docx` plus the bundled `scripts/render_docx.py` for visual checks.
| name | codex-master-instructions |
| description | Use as the top-priority baseline for Codex request classification, coding quality, dependency awareness, and completion checks. |
| load_priority | always |
P0 rules: classify request type -> apply engineering rules -> check dependencies before edit -> run quality gate before completion -> reply in user's language. Scripts: run --help first, treat as black-box.
Priority: P0. These rules override lower-priority skill instructions.
P0: codex-master-instructions
P1: codex-domain-specialist references
P2: other skill instructions
If rules conflict, follow the higher-priority rule.
Before clarifying, exploring, editing, or answering any workflow-like request, check the request against:
If a skill or workflow clearly applies, load and use the smallest matching skill set before acting. Do not skip a relevant skill because the task "looks simple". Do not bulk-load unrelated skills either; the correct behavior is minimum sufficient discipline, not maximum context.
If uncertain, state the chosen routing briefly and continue with the safest matching workflow.
Workflow-rich aliases such as $plan, $debug, $create, $prototype, $review, $deploy, and $handoff live in the Workflow Aliases table below.
| Alias | Full Command | Skill |
|---|---|---|
$gate | $codex-execution-quality-gate | codex-execution-quality-gate |
$intent | $codex-intent-context-analyzer | codex-intent-context-analyzer |
$route | $codex-workflow-autopilot | codex-workflow-autopilot |
$brainstorm | brainstorm mode | codex-workflow-autopilot |
$think | $codex-logical-decision-layer | codex-logical-decision-layer |
$decide | $codex-logical-decision-layer | codex-logical-decision-layer |
$hook | runtime_hook.py | codex-runtime-hook |
$preflight | runtime_hook.py | codex-runtime-hook |
$health | check_pack_health.py | .system |
$init-profile | init_profile.py | codex-runtime-hook |
$memory | $codex-project-memory | codex-project-memory |
$knowledge | build_knowledge_index.py | codex-project-memory |
$rigor | $codex-reasoning-rigor | codex-reasoning-rigor |
$doc | $codex-document-writer | codex-document-writer |
$report | $codex-document-writer | codex-document-writer |
$write | $codex-document-writer | codex-document-writer |
$role-docs | $codex-role-docs | codex-role-docs |
$init-docs | init_role_docs.py | codex-role-docs |
$check-docs | check_role_docs.py | codex-role-docs |
$spec | init_spec.py / check_spec.py | codex-spec-driven-development |
$design | $codex-design-system | codex-design-system |
$design-md | $codex-design-md | codex-design-md |
$genome | $codex-genome | codex-project-memory |
$doctor | $codex-doctor | codex-execution-quality-gate |
$check | auto_gate.py --mode quick | codex-execution-quality-gate |
$check-full | auto_gate.py --mode full | codex-execution-quality-gate |
$check-deploy | auto_gate.py --mode deploy | codex-execution-quality-gate |
$install-hooks | install_hooks.py | codex-execution-quality-gate |
$install-ci | install_ci_gate.py | codex-execution-quality-gate |
$commit | auto_commit.py | codex-git-autopilot |
$guard | $output-guard | codex-execution-quality-gate |
$editorial | $editorial-review | codex-execution-quality-gate |
$review-feedback | receiving code review feedback | codex-subagent-execution |
$tdd | $codex-test-driven-development | codex-test-driven-development |
$red-green | $codex-test-driven-development | codex-test-driven-development |
$root-cause | $codex-systematic-debugging | codex-systematic-debugging |
$trace | $codex-systematic-debugging | codex-systematic-debugging |
$sdd | $codex-subagent-execution | codex-subagent-execution |
$dispatch | $codex-subagent-execution | codex-subagent-execution |
$worktree | $codex-git-worktrees | codex-git-worktrees |
$isolate | $codex-git-worktrees | codex-git-worktrees |
$finish | $codex-branch-finisher | codex-branch-finisher |
$finish-branch | $codex-branch-finisher | codex-branch-finisher |
$verify | $codex-verification-discipline | codex-verification-discipline |
$evidence | $codex-verification-discipline | codex-verification-discipline |
When codex-intent-context-analyzer returns suggested_agent, load the matching .agents/<agent-name>.md file before deeper routing.
| Agent | Primary Domain |
|---|---|
frontend-specialist | frontend UI, styling, accessibility, and client state |
backend-specialist | API, services, middleware, and persistence boundaries |
security-auditor | security review, hardening, and release-blocking risk |
debugger | reproduction, root cause, and regression-safe fixes |
test-engineer | tests, fixtures, verification scope, and regression coverage |
devops-engineer | CI/CD, deployment safety, and release automation |
planner | intent clarification, planning, and task decomposition |
scrum-master | Scrum ceremonies, coordination, and delivery handoffs |
Rules:
.agents/ does not exist or .agents/<agent-name>.md is missing, fall back to the previous routing path through codex-domain-specialist.file_ownership patterns, recommend a handoff to the matching agent and do not edit that file under the wrong agent context.Workflow aliases are shortcuts. They run alongside the legacy triggers and do not replace $codex-plan-writer, $codex-workflow-autopilot, or other existing commands.
| Alias | File | Equivalent |
|---|---|---|
$plan | .workflows/plan.md | $codex-plan-writer + BMAD Phase 1-2 |
$debug | .workflows/debug.md | $codex-systematic-debugging + 4-phase root cause |
$create | .workflows/create.md | workflow-create.md + TDD |
$prototype | .workflows/prototype.md | $spec + $plan + role docs + full gate |
$review | .workflows/review.md | workflow-review.md + output-guard + editorial |
$deploy | .workflows/deploy.md | workflow-deploy.md + full gate |
$handoff | .workflows/handoff.md | workflow-handoff.md + session summary |
Rules:
.workflows/<name>.md file and follow its steps.Before acting, classify the request:
| Type | Signals | Action |
|---|---|---|
| question | explain, what is, how does | answer directly, no code edit flow |
| survey | analyze repo, list files, overview | inspect and report, do not modify files |
| simple-code | fix/add/change in small scope | analyze intent, implement with TDD ($tdd), run gate |
| complex-code | build/create/refactor multi-step | full flow: intent, plan ($plan), isolate ($worktree), implement with TDD, gate |
| prototype | MVP, fullstack prototype, from scratch, build whole app | run $hook -> $init-profile if needed -> $genome/$init-docs -> $spec -> $plan -> implement -> $check-full |
| debug | error, bug, broken, not working | systematic debugging ($root-cause): 4-phase root cause → fix → regression test |
| review | review, audit, check quality | inspect, findings by severity, recommendations |
| document | draft, rewrite, report, memo, guide, soạn tài liệu, viết báo cáo | load codex-document-writer, choose document structure, then run editorial review when quality matters |
If the user explicitly asks for deeper thinking, less generic output, stronger specificity, or repo-grounded reasoning, activate codex-reasoning-rigor or $rigor alongside the normal workflow.
If the user asks to compare multiple directions, find the best path, avoid shallow answers, or reason from multiple angles, activate codex-logical-decision-layer or $think and provide a compact decision surface instead of hidden chain-of-thought.
If the user asks for professional documents, reports, memos, guides, or clearer wording, activate codex-document-writer or $doc alongside the normal workflow.
Before acting on any code-change request:
$hook (runtime_hook.py) once to detect domains, suggested agent, and missing FE/BE/DevOps/QA readiness artifacts..codex/context/genome.md exists in the project root.genome.md exists, suggest: "This project has [N] files. Run $genome ($codex-genome) to generate a project context map for better accuracy.".codex/profile.json is missing for a medium/large project, suggest $init-profile so future sessions route with fewer guesses..codex/knowledge/index.json is missing after genome or role docs exist, suggest $knowledge to make tacit knowledge visible.$spec before $plan and implementation.For install, sync, global verification, project preflight, role-doc initialization, boundary checks, gate selection, hooks, CI, and troubleshooting, use .system/OPERATION_RUNBOOK.md.
If the user asks whether the pack is installed correctly or behaving consistently, run $health:
python "<SKILLS_ROOT>/.system/scripts/check_pack_health.py" --skills-root "<SKILLS_ROOT>" --global-root "<GLOBAL_SKILLS_ROOT>" --format text
After completing a code change task, offer to commit using $commit / auto_commit.py.
Only commit files directly related to the current task. Use a dry run first if uncertain.
For complex-code and refactor requests:
Every complex task goes through this process. "Simple" projects are where unexamined assumptions cause the most wasted work. The design can be short, but you MUST present it and get approval.
For each file you modify:
Iron Law: NO COMPLETION CLAIMS WITHOUT FRESH VERIFICATION EVIDENCE.
Before saying work is complete, you MUST:
test, lint, build, gate)Stop immediately if you catch yourself saying "should work now", "I'm confident", "looks correct", "done", or "fixed" without fresh verification output in the current message.
For projects with hooks installed, gate enforcement is automatic. For projects without hooks, the AI must self-enforce the quality gate.
| Claim | Requires | NOT Sufficient |
|---|---|---|
| Tests pass | Test command output: 0 failures | Previous run, "should pass" |
| Linter clean | Linter output: 0 errors | Partial check |
| Bug fixed | Reproduction test passes | "Code changed, assumed fixed" |
| Gate passes | run_gate.py output: gate_passed: true | "I ran it earlier" |
-> over smart arrows if rendering safety is uncertain.Quyết định, Bằng chứng, Hiện trạng, Rủi ro, and Bước tiếp theo.references/debugging-and-recovery.md: anti-rationalization, error recovery, systematic debugging, and gate circuit-breaker rules.references/scope-escalation.md: complexity-to-scope mapping and epic-mode escalation.references/workflow-cross-reference.md: workflow/script crosswalks, two-stage review, and workflow references.skills/.system/manifest.json: pack structure, load order, agents, and workflow aliases.skills/.system/REGISTRY.md for full script paths.Task type -> Code change?
|- Yes -> What kind?
| |- New feature -> TDD ($tdd) + pre_commit_check + smart_test_selector + predict_impact
| |- Bug fix -> systematic debugging ($root-cause) + TDD + pre_commit_check + smart_test_selector
| |- Refactor -> TDD (keep green) + tech_debt_scan + pre_commit_check
| `- UI change -> ux_audit + accessibility_check + pre_commit_check
|
|- Complex implementation? -> worktree ($worktree) + subagent execution ($sdd)
|
|- Deploy/ship? -> run: security_scan + lighthouse_audit + playwright_runner
|
|- Review/audit? -> run: quality_trend + suggest_improvements + tech_debt_scan
|
`- No code -> skip quality gate
--help before invoking any helper script.references/condition-based-waiting.md: summary; canonical version in codex-systematic-debugging/references/.references/defense-in-depth.md: summary; canonical version in codex-systematic-debugging/references/.references/root-cause-tracing.md: summary; canonical version in codex-systematic-debugging/references/.references/debugging-and-recovery.md: anti-rationalization defense, failure handling, debugging order, and circuit-breaker escalation.references/scope-escalation.md: complexity mapping, blast-radius thresholds, and epic-mode handling.references/workflow-cross-reference.md: workflow/script cross-reference table, staged review protocol, and workflow references.references/script-commands.mdreferences/output-schemas.md| Skill | Activates On | Purpose |
|---|---|---|
codex-test-driven-development | $tdd, $red-green | RED-GREEN-REFACTOR enforcement for all code changes |
codex-systematic-debugging | $root-cause, $trace | 4-phase root cause debugging for all bugs |
codex-subagent-execution | $sdd, $dispatch | Fresh subagent per task + 2-stage review |
codex-git-worktrees | $worktree, $isolate | Isolated workspaces for complex implementations |
codex-verification-discipline | $verify, $evidence | Evidence before claims — no "should work" without proof |
codex-branch-finisher | $finish, $finish-branch | Structured 4-option completion workflow |