Skip to content

feat(skills): remove the skills a run installed when it ends - #1489

Merged
edwinyjlim merged 5 commits into
mainfrom
remove-skill
Oct 22, 2026
Merged

edwinyjlim merged 5 commits into
mainfrom
remove-skill

Conversation

@edwinyjlim

Copy link
Copy Markdown
Member

runProgram now notes the wizard-marked skills in .claude/skills before each run and deletes the ones the run added when it ends.

Skills the user wrote, or kept from an earlier run, stay. An empty skills folder is removed too.

This covers headless and CI runs, which never showed the keep-skills screen and so left their skills behind. Self-driving drops its own postRun removal, since every program now gets the default behavior.

edwinyjlim and others added 2 commits October 22, 2026 15:47
runProgram now notes the wizard-marked skills in .claude/skills before
each run and deletes the ones the run added when it ends, whether it
succeeds, fails or is interrupted. Skills the user wrote, or kept from
an earlier run, stay. An empty skills folder is removed too.

This covers headless and CI runs, which never showed the keep-skills
screen and so left their skills behind. Self-driving drops its own
postRun removal, since every program now gets it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every program flow ended on a screen asking whether to keep the
installed skills. The runner now removes them when the run ends, so the
screen and its step in each flow are gone. Flows end on the exit screen.

After a failed run, choosing "continue" ended the run when keep-skills
finished. The host and the abort presenter now wait for the exit screen
instead.

The e2e harness reports `flowComplete` in place of `skillsComplete`
(read_state and e2e-result.json), and profiles lose their `skills`
setting and the `keep_skills` action. The `skills complete` and
`screen keep-skills` events stop firing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@edwinyjlim
edwinyjlim requested review from a team as code owners October 22, 2026 22:56
@edwinyjlim
edwinyjlim requested review from a team, JamesPatrickGill, TueHaulund, ablaszkiewicz, fasyy612, hpouillot, ksvat and rafaeelaudibert and removed request for a team, TueHaulund, fasyy612 and ksvat October 22, 2026 22:56
@github-actions

Copy link
Copy Markdown

🧙 Wizard CI

Run the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands:

Test all apps:

  • /wizard-ci all

Test all apps in a directory:

  • /wizard-ci ai-observability
  • /wizard-ci basic-integration
  • /wizard-ci feature-flags
  • /wizard-ci mcp-analytics
  • /wizard-ci replay-vision
  • /wizard-ci revenue
  • /wizard-ci self-driving
  • /wizard-ci warehouse
  • /wizard-ci warehouse-seeded

Test an individual app:

  • /wizard-ci ai-observability/anthropic
  • /wizard-ci ai-observability/google-adk
  • /wizard-ci ai-observability/groq
Show more apps
  • /wizard-ci ai-observability/manual-capture
  • /wizard-ci ai-observability/openai
  • /wizard-ci ai-observability/openai-agents
  • /wizard-ci ai-observability/opentelemetry
  • /wizard-ci ai-observability/vercel-ai
  • /wizard-ci basic-integration/android
  • /wizard-ci basic-integration/angular
  • /wizard-ci basic-integration/astro
  • /wizard-ci basic-integration/django
  • /wizard-ci basic-integration/fastapi
  • /wizard-ci basic-integration/flask
  • /wizard-ci basic-integration/flutter
  • /wizard-ci basic-integration/javascript-node
  • /wizard-ci basic-integration/javascript-web
  • /wizard-ci basic-integration/laravel
  • /wizard-ci basic-integration/next-js
  • /wizard-ci basic-integration/nuxt
  • /wizard-ci basic-integration/python
  • /wizard-ci basic-integration/rails
  • /wizard-ci basic-integration/react-native
  • /wizard-ci basic-integration/react-router
  • /wizard-ci basic-integration/sveltekit
  • /wizard-ci basic-integration/swift
  • /wizard-ci basic-integration/tanstack-router
  • /wizard-ci basic-integration/tanstack-start
  • /wizard-ci basic-integration/vue
  • /wizard-ci feature-flags/django
  • /wizard-ci feature-flags/next-js
  • /wizard-ci mcp-analytics/custom-dispatcher
  • /wizard-ci mcp-analytics/typescript-sdk
  • /wizard-ci replay-vision/javascript-node
  • /wizard-ci replay-vision/next-js
  • /wizard-ci replay-vision/react-vite
  • /wizard-ci revenue/stripe
  • /wizard-ci self-driving/astro
  • /wizard-ci self-driving/fastapi
  • /wizard-ci self-driving/nuxt
  • /wizard-ci self-driving/react-router
  • /wizard-ci self-driving/sveltekit
  • /wizard-ci warehouse/monorepo-env
  • /wizard-ci warehouse/multi-source-next
  • /wizard-ci warehouse/stripe-node
  • /wizard-ci warehouse/zero-source
  • /wizard-ci warehouse-seeded/next-stripe
  • /wizard-ci warehouse-seeded/next-stripe-declined

Test against a Context Mill branch:

  • /wizard-ci all context-mill:my-branch

Add context-mill:<branch> to any command above to pin the Context Mill branch. It defaults to main.

Results will be posted here when complete.

@johncwaters johncwaters left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Note

Automated review. Not written by a human.

Approved by hand after checking the automated review.

// The run neutralized its directory's settings; put them back whatever happened.
if (settings.backedUp) restoreClaudeSettings(runDir);
unregisterSkills();
removeSkills();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Note

Automated review. Not written by a human.

[correctness] LOW

removeSkills() runs unguarded in the finally. removeRunSkills guards each rmSync but not the readdirSync in listWizardSkills, so an unreadable skills folder (e.g. EACCES) would throw from the finally and replace the run's real result or error. Wrapping the call in a try/catch that logs would match the helper's best-effort intent.

An unreadable .claude/skills folder made listWizardSkills throw, which
could fail a run before its agent started or replace its result from the
finally. Listing now returns null on a read error, and removeRunSkills
deletes nothing when either listing is null.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@edwinyjlim

Copy link
Copy Markdown
Member Author

/wizard-ci basic-integration/next-js

@wizard-ci-bot

wizard-ci-bot Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

🧙 Wizard CI Results

Trigger ID: e0f920a
Workflow: View run

App Confidence PR YARA
basic-integration/next-js/15-app-router-saas 5/5 #4752 (logs) ✓
basic-integration/next-js/15-app-router-todo 4/5 #4751 (logs) ✓
basic-integration/next-js/15-pages-router-saas 4/5 #4750 (logs) ✓
basic-integration/next-js/15-pages-router-todo 3/5 #4749 (logs) ✓

Configuration

Setting Value
Wizard ref remove-skill
Context Mill ref main
PostHog ref master

Search for trigger ID e0f920a in wizard-workbench PRs.

Comment thread src/shared/skill-install.ts Outdated
@veria-ai

veria-ai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

PR overview

All previously flagged issues have been addressed. No open security concerns remain on this pull request.

Security review

No open security issues remain on this pull request.

Fixed/addressed: 1 · PR risk: 0/10

edwinyjlim and others added 2 commits October 22, 2026 16:16
The run's snapshot held only wizard-marked folders, so an unmarked folder
that a same-named install marked during the run was deleted, and a
symlinked .claude/skills could point that deletion outside the project.
The snapshot now holds every entry, the listing returns null when the
skills folder resolves outside the project, and symlinked entries are
skipped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
rmdir removes only an empty folder, so the cleanup can never delete
contents added between its emptiness check and the removal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@edwinyjlim
edwinyjlim merged commit 49ad13a into main Oct 22, 2026
18 checks passed
@edwinyjlim
edwinyjlim deleted the remove-skill branch October 22, 2026 23:27
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.

2 participants