💫 Toolkit to help you get started with SDD or any other process!
Resolve merge conflicts integrating Codexsupport with upstream Windsurf updates
honjo-hiroaki-gtt537332725ba5
diff --cc CHANGELOG.mdindex e9cca156a,42d02b122..ac1610649--- a/CHANGELOG.md+++ b/CHANGELOG.md@@@ -5,9 -5,13 +5,20 @@@ All notable changes to the Specify CLIThe format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).- ## [Unreleased]++## [0.0.10] - 2025-09-20+- ## [0.0.7] - 2025-09-18++### Added++++- Codex CLI support across the Specify CLI, documentation, and bootstrap scripts, including automatic slash-command provisioning and prompt mirroring into `${CODEX_HOME:-~/.codex}/prompts`.++- Codex-aware context update tooling (Bash and PowerShell) so feature plans refresh `AGENTS.md` alongside existing assistants without manual edits.+++ ## [0.0.9] - 2025-09-19++ ### Changed++ - Improved agent selector UI with cyan highlighting for agent keys and gray parentheses for full names++ ## [0.0.8] - 2025-09-19### Addeddiff --cc README.mdindex a85e7103c,9c48d9d18..3680be7a5--- a/README.md+++ b/README.md@@@ -170,7 -209,7 +209,7 @@@ Our research and experimentation focus## 🔧 Prerequisites- **Linux/macOS** (or WSL2 on Windows)- - AI coding agent: [Claude Code](https://www.anthropic.com/claude-code), [GitHub Copilot](https://code.visualstudio.com/), [Gemini CLI](https://github.com/google-gemini/gemini-cli), [Cursor](https://cursor.sh/), [Qwen CLI](https://github.com/QwenLM/qwen-code), [opencode](https://opencode.ai/), or [Codex CLI](https://github.com/openai/codex)-- AI coding agent: [Claude Code](https://www.anthropic.com/claude-code), [GitHub Copilot](https://code.visualstudio.com/), [Gemini CLI](https://github.com/google-gemini/gemini-cli), [Cursor](https://cursor.sh/), [Qwen CLI](https://github.com/QwenLM/qwen-code), [opencode](https://opencode.ai/), or [Windsurf](https://windsurf.com/)++- AI coding agent: [Claude Code](https://www.anthropic.com/claude-code), [GitHub Copilot](https://code.visualstudio.com/), [Gemini CLI](https://github.com/google-gemini/gemini-cli), [Cursor](https://cursor.sh/), [Qwen CLI](https://github.com/QwenLM/qwen-code), [opencode](https://opencode.ai/), [Codex CLI](https://github.com/openai/codex), or [Windsurf](https://windsurf.com/)- [uv](https://docs.astral.sh/uv/) for package management- [Python 3.11+](https://www.python.org/downloads/)- [Git](https://git-scm.com/downloads)@@@ -207,30 -246,20 +246,31 @@@ You will be prompted to select the AI aspecify init <project_name> --ai claudespecify init <project_name> --ai geminispecify init <project_name> --ai copilot+specify init <project_name> --ai cursorspecify init <project_name> --ai qwenspecify init <project_name> --ai opencode+specify init <project_name> --ai codex+ specify init <project_name> --ai windsurf# Or in current directory:specify init --here --ai claude+specify init --here --ai codex```- The CLI will check if you have Claude Code, Gemini CLI, Qwen CLI, opencode, or Codex CLI installed. If you do not, or you prefer to get the templates without checking for the right tools, use `--ignore-agent-tools` with your command:-The CLI will check if you have Claude Code, Gemini CLI, Cursor CLI, Qwen CLI, or opencode installed. If you do not, or you prefer to get the templates without checking for the right tools, use `--ignore-agent-tools` with your command:++The CLI will check if you have Claude Code, Gemini CLI, Cursor CLI, Qwen CLI, opencode, or Codex CLI installed. If you do not, or you prefer to get the templates without checking for the right tools, use `--ignore-agent-tools` with your command:```bashspecify init <project_name> --ai claude --ignore-agent-tools```+> [!NOTE]+> Codex CLI specifics+> - `specify init --ai codex` seeds `commands/*.md` in your repo and automatically mirrors them into `${CODEX_HOME:-~/.codex}/prompts` so Codex picks up `/specify`, `/plan`, and `/tasks` immediately.+> - If Codex was running during installation, restart the CLI once so it reloads the refreshed slash commands.+> - Codex persists its working memory in `AGENTS.md`; if you do not see that file yet, run `codex /init` once inside the project to generate it.+> - When Codex is configured to run helper scripts, open `codex /approvals` and enable “Run shell commands”.+> - If you point `CODEX_HOME` at the project (for per-repo isolation) the installer adds ignore rules for Codex session artifacts to `.gitignore`; adjust them as needed for your workflow.+- ### **STEP 1:** Bootstrap the project+ ### **STEP 1:** Establish project principlesGo to the project folder and run your AI agent. In our example, we're using `claude`.diff --cc scripts/bash/update-agent-context.shindex b186a2f8c,ba3ab33eb..b9dff8292--- a/scripts/bash/update-agent-context.sh+++ b/scripts/bash/update-agent-context.sh@@@ -54,14 -54,15 +54,16 @@@ case "$AGENT_TYPE" icursor) update_agent_file "$CURSOR_FILE" "Cursor IDE" ;;qwen) update_agent_file "$QWEN_FILE" "Qwen Code" ;;opencode) update_agent_file "$AGENTS_FILE" "opencode" ;;+ codex) update_agent_file "$AGENTS_FILE" "Codex CLI" ;;+ windsurf) update_agent_file "$WINDSURF_FILE" "Windsurf" ;;"") [ -f "$CLAUDE_FILE" ] && update_agent_file "$CLAUDE_FILE" "Claude Code"; \[ -f "$GEMINI_FILE" ] && update_agent_file "$GEMINI_FILE" "Gemini CLI"; \[ -f "$COPILOT_FILE" ] && update_agent_file "$COPILOT_FILE" "GitHub Copilot"; \[ -f "$CURSOR_FILE" ] && update_agent_file "$CURSOR_FILE" "Cursor IDE"; \[ -f "$QWEN_FILE" ] && update_agent_file "$QWEN_FILE" "Qwen Code"; \- [ -f "$AGENTS_FILE" ] && update_agent_file "$AGENTS_FILE" "opencode"; \+ [ -f "$AGENTS_FILE" ] && update_agent_file "$AGENTS_FILE" "Codex/opencode"; \- if [ ! -f "$CLAUDE_FILE" ] && [ ! -f "$GEMINI_FILE" ] && [ ! -f "$COPILOT_FILE" ] && [ ! -f "$CURSOR_FILE" ] && [ ! -f "$QWEN_FILE" ] && [ ! -f "$AGENTS_FILE" ]; then update_agent_file "$CLAUDE_FILE" "Claude Code"; fi ;;- *) echo "ERROR: Unknown agent type '$AGENT_TYPE' (expected claude|gemini|copilot|cursor|qwen|opencode|codex)"; exit 1 ;;+ [ -f "$WINDSURF_FILE" ] && update_agent_file "$WINDSURF_FILE" "Windsurf"; \+ if [ ! -f "$CLAUDE_FILE" ] && [ ! -f "$GEMINI_FILE" ] && [ ! -f "$COPILOT_FILE" ] && [ ! -f "$CURSOR_FILE" ] && [ ! -f "$QWEN_FILE" ] && [ ! -f "$AGENTS_FILE" ] && [ ! -f "$WINDSURF_FILE" ]; then update_agent_file "$CLAUDE_FILE" "Claude Code"; fi ;;- *) echo "ERROR: Unknown agent type '$AGENT_TYPE' (expected claude|gemini|copilot|cursor|qwen|opencode|windsurf)"; exit 1 ;;++ *) echo "ERROR: Unknown agent type '$AGENT_TYPE' (expected claude|gemini|copilot|cursor|qwen|opencode|codex|windsurf)"; exit 1 ;;esac- echo; echo "Summary of changes:"; [ -n "$NEW_LANG" ] && echo "- Added language: $NEW_LANG"; [ -n "$NEW_FRAMEWORK" ] && echo "- Added framework: $NEW_FRAMEWORK"; [ -n "$NEW_DB" ] && [ "$NEW_DB" != "N/A" ] && echo "- Added database: $NEW_DB"; echo; echo "Usage: $0 [claude|gemini|copilot|cursor|qwen|opencode|codex]"-echo; echo "Summary of changes:"; [ -n "$NEW_LANG" ] && echo "- Added language: $NEW_LANG"; [ -n "$NEW_FRAMEWORK" ] && echo "- Added framework: $NEW_FRAMEWORK"; [ -n "$NEW_DB" ] && [ "$NEW_DB" != "N/A" ] && echo "- Added database: $NEW_DB"; echo; echo "Usage: $0 [claude|gemini|copilot|cursor|qwen|opencode|windsurf]"++echo; echo "Summary of changes:"; [ -n "$NEW_LANG" ] && echo "- Added language: $NEW_LANG"; [ -n "$NEW_FRAMEWORK" ] && echo "- Added framework: $NEW_FRAMEWORK"; [ -n "$NEW_DB" ] && [ "$NEW_DB" != "N/A" ] && echo "- Added database: $NEW_DB"; echo; echo "Usage: $0 [claude|gemini|copilot|cursor|qwen|opencode|codex|windsurf]"diff --cc src/specify_cli/__init__.pyindex fdac7d8ee,891d5f2e9..da903c625--- a/src/specify_cli/__init__.py+++ b/src/specify_cli/__init__.py@@@ -60,7 -73,7 +73,8 @@@ AI_CHOICES ="cursor": "Cursor","qwen": "Qwen Code","opencode": "opencode",- "windsurf": "Windsurf"+ "codex": "Codex CLI",++ "windsurf": "Windsurf",}# Add script type choicesSCRIPT_TYPE_CHOICES = {"sh": "POSIX Shell (bash/zsh)", "ps": "PowerShell"}@@@ -1071,7 -751,7 +1098,7 @@@ def sync_codex_prompts(project_path: Pa@app.command()def init(project_name: str = typer.Argument(None, help="Name for your new project directory (optional if using --here)"),- ai_assistant: str = typer.Option(None, "--ai", help="AI assistant to use: claude, gemini, copilot, cursor, qwen, opencode, or codex"),- ai_assistant: str = typer.Option(None, "--ai", help="AI assistant to use: claude, gemini, copilot, cursor, qwen, opencode or windsurf"),++ ai_assistant: str = typer.Option(None, "--ai", help="AI assistant to use: claude, gemini, copilot, cursor, qwen, opencode, codex, or windsurf"),script_type: str = typer.Option(None, "--script", help="Script type to use: sh or ps"),ignore_agent_tools: bool = typer.Option(False, "--ignore-agent-tools", help="Skip checks for AI agent tools like Claude Code"),no_git: bool = typer.Option(False, "--no-git", help="Skip git repository initialization"),@@@ -1084,7 -765,7 +1112,7 @@@This command will:1. Check that required tools are installed (git is optional)- 2. Let you choose your AI assistant (Claude Code, Gemini CLI, GitHub Copilot, Cursor, Qwen Code, opencode, or Codex CLI)- 2. Let you choose your AI assistant (Claude Code, Gemini CLI, GitHub Copilot, Cursor, Qwen Code, opencode or Windsurf)++ 2. Let you choose your AI assistant (Claude Code, Gemini CLI, GitHub Copilot, Cursor, Qwen Code, opencode, Codex CLI, or Windsurf)3. Download the appropriate template from GitHub4. Extract the template to a new project directory or current directory5. Initialize a fresh git repository (if not --no-git and no existing repo)@@@ -1097,11 -778,9 +1125,12 @@@specify init my-project --ai copilot --no-gitspecify init my-project --ai cursorspecify init my-project --ai qwen+ specify init my-project --ai opencode+ specify init my-project --ai codex+ specify init my-project --ai windsurfspecify init --ignore-agent-tools my-projectspecify init --here --ai claude+ specify init --here --ai codexspecify init --here"""# Show banner first@@@ -1254,13 -934,8 +1292,13 @@@local_ssl_context = ssl_context if verify else Falselocal_client = httpx.Client(verify=local_ssl_context)- download_and_extract_template(project_path, selected_ai, selected_script, here, verbose=False, tracker=tracker, client=local_client, debug=debug)+ download_and_extract_template(project_path, selected_ai, selected_script, here, verbose=False, tracker=tracker, client=local_client, debug=debug, github_token=github_token)+ # Ensure /commands directory for Codex CLI workspaces only+ if selected_ai == "codex":+ ensure_workspace_commands(project_path, tracker=tracker)+ sync_codex_prompts(project_path, tracker=tracker)+# Ensure scripts are executable (POSIX)ensure_executable_scripts(project_path, tracker=tracker)@@@ -1312,48 -987,16 +1350,18 @@@steps_lines.append("1. You're already in the project directory!")step_num = 2- if selected_ai == "claude":- steps_lines.append(f"{step_num}. Open in Visual Studio Code and start using / commands with Claude Code")- steps_lines.append(" - Type / in any file to see available commands")- steps_lines.append(" - Use /specify to create specifications")- steps_lines.append(" - Use /plan to create implementation plans")- steps_lines.append(" - Use /tasks to generate tasks")- elif selected_ai == "gemini":- steps_lines.append(f"{step_num}. Use / commands with Gemini CLI")- steps_lines.append(" - Run gemini /specify to create specifications")- steps_lines.append(" - Run gemini /plan to create implementation plans")- steps_lines.append(" - Run gemini /tasks to generate tasks")- steps_lines.append(" - See GEMINI.md for all available commands")- elif selected_ai == "copilot":- steps_lines.append(f"{step_num}. Open in Visual Studio Code and use [bold cyan]/specify[/], [bold cyan]/plan[/], [bold cyan]/tasks[/] commands with GitHub Copilot")- elif selected_ai == "qwen":- steps_lines.append(f"{step_num}. Use / commands with Qwen CLI")- steps_lines.append(" - Run qwen /specify to create specifications")- steps_lines.append(" - Run qwen /plan to create implementation plans")- steps_lines.append(" - Run qwen /tasks to generate tasks")- steps_lines.append(" - See QWEN.md for all available commands")- elif selected_ai == "opencode":- steps_lines.append(f"{step_num}. Use / commands with opencode")- steps_lines.append(" - Use /specify to create specifications")- steps_lines.append(" - Use /plan to create implementation plans")- steps_lines.append(" - Use /tasks to generate tasks")- elif selected_ai == "codex":- steps_lines.append(f"{step_num}. Use / commands with Codex CLI")- steps_lines.append(" - Run codex /specify to create specifications")- steps_lines.append(" - Run codex /plan to create implementation plans")- steps_lines.append(" - Run codex /tasks to generate task lists")- steps_lines.append(" - See AGENTS.md for bundled commands")-- # Removed script variant step (scripts are transparent to users)- step_num += 1- steps_lines.append(f"{step_num}. Update [bold magenta]CONSTITUTION.md[/bold magenta] with your project's non-negotiable principles")+ steps_lines.append(f"{step_num}. Start using slash commands with your AI agent:")+ steps_lines.append(" 2.1 [cyan]/constitution[/] - Establish project principles")+ steps_lines.append(" 2.2 [cyan]/specify[/] - Create specifications")+ steps_lines.append(" 2.3 [cyan]/plan[/] - Create implementation plans")+ steps_lines.append(" 2.4 [cyan]/tasks[/] - Generate actionable tasks")+ steps_lines.append(" 2.5 [cyan]/implement[/] - Execute implementation")++ if selected_ai == "codex":++ steps_lines.append(" 2.6 [cyan]Codex CLI[/] - Restart Codex if slash commands are missing; commands mirror into AGENTS.md")steps_panel = Panel("\n".join(steps_lines), title="Next steps", border_style="cyan", padding=(1,2))- console.print() # blank line+ console.print()console.print(steps_panel)-- # Removed farewell line per user request-@app.command()def check():@@@ -1371,10 -1012,9 +1377,10 @@@tracker.add("qwen", "Qwen Code CLI")tracker.add("code", "VS Code (for GitHub Copilot)")tracker.add("cursor-agent", "Cursor IDE agent (optional)")+ tracker.add("windsurf", "Windsurf IDE (optional)")tracker.add("opencode", "opencode")+ tracker.add("codex", "Codex CLI")- # Check each toolgit_ok = check_tool_for_tracker("git", "https://git-scm.com/downloads", tracker)claude_ok = check_tool_for_tracker("claude", "https://docs.anthropic.com/en/docs/claude-code/setup", tracker)gemini_ok = check_tool_for_tracker("gemini", "https://github.com/google-gemini/gemini-cli", tracker)@@@ -1384,20 -1023,16 +1389,17 @@@if not code_ok:code_ok = check_tool_for_tracker("code-insiders", "https://code.visualstudio.com/insiders/", tracker)cursor_ok = check_tool_for_tracker("cursor-agent", "https://cursor.sh/", tracker)+ windsurf_ok = check_tool_for_tracker("windsurf", "https://windsurf.com/", tracker)opencode_ok = check_tool_for_tracker("opencode", "https://opencode.ai/", tracker)+ codex_ok = check_tool_for_tracker("codex", "https://github.com/openai/codex", tracker)-- # Render the final tree+console.print(tracker.render())-+- # Summaryconsole.print("\n[bold green]Specify CLI is ready to use![/bold green]")-+- # Recommendationsif not git_ok:console.print("[dim]Tip: Install git for repository management[/dim]")- if not (claude_ok or gemini_ok or cursor_ok or qwen_ok or opencode_ok or codex_ok):- console.print("[yellow]Consider installing an AI assistant for the best experience[/yellow]")- if not (claude_ok or gemini_ok or cursor_ok or qwen_ok or windsurf_ok or opencode_ok):++ if not (claude_ok or gemini_ok or cursor_ok or qwen_ok or windsurf_ok or opencode_ok or codex_ok):console.print("[dim]Tip: Install an AI assistant for the best experience[/dim]")diff --cc templates/commands/specify.mdindex 2ea4f785c,5fbd76e71..8544b3f21--- a/templates/commands/specify.md+++ b/templates/commands/specify.md@@@ -5,11 -5,10 +5,12 @@@ scriptsps: scripts/powershell/create-new-feature.ps1 -Json "{ARGS}"----Given the feature description provided as an argument, do this:+The text the user typed after `/specify` in the triggering message **is** the feature description. Assume you always have it available in this conversation even if `{ARGS}` appears literally below. Do not ask the user to repeat it unless they provided a truly empty command.++Given that feature description, do this:1. Run the script `{SCRIPT}` from repo root and parse its JSON output for BRANCH_NAME and SPEC_FILE. All file paths must be absolute.+ **IMPORTANT** You must only ever run this script once. The JSON is provided in the terminal as output - always refer to it to get the actual content you're looking for.2. Load `templates/spec-template.md` to understand required sections.3. Write the specification to SPEC_FILE using the template structure, replacing placeholders with concrete details derived from the feature description (arguments) while preserving section order and headings.4. Report completion with branch name, spec file path, and readiness for the next phase.