SR-6 GET /agents/skills/library + agent-creation wizard "Skills" step #874

Closed
opened 2026-05-05 10:29:39 +00:00 by claude-desktop · 0 comments
Collaborator

User story

As an operator, I want the agent-creation wizard to show me a checklist of every skills/*.md file (with role-appropriate defaults pre-checked), and to seed agent_skill rows from the ones I confirm, so that creating a new agent_type starts with a working set of skills with no manual SQL.

Acceptance criteria

Library endpoint

  • New GET /agents/skills/library returns { name: string, body: string }[] reading skills/*.md from disk. Server-side cache (in-memory, populated once).
  • Used by: the wizard step (this ticket), the "Reset to factory" action (SR-8), the "Add skill" picker (SR-8), the migration drift-check (SR-3).

Wizard step

  • New step on the agent-creation surface (/agents/<type>/setup or equivalent) titled "Skills".
  • Renders a checklist of every skills/*.md filename, grouped by recommended-for-role:
    • code / code-lead / design roles → pre-check implement, address-review, rebase, fix-ci (and breakdown for code-lead).
    • review / design-review roles → pre-check review.
    • All roles → pre-check artifact-style.
    • All roles → leave caveman unchecked by default; copy explains the trade-off and recommends opting in.
    • designer type → pre-check the design-*-named files in place of their generic siblings: design-implement instead of implement, design-review instead of review, design-address-review instead of address-review, design-breakdown instead of breakdown.
  • Each row has a "Preview" affordance that opens the source .md in a read-only modal.
  • On confirm:
    • For each checked filename <name>.md, INSERT into agent_skill (scope='type', agent_type, name, body, updated_at) with body copied verbatim from the file. The inserted row name matches the agent_type's effective skill name — for designer, the row inserted from design-implement.md has name='implement' (not name='design-implement'), so the dispatch path looks up the right body without any rewrite indirection.
    • Set agent_type.apply_artifact_style = 1 if artifact-style was checked (default), else = 0.
    • Set agent_type.apply_caveman from the checkbox (recommended-off).

Tests

  • wizard-skill-seeding.test.ts — designer pre-checks translate to plain implement / review rows with design bodies; default bool values applied; non-designer types get plain bodies.
  • library-endpoint.test.ts — endpoint returns every file in skills/; cache survives a re-call.

Out of scope

  • CRUD-after-creation surface (covered in SR-7 / SR-8).
  • Removing the legacy /settings/agent-config Skills tab (covered in SR-10).
  • Custom skill names not present in skills/*.md — wizard does not expose them; CRUD UI handles custom skills post-creation.

References

  • Spec: specs/skills-rework.md §Wizard flow, §API surface.
  • Existing wizard component: apps/web/src/routes/onboarding.tsx, apps/web/src/routes/agents.$type.index.tsx.
  • Existing loadSkill cache: apps/server/src/domain/analytics/skill-loader.ts.
  • Depends on SR-1.
## User story As an operator, I want the agent-creation wizard to show me a checklist of every `skills/*.md` file (with role-appropriate defaults pre-checked), and to seed `agent_skill` rows from the ones I confirm, so that creating a new agent_type starts with a working set of skills with no manual SQL. ## Acceptance criteria ### Library endpoint - [ ] New `GET /agents/skills/library` returns `{ name: string, body: string }[]` reading `skills/*.md` from disk. Server-side cache (in-memory, populated once). - [ ] Used by: the wizard step (this ticket), the "Reset to factory" action (SR-8), the "Add skill" picker (SR-8), the migration drift-check (SR-3). ### Wizard step - [ ] New step on the agent-creation surface (`/agents/<type>/setup` or equivalent) titled "Skills". - [ ] Renders a checklist of every `skills/*.md` filename, grouped by recommended-for-role: - `code` / `code-lead` / `design` roles → pre-check `implement`, `address-review`, `rebase`, `fix-ci` (and `breakdown` for code-lead). - `review` / `design-review` roles → pre-check `review`. - All roles → pre-check `artifact-style`. - All roles → leave `caveman` unchecked by default; copy explains the trade-off and recommends opting in. - `designer` type → pre-check the `design-*`-named files in place of their generic siblings: `design-implement` instead of `implement`, `design-review` instead of `review`, `design-address-review` instead of `address-review`, `design-breakdown` instead of `breakdown`. - [ ] Each row has a "Preview" affordance that opens the source `.md` in a read-only modal. - [ ] On confirm: - For each checked filename `<name>.md`, INSERT into `agent_skill (scope='type', agent_type, name, body, updated_at)` with body copied verbatim from the file. The inserted row name matches the `agent_type`'s effective skill name — for `designer`, the row inserted from `design-implement.md` has `name='implement'` (not `name='design-implement'`), so the dispatch path looks up the right body without any rewrite indirection. - Set `agent_type.apply_artifact_style = 1` if `artifact-style` was checked (default), else `= 0`. - Set `agent_type.apply_caveman` from the checkbox (recommended-off). ### Tests - [ ] `wizard-skill-seeding.test.ts` — designer pre-checks translate to plain `implement` / `review` rows with design bodies; default bool values applied; non-designer types get plain bodies. - [ ] `library-endpoint.test.ts` — endpoint returns every file in `skills/`; cache survives a re-call. ## Out of scope - CRUD-after-creation surface (covered in SR-7 / SR-8). - Removing the legacy `/settings/agent-config` Skills tab (covered in SR-10). - Custom skill names not present in `skills/*.md` — wizard does not expose them; CRUD UI handles custom skills post-creation. ## References - Spec: `specs/skills-rework.md` §Wizard flow, §API surface. - Existing wizard component: `apps/web/src/routes/onboarding.tsx`, `apps/web/src/routes/agents.$type.index.tsx`. - Existing `loadSkill` cache: `apps/server/src/domain/analytics/skill-loader.ts`. - Depends on **SR-1**.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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#874
No description provided.