SR-7 CRUD endpoints for agent_skill (type + instance) #875
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#875
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 HTTP endpoints to list, upsert, and delete skill rows scoped to either an
agent_typeor anagent instance, so that the new web UI can run all CRUD without touching the legacy/agent-config/*routes.Acceptance criteria
Type-scope endpoints
GET /agents/<type>/skills→ array of{ name, body, updated_at }foragent_skillrows wherescope='type'andagent_type=<type>.POST /agents/<type>/skillsbody{ name, body }→ upsert withscope='type'. Returns 200 + the persisted row.DELETE /agents/<type>/skills/<name>→ delete row. 404 when no matching row.Instance-scope endpoints
GET /agents/<type>/<instance>/skills→ array of{ name, body, updated_at }foragent_skillrows wherescope='instance'andinstance_idmatches. Includes a parallel "inherits from type" array of names that are present at type scope but not overridden at instance scope, so the UI can show the full effective list.POST /agents/<type>/<instance>/skillsbody{ name, body }→ upsert withscope='instance',instance_id=<instance>,agent_type=<type>. Trigger from SR-1 enforces consistency between the URL<type>and the agents row.DELETE /agents/<type>/<instance>/skills/<name>→ delete the instance-scope row only; type-scope row (if any) is untouched and becomes effective again.Pool-session caveat
POST /agents/<type>/<instance>/skillssucceeds and at least one active session exists for the instance's pool ((forge, type, repo, issue)keys), the response payload includespool_session_warning: trueand a body listing the affected sessions. The UI can render a warning. Server does not auto-invalidate; that policy lives in SR-9 / a follow-up.Auth
/agent-config/*routes (Authelia + admin scope).Tests
agent-skill-routes.test.ts— happy-path CRUD, 404 on missing row, trigger rejection on mismatched<type>vsagents.type, FK cascade behaviour when anagentsrow is deleted.Out of scope
/agent-config/*routes for kind=skills (covered in SR-10).References
specs/skills-rework.md§API surface, §CRUD UI.apps/server/src/main.ts.🦵 @charles kicked the queue — re-running implement on @code-lead.