ワンクリックで
query-switchboard-kanban
Query kanban state using direct SQL access to kanban.db
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Query kanban state using direct SQL access to kanban.db
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
When planning, flag uncertain assumptions and supply a ready-to-run web-research prompt to confirm them.
Local Switchboard management console — drive the board when the VS Code extension is running
Implement with high accuracy and self-review (invest effort up front to minimize rework)
Reconcile and restructure a feature's subtasks — improve each, then merge/delete/rewrite/split to make the set coherent
Deep planning, dependency checks, and adversarial review
Cloud-VM planning mode — plan first, do not auto-code in a remote VM
| name | query-switchboard-kanban |
| description | Query kanban state using direct SQL access to kanban.db |
| allowed-tools | Bash |
| user-invokable | false |
Query kanban board state using direct SQL access to the kanban database. This skill is READ-ONLY — execution agents must never use SQL UPDATE/DELETE/INSERT on the kanban database.
.switchboard/workspace-id (two lines: line 1 = workspace ID, line 2 = database path)sqlite3 CLI (pre-installed on macOS)The kanban board auto-exports its current state to a markdown file on every change. For simple reads, use this instead of SQL:
read_file <workspace_root>/.switchboard/kanban-board.md
Use SQL queries only when you need filtering, aggregation, or specific plan lookups that the markdown file doesn't support.
# Resolve the Switchboard control plane from the nearest ANCESTOR directory that
# contains it — never trust the current working directory. This matters because
# sqlite3 SILENTLY CREATES an empty database when handed a path that doesn't
# exist; a wrong cwd would otherwise leave a stray 0-byte kanban.db behind.
SB_ROOT="$PWD"
while [ "$SB_ROOT" != "/" ] && [ ! -f "$SB_ROOT/.switchboard/workspace-id" ]; do
SB_ROOT=$(dirname "$SB_ROOT")
done
WSID_FILE="$SB_ROOT/.switchboard/workspace-id"
WORKSPACE_ID=$(sed -n '1p' "$WSID_FILE" 2>/dev/null)
DB_PATH=$(sed -n '2p' "$WSID_FILE" 2>/dev/null)
# Fallback if line 2 (DB path) is empty — old-format workspace-id file.
[ -z "$DB_PATH" ] && DB_PATH="$SB_ROOT/.switchboard/kanban.db"
# Guard: refuse to continue if the DB is missing, rather than querying (and thus
# creating) a phantom empty database somewhere it should never exist.
if [ ! -f "$DB_PATH" ]; then
echo "ERROR: kanban DB not found at '$DB_PATH'" >&2
echo "Run this from the workspace root, or fix line 2 of .switchboard/workspace-id." >&2
exit 1
fi
038bffef-9842-4574-96a1-69a43a280b3c)Always query with
sqlite3 -readonly "$DB_PATH" "<sql>". This skill only reads.-readonlyprevents accidental writes and is a second guard against sqlite3 fabricating an empty database if the path is ever wrong.
SELECT plan_id, session_id, topic, kanban_column, status, complexity
FROM plans
WHERE workspace_id = '<workspace_id>'
AND status = 'active'
AND kanban_column = '<column_name>'
ORDER BY updated_at DESC;
Valid columns: CREATED, BACKLOG, PLAN REVIEWED, CONTEXT GATHERER, LEAD CODED, CODER CODED, CODE REVIEWED, CODED, COMPLETED
SELECT plan_id, session_id, topic, kanban_column, dependencies
FROM plans
WHERE workspace_id = '<workspace_id>'
AND status = 'active'
AND kanban_column IN ('CREATED', 'BACKLOG', 'PLAN REVIEWED')
ORDER BY updated_at DESC;
SELECT *
FROM plans
WHERE session_id = '<session_id>'
LIMIT 1;
SELECT *
FROM plans
WHERE workspace_id = '<workspace_id>'
AND status = 'active'
ORDER BY kanban_column, updated_at DESC;
# Resolve the control-plane root from the nearest ancestor (see note above) so a
# wrong cwd can't make sqlite3 fabricate an empty DB.
SB_ROOT="$PWD"
while [ "$SB_ROOT" != "/" ] && [ ! -f "$SB_ROOT/.switchboard/workspace-id" ]; do
SB_ROOT=$(dirname "$SB_ROOT")
done
WORKSPACE_ID=$(sed -n '1p' "$SB_ROOT/.switchboard/workspace-id" 2>/dev/null)
DB_PATH=$(sed -n '2p' "$SB_ROOT/.switchboard/workspace-id" 2>/dev/null)
[ -z "$DB_PATH" ] && DB_PATH="$SB_ROOT/.switchboard/kanban.db"
[ -f "$DB_PATH" ] || { echo "ERROR: kanban DB not found at '$DB_PATH'" >&2; exit 1; }
# Get plans in BACKLOG column — READ-ONLY (this skill never writes).
sqlite3 -readonly "$DB_PATH" "SELECT plan_id, session_id, topic, kanban_column FROM plans WHERE workspace_id = '$WORKSPACE_ID' AND status = 'active' AND kanban_column = 'BACKLOG' ORDER BY updated_at DESC;"
| Column | Type | Description |
|---|---|---|
| plan_id | TEXT | Primary key |
| session_id | TEXT UNIQUE | Session identifier |
| topic | TEXT | Plan title |
| plan_file | TEXT | Path to plan markdown file |
| kanban_column | TEXT | Current column |
| status | TEXT | 'active', 'archived', 'completed', 'deleted' |
| complexity | TEXT | Complexity score (1-10 or 'Unknown') |
| tags | TEXT | Comma-separated tags |
| dependencies | TEXT | Dependency description |
| repo_scope | TEXT | Repository scope |
| workspace_id | TEXT | Workspace identifier |
| created_at | TEXT | ISO timestamp |
| updated_at | TEXT | ISO timestamp |
| last_action | TEXT | Last action description |
| source_type | TEXT | 'local', 'brain', etc. |
| brain_source_path | TEXT | Original brain file path |
| mirror_path | TEXT | Mirrored file path |
| routed_to | TEXT | Target agent |
| dispatched_agent | TEXT | Agent that executed |
| dispatched_ide | TEXT | IDE used |
| clickup_task_id | TEXT | ClickUp task ID |
| linear_issue_id | TEXT | Linear issue ID |
| worktree_id | INTEGER | Associated worktree ID |
| worktree_status | TEXT | Worktree status ('none', 'active', 'merged', 'deleted') |
| is_feature | INTEGER | 1 if this plan is a feature, 0 otherwise |
| feature_id | TEXT | Parent feature plan_id if this is a subtask |
| workspace_name | TEXT | Human-readable name of the workspace |
| project_id | INTEGER | Foreign key matching projects.id |
| Column | Type | Description |
|---|---|---|
| id | INTEGER | Primary key (autoincrement) |
| name | TEXT | Project name |
| workspace_id | TEXT | Workspace identifier |
| created_at | TEXT | ISO timestamp |
| Column | Type | Description |
|---|---|---|
| key | TEXT PRIMARY KEY | Configuration key |
| value | TEXT | Configuration value |
Key: workspace_id stores the workspace identifier.
For ready-made query templates on workspace names, projects, and features, see the query-kanban-plans skill.