Skip to content

feat: render skill invocations in the transcript and edit flow - #30881

Merged
jaaydenh merged 217 commits into
mainfrom
chat-project-skills/skill-chips-transcript
Oct 22, 2026
Merged

jaaydenh merged 217 commits into
mainfrom
chat-project-skills/skill-chips-transcript

Conversation

@jaaydenh

@jaaydenh jaaydenh commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Add sqlc queries for skills owned by a chat project and authorize them
through the parent project in dbauthz: reading needs chat_project:read
and writing needs chat_project:update. Skill.RBACObject keeps denying
project rows so any unwrapped path fails closed.

Add the chat_project_skill audit resource type and
AuditableChatProjectSkill so the upcoming project skill API can record
audit entries.
Add experimental routes to list, create, read, update and delete skills
on a chat project. Reading needs read on the project and writes need
update; callers who lack the permission get a 404 like the project
instructions routes. The handlers reuse the shared skill create and
update path, map the per-project cap and name index to 409, and audit
every write as a chat_project_skill.

Add matching ExperimentalClient methods.
Chats in a project now get the project's enabled skills as a new
"project" skill source, read as the chat owner each turn. Subagents use
the root chat's project. read_skill loads project skill bodies, and
MergeSkills takes sources in merge order so new sources do not change
its signature.
The "/" menu offers the skills of the chat's project, next to personal,
organization and workspace skills, and /clear and /compact defer to a
project skill with the same name. Documents project skills.
…g in the slash menu

Organization and project skills load through one hook, and the menu
renders its skill groups from one ordered list. Adds project loading and
error stories.
Cover the project-only skill tool check in the integration test, the
project skill body loader's not-found mapping, and the chat-projects
experiment gate in the composer.
…ed skill helpers

Split the form body of SkillEditor into SkillEditorForm, settle saves
through a mutate callback so the editor stays locked until the request
finishes, move the read-only enabled indicator into SkillEnabledSwitch,
and share the empty and loaded form value helpers in utils/skills.ts.
Add API methods and query factories to read, create, update, and delete
chat project skills, a projectSkillsScope for the shared skill helpers,
and ProjectSkillsDialog, which lists a project's skills and edits them
with SkillEditorForm.
Add a Skills row to the project Details panel that opens
ProjectSkillsDialog, with stories for the dialog and the panel, and
document where project skills are managed.
Add a skill-invocation chat input and message part. chatd loads the
invoked skill body with the chat owner's permissions when a message is
created, sent, or edited, stores it on the part, and renders it into
the user's prompt inside <invoked-skill>. Unavailable skills reject the
request with a 400. The stored body is internal and never returned by
the API.
…ts through refetches and handle deleted skills
…downloads, toggles, refetches and deleted skills
…ll details after deletes and refresh after download 404s
jaaydenh added a commit that referenced this pull request Oct 21, 2026
Adds `ProjectSkillsDialog`, the dialog for managing a chat project's
skills, plus the API client methods and react-query factories for the
project skill routes from #30827. Nothing opens the dialog yet; the next
PR adds the entry point in the project page Details panel.

- List view: "Project skills" with each skill's name, description, an
enabled switch and last updated time, a row menu with Edit (View when
read-only), Download and Delete, and a "No skills added yet" empty
state.
- New and Edit replace the list inside the same dialog and reuse
`SkillEditorForm`, including paste-to-import and file upload. Name is
locked when editing, and Escape asks before discarding unsaved edits.
- Without update permission the dialog is read-only: no New, Delete or
Save, and fields are disabled.
- Create, update and delete invalidate the project skill list, so the
composer `/` menu picks up changes too. A 409 (duplicate name or the
100-skill cap) is shown in the form and refreshes the list.

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

linear-code Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

CODAGT-1438

DES-22217

jaaydenh added a commit that referenced this pull request Oct 21, 2026
Adds a "Skills" row to the project page Details panel. It shows "None"
or the skill count (noting disabled skills) and opens the project skills
dialog from #30855. Editing follows the project's `permissions.update`,
the same flag that gates the instructions editor. The server computes it
with the project's sharing ACL, so an `admin` sharee can edit skills,
and users who can only read the project get the read-only dialog. Focus
returns to the row when the dialog closes. The extending agents docs now
point at the project page for managing project skills.

Dogfood UAT on this stack passed: creating, editing, importing,
downloading, turning off and deleting skills from the dialog; Save stays
disabled until the form is valid; a duplicate name shows the 409 in the
dialog; new skills show up in the project page `/` menu without a
reload. The read-only dialog was checked with a stubbed projects list,
before project sharing (#30439) landed.

| Editor | List after saving |
| --- | --- |
| <img alt="New project skill editor"
src="https://raw.githubusercontent.com/coder/coder/assets/pr-30856-project-skills/pr/skill-editor.png"
width="600" /> | <img alt="Project skills list after saving"
src="https://raw.githubusercontent.com/coder/coder/assets/pr-30856-project-skills/pr/skill-list.png"
width="600" /> |

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

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
@tracyjohnsonux

Copy link
Copy Markdown
Collaborator

Design isn't working for me, a bit clunky. added an issue to provide feedback https://linear.app/codercom/issue/DES-22217/review-and-normalize-pill-states-across-coder-agents

jaaydenh added a commit that referenced this pull request Oct 22, 2026
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>
@jaaydenh
jaaydenh requested review from a team and ethanndickson October 22, 2026 04:13
jaaydenh and others added 2 commits October 22, 2026 11:13
Co-authored-by: Nick Vigilante <nickvigilante@users.noreply.github.com>
Base automatically changed from chat-project-skills/skill-chips-composer to main October 22, 2026 04:43
jaaydenh added a commit that referenced this pull request Oct 22, 2026
Choosing a skill from the `/` menu now inserts a skill chip into the
composer instead of `/alias` text, and the message sends it as a
structured `skill-invocation` part (#30861), so chatd loads that exact
skill's body into the prompt.

- A Lexical `SkillInvocationNode` renders the chip with a remove button;
`/clear` and `/compact` still insert as commands, and typed `/name` text
that wasn't picked from the menu still goes out as plain text (#31126
turns a typed full alias into a chip).
- `buildChatInputContent` emits text and skill parts in document order,
a chip-only message can be sent, drafts keep chips, and the new chat
form forwards them.
- `insertSkill(source, name)` on the composer handle inserts a chip at
the caret without duplicating one that's already there. The project
action bar later in this stack uses it.
- Arrow keys step over chips instead of selecting them. Selecting a chip
node dropped the browser selection, so the next keystroke landed at the
start of the message; file reference chips had the same bug and get the
same fix.
- Copy and paste keep chips: copied text includes `/source/name`,
pasting skips a chip that's already in the composer, and a chip for a
skill this chat can't use is pasted as plain text.

Rendering the parts in the transcript and edit flow is in the next PR.

Dogfood UAT passed on this stack: picking project, personal and
organization skills sends one skill part each and the agent answers from
the skill body without calling `read_skill`; the caret, paste and copy
cases above, drafts, `/clear`, `/compact` and the 400 for a disabled or
deleted skill all behaved as expected.

| Chip in the composer | Sent message in the transcript |
| --- | --- |
| <img alt="Skill chip in the project composer"
src="https://raw.githubusercontent.com/coder/coder/assets/pr-30880-skill-chips/pr/composer-chip.png"
width="600" /> | <img alt="Skill chip in the sent message with the
codeword reply"
src="https://raw.githubusercontent.com/coder/coder/assets/pr-30880-skill-chips/pr/transcript-chip.png"
width="600" /> |

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>

@ethanndickson ethanndickson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docs need cleaning up. I'd probably just not add any docs here

@jaaydenh
jaaydenh merged commit 3c83820 into main Oct 22, 2026
31 checks passed
@jaaydenh
jaaydenh deleted the chat-project-skills/skill-chips-transcript branch October 22, 2026 05:58
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 22, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants