Skip to content

Commit 6f523ed

Browse files
authored
Fix #1658: Add commands_subdir field to support non-standard agent directory structures (#1660)
- Added commands_subdir field to AGENT_CONFIG for all agents - Updated install_ai_skills() to use commands_subdir instead of hardcoded 'commands' - Fixed --ai-skills flag for copilot, opencode, windsurf, codex, kilocode, q, and agy - Bumped version to 0.1.5 - Updated AGENTS.md documentation with new field Affected agents now correctly locate their command templates: - copilot: .github/agents/ - opencode: .opencode/command/ (singular) - windsurf: .windsurf/workflows/ - codex: .codex/prompts/ - kilocode: .kilocode/workflows/ - q: .amazonq/prompts/ - agy: .agent/workflows/ All 51 tests pass.
1 parent 68d1d3a commit 6f523ed

File tree

4 files changed

+38
-4
lines changed

4 files changed

+38
-4
lines changed

AGENTS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ AGENT_CONFIG = {
6666
"new-agent-cli": { # Use the ACTUAL CLI tool name (what users type in terminal)
6767
"name": "New Agent Display Name",
6868
"folder": ".newagent/", # Directory for agent files
69+
"commands_subdir": "commands", # Subdirectory name for command files (default: "commands")
6970
"install_url": "https://example.com/install", # URL for installation docs (or None if IDE-based)
7071
"requires_cli": True, # True if CLI tool required, False for IDE-based agents
7172
},
@@ -83,6 +84,10 @@ This eliminates the need for special-case mappings throughout the codebase.
8384

8485
- `name`: Human-readable display name shown to users
8586
- `folder`: Directory where agent-specific files are stored (relative to project root)
87+
- `commands_subdir`: Subdirectory name within the agent folder where command/prompt files are stored (default: `"commands"`)
88+
- Most agents use `"commands"` (e.g., `.claude/commands/`)
89+
- Some agents use alternative names: `"agents"` (copilot), `"workflows"` (windsurf, kilocode, agy), `"prompts"` (codex, q), `"command"` (opencode - singular)
90+
- This field enables `--ai-skills` to locate command templates correctly for skill generation
8691
- `install_url`: Installation documentation URL (set to `None` for IDE-based agents)
8792
- `requires_cli`: Whether the agent requires a CLI tool check during initialization
8893

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ All notable changes to the Specify CLI and templates are documented here.
77
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
88
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
99

10+
## [0.1.5] - Unreleased
11+
12+
### Fixed
13+
14+
- **AI Skills Installation Bug (#1658)**: Fixed `--ai-skills` flag not generating skill files for GitHub Copilot and other agents with non-standard command directory structures
15+
- Added `commands_subdir` field to `AGENT_CONFIG` to explicitly specify the subdirectory name for each agent
16+
- Affected agents now work correctly: copilot (`.github/agents/`), opencode (`.opencode/command/`), windsurf (`.windsurf/workflows/`), codex (`.codex/prompts/`), kilocode (`.kilocode/workflows/`), q (`.amazonq/prompts/`), and agy (`.agent/workflows/`)
17+
- The `install_ai_skills()` function now uses the correct path for all agents instead of assuming `commands/` for everyone
18+
1019
## [0.1.4] - Unreleased
1120

1221
### Fixed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "specify-cli"
3-
version = "0.1.4"
3+
version = "0.1.5"
44
description = "Specify CLI, part of GitHub Spec Kit. A tool to bootstrap your projects for Spec-Driven Development (SDD)."
55
requires-python = ">=3.11"
66
dependencies = [

src/specify_cli/__init__.py

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,119 +123,138 @@ def _format_rate_limit_error(status_code: int, headers: httpx.Headers, url: str)
123123

124124
return "\n".join(lines)
125125

126-
# Agent configuration with name, folder, install URL, and CLI tool requirement
126+
# Agent configuration with name, folder, install URL, CLI tool requirement, and commands subdirectory
127127
AGENT_CONFIG = {
128128
"copilot": {
129129
"name": "GitHub Copilot",
130130
"folder": ".github/",
131+
"commands_subdir": "agents", # Special: uses agents/ not commands/
131132
"install_url": None, # IDE-based, no CLI check needed
132133
"requires_cli": False,
133134
},
134135
"claude": {
135136
"name": "Claude Code",
136137
"folder": ".claude/",
138+
"commands_subdir": "commands",
137139
"install_url": "https://docs.anthropic.com/en/docs/claude-code/setup",
138140
"requires_cli": True,
139141
},
140142
"gemini": {
141143
"name": "Gemini CLI",
142144
"folder": ".gemini/",
145+
"commands_subdir": "commands",
143146
"install_url": "https://github.com/google-gemini/gemini-cli",
144147
"requires_cli": True,
145148
},
146149
"cursor-agent": {
147150
"name": "Cursor",
148151
"folder": ".cursor/",
152+
"commands_subdir": "commands",
149153
"install_url": None, # IDE-based
150154
"requires_cli": False,
151155
},
152156
"qwen": {
153157
"name": "Qwen Code",
154158
"folder": ".qwen/",
159+
"commands_subdir": "commands",
155160
"install_url": "https://github.com/QwenLM/qwen-code",
156161
"requires_cli": True,
157162
},
158163
"opencode": {
159164
"name": "opencode",
160165
"folder": ".opencode/",
166+
"commands_subdir": "command", # Special: singular 'command' not 'commands'
161167
"install_url": "https://opencode.ai",
162168
"requires_cli": True,
163169
},
164170
"codex": {
165171
"name": "Codex CLI",
166172
"folder": ".codex/",
173+
"commands_subdir": "prompts", # Special: uses prompts/ not commands/
167174
"install_url": "https://github.com/openai/codex",
168175
"requires_cli": True,
169176
},
170177
"windsurf": {
171178
"name": "Windsurf",
172179
"folder": ".windsurf/",
180+
"commands_subdir": "workflows", # Special: uses workflows/ not commands/
173181
"install_url": None, # IDE-based
174182
"requires_cli": False,
175183
},
176184
"kilocode": {
177185
"name": "Kilo Code",
178186
"folder": ".kilocode/",
187+
"commands_subdir": "workflows", # Special: uses workflows/ not commands/
179188
"install_url": None, # IDE-based
180189
"requires_cli": False,
181190
},
182191
"auggie": {
183192
"name": "Auggie CLI",
184193
"folder": ".augment/",
194+
"commands_subdir": "commands",
185195
"install_url": "https://docs.augmentcode.com/cli/setup-auggie/install-auggie-cli",
186196
"requires_cli": True,
187197
},
188198
"codebuddy": {
189199
"name": "CodeBuddy",
190200
"folder": ".codebuddy/",
201+
"commands_subdir": "commands",
191202
"install_url": "https://www.codebuddy.ai/cli",
192203
"requires_cli": True,
193204
},
194205
"qodercli": {
195206
"name": "Qoder CLI",
196207
"folder": ".qoder/",
208+
"commands_subdir": "commands",
197209
"install_url": "https://qoder.com/cli",
198210
"requires_cli": True,
199211
},
200212
"roo": {
201213
"name": "Roo Code",
202214
"folder": ".roo/",
215+
"commands_subdir": "commands",
203216
"install_url": None, # IDE-based
204217
"requires_cli": False,
205218
},
206219
"q": {
207220
"name": "Amazon Q Developer CLI",
208221
"folder": ".amazonq/",
222+
"commands_subdir": "prompts", # Special: uses prompts/ not commands/
209223
"install_url": "https://aws.amazon.com/developer/learning/q-developer-cli/",
210224
"requires_cli": True,
211225
},
212226
"amp": {
213227
"name": "Amp",
214228
"folder": ".agents/",
229+
"commands_subdir": "commands",
215230
"install_url": "https://ampcode.com/manual#install",
216231
"requires_cli": True,
217232
},
218233
"shai": {
219234
"name": "SHAI",
220235
"folder": ".shai/",
236+
"commands_subdir": "commands",
221237
"install_url": "https://github.com/ovh/shai",
222238
"requires_cli": True,
223239
},
224240
"agy": {
225241
"name": "Antigravity",
226242
"folder": ".agent/",
243+
"commands_subdir": "workflows", # Special: uses workflows/ not commands/
227244
"install_url": None, # IDE-based
228245
"requires_cli": False,
229246
},
230247
"bob": {
231248
"name": "IBM Bob",
232249
"folder": ".bob/",
250+
"commands_subdir": "commands",
233251
"install_url": None, # IDE-based
234252
"requires_cli": False,
235253
},
236254
"generic": {
237255
"name": "Generic (bring your own agent)",
238256
"folder": None, # Set dynamically via --ai-commands-dir
257+
"commands_subdir": "commands",
239258
"install_url": None,
240259
"requires_cli": False,
241260
},
@@ -1056,10 +1075,11 @@ def install_ai_skills(project_path: Path, selected_ai: str, tracker: StepTracker
10561075
# download_and_extract_template() already placed the .md files here.
10571076
agent_config = AGENT_CONFIG.get(selected_ai, {})
10581077
agent_folder = agent_config.get("folder", "")
1078+
commands_subdir = agent_config.get("commands_subdir", "commands")
10591079
if agent_folder:
1060-
templates_dir = project_path / agent_folder.rstrip("/") / "commands"
1080+
templates_dir = project_path / agent_folder.rstrip("/") / commands_subdir
10611081
else:
1062-
templates_dir = project_path / "commands"
1082+
templates_dir = project_path / commands_subdir
10631083

10641084
if not templates_dir.exists() or not any(templates_dir.glob("*.md")):
10651085
# Fallback: try the repo-relative path (for running from source checkout)

0 commit comments

Comments
 (0)