Skip to content

Commit b08c94e

Browse files
jsourcebotgithub-actions[bot]brendan-kellam
authored
Jminnetian/askskills (#1410)
* Update schema to support the foundation for skills, both personal and for the organization * Add initial UI and actions to support personal skills * support unsaved changes loss guard, work in progress * Add Ask command suggestions for personal skills * feat: add slash command argument substitution * refactor: model agent skill scope explicitly * Add org skill adoption commands Any org member can create a skill into the shared workspace catalog; members opt in by adopting it, while only owners can feature or auto-enroll a skill for everyone. Personal and org skills may share a slug since commands resolve by source and id, so duplicates from different sources coexist. * Add org skill settings UI * Add workspace skill management UI * Add file mentions to skill instructions * feat(web): auto-invoke agent skills in Ask via load_skill tool The Ask model can now discover opt-in skills from an <agent_skills> catalog in the system prompt and load their instructions on demand through a single load_skill tool, reusing the existing auth-scope helpers and argument substitution. Auto-invocation is gated per skill by a new autoInvocationEnabled flag and a global env kill-switch; manual slash-command invocation is unchanged. * feat(web): render load_skill tool calls and harden auto-invocation Surface load_skill tool calls in the Ask details card via a new tool-part type and component so users can see which skill the model loaded and its instructions. Also folds in review hardening: sanitize every skill catalog field injected into the system prompt, make load_skill fail closed on transient lookup errors, and consolidate the manual and auto skill catalogs onto one shared query helper. Includes the migration for the autoInvocationEnabled column. * refactor(web): force skill auto-invocation, drop arguments, org-scope personal skills Skills are now always model-invocable: removed the per-skill autoInvocationEnabled flag, its UI toggle, and the env kill-switch. Skills no longer take arguments, so the substitution engine and argumentNames are gone. Personal skills are bound to the current org, and the ORG visibility is renamed to SHARED across schema, server, and UI. The five skill migrations are collapsed into one. * refactor(web): move Ask Sourcebot skills into a standalone Skills page Extract personal and shared skill management out of the account Ask Sourcebot settings into a routed /settings/skills two-pane page with inline editing. The account page now manages connectors only; existing skill actions are reused, with the shared catalog surfacing instructions and creator email for the detail view. * update on skills editing ux * refactor(web): UI improvements for the Ask skills page Make the instructions editor flush with the name/command bars, let split view use the full pane, and keep the view toggle and counter stationary across mode switches. Replace the misleading Shared toggle on other members' shared skills with an enable toggle in the list, color the Auto/Featured badges instead of using icons, add a Skills entry to the chat + menu, and stop the table-of-contents focus ring from lingering after a click. * refactor(web): remove the featured skills concept Drop the `featured` flag entirely from agent skills: the schema column and shared-catalog index, the server selects/sort/flag-input schema, the Featured badge and admin toggle, and all related tests. Shared skills now sort by recency then name; the remaining auto-enroll flag is unchanged. Includes a migration dropping the column. * fix(web): only show search mode tooltips when the dropdown is open The Ask Sourcebot tooltip stayed permanently visible on the chat landing page because the search mode tooltips force their open state from the current mode. The recent tooltip Portal change let that force-open content escape the dropdown's DOM subtree. Gate the tooltips on the Select's open state so they only render while the dropdown is open. * feat(web): import skills from markdown on the Skills page The Skills page '+' now opens a menu offering manual create or import from markdown. Importing parses front matter for name, command, and description and the body for instructions, then drops into the create form pre-populated for review before saving. * feat(web): import skills from an indexed repository Adds an 'Import from repository' option to the Skills page '+' menu that browses your indexed repos, filters to markdown files, and populates the create form from the selected file's front matter and body. Reuses the existing markdown parser and create flow. * feat(web): repo-synced agent skills with org sharing and access gating Import a skill from an indexed repository file; its description and instructions stay synced to the file (refreshed via Update from source, keyed on the git blob OID) while name and command stay editable local labels. Synced skills can be published to the org and stay synced, and are exposed only to users who can access the source repo — across the command catalog, instruction materialization, load_skill, and the shared catalog. * feat(web): overhaul shared-skills admin table and sharing UX Replace the workspace shared-skills card list with a searchable, filterable table (Synced/Manual filter, Added by, Auto toggle), backed by source and creator fields on the management item. Sharing a synced skill now goes through a confirmation dialog warning about owner/member repo visibility, shown only when permission syncing is on. Add cross-navigation between the account and admin skill views, and drop the redundant Make personal menu item in favor of the Shared toggle. * refactor(web): drop dead skill toggle and redundant delete guard Remove the unused OrgSkillFlagToggle export (and its now-unused Switch import), which had no consumers after the shared-skills admin table redesign. Simplify the delete button's onClick, which is already disabled while a flag mutation is pending. * Add changelog entry for Ask skills * chore: regenerate OpenAPI spec * fix: stabilize workspace skills management * fix: refresh skills settings after mutations * Squash agent skill migrations * fix: escape agent skill catalog fields * fix(web): preserve manual skill invocation source * fix: remove made-personal skills from shared catalog * fix(web): make unsaved changes bypass one-shot * fix: center import repo dialog close button * Track ask skill analytics events * Strengthen skill analytics redaction test * Address ask skill analytics feedback * Address skill analytics feedback follow-ups * Rename agent skills migration * Improve skills editor guidance * Extract chat agent tools * Rename skill command server helper * Refactor skills page components * Remove redundant tooltip portal wrappers TooltipContent now renders inside a portal itself, so the manual TooltipPrimitive.Portal wrappers in upgradeBadge and membersTable are redundant. * Add client validation for skill forms * Extract shared chat mention chip * Make synced skills editable with warn-on-overwrite sync Skill descriptions are now required everywhere. Synced skills' content is fully editable; syncing (or force-syncing an up-to-date skill) warns only when it would overwrite local edits, detected by diffing against the stored imported blob rather than any new database state. Fields the source file omits keep their local values, and repo imports now land in the prefilled create form instead of creating directly. * Add avatar to skill added-by metadata * docs: add skills documentation images * Move skill field guidance into placeholders Fold the per-field help text into each input's placeholder and drop the redundant description lines. Instructions guidance now covers both task and knowledge skills. * docs: update skills page screenshot * fix(web): stabilize manual skill analytics * refactor(web): standardize skills settings layout * fix(web): prevent duplicate skill saves * fix(web): scope shared skill sync status visibility * fix padding * docs: link Ask skills changelog entry to PR --------- Co-authored-by: Jack Minnetian <270441393+BlueBottleLatte@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Brendan Kellam <brendan@sourcebot.dev>
1 parent eeb9fd7 commit b08c94e

117 files changed

Lines changed: 13506 additions & 240 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2525
- [EE] Added image attachments to Ask Sourcebot, letting users attach images to a chat message when the selected model supports image input. [#1375](https://github.com/sourcebot-dev/sourcebot/pull/1375)
2626
- Added deployment system resource stats (CPU cores + cgroup quota, host + container memory, disk, load average) to the service ping, so resource issues can be diagnosed more quickly. [#1424](https://github.com/sourcebot-dev/sourcebot/pull/1424)
2727
- Added a `robots.txt` that disallows crawlers, with an allowlist for link-preview bots so shared links keep their OpenGraph previews. [#1426](https://github.com/sourcebot-dev/sourcebot/pull/1426)
28+
- [EE] Added Ask Sourcebot skills, letting users create, import, share, sync, and auto-invoke reusable chat instructions across personal and workspace scopes. [#1410](https://github.com/sourcebot-dev/sourcebot/pull/1410)
2829

2930
### Fixed
3031
- Send anonymous server-side PostHog events as personless so unauthenticated requests don't inflate person counts. [#1367](https://github.com/sourcebot-dev/sourcebot/pull/1367)

docs/api-reference/sourcebot-public.openapi.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,9 @@
576576
},
577577
"externalWebUrl": {
578578
"type": "string"
579+
},
580+
"blobSha": {
581+
"type": "string"
579582
}
580583
},
581584
"required": [

docs/docs.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
"group": "Ask Sourcebot",
6767
"root": "docs/features/ask/ask-sourcebot",
6868
"pages": [
69+
"docs/features/ask/skills",
6970
"docs/features/ask/connectors",
7071
"docs/features/ask/chat-sharing",
7172
"docs/features/ask/add-model-providers"

docs/docs/features/ask/skills.mdx

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
---
2+
title: Skills
3+
---
4+
5+
Skills are reusable context for [Ask Sourcebot](/docs/features/ask/ask-sourcebot).
6+
They can capture organizational knowledge, define a workflow, or give Ask Sourcebot extra context for a class of questions.
7+
8+
<Frame>
9+
<img src="/images/skills_page.png" alt="Skills page overview" />
10+
</Frame>
11+
12+
## Creating a skill
13+
14+
Go to **Settings -> Skills** and click **Add skill**.
15+
16+
You can create a skill in three ways:
17+
18+
- **New skill**: Create a skill directly in Sourcebot.
19+
- **Import from file**: Upload a local `.md` or `.markdown` file and review it before saving.
20+
- **Import from repository**: Choose a markdown file from an indexed repository and keep the skill synced to that file.
21+
22+
Each skill has four fields:
23+
24+
- **Name**: A recognizable name for the skill.
25+
- **Command**: The slash command users type to run the skill, such as `/deep-research`.
26+
- **Description**: A short summary of when Ask Sourcebot should use the skill.
27+
- **Instructions**: The markdown context or guidance Ask Sourcebot uses when the skill runs.
28+
29+
<Frame>
30+
<img src="/images/skills_create.png" alt="Create a skill" />
31+
</Frame>
32+
33+
## Writing instructions
34+
35+
Keep the description specific. Ask Sourcebot uses it to decide when a skill is relevant, and users see it when browsing slash commands.
36+
37+
Put the useful context or guidance in the instructions.
38+
39+
<Frame>
40+
<img src="/images/skills_editor.png" alt="Skill editor" />
41+
</Frame>
42+
43+
## Using skills in chat
44+
45+
Type `/` at the start of an Ask Sourcebot prompt to browse available skill commands.
46+
47+
When you select a skill, Ask Sourcebot expands the command into that skill's instructions before answering. If the instructions include file mentions, those files are added to the chat context automatically.
48+
49+
Ask Sourcebot may also load a matching skill automatically. When this happens, the chat details show the loaded skill name and command.
50+
51+
<Frame>
52+
<img src="/images/skills_slash_command.png" alt="Skill slash command suggestions" />
53+
</Frame>
54+
55+
## Personal and shared skills
56+
57+
Skills can be personal or shared:
58+
59+
- **Personal skills** are private to you in the current workspace.
60+
- **Shared skills** are published to the workspace skill catalog.
61+
62+
You can add or remove shared skills from your own Ask commands from **Settings -> Skills**. Skill authors and organization owners can edit or delete shared skills.
63+
64+
Organization owners can manage shared skills from **Settings -> Workspace -> Ask Sourcebot**. Owners can also enable **Auto** for a shared skill, which adds it to members' Ask commands by default.
65+
66+
<Frame>
67+
<img src="/images/skills_workspace_manager.png" alt="Workspace shared skills manager" />
68+
</Frame>
69+
70+
## Importing skills
71+
72+
### Import from file
73+
74+
File imports support `.md` and `.markdown` files. If the file has front matter, Sourcebot uses it to prefill the skill name, command, and description.
75+
76+
Supported front matter fields:
77+
78+
```md
79+
---
80+
name: Debug Build Failure
81+
slug: debug-build
82+
description: Investigate a failing CI or build error.
83+
---
84+
```
85+
86+
You can also use `title` instead of `name`, and `command` instead of `slug`.
87+
88+
After importing a local file, the skill is editable in Sourcebot.
89+
90+
### Import from repository
91+
92+
Repository imports let you choose a markdown file from an indexed repository. Sourcebot prefills the create form from the file so you can review it, add a missing description, and save. The resulting skill stays synced to that file.
93+
94+
Synced skills behave like manually-created skills, with a link back to their source file:
95+
96+
- Every field stays editable. Local edits are kept until you sync.
97+
- Sourcebot checks whether the indexed source file has changed.
98+
- When an update is available, use **Update from source** to replace the skill's content with the file's.
99+
- When the skill is already up to date, use **Force sync** to restore the content from the source file.
100+
- Either action warns you first if it would overwrite local edits.
101+
- Fields the source file does not provide (for example, a missing `description`) keep their local values when you sync.
102+
103+
<Frame>
104+
<img src="/images/skills_synced_from_repo.png" alt="Synced repository skill" />
105+
</Frame>
106+
107+
## Permissions and synced skills
108+
109+
Synced skills mirror content from a repository file, so Sourcebot only shows them to users who can access the source repository.
110+
111+
If repository permission syncing is enabled, sharing a synced skill shows a warning before publishing it to the workspace. Members without access to the source repository will not see the skill.
112+
113+
Organization owners can still see and manage shared synced skills from workspace settings, even if they do not have access to the source repository.
114+
115+
## Managing skills
116+
117+
From **Settings -> Skills**, you can:
118+
119+
- Search personal and shared skills.
120+
- Create, edit, delete, or share skills.
121+
- Add or remove shared skills from your commands.
122+
- Make a shared skill personal if you manage it.
123+
- Update synced skills from their source file.
124+
125+
Synced skills show their source repository and file path, plus one of these statuses:
126+
127+
- **Up to date**: The skill matches the indexed source file.
128+
- **Update available**: The indexed source file has changed.
129+
- **Source file not found**: The file was renamed, deleted, or no longer resolves at the imported revision.
130+
- **Source repo unavailable**: The repository is no longer available or visible.

docs/images/skills_create.png

179 KB
Loading

docs/images/skills_editor.png

341 KB
Loading

docs/images/skills_page.png

335 KB
Loading
125 KB
Loading
141 KB
Loading
133 KB
Loading

0 commit comments

Comments
 (0)