feat: implement ai-skills command line switch#1600
feat: implement ai-skills command line switch#1600dhilipkumars wants to merge 10 commits intogithub:mainfrom
Conversation
|
@mnriem i re-worked on this a bit, i spent a little bit of time on this and realized each coding agent uses its own directory to store project specific skills, so sort of re-wrote it. PTAL. eg:
|
There was a problem hiding this comment.
Pull request overview
This PR implements a new --ai-skills command-line flag for the specify init command that installs Prompt.MD templates from templates/commands/ as agent skills following the agentskills.io specification. The feature creates SKILL.md files in agent-specific skills directories (e.g., .claude/skills/, .gemini/skills/) and optionally cleans up duplicate command files to prevent conflicts.
Changes:
- Added
install_ai_skills()function to convert 9 command templates into agent skills with enhanced descriptions - Added
_get_skills_dir()helper to resolve agent-specific skills directories with override support - Added validation requiring
--aiflag when using--ai-skills - Version bumped from 0.1.0 to 0.1.1
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 9 comments.
| File | Description |
|---|---|
| src/specify_cli/init.py | Core implementation: added yaml import, AGENT_SKILLS_DIR_OVERRIDES/SKILL_DESCRIPTIONS constants, install_ai_skills() and _get_skills_dir() functions, --ai-skills CLI option, validation logic, and tracker integration |
| pyproject.toml | Version bump from 0.1.0 to 0.1.1 |
| README.md | Added documentation for --ai-skills flag in options table and usage examples |
| CHANGELOG.md | Added 0.1.1 release notes documenting the new agent skills installation feature |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 19 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@mnriem does the PR look good to you now? |
|
Fixes #1585 |
2303a07 to
efb7a7d
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (4)
tests/test_ai_skills.py:509
- This end-to-end
inittest doesn’t assertresult.exit_code(or printresult.outputon failure). Addassert result.exit_code == 0so the test can’t pass ifinitfails after partially performing side effects.
result = runner.invoke(app, ["init", str(target), "--ai", "claude", "--ai-skills", "--script", "sh", "--no-git"])
tests/test_ai_skills.py:541
- This end-to-end
inittest doesn’t assertresult.exit_code. Addassert result.exit_code == 0(and consider asserting key output) to ensure the--hereflow succeeds and the command-preservation assertions aren’t passing after an early failure.
result = runner.invoke(app, ["init", "--here", "--ai", "claude", "--ai-skills", "--script", "sh", "--no-git"])
src/specify_cli/init.py:1062
- The repo-relative fallback (
Path(__file__).parent.parent.parent / "templates/commands") is unlikely to exist in an installed wheel (pyproject only packagessrc/specify_cli), which means--ai-skillswill silently do nothing for agents whose extracted commands aren’t Markdown (e.g., Gemini). Consider switching the fallback to a path inside the extracted project (such as.specify/templates/commands), or packaging the templates as package data and loading them viaimportlib.resources.
script_dir = Path(__file__).parent.parent.parent # up from src/specify_cli/
fallback_dir = script_dir / "templates" / "commands"
if fallback_dir.exists() and any(fallback_dir.glob("*.md")):
templates_dir = fallback_dir
src/specify_cli/init.py:1400
- New-project cleanup removes only
<agent_folder>/commands, but several agents don’t store commands there (e.g., Copilot.github/agents, Windsurf.windsurf/workflows, Kilo/Auggie/Roo.*/rules, Amazon Q.amazonq/prompts, opencode.opencode/command). With--ai-skills, this will leave both commands and skills for those agents, contradicting the “skills replace commands” behavior. Consider deriving the command directory from an agent-specific mapping (or from what was actually extracted) and removing that directory instead.
if skills_ok and not here:
agent_cfg = AGENT_CONFIG.get(selected_ai, {})
agent_folder = agent_cfg.get("folder", "")
if agent_folder:
cmds_dir = project_path / agent_folder.rstrip("/") / "commands"
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Superseded by PR #1632 Thank you for your excellent contribution! |
|
Thanks for cherry picking my commits to the other PR, sorry i don't know why this PR resulted in a non-mergable state. |
|
No problem. Really appreciate your contribution! |
Implements agent skills with a command line switch
--ai-skills, needs to be used in combination with--ai.Additional help text when you
specify init --helpSample run
will result in
ai coding agent: anti-gravity
Fixes #1585 , #1615