Files
coder/docs/reference/api
Jaayden HalkoandCursor ffd24861a1 feat: send skill invocations as structured message parts (#30861)
Adds a structured `skill-invocation` chat part so a user message can
carry an explicit skill. chatd loads that exact skill when the message
is sent and puts its body into the user's prompt, so the skill always
applies instead of relying on the model to notice it in
`<available-skills>`. The composer chip that sends these parts comes in
the next PR.

- codersdk: a `skill-invocation` input part and message part with
`skill_source` (`personal`, `org`, `project`, `workspace`) and
`skill_name`. The resolved body is stored on the part as internal
`skill_body`; it's hidden from TypeScript and stripped from every API
response.
- coderd rejects an unknown source or an invalid name with 400.
- chatd resolves each invocation on create, send and edit with the chat
owner's permissions, through the same loaders as `read_skill`: stored
skills by source and name (project skills through the chat's project,
with the root chat fallback for subagents) and workspace skills from the
pinned context snapshot. The body is saved at send time so past turns
show what the model received. A missing, disabled or unreadable skill
rejects the send with 400 "Skill project/triage is not available."
- The prompt renders a line saying the user invoked the skill, followed
by `<invoked-skill name="project/triage">` with the sanitized body.
Titles and hook prompt text show the invocation as `/project/triage`.
- The site only gets no-op cases so the regenerated types compile.
`coderd/x/chatd/ARCHITECTURE.md` gets a TODO for the author.

Stack (merge top to bottom):
- #30826
- #30827
- #30838
- #30840
- #30854
- #30855
- #30856
- #30861 👈
- #30880
- #30881
- #30882
- #30884
- #31122
- #31126

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-22 11:04:09 +07:00
..