$npx -y skills add anombyte93/prd-taskmaster --skill setupPhase 0 of the prd-taskmaster pipeline. Resolves the active backend, initializes the project, configures the provider stack when the TaskMaster backend is active (DETECT-FIRST — never overwrite a working user config), and verifies the AI pipeline. Autonomous: zero user questions
| 1 | # Phase 0: Setup |
| 2 | |
| 3 | Declarative phase skill. Invoked by the prd-taskmaster orchestrator when |
| 4 | `current_phase` is null or `SETUP`. Never called directly by a user. |
| 5 | |
| 6 | ## Entry gate |
| 7 | |
| 8 | 1. Call `mcp__plugin_prd_go__check_gate(phase="SETUP", evidence={})` for diagnostics. |
| 9 | |
| 10 | `check_gate` is an EXIT gate: it verifies you have the evidence to *advance*, not to |
| 11 | *enter*. On first entry you have no evidence yet (Step 4 below produces |
| 12 | `validate_setup.ready=true`), so a `gate_passed: false` result here is EXPECTED — the |
| 13 | state machine's legal transitions (`None → SETUP`) already guarantee only legal entry. |
| 14 | |
| 15 | - **First entry** (no evidence yet): note the result and continue with the Procedure. |
| 16 | - **Re-entry**: if the gate reports violations, report them and stop — it protects |
| 17 | against re-running a completed phase or skipping ahead. |
| 18 | |
| 19 | Enforce the gate when you ADVANCE (after the procedure), not on entry. |
| 20 | |
| 21 | ## Procedure (5 steps, abort on hard failure) |
| 22 | |
| 23 | ### Step 1: Backend detection |
| 24 | |
| 25 | Run backend detection: |
| 26 | |
| 27 | ```bash |
| 28 | python3 script.py backend-detect |
| 29 | ``` |
| 30 | |
| 31 | The native engine is the sole generator and needs no external binary — a |
| 32 | keyless host CLI (`claude` / `codex` / `gemini`) on PATH, or a provider API key, |
| 33 | is sufficient (see Chunk 7's `atlas setup` wizard). The `task-master` binary is |
| 34 | no longer required or supported; `backend-detect` reports its presence purely as |
| 35 | informational. Continue with the resolved (native) backend. |
| 36 | |
| 37 | ### Step 2: Project init |
| 38 | |
| 39 | Check whether the current project has a `.taskmaster/` directory (the engine |
| 40 | still reads/writes the `.taskmaster/` file format for tasks and config). |
| 41 | |
| 42 | If missing, run backend op `init`: |
| 43 | |
| 44 | ```bash |
| 45 | python3 script.py init-project |
| 46 | ``` |
| 47 | |
| 48 | This initialises the native project state and the `.taskmaster/` file format. If |
| 49 | `.taskmaster/` is present, continue. |
| 50 | |
| 51 | ### Step 2.5: Customisation bootstrap (REQUIRED — closes execute-task deadlock) |
| 52 | |
| 53 | `execute-task` requires `.atlas-ai/customizations/system-prompt-template.md` |
| 54 | to exist as a precondition (its Entry gate halts otherwise). It cannot |
| 55 | create the file from inside the loop — the failure mode is a hard halt with |
| 56 | no recovery path. |
| 57 | |
| 58 | This step ensures the file exists BEFORE execute-task ever runs: |
| 59 | |
| 60 | ```bash |
| 61 | PLUGIN_SKEL="${CLAUDE_PLUGIN_ROOT}/skel/customizations" |
| 62 | mkdir -p .atlas-ai/customizations |
| 63 | if [ ! -f .atlas-ai/customizations/system-prompt-template.md ]; then |
| 64 | if [ -d "$PLUGIN_SKEL" ]; then |
| 65 | cp -n "$PLUGIN_SKEL"/*.md .atlas-ai/customizations/ # -n: no-clobber, copy starter pack |
| 66 | else |
| 67 | : > .atlas-ai/customizations/system-prompt-template.md # empty is fine per execute-task Entry gate |
| 68 | fi |
| 69 | fi |
| 70 | ``` |
| 71 | |
| 72 | The starter pack (`domain-vocabulary.md`, `system-prompt-template.md`, |
| 73 | `task-enrichment-rules.md`, `verification-preferences.md`) is editable — |
| 74 | users tune them to project-specific terminology. Empty is acceptable; the |
| 75 | file simply must exist. |
| 76 | |
| 77 | Also scaffold `.atlas-ai/ship-check.py` if it doesn't already exist: |
| 78 | |
| 79 | ```bash |
| 80 | if [ ! -f .atlas-ai/ship-check.py ] && [ -f "${CLAUDE_PLUGIN_ROOT}/skel/ship-check.py" ]; then |
| 81 | cp "${CLAUDE_PLUGIN_ROOT}/skel/ship-check.py" .atlas-ai/ship-check.py |
| 82 | chmod +x .atlas-ai/ship-check.py |
| 83 | fi |
| 84 | ``` |
| 85 | |
| 86 | (Codified 2026-06-04 — yesterday's run halted at execute-task Entry |
| 87 | because `system-prompt-template.md` was missing; the file had to be |
| 88 | manually `touch`-ed from outside the loop.) |
| 89 | |
| 90 | ### Step 3: Provider configuration — DETECT-FIRST |
| 91 | |
| 92 | When the TaskMaster backend is active, **read `task-master models` output BEFORE |
| 93 | setting anything.** This is the load-bearing rule. A working user config must |
| 94 | NOT be overwritten silently. When the native backend is active, provider |
| 95 | configuration is handled by the resolved backend and this TaskMaster-specific |
| 96 | step is informational only. |
| 97 | |
| 98 | | `task-master models` output | Action | |
| 99 | |---|---| |
| 100 | | Main / Research / Fallback all populated with a supported provider | SKIP — go to Step 4. | |
| 101 | | Main set, Research/Fallback empty | Partial mutate — fill the empty roles only. | |
| 102 | | All three empty (fresh install) | Full configure — use the default stack below. | |
| 103 | | Provider flagged unsupported / deprecated | Ask the user before mutating. | |
| 104 | |
| 105 | **Why DETECT-FIRST:** v4 dogfood (2026-04-13, LEARNING #9) caught the skill |
| 106 | overwriting a working `gemini-cli / gemini-3-pro-preview` config because the |
| 107 | procedure wasn't branch-aware. Detect first, mutate only the empty slots. |
| 108 | |
| 109 | **Default stack (fresh install only):** |
| 110 | |
| 111 | ```bash |
| 112 | task |