Repository navigation
Let people delete skills and playbooks from the library - #394
Merged
abhishekgahlot2 merged 3 commits intoNov 2, 2026
Merged
Conversation
Skills and playbooks could be created and imported but never removed in the app, even though the backend already exposes a delete endpoint. This adds a Delete action to the skill detail dialog and to the playbook detail. Both surfaces share one small component, SkillDeleteAction, which reuses the existing InlineDeleteConfirm strip: a quiet Delete button opens a confirm with Cancel and a red Delete, calls the delete endpoint, refreshes the list and closes the dialog, and shows a plain error line if the call fails. Deleting the last variant of a grouped skill closes the dialog; deleting one of several leaves the rest open. A test covers the confirm and list refresh, Cancel leaving the item untouched, and the failure path. Closes useagenthq#351.
Deleting a skill pinned by an enabled automation or bot routine left every later firing failing with missing_skill_revision, and the scheduler only logged it. DELETE /api/skills/:id now answers 409 skill_in_use while any enabled schedule in the same org pins the skill, with the first five holders by name (a routine also names its bot) and the total count. Other orgs' schedules never count; a paused or repointed one no longer holds it. The confirm strip says who still uses it and to pause them or change what they use first. A 404 means a teammate already deleted it, so the list refreshes instead of showing an error, and the remaining failure line uses plain words. The strip gains an optional problem line, announced as an alert, so the reason shows where the member pressed Delete.
Contributor
|
Merged, thanks @coolestnick! I added one thing on top: the delete now refuses while an enabled automation or bot routine still uses the skill, and the confirm strip names them, so nothing stops running quietly. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #286
What and why
Skills and playbooks could be created and imported but never removed in the app, even though the backend already exposes a delete endpoint. This adds a Delete action to the skill detail dialog and to the playbook detail, so people can clear out what they no longer need.
How it works
Both surfaces share one small component,
SkillDeleteAction, which reuses the existingInlineDeleteConfirmstrip rather than inventing a new pattern:Deleting the last variant of a grouped skill closes the dialog; deleting one of several leaves the rest open. Runs that already used a skill keep their recorded version, so history is preserved.
Tests
A new interaction test covers the confirm and the list refresh, Cancel leaving the item untouched, and the failed-delete error path. Full suite green: typecheck,
bun run test(1771 pass), lint, and build.How to see it
Open a skill (Skills) or a playbook (Playbooks), and use the new Delete button at the bottom of the detail.
Before / after
Need help on this PR? Tag
@codesmith-botwith what you need.