Skip to content

Commit 7217df4

Browse files
committed
fix: PS1 no-python warning, integration hook for override skills, alias cleanup
- Warn when no Python 3 found in PS1 and presets use composition strategies - Apply post_process_skill_content integration hook when restoring override-backed skills so agent-specific flags are preserved - Unregister command aliases alongside primary name when composition fails to prevent orphaned alias files
1 parent d5875f7 commit 7217df4

2 files changed

Lines changed: 28 additions & 1 deletion

File tree

scripts/powershell/common.ps1

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,16 @@ function Resolve-TemplateContent {
414414

415415
if ($sortedPresets.Count -gt 0) {
416416
$pyCmd = Get-Python3Command
417+
if (-not $pyCmd) {
418+
# Check if any preset has strategy fields that would be ignored
419+
foreach ($pid in $sortedPresets) {
420+
$mf = Join-Path $presetsDir "$pid/preset.yml"
421+
if ((Test-Path $mf) -and (Select-String -Path $mf -Pattern 'strategy:' -Quiet -ErrorAction SilentlyContinue)) {
422+
Write-Warning "No Python 3 found; preset composition strategies will be ignored"
423+
break
424+
}
425+
}
426+
}
417427
foreach ($presetId in $sortedPresets) {
418428
# Read strategy and file path from preset manifest
419429
$strategy = 'replace'

src/specify_cli/presets.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -777,8 +777,20 @@ def _reconcile_composed_commands(self, command_names: List[str]) -> None:
777777
stacklevel=2,
778778
)
779779
registrar._ensure_configs()
780+
# Include aliases from the top layer's manifest
781+
cmd_names_to_unregister = [cmd_name]
782+
for _pid, _meta in presets_by_priority:
783+
_pd = self.presets_dir / _pid
784+
_m = resolver._get_manifest(_pd)
785+
if _m:
786+
for _t in _m.templates:
787+
if _t.get("name") == cmd_name and _t.get("type") == "command":
788+
for alias in _t.get("aliases", []):
789+
if isinstance(alias, str):
790+
cmd_names_to_unregister.append(alias)
791+
break
780792
registrar.unregister_commands(
781-
{agent: [cmd_name] for agent in registrar.AGENT_CONFIGS
793+
{agent: cmd_names_to_unregister for agent in registrar.AGENT_CONFIGS
782794
if registrar.AGENT_CONFIGS[agent].get("extension") != "/SKILL.md"},
783795
self.project_root,
784796
)
@@ -1034,6 +1046,11 @@ def _reconcile_skills(self, command_names: List[str]) -> None:
10341046
f"---\n{fm_text}\n---\n\n"
10351047
f"# Speckit {skill_title} Skill\n\n{body}\n"
10361048
)
1049+
# Apply integration post-processing (e.g. Claude flags)
1050+
from .integrations import get_integration
1051+
integration = get_integration(selected_ai) if isinstance(selected_ai, str) else None
1052+
if integration is not None and hasattr(integration, "post_process_skill_content"):
1053+
skill_content = integration.post_process_skill_content(skill_content)
10371054
skill_file.write_text(skill_content, encoding="utf-8")
10381055
except Exception:
10391056
pass # best-effort override skill restoration

0 commit comments

Comments
 (0)