Skip to content

Commit aac73d5

Browse files
mnriemCopilot
andcommitted
Add generic agent support with customizable command directories
- Add --ai generic option for unsupported AI agents (bring your own agent) - Require --ai-commands-dir to specify where agent reads commands from - Generate Markdown commands with $ARGUMENTS format (compatible with most agents) - Rebuild CHANGELOG from GitHub releases (last 10 releases) - Align version to 0.1.3 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 6fca5d8 commit aac73d5

File tree

11 files changed

+102
-309
lines changed

11 files changed

+102
-309
lines changed

.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: 28 additions & 287 deletions
Large diffs are not rendered by default.

README.md

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

166167
## 🔧 Specify CLI Reference
167168

@@ -179,7 +180,8 @@ The `specify` command supports the following options:
179180
| Argument/Option | Type | Description |
180181
| ---------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
181182
| `<project-name>` | Argument | Name for your new project directory (optional if using `--here`, or use `.` for current directory) |
182-
| `--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` |
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`, `qoder`, or `generic` (requires `--ai-commands-dir`) |
184+
| `--ai-commands-dir` | Option | Directory for agent command files (required with `--ai generic`, e.g. `.myagent/commands/`) |
183185
| `--script` | Option | Script variant to use: `sh` (bash/zsh) or `ps` (PowerShell) |
184186
| `--ignore-agent-tools` | Flag | Skip checks for AI agent tools like Claude Code |
185187
| `--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.2"
3+
version = "0.1.3"
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
@@ -233,6 +233,12 @@ def _format_rate_limit_error(status_code: int, headers: httpx.Headers, url: str)
233233
"install_url": None, # IDE-based
234234
"requires_cli": False,
235235
},
236+
"generic": {
237+
"name": "Generic (bring your own agent)",
238+
"folder": None, # Set dynamically via --ai-commands-dir
239+
"install_url": None,
240+
"requires_cli": False,
241+
},
236242
}
237243

238244
SCRIPT_TYPE_CHOICES = {"sh": "POSIX Shell (bash/zsh)", "ps": "PowerShell"}
@@ -1188,7 +1194,8 @@ def install_ai_skills(project_path: Path, selected_ai: str, tracker: StepTracker
11881194
@app.command()
11891195
def init(
11901196
project_name: str = typer.Argument(None, help="Name for your new project directory (optional if using --here, or use '.' for current directory)"),
1191-
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 "),
1197+
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)"),
1198+
ai_commands_dir: str = typer.Option(None, "--ai-commands-dir", help="Directory for agent command files (required with --ai generic, e.g. .myagent/commands/)"),
11921199
script_type: str = typer.Option(None, "--script", help="Script type to use: sh or ps"),
11931200
ignore_agent_tools: bool = typer.Option(False, "--ignore-agent-tools", help="Skip checks for AI agent tools like Claude Code"),
11941201
no_git: bool = typer.Option(False, "--no-git", help="Skip git repository initialization"),
@@ -1224,6 +1231,7 @@ def init(
12241231
specify init --here --force # Skip confirmation when current directory not empty
12251232
specify init my-project --ai claude --ai-skills # Install agent skills
12261233
specify init --here --ai gemini --ai-skills
1234+
specify init my-project --ai generic --ai-commands-dir .myagent/commands/ # Unsupported agent
12271235
"""
12281236

12291237
show_banner()
@@ -1308,6 +1316,16 @@ def init(
13081316
"copilot"
13091317
)
13101318

1319+
# Validate --ai-commands-dir usage
1320+
if selected_ai == "generic":
1321+
if not ai_commands_dir:
1322+
console.print("[red]Error:[/red] --ai-commands-dir is required when using --ai generic")
1323+
console.print("[dim]Example: specify init my-project --ai generic --ai-commands-dir .myagent/commands/[/dim]")
1324+
raise typer.Exit(1)
1325+
elif ai_commands_dir:
1326+
console.print(f"[red]Error:[/red] --ai-commands-dir can only be used with --ai generic (not '{selected_ai}')")
1327+
raise typer.Exit(1)
1328+
13111329
if not ignore_agent_tools:
13121330
agent_config = AGENT_CONFIG.get(selected_ai)
13131331
if agent_config and agent_config["requires_cli"]:
@@ -1383,6 +1401,18 @@ def init(
13831401

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

1404+
# For generic agent, rename placeholder directory to user-specified path
1405+
if selected_ai == "generic" and ai_commands_dir:
1406+
placeholder_dir = project_path / ".speckit" / "commands"
1407+
target_dir = project_path / ai_commands_dir
1408+
if placeholder_dir.is_dir():
1409+
target_dir.parent.mkdir(parents=True, exist_ok=True)
1410+
shutil.move(str(placeholder_dir), str(target_dir))
1411+
# Clean up empty .speckit dir if it's now empty
1412+
speckit_dir = project_path / ".speckit"
1413+
if speckit_dir.is_dir() and not any(speckit_dir.iterdir()):
1414+
speckit_dir.rmdir()
1415+
13861416
ensure_executable_scripts(project_path, tracker=tracker)
13871417

13881418
ensure_constitution_from_template(project_path, tracker=tracker)
@@ -1468,16 +1498,17 @@ def init(
14681498
# Agent folder security notice
14691499
agent_config = AGENT_CONFIG.get(selected_ai)
14701500
if agent_config:
1471-
agent_folder = agent_config["folder"]
1472-
security_notice = Panel(
1473-
f"Some agents may store credentials, auth tokens, or other identifying and private artifacts in the agent folder within your project.\n"
1474-
f"Consider adding [cyan]{agent_folder}[/cyan] (or parts of it) to [cyan].gitignore[/cyan] to prevent accidental credential leakage.",
1475-
title="[yellow]Agent Folder Security[/yellow]",
1476-
border_style="yellow",
1477-
padding=(1, 2)
1478-
)
1479-
console.print()
1480-
console.print(security_notice)
1501+
agent_folder = ai_commands_dir if selected_ai == "generic" else agent_config["folder"]
1502+
if agent_folder:
1503+
security_notice = Panel(
1504+
f"Some agents may store credentials, auth tokens, or other identifying and private artifacts in the agent folder within your project.\n"
1505+
f"Consider adding [cyan]{agent_folder}[/cyan] (or parts of it) to [cyan].gitignore[/cyan] to prevent accidental credential leakage.",
1506+
title="[yellow]Agent Folder Security[/yellow]",
1507+
border_style="yellow",
1508+
padding=(1, 2)
1509+
)
1510+
console.print()
1511+
console.print(security_notice)
14811512

14821513
steps_lines = []
14831514
if not here:
@@ -1535,6 +1566,8 @@ def check():
15351566

15361567
agent_results = {}
15371568
for agent_key, agent_config in AGENT_CONFIG.items():
1569+
if agent_key == "generic":
1570+
continue # Generic is not a real agent to check
15381571
agent_name = agent_config["name"]
15391572
requires_cli = agent_config["requires_cli"]
15401573

0 commit comments

Comments
 (0)