feat(agents): skill library + setup wizard seeding (SR-6, #874) #889

Merged
charles merged 2 commits from feat/874-skill-wizard into main 2026-05-05 22:21:33 +00:00
Collaborator

Summary

Implements issue #874: shipped skill templates from skills/*.md, wizard step to seed agent_skill + appendix flags for a new agent type.

Changes

  • GET /agents/skills/library{ name, body }[], in-memory cache populated on first read.
  • POST /api/agent-types/:name/skills/wizard-seed — body { checked: string[] }; upserts type-scoped rows with design-* → base names; sets apply_artifact_style / apply_caveman from artifact-style / caveman in the list.
  • @claude-hooks/shared: effectiveSkillRowName, defaultCheckedSkillFiles (role defaults; caveman off).
  • Web: /agents/:type/setup — grouped checklist, preview drawer, link from add-agent-type success panel.
  • Tests: library-endpoint.test.ts, wizard-skill-seeding.test.ts.

How to verify

  • Open /agents/<new-type>/setup after creating a type, toggle skills, save; confirm rows under type skills and flags in DB/UI.
  • GET /agents/skills/library returns all markdown templates.

Closes #874

## Summary Implements [issue #874](https://forge.jacquin.app/charles/claude-hooks/issues/874): shipped skill templates from `skills/*.md`, wizard step to seed `agent_skill` + appendix flags for a new agent type. ## Changes - **GET `/agents/skills/library`** — `{ name, body }[]`, in-memory cache populated on first read. - **POST `/api/agent-types/:name/skills/wizard-seed`** — body `{ checked: string[] }`; upserts type-scoped rows with `design-*` → base names; sets `apply_artifact_style` / `apply_caveman` from `artifact-style` / `caveman` in the list. - **`@claude-hooks/shared`**: `effectiveSkillRowName`, `defaultCheckedSkillFiles` (role defaults; caveman off). - **Web**: `/agents/:type/setup` — grouped checklist, preview drawer, link from add-agent-type success panel. - **Tests**: `library-endpoint.test.ts`, `wizard-skill-seeding.test.ts`. ## How to verify - Open `/agents/<new-type>/setup` after creating a type, toggle skills, save; confirm rows under type skills and flags in DB/UI. - `GET /agents/skills/library` returns all markdown templates. Closes #874
feat(agents): skill library + setup wizard seeding (SR-6, #874)
All checks were successful
qa / dockerfile (pull_request) Successful in 7s
qa / sql-layer-check (pull_request) Successful in 7s
qa / db-schema (pull_request) Successful in 28s
qa / qa-1 (pull_request) Successful in 47s
qa / qa (pull_request) Successful in 0s
26dd9dd04a
- 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>
fix(sr-6): address PR #889 review findings
All checks were successful
qa / dockerfile (pull_request) Successful in 7s
qa / sql-layer-check (pull_request) Successful in 7s
qa / db-schema (pull_request) Successful in 34s
qa / qa-1 (pull_request) Successful in 45s
qa / qa (pull_request) Successful in 0s
5755e2a73d
- 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>
charles deleted branch feat/874-skill-wizard 2026-05-05 22:21:34 +00:00
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!889
No description provided.