feat(db): agent_skill table + apply_caveman / apply_artifact_style (SR-1) #880
No reviewers
Labels
No labels
area:agents
area:dashboard
area:database
area:design
area:design-review
area:flows
area:infra
area:meta
area:security
area:sessions
area:webhook
area:workdir
security
type:bug
type:chore
type:meta
type:user-story
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/claude-hooks!880
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "code-lead/869"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
SR-1 foundation for the skills rework — single
agent_skilltable scoped (type/instance) with partial unique indexes, FK toagents(rowid)ON DELETE CASCADE, BEFORE INSERT/UPDATE consistency triggers, and the two boolean columns onagent_typethat gate the caveman / artifact-style appendices.No call sites read from the new table yet; SR-3 backfills, SR-4 swaps the read path, SR-11 drops legacy
skill.Test plan
bun test src/infrastructure/database/agent-skill-store.test.ts— 13 tests passbun run scripts/db-check.ts— agents + tasks okjust sql-layer-check— no rawbun:sqliteoutside infra/databaseCloses #869
SR-1 foundation for the skills rework — single agent_skill table scoped ('type'|'instance') with partial unique indexes, FK to agents(rowid) ON DELETE CASCADE, and BEFORE INSERT/UPDATE triggers that abort when an instance row's agent_type diverges from agents.type. Adds the two boolean columns on agent_type that gate the caveman / artifact-style appendices. The Drizzle store module ships the eight CRUD entry points called out in the AC plus a dropAgentInstanceSkillsForInstance helper that agents-store.deleteAgent now invokes — Bun's WAL leaves rowid-targeted FKs advisory, so the cascade is wired in code (matching the existing agent_token_override / provider-state pattern). No call sites read from the new table yet; SR-3 backfills, SR-4 swaps the read path, SR-11 drops the legacy `skill` table. Closes #869All AC met; CI green across all 5 jobs.
Nit (non-blocking):
apply_cavemanandapply_artifact_styleon the Drizzle schema (schema/agent-type.ts) are missing.notNull(), unlike every other integer-boolean column in that table (penpot_mcp, etc.). Drizzle will type them asnumber | null— SR-4 should guard against null if it reads these without null-checks, or add.notNull()in a follow-up.