diff --git a/frontend/src/views/TaskEditorView.vue b/frontend/src/views/TaskEditorView.vue index dbcab0b..4617777 100644 --- a/frontend/src/views/TaskEditorView.vue +++ b/frontend/src/views/TaskEditorView.vue @@ -579,8 +579,10 @@ useEditorGuards(dirty, save);
diff --git a/plugin/skills/using-scribe/SKILL.md b/plugin/skills/using-scribe/SKILL.md index 2b9b599..9485bd0 100644 --- a/plugin/skills/using-scribe/SKILL.md +++ b/plugin/skills/using-scribe/SKILL.md @@ -30,8 +30,8 @@ This plugin makes Scribe the home for the operator's **rules, recall, and planning** — the jobs Claude's native auto-memory would otherwise do. When the plugin is present, route those jobs to Scribe and **do not also write them to native memory**: codify rules with `create_rule` / `create_project_rule`, -capture durable knowledge as Scribe notes, and keep plans in `kind=plan` tasks — -not in `MEMORY.md` or `CLAUDE.md`. One copy, in Scribe; let any existing local +capture durable knowledge as Scribe notes, and keep plans in Scribe milestones +(via `start_planning`) — not in `MEMORY.md` or `CLAUDE.md`. One copy, in Scribe; let any existing local memory shrink as Scribe takes over. Don't maintain both stores in parallel. Two constraints on *how* that's achieved: @@ -64,9 +64,10 @@ Two constraints on *how* that's achieved: note/rule/task over creating a new one. Search first; revise what's there. 4. **Plans live in Scribe.** For non-trivial work call `start_planning(project_id, - title)` FIRST — the plan body + step checklist live in the `kind=plan` task, - progress goes in work-logs (`add_task_log`). Do not write plans/specs to local - `.md` files. + title)` FIRST — it creates a milestone whose `body` holds the design; each + step is its own task under that milestone (`create_task(milestone_id=...)`), + progress goes in work-logs (`add_task_log`). Read it back with `get_milestone`. + Do not write plans/specs to local `.md` files. 5. **Keep state honest.** Set a task `in_progress` when you start it, `done` the moment it's complete; log progress as you go. diff --git a/plugin/skills/writing-plans/SKILL.md b/plugin/skills/writing-plans/SKILL.md index 36e37e6..8ef8d80 100644 --- a/plugin/skills/writing-plans/SKILL.md +++ b/plugin/skills/writing-plans/SKILL.md @@ -1,46 +1,58 @@ --- name: writing-plans -description: Use before starting any non-trivial or multi-step piece of work — produce a clear plan BEFORE diving in. Triggers when the user asks you to plan, design an approach, scope an effort, or tackle work big enough to need ordered steps. The plan lives in a Scribe kind=plan task (via start_planning), not a local file. +description: Use before starting any non-trivial or multi-step piece of work — produce a clear plan BEFORE diving in. Triggers when the user asks you to plan, design an approach, scope an effort, or tackle work big enough to need ordered steps. The plan lives in a Scribe milestone (via start_planning), not a local file. --- # Writing plans -A plan is **how** you'll execute a chunk of work — the design plus an ordered, -checkable list of steps — written *before* you start, so the approach is -reviewable and the work stays trackable. +A plan is **how** you'll execute a chunk of work — the design plus an ordered +set of steps — written *before* you start, so the approach is reviewable and the +work stays trackable. ## Start the plan in Scribe, not a file For non-trivial work, call **`start_planning(project_id, title)` FIRST** — -before any design or implementation. It creates a `kind=plan` task seeded with a -template and returns the task id plus the project's applicable rules. The plan -lives in that task: edit the body with `update_task`, record progress with -`add_task_log`. **Do not** write plans or specs to local `.md` files — the task -is the record, not a file on disk. +before any design or implementation. It creates a **milestone** (the plan +container) seeded with a design template and returns the milestone id plus the +project's applicable rules. The plan lives in that milestone: + +- The **design/intent** goes in the milestone `body` — edit it with + `update_milestone(milestone_id, body=...)`. +- Each **step** is its own task under the milestone — create it with + `create_task(milestone_id=)` and track it with status + + `add_task_log`. Steps are first-class tasks, **not** checkboxes in the body. +- Read the whole plan back with `get_milestone` (body + its step-tasks). + +**Do not** write plans or specs to local `.md` files — the milestone is the +record, not a file on disk. (The old `kind=plan` task is retired; `start_planning` +no longer creates one.) Before designing from scratch, **recall**: `search` Scribe for a related prior plan or decision. Often the thinking (or half of it) already exists. ## What a good plan contains -- **Goal** — what "done" looks like, and why, in a sentence or two. -- **Approach** — the key design decisions and the trade-offs you chose, briefly. -- **Steps** — an ordered checklist, each step small enough to verify on its own; - note which files/areas each touches. +- **Goal** — what "done" looks like, and why, in a sentence or two (milestone body). +- **Approach** — the key design decisions and the trade-offs you chose, briefly + (milestone body). +- **Steps** — an ordered set of step-tasks under the milestone, each small enough + to verify on its own; note which files/areas each touches. - **Verification** — how you'll know it actually works (a test, CI, an observable behavior), not just "it's written." ## While executing -- Keep the plan **honest**: tick steps as they land; record decisions, findings, - and pivots with `add_task_log` rather than silently rewriting the body. -- If reality diverges from the plan, **update the plan** — one that no longer - matches what you're doing is worse than none. -- Set the plan task `in_progress` when you start and `done` when it's complete. +- Keep the plan **honest**: drive each step-task's status (todo → + in_progress → done) as it lands; record decisions, findings, and pivots with + `add_task_log` on the relevant step rather than silently rewriting the body. +- If reality diverges from the plan, **update the milestone body** — a design + that no longer matches what you're doing is worse than none. Add or re-scope + step-tasks as the work changes. +- Mark the milestone `done` when its steps are complete. ## Match depth to the work -A two-step change deserves a two-line plan; a multi-day effort deserves -milestones and sub-tasks. Don't over-plan the trivial, and don't under-plan -something that will sprawl. The point is a shared, reviewable intent — not -ceremony. +A two-step change deserves a two-line plan; a multi-day effort deserves a +fleshed-out milestone body and several step-tasks. Don't over-plan the trivial, +and don't under-plan something that will sprawl. The point is a shared, +reviewable intent — not ceremony. diff --git a/src/scribe/mcp/tools/tasks.py b/src/scribe/mcp/tools/tasks.py index 629a12c..6264253 100644 --- a/src/scribe/mcp/tools/tasks.py +++ b/src/scribe/mcp/tools/tasks.py @@ -63,9 +63,10 @@ async def get_task(task_id: int) -> dict: """Fetch a single Scribe task by ID. Returns id, title, body, status, priority, tags, project_id, milestone_id, - parent_id, parent_title, due_date, created_at, updated_at. For kind=plan - tasks, the response also includes applicable_rules + subscribed_rulebooks - from the task's project's rulebook subscriptions. + parent_id, parent_title, due_date, created_at, updated_at. For legacy + kind=plan tasks, the response also includes applicable_rules + + subscribed_rulebooks from the task's project's rulebook subscriptions (new + plans are milestones — use get_milestone for those). """ uid = current_user_id() note = await notes_svc.get_note(uid, task_id) @@ -79,6 +80,8 @@ async def get_task(task_id: int) -> dict: parent_title = parent.title data["parent_title"] = parent_title + # Legacy kind=plan tasks predate milestone-as-plan; still surface their + # project's rules on read so the historical plans stay useful. if data.get("task_kind") == "plan" and note.project_id: applicable = await rulebooks_svc.get_applicable_rules( project_id=note.project_id, user_id=uid, @@ -116,15 +119,23 @@ async def create_task( milestone_id: Place within a project milestone (0 = no milestone). parent_id: Make this a sub-task of another task (0 = top-level). tags: List of plain-string tags without # prefix. - kind: 'work' (default), 'plan', or 'issue'. An issue is corrective work — - a problem you fixed or are fixing; record symptom → root cause → fix - in the body. Prefer start_planning to create plans. + kind: 'work' (default) or 'issue'. An issue is corrective work — a + problem you fixed or are fixing; record symptom → root cause → fix + in the body. (Plans are milestones now — call start_planning to begin + a plan; 'plan' is not a valid kind here.) system_ids: Ids of the project's Systems (reusable subsystem/area objects; see list_systems / create_system) to associate this task with. arose_from_id: For an issue, the id of the task/feature it arose from (provenance). 0 = none. """ uid = current_user_id() + if kind == "plan": + raise ValueError( + "kind=plan is retired — a plan is now a milestone. Call " + "start_planning(project_id, title) to begin a plan (it creates the " + "milestone + seeds the design), then create each step as its own " + "task with create_task(milestone_id=)." + ) note = await notes_svc.create_note( uid, title=title, diff --git a/src/scribe/routes/tasks.py b/src/scribe/routes/tasks.py index 95d1afd..9f0ee5f 100644 --- a/src/scribe/routes/tasks.py +++ b/src/scribe/routes/tasks.py @@ -99,6 +99,15 @@ async def create_task_route(): description = data.get("description") tags = data.get("tags", []) + # kind=plan is retired — plans are milestones now (see start_planning). + # The 'plan' enum value stays valid for legacy tasks, but new ones can't + # be created with it through any path. + if data.get("kind") == "plan": + return jsonify({ + "error": "kind=plan is retired — plans are milestones. " + "Use POST /api/tasks/planning to start a plan." + }), 400 + due_date = parse_iso_date(data.get("due_date"), "due_date") if isinstance(due_date, tuple): return due_date diff --git a/tests/test_mcp_tool_tasks.py b/tests/test_mcp_tool_tasks.py index 9aa8f96..7b845d7 100644 --- a/tests/test_mcp_tool_tasks.py +++ b/tests/test_mcp_tool_tasks.py @@ -113,6 +113,16 @@ async def test_create_task_passes_status(): assert mock.call_args.kwargs["status"] == "todo" +@pytest.mark.asyncio +async def test_create_task_rejects_retired_plan_kind(): + """kind=plan is hard-retired — plans are milestones (start_planning).""" + mock = AsyncMock() + with patch("scribe.mcp.tools.tasks.notes_svc.create_note", mock): + with pytest.raises(ValueError, match="kind=plan is retired"): + await create_task(title="x", kind="plan") + assert not mock.called # never reached the create + + @pytest.mark.asyncio async def test_create_task_priority_empty_becomes_none(): fake = _fake_task()