用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/mitchellfyi/dex --skill dxplan命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Orchestrate the full Dex ticket lifecycle from planning through PR completion.
Run independent full-scope Dex review waves until the selected risk tier's consecutive clean-pass gate succeeds.
Execute the approved implementation plan with TDD discipline and completeness verification.
正在显示 SKILL.md
| name | dxplan |
| description | Create an implementation plan from a ticket or user request after gathering project context. |
Create an implementation plan from a ticket or user request.
When running under dx Phase 1, write the Phase 1 started marker before
gathering context:
source "${DEX_DIR:-$HOME/work/dex}/lib/common.sh" || exit 1
touch "$(dx_phase_started_file "${DEX_SESSION_ID:-$(dx_session_id)}" 1)"
This marker tells the Stop hook that the actual dxplan workflow is running.
Do not skip it when DEX_SESSION_ID is present.
Phase 0 (Setup) already renamed the branch, assigned the ticket, pushed the branch, and moved status to In Progress before Phase 1 began. Do not redo those steps here; only flag missing setup back to the user if you notice it.
Use the integrations configured in dex.md § Integrations. Skip any that are "not configured".
Ticket tracker:
Design tool (if configured and ticket references design URLs):
Error monitoring (if configured and ticket relates to a bug):
Related work:
git log --oneline -20AGENTS.md, CLAUDE.md, or README.md for each area affected..dex/memory/index.md exists, read it and load only memory entries
whose scope matches the ticket, affected paths, or planning phase. Treat
memory as context to verify, not proof.Understanding check — before drafting the plan, answer these five questions (to yourself):
If you cannot answer all five confidently, gather more context.
Do not accept the requested implementation shape at face value. The user owns the desired outcome; your job is to test whether the first apparent solution is the best way to reach it in this codebase.
For every non-trivial ticket, run this challenge pass before defining the target state:
If online research tools are unavailable, say so in the plan and rely on local docs, dependency source, installed package metadata, and codebase precedent. Do not invent best-practice claims without a source.
Bar: if you cannot answer with 100% confidence from the ticket, codebase, or related docs, ask the user. Do not silently make decisions on the user's behalf — even when the decision seems obvious to you. The user's domain context, deadlines, downstream coordination, and prior decisions are invisible from inside the codebase.
Before defining the target state, list every:
For each one, ask: "Could I be wrong about this?" If your confidence is below 100%, surface it to the user.
How to ask:
AskUserQuestion tool to batch related clarifying questions. If the UI/tool limits each batch (for example, 3 questions), that is only a per-call limit, not a total planning limit.Acceptable to skip asking only when:
Always ask when the unknown affects: scope, contract (types, schemas, APIs), naming of public symbols, behaviour the user can observe, performance budgets, security posture, or visible UX.
After the user answers, refine the plan. If new unknowns surface, ask again. Iterate until you can articulate every plan decision as either "the user said X", "the docs/code prove X", "the user explicitly deferred X", or "this is universally safe / fully reversible during implementation". Do not stop at an arbitrary question count, because the goal is not to ask a small number of questions; the goal is to remove unresolved assumptions. Do not present the final plan until every material assumption has been answered, explicitly deferred by the user, resolved from authoritative context, or proven fully reversible during implementation. Residual assumptions that survive this loop must be listed verbatim in Step 6 alongside the plan.
Before drafting task lists, explicitly describe the end state:
npm test -- --grep 'auth middleware' passes"src/config.ts exports AuthConfig type"{\"status\":\"ok\"}"grep -r 'TODO' src/ returns no matches"The plan is then the ordered steps transforming current state into this target. Work backward: what must be true last? What must be true before that? Continue until you reach the current state.
This step exists because plans naturally construct backward from a target. Making the target explicit and validated prevents a common failure: a well-structured plan aimed at the wrong outcome.
For non-trivial tickets (more than a config change, typo fix, or single-file edit), present 2-3 approaches before detailing the chosen one. These options must come from Step 2.3's challenge pass, not from generic "small/medium/large" templates if those labels do not fit the actual work:
| Approach | Description | Pros | Cons |
|---|---|---|---|
| Minimal | Smallest change that meets requirements | Fast, low risk, easy to review | May need follow-up work |
| Balanced | Clean implementation following existing patterns | Maintainable, idiomatic | Takes longer |
| Comprehensive | Full solution with edge cases, optimisations, extensibility | Complete, future-proof | Largest scope, longest review |
Present the approaches briefly (2-3 sentences each), then recommend one with reasoning. The recommendation must cite both local fit (existing paths, patterns, or constraints) and any external source that materially shaped the decision. For trivial tickets, skip this and go straight to the task list.
Research mandate (non-trivial tickets): before finalizing the approach, search for common pitfalls related to the chosen technology or pattern. Check: official documentation, similar implementations in the codebase, known issues in dependencies you'll use. If the best practice has changed recently or depends on a current library/framework version, verify it online or from installed package docs before relying on it.
prompts/review-risk-assessment.md) and tells the implementer
where to concentrate care:
Before presenting the plan, verify it against these quality gates:
If any gate fails, fix the plan before proceeding.
TaskCreate for each work item in the plan.Present the plan and stop for user approval by default.
Before presenting, invoke the humanizer skill on the user-facing plan text. Preserve all technical identifiers, commands, paths, and task structure exactly.
Include:
If the previous step ended with no answered questions, double-check Step 2.4 — a non-trivial change with zero assumptions usually means assumptions were made silently.
When running in plan mode (e.g., via dx Phase 1 or dxloop), present the plan via ExitPlanMode. The user approves or rejects through the plan mode UI.
Do not begin implementation until the user approves the plan unless the active
lifecycle records a reasoned plan.approval waiver. A waiver means the plan
was not human-approved: preserve that distinction in the phase outcome and do
not write the normal approval marker or claim approval.
When running under terminal dx Phase 1, approval is the handoff signal to the Stop hook. For headless runs started by dx run, if DEX_HEADLESS_RUN=1 and the run spec has workflow.requires_plan_approval: false, the run spec is the approval source; complete the same plan quality checks before continuing.
If this Phase 1 plan came from a freeform dx "<task>" request rather than an
existing ticket id, run this gate after ExitPlanMode is approved and before
writing the Phase 1 ready marker.
First, check .dex/dex.md § Integrations:
not configured, skip this gate and continue.DEX_HEADLESS_RUN=1), skip interactive write-back
unless the run spec explicitly asks for tracker ticket creation.Ask the user which path they want:
When creating tracker items:
.dex/dex.md § Integrations.humanizer skill to every ticket title/body before creating it.
Preserve file paths, commands, acceptance criteria, task numbering, risk
labels, and verification commands exactly.dx <ticket> lifecycle
and include scope, dependencies, affected files, risk level, and verification
commands.gh issue create. Reference the parent
issue in each child body. Use existing labels only; do not create labels.After write-back:
source "${DEX_DIR:-$HOME/work/dex}/lib/common.sh" || exit 1
SID="${DEX_SESSION_ID:-$(dx_session_id)}"
dx_meta_write "$SID" "tracker_key=<KEY-OR-URL>" "ticket_number=<NUMBER-IF-GITHUB>"
git branch -m "$(git rev-parse --abbrev-ref HEAD)" "<tracker-branch-name>"
git push -u origin "<tracker-branch-name>"
dx_meta_write "$SID" "current_branch=<tracker-branch-name>"
Do not write the Phase 1 ready marker until this gate is complete or explicitly skipped by the user.
Before writing the plan summary, invoke the humanizer skill on the draft copy. Preserve task numbering, file paths, commands, ticket IDs, and acceptance criteria exactly.
Add the plan summary to the existing or newly selected ticket via the configured tracker. If no tracker is configured, skip — the plan exists in the conversation and task list.
After ExitPlanMode is approved, or after the headless run spec authorizes plan
execution, complete the tracker intake gate and ticket update steps above when
they apply. Before writing the ready marker, save the approved requirements for
the independent Phase 3 reviewers. Write a version 1 JSON object to
dx_review_criteria_file with exactly these fields:
{
"version": 1,
"source": "approved-plan",
"objectives": ["<one approved outcome per one-line string>"],
"acceptance_criteria": ["<every approved criterion, without dropping constraints>"],
"verification_requirements": ["<each concrete command or observable verification requirement>"]
}
Use "headless-run-spec" as source only when a headless run spec authorized
the plan without interactive approval. Keep each array non-empty. Copy the
approved plan faithfully: do not add requirements, omit edge cases, use
placeholders, or include implementation notes that were not approved. Write via
a temporary file and atomic mv, then validate the artifact before marking the
phase ready:
source "${DEX_DIR:-$HOME/work/dex}/lib/common.sh" || exit 1
SESSION_ID="${DEX_SESSION_ID:-$(dx_session_id)}"
CRITERIA_FILE="$(dx_review_criteria_file "$SESSION_ID")"
dx_review_criteria_valid "$CRITERIA_FILE" || exit 1
touch "$(dx_phase_ready_file "$SESSION_ID" 1)"
On the first Stop after the ready marker exists, the lifecycle controller seals the canonical criteria hash as approval revision 1. A later replacement cannot advance until the user approves it and Phase 2 explicitly rotates that seal.
Then print only a brief confirmation if needed and stop once so the hook can audit the plan and inject Phase 2 in the same Claude session. Do not tell the user to run /dximplement, do not ask whether to continue, and do not wait for another user prompt.
dx "<task>" requests with a configured tracker, the user
chooses whether the approved plan becomes tracker work before implementation
starts.