@@ -326,13 +326,25 @@ def pre_init(
326326 tracker .start ("team-directives" )
327327 directives_path = None
328328 try :
329- status , directives_path = sync_team_ai_directives (
330- team_ai_directives , project_path
331- )
332- if status == "installed" :
333- tracker .complete ("team-directives" , f"installed to { directives_path } " )
334- elif status == "local" :
335- tracker .complete ("team-directives" , f"local: { directives_path } " )
329+ # Determine if this is a local directory (use reference mode) or URL (install)
330+ potential_path = Path (team_ai_directives ).expanduser ()
331+ is_local_dir = potential_path .exists () and potential_path .is_dir ()
332+
333+ if is_local_dir :
334+ # Local directory: use reference mode (no copy)
335+ status , directives_path = sync_team_ai_directives (
336+ team_ai_directives , project_path , install = False
337+ )
338+ tracker .complete ("team-directives" , f"referenced: { directives_path } " )
339+ else :
340+ # ZIP URL: install to .specify/extensions/
341+ status , directives_path = sync_team_ai_directives (
342+ team_ai_directives , project_path , install = True
343+ )
344+ if status == "installed" :
345+ tracker .complete ("team-directives" , f"installed to { directives_path } " )
346+ elif status == "local" :
347+ tracker .complete ("team-directives" , f"local: { directives_path } " )
336348 os .environ ["SPECIFY_TEAM_DIRECTIVES" ] = str (directives_path )
337349 except Exception as e :
338350 tracker .error ("team-directives" , str (e ))
@@ -927,24 +939,21 @@ def skill_install(
927939 # Check for team manifest and blocked skills enforcement
928940 team_manifest = None
929941 if not skip_blocked_check :
930- ext_path = project_path / ".specify" / "extensions" / "team-ai-directives"
931- if ext_path .exists ():
932- team_directives_path = str (ext_path )
942+ from . import get_team_directives_path
933943
944+ team_directives_path = get_team_directives_path (project_path )
934945 if team_directives_path :
935- team_directives = Path (team_directives_path )
936- if team_directives .exists ():
937- team_manifest = TeamSkillsManifest (team_directives )
938- if team_manifest .exists () and team_manifest .should_enforce_blocked ():
939- blocked = team_manifest .get_blocked_skills ()
940- for blocked_skill in blocked :
941- if blocked_skill in skill_ref or skill_ref in blocked_skill :
942- console .print (
943- f"[red]✗ Skill blocked by team policy:[/red] { skill_ref } \n "
944- f" Blocked pattern: { blocked_skill } \n "
945- f" Use --skip-blocked-check to override (not recommended)"
946- )
947- raise typer .Exit (1 )
946+ team_manifest = TeamSkillsManifest (team_directives_path )
947+ if team_manifest .exists () and team_manifest .should_enforce_blocked ():
948+ blocked = team_manifest .get_blocked_skills ()
949+ for blocked_skill in blocked :
950+ if blocked_skill in skill_ref or skill_ref in blocked_skill :
951+ console .print (
952+ f"[red]✗ Skill blocked by team policy:[/red] { skill_ref } \n "
953+ f" Blocked pattern: { blocked_skill } \n "
954+ f" Use --skip-blocked-check to override (not recommended)"
955+ )
956+ raise typer .Exit (1 )
948957
949958 installer = SkillInstaller (manifest , team_manifest )
950959
@@ -1227,8 +1236,9 @@ def skill_sync_team(
12271236
12281237 project_path = Path .cwd ()
12291238
1230- ext_path = project_path / ".specify" / "extensions" / "team-ai-directives"
1231- team_directives_path = str (ext_path ) if ext_path .exists () else None
1239+ from . import get_team_directives_path
1240+
1241+ team_directives_path = get_team_directives_path (project_path )
12321242
12331243 if not team_directives_path :
12341244 console .print (
@@ -1237,7 +1247,7 @@ def skill_sync_team(
12371247 )
12381248 return
12391249
1240- team_directives = Path ( team_directives_path )
1250+ team_directives = team_directives_path
12411251 if not team_directives .exists ():
12421252 console .print (f"[red]Team directives not found:[/red] { team_directives } " )
12431253 return
0 commit comments