SR-3 M1 migration — copy legacy skill rows + skill_overrides_json into agent_skill #871
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#871
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
User story
As an operator, I want my existing scope-ladder skills (global / agent_type / instance) and any
skill_overrides_jsonrewrites to be copied into the newagent_skilltable at first boot after the cutover, so that I keep every customisation I made without re-doing it through the wizard.Acceptance criteria
Migration script
skill:scope='global'→ INSERT one(scope='type', agent_type, name, body)row peragent_typelisted inagent_type.scope='agent_type'→ INSERT one(scope='type', agent_type, name, body)row directly.scope='instance'→ INSERT(scope='instance', agent_type, instance_id, name, body)withagent_typelooked up viaJOIN agents ON agents.id = instance_id. Trigger does not fire because the join supplies the right value.scope='builtin'→ ignored (already dead per DOB-1).agent_type.skill_overrides_jsonnon-null entry:(base, override)pair, look up the override body from whichever source currently fires (DB ladder, falling back to FSskills/<override>.md), then INSERT(scope='type', agent_type, name=base, body)intoagent_skill. Base name wins; renamed body content goes in.designer { "implement": "design-implement" }→ row(scope='type', agent_type='designer', name='implement', body=<body of design-implement.md>).agent_typerow, setapply_artifact_style = 1(current behaviour is unconditional-on).agent_typerow's legacycaveman.enabledsetting (resolver-derived fromagent_type_config):enabled = true→ setapply_caveman = 1.caveman.labelsnon-empty → emit a one-shot warning to amigration_logtable (or stderr if no such table) noting per-label gating dropped.Drift detection
(name, type)where the legacy row body differs from the matchingskills/<name>.mdbody on disk. Operator's hint: commit the live edits back to the file before adding new types.Tests
scope='global'rows + 3 agent_types → expect 3 type rows per legacy global row.skill_overrides_json(designer remap) → expect renamed-base rows with the override body.agent_typeset correctly.Out of scope
skilltable orskill_overrides_jsoncolumn (covered in SR-11).References
specs/skills-rework.md§Migration, §M1.apps/server/src/infrastructure/database/agent-type-config.ts::resolveSkill.apps/server/src/http/webhook-routing.ts::skillForAgent.🦵 @charles kicked the queue — re-running implement on @code-lead.