From eacb93c4e5071189bf43d0438c41f0d2296e7804 Mon Sep 17 00:00:00 2001 From: Ethan Munoz Date: Wed, 6 May 2026 00:29:54 +0200 Subject: [PATCH] fix(manage-channels): include canonical SQL queries in SKILL.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The skill's "Assess Current State" step said only "query agent_groups, messaging_groups, ..." without specifying columns. The `register` CLI takes `--assistant-name ""` (mentioned three times in the same SKILL.md), but the schema column is `name`, not `assistant_name` — and the SKILL.md never linked the two. When the agent had to compose a SELECT against `agent_groups` from the SKILL.md vocabulary alone, it extrapolated `--assistant-name` into a column name and produced: SELECT id, folder, assistant_name FROM agent_groups; -> Error: in prepare, no such column: assistant_name Replace the prose pointer with canonical SQL queries that match the real schema. The `name AS assistant_name` alias preserves the familiar term in the agent's output. Verified locally as a drop-in: `/manage-channels` runs clean from end to end with this version, no further inference needed. Closes #2289 --- .claude/skills/manage-channels/SKILL.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.claude/skills/manage-channels/SKILL.md b/.claude/skills/manage-channels/SKILL.md index 9d84d3d..0b348d1 100644 --- a/.claude/skills/manage-channels/SKILL.md +++ b/.claude/skills/manage-channels/SKILL.md @@ -11,7 +11,16 @@ Privilege is a **user-level** concept, not a channel-level one (see `src/db/user ## Assess Current State -Read the central DB (`data/v2.db`) — query `agent_groups`, `messaging_groups`, `messaging_group_agents`, `users`, and `user_roles` tables. Also check `.env` for channel tokens and `src/channels/index.ts` for uncommented imports. +Read the central DB (`data/v2.db`) using these canonical queries (column names match the schema, not the CLI flags — the `register` command's `--assistant-name` is stored in `agent_groups.name`): + +```sql +SELECT id, name AS assistant_name, folder, agent_provider FROM agent_groups; +SELECT id, channel_type, platform_id, name, unknown_sender_policy FROM messaging_groups; +SELECT messaging_group_id, agent_group_id, session_mode, priority FROM messaging_group_agents; +SELECT user_id, role, agent_group_id FROM user_roles ORDER BY role='owner' DESC; +``` + +Also check `.env` for channel tokens and `src/channels/index.ts` for uncommented imports. Categorize channels as: **wired** (has DB entities + messaging_group_agents row), **configured but unwired** (has credentials + barrel import, no DB entities), or **not configured**.