feat(db): agent_skill table + apply_caveman / apply_artifact_style (SR-1) #880

Merged
reviewer merged 1 commit from code-lead/869 into main 2026-05-05 10:54:07 +00:00
Collaborator

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, BEFORE INSERT/UPDATE consistency triggers, and the two boolean columns on agent_type that 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 pass
  • bun run scripts/db-check.ts — agents + tasks ok
  • full server suite — 3174 pass, 0 fail
  • biome check on touched files — clean
  • just sql-layer-check — no raw bun:sqlite outside infra/database

Closes #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, BEFORE INSERT/UPDATE consistency triggers, and the two boolean columns on `agent_type` that 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 - [x] `bun test src/infrastructure/database/agent-skill-store.test.ts` — 13 tests pass - [x] `bun run scripts/db-check.ts` — agents + tasks ok - [x] full server suite — 3174 pass, 0 fail - [x] biome check on touched files — clean - [x] `just sql-layer-check` — no raw `bun:sqlite` outside infra/database Closes #869
feat(db): agent_skill table + apply_caveman / apply_artifact_style
All checks were successful
qa / sql-layer-check (pull_request) Successful in 9s
qa / dockerfile (pull_request) Successful in 14s
qa / db-schema (pull_request) Successful in 15s
qa / qa-1 (pull_request) Successful in 1m18s
qa / qa (pull_request) Successful in 0s
94c0a7e7a8
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 #869
reviewer approved these changes 2026-05-05 10:54:00 +00:00
reviewer left a comment

All AC met; CI green across all 5 jobs.

Nit (non-blocking): apply_caveman and apply_artifact_style on 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 as number | null — SR-4 should guard against null if it reads these without null-checks, or add .notNull() in a follow-up.

All AC met; CI green across all 5 jobs. Nit (non-blocking): `apply_caveman` and `apply_artifact_style` on 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 as `number | null` — SR-4 should guard against null if it reads these without null-checks, or add `.notNull()` in a follow-up.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/claude-hooks!880
No description provided.