feat: add --agent-skills switch to init command#1561
feat: add --agent-skills switch to init command#1561dhilipkumars wants to merge 1 commit intogithub:mainfrom
Conversation
This change adds the --agent-skills switch to the init command, allowing users to automatically install agent skills from Prompt.MD templates. It also adds pyyaml as a dependency.
There was a problem hiding this comment.
Pull request overview
This PR adds support for automatically installing agent skills during project initialization by introducing the --agent-skills flag to the init command. The feature converts Prompt.MD template files from templates/commands/ into properly formatted SKILL.md files following the agentskills.io specification.
Changes:
- Added
install_agent_skills()function to convert Prompt.MD templates into agent skills with enhanced descriptions - Added
--agent-skillsCLI flag toinitcommand (requires--aiflag) - Added
pyyamldependency for YAML frontmatter parsing
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/specify_cli/init.py | Implements agent skills installation logic and adds CLI flag validation |
| pyproject.toml | Adds pyyaml dependency and bumps version to 0.0.23 |
| README.md | Documents the new --agent-skills flag with usage examples |
| CHANGELOG.md | Documents the feature addition for version 0.0.23 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| installed_count += 1 | ||
|
|
||
| except Exception as e: | ||
| console.print(f"[yellow]Warning: Failed to install skill {command_name}: {e}[/yellow]") |
There was a problem hiding this comment.
The error message references command_name which may not be defined if the exception occurs before line 1008. Consider using command_file.stem or wrapping in a try-except to ensure the variable is always available.
| console.print(f"[yellow]Warning: Failed to install skill {command_name}: {e}[/yellow]") | |
| skill_label = command_name if 'command_name' in locals() else command_file.stem | |
| console.print(f"[yellow]Warning: Failed to install skill {skill_label}: {e}[/yellow]") |
| skill_content = f"""--- | ||
| name: {skill_name} | ||
| description: {enhanced_desc} | ||
| compatibility: Requires git and spec-kit project structure with .specify/ directory |
There was a problem hiding this comment.
Inconsistent naming: the directory is referred to as .specify/ here but the actual skills are installed to .agent/ directory. This should be clarified or corrected to avoid confusion.
| compatibility: Requires git and spec-kit project structure with .specify/ directory | |
| compatibility: Requires git and spec-kit project structure with .agent/skills/ directory |
This change adds the --agent-skills switch to the init command, allowing users to automatically install agent skills from Prompt.MD templates. It also adds pyyaml as a dependency.