Skip to content

Detect locally modified skills and warn users during install - #6

Merged
mrsimpson merged 2 commits into
mainfrom
claude/improve-local-skills-handling-6DTbE
Mar 18, 2026
Merged

mrsimpson merged 2 commits into
mainfrom
claude/improve-local-skills-handling-6DTbE

Conversation

@mrsimpson

Copy link
Copy Markdown
Contributor

Summary

This PR adds detection for locally modified inline skills and prevents them from being overwritten during install/setup operations. Users are now warned when their local skill modifications would be lost, with instructions on how to update them if desired.

Key Changes

  • Modified writeInlineSkills() function to return a list of skill names that have been locally modified, instead of void

    • Now reads existing skill files before writing to detect changes
    • Skips writing files that have been locally modified
    • Only creates directories and writes files for new or unchanged skills
  • Updated install and setup commands to handle modified skills

    • Both runInstall() and runSetup() now call writeInlineSkills() and check for modifications
    • Display a warning message listing any locally modified skills
    • Provide guidance to users on how to update skills if needed
  • Refactored skill writing responsibility

    • Removed writeInlineSkills() call from claudeCodeWriter
    • Moved to CLI commands (install.ts and setup.ts) where it's called before installSkills()
    • Exported writeInlineSkills from harnesses package for use in CLI

Implementation Details

  • The function now compares the expected skill content with existing file content before writing
  • If content matches, the file is skipped (not added to modified list)
  • If content differs or file doesn't exist, it's written normally
  • Modified skills are collected and returned to the caller for user notification

https://claude.ai/code/session_01Sf3uGYRodvenEj8NWyzVcM

claude added 2 commits March 18, 2026 12:11
Before writing SKILL.md files to .ade/skills/, check if an existing file
differs from the default content. If it does, skip overwriting and warn the
user that their modified version will be used, with instructions to remove
.ade/skills/ to restore defaults.

Also moves writeInlineSkills() to be called at the top level in setup/install
commands (like installSkills) so the return value can drive user-facing
clack warnings.

https://claude.ai/code/session_01Sf3uGYRodvenEj8NWyzVcM
- Add writeInlineSkills to @codemcp/ade-harnesses mock in setup/install specs
- Update claude-code.spec.ts to test writeInlineSkills directly rather
  than via claudeCodeWriter.install(), reflecting the move of skill
  writing responsibility to the CLI commands

https://claude.ai/code/session_01Sf3uGYRodvenEj8NWyzVcM
@mrsimpson
mrsimpson force-pushed the claude/improve-local-skills-handling-6DTbE branch from e4b22f0 to a273a48 Compare March 18, 2026 12:21
@mrsimpson
mrsimpson merged commit 8d13e00 into main Mar 18, 2026
1 check passed
@mrsimpson
mrsimpson deleted the claude/improve-local-skills-handling-6DTbE branch March 18, 2026 12:28
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