project-router
This skill is Safa’s canonical project management + context switching control plane.
Core idea:
- Canonical PM is local + queryable (SQLite): projects, tasks, context packs.
- Trello is a tracking backend/UI: cards mirror canonical tasks; lists mirror status; labels mirror priority.
- The “killer feature” is context switching: load the right docs/code/index for a project/task quickly and deterministically.
It provides:
- CLI:
project <verb> ...
- MCP server:
mcp-project-router (tools mirror the CLI)
- Per-project bundle stored in
.project/ (brief, targets, artifact index)
- A canonical task store (SQLite) + Trello sync adapter
Project bundle layout (v1)
The .project/ bundle is the project-local context nucleus. The canonical PM DB points at these bundles.
Inside a project root:
.project/project.json — structured manifest
.project/PROJECT.md — living brief
.project/targets.json — target definitions (commands)
.project/index/artifacts.json — artifact index
.project/history/plans/*.json — plans
.project/history/applies/*.json — apply receipts
CLI quick start
Baseline / existing commands
From anywhere inside a repo/workspace:
project detect
project context
project target list
project target run <name>
Initialize a bundle (dry-run plan + apply):
project init (prints plan)
project apply <planId>
Artifacts:
project artifact add <path|url> [--tags a,b,c] (plan + apply)
Canonical PM + context switching (new)
Note: these verbs are the target UX. Implementations should remain idempotent and safe.
Project registration:
project pm project add <slug> --name "..." --root <path>
project pm project list
Task management:
project pm task add <slug> "<title>" --priority P0|P1|P2|P3 [--status inbox|next|doing|blocked|waiting|done]
project pm task list [--project <slug>] [--status ...]
project pm task set-status <taskId> <status>
Context switching:
project pm switch <slug>
- prints pinned docs + top targets + active tasks
project pm focus <taskId>
- loads task-linked files/artifacts and updates the task activity log
Trello sync:
project pm trello sync [--project <slug>]
- ensures the single "Safa — PM" Trello board exists
- ensures lists exist (Inbox/Next/Doing/Blocked/Waiting/Done)
- upserts cards for canonical tasks
- moves cards to match status
- applies priority labels (P0..P3)
MCP quick start (via mcporter)
mcporter list mcp-project-router --schema --timeout 120000 --json
Examples:
- Detect:
mcporter call --server mcp-project-router --tool project_detect --args '{}'
- Read context:
mcporter call --server mcp-project-router --tool project_context_read --args '{}'
- Run target:
mcporter call --server mcp-project-router --tool project_target_run --args '{"target":"test"}'
Trello backend conventions
Single-board setup:
Canonical PM storage (SQLite)
Recommended DB location (in workspace):
/home/safa/clawd/data/pm/pm.sqlite
Minimum tables (v0):
projects(slug PRIMARY KEY, name, root_path, created_at, updated_at)
tasks(task_id PRIMARY KEY, project_slug, title, status, priority, created_at, updated_at)
task_refs(task_id, kind, ref) (file paths / urls / artifacts)
external_refs(task_id, system, external_id, meta_json) (e.g., Trello card_id/list_id)
Safety
- Project bundle writes remain plan/apply.
- Canonical PM writes should be idempotent and auditable (timestamps + activity log).
- Trello sync should be safe to re-run repeatedly (upsert by
task_id marker; never duplicate cards).
project_target_run executes commands defined in .project/targets.json.
1---2name: project-router3description: Terminal-first project bootstrapper and workspace context manager. Use when the user asks for /project-style workflows: detect current project, read project context/brief, run standardized targets (build/test/lint/deploy), init a .project bundle via plan/apply, manage artifacts, or expose these actions via MCP server mcp-project-router and CLI project.4---5
6# project-router
7
8This skill is Safa’s **canonical project management + context switching control plane**.
9
10Core idea:
11- **Canonical PM is local + queryable (SQLite)**: projects, tasks, context packs.
12- **Trello is a tracking backend/UI**: cards mirror canonical tasks; lists mirror status; labels mirror priority.
13- The “killer feature” is **context switching**: load the right docs/code/index for a project/task quickly and deterministically.
14
15It provides:
16- CLI: `project <verb> ...`
17- MCP server: `mcp-project-router` (tools mirror the CLI)
18- Per-project bundle stored in `.project/` (brief, targets, artifact index)
19- A canonical task store (SQLite) + Trello sync adapter
20
21## Project bundle layout (v1)
22
23The `.project/` bundle is the **project-local** context nucleus. The canonical PM DB points at these bundles.
24
25Inside a project root:
26- `.project/project.json` — structured manifest
27- `.project/PROJECT.md` — living brief
28- `.project/targets.json` — target definitions (commands)
29- `.project/index/artifacts.json` — artifact index
30- `.project/history/plans/*.json` — plans
31- `.project/history/applies/*.json` — apply receipts
32
33## CLI quick start
34
35### Baseline / existing commands
36
37From anywhere inside a repo/workspace:
38- `project detect`
39- `project context`
40- `project target list`
41- `project target run <name>`
42
43Initialize a bundle (dry-run plan + apply):
44- `project init` (prints plan)
45- `project apply <planId>`
46
47Artifacts:
48- `project artifact add <path|url> [--tags a,b,c]` (plan + apply)
49
50### Canonical PM + context switching (new)
51
52> Note: these verbs are the target UX. Implementations should remain idempotent and safe.
53
54Project registration:
55- `project pm project add <slug> --name "..." --root <path>`
56- `project pm project list`
57
58Task management:
59- `project pm task add <slug> "<title>" --priority P0|P1|P2|P3 [--status inbox|next|doing|blocked|waiting|done]`
60- `project pm task list [--project <slug>] [--status ...]`
61- `project pm task set-status <taskId> <status>`
62
63Context switching:
64- `project pm switch <slug>`
65 - prints pinned docs + top targets + active tasks
66- `project pm focus <taskId>`
67 - loads task-linked files/artifacts and updates the task activity log
68
69Trello sync:
70- `project pm trello sync [--project <slug>]`
71 - ensures the single "Safa — PM" Trello board exists
72 - ensures lists exist (Inbox/Next/Doing/Blocked/Waiting/Done)
73 - upserts cards for canonical tasks
74 - moves cards to match status
75 - applies priority labels (P0..P3)
76
77## MCP quick start (via mcporter)
78
79- `mcporter list mcp-project-router --schema --timeout 120000 --json`
80
81Examples:
82- Detect:
83 - `mcporter call --server mcp-project-router --tool project_detect --args '{}'`
84- Read context:
85 - `mcporter call --server mcp-project-router --tool project_context_read --args '{}'`
86- Run target:
87 - `mcporter call --server mcp-project-router --tool project_target_run --args '{"target":"test"}'`
88
89## Trello backend conventions
90
91Single-board setup:
92- Board name: `Safa — PM` (or configurable)
93- Lists == canonical statuses:
94 - `Inbox`, `Next`, `Doing`, `Blocked`, `Waiting`, `Done`
95- Card title: `[<project_slug>] <task_title>`
96- Card description begins with a machine block for idempotency:
97 ```yaml
98 --- pm ---
99 task_id: <stable-id>
100 project: <slug>
101 status: <status>
102 priority: P0|P1|P2|P3
103 ---
104 ```
105- Labels (priority, color-coded):
106 - `P0` = red
107 - `P1` = orange
108 - `P2` = yellow
109 - `P3` = blue
110
111## Canonical PM storage (SQLite)
112
113Recommended DB location (in workspace):
114- `/home/safa/clawd/data/pm/pm.sqlite`
115
116Minimum tables (v0):
117- `projects(slug PRIMARY KEY, name, root_path, created_at, updated_at)`
118- `tasks(task_id PRIMARY KEY, project_slug, title, status, priority, created_at, updated_at)`
119- `task_refs(task_id, kind, ref)` (file paths / urls / artifacts)
120- `external_refs(task_id, system, external_id, meta_json)` (e.g., Trello card_id/list_id)
121
122## Safety
123
124- Project bundle writes remain **plan/apply**.
125- Canonical PM writes should be idempotent and auditable (timestamps + activity log).
126- Trello sync should be safe to re-run repeatedly (upsert by `task_id` marker; never duplicate cards).
127- `project_target_run` executes commands defined in `.project/targets.json`.