INNER CODE UNIT · Python
uninstall_skill
faridrashidi/cnsplots · src/cnsplots/_cli.py:293
def uninstall_skill(agent: str, *, base_dir: Path) -> tuple[tuple[str, Path], ...]:
"""Remove unchanged managed files; retain edits and unrelated content.
Missing paths succeed. Existing directories without a manifest are refused.
Retained files become unmanaged when the ownership manifest is removed.
"""
destinations = _destinations(agent, base_dir)
plans = []
for _, destination in destinations:
if not destination.exists():
continue
manifest = _read_manifest(destination)
if manifest is None:
raise ValueError(
f"no ownership manifest at {destination}; run install --force to track "
"packaged files before uninstall (overwrites packaged paths)"
)
removals = tuple(