validate-app-db-schema
FreeNo executable scriptsNot checkedValidate that ~/.copilot/data.db has the required schema for session hierarchy (workspace_parent_links, workspaces, sessions tables and columns). Runs an…
by rajbos★ 127 GitHub starsAbout this skill
Validate App DB Schema Skill
Validates that the Copilot app's ~/.copilot/data.db still exposes the tables and columns that the extension's session hierarchy feature depends on.
Background
The session hierarchy feature reads parent/child workspace relationships from data.db — a private Copilot app database that is not part of any public API. Its schema can change without notice when the app is updated.
This skill:
- Checks that the required tables and columns exist
- Runs an actual data query (today's parent/child links) to confirm reads work end-to-end
- Reports a clear PASS / FAIL with details so CI or a periodic workflow can surface regressions early
What We Depend On
| Table | Required columns |
|---|---|
workspace_parent_links |
child_workspace_id, parent_workspace_id, creator_session_id, created_at |
workspaces |
id, session_id, name, updated_at |
sessions |
id, title, created_at, updated_at |
persistent_projects |
session_id (a Copilot app Project's coordinator session) |
persistent_project_assignments |
coordinator_session_id, child_session_id, child_workspace_id |
The join that the extension uses (simplified):
SELECT cw.session_id, cw.name, pw.session_id, pw.name
FROM workspace_parent_links l
JOIN workspaces cw ON cw.id = l.child_workspace_id
JOIN workspaces pw ON pw.id = l.parent_workspace_id
WHERE cw.session_id IN (...)
OR pw.session_id IN (...)
Copilot app Projects are read separately (older data.db files lack these tables), linking a coordinator session to the sessions it assigned work to:
SELECT COALESCE(a.child_session_id, cw.session_id), COALESCE(cw.name, cs.title),
a.coordinator_session_id, ps.title
FROM persistent_project_assignments a
JOIN persistent_projects pp ON pp.session_id = a.coordinator_session_id
LEFT JOIN workspaces cw ON cw.id = a.child_workspace_id
LEFT JOIN sessions cs ON cs.id = COALESCE(a.child_session_id, cw.session_id)
LEFT JOIN sessions ps ON ps.id = a.coordinator_session_id
Usage
# Basic validation — exits 0 on pass, 1 on fail
node .github/skills/validate-app-db-schema/validate-schema.js
# Output as JSON (for automated processing)
node .github/skills/validate-app-db-schema/validate-schema.js --json
# Show help
node .github/skills/validate-app-db-schema/validate-schema.js --help
Integration
Add to a periodic GitHub Actions workflow or run manually after a Copilot app update. Example:
- name: Validate data.db schema
run: node .github/skills/validate-app-db-schema/validate-schema.js --json
Implementation Details
The script reads data.db using sql.js (pure WASM — no native SQLite binaries required).
It performs three checks:
- File exists:
~/.copilot/data.dbis present - Schema check:
PRAGMA table_info(table_name)confirms all required columns exist - Live query: Runs the actual JOIN query used by the extension against the last 24h of data
Related Code
vscode-extension/src/copilotAppData.ts— the module that reads data.db at runtimesrc/types.ts—SessionHierarchyNode,SessionRelationRef,SessionFileDetailsvscode-extension/src/extension.ts—enrichSessionHierarchy()method
Install validate-app-db-schema in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
Allowed tools
Tools this skill is permitted to call.
No restriction — this skill can use any tool.
FAQ
What does the validate-app-db-schema skill do?
Validate that ~/.copilot/data.db has the required schema for session hierarchy (workspace_parent_links, workspaces, sessions tables and columns). Runs an actual today's-data query so schema regressions are caught early. Use when data.db schema changes may have broken hierarchy enrichment, or on a periodic schedule to detect breaking changes.
How do I install the validate-app-db-schema skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the validate-app-db-schema skill run scripts?
No, this skill is instructions only (SKILL.md) with no executable scripts.
Related skills
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
by Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
by Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
by Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
by Anthropic