Skip to content

Commit 89fb41e

Browse files
committed
Add support for generic AI agents with customizable command directories
- Introduced `--ai generic` option for unsupported agents, allowing users to specify their own command directories. - Updated documentation and examples to reflect the new generic agent support. - Enhanced scripts and workflows to accommodate the new agent type.
1 parent 8d1fba3 commit 89fb41e

10 files changed

Lines changed: 83 additions & 21 deletions

File tree

.github/workflows/scripts/create-github-release.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,7 @@ gh release create "$VERSION" \
5252
.genreleases/spec-kit-template-agy-ps-"$VERSION".zip \
5353
.genreleases/spec-kit-template-bob-sh-"$VERSION".zip \
5454
.genreleases/spec-kit-template-bob-ps-"$VERSION".zip \
55+
.genreleases/spec-kit-template-generic-sh-"$VERSION".zip \
56+
.genreleases/spec-kit-template-generic-ps-"$VERSION".zip \
5557
--title "Spec Kit Templates - $VERSION_NO_V" \
5658
--notes-file release_notes.md

.github/workflows/scripts/create-release-packages.ps1

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
1515
.PARAMETER Agents
1616
Comma or space separated subset of agents to build (default: all)
17-
Valid agents: claude, gemini, copilot, cursor-agent, qwen, opencode, windsurf, codex, kilocode, auggie, roo, codebuddy, amp, q, bob, qoder
17+
Valid agents: claude, gemini, copilot, cursor-agent, qwen, opencode, windsurf, codex, kilocode, auggie, roo, codebuddy, amp, q, bob, qoder, generic
1818
1919
.PARAMETER Scripts
2020
Comma or space separated subset of script types to build (default: both)
@@ -347,6 +347,10 @@ function Build-Variant {
347347
$cmdDir = Join-Path $baseDir ".qoder/commands"
348348
Generate-Commands -Agent 'qoder' -Extension 'md' -ArgFormat '$ARGUMENTS' -OutputDir $cmdDir -ScriptVariant $Script
349349
}
350+
'generic' {
351+
$cmdDir = Join-Path $baseDir ".speckit/commands"
352+
Generate-Commands -Agent 'generic' -Extension 'md' -ArgFormat '$ARGUMENTS' -OutputDir $cmdDir -ScriptVariant $Script
353+
}
350354
}
351355

352356
# Create zip archive
@@ -356,7 +360,7 @@ function Build-Variant {
356360
}
357361

358362
# Define all agents and scripts
359-
$AllAgents = @('claude', 'gemini', 'copilot', 'cursor-agent', 'qwen', 'opencode', 'windsurf', 'codex', 'kilocode', 'auggie', 'roo', 'codebuddy', 'amp', 'q', 'bob', 'qoder')
363+
$AllAgents = @('claude', 'gemini', 'copilot', 'cursor-agent', 'qwen', 'opencode', 'windsurf', 'codex', 'kilocode', 'auggie', 'roo', 'codebuddy', 'amp', 'q', 'bob', 'qoder', 'generic')
360364
$AllScripts = @('sh', 'ps')
361365

362366
function Normalize-List {

.github/workflows/scripts/create-release-packages.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ set -euo pipefail
66
# Usage: .github/workflows/scripts/create-release-packages.sh <version>
77
# Version argument should include leading 'v'.
88
# Optionally set AGENTS and/or SCRIPTS env vars to limit what gets built.
9-
# AGENTS : space or comma separated subset of: claude gemini copilot cursor-agent qwen opencode windsurf codex amp shai bob (default: all)
9+
# AGENTS : space or comma separated subset of: claude gemini copilot cursor-agent qwen opencode windsurf codex amp shai bob generic (default: all)
1010
# SCRIPTS : space or comma separated subset of: sh ps (default: both)
1111
# Examples:
1212
# AGENTS=claude SCRIPTS=sh $0 v0.2.0
@@ -221,13 +221,16 @@ build_variant() {
221221
bob)
222222
mkdir -p "$base_dir/.bob/commands"
223223
generate_commands bob md "\$ARGUMENTS" "$base_dir/.bob/commands" "$script" ;;
224+
generic)
225+
mkdir -p "$base_dir/.speckit/commands"
226+
generate_commands generic md "\$ARGUMENTS" "$base_dir/.speckit/commands" "$script" ;;
224227
esac
225228
( cd "$base_dir" && zip -r "../spec-kit-template-${agent}-${script}-${NEW_VERSION}.zip" . )
226229
echo "Created $GENRELEASES_DIR/spec-kit-template-${agent}-${script}-${NEW_VERSION}.zip"
227230
}
228231

229232
# Determine agent list
230-
ALL_AGENTS=(claude gemini copilot cursor-agent qwen opencode windsurf codex kilocode auggie roo codebuddy amp shai q agy bob qoder)
233+
ALL_AGENTS=(claude gemini copilot cursor-agent qwen opencode windsurf codex kilocode auggie roo codebuddy amp shai q agy bob qoder generic)
231234
ALL_SCRIPTS=(sh ps)
232235

233236
norm_list() {

AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ Specify supports multiple AI agents by generating agent-specific command files a
4848
| **Amp** | `.agents/commands/` | Markdown | `amp` | Amp CLI |
4949
| **SHAI** | `.shai/commands/` | Markdown | `shai` | SHAI CLI |
5050
| **IBM Bob** | `.bob/commands/` | Markdown | N/A (IDE-based) | IBM Bob IDE |
51+
| **Generic** | User-specified via `--ai-commands-dir` | Markdown | N/A | Bring your own agent |
5152

5253
### Step-by-Step Integration Guide
5354

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ 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.1] - 2026-02-17
11+
12+
### Added
13+
14+
- **Generic Agent Support**: Added `--ai generic` option for unsupported AI agents ("bring your own agent")
15+
- Requires `--ai-commands-dir <path>` to specify where the agent reads commands from
16+
- Generates Markdown commands with `$ARGUMENTS` format (compatible with most agents)
17+
- Example: `specify init my-project --ai generic --ai-commands-dir .myagent/commands/`
18+
- Enables users to start with Spec Kit immediately while their agent awaits formal support
19+
1020
## [0.1.0] - 2026-01-28
1121

1222
### Added

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ Want to see Spec Kit in action? Watch our [video overview](https://www.youtube.c
163163
| [SHAI (OVHcloud)](https://github.com/ovh/shai) || |
164164
| [Windsurf](https://windsurf.com/) || |
165165
| [Antigravity (agy)](https://agy.ai/) || |
166+
| Generic || Bring your own agent — use `--ai generic --ai-commands-dir <path>` for unsupported agents |
166167

167168
## 🔧 Specify CLI Reference
168169

@@ -180,7 +181,8 @@ The `specify` command supports the following options:
180181
| Argument/Option | Type | Description |
181182
| ---------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
182183
| `<project-name>` | Argument | Name for your new project directory (optional if using `--here`, or use `.` for current directory) |
183-
| `--ai` | Option | AI assistant to use: `claude`, `gemini`, `copilot`, `cursor-agent`, `qwen`, `opencode`, `codex`, `windsurf`, `kilocode`, `auggie`, `roo`, `codebuddy`, `amp`, `shai`, `q`, `agy`, `bob`, or `qoder` |
184+
| `--ai` | Option | AI assistant to use: `claude`, `gemini`, `copilot`, `cursor-agent`, `qwen`, `opencode`, `codex`, `windsurf`, `kilocode`, `auggie`, `roo`, `codebuddy`, `amp`, `shai`, `q`, `agy`, `bob`, `qoder`, or `generic` (requires `--ai-commands-dir`) |
185+
| `--ai-commands-dir` | Option | Directory for agent command files (required with `--ai generic`, e.g. `.myagent/commands/`) |
184186
| `--script` | Option | Script variant to use: `sh` (bash/zsh) or `ps` (PowerShell) |
185187
| `--ignore-agent-tools` | Flag | Skip checks for AI agent tools like Claude Code |
186188
| `--no-git` | Flag | Skip git repository initialization |
@@ -217,6 +219,9 @@ specify init my-project --ai shai
217219
# Initialize with IBM Bob support
218220
specify init my-project --ai bob
219221

222+
# Initialize with an unsupported agent (generic / bring your own agent)
223+
specify init my-project --ai generic --ai-commands-dir .myagent/commands/
224+
220225
# Initialize with PowerShell scripts (Windows/cross-platform)
221226
specify init my-project --ai copilot --script ps
222227

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.0"
3+
version = "0.1.1"
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 = [

scripts/bash/update-agent-context.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,9 +637,12 @@ update_specific_agent() {
637637
bob)
638638
update_agent_file "$BOB_FILE" "IBM Bob"
639639
;;
640+
generic)
641+
log_info "Generic agent: no predefined context file. Use the agent-specific update script for your agent."
642+
;;
640643
*)
641644
log_error "Unknown agent type '$agent_type'"
642-
log_error "Expected: claude|gemini|copilot|cursor-agent|qwen|opencode|codex|windsurf|kilocode|auggie|roo|amp|shai|q|agy|bob|qoder"
645+
log_error "Expected: claude|gemini|copilot|cursor-agent|qwen|opencode|codex|windsurf|kilocode|auggie|roo|amp|shai|q|agy|bob|qoder|generic"
643646
exit 1
644647
;;
645648
esac

scripts/powershell/update-agent-context.ps1

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Relies on common helper functions in common.ps1
2525
#>
2626
param(
2727
[Parameter(Position=0)]
28-
[ValidateSet('claude','gemini','copilot','cursor-agent','qwen','opencode','codex','windsurf','kilocode','auggie','roo','codebuddy','amp','shai','q','agy','bob','qoder')]
28+
[ValidateSet('claude','gemini','copilot','cursor-agent','qwen','opencode','codex','windsurf','kilocode','auggie','roo','codebuddy','amp','shai','q','agy','bob','qoder','generic')]
2929
[string]$AgentType
3030
)
3131

@@ -390,7 +390,8 @@ function Update-SpecificAgent {
390390
'q' { Update-AgentFile -TargetFile $Q_FILE -AgentName 'Amazon Q Developer CLI' }
391391
'agy' { Update-AgentFile -TargetFile $AGY_FILE -AgentName 'Antigravity' }
392392
'bob' { Update-AgentFile -TargetFile $BOB_FILE -AgentName 'IBM Bob' }
393-
default { Write-Err "Unknown agent type '$Type'"; Write-Err 'Expected: claude|gemini|copilot|cursor-agent|qwen|opencode|codex|windsurf|kilocode|auggie|roo|codebuddy|amp|shai|q|agy|bob|qoder'; return $false }
393+
'generic' { Write-Info 'Generic agent: no predefined context file. Use the agent-specific update script for your agent.' }
394+
default { Write-Err "Unknown agent type '$Type'"; Write-Err 'Expected: claude|gemini|copilot|cursor-agent|qwen|opencode|codex|windsurf|kilocode|auggie|roo|codebuddy|amp|shai|q|agy|bob|qoder|generic'; return $false }
394395
}
395396
}
396397

@@ -427,7 +428,7 @@ function Print-Summary {
427428
if ($NEW_FRAMEWORK) { Write-Host " - Added framework: $NEW_FRAMEWORK" }
428429
if ($NEW_DB -and $NEW_DB -ne 'N/A') { Write-Host " - Added database: $NEW_DB" }
429430
Write-Host ''
430-
Write-Info 'Usage: ./update-agent-context.ps1 [-AgentType claude|gemini|copilot|cursor-agent|qwen|opencode|codex|windsurf|kilocode|auggie|roo|codebuddy|amp|shai|q|agy|bob|qoder]'
431+
Write-Info 'Usage: ./update-agent-context.ps1 [-AgentType claude|gemini|copilot|cursor-agent|qwen|opencode|codex|windsurf|kilocode|auggie|roo|codebuddy|amp|shai|q|agy|bob|qoder|generic]'
431432
}
432433

433434
function Main {

src/specify_cli/__init__.py

Lines changed: 44 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,12 @@ def _format_rate_limit_error(status_code: int, headers: httpx.Headers, url: str)
232232
"install_url": None, # IDE-based
233233
"requires_cli": False,
234234
},
235+
"generic": {
236+
"name": "Generic (bring your own agent)",
237+
"folder": None, # Set dynamically via --ai-commands-dir
238+
"install_url": None,
239+
"requires_cli": False,
240+
},
235241
}
236242

237243
SCRIPT_TYPE_CHOICES = {"sh": "POSIX Shell (bash/zsh)", "ps": "PowerShell"}
@@ -986,7 +992,8 @@ def ensure_constitution_from_template(project_path: Path, tracker: StepTracker |
986992
@app.command()
987993
def init(
988994
project_name: str = typer.Argument(None, help="Name for your new project directory (optional if using --here, or use '.' for current directory)"),
989-
ai_assistant: str = typer.Option(None, "--ai", help="AI assistant to use: claude, gemini, copilot, cursor-agent, qwen, opencode, codex, windsurf, kilocode, auggie, codebuddy, amp, shai, q, agy, bob, or qoder "),
995+
ai_assistant: str = typer.Option(None, "--ai", help="AI assistant to use: claude, gemini, copilot, cursor-agent, qwen, opencode, codex, windsurf, kilocode, auggie, codebuddy, amp, shai, q, agy, bob, qoder, or generic (requires --ai-commands-dir)"),
996+
ai_commands_dir: str = typer.Option(None, "--ai-commands-dir", help="Directory for agent command files (required with --ai generic, e.g. .myagent/commands/)"),
990997
script_type: str = typer.Option(None, "--script", help="Script type to use: sh or ps"),
991998
ignore_agent_tools: bool = typer.Option(False, "--ignore-agent-tools", help="Skip checks for AI agent tools like Claude Code"),
992999
no_git: bool = typer.Option(False, "--no-git", help="Skip git repository initialization"),
@@ -1019,6 +1026,7 @@ def init(
10191026
specify init --here --ai codebuddy
10201027
specify init --here
10211028
specify init --here --force # Skip confirmation when current directory not empty
1029+
specify init my-project --ai generic --ai-commands-dir .myagent/commands/ # Unsupported agent
10221030
"""
10231031

10241032
show_banner()
@@ -1098,6 +1106,16 @@ def init(
10981106
"copilot"
10991107
)
11001108

1109+
# Validate --ai-commands-dir usage
1110+
if selected_ai == "generic":
1111+
if not ai_commands_dir:
1112+
console.print("[red]Error:[/red] --ai-commands-dir is required when using --ai generic")
1113+
console.print("[dim]Example: specify init my-project --ai generic --ai-commands-dir .myagent/commands/[/dim]")
1114+
raise typer.Exit(1)
1115+
elif ai_commands_dir:
1116+
console.print(f"[red]Error:[/red] --ai-commands-dir can only be used with --ai generic (not '{selected_ai}')")
1117+
raise typer.Exit(1)
1118+
11011119
if not ignore_agent_tools:
11021120
agent_config = AGENT_CONFIG.get(selected_ai)
11031121
if agent_config and agent_config["requires_cli"]:
@@ -1168,6 +1186,18 @@ def init(
11681186

11691187
download_and_extract_template(project_path, selected_ai, selected_script, here, verbose=False, tracker=tracker, client=local_client, debug=debug, github_token=github_token)
11701188

1189+
# For generic agent, rename placeholder directory to user-specified path
1190+
if selected_ai == "generic" and ai_commands_dir:
1191+
placeholder_dir = project_path / ".speckit" / "commands"
1192+
target_dir = project_path / ai_commands_dir
1193+
if placeholder_dir.is_dir():
1194+
target_dir.parent.mkdir(parents=True, exist_ok=True)
1195+
shutil.move(str(placeholder_dir), str(target_dir))
1196+
# Clean up empty .speckit dir if it's now empty
1197+
speckit_dir = project_path / ".speckit"
1198+
if speckit_dir.is_dir() and not any(speckit_dir.iterdir()):
1199+
speckit_dir.rmdir()
1200+
11711201
ensure_executable_scripts(project_path, tracker=tracker)
11721202

11731203
ensure_constitution_from_template(project_path, tracker=tracker)
@@ -1230,16 +1260,17 @@ def init(
12301260
# Agent folder security notice
12311261
agent_config = AGENT_CONFIG.get(selected_ai)
12321262
if agent_config:
1233-
agent_folder = agent_config["folder"]
1234-
security_notice = Panel(
1235-
f"Some agents may store credentials, auth tokens, or other identifying and private artifacts in the agent folder within your project.\n"
1236-
f"Consider adding [cyan]{agent_folder}[/cyan] (or parts of it) to [cyan].gitignore[/cyan] to prevent accidental credential leakage.",
1237-
title="[yellow]Agent Folder Security[/yellow]",
1238-
border_style="yellow",
1239-
padding=(1, 2)
1240-
)
1241-
console.print()
1242-
console.print(security_notice)
1263+
agent_folder = ai_commands_dir if selected_ai == "generic" else agent_config["folder"]
1264+
if agent_folder:
1265+
security_notice = Panel(
1266+
f"Some agents may store credentials, auth tokens, or other identifying and private artifacts in the agent folder within your project.\n"
1267+
f"Consider adding [cyan]{agent_folder}[/cyan] (or parts of it) to [cyan].gitignore[/cyan] to prevent accidental credential leakage.",
1268+
title="[yellow]Agent Folder Security[/yellow]",
1269+
border_style="yellow",
1270+
padding=(1, 2)
1271+
)
1272+
console.print()
1273+
console.print(security_notice)
12431274

12441275
steps_lines = []
12451276
if not here:
@@ -1297,6 +1328,8 @@ def check():
12971328

12981329
agent_results = {}
12991330
for agent_key, agent_config in AGENT_CONFIG.items():
1331+
if agent_key == "generic":
1332+
continue # Generic is not a real agent to check
13001333
agent_name = agent_config["name"]
13011334
requires_cli = agent_config["requires_cli"]
13021335

0 commit comments

Comments
 (0)