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