Skip to content

feat(skills): add DELETE endpoint to permanently remove a skill - #499

Open
kristopolous wants to merge 1 commit into
truefoundry:mainfrom
kristopolous:feat/skill-disable-endpoint
Open

feat(skills): add DELETE endpoint to permanently remove a skill#499
kristopolous wants to merge 1 commit into
truefoundry:mainfrom
kristopolous:feat/skill-disable-endpoint

Conversation

@kristopolous

@kristopolous kristopolous commented Aug 29, 2026

Copy link
Copy Markdown

Summary

Fixes #498.

There is currently no way to disable/remove a configured skill. In Settings → Skills, the "Enabled" list's flush-right action slot is wired to a Remove button (SkillSettings.tsx), but it's gated on skillCatalog.deleteSkill, which was never implemented — the adapter's own comment says why: "Delete omitted (no BE route)". There is no DELETE route for skills at all today (packages/trueforge/src/routes/skillRoutes.ts only has list/create/put), so the button silently never renders.

This PR adds the missing backend piece: DELETE /api/v1/settings/skills/{name}.

Scope: backend only (same reason as #495)

packages/trueforge-sdk is Fern-generated in CI and that workflow can't push its regen commit to a fork PR branch. A local regen attempt produces the same ~450-file unrelated-churn diff I hit on #495 (different pinned generator behavior than what's currently committed), which doesn't belong in this PR, and AGENTS.md forbids hand-editing packages/trueforge-sdk.

So this PR is the backend endpoint only, tested. Two follow-ups, both filed as part of #498:

  1. Wire skillCatalog.deleteSkill + an "Edit"-styled button in SkillSettings.tsx once this merges and the SDK regenerates on main — same sequencing as the connector "Remove" button after feat(mcp-servers): add DELETE endpoint to permanently remove a connector #495.
  2. Full field editing (description, and repo/path/ref for GitHub-imported skills) needs a real port/data-shape change: the SkillCatalogServer port has no updateSkill method at all, and listSkills() only returns { id, name, description } — a custom-imported skill's current source isn't visible client-side to safely pre-fill or resubmit an edit form. That's out of scope for a UI-only change.

Test plan

  • New tests in skillStoreContractSuite.ts (runs against both backends): delete removes the row; idempotent for an unknown skill, other tenants untouched.
  • New tests in tests/unit/apis/skills.test.ts: DELETE /{name} removes the skill; idempotent for an unknown skill.
  • pnpm test:store:sqlite — 133 passed (was 131), 1 skipped; confirmed the two new deleteSkill cases ran via --verbose.
  • pnpm test (trueforge unit suite) — 294/294 pass, including skills.test.ts.
  • pnpm run typecheck — clean.
  • pnpm eslint on changed files — clean.
  • Added a changeset (@truefoundry/trueforge minor — new endpoint).
  • Postgres store contract suite — same as feat(mcp-servers): add DELETE endpoint to permanently remove a connector #495, couldn't verify locally (sandbox blocks raw TCP to a local Postgres container), but CI runs it against this exact test file with a real postgres:17-alpine service.

🤖 Generated with Claude Code

https://claude.ai/code/session_01MxyEPwQ73B27NTr83U69Ba


Note

Low Risk
Tenant-scoped row delete behind existing settings admin auth; behavior matches other delete endpoints and is covered by contract/API tests.

Overview
Adds DELETE /api/v1/settings/skills/{name} so configured skills can be removed from the backend (unblocks Settings “Remove” once the SDK catches up).

The flow mirrors existing admin delete routes: OpenAPI route with name path param, handler returns 200 and {}, and ISkillStore.deleteSkill deletes by (tenant_id, name) in both Postgres and SQLite with idempotent behavior when the row is already missing. A DeleteSkillResponseSchema documents the empty success body; store contract and API unit tests cover removal, idempotency, and tenant isolation. @truefoundry/trueforge gets a minor changeset for the new endpoint.

Reviewed by Cursor Bugbot for commit d06cd36. Bugbot is set up for automated code reviews on this repo. Configure here.

There is currently no way to disable/remove a configured skill: the
"Enabled" list in Settings > Skills is wired to a Remove button, but
it's gated on skillCatalog.deleteSkill, which was never implemented
because no backend DELETE route existed for skills at all — the
button silently never rendered.

Add IMcpServerStore-style deleteSkill for both Postgres and SQLite,
the DELETE route, and its handler. Mirrors the equivalent MCP
connector work (truefoundry#494/truefoundry#495) exactly: idempotent, 200 with {} on
success, same pattern as the existing delete-agent/delete-mcp-server
routes.

Backend only, same reason as truefoundry#495: packages/trueforge-sdk is
Fern-generated in CI and fork PRs cannot receive that regen commit.
The "Edit" button + wired Disable action in the Skills settings UI is
a fast-follow once this merges and the SDK regenerates on main. Full
field editing (description, repo/path/ref) needs a separate follow-up
— the SkillCatalogServer port has no updateSkill method and the list
view doesn't expose a skill's current source, so that's a real
port/data-shape change, not just a UI addition.

Fixes truefoundry#498

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MxyEPwQ73B27NTr83U69Ba
@changeset-bot

changeset-bot Bot commented Aug 29, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d06cd36

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@truefoundry/trueforge Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No way to edit or disable a configured skill

1 participant