Skip to content

Commit 1fd770b

Browse files
committed
refactor: consolidate agent configurations and improve test coverage
1 parent 61b0637 commit 1fd770b

File tree

5 files changed

+251
-257
lines changed

5 files changed

+251
-257
lines changed

AGENTS.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Follow these steps to add a new agent (using a hypothetical new agent as an exam
5858

5959
**IMPORTANT**: Use the actual CLI tool name as the key, not a shortened version.
6060

61-
Add the new agent to the `AGENT_CONFIG` dictionary in `src/specify_cli/__init__.py`. This is the **single source of truth** for all agent metadata:
61+
Add the new agent to the `AGENT_CONFIG` dictionary in `src/specify_cli/agent_config.py`. This is the **single source of truth** for all agent metadata:
6262

6363
```python
6464
AGENT_CONFIG = {
@@ -69,6 +69,9 @@ AGENT_CONFIG = {
6969
"commands_subdir": "commands", # Subdirectory name for command files (default: "commands")
7070
"install_url": "https://example.com/install", # URL for installation docs (or None if IDE-based)
7171
"requires_cli": True, # True if CLI tool required, False for IDE-based agents
72+
"command_format": "markdown", # File format for commands (markdown/toml)
73+
"command_args": "$ARGUMENTS", # Placeholder for arguments
74+
"command_extension": ".md", # File extension for commands
7275
},
7376
}
7477
```
@@ -90,6 +93,9 @@ This eliminates the need for special-case mappings throughout the codebase.
9093
- This field enables `--ai-skills` to locate command templates correctly for skill generation
9194
- `install_url`: Installation documentation URL (set to `None` for IDE-based agents)
9295
- `requires_cli`: Whether the agent requires a CLI tool check during initialization
96+
- `command_format`: The format used for generating command files (`"markdown"` or `"toml"`)
97+
- `command_args`: The placeholder string used for arguments (`"$ARGUMENTS"` or `"{{args}}"`)
98+
- `command_extension`: The file extension for generated commands (`".md"` or `".toml"`)
9399

94100
#### 2. Update CLI Help Text
95101

src/specify_cli/__init__.py

Lines changed: 1 addition & 136 deletions
Original file line numberDiff line numberDiff line change
@@ -123,142 +123,7 @@ 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, CLI tool requirement, and commands subdirectory
127-
AGENT_CONFIG = {
128-
"copilot": {
129-
"name": "GitHub Copilot",
130-
"folder": ".github/",
131-
"commands_subdir": "agents", # Special: uses agents/ not commands/
132-
"install_url": None, # IDE-based, no CLI check needed
133-
"requires_cli": False,
134-
},
135-
"claude": {
136-
"name": "Claude Code",
137-
"folder": ".claude/",
138-
"commands_subdir": "commands",
139-
"install_url": "https://docs.anthropic.com/en/docs/claude-code/setup",
140-
"requires_cli": True,
141-
},
142-
"gemini": {
143-
"name": "Gemini CLI",
144-
"folder": ".gemini/",
145-
"commands_subdir": "commands",
146-
"install_url": "https://github.com/google-gemini/gemini-cli",
147-
"requires_cli": True,
148-
},
149-
"cursor-agent": {
150-
"name": "Cursor",
151-
"folder": ".cursor/",
152-
"commands_subdir": "commands",
153-
"install_url": None, # IDE-based
154-
"requires_cli": False,
155-
},
156-
"qwen": {
157-
"name": "Qwen Code",
158-
"folder": ".qwen/",
159-
"commands_subdir": "commands",
160-
"install_url": "https://github.com/QwenLM/qwen-code",
161-
"requires_cli": True,
162-
},
163-
"opencode": {
164-
"name": "opencode",
165-
"folder": ".opencode/",
166-
"commands_subdir": "command", # Special: singular 'command' not 'commands'
167-
"install_url": "https://opencode.ai",
168-
"requires_cli": True,
169-
},
170-
"codex": {
171-
"name": "Codex CLI",
172-
"folder": ".codex/",
173-
"commands_subdir": "prompts", # Special: uses prompts/ not commands/
174-
"install_url": "https://github.com/openai/codex",
175-
"requires_cli": True,
176-
},
177-
"windsurf": {
178-
"name": "Windsurf",
179-
"folder": ".windsurf/",
180-
"commands_subdir": "workflows", # Special: uses workflows/ not commands/
181-
"install_url": None, # IDE-based
182-
"requires_cli": False,
183-
},
184-
"kilocode": {
185-
"name": "Kilo Code",
186-
"folder": ".kilocode/",
187-
"commands_subdir": "workflows", # Special: uses workflows/ not commands/
188-
"install_url": None, # IDE-based
189-
"requires_cli": False,
190-
},
191-
"auggie": {
192-
"name": "Auggie CLI",
193-
"folder": ".augment/",
194-
"commands_subdir": "commands",
195-
"install_url": "https://docs.augmentcode.com/cli/setup-auggie/install-auggie-cli",
196-
"requires_cli": True,
197-
},
198-
"codebuddy": {
199-
"name": "CodeBuddy",
200-
"folder": ".codebuddy/",
201-
"commands_subdir": "commands",
202-
"install_url": "https://www.codebuddy.ai/cli",
203-
"requires_cli": True,
204-
},
205-
"qodercli": {
206-
"name": "Qoder CLI",
207-
"folder": ".qoder/",
208-
"commands_subdir": "commands",
209-
"install_url": "https://qoder.com/cli",
210-
"requires_cli": True,
211-
},
212-
"roo": {
213-
"name": "Roo Code",
214-
"folder": ".roo/",
215-
"commands_subdir": "commands",
216-
"install_url": None, # IDE-based
217-
"requires_cli": False,
218-
},
219-
"q": {
220-
"name": "Amazon Q Developer CLI",
221-
"folder": ".amazonq/",
222-
"commands_subdir": "prompts", # Special: uses prompts/ not commands/
223-
"install_url": "https://aws.amazon.com/developer/learning/q-developer-cli/",
224-
"requires_cli": True,
225-
},
226-
"amp": {
227-
"name": "Amp",
228-
"folder": ".agents/",
229-
"commands_subdir": "commands",
230-
"install_url": "https://ampcode.com/manual#install",
231-
"requires_cli": True,
232-
},
233-
"shai": {
234-
"name": "SHAI",
235-
"folder": ".shai/",
236-
"commands_subdir": "commands",
237-
"install_url": "https://github.com/ovh/shai",
238-
"requires_cli": True,
239-
},
240-
"agy": {
241-
"name": "Antigravity",
242-
"folder": ".agent/",
243-
"commands_subdir": "workflows", # Special: uses workflows/ not commands/
244-
"install_url": None, # IDE-based
245-
"requires_cli": False,
246-
},
247-
"bob": {
248-
"name": "IBM Bob",
249-
"folder": ".bob/",
250-
"commands_subdir": "commands",
251-
"install_url": None, # IDE-based
252-
"requires_cli": False,
253-
},
254-
"generic": {
255-
"name": "Generic (bring your own agent)",
256-
"folder": None, # Set dynamically via --ai-commands-dir
257-
"commands_subdir": "commands",
258-
"install_url": None,
259-
"requires_cli": False,
260-
},
261-
}
126+
from .agent_config import AGENT_CONFIG
262127

263128
SCRIPT_TYPE_CHOICES = {"sh": "POSIX Shell (bash/zsh)", "ps": "PowerShell"}
264129

src/specify_cli/agent_config.py

Lines changed: 202 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,202 @@
1+
"""
2+
Agent configurations for specify-cli.
3+
Shared between CLI initialization and the extension system.
4+
"""
5+
6+
# Default values for agent metadata
7+
DEFAULT_FORMAT = "markdown"
8+
DEFAULT_ARGS = "$ARGUMENTS"
9+
DEFAULT_EXTENSION = ".md"
10+
11+
AGENT_CONFIG = {
12+
"copilot": {
13+
"name": "GitHub Copilot",
14+
"folder": ".github/",
15+
"commands_subdir": "agents",
16+
"install_url": None,
17+
"requires_cli": False,
18+
"command_format": DEFAULT_FORMAT,
19+
"command_args": DEFAULT_ARGS,
20+
"command_extension": DEFAULT_EXTENSION,
21+
},
22+
"claude": {
23+
"name": "Claude Code",
24+
"folder": ".claude/",
25+
"commands_subdir": "commands",
26+
"install_url": "https://docs.anthropic.com/en/docs/claude-code/setup",
27+
"requires_cli": True,
28+
"command_format": DEFAULT_FORMAT,
29+
"command_args": DEFAULT_ARGS,
30+
"command_extension": DEFAULT_EXTENSION,
31+
},
32+
"gemini": {
33+
"name": "Gemini CLI",
34+
"folder": ".gemini/",
35+
"commands_subdir": "commands",
36+
"install_url": "https://github.com/google-gemini/gemini-cli",
37+
"requires_cli": True,
38+
"command_format": "toml",
39+
"command_args": "{{args}}",
40+
"command_extension": ".toml",
41+
},
42+
"cursor-agent": {
43+
"name": "Cursor",
44+
"folder": ".cursor/",
45+
"commands_subdir": "commands",
46+
"install_url": None,
47+
"requires_cli": False,
48+
"command_format": DEFAULT_FORMAT,
49+
"command_args": DEFAULT_ARGS,
50+
"command_extension": DEFAULT_EXTENSION,
51+
},
52+
"qwen": {
53+
"name": "Qwen Code",
54+
"folder": ".qwen/",
55+
"commands_subdir": "commands",
56+
"install_url": "https://github.com/QwenLM/qwen-code",
57+
"requires_cli": True,
58+
"command_format": "toml",
59+
"command_args": "{{args}}",
60+
"command_extension": ".toml",
61+
},
62+
"opencode": {
63+
"name": "opencode",
64+
"folder": ".opencode/",
65+
"commands_subdir": "command",
66+
"install_url": "https://opencode.ai",
67+
"requires_cli": True,
68+
"command_format": DEFAULT_FORMAT,
69+
"command_args": DEFAULT_ARGS,
70+
"command_extension": DEFAULT_EXTENSION,
71+
},
72+
"codex": {
73+
"name": "Codex CLI",
74+
"folder": ".codex/",
75+
"commands_subdir": "prompts",
76+
"install_url": "https://github.com/openai/codex",
77+
"requires_cli": True,
78+
"command_format": DEFAULT_FORMAT,
79+
"command_args": DEFAULT_ARGS,
80+
"command_extension": DEFAULT_EXTENSION,
81+
},
82+
"windsurf": {
83+
"name": "Windsurf",
84+
"folder": ".windsurf/",
85+
"commands_subdir": "workflows",
86+
"install_url": None,
87+
"requires_cli": False,
88+
"command_format": DEFAULT_FORMAT,
89+
"command_args": DEFAULT_ARGS,
90+
"command_extension": DEFAULT_EXTENSION,
91+
},
92+
"kilocode": {
93+
"name": "Kilo Code",
94+
"folder": ".kilocode/",
95+
"commands_subdir": "rules",
96+
"install_url": None,
97+
"requires_cli": False,
98+
"command_format": DEFAULT_FORMAT,
99+
"command_args": DEFAULT_ARGS,
100+
"command_extension": DEFAULT_EXTENSION,
101+
},
102+
"auggie": {
103+
"name": "Auggie CLI",
104+
"folder": ".augment/",
105+
"commands_subdir": "rules",
106+
"install_url": "https://docs.augmentcode.com/cli/setup-auggie/install-auggie-cli",
107+
"requires_cli": True,
108+
"command_format": DEFAULT_FORMAT,
109+
"command_args": DEFAULT_ARGS,
110+
"command_extension": DEFAULT_EXTENSION,
111+
},
112+
"codebuddy": {
113+
"name": "CodeBuddy",
114+
"folder": ".codebuddy/",
115+
"commands_subdir": "commands",
116+
"install_url": "https://www.codebuddy.ai/cli",
117+
"requires_cli": True,
118+
"command_format": DEFAULT_FORMAT,
119+
"command_args": DEFAULT_ARGS,
120+
"command_extension": DEFAULT_EXTENSION,
121+
},
122+
"qodercli": {
123+
"name": "Qoder CLI",
124+
"folder": ".qoder/",
125+
"commands_subdir": "commands",
126+
"install_url": "https://qoder.com/cli",
127+
"requires_cli": True,
128+
"command_format": DEFAULT_FORMAT,
129+
"command_args": DEFAULT_ARGS,
130+
"command_extension": DEFAULT_EXTENSION,
131+
},
132+
"roo": {
133+
"name": "Roo Code",
134+
"folder": ".roo/",
135+
"commands_subdir": "rules",
136+
"install_url": None,
137+
"requires_cli": False,
138+
"command_format": DEFAULT_FORMAT,
139+
"command_args": DEFAULT_ARGS,
140+
"command_extension": DEFAULT_EXTENSION,
141+
},
142+
"q": {
143+
"name": "Amazon Q Developer CLI",
144+
"folder": ".amazonq/",
145+
"commands_subdir": "prompts",
146+
"install_url": "https://aws.amazon.com/developer/learning/q-developer-cli/",
147+
"requires_cli": True,
148+
"command_format": DEFAULT_FORMAT,
149+
"command_args": DEFAULT_ARGS,
150+
"command_extension": DEFAULT_EXTENSION,
151+
},
152+
"amp": {
153+
"name": "Amp",
154+
"folder": ".agents/",
155+
"commands_subdir": "commands",
156+
"install_url": "https://ampcode.com/manual#install",
157+
"requires_cli": True,
158+
"command_format": DEFAULT_FORMAT,
159+
"command_args": DEFAULT_ARGS,
160+
"command_extension": DEFAULT_EXTENSION,
161+
},
162+
"shai": {
163+
"name": "SHAI",
164+
"folder": ".shai/",
165+
"commands_subdir": "commands",
166+
"install_url": "https://github.com/ovh/shai",
167+
"requires_cli": True,
168+
"command_format": DEFAULT_FORMAT,
169+
"command_args": DEFAULT_ARGS,
170+
"command_extension": DEFAULT_EXTENSION,
171+
},
172+
"agy": {
173+
"name": "Antigravity",
174+
"folder": ".agent/",
175+
"commands_subdir": "workflows",
176+
"install_url": None,
177+
"requires_cli": False,
178+
"command_format": DEFAULT_FORMAT,
179+
"command_args": DEFAULT_ARGS,
180+
"command_extension": DEFAULT_EXTENSION,
181+
},
182+
"bob": {
183+
"name": "IBM Bob",
184+
"folder": ".bob/",
185+
"commands_subdir": "commands",
186+
"install_url": None,
187+
"requires_cli": False,
188+
"command_format": DEFAULT_FORMAT,
189+
"command_args": DEFAULT_ARGS,
190+
"command_extension": DEFAULT_EXTENSION,
191+
},
192+
"generic": {
193+
"name": "Generic (bring your own agent)",
194+
"folder": None,
195+
"commands_subdir": "commands",
196+
"install_url": None,
197+
"requires_cli": False,
198+
"command_format": DEFAULT_FORMAT,
199+
"command_args": DEFAULT_ARGS,
200+
"command_extension": DEFAULT_EXTENSION,
201+
},
202+
}

0 commit comments

Comments
 (0)