Skip to content

Commit 7d0436b

Browse files
committed
feat(skill): MCP-first backend resolution (Phase 0) + dual op tables
The skill never used the engine's MCP server in real sessions: MCP tool schemas are deferred in Claude Code (need a ToolSearch load before they are callable), the SKILL.md allowed-tools gate excluded both ToolSearch and the mcp__* tools, and every instruction site hardcoded script.py. The model checked "is engine_preflight available?", saw nothing callable, and silently took the CLI fallback every run. - SKILL.md: new mandatory "Phase 0: Engine Backend Resolution" — load the engine tools via ToolSearch (select by id, keyword fallback), announce MCP-mode vs CLI-mode, and forbid script.py for MCP-covered ops while in MCP-mode; allowed-tools now include ToolSearch + mcp__atlas-engine + both plugin-scoped server ids - SKILL.md: "Script Commands Reference" + "Backend operations" merged into one normative dual-column "Engine operations" table (op -> MCP tool -> script.py), plus an explicit script/agent-only table - phases/GENERATE.md, phases/HANDOFF.md: MCP-mode route above every CLI call site, with verified tool parameter names (load_template, validate_prd, calc_tasks, parse_prd, tm_parallel_expand, detect_capabilities, next_task, set_task_status) - install.sh: /atlas alias skill heredoc gets the same allowed-tools superset and a do-not-skip-Phase-0 instruction - skills/*/SKILL.md (9 bundled plugin skills): same allowed-tools additions; go orchestrator gets the deferred-tools ToolSearch note CLI-mode stays first-class for codex/gemini and zero-dependency installs; script.py behavior is unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 1d1b049 commit 7d0436b

13 files changed

Lines changed: 175 additions & 51 deletions

File tree

SKILL.md

Lines changed: 90 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,16 @@ allowed-tools:
1515
- Skill
1616
- AskUserQuestion
1717
- WebSearch
18+
- ToolSearch
19+
- mcp__atlas-engine
20+
- mcp__plugin_prd-taskmaster_go
21+
- mcp__plugin_atlas-go_go
1822
---
1923

2024
# prd-taskmaster — the Atlas engine
2125

22-
Zero-config goal-to-tasks engine. AI handles discovery and content; `script.py` handles mechanics.
26+
Zero-config goal-to-tasks engine. AI handles discovery and content; the engine backend (MCP
27+
server preferred, `script.py` fallback — see Phase 0) handles mechanics.
2328

2429
**Command:** `/atlas` is the canonical invocation (or `/prd-taskmaster`, or just say "I want to
2530
build …"). The full plugin install also exposes phase skills; this standalone skill runs the whole
@@ -38,17 +43,55 @@ CLI/MCP parsing.
3843
Activate: PRD, product requirements, taskmaster, task-driven development, "I want to build X", any goal.
3944
Skip: API docs, test specs, project timelines, PDF creation.
4045

46+
## Phase 0: Engine Backend Resolution (MANDATORY — before any other engine operation)
47+
48+
The engine has two interchangeable backends: the **atlas-engine MCP server** (preferred)
49+
and **script.py** (zero-dependency fallback). Resolve which one this session uses NOW.
50+
Do NOT silently default to script.py.
51+
52+
**Claude Code note — deferred tools:** MCP tools are often *deferred*: their names appear
53+
in a system-reminder list but they are NOT callable until you load their schemas with the
54+
`ToolSearch` tool. "I don't see a callable engine_preflight tool" does NOT mean the server
55+
is absent — it almost always means you have not run ToolSearch yet.
56+
57+
Resolution procedure, in order:
58+
59+
1. If a `ToolSearch` tool exists in your session:
60+
a. `ToolSearch(query="select:mcp__atlas-engine__engine_preflight")`
61+
b. If no match: `ToolSearch(query="+engine preflight atlas", max_results=10)` — this
62+
also catches plugin-scoped ids such as `mcp__plugin_prd-taskmaster_go__engine_preflight`.
63+
c. If a schema loads → **MCP-mode = ON**. Record the prefix (e.g. `mcp__atlas-engine__`).
64+
If both user-scope and plugin-scope match, prefer `mcp__atlas-engine__`.
65+
2. No ToolSearch, but an `engine_preflight` MCP tool is already directly callable →
66+
**MCP-mode = ON** with that prefix.
67+
3. Otherwise → **MCP-mode = OFF** (CLI-mode).
68+
69+
Announce the result before Phase 1, exactly one line:
70+
`Engine backend: MCP (<prefix>*)` or `Engine backend: script.py (CLI fallback)`.
71+
72+
Hard rules for the rest of the run:
73+
74+
- **MCP-mode ON:** every operation in the "Engine operations" table below MUST use its MCP
75+
tool. Running `python3 script.py <cmd>` for an op that has an MCP tool in this session's
76+
prefix is a compliance failure — the only exceptions are ops in the "Script/agent-only"
77+
table and ops whose tool is missing from the resolved prefix (some plugin installs expose
78+
fewer tools — fall back to script.py for just those ops).
79+
- **MCP-mode OFF:** use the script.py commands exactly as documented below. Other harnesses
80+
(codex, gemini) have no ToolSearch and may have no MCP server — CLI-mode is fully
81+
supported and not a degraded experience.
82+
- If an MCP call errors mid-run (server died/disconnected), say so explicitly, flip to
83+
CLI-mode, and continue.
84+
4185
## Phase 1: Zero-Config Preflight
4286

4387
Run preflight and auto-detect everything. Ask zero setup questions.
4488

45-
**MCP (preferred — ONE batched call, no script spam):** if an `engine_preflight`
46-
MCP tool is available in your session (plugin install, or the engine's MCP server
47-
registered), call it once — it covers preflight + taskmaster detection + provider
89+
**MCP-mode (from Phase 0 — ONE batched call, no script spam):** call
90+
`<prefix>engine_preflight` once — it covers preflight + taskmaster detection + provider
4891
configuration + capabilities and returns a `summary` list to present verbatim.
49-
Skip the individual script calls below entirely.
92+
Skip every individual script call below entirely.
5093

51-
**CLI fallback (zero-dependency installs):** one batched subcommand, same result:
94+
**CLI-mode (zero-dependency installs):** one batched subcommand, same result:
5295

5396
```bash
5497
python3 ~/.claude/skills/prd-taskmaster/script.py engine-preflight
@@ -163,50 +206,59 @@ always fully usable on its own.
163206

164207
## Feedback
165208

166-
At debrief time, every executing agent records how the run went. Prefer the MCP
167-
`feedback_submit` tool; fallback is `python3 script.py feedback-add --rating <1-5>
209+
At debrief time, every executing agent records how the run went. MCP-mode:
210+
`<prefix>feedback_submit` / `<prefix>feedback_report`. CLI-mode:
211+
`python3 script.py feedback-add --rating <1-5>
168212
--agent <name> --harness <claude-code|codex|gemini|api|other> --task-ref <id>
169213
--well <text> --failed <text> --suggest <text>`. Feedback is stored in
170214
`.atlas-ai/feedback.jsonl`; summarize it with `python3 script.py feedback-report`.
171215

172-
## Script Commands Reference
216+
## Engine operations
217+
218+
This table is normative — instruction sites reference operations by name. In MCP-mode use
219+
the MCP tool (substitute the Phase-0 prefix); in CLI-mode use the script.py command.
220+
221+
| Operation | MCP tool (MCP-mode) | script.py (CLI-mode / fallback) |
222+
|-----------|---------------------|---------------------------------|
223+
| `engine-preflight` | `engine_preflight` | `engine-preflight` |
224+
| `preflight` | `preflight` | `preflight` |
225+
| `detect-taskmaster` | `detect_taskmaster` | `detect-taskmaster` |
226+
| `backend-detect` | `backend_detect` | `backend-detect` |
227+
| `init` | `init_project` | `init-project` |
228+
| `init-taskmaster` | `init_taskmaster` | `init-taskmaster` |
229+
| `validate-setup` | `validate_setup` | (covered by `engine-preflight`) |
230+
| `detect-capabilities` | `detect_capabilities` | `detect-capabilities` |
231+
| `load-template` | `load_template` | `load-template --type comprehensive\|minimal` |
232+
| `calc-tasks` | `calc_tasks` | `calc-tasks --requirements <count> [--scale solo\|team\|enterprise]` |
233+
| `validate-prd` | `validate_prd` | `validate-prd --input <path>` |
234+
| `backup-prd` | `backup_prd` | `backup-prd --input <path>` |
235+
| `parse-prd` | `parse_prd` | `parse-prd --input <path> --num-tasks N [--tag]` |
236+
| `rate` | `rate_tasks` | `rate [--tag] [--no-research]` |
237+
| `expand` | `expand_tasks` | `expand [--id N ...] [--no-research] [--tag]` |
238+
| `tm-parallel` | `tm_parallel_expand` | `tm-parallel` |
239+
| `next` | `next_task` | `next-task [--tag]` |
240+
| `set-status` | `set_task_status` | `set-status --id <id> --status <status> [--tag]` |
241+
| `fleet-waves` | `compute_fleet_waves` | `fleet-waves` |
242+
| `feedback-add` | `feedback_submit` | `feedback-add --rating <1-5> ...` |
243+
| `feedback-report` | `feedback_report` | `feedback-report` |
244+
245+
Backend behavior is identical through either interface: the `taskmaster` backend wraps native
246+
TaskMaster operations safely (init/parse/rate/expand, including `tm-parallel`); the `native`
247+
backend uses direct API calls or returns `agent_action_required`; `next`/`set-status` are
248+
engine-native under every backend.
249+
250+
## Script/agent-only operations (no MCP tool — always script.py, any mode)
173251

174252
| Command | Purpose |
175253
|---------|---------|
176-
| `engine-preflight` | ONE batched call: preflight + taskmaster + providers + capabilities + summary |
177-
| `preflight` | Detect environment state |
178-
| `detect-taskmaster` | Find MCP or CLI taskmaster |
179-
| `backend-detect` | Detect resolved backend, both backend capabilities, and ai_ops |
180-
| `init-project` | Initialise the resolved backend project state |
181-
| `parse-prd --input <path> --num-tasks N [--tag]` | Parse a PRD through the resolved backend |
182-
| `expand [--id N ...] [--no-research] [--tag]` | Expand selected or all pending tasks through the resolved backend |
183-
| `rate [--tag] [--no-research]` | Rate task complexity through the resolved backend |
184-
| `init-taskmaster` | task-master init with `.mcp.json` protection |
185254
| `configure-providers` | Configure native Claude/Codex + local Perplexity API Free defaults |
186255
| `detect-providers` | Auto-detect AI providers |
187-
| `detect-capabilities` | Scan for available skills/tools; returns tier + recommended mode with reason |
188-
| `load-template --type comprehensive\|minimal` | Load PRD template |
189-
| `calc-tasks --requirements <count> [--scale solo\|team\|enterprise]` | Recommended task count (scale-banded) |
190-
| `validate-prd --input <path>` | Quality checks + placeholder detection |
191-
| `backup-prd --input <path>` | Timestamped backup |
192-
| `validate-tasks [--input <path>]` | Validate manually-authored tasks.json |
256+
| `validate-tasks [--input <path>] [--require-phase-config]` | Validate manually-authored tasks.json |
193257
| `enrich-tasks` | Add phaseConfig metadata to tasks |
194258
| `parallel-plan [--missing-only]` | Emit per-task research packets for parallel subagents |
195259
| `parallel-apply --input <results.json>` | Merge parallel research results atomically |
196260
| `parallel-extract --output <path>` / `parallel-inject --input <path>` | Tagged ⇄ flat tasks bridge |
197-
198-
## Backend operations
199-
200-
This table is normative — instruction sites reference operations by name.
201-
202-
| Operation | Command (both backends) | Notes |
203-
|-----------|--------------------------|-------|
204-
| `init` | `script.py init-project` | `taskmaster` backend wraps native TaskMaster initialization safely; `native` backend uses direct API initialization or returns `agent_action_required`. |
205-
| `parse-prd` | `script.py parse-prd --input <path> --num-tasks N [--tag]` | `taskmaster` backend wraps native TaskMaster PRD parsing; `native` backend uses direct API parsing or returns `agent_action_required`. |
206-
| `rate` | `script.py rate [--tag] [--no-research]` | `taskmaster` backend wraps native TaskMaster complexity/rating; `native` backend uses direct API rating or returns `agent_action_required`. |
207-
| `expand` | `script.py expand [--id N ...] [--no-research] [--tag]` | `taskmaster` backend wraps native TaskMaster expansion, including `tm-parallel` for expand; `native` backend uses direct API expansion or returns `agent_action_required`. |
208-
| `next` | `script.py next-task [--tag]` | Engine-native under every backend; next/set-status are engine-native under every backend. |
209-
| `set-status` | `script.py set-status --id <id> --status <status> [--tag]` | Engine-native under every backend; next/set-status are engine-native under every backend. |
261+
| `economy-report` | Summarize telemetry per (op_class, model) |
210262

211263
## Parallel Research & Complexity
212264

@@ -290,3 +342,4 @@ All commands default `--tag` to `.taskmaster/state.json` currentTag and run from
290342
7. Phase files must be Read explicitly — they are not auto-loaded
291343
8. Native/free provider defaults are enforced by `configure-providers`; do not drift back to paid Anthropic/Perplexity APIs unless native/free routes are unavailable
292344
9. Perplexity API Free research must be normalized through `parallel-apply`; native TaskMaster research is only acceptable when it returns valid structured output and validation passes
345+
10. Phase 0 backend resolution is mandatory — in MCP-mode, script.py is forbidden for any op that has an MCP tool in the resolved prefix

install.sh

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -370,8 +370,18 @@ description: >-
370370
invokes /atlas, says "I want to build", or asks for a PRD / task-driven build.
371371
allowed-tools:
372372
- Read
373-
- Skill
373+
- Write
374+
- Edit
375+
- Grep
376+
- Glob
374377
- Bash
378+
- Skill
379+
- AskUserQuestion
380+
- WebSearch
381+
- ToolSearch
382+
- mcp__atlas-engine
383+
- mcp__plugin_prd-taskmaster_go
384+
- mcp__plugin_atlas-go_go
375385
---
376386
377387
# /atlas — the Atlas engine
@@ -382,8 +392,9 @@ This is a thin alias. Immediately Read and follow the full engine skill:
382392
Read ${SKILL_DIR}/SKILL.md
383393
\`\`\`
384394
385-
Then execute that skill's pipeline (Preflight -> Discovery -> Generate -> Handoff)
386-
exactly as written, carrying over whatever goal or arguments the user provided.
395+
Then execute that skill's pipeline (Backend Resolution -> Preflight -> Discovery ->
396+
Generate -> Handoff) exactly as written, carrying over whatever goal or arguments the
397+
user provided. Do not skip the skill's Phase 0 (engine backend resolution via ToolSearch).
387398
ALIASEOF
388399
ok "Installed /atlas alias skill -> ${ALIAS_DIR}"
389400

phases/GENERATE.md

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
# Phase: Generate & Validate — Spec Creation and Task Parsing
22

3-
## Tool preference (applies to every step below)
3+
## Backend mode (applies to every step below)
44

5-
The engine's deterministic operations are available as MCP tools when ANY engine
6-
server is registered — tool ids look like `mcp__atlas-engine__<name>` (user-scoped
7-
server) or `mcp__plugin_prd-taskmaster_go__<name>` (plugin install). **Always
8-
prefer the MCP tool over the script.py equivalent** (same names: load_template,
9-
validate_prd, calc_tasks, engine_preflight, compute_fleet_waves, ...). The
10-
script.py commands below are the zero-dependency fallback only.
5+
Backend mode was resolved in SKILL.md Phase 0. If you have NOT resolved it (e.g. this
6+
phase file was entered directly), run the Phase 0 procedure now — in Claude Code that
7+
means `ToolSearch(query="select:mcp__atlas-engine__engine_preflight")` (keyword fallback
8+
`ToolSearch(query="+engine preflight atlas", max_results=10)`) BEFORE any bash. Tool ids
9+
look like `mcp__atlas-engine__<name>` (user-scoped server) or
10+
`mcp__plugin_prd-taskmaster_go__<name>` (plugin install). **In MCP-mode, using script.py
11+
for an MCP-covered op is a compliance failure.** The script.py commands below are the
12+
CLI-mode path (zero-dependency installs, codex/gemini harnesses).
1113

1214

1315
## The One Rule
@@ -36,6 +38,8 @@ Decide based on discovery depth:
3638
- **Comprehensive**: 4+ detailed answers, complex project
3739
- **Minimal**: Quick project, thin answers, user wants speed
3840

41+
**MCP-mode**: `<prefix>load_template(type="comprehensive")`
42+
**CLI-mode**:
3943
```bash
4044
python3 ~/.claude/skills/prd-taskmaster/script.py load-template --type comprehensive
4145
```
@@ -74,6 +78,8 @@ Key rule: Every `[placeholder]`, `{{variable}}`, `[TBD]`, `[TODO]` must be repla
7478

7579
## Step 3: Validate Spec Quality
7680

81+
**MCP-mode**: `<prefix>validate_prd(input_path=".taskmaster/docs/prd.md")`
82+
**CLI-mode**:
7783
```bash
7884
python3 ~/.claude/skills/prd-taskmaster/script.py validate-prd --input .taskmaster/docs/prd.md
7985
```
@@ -89,13 +95,19 @@ Returns: `score`, `grade`, `checks`, `warnings`, `placeholders_found`.
8995
## Step 4: Parse Tasks via Backend
9096

9197
Calculate task count:
98+
99+
**MCP-mode**: `<prefix>calc_tasks(requirements_count=<count>)`
100+
**CLI-mode**:
92101
```bash
93102
python3 ~/.claude/skills/prd-taskmaster/script.py calc-tasks --requirements <count>
94103
```
95104

96105
Parse through the normative backend operation:
97106

98107
**backend op parse-prd**:
108+
109+
**MCP-mode**: `<prefix>parse_prd(prd_path=".taskmaster/docs/prd.md", num_tasks=<recommended>)`
110+
**CLI-mode**:
99111
```bash
100112
python3 ~/.claude/skills/prd-taskmaster/script.py parse-prd --input .taskmaster/docs/prd.md --num-tasks <recommended>
101113
```
@@ -186,6 +198,9 @@ free local proxy / no API key /
186198
parallel-plan → N research subagents → parallel-apply
187199
```
188200

201+
In MCP-mode, the NATIVE-PARALLEL path is `<prefix>tm_parallel_expand` (instead of
202+
`script.py tm-parallel`) and serial expansion uses `<prefix>rate_tasks` / `<prefix>expand_tasks`.
203+
189204
This keeps TaskMaster's model-agnostic AI (any configured API does the expansion/research) while
190205
parallelizing it externally. Never run multiple `expand --id` concurrently in ONE directory — the
191206
10s lock-stale window vs 30–120s AI calls is a real race; isolation dirs (tm-parallel) exist for

phases/HANDOFF.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ HANDOFF CHECKLIST:
2020

2121
## Step 1: Detect Capabilities
2222

23+
**MCP-mode** (from SKILL.md Phase 0): `<prefix>detect_capabilities()`
24+
**CLI-mode**:
2325
```bash
2426
python3 ~/.claude/skills/prd-taskmaster/script.py detect-capabilities
2527
```
@@ -107,11 +109,12 @@ Read the project's `./CLAUDE.md`. Append the TaskMaster workflow section if norm
107109
```markdown
108110
## Task Execution Workflow (prd-taskmaster)
109111

110-
When implementing tasks, use backend operations:
111-
1. `script.py next-task` -- get next dependency-ready task
112-
2. `script.py set-status --id <id> --status in-progress` -- mark started
112+
When implementing tasks, use backend operations (MCP tool when the engine MCP server is
113+
available — e.g. `mcp__atlas-engine__next_task` — otherwise script.py):
114+
1. `next` op — MCP `next_task` or `script.py next-task` -- get next dependency-ready task
115+
2. `set-status` op — MCP `set_task_status(id, status="in-progress")` or `script.py set-status --id <id> --status in-progress` -- mark started
113116
3. Implement the task (follow the plan step linked to this task)
114-
4. `script.py set-status --id <id> --status done` -- mark complete
117+
4. `set-status` op — MCP `set_task_status(id, status="done")` or `script.py set-status --id <id> --status done` -- mark complete
115118
5. Update TodoWrite with progress
116119
6. Repeat from step 1
117120

skills/customise-workflow/SKILL.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ allowed-tools:
1717
- Edit
1818
- Bash
1919
- AskUserQuestion
20+
- ToolSearch
21+
- mcp__atlas-engine
22+
- mcp__plugin_prd-taskmaster_go
23+
- mcp__plugin_atlas-go_go
2024
---
2125

2226
# customise-workflow

skills/discover/SKILL.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ allowed-tools:
1313
- Skill
1414
- AskUserQuestion
1515
- Write
16+
- ToolSearch
17+
- mcp__atlas-engine
18+
- mcp__plugin_prd-taskmaster_go
19+
- mcp__plugin_atlas-go_go
1620
---
1721

1822
# Phase 1: Discover

skills/execute-fleet/SKILL.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ allowed-tools:
1010
- Read
1111
- Bash
1212
- Skill
13+
- ToolSearch
14+
- mcp__atlas-engine
15+
- mcp__plugin_prd-taskmaster_go
16+
- mcp__plugin_atlas-go_go
1317
---
1418

1519
# execute-fleet

skills/execute-task/SKILL.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ allowed-tools:
1717
- Bash
1818
- Skill
1919
- Agent
20+
- ToolSearch
21+
- mcp__atlas-engine
22+
- mcp__plugin_prd-taskmaster_go
23+
- mcp__plugin_atlas-go_go
2024
---
2125

2226
# execute-task

skills/expand-tasks/SKILL.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ allowed-tools:
1717
- Glob
1818
- Grep
1919
- AskUserQuestion
20+
- ToolSearch
21+
- mcp__atlas-engine
22+
- mcp__plugin_prd-taskmaster_go
23+
- mcp__plugin_atlas-go_go
2024
---
2125

2226
# Expand Tasks with Research v1.0

skills/generate/SKILL.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ allowed-tools:
1414
- Edit
1515
- Bash
1616
- Skill
17+
- ToolSearch
18+
- mcp__atlas-engine
19+
- mcp__plugin_prd-taskmaster_go
20+
- mcp__plugin_atlas-go_go
1721
---
1822

1923
# Phase 2: Generate

0 commit comments

Comments
 (0)