Compare commits

..

22 Commits

Author SHA1 Message Date
Den Delimarsky
f3ada747cf Merge pull request #983 from isdaniel/add-more-common-patterns
Support more lang/Devops of Common Patterns by Technology
2025-10-21 10:16:51 -07:00
Den Delimarsky
cbc8ab020c Merge pull request #984 from JianfuLi/main
fix: correct command references in analyze.md and implement.md
2025-10-21 10:15:02 -07:00
danielshih
e0e62f6757 revert vscode auto remove extra space 2025-10-21 21:31:37 +08:00
Jeff Li
6c22085214 fix: correct command references in implement.md
Update speckit.implement.md to correct the command for regenerating the task list from '/tasks' to '/speckit.tasks', ensuring accurate documentation for task breakdown requirements.
2025-10-21 21:30:52 +08:00
danielshih
02c1549f80 fix regarding copilot suggestion 2025-10-21 21:27:46 +08:00
Jeff Li
ab14090813 fix: correct command references in speckit.analyze.md
Update speckit.analyze.md to reflect changes in command references, ensuring consistency in the execution flow and clarity in the analysis process. The command now specifies `/speckit.tasks` and `/speckit.implement` for improved user guidance.
2025-10-21 21:27:05 +08:00
danielshih
546e9d6617 Support more lang/Devops of Common Patterns by Technology
- lang: TypeScript, Swift, R.
- Devops: Kubernetes/k8s
2025-10-21 21:18:57 +08:00
Den Delimarsky
ea90d02c41 Merge pull request #487 from tinesoft/main
chore: add `devcontainer` support  to ease developer workstation setup
2025-10-18 20:28:40 -07:00
Den Delimarsky
3e85f46465 Merge pull request #910 from zidoshare/create-new-feature
fix: correct argument parsing in create-new-feature.sh script
2025-10-18 20:04:53 -07:00
Den Delimarsky
015440838a Merge branch 'main' into create-new-feature 2025-10-18 20:04:37 -07:00
Den Delimarsky
7050a3151c Merge pull request #918 from wfongcn/patch-1
Change loop condition to include last argument
2025-10-18 20:03:39 -07:00
Den Delimarsky
9e84f46e56 Merge pull request #929 from isdaniel/fix/ide-agent-cli-checks
fix: Skip CLI checks for IDE-based agents in check command
2025-10-18 20:03:14 -07:00
danielshih
098380a46f fix: Skip CLI checks for IDE-based agents in check command
- Add requires_cli field handling to check() command
- IDE-based agents (copilot, cursor-agent, windsurf, kilocode, roo) now properly skip CLI checks
- Prevents false errors when checking for IDE-integrated agents that don't require CLI tools
2025-10-17 23:53:47 +08:00
Peter Wang
74f7e508a4 Change loop condition to include last argument
The last argument is not processed. 
e.g. create-new-feature.sh -h doesn't show the help information.
2025-10-17 09:03:47 +08:00
Tine Kondo
71c2c63d55 chore: replace bun by node/npm in the devcontainer (as many CLI-based agents actually require a node runtime) 2025-10-16 15:05:05 +00:00
hongxuww
b37a9516d0 fix: correct argument parsing in create-new-feature.sh script
Fix two critical bugs in the argument parsing logic that caused incorrect
behavior when --short-name parameter was used:

1. **Index offset bug**: The loop started at i=0 and used i < $#, which
   incorrectly processed $0 (script name) as the first argument and
   skipped the last actual parameter. Changed to i=1 and i <= $# to
   properly iterate through actual command-line arguments ($1 to $#).

2. **Boundary condition bug**: The condition `[ $((i + 1)) -ge $# ]`
   incorrectly flagged valid arguments as missing. When --short-name was
   at position $#-1, the next position $# was valid but treated as
   out-of-bounds. Changed to `[ $((i + 1)) -gt $# ]` for correct validation.

3. **Enhanced validation**: Added check to ensure --short-name value is
   not another option (doesn't start with --).

**Before**:
- `script --json "desc" --short-name "test"` → Error: requires a value
- `script --json "desc1" "desc2" --short-name` → Generated wrong branch name

**After**:
- `script --json "desc" --short-name "test"` → Works correctly
- `script --json "desc1" "desc2" --short-name` → Proper error message

This ensures the script correctly supports both parameter orders:
- `[--json] [--short-name <name>] <feature_description>`
- `[--json] <feature_description> [--short-name <name>]`
2025-10-16 10:02:53 +00:00
Tine Kondo
b009773d5c chore: add Claude Code extension to devcontainer configuration 2025-10-16 09:43:00 +00:00
Tine Kondo
a8514da3e8 chore: add installation of codebuddy CLI in the devcontainer 2025-10-16 10:15:41 +02:00
Tine Kondo
9d4e8e9eb9 chore: fix path to powershell script in vscode settings 2025-10-16 10:15:41 +02:00
Tine Kondo
f3c77e2f4f fix: correct run_command exit behavior and improve installation instructions (for Amazon Q) in post-create.sh + fix typos in CONTRIBUTING.md 2025-10-16 10:15:40 +02:00
Tine Kondo
ecec4bc5e0 chore: add specify's github copilot chat settings to devcontainer 2025-10-16 10:15:40 +02:00
Tine Kondo
900bc2ed68 chore: add devcontainer support to ease developer workstation setup
Fixes #466
2025-10-16 10:15:40 +02:00
8 changed files with 272 additions and 16 deletions

View File

@@ -0,0 +1,77 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/python
{
"name": "SpecKitDevContainer",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/python:3.13-trixie", // based on Debian "Trixie" (13)
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": true,
"installOhMyZsh": true,
"installOhMyZshConfig": true,
"upgradePackages": true,
"username": "devcontainer",
"userUid": "automatic",
"userGid": "automatic"
},
"ghcr.io/devcontainers/features/dotnet:2": {
"version": "lts"
},
"ghcr.io/devcontainers/features/git:1": {
"ppa": true,
"version": "latest"
},
"ghcr.io/devcontainers/features/node": {
"version": "lts"
}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [
8080 // for Spec-Kit documentation site
],
"containerUser": "devcontainer",
"updateRemoteUserUID": true,
"postCreateCommand": "chmod +x ./.devcontainer/post-create.sh && ./.devcontainer/post-create.sh",
"postStartCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}",
"customizations": {
"vscode": {
"extensions": [
"mhutchie.git-graph",
"eamodio.gitlens",
"anweber.reveal-button",
"chrisdias.promptboost",
// Github Copilot
"GitHub.copilot",
"GitHub.copilot-chat",
// Codex
"openai.chatgpt",
// Kilo Code
"kilocode.Kilo-Code",
// Roo Code
"RooVeterinaryInc.roo-cline",
// Amazon Developer Q
"AmazonWebServices.amazon-q-vscode",
// Claude Code
"anthropic.claude-code"
],
"settings": {
"debug.javascript.autoAttachFilter": "disabled", // fix running commands in integrated terminal
// Specify settings for Github Copilot
"git.autofetch": true,
"chat.promptFilesRecommendations": {
"speckit.constitution": true,
"speckit.specify": true,
"speckit.plan": true,
"speckit.tasks": true,
"speckit.implement": true
},
"chat.tools.terminal.autoApprove": {
".specify/scripts/bash/": true,
".specify/scripts/powershell/": true
}
}
}
}
}

100
.devcontainer/post-create.sh Executable file
View File

@@ -0,0 +1,100 @@
#!/bin/bash
# Exit immediately on error, treat unset variables as an error, and fail if any command in a pipeline fails.
set -euo pipefail
# Function to run a command and show logs only on error
run_command() {
local command_to_run="$*"
local output
local exit_code
# Capture all output (stdout and stderr)
output=$(eval "$command_to_run" 2>&1) || exit_code=$?
exit_code=${exit_code:-0}
if [ $exit_code -ne 0 ]; then
echo -e "\033[0;31m[ERROR] Command failed (Exit Code $exit_code): $command_to_run\033[0m" >&2
echo -e "\033[0;31m$output\033[0m" >&2
exit $exit_code
fi
}
# Installing CLI-based AI Agents
echo -e "\n🤖 Installing Copilot CLI..."
run_command "npm install -g @github/copilot@latest"
echo "✅ Done"
echo -e "\n🤖 Installing Claude CLI..."
run_command "npm install -g @anthropic-ai/claude-code@latest"
echo "✅ Done"
echo -e "\n🤖 Installing Codex CLI..."
run_command "npm install -g @openai/codex@latest"
echo "✅ Done"
echo -e "\n🤖 Installing Gemini CLI..."
run_command "npm install -g @google/gemini-cli@latest"
echo "✅ Done"
echo -e "\n🤖 Installing Augie CLI..."
run_command "npm install -g @augmentcode/auggie@latest"
echo "✅ Done"
echo -e "\n🤖 Installing Qwen Code CLI..."
run_command "npm install -g @qwen-code/qwen-code@latest"
echo "✅ Done"
echo -e "\n🤖 Installing OpenCode CLI..."
run_command "npm install -g opencode-ai@latest"
echo "✅ Done"
echo -e "\n🤖 Installing Amazon Q CLI..."
# 👉🏾 https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/command-line-verify-download.html
run_command "curl --proto '=https' --tlsv1.2 -sSf 'https://desktop-release.q.us-east-1.amazonaws.com/latest/q-x86_64-linux.zip' -o 'q.zip'"
run_command "curl --proto '=https' --tlsv1.2 -sSf 'https://desktop-release.q.us-east-1.amazonaws.com/latest/q-x86_64-linux.zip.sig' -o 'q.zip.sig'"
cat > amazonq-public-key.asc << 'EOF'
-----BEGIN PGP PUBLIC KEY BLOCK-----
mDMEZig60RYJKwYBBAHaRw8BAQdAy/+G05U5/EOA72WlcD4WkYn5SInri8pc4Z6D
BKNNGOm0JEFtYXpvbiBRIENMSSBUZWFtIDxxLWNsaUBhbWF6b24uY29tPoiZBBMW
CgBBFiEEmvYEF+gnQskUPgPsUNx6jcJMVmcFAmYoOtECGwMFCQPCZwAFCwkIBwIC
IgIGFQoJCAsCBBYCAwECHgcCF4AACgkQUNx6jcJMVmef5QD/QWWEGG/cOnbDnp68
SJXuFkwiNwlH2rPw9ZRIQMnfAS0A/0V6ZsGB4kOylBfc7CNfzRFGtovdBBgHqA6P
zQ/PNscGuDgEZig60RIKKwYBBAGXVQEFAQEHQC4qleONMBCq3+wJwbZSr0vbuRba
D1xr4wUPn4Avn4AnAwEIB4h+BBgWCgAmFiEEmvYEF+gnQskUPgPsUNx6jcJMVmcF
AmYoOtECGwwFCQPCZwAACgkQUNx6jcJMVmchMgEA6l3RveCM0YHAGQaSFMkguoAo
vK6FgOkDawgP0NPIP2oA/jIAO4gsAntuQgMOsPunEdDeji2t+AhV02+DQIsXZpoB
=f8yY
-----END PGP PUBLIC KEY BLOCK-----
EOF
run_command "gpg --batch --import amazonq-public-key.asc"
run_command "gpg --verify q.zip.sig q.zip"
run_command "unzip -q q.zip"
run_command "chmod +x ./q/install.sh"
run_command "./q/install.sh --no-confirm"
run_command "rm -rf ./q q.zip q.zip.sig amazonq-public-key.asc"
echo "✅ Done"
echo -e "\n🤖 Installing CodeBuddy CLI..."
run_command "npm install -g @tencent-ai/codebuddy-code@latest"
echo "✅ Done"
# Installing UV (Python package manager)
echo -e "\n🐍 Installing UV - Python Package Manager..."
run_command "pipx install uv"
echo "✅ Done"
# Installing DocFx (for documentation site)
echo -e "\n📚 Installing DocFx..."
run_command "dotnet tool update -g docfx"
echo "✅ Done"
echo -e "\n🧹 Cleaning cache..."
run_command "sudo apt-get autoclean"
run_command "sudo apt-get clean"
echo "✅ Setup completed. Happy coding! 🚀"

View File

@@ -239,6 +239,51 @@ AGENT_CONFIG = {
- Reduces the chance of bugs when adding new agents
- Tool checking "just works" without additional mappings
#### 7. Update Devcontainer files (Optional)
For agents that have VS Code extensions or require CLI installation, update the devcontainer configuration files:
##### VS Code Extension-based Agents
For agents available as VS Code extensions, add them to `.devcontainer/devcontainer.json`:
```json
{
"customizations": {
"vscode": {
"extensions": [
// ... existing extensions ...
// [New Agent Name]
"[New Agent Extension ID]"
]
}
}
}
```
##### CLI-based Agents
For agents that require CLI tools, add installation commands to `.devcontainer/post-create.sh`:
```bash
#!/bin/bash
# Existing installations...
echo -e "\n🤖 Installing [New Agent Name] CLI..."
# run_command "npm install -g [agent-cli-package]@latest" # Example for node-based CLI
# or other installation instructions (must be non-interactive and compatible with Linux Debian "Trixie" or later)...
echo "✅ Done"
```
**Quick Tips:**
- **Extension-based agents**: Add to the `extensions` array in `devcontainer.json`
- **CLI-based agents**: Add installation scripts to `post-create.sh`
- **Hybrid agents**: May require both extension and CLI installation
- **Test thoroughly**: Ensure installations work in the devcontainer environment
## Agent Categories
### CLI-Based Agents
@@ -249,6 +294,7 @@ Require a command-line tool to be installed:
- **Cursor**: `cursor-agent` CLI
- **Qwen Code**: `qwen` CLI
- **opencode**: `opencode` CLI
- **Amazon Q Developer CLI**: `q` CLI
- **CodeBuddy CLI**: `codebuddy` CLI
### IDE-Based Agents

View File

@@ -13,6 +13,23 @@ These are one time installations required to be able to test your changes locall
1. Install [Git](https://git-scm.com/downloads)
1. Have an [AI coding agent available](README.md#-supported-ai-agents)
<details>
<summary><b>💡 Hint if you are using <code>VSCode</code> or <code>GitHub Codespaces</code> as your IDE</b></summary>
<br>
Provided you have [Docker](https://docker.com) installed on your machine, you can leverage [Dev Containers](https://containers.dev) through this [VSCode extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers), to easily set up your development environment, with aforementioned tools already installed and configured, thanks to the `.devcontainer/devcontainer.json` file (located at the root of the project).
To do so, simply:
- Checkout the repo
- Open it with VSCode
- Open the [Command Palette](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette) and select "Dev Containers: Open Folder in Container..."
On [GitHub Codespaces](https://github.com/features/codespaces) it's even simpler, as it leverages the `.devcontainer/devcontainer.json` automatically upon opening the codespace.
</details>
## Submitting a pull request
>[!NOTE]

View File

@@ -5,20 +5,26 @@ set -e
JSON_MODE=false
SHORT_NAME=""
ARGS=()
i=0
while [ $i -lt $# ]; do
i=1
while [ $i -le $# ]; do
arg="${!i}"
case "$arg" in
--json)
JSON_MODE=true
;;
--short-name)
if [ $((i + 1)) -ge $# ]; then
if [ $((i + 1)) -gt $# ]; then
echo 'Error: --short-name requires a value' >&2
exit 1
fi
i=$((i + 1))
SHORT_NAME="${!i}"
next_arg="${!i}"
# Check if the next argument is another option (starts with --)
if [[ "$next_arg" == --* ]]; then
echo 'Error: --short-name requires a value' >&2
exit 1
fi
SHORT_NAME="$next_arg"
;;
--help|-h)
echo "Usage: $0 [--json] [--short-name <name>] <feature_description>"
@@ -197,4 +203,4 @@ else
echo "SPEC_FILE: $SPEC_FILE"
echo "FEATURE_NUM: $FEATURE_NUM"
echo "SPECIFY_FEATURE environment variable set to: $BRANCH_NAME"
fi
fi

View File

@@ -1164,18 +1164,25 @@ def check():
tracker.add("git", "Git version control")
git_ok = check_tool("git", tracker=tracker)
agent_results = {}
for agent_key, agent_config in AGENT_CONFIG.items():
agent_name = agent_config["name"]
requires_cli = agent_config["requires_cli"]
tracker.add(agent_key, agent_name)
agent_results[agent_key] = check_tool(agent_key, tracker=tracker)
if requires_cli:
agent_results[agent_key] = check_tool(agent_key, tracker=tracker)
else:
# IDE-based agent - skip CLI check and mark as optional
tracker.skip(agent_key, "IDE-based, no CLI check")
agent_results[agent_key] = False # Don't count IDE agents as "found"
# Check VS Code variants (not in agent config)
tracker.add("code", "Visual Studio Code")
code_ok = check_tool("code", tracker=tracker)
tracker.add("code-insiders", "Visual Studio Code Insiders")
code_insiders_ok = check_tool("code-insiders", tracker=tracker)

View File

@@ -15,13 +15,13 @@ You **MUST** consider the user input before proceeding (if not empty).
## Goal
Identify inconsistencies, duplications, ambiguities, and underspecified items across the three core artifacts (`spec.md`, `plan.md`, `tasks.md`) before implementation. This command MUST run only after `/tasks` has successfully produced a complete `tasks.md`.
Identify inconsistencies, duplications, ambiguities, and underspecified items across the three core artifacts (`spec.md`, `plan.md`, `tasks.md`) before implementation. This command MUST run only after `/speckit.tasks` has successfully produced a complete `tasks.md`.
## Operating Constraints
**STRICTLY READ-ONLY**: Do **not** modify any files. Output a structured analysis report. Offer an optional remediation plan (user must explicitly approve before any follow-up editing commands would be invoked manually).
**Constitution Authority**: The project constitution (`/memory/constitution.md`) is **non-negotiable** within this analysis scope. Constitution conflicts are automatically CRITICAL and require adjustment of the spec, plan, or tasks—not dilution, reinterpretation, or silent ignoring of the principle. If a principle itself needs to change, that must occur in a separate, explicit constitution update outside `/analyze`.
**Constitution Authority**: The project constitution (`/memory/constitution.md`) is **non-negotiable** within this analysis scope. Constitution conflicts are automatically CRITICAL and require adjustment of the spec, plan, or tasks—not dilution, reinterpretation, or silent ignoring of the principle. If a principle itself needs to change, that must occur in a separate, explicit constitution update outside `/speckit.analyze`.
## Execution Steps
@@ -157,9 +157,9 @@ Output a Markdown report (no file writes) with the following structure:
At end of report, output a concise Next Actions block:
- If CRITICAL issues exist: Recommend resolving before `/implement`
- If CRITICAL issues exist: Recommend resolving before `/speckit.implement`
- If only LOW/MEDIUM: User may proceed, but provide improvement suggestions
- Provide explicit command suggestions: e.g., "Run /specify with refinement", "Run /plan to adjust architecture", "Manually edit tasks.md to add coverage for 'performance-metrics'"
- Provide explicit command suggestions: e.g., "Run /speckit.specify with refinement", "Run /speckit.plan to adjust architecture", "Manually edit tasks.md to add coverage for 'performance-metrics'"
### 8. Offer Remediation

View File

@@ -74,7 +74,7 @@ You **MUST** consider the user input before proceeding (if not empty).
**If ignore file missing**: Create with full pattern set for detected technology
**Common Patterns by Technology** (from plan.md tech stack):
- **Node.js/JavaScript**: `node_modules/`, `dist/`, `build/`, `*.log`, `.env*`
- **Node.js/JavaScript/TypeScript**: `node_modules/`, `dist/`, `build/`, `*.log`, `.env*`
- **Python**: `__pycache__/`, `*.pyc`, `.venv/`, `venv/`, `dist/`, `*.egg-info/`
- **Java**: `target/`, `*.class`, `*.jar`, `.gradle/`, `build/`
- **C#/.NET**: `bin/`, `obj/`, `*.user`, `*.suo`, `packages/`
@@ -85,6 +85,8 @@ You **MUST** consider the user input before proceeding (if not empty).
- **Kotlin**: `build/`, `out/`, `.gradle/`, `.idea/`, `*.class`, `*.jar`, `*.iml`, `*.log`, `.env*`
- **C++**: `build/`, `bin/`, `obj/`, `out/`, `*.o`, `*.so`, `*.a`, `*.exe`, `*.dll`, `.idea/`, `*.log`, `.env*`
- **C**: `build/`, `bin/`, `obj/`, `out/`, `*.o`, `*.a`, `*.so`, `*.exe`, `Makefile`, `config.log`, `.idea/`, `*.log`, `.env*`
- **Swift**: `.build/`, `DerivedData/`, `*.swiftpm/`, `Packages/`
- **R**: `.Rproj.user/`, `.Rhistory`, `.RData`, `.Ruserdata`, `*.Rproj`, `packrat/`, `renv/`
- **Universal**: `.DS_Store`, `Thumbs.db`, `*.tmp`, `*.swp`, `.vscode/`, `.idea/`
**Tool-Specific Patterns**:
@@ -92,6 +94,7 @@ You **MUST** consider the user input before proceeding (if not empty).
- **ESLint**: `node_modules/`, `dist/`, `build/`, `coverage/`, `*.min.js`
- **Prettier**: `node_modules/`, `dist/`, `build/`, `coverage/`, `package-lock.json`, `yarn.lock`, `pnpm-lock.yaml`
- **Terraform**: `.terraform/`, `*.tfstate*`, `*.tfvars`, `.terraform.lock.hcl`
- **Kubernetes/k8s**: `*.secret.yaml`, `secrets/`, `.kube/`, `kubeconfig*`, `*.key`, `*.crt`
5. Parse tasks.md structure and extract:
- **Task phases**: Setup, Tests, Core, Integration, Polish
@@ -128,5 +131,5 @@ You **MUST** consider the user input before proceeding (if not empty).
- Confirm the implementation follows the technical plan
- Report final status with summary of completed work
Note: This command assumes a complete task breakdown exists in tasks.md. If tasks are incomplete or missing, suggest running `/tasks` first to regenerate the task list.
Note: This command assumes a complete task breakdown exists in tasks.md. If tasks are incomplete or missing, suggest running `/speckit.tasks` first to regenerate the task list.