@@ -1290,15 +1290,10 @@ def _unregister_extension_skills(
12901290 Called during extension removal to clean up skill files that
12911291 were created by ``_register_extension_skills()``.
12921292
1293- When *skills_dir* is omitted, this is a genuinely unscoped removal
1294- (e.g. full extension removal): ``registered_skills`` is a single
1295- flat list covering mirrors created under *every* agent this
1296- extension was ever activated under, not just the currently active
1297- one, so we always scan all known agent skills directories rather
1298- than narrowing to whichever agent happens to be active right now.
1299- Each candidate directory is verified against the SKILL.md
1300- ``metadata.source`` field before removal to avoid accidentally
1301- deleting user-created skills with the same name.
1293+ When *skills_dir* is omitted, project-local agent skill directories
1294+ are scanned. Home-scoped outputs require explicit agent provenance:
1295+ the legacy flat registry and ``metadata.source`` marker do not
1296+ identify which project created a global skill.
13021297
13031298 Args:
13041299 skill_names: List of skill names to remove.
@@ -1391,6 +1386,10 @@ def _unregister_extension_skills(
13911386 skills_candidate ,
13921387 trusted_root ,
13931388 ) in self ._extension_skill_candidate_dirs ().items ():
1389+ # ponytail: flat provenance cannot safely own global output;
1390+ # include home paths once registry entries identify project/agent.
1391+ if trusted_root != Path (os .path .abspath (self .project_root )):
1392+ continue
13941393 if not skills_candidate .is_dir ():
13951394 continue
13961395 # Reject the candidate directory itself (any path
0 commit comments