feat: Auto-register ai-skills for extensions whenever applicable#1840
Draft
dhilipkumars wants to merge 1 commit intogithub:mainfrom
Draft
feat: Auto-register ai-skills for extensions whenever applicable#1840dhilipkumars wants to merge 1 commit intogithub:mainfrom
dhilipkumars wants to merge 1 commit intogithub:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds automatic agent-skill (agentskills.io) generation for extension commands when a project was initialized with --ai-skills, and ensures those skills are tracked and cleaned up on extension removal.
Changes:
- Add skill directory detection plus skill register/unregister hooks to
ExtensionManager(tracked in extension registry metadata). - Update CLI output and docs to surface skill auto-registration behavior.
- Add comprehensive unit tests for skill creation, YAML parsing, non-overwrite behavior, and removal cleanup (including fallback cleanup when init-options change).
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
tests/test_extension_skills.py |
Adds unit tests covering extension skill auto-registration and cleanup behaviors. |
src/specify_cli/extensions.py |
Implements skill dir lookup, skill generation for extension commands, registry tracking, and uninstall cleanup (with fallback scan). |
src/specify_cli/__init__.py |
Updates extension add/remove CLI output to include registered skill counts. |
extensions/EXTENSION-USER-GUIDE.md |
Documents the new auto-registration behavior for agent skills. |
README.md |
Updates --ai-skills option description to mention extension command auto-registration. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| for cmd_info in manifest.commands: | ||
| cmd_name = cmd_info["name"] | ||
| cmd_file_rel = cmd_info["file"] | ||
| source_file = extension_dir / cmd_file_rel |
Comment on lines
+524
to
+529
|
|
||
| skill_content = ( | ||
| f"---\n" | ||
| f"{frontmatter_text}\n" | ||
| f"---\n\n" | ||
| f"# {skill_name.replace('-', ' ').replace('.', ' ').title()} Skill\n\n" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Testing
uv run specify --helpuv sync && uv run pytestAI Disclosure
Fixes: #1795