Skip to content

Commit 0495c1e

Browse files
committed
fix: address nineteenth round of Copilot PR review feedback
- Keep non-skill agent reconciliation: reconciliation uses register_commands_for_non_skill_agents to avoid overwriting formatted SKILL.md content; _unregister_skills restores core/extension skills and _reconcile_skills handles lower-priority preset skills - Show composition error in CLI resolve: when has_composition is true, call resolve_content() and warn if composition cannot produce output (no base layer) instead of showing a misleading 'resolved' path
1 parent d052cd0 commit 0495c1e

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

src/specify_cli/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2610,7 +2610,12 @@ def preset_resolve(
26102610
and any(layer["strategy"] != "replace" for layer in layers)
26112611
)
26122612
if has_composition:
2613-
console.print(" [dim]Final output is composed from multiple preset layers; the path above is the highest-priority contributing layer.[/dim]")
2613+
# Verify composition is actually possible
2614+
composed = resolver.resolve_content(template_name)
2615+
if composed is None:
2616+
console.print(" [yellow]Warning: composition cannot produce output (no base layer with 'replace' strategy)[/yellow]")
2617+
else:
2618+
console.print(" [dim]Final output is composed from multiple preset layers; the path above is the highest-priority contributing layer.[/dim]")
26142619
console.print("\n [bold]Composition chain:[/bold]")
26152620
# Compute the effective base: the last consecutive replace layer
26162621
# from the bottom before the first non-replace (same logic as

src/specify_cli/presets.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -772,10 +772,12 @@ def _register_for_non_skill_agents(
772772
source_id: str,
773773
source_dir: Path,
774774
) -> None:
775-
"""Register commands for all non-skill agents.
775+
"""Register commands for all agents during reconciliation.
776776
777-
Used during reconciliation to avoid overwriting properly formatted
778-
SKILL.md files that were written by _register_skills().
777+
Uses the non-skill registrar for command agents, then relies on
778+
_reconcile_skills() (called separately) to properly format SKILL.md
779+
files for skill-based agents. This avoids overwriting properly
780+
formatted SKILL.md content with raw command file content.
779781
"""
780782
registrar.register_commands_for_non_skill_agents(
781783
commands, source_id, source_dir, self.project_root

0 commit comments

Comments
 (0)