Skip to content

feat: implement ai-skills command line switch#1600

Closed
dhilipkumars wants to merge 10 commits intogithub:mainfrom
dhilipkumars:feat/ai-skills
Closed

feat: implement ai-skills command line switch#1600
dhilipkumars wants to merge 10 commits intogithub:mainfrom
dhilipkumars:feat/ai-skills

Conversation

@dhilipkumars
Copy link
Contributor

@dhilipkumars dhilipkumars commented Feb 13, 2026

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 --help

--ai-skills                       Install Prompt.MD templates as agent skills (requires --ai)

Sample run

$specify init test-gemini --ai gemini --ai-skills --script sh

will result in

ls -lart test-gemini/.gemini/skills
total 0
drwxr-xr-x@  3 dhilipkumars  staff   96 Feb 13 10:33 speckit-analyze
drwxr-xr-x@  3 dhilipkumars  staff   96 Feb 13 10:33 speckit-checklist
drwxr-xr-x@  3 dhilipkumars  staff   96 Feb 13 10:33 speckit-clarify
drwxr-xr-x@  3 dhilipkumars  staff   96 Feb 13 10:33 speckit-constitution
drwxr-xr-x@  3 dhilipkumars  staff   96 Feb 13 10:33 speckit-implement
drwxr-xr-x@  3 dhilipkumars  staff   96 Feb 13 10:33 speckit-plan
drwxr-xr-x@  3 dhilipkumars  staff   96 Feb 13 10:33 speckit-specify
drwxr-xr-x@  3 dhilipkumars  staff   96 Feb 13 10:33 speckit-tasks
drwxr-xr-x@ 11 dhilipkumars  staff  352 Feb 13 10:33 .
drwxr-xr-x@  3 dhilipkumars  staff   96 Feb 13 10:33 speckit-taskstoissues
drwxr-xr-x@  3 dhilipkumars  staff   96 Feb 13 10:33 ..
image

ai coding agent: anti-gravity

Fixes #1585 , #1615

@dhilipkumars
Copy link
Contributor Author

dhilipkumars commented Feb 13, 2026

@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:

  • gemini = .gemini/skills
  • copilot = .github/skills

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 --ai flag 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.

@dhilipkumars dhilipkumars requested a review from Copilot February 13, 2026 16:31
@dhilipkumars dhilipkumars changed the title implement ai-skills command line switch feat: implement ai-skills command line switch Feb 13, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot AI review requested due to automatic review settings February 18, 2026 20:21
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot AI review requested due to automatic review settings February 18, 2026 21:50
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@dhilipkumars
Copy link
Contributor Author

@mnriem does the PR look good to you now?

@dhilipkumars
Copy link
Contributor Author

Fixes #1585

Copilot AI review requested due to automatic review settings February 19, 2026 18:25
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 init test doesn’t assert result.exit_code (or print result.output on failure). Add assert result.exit_code == 0 so the test can’t pass if init fails 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 init test doesn’t assert result.exit_code. Add assert result.exit_code == 0 (and consider asserting key output) to ensure the --here flow 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 packages src/specify_cli), which means --ai-skills will 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 via importlib.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.

@mnriem mnriem self-requested a review February 19, 2026 18:37
@mnriem mnriem self-assigned this Feb 19, 2026
@mnriem mnriem self-requested a review February 19, 2026 18:44
@mnriem mnriem self-requested a review February 19, 2026 18:49
@mnriem
Copy link
Collaborator

mnriem commented Feb 19, 2026

Superseded by PR #1632

Thank you for your excellent contribution!

@mnriem mnriem closed this Feb 19, 2026
@dhilipkumars
Copy link
Contributor Author

Thanks for cherry picking my commits to the other PR, sorry i don't know why this PR resulted in a non-mergable state.

@mnriem
Copy link
Collaborator

mnriem commented Feb 19, 2026

No problem. Really appreciate your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Agent Skills integration.

2 participants

Comments