skill
Alternate Part
Public Made by Adomby adom
Which part can replace this one on my board, in stock now: any part, with the answer saying how sure it is.
main
#!/usr/bin/env python3
"""Remove only unchanged files installed by this package; preserve local edits."""
import argparse,os
from pathlib import Path
root=Path(__file__).resolve().parents[1]
p=argparse.ArgumentParser();p.add_argument('--home',type=Path);args=p.parse_args()
home=args.home or Path.home();codex=home/'.codex' if args.home else Path(os.environ.get('CODEX_HOME',str(home/'.codex')))
for base in [home/'.claude/skills',codex/'skills']:
for source in sorted((root/'skills').iterdir()):
target=base/source.name
for file in source.rglob('*'):
out=target/file.relative_to(source)
if file.is_file() and out.is_file() and out.read_bytes()==file.read_bytes():out.unlink()
if target.exists():
for d in sorted([p for p in target.rglob('*') if p.is_dir()]+[target],key=lambda p:len(p.parts),reverse=True):
if not any(d.iterdir()):d.rmdir()