feat(agents): skill library + setup wizard seeding (SR-6, #874) #889
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!889
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/874-skill-wizard"
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?
Summary
Implements issue #874: shipped skill templates from
skills/*.md, wizard step to seedagent_skill+ appendix flags for a new agent type.Changes
/agents/skills/library—{ name, body }[], in-memory cache populated on first read./api/agent-types/:name/skills/wizard-seed— body{ checked: string[] }; upserts type-scoped rows withdesign-*→ base names; setsapply_artifact_style/apply_cavemanfromartifact-style/cavemanin the list.@claude-hooks/shared:effectiveSkillRowName,defaultCheckedSkillFiles(role defaults; caveman off)./agents/:type/setup— grouped checklist, preview drawer, link from add-agent-type success panel.library-endpoint.test.ts,wizard-skill-seeding.test.ts.How to verify
/agents/<new-type>/setupafter creating a type, toggle skills, save; confirm rows under type skills and flags in DB/UI.GET /agents/skills/libraryreturns all markdown templates.Closes #874
- GET /agents/skills/library returns cached {name, body}[] from skills/*.md - POST /api/agent-types/:name/skills/wizard-seed upserts agent_skill + appendix flags - Shared defaultCheckedSkillFiles + effectiveSkillRowName in @claude-hooks/shared - Web /agents/$type/setup route with checklist, preview drawer, link from add-type wizard - Tests: library-endpoint.test.ts, wizard-skill-seeding.test.ts Co-authored-by: Cursor <cursoragent@cursor.com>- skill-library: only swallow ENOENT from readdir; other errors propagate instead of permanently caching an empty library. Individual readFile calls now skip ENOENT (TOCTOU) and rethrow other errors. Parallelize reads with Promise.all. - agent-skill-store: add seedWizardSkills() wrapping upserts + flag update in a single SQLite transaction to prevent partial writes. Document why setAgentTypeAppendixFlags stays on raw getDb().run() (Drizzle bun-sqlite .run() returns void, changes not accessible). - agent-skill-wizard-seed: replace loop + separate flag call with seedWizardSkills() for atomic execution. - setup route: replace bare `as { role?: string }` cast on unknown resolved field with a proper runtime narrowing chain. - tests: add stem-absent-from-library → 400 and malformed-body → 400 cases to wizard-skill-seeding.test.ts. Co-authored-by: Cursor <cursoragent@cursor.com>