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---56# project-router78This skill is Safa’s **canonical project management + context switching control plane**.910Core 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.1415It 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 adapter2021## Project bundle layout (v1)2223The `.project/` bundle is the **project-local** context nucleus. The canonical PM DB points at these bundles.2425Inside a project root:26- `.project/project.json` — structured manifest27- `.project/PROJECT.md` — living brief28- `.project/targets.json` — target definitions (commands)29- `.project/index/artifacts.json` — artifact index30- `.project/history/plans/*.json` — plans31- `.project/history/applies/*.json` — apply receipts3233## CLI quick start3435### Baseline / existing commands3637From anywhere inside a repo/workspace:38- `project detect`39- `project context`40- `project target list`41- `project target run <name>`4243Initialize a bundle (dry-run plan + apply):44- `project init` (prints plan)45- `project apply <planId>`4647Artifacts:48- `project artifact add <path|url> [--tags a,b,c]` (plan + apply)4950### Canonical PM + context switching (new)5152> Note: these verbs are the target UX. Implementations should remain idempotent and safe.5354Project registration:55- `project pm project add <slug> --name "..." --root <path>`56- `project pm project list`5758Task 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>`6263Context switching:64- `project pm switch <slug>`65 - prints pinned docs + top targets + active tasks66- `project pm focus <taskId>`67 - loads task-linked files/artifacts and updates the task activity log6869Trello sync:70- `project pm trello sync [--project <slug>]`71 - ensures the single "Safa — PM" Trello board exists72 - ensures lists exist (Inbox/Next/Doing/Blocked/Waiting/Done)73 - upserts cards for canonical tasks74 - moves cards to match status75 - applies priority labels (P0..P3)7677## MCP quick start (via mcporter)7879- `mcporter list mcp-project-router --schema --timeout 120000 --json`8081Examples: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"}'`8889## Trello backend conventions9091Single-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 ```yaml98 --- pm ---99 task_id: <stable-id>100 project: <slug>101 status: <status>102 priority: P0|P1|P2|P3103 ---104 ```105- Labels (priority, color-coded):106 - `P0` = red107 - `P1` = orange108 - `P2` = yellow109 - `P3` = blue110111## Canonical PM storage (SQLite)112113Recommended DB location (in workspace):114- `/home/safa/clawd/data/pm/pm.sqlite`115116Minimum 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)121122## Safety123124- 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`.