Skip to content

feat: turn typed skill aliases into chips - #31126

Merged
jaaydenh merged 313 commits into
mainfrom
chat-project-skills/typed-skill-chips
Nov 2, 2026
Merged

jaaydenh merged 313 commits into
mainfrom
chat-project-skills/typed-skill-chips

Conversation

@jaaydenh

@jaaydenh jaaydenh commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Typing a skill's full alias and a space now inserts that skill's chip, the same as picking it from the / menu. Before, only a menu pick made a chip, and a typed /deploy staging went out as plain text. For a manual-only skill (#30882, #30884) that meant the skill could never load: chatd leaves it out of the agent's skill list and read_skill reports it as not found, so only a skill-invocation part brings it in. This was raised in review on #30880.

  • When whitespace typed right after the alias closes the / trigger, and the alias exactly matches an available skill (the bare /name the menu shows, or the qualified /source/name), the alias becomes a chip. Partial names, unknown tokens such as paths, and a bare name that two sources share stay text. Only that insertion converts: moving the caret past a space that is already there leaves the text alone.
  • Conversion uses the same lists as the menu. A bare alias typed while a skill list is still loading stays text, because the menu also qualifies every trigger until all lists are known.
  • Unlike a menu pick, the typed text stays when the chip is already in the message, or when the message already has 8 skills (the limit toast still shows).

Stack (merge top to bottom):

…ject-skills/skill-chips-transcript

# Conflicts:
#	site/src/pages/AgentsPage/components/ChatMessageInput/SkillChip.tsx
@coderagents

coderagents Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Documentation Check

Updates Needed

  • docs/ai-coder/agents/extending-agents.md (open) - Resolved in 3badb2b. The sentence "Text such as /triage that you type without choosing it from the menu is sent as plain text" was replaced with an accurate description: typing a full alias (bare or qualified) followed by a space attaches the skill as a chip, and partial names, non-matching text, ambiguous bare names, an already-present chip, and the 8-skill maximum stay plain text.

Automated review via Coder Agents

jaaydenh added a commit that referenced this pull request Oct 22, 2026
Renders `skill-invocation` parts from #30861 in the conversation. A user
message shows its skill chips inline with the text, and a message with
only a skill invocation is no longer treated as empty. Editing a past
message restores its chips in the composer (the editable payload now
carries the serialized editor state), optimistic edits keep skill parts,
and queued messages show the skill.

| Editing a message with a chip | Queued message |
| --- | --- |
| <img alt="Editing a past message restores its skill chip"
src="https://raw.githubusercontent.com/coder/coder/assets/pr-30880-skill-chips/pr/edit-chip.png"
width="600" /> | <img alt="Queued message showing its skill"
src="https://raw.githubusercontent.com/coder/coder/assets/pr-30880-skill-chips/pr/queued-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>
Co-authored-by: Nick Vigilante <nickvigilante@users.noreply.github.com>
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Docs preview

Check off each page once it's been reviewed. If a page changes in a later push, its checkbox clears automatically so it gets a fresh look. Pages not yet wired into the docs navigation aren't listed here.

@jaaydenh jaaydenh changed the title feat(site/src/pages/AgentsPage/components/ChatMessageInput): turn typed skill aliases into chips feat: turn typed skill aliases into chips Oct 22, 2026

@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.

IMO we need to be reviewing docs more closely, there's so much junk in these agent written docs.

@nickvigilante nickvigilante left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Revisiting this: I agree with @ethanndickson that the edge cases in lines 284-286 of extending-agents.md go further than readers need. I'd keep line 283 and replace 284-286 with one sentence: "Text that doesn't match exactly one available skill is sent as plain text." Docs LGTM with that trim.

jaaydenh added a commit that referenced this pull request Oct 23, 2026
Adds two per-skill settings that the project skills UI will expose next:

- `action` marks a project skill to show as an action button above
project chat composers. A `skills_action_project_only` check keeps it to
project skills; the personal and organization routes reject `action`
with 400.
- `model_invocable` (default true, every stored source) controls
automatic use. When it's false the skill is left out of
`<available-skills>` and `read_skill` reports it as not found, but a
structured skill invocation (a chip from the `/` menu or an action)
still loads it, as long as the skill is enabled and the chat owner can
read it. Workspace skills always count as model-invocable.

Migration 000625 adds both columns with defaults, so existing skills
keep today's behavior. The list, get, insert and update queries,
`codersdk.SkillMetadata` and the create/update requests carry both
fields, and the audit table tracks them.
`coderd/x/chatd/ARCHITECTURE.md` gets TODO notes for the author.

**NOTE**: the migration adds two columns with constant defaults and a
CHECK constraint to `skills`.

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>
Co-authored-by: Nick Vigilante <nickvigilante@users.noreply.github.com>
jaaydenh added a commit that referenced this pull request Oct 23, 2026
Exposes the two project skill settings from #30882 and adds project
actions above project chat composers.

- The project skill editor gets two switches, "Show as action" and
"Agents can use it automatically". New skills start with actions off and
automatic use on, importing a SKILL.md with `disable-model-invocation:
true` starts automatic use off, and a settings-only change saves without
rewriting SKILL.md. The skills list shows "Action" and "Manual only"
badges.
- A new `ProjectSkillActions` bar shows enabled action skills sorted by
name: up to three buttons (description as tooltip), the rest under
"More". Clicking one inserts that skill's chip into the composer through
`insertSkill`; it doesn't start a chat, and a chip that's already there
isn't duplicated. It renders nothing while loading, on error, or with no
actions.
- The bar appears above the project page's new-chat composer and above
the composer of ongoing project chats (subagents use the root chat's
project). It's hidden when the composer is read-only and behind the
`chat-projects` experiment. The list refetches when the window regains
focus and after a send fails because a skill is no longer available.
- The extending agents docs describe both settings.

Dogfood UAT passed: three buttons plus More on the project page and in
ongoing chats, chips inserted without creating a chat, the agent
answering from action-invoked skills (including a manual-only skill that
`read_skill` can't load), the bar updating after settings changes and
after a deleted skill's send failed, settings-only saves leaving
SKILL.md unchanged, and no bar outside projects.

| Project page actions with More open | Action chip in an ongoing chat |
| --- | --- |
| <img alt="Project page composer with three action buttons and More
open"
src="https://raw.githubusercontent.com/coder/coder/assets/pr-30884-project-actions/pr/project-page-actions.png"
width="600" /> | <img alt="Ongoing project chat with an action chip
inserted"
src="https://raw.githubusercontent.com/coder/coder/assets/pr-30884-project-actions/pr/chat-actions.png"
width="600" /> |

| Editor switches | List badges |
| --- | --- |
| <img alt="Project skill editor with the two switches"
src="https://raw.githubusercontent.com/coder/coder/assets/pr-30884-project-actions/pr/editor-switches.png"
width="600" /> | <img alt="Project skills list with Action and Manual
only badges"
src="https://raw.githubusercontent.com/coder/coder/assets/pr-30884-project-actions/pr/list-badges.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>
Co-authored-by: Nick Vigilante <nickvigilante@users.noreply.github.com>
# Conflicts:
#	coderd/x/chatd/ARCHITECTURE.md
#	docs/ai-coder/agents/extending-agents.md
#	site/src/pages/AgentsPage/components/ChatMessageInput/ChatMessageInput.tsx
@linear-code

linear-code Bot commented Oct 26, 2026

Copy link
Copy Markdown

CODAGT-1438

Base automatically changed from chat-project-skills/skill-editor-parts to main November 2, 2026 13:19
jaaydenh added a commit that referenced this pull request Nov 2, 2026
…r into compound components (#31122)

Turns `SkillEditorForm` into compound components, the condition
@jakehwll set when pre-approving #30854
([thread](#30854 (comment))).

`SkillEditorForm` took 11 props. Two were render-prop slots
(`header(state)`, `footer(state)`) that only existed to hand `{ isBusy,
canSubmit, isDirty }` back to the caller, three were per-field overrides
(`nameHint`, `bodyPlaceholder`, `showProjectSettings`), and the dialog
wrapper's props were an `Omit<>` of all that. The change lands at the
top of the stack because #30855 and #30884 both reshape this API, so
doing it once here avoids reworking each layer.

`SkillEditorForm` is now a root that owns Formik, validation, the
submit-settlement guard, and the file-read busy flag, and provides them
through context. Callers compose named parts: `SkillEditorFields`,
`SkillEditorSubmitError`, `SkillEditorImport` (`resetsModelInvocable`
replaces the `showProjectSettings` branch in import),
`SkillEditorNameField` (`hint`), `SkillEditorDescriptionField`,
`SkillEditorBodyField` (`placeholder`), `SkillEditorProjectSettings`,
and `SkillEditorSubmitButton`. Custom headers and footers read `{ mode,
readOnly, isBusy, canSubmit, isDirty }` from
`useSkillEditorFormState()`. Parts don't hide themselves when read-only;
the caller decides. `SkillEditor` is renamed `SkillEditorDialog`, since
a bare `SkillEditor` is ambiguous next to the parts.

The project dialog call site, before:

```tsx
<SkillEditorForm
  mode={view.type} readOnly={!canEdit} initialValues={...} existingNames={existingNames}
  submitError={submitError} isSubmitting={isSubmitting}
  nameHint="Lowercase letters, numbers, and hyphens."
  bodyPlaceholder="Describe when and how the agent should use this skill."
  showProjectSettings
  header={({ isDirty }) => <ProjectSkillEditorHeader ... onBack={isDirty ? confirmDiscard : onBack} />}
  footer={({ canSubmit }) => canEdit && (
    <DialogFooter ...><Button type="submit" disabled={!canSubmit}>...Save</Button></DialogFooter>
  )}
  onSubmit={...}
/>
```

After:

```tsx
<SkillEditorForm mode={view.type} readOnly={!canEdit} initialValues={...}
  existingNames={existingNames} isSubmitting={isSubmitting} onSubmit={...}>
  <ProjectSkillDiscardGuardedHeader ... /> {/* reads isDirty from useSkillEditorFormState() */}
  <SkillEditorFields>
    <SkillEditorSubmitError error={submitError} />
    {canEdit && <SkillEditorImport resetsModelInvocable />}
    <SkillEditorNameField hint="Lowercase letters, numbers, and hyphens." />
    <SkillEditorDescriptionField />
    <SkillEditorProjectSettings />
    <SkillEditorBodyField placeholder="Describe when and how the agent should use this skill." />
  </SkillEditorFields>
  {canEdit && (
    <DialogFooter ...><SkillEditorSubmitButton>Save</SkillEditorSubmitButton></DialogFooter>
  )}
</SkillEditorForm>
```

Behavior is unchanged and the existing tests pass without edits beyond
the rename. The rendered DOM is identical: I compared `document.body`
before and after for the personal dialog (create, edit, read-only, with
a submit error) and the project dialog (create, edit with unsaved
changes, read-only), so there are no screenshots. Everything stays in
`SkillEditor.tsx` so the diff reads as moved JSX rather than file
renames.

Stack (merge top to bottom):
- #30826
- #30827
- #30838
- #30840
- #30854
- #30855
- #30856
- #30861
- #30880
- #30881
- #30882
- #30884
- #31122 👈
- #31126
@jaaydenh
jaaydenh merged commit 4790b0e into main Nov 2, 2026
28 of 29 checks passed
@jaaydenh
jaaydenh deleted the chat-project-skills/typed-skill-chips branch November 2, 2026 14:07
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 2, 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.

3 participants