Skip to content

Commit a1a0094

Browse files
committed
fix: add context_note to non-skill agent registration for extensions
Add context_note parameter to register_commands_for_non_skill_agents and pass extension name/id during reconciliation so rendered command files preserve the extension-specific context markers.
1 parent 697f056 commit a1a0094

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

src/specify_cli/agents.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -657,6 +657,7 @@ def register_commands_for_non_skill_agents(
657657
source_id: str,
658658
source_dir: Path,
659659
project_root: Path,
660+
context_note: str = None,
660661
) -> Dict[str, List[str]]:
661662
"""Register commands for all non-skill agents in the project.
662663
@@ -669,6 +670,7 @@ def register_commands_for_non_skill_agents(
669670
source_id: Identifier of the source
670671
source_dir: Directory containing command source files
671672
project_root: Path to project root
673+
context_note: Custom context comment for markdown output
672674
673675
Returns:
674676
Dictionary mapping agent names to list of registered commands
@@ -684,6 +686,7 @@ def register_commands_for_non_skill_agents(
684686
registered = self.register_commands(
685687
agent_name, commands, source_id,
686688
source_dir, project_root,
689+
context_note=context_note,
687690
)
688691
if registered:
689692
results[agent_name] = registered

src/specify_cli/presets.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -747,9 +747,11 @@ def _reconcile_composed_commands(self, command_names: List[str]) -> None:
747747
if c.get("name") == cmd_name
748748
]
749749
if matching_cmds:
750+
ext_name = ext_manifest.data.get("extension", {}).get("name", ext_id)
750751
registrar.register_commands_for_non_skill_agents(
751752
matching_cmds, ext_id, ext_dir,
752753
self.project_root,
754+
context_note=f"Extension: {ext_name} ({ext_id})",
753755
)
754756
registered = True
755757
except Exception:

0 commit comments

Comments
 (0)