AgentSkillsCN

codex-workflow-autopilot

根据已确认的意图,利用行为模式、BMAD 阶段、检查点与 X 阶段验证,生成执行工作流。将构建、修复、评审、调试与文档编写等任务有序拆解为各步骤,并明确退出条件。

SKILL.md
--- frontmatter
name: codex-workflow-autopilot
description: Generate execution workflows from confirmed intent using behavioral modes, BMAD phases, checkpoints, and Phase X verification. Route build, fix, review, debug, and docs tasks into ordered steps with exit criteria.

Workflow Autopilot

Activation

  1. Activate after intent analysis is confirmed.
  2. Activate on explicit $codex-workflow-autopilot.
  3. Activate teaching mode on $teach, "explain", or "walk me through".

Behavioral Modes

SignalsModeBehavior
what if, ideas, optionsbrainstormask clarifying questions and present alternatives, no code
think with me, compare options, help me decidethinking-partnerco-think with tradeoff-first framing and explicit decision criteria
build, create, implementimplementexecute quickly with production-focused output
error, bug, brokendebugreproduce, isolate, root-cause, fix, regression-test
review, audit, checkreviewinspect and report findings by severity
challenge this, poke holes, red team, counterargumentdevils-advocatestress-test assumptions, expose risks, and propose mitigations
explain, teach, learnteachexplain progressively with examples
deploy, release, shipshipprioritize stability and complete checks

Thinking-Partner Trigger

Trigger this mode when user asks for collaborative reasoning rather than immediate implementation.

  • Signal examples: "think with me", "compare options", "which approach is better", "help me decide".
  • Load and apply: references/thinking-partner-mode.md.
  • Ask focused clarifying questions before proposing workflow.
  • Present option matrix with tradeoffs, risks, and recommended path.
  • Convert selected path back to workflow steps and exit criteria.

Devil's Advocate Trigger

Trigger this mode when user asks for challenge, risk probing, or plan hardening.

  • Signal examples: "be critical", "find blind spots", "red team this plan", "play devil's advocate".
  • Load and apply: references/devils-advocate-mode.md.
  • Attack assumptions explicitly and rank findings by impact/likelihood.
  • Provide mitigation actions and clear stop/ship criteria.
  • Return to normal workflow mode only after key risks are addressed or explicitly accepted.

Teaching Mode Trigger

Trigger this mode when user asks to understand project code, not to modify it.

  • Signal examples: $teach, "explain this", "teach me", "how does this work", "walk me through".
  • Load and apply: references/teaching-mode-spec.md.
  • Prefer project-specific explanation over generic language/framework theory.
  • Use scripts/explain_code.py as optional context helper for functions/imports/imported-by mapping.
  • Output in four layers: what, how, why, connections, then gotchas.
  • Keep scope tight to user request (function/file/module) and avoid unnecessary full-file dumps.

Intent to Workflow

IntentStepsExit Criteria
buildanalyze -> plan -> implement -> test -> docs -> gatetests pass, docs checked, gate pass
fixreproduce -> isolate -> root-cause -> fix -> regression-test -> docs -> gateroot cause identified, regression test pass, gate pass
reviewinspect -> categorize findings -> recommend actionsfindings documented with severity
debugreproduce -> hypotheses -> verify/eliminate -> fix -> regression-test -> gateverified fix with evidence, gate pass
docsscope change -> update docs -> verify links/accuracy -> gatedocs updated and verified

BMAD for Complex Requests

Use BMAD when intent analysis marks complexity: complex.

Phase 1: Analysis (no code)

  • confirm requirements and constraints
  • inspect existing patterns
  • capture key decisions

Phase 2: Planning (no code)

  • create plan via $codex-plan-writer
  • define task-level input/output/verify

Checkpoint: wait for explicit user approval before Phase 3.

Phase 3: Solutioning (no code)

  • finalize architecture and data flow decisions
  • identify cross-file impacts

Phase 4: Implementation (code)

  • implement task by task
  • run tests/docs as workflow requires

Phase X: Verification (always last)

  1. Run $codex-execution-quality-gate.
  2. If gate fails, fix blockers and rerun.
  3. Do not declare completion before gate decision.

Reference Files

  • references/thinking-partner-mode.md: use only when collaborative option analysis is requested.
  • references/devils-advocate-mode.md: use only when explicit challenge/risk probing is requested.
  • references/teaching-mode-spec.md: use when user asks for code walkthrough, explanation, or teaching.

Helper Script

  • scripts/explain_code.py:
    • Windows: python "$env:USERPROFILE\.codex\skills\codex-workflow-autopilot\scripts\explain_code.py" --project-root <path> --file <relative-or-absolute-file>
    • macOS/Linux: python "$HOME/.codex/skills/codex-workflow-autopilot/scripts/explain_code.py" --project-root <path> --file <relative-or-absolute-file>

Overrides

  • "skip test": remove test step and warn quality confidence is reduced.
  • "no docs": remove docs step and warn maintainability confidence is reduced.
  • "just do it": default to build workflow and still show brief step plan.
  • "skip plan": allow for simple scope; for complex scope warn and reconfirm.

Scope Heuristic

  • small: 1-3 files, single concern
  • medium: 4-10 files, multiple concerns
  • large: 10+ files or architectural impact

Output Contract

Return fenced JSON in conversation:

json
{
  "mode": "brainstorm | thinking-partner | implement | debug | review | devils-advocate | teach | ship",
  "workflow_type": "build | fix | review | debug | docs",
  "steps": ["step1", "step2"],
  "exit_criteria": ["criterion1"],
  "estimated_scope": "small | medium | large",
  "phase": "analysis | planning | solutioning | implementation | verification"
}

Execution remains sequential for MVP.