diff --git a/.github/ISSUE_TEMPLATE/extension_submission.yml b/.github/ISSUE_TEMPLATE/extension_submission.yml
index d298925e7..9d3f15872 100644
--- a/.github/ISSUE_TEMPLATE/extension_submission.yml
+++ b/.github/ISSUE_TEMPLATE/extension_submission.yml
@@ -12,7 +12,7 @@ body:
- Review the [Extension Publishing Guide](https://github.com/github/spec-kit/blob/main/extensions/EXTENSION-PUBLISHING-GUIDE.md)
- Ensure your extension has a valid `extension.yml` manifest
- Create a GitHub release with a version tag (e.g., v1.0.0)
- - Test installation: `specify extension add --from `
+ - Test installation: `specify extension add --from `
- type: input
id: extension-id
@@ -229,7 +229,7 @@ body:
placeholder: |
```bash
# Install extension
- specify extension add --from https://github.com/your-org/spec-kit-your-extension/archive/refs/tags/v1.0.0.zip
+ specify extension add --from https://github.com/your-org/spec-kit-your-extension/archive/refs/tags/v1.0.0.zip
# Use a command
/speckit.your-extension.command-name arg1 arg2
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index 8b648df8c..fdece6309 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -15,7 +15,7 @@ jobs:
uses: actions/checkout@v6
- name: Run markdownlint-cli2
- uses: DavidAnson/markdownlint-cli2-action@v23
+ uses: DavidAnson/markdownlint-cli2-action@ce4853d43830c74c1753b39f3cf40f71c2031eb9 # v23
with:
globs: |
'**/*.md'
diff --git a/.github/workflows/release-trigger.yml b/.github/workflows/release-trigger.yml
index 2b70d89e5..a451accfe 100644
--- a/.github/workflows/release-trigger.yml
+++ b/.github/workflows/release-trigger.yml
@@ -139,6 +139,22 @@ jobs:
git push origin "${{ steps.version.outputs.tag }}"
echo "Branch ${{ env.branch }} and tag ${{ steps.version.outputs.tag }} pushed"
+ - name: Bump to dev version
+ id: dev_version
+ run: |
+ IFS='.' read -r MAJOR MINOR PATCH <<< "${{ steps.version.outputs.version }}"
+ NEXT_DEV="$MAJOR.$MINOR.$((PATCH + 1)).dev0"
+ echo "dev_version=$NEXT_DEV" >> $GITHUB_OUTPUT
+ sed -i "s/version = \".*\"/version = \"$NEXT_DEV\"/" pyproject.toml
+ git add pyproject.toml
+ if git diff --cached --quiet; then
+ echo "No dev version changes to commit"
+ else
+ git commit -m "chore: begin $NEXT_DEV development"
+ git push origin "${{ env.branch }}"
+ echo "Bumped to dev version $NEXT_DEV"
+ fi
+
- name: Open pull request
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_PAT }}
@@ -146,16 +162,17 @@ jobs:
gh pr create \
--base main \
--head "${{ env.branch }}" \
- --title "chore: bump version to ${{ steps.version.outputs.version }}" \
- --body "Automated version bump to ${{ steps.version.outputs.version }}.
+ --title "chore: release ${{ steps.version.outputs.version }}, begin ${{ steps.dev_version.outputs.dev_version }} development" \
+ --body "Automated release of ${{ steps.version.outputs.version }}.
This PR was created by the Release Trigger workflow. The git tag \`${{ steps.version.outputs.tag }}\` has already been pushed and the release artifacts are being built.
- Merge this PR to record the version bump and changelog update on \`main\`."
+ Merging this PR will set \`main\` to \`${{ steps.dev_version.outputs.dev_version }}\` so that development installs are clearly marked as pre-release."
- name: Summary
run: |
echo "β
Version bumped to ${{ steps.version.outputs.version }}"
echo "β
Tag ${{ steps.version.outputs.tag }} created and pushed"
+ echo "β
Dev version set to ${{ steps.dev_version.outputs.dev_version }}"
echo "β
PR opened to merge version bump into main"
echo "π Release workflow is building artifacts from the tag"
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 9c6230438..f45c5f107 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -16,7 +16,7 @@ jobs:
uses: actions/checkout@v4
- name: Install uv
- uses: astral-sh/setup-uv@v7
+ uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
- name: Set up Python
uses: actions/setup-python@v6
@@ -36,7 +36,7 @@ jobs:
uses: actions/checkout@v4
- name: Install uv
- uses: astral-sh/setup-uv@v7
+ uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
diff --git a/AGENTS.md b/AGENTS.md
index a15e0bc4b..eb3d27065 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -30,10 +30,10 @@ Specify supports multiple AI agents by generating agent-specific command files a
| **Claude Code** | `.claude/commands/` | Markdown | `claude` | Anthropic's Claude Code CLI |
| **Gemini CLI** | `.gemini/commands/` | TOML | `gemini` | Google's Gemini CLI |
| **GitHub Copilot** | `.github/agents/` | Markdown | N/A (IDE-based) | GitHub Copilot in VS Code |
-| **Cursor** | `.cursor/commands/` | Markdown | `cursor-agent` | Cursor CLI |
+| **Cursor** | `.cursor/commands/` | Markdown | N/A (IDE-based) | Cursor IDE (`--ai cursor-agent`) |
| **Qwen Code** | `.qwen/commands/` | Markdown | `qwen` | Alibaba's Qwen Code CLI |
| **opencode** | `.opencode/command/` | Markdown | `opencode` | opencode CLI |
-| **Codex CLI** | `.agents/skills/` | Markdown | `codex` | Codex CLI (skills) |
+| **Codex CLI** | `.agents/skills/` | Markdown | `codex` | Codex CLI (`--ai codex --ai-skills`) |
| **Windsurf** | `.windsurf/workflows/` | Markdown | N/A (IDE-based) | Windsurf IDE workflows |
| **Junie** | `.junie/commands/` | Markdown | `junie` | Junie by JetBrains |
| **Kilo Code** | `.kilocode/workflows/` | Markdown | N/A (IDE-based) | Kilo Code IDE |
@@ -50,6 +50,8 @@ Specify supports multiple AI agents by generating agent-specific command files a
| **iFlow CLI** | `.iflow/commands/` | Markdown | `iflow` | iFlow CLI (iflow-ai) |
| **IBM Bob** | `.bob/commands/` | Markdown | N/A (IDE-based) | IBM Bob IDE |
| **Trae** | `.trae/rules/` | Markdown | N/A (IDE-based) | Trae IDE |
+| **Antigravity** | `.agent/commands/` | Markdown | N/A (IDE-based) | Antigravity IDE (`--ai agy --ai-skills`) |
+| **Mistral Vibe** | `.vibe/prompts/` | Markdown | `vibe` | Mistral Vibe CLI |
| **Generic** | User-specified via `--ai-commands-dir` | Markdown | N/A | Bring your own agent |
### Step-by-Step Integration Guide
@@ -316,32 +318,40 @@ Require a command-line tool to be installed:
- **Claude Code**: `claude` CLI
- **Gemini CLI**: `gemini` CLI
-- **Cursor**: `cursor-agent` CLI
- **Qwen Code**: `qwen` CLI
- **opencode**: `opencode` CLI
+- **Codex CLI**: `codex` CLI (requires `--ai-skills`)
- **Junie**: `junie` CLI
-- **Kiro CLI**: `kiro-cli` CLI
+- **Auggie CLI**: `auggie` CLI
- **CodeBuddy CLI**: `codebuddy` CLI
- **Qoder CLI**: `qodercli` CLI
+- **Kiro CLI**: `kiro-cli` CLI
- **Amp**: `amp` CLI
- **SHAI**: `shai` CLI
- **Tabnine CLI**: `tabnine` CLI
- **Kimi Code**: `kimi` CLI
+- **Mistral Vibe**: `vibe` CLI
- **Pi Coding Agent**: `pi` CLI
+- **iFlow CLI**: `iflow` CLI
### IDE-Based Agents
Work within integrated development environments:
- **GitHub Copilot**: Built into VS Code/compatible editors
+- **Cursor**: Built into Cursor IDE (`--ai cursor-agent`)
- **Windsurf**: Built into Windsurf IDE
+- **Kilo Code**: Built into Kilo Code IDE
+- **Roo Code**: Built into Roo Code IDE
- **IBM Bob**: Built into IBM Bob IDE
+- **Trae**: Built into Trae IDE
+- **Antigravity**: Built into Antigravity IDE (`--ai agy --ai-skills`)
## Command File Formats
### Markdown Format
-Used by: Claude, Cursor, opencode, Windsurf, Junie, Kiro CLI, Amp, SHAI, IBM Bob, Kimi Code, Qwen, Pi
+Used by: Claude, Cursor, GitHub Copilot, opencode, Windsurf, Junie, Kiro CLI, Amp, SHAI, IBM Bob, Kimi Code, Qwen, Pi, Codex, Auggie, CodeBuddy, Qoder, Roo Code, Kilo Code, Trae, Antigravity, Mistral Vibe, iFlow
**Standard format:**
@@ -379,15 +389,29 @@ Command content with {SCRIPT} and {{args}} placeholders.
## Directory Conventions
- **CLI agents**: Usually `./commands/`
+- **Singular command exception**:
+ - opencode: `.opencode/command/` (singular `command`, not `commands`)
+- **Nested path exception**:
+ - Tabnine: `.tabnine/agent/commands/` (extra `agent/` segment)
+- **Shared `.agents/` folder**:
+ - Amp: `.agents/commands/` (shared folder, not `.amp/`)
+ - Codex: `.agents/skills/` (shared folder; requires `--ai-skills`; invoked as `$speckit-`)
- **Skills-based exceptions**:
- - Codex: `.agents/skills/` (skills, invoked as `$speckit-`)
+ - Kimi Code: `.kimi/skills/` (skills, invoked as `/skill:speckit-`)
- **Prompt-based exceptions**:
- Kiro CLI: `.kiro/prompts/`
- Pi: `.pi/prompts/`
+ - Mistral Vibe: `.vibe/prompts/`
+- **Rules-based exceptions**:
+ - Trae: `.trae/rules/`
- **IDE agents**: Follow IDE-specific patterns:
- Copilot: `.github/agents/`
- Cursor: `.cursor/commands/`
- Windsurf: `.windsurf/workflows/`
+ - Kilo Code: `.kilocode/workflows/`
+ - Roo Code: `.roo/commands/`
+ - IBM Bob: `.bob/commands/`
+ - Antigravity: `.agent/skills/` (`--ai-skills` required; `.agent/commands/` is deprecated)
## Argument Patterns
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3265b305b..8394968a2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,31 @@
+## [0.4.4] - 2026-04-01
+
+### Changed
+
+- Stage 2: Copilot integration β proof of concept with shared template primitives (#2035)
+- docs: sync AGENTS.md with AGENT_CONFIG for missing agents (#2025)
+- docs: ensure manual tests use local specify (#2020)
+- Stage 1: Integration foundation β base classes, manifest system, and registry (#1925)
+- fix: harden GitHub Actions workflows (#2021)
+- chore: use PEP 440 .dev0 versions on main after releases (#2032)
+- feat: add superpowers bridge extension to community catalog (#2023)
+- feat: add product-forge extension to community catalog (#2012)
+- feat(scripts): add --allow-existing-branch flag to create-new-feature (#1999)
+- fix(scripts): add correct path for copilot-instructions.md (#1997)
+- Update README.md (#1995)
+- fix: prevent extension command shadowing (#1994)
+- Fix Claude Code CLI detection for npm-local installs (#1978)
+- fix(scripts): honor PowerShell agent and script filters (#1969)
+- feat: add MAQA extension suite (7 extensions) to community catalog (#1981)
+- feat: add spec-kit-onboard extension to community catalog (#1991)
+- Add plan-review-gate to community catalog (#1993)
+- chore(deps): bump actions/deploy-pages from 4 to 5 (#1990)
+- chore(deps): bump DavidAnson/markdownlint-cli2-action from 19 to 23 (#1989)
+- chore: bump version to 0.4.3 (#1986)
+
## [0.4.3] - 2026-03-26
### Changed
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 2b42e8fd6..9044ef5ff 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -36,7 +36,7 @@ On [GitHub Codespaces](https://github.com/features/codespaces) it's even simpler
> If your pull request introduces a large change that materially impacts the work of the CLI or the rest of the repository (e.g., you're introducing new templates, arguments, or otherwise major changes), make sure that it was **discussed and agreed upon** by the project maintainers. Pull requests with large changes that did not have a prior conversation and agreement will be closed.
1. Fork and clone the repository
-1. Configure and install the dependencies: `uv sync`
+1. Configure and install the dependencies: `uv sync --extra test`
1. Make sure the CLI works on your machine: `uv run specify --help`
1. Create a new branch: `git checkout -b my-branch-name`
1. Make your change, add tests, and make sure everything still works
@@ -44,6 +44,9 @@ On [GitHub Codespaces](https://github.com/features/codespaces) it's even simpler
1. Push to your fork and submit a pull request
1. Wait for your pull request to be reviewed and merged.
+For the detailed test workflow, command-selection prompt, and PR reporting template, see [`TESTING.md`](./TESTING.md).
+Activate the project virtual environment (see the Setup block in [`TESTING.md`](./TESTING.md)), then install the CLI from your working tree (`uv pip install -e .` after `uv sync --extra test`) or otherwise ensure the shell uses the local `specify` binary before running the manual slash-command tests described below.
+
Here are a few things you can do that will increase the likelihood of your pull request being accepted:
- Follow the project's coding conventions.
@@ -62,6 +65,14 @@ When working on spec-kit:
3. Test script functionality in the `scripts/` directory
4. Ensure memory files (`memory/constitution.md`) are updated if major process changes are made
+### Recommended validation flow
+
+For the smoothest review experience, validate changes in this order:
+
+1. **Run focused automated checks first** β use the quick verification commands in [`TESTING.md`](./TESTING.md) to catch packaging, scaffolding, and configuration regressions early.
+2. **Run manual workflow tests second** β if your change affects slash commands or the developer workflow, follow [`TESTING.md`](./TESTING.md) to choose the right commands, run them in an agent, and capture results for your PR.
+3. **Use local release packages when debugging packaged output** β if you need to inspect the exact files CI-style packaging produces, generate local release packages as described below.
+
### Testing template and command changes locally
Running `uv run specify init` pulls released packages, which wonβt include your local changes.
@@ -85,6 +96,8 @@ To test your templates, commands, and other changes locally, follow these steps:
Navigate to your test project folder and open the agent to verify your implementation.
+If you only need to validate generated file structure and content before doing manual agent testing, start with the focused automated checks in [`TESTING.md`](./TESTING.md). Keep this section for the cases where you need to inspect the exact packaged output locally.
+
## AI contributions in Spec Kit
> [!IMPORTANT]
diff --git a/README.md b/README.md
index 4308d332c..1890142ad 100644
--- a/README.md
+++ b/README.md
@@ -9,7 +9,7 @@
-
+
@@ -208,6 +208,7 @@ The following community-contributed extensions are available in [`catalog.commun
| Retrospective Extension | Post-implementation retrospective with spec adherence scoring, drift analysis, and human-gated spec updates | `docs` | Read+Write | [spec-kit-retrospective](https://github.com/emi-dm/spec-kit-retrospective) |
| Review Extension | Post-implementation comprehensive code review with specialized agents for code quality, comments, tests, error handling, type design, and simplification | `code` | Read-only | [spec-kit-review](https://github.com/ismaelJimenez/spec-kit-review) |
| SDD Utilities | Resume interrupted workflows, validate project health, and verify spec-to-task traceability | `process` | Read+Write | [speckit-utils](https://github.com/mvanhorn/speckit-utils) |
+| Superpowers Bridge | Orchestrates obra/superpowers skills within the spec-kit SDD workflow across the full lifecycle (clarification, TDD, review, verification, critique, debugging, branch completion) | `process` | Read+Write | [superpowers-bridge](https://github.com/RbBtSn0w/spec-kit-extensions/tree/main/superpowers-bridge) |
| Spec Sync | Detect and resolve drift between specs and implementation. AI-assisted resolution with human approval | `docs` | Read+Write | [spec-kit-sync](https://github.com/bgervin/spec-kit-sync) |
| Understanding | Automated requirements quality analysis β 31 deterministic metrics against IEEE/ISO standards with experimental energy-based ambiguity detection | `docs` | Read-only | [understanding](https://github.com/Testimonial/understanding) |
| V-Model Extension Pack | Enforces V-Model paired generation of development specs and test specs with full traceability | `docs` | Read+Write | [spec-kit-v-model](https://github.com/leocamello/spec-kit-v-model) |
diff --git a/TESTING.md b/TESTING.md
index 95b1bde84..1fa6b1c88 100644
--- a/TESTING.md
+++ b/TESTING.md
@@ -1,8 +1,59 @@
-# Manual Testing Guide
+# Testing Guide
+
+This document is the detailed testing companion to [`CONTRIBUTING.md`](./CONTRIBUTING.md).
+
+Use it for three things:
+
+1. running quick automated checks before manual testing,
+2. manually testing affected slash commands through an AI agent, and
+3. capturing the results in a PR-friendly format.
Any change that affects a slash command's behavior requires manually testing that command through an AI agent and submitting results with the PR.
-## Process
+## Recommended order
+
+1. **Sync your environment** β install the project and test dependencies.
+2. **Run focused automated checks** β especially for packaging, scaffolding, agent config, and generated-file changes.
+3. **Run manual agent tests** β for any affected slash commands.
+4. **Paste results into your PR** β include both command-selection reasoning and manual test results.
+
+## Quick automated checks
+
+Run these before manual testing when your change affects packaging, scaffolding, templates, release artifacts, or agent wiring.
+
+### Environment setup
+
+```bash
+cd
+uv sync --extra test
+source .venv/bin/activate # On Windows (CMD): .venv\Scripts\activate | (PowerShell): .venv\Scripts\Activate.ps1
+```
+
+### Generated package structure and content
+
+```bash
+uv run python -m pytest tests/test_core_pack_scaffold.py -q
+```
+
+This validates the generated files that CI-style packaging depends on, including directory layout, file names, frontmatter/TOML validity, placeholder replacement, `.specify/` path rewrites, and parity with `create-release-packages.sh`.
+
+### Agent configuration and release wiring consistency
+
+```bash
+uv run python -m pytest tests/test_agent_config_consistency.py -q
+```
+
+Run this when you change agent metadata, release scripts, context update scripts, or artifact naming.
+
+### Optional single-agent packaging spot check
+
+```bash
+AGENTS=copilot SCRIPTS=sh ./.github/workflows/scripts/create-release-packages.sh v1.0.0
+```
+
+Inspect `.genreleases/sdd-copilot-package-sh/` and the matching ZIP in `.genreleases/` when you want to review the exact packaged output for one agent/script combination.
+
+## Manual testing process
1. **Identify affected commands** β use the [prompt below](#determining-which-tests-to-run) to have your agent analyze your changed files and determine which commands need testing.
2. **Set up a test project** β scaffold from your local branch (see [Setup](#setup)).
@@ -13,19 +64,22 @@ Any change that affects a slash command's behavior requires manually testing tha
## Setup
```bash
-# Install the CLI from your local branch
+# Install the project and test dependencies from your local branch
cd
-uv venv .venv
-source .venv/bin/activate # On Windows: .venv\Scripts\activate
+uv sync --extra test
+source .venv/bin/activate # On Windows (CMD): .venv\Scripts\activate | (PowerShell): .venv\Scripts\Activate.ps1
uv pip install -e .
+# Ensure the `specify` binary in this environment points at your working tree so the agent runs the branch you're testing.
# Initialize a test project using your local changes
-specify init /tmp/speckit-test --ai --offline
+uv run specify init /tmp/speckit-test --ai --offline
cd /tmp/speckit-test
# Open in your agent
```
+If you are testing the packaged output rather than the live source tree, create a local release package first as described in [`CONTRIBUTING.md`](./CONTRIBUTING.md).
+
## Reporting results
Paste this into your PR:
diff --git a/extensions/EXTENSION-DEVELOPMENT-GUIDE.md b/extensions/EXTENSION-DEVELOPMENT-GUIDE.md
index 81179a073..4eb7626d8 100644
--- a/extensions/EXTENSION-DEVELOPMENT-GUIDE.md
+++ b/extensions/EXTENSION-DEVELOPMENT-GUIDE.md
@@ -514,7 +514,7 @@ zip -r spec-kit-my-ext-1.0.0.zip extension.yml commands/ scripts/ docs/
Users install with:
```bash
-specify extension add --from https://github.com/.../spec-kit-my-ext-1.0.0.zip
+specify extension add --from https://github.com/.../spec-kit-my-ext-1.0.0.zip
```
### Option 3: Community Reference Catalog
diff --git a/extensions/EXTENSION-PUBLISHING-GUIDE.md b/extensions/EXTENSION-PUBLISHING-GUIDE.md
index 25801ca17..143373874 100644
--- a/extensions/EXTENSION-PUBLISHING-GUIDE.md
+++ b/extensions/EXTENSION-PUBLISHING-GUIDE.md
@@ -122,7 +122,7 @@ Test that users can install from your release:
specify extension add --dev /path/to/your-extension
# Test from GitHub archive
-specify extension add --from https://github.com/your-org/spec-kit-your-extension/archive/refs/tags/v1.0.0.zip
+specify extension add --from https://github.com/your-org/spec-kit-your-extension/archive/refs/tags/v1.0.0.zip
```
---
diff --git a/extensions/EXTENSION-USER-GUIDE.md b/extensions/EXTENSION-USER-GUIDE.md
index e136de604..190e263af 100644
--- a/extensions/EXTENSION-USER-GUIDE.md
+++ b/extensions/EXTENSION-USER-GUIDE.md
@@ -160,7 +160,7 @@ This will:
```bash
# From GitHub release
-specify extension add --from https://github.com/org/spec-kit-ext/archive/refs/tags/v1.0.0.zip
+specify extension add --from https://github.com/org/spec-kit-ext/archive/refs/tags/v1.0.0.zip
```
### Install from Local Directory (Development)
@@ -737,7 +737,7 @@ You can still install extensions not in your catalog using `--from`:
specify extension add jira
# Direct URL (bypasses catalog)
-specify extension add --from https://github.com/someone/spec-kit-ext/archive/v1.0.0.zip
+specify extension add --from https://github.com/someone/spec-kit-ext/archive/v1.0.0.zip
# Local development
specify extension add --dev /path/to/extension
@@ -807,7 +807,7 @@ specify extension add --dev /path/to/extension
2. Install older version of extension:
```bash
- specify extension add --from https://github.com/org/ext/archive/v1.0.0.zip
+ specify extension add --from https://github.com/org/ext/archive/v1.0.0.zip
```
### MCP Tool Not Available
diff --git a/extensions/README.md b/extensions/README.md
index eb8c3c782..a8eedf7ce 100644
--- a/extensions/README.md
+++ b/extensions/README.md
@@ -59,7 +59,7 @@ Populate your `catalog.json` with approved extensions:
Skip catalog curation - team members install directly using URLs:
```bash
-specify extension add --from https://github.com/org/spec-kit-ext/archive/refs/tags/v1.0.0.zip
+specify extension add --from https://github.com/org/spec-kit-ext/archive/refs/tags/v1.0.0.zip
```
**Benefits**: Quick for one-off testing or private extensions
@@ -108,7 +108,7 @@ specify extension search # See what's in your catalog
specify extension add # Install by name
# Direct from URL (bypasses catalog)
-specify extension add --from https://github.com///archive/refs/tags/.zip
+specify extension add --from https://github.com///archive/refs/tags/.zip
# List installed extensions
specify extension list
diff --git a/extensions/catalog.community.json b/extensions/catalog.community.json
index e210dd14f..e24cb2f77 100644
--- a/extensions/catalog.community.json
+++ b/extensions/catalog.community.json
@@ -1,12 +1,12 @@
{
"schema_version": "1.0",
- "updated_at": "2026-03-28T00:00:00Z",
+ "updated_at": "2026-03-30T00:00:00Z",
"catalog_url": "https://raw.githubusercontent.com/github/spec-kit/main/extensions/catalog.community.json",
"extensions": {
"aide": {
"name": "AI-Driven Engineering (AIDE)",
"id": "aide",
- "description": "A structured 7-step workflow for building new projects from scratch with AI assistants \u2014 from vision through implementation.",
+ "description": "A structured 7-step workflow for building new projects from scratch with AI assistants β from vision through implementation.",
"author": "mnriem",
"version": "1.0.0",
"download_url": "https://github.com/mnriem/spec-kit-extensions/releases/download/aide-v1.0.0/aide.zip",
@@ -170,7 +170,7 @@
"cognitive-squad": {
"name": "Cognitive Squad",
"id": "cognitive-squad",
- "description": "Multi-agent cognitive system with Triadic Model: understanding, internalization, application \u2014 with quality gates, backpropagation verification, and self-healing",
+ "description": "Multi-agent cognitive system with Triadic Model: understanding, internalization, application β with quality gates, backpropagation verification, and self-healing",
"author": "Testimonial",
"version": "0.1.0",
"download_url": "https://github.com/Testimonial/cognitive-squad/archive/refs/tags/v0.1.0.zip",
@@ -242,7 +242,7 @@
"updated_at": "2026-03-19T12:08:20Z"
},
"docguard": {
- "name": "DocGuard \u2014 CDD Enforcement",
+ "name": "DocGuard β CDD Enforcement",
"id": "docguard",
"description": "Canonical-Driven Development enforcement. Validates, scores, and traces project documentation with automated checks, AI-driven workflows, and spec-kit hooks. Zero NPM runtime dependencies.",
"author": "raccioly",
@@ -379,7 +379,7 @@
"iterate": {
"name": "Iterate",
"id": "iterate",
- "description": "Iterate on spec documents with a two-phase define-and-apply workflow \u2014 refine specs mid-implementation and go straight back to building",
+ "description": "Iterate on spec documents with a two-phase define-and-apply workflow β refine specs mid-implementation and go straight back to building",
"author": "Vianca Martinez",
"version": "2.0.0",
"download_url": "https://github.com/imviancagrace/spec-kit-iterate/archive/refs/tags/v2.0.0.zip",
@@ -469,9 +469,9 @@
"updated_at": "2026-03-17T00:00:00Z"
},
"maqa": {
- "name": "MAQA \u2014 Multi-Agent & Quality Assurance",
+ "name": "MAQA β Multi-Agent & Quality Assurance",
"id": "maqa",
- "description": "Coordinator \u2192 feature \u2192 QA agent workflow with parallel worktree-based implementation. Language-agnostic. Auto-detects installed board plugins (Trello, Linear, GitHub Projects, Jira, Azure DevOps). Optional CI gate.",
+ "description": "Coordinator β feature β QA agent workflow with parallel worktree-based implementation. Language-agnostic. Auto-detects installed board plugins (Trello, Linear, GitHub Projects, Jira, Azure DevOps). Optional CI gate.",
"author": "GenieRobot",
"version": "0.1.3",
"download_url": "https://github.com/GenieRobot/spec-kit-maqa-ext/releases/download/maqa-v0.1.3/maqa.zip",
@@ -994,7 +994,7 @@
"status": {
"name": "Project Status",
"id": "status",
- "description": "Show current SDD workflow progress \u2014 active feature, artifact status, task completion, workflow phase, and extensions summary.",
+ "description": "Show current SDD workflow progress β active feature, artifact status, task completion, workflow phase, and extensions summary.",
"author": "KhawarHabibKhan",
"version": "1.0.0",
"download_url": "https://github.com/KhawarHabibKhan/spec-kit-status/archive/refs/tags/v1.0.0.zip",
@@ -1023,6 +1023,49 @@
"created_at": "2026-03-16T00:00:00Z",
"updated_at": "2026-03-16T00:00:00Z"
},
+ "superb": {
+ "name": "Superpowers Bridge",
+ "id": "superb",
+ "description": "Orchestrates obra/superpowers skills within the spec-kit SDD workflow. Thin bridge commands delegate to superpowers' authoritative SKILL.md files at runtime (with graceful fallback), while bridge-original commands provide spec-kit-native value. Eight commands cover the full lifecycle: intent clarification, TDD enforcement, task review, verification, critique, systematic debugging, branch completion, and review response. Hook-bound commands fire automatically; standalone commands are invoked when needed.",
+ "author": "rbbtsn0w",
+ "version": "1.0.0",
+ "download_url": "https://github.com/RbBtSn0w/spec-kit-extensions/releases/download/superpowers-bridge-v1.0.0/superpowers-bridge.zip",
+ "repository": "https://github.com/RbBtSn0w/spec-kit-extensions",
+ "homepage": "https://github.com/RbBtSn0w/spec-kit-extensions",
+ "documentation": "https://github.com/RbBtSn0w/spec-kit-extensions/blob/main/superpowers-bridge/README.md",
+ "changelog": "https://github.com/RbBtSn0w/spec-kit-extensions/blob/main/superpowers-bridge/CHANGELOG.md",
+ "license": "MIT",
+ "requires": {
+ "speckit_version": ">=0.4.3",
+ "tools": [
+ {
+ "name": "superpowers",
+ "version": ">=5.0.0",
+ "required": false
+ }
+ ]
+ },
+ "provides": {
+ "commands": 8,
+ "hooks": 4
+ },
+ "tags": [
+ "methodology",
+ "tdd",
+ "code-review",
+ "workflow",
+ "superpowers",
+ "brainstorming",
+ "verification",
+ "debugging",
+ "branch-management"
+ ],
+ "verified": false,
+ "downloads": 0,
+ "stars": 0,
+ "created_at": "2026-03-30T00:00:00Z",
+ "updated_at": "2026-03-30T00:00:00Z"
+ },
"sync": {
"name": "Spec Sync",
"id": "sync",
@@ -1058,7 +1101,7 @@
"understanding": {
"name": "Understanding",
"id": "understanding",
- "description": "Automated requirements quality analysis \u2014 validates specs against IEEE/ISO standards using 31 deterministic metrics. Catches ambiguity, missing testability, and structural issues before they reach implementation. Includes experimental energy-based ambiguity detection using local LM token perplexity.",
+ "description": "Automated requirements quality analysis β validates specs against IEEE/ISO standards using 31 deterministic metrics. Catches ambiguity, missing testability, and structural issues before they reach implementation. Includes experimental energy-based ambiguity detection using local LM token perplexity.",
"author": "Ladislav Bihari",
"version": "3.4.0",
"download_url": "https://github.com/Testimonial/understanding/archive/refs/tags/v3.4.0.zip",
diff --git a/pyproject.toml b/pyproject.toml
index 3810238ad..dbb24e59f 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "specify-cli"
-version = "0.4.3"
+version = "0.4.5.dev0"
description = "Specify CLI, part of GitHub Spec Kit. A tool to bootstrap your projects for Spec-Driven Development (SDD)."
requires-python = ">=3.11"
dependencies = [
diff --git a/src/specify_cli/__init__.py b/src/specify_cli/__init__.py
index b10a72d05..f9dcc95da 100644
--- a/src/specify_cli/__init__.py
+++ b/src/specify_cli/__init__.py
@@ -1204,6 +1204,84 @@ def _locate_release_script() -> tuple[Path, str]:
raise FileNotFoundError(f"Release script '{name}' not found in core_pack or source checkout")
+def _install_shared_infra(
+ project_path: Path,
+ script_type: str,
+ tracker: StepTracker | None = None,
+) -> bool:
+ """Install shared infrastructure files into *project_path*.
+
+ Copies ``.specify/scripts/`` and ``.specify/templates/`` from the
+ bundled core_pack or source checkout. Tracks all installed files
+ in ``speckit.manifest.json``.
+ Returns ``True`` on success.
+ """
+ from .integrations.manifest import IntegrationManifest
+
+ core = _locate_core_pack()
+ manifest = IntegrationManifest("speckit", project_path, version=get_speckit_version())
+
+ # Scripts
+ if core and (core / "scripts").is_dir():
+ scripts_src = core / "scripts"
+ else:
+ repo_root = Path(__file__).parent.parent.parent
+ scripts_src = repo_root / "scripts"
+
+ skipped_files: list[str] = []
+
+ if scripts_src.is_dir():
+ dest_scripts = project_path / ".specify" / "scripts"
+ dest_scripts.mkdir(parents=True, exist_ok=True)
+ variant_dir = "bash" if script_type == "sh" else "powershell"
+ variant_src = scripts_src / variant_dir
+ if variant_src.is_dir():
+ dest_variant = dest_scripts / variant_dir
+ dest_variant.mkdir(parents=True, exist_ok=True)
+ # Merge without overwriting β only add files that don't exist yet
+ for src_path in variant_src.rglob("*"):
+ if src_path.is_file():
+ rel_path = src_path.relative_to(variant_src)
+ dst_path = dest_variant / rel_path
+ if dst_path.exists():
+ skipped_files.append(str(dst_path.relative_to(project_path)))
+ else:
+ dst_path.parent.mkdir(parents=True, exist_ok=True)
+ shutil.copy2(src_path, dst_path)
+ rel = dst_path.relative_to(project_path).as_posix()
+ manifest.record_existing(rel)
+
+ # Page templates (not command templates, not vscode-settings.json)
+ if core and (core / "templates").is_dir():
+ templates_src = core / "templates"
+ else:
+ repo_root = Path(__file__).parent.parent.parent
+ templates_src = repo_root / "templates"
+
+ if templates_src.is_dir():
+ dest_templates = project_path / ".specify" / "templates"
+ dest_templates.mkdir(parents=True, exist_ok=True)
+ for f in templates_src.iterdir():
+ if f.is_file() and f.name != "vscode-settings.json" and not f.name.startswith("."):
+ dst = dest_templates / f.name
+ if dst.exists():
+ skipped_files.append(str(dst.relative_to(project_path)))
+ else:
+ shutil.copy2(f, dst)
+ rel = dst.relative_to(project_path).as_posix()
+ manifest.record_existing(rel)
+
+ if skipped_files:
+ import logging
+ logging.getLogger(__name__).warning(
+ "The following shared files already exist and were not overwritten:\n%s",
+ "\n".join(f" {f}" for f in skipped_files),
+ )
+
+ manifest.save()
+ return True
+
+
def scaffold_from_core_pack(
project_path: Path,
ai_assistant: str,
@@ -1835,6 +1913,7 @@ def init(
offline: bool = typer.Option(False, "--offline", help="Use assets bundled in the specify-cli package instead of downloading from GitHub (no network access required). Bundled assets will become the default in v0.6.0 and this flag will be removed."),
preset: str = typer.Option(None, "--preset", help="Install a preset during initialization (by preset ID)"),
branch_numbering: str = typer.Option(None, "--branch-numbering", help="Branch numbering strategy: 'sequential' (001, 002, ...) or 'timestamp' (YYYYMMDD-HHMMSS)"),
+ integration: str = typer.Option(None, "--integration", help="Use the new integration system (e.g. --integration copilot). Mutually exclusive with --ai."),
):
"""
Initialize a new Specify project.
@@ -1896,6 +1975,35 @@ def init(
if ai_assistant:
ai_assistant = AI_ASSISTANT_ALIASES.get(ai_assistant, ai_assistant)
+ # --integration and --ai are mutually exclusive
+ if integration and ai_assistant:
+ console.print("[red]Error:[/red] --integration and --ai are mutually exclusive")
+ console.print("[yellow]Use:[/yellow] --integration for the new integration system, or --ai for the legacy path")
+ raise typer.Exit(1)
+
+ # Auto-promote: --ai β integration path with a nudge (if registered)
+ use_integration = False
+ if integration:
+ from .integrations import INTEGRATION_REGISTRY, get_integration
+ resolved_integration = get_integration(integration)
+ if not resolved_integration:
+ console.print(f"[red]Error:[/red] Unknown integration: '{integration}'")
+ available = ", ".join(sorted(INTEGRATION_REGISTRY))
+ console.print(f"[yellow]Available integrations:[/yellow] {available}")
+ raise typer.Exit(1)
+ use_integration = True
+ # Map integration key to the ai_assistant variable for downstream compatibility
+ ai_assistant = integration
+ elif ai_assistant:
+ from .integrations import get_integration
+ resolved_integration = get_integration(ai_assistant)
+ if resolved_integration:
+ use_integration = True
+ console.print(
+ f"[dim]Tip: Use [bold]--integration {ai_assistant}[/bold] instead of "
+ f"--ai {ai_assistant}. The --ai flag will be deprecated in a future release.[/dim]"
+ )
+
if project_name == ".":
here = True
project_name = None # Clear project_name to use existing validation logic
@@ -2064,7 +2172,10 @@ def init(
"This will become the default in v0.6.0."
)
- if use_github:
+ if use_integration:
+ tracker.add("integration", "Install integration")
+ tracker.add("shared-infra", "Install shared infrastructure")
+ elif use_github:
for key, label in [
("fetch", "Fetch latest release"),
("download", "Download template"),
@@ -2099,7 +2210,39 @@ def init(
verify = not skip_tls
local_ssl_context = ssl_context if verify else False
- if use_github:
+ if use_integration:
+ # Integration-based scaffolding (new path)
+ from .integrations.manifest import IntegrationManifest
+ tracker.start("integration")
+ manifest = IntegrationManifest(
+ resolved_integration.key, project_path, version=get_speckit_version()
+ )
+ resolved_integration.setup(
+ project_path, manifest,
+ script_type=selected_script,
+ )
+ manifest.save()
+
+ # Write .specify/integration.json
+ script_ext = "sh" if selected_script == "sh" else "ps1"
+ integration_json = project_path / ".specify" / "integration.json"
+ integration_json.parent.mkdir(parents=True, exist_ok=True)
+ integration_json.write_text(json.dumps({
+ "integration": resolved_integration.key,
+ "version": get_speckit_version(),
+ "scripts": {
+ "update-context": f".specify/integrations/{resolved_integration.key}/scripts/update-context.{script_ext}",
+ },
+ }, indent=2) + "\n", encoding="utf-8")
+
+ tracker.complete("integration", resolved_integration.config.get("name", resolved_integration.key))
+
+ # Install shared infrastructure (scripts, templates)
+ tracker.start("shared-infra")
+ _install_shared_infra(project_path, selected_script, tracker=tracker)
+ tracker.complete("shared-infra", f"scripts ({selected_script}) + templates")
+
+ elif use_github:
with httpx.Client(verify=local_ssl_context) as local_client:
download_and_extract_template(
project_path,
@@ -2234,7 +2377,7 @@ def init(
# Persist the CLI options so later operations (e.g. preset add)
# can adapt their behaviour without re-scanning the filesystem.
# Must be saved BEFORE preset install so _get_skills_dir() works.
- save_init_options(project_path, {
+ init_opts = {
"ai": selected_ai,
"ai_skills": ai_skills,
"ai_commands_dir": ai_commands_dir,
@@ -2244,7 +2387,10 @@ def init(
"offline": offline,
"script": selected_script,
"speckit_version": get_speckit_version(),
- })
+ }
+ if use_integration:
+ init_opts["integration"] = resolved_integration.key
+ save_init_options(project_path, init_opts)
# Install preset if specified
if preset:
diff --git a/src/specify_cli/agents.py b/src/specify_cli/agents.py
index 4f574bf61..10cf5eb31 100644
--- a/src/specify_cli/agents.py
+++ b/src/specify_cli/agents.py
@@ -43,7 +43,7 @@ class CommandRegistrar:
"args": "$ARGUMENTS",
"extension": ".agent.md"
},
- "cursor": {
+ "cursor-agent": {
"dir": ".cursor/commands",
"format": "markdown",
"args": "$ARGUMENTS",
@@ -170,6 +170,11 @@ class CommandRegistrar:
"extension": ".md",
"strip_frontmatter_keys": ["handoffs"],
"inject_name": True,
+ "vibe": {
+ "dir": ".vibe/prompts",
+ "format": "markdown",
+ "args": "$ARGUMENTS",
+ "extension": ".md"
}
}
@@ -243,11 +248,11 @@ class CommandRegistrar:
for key, script_path in scripts.items():
if isinstance(script_path, str):
- scripts[key] = self._rewrite_project_relative_paths(script_path)
+ scripts[key] = self.rewrite_project_relative_paths(script_path)
return frontmatter
@staticmethod
- def _rewrite_project_relative_paths(text: str) -> str:
+ def rewrite_project_relative_paths(text: str) -> str:
"""Rewrite repo-relative paths to their generated project locations."""
if not isinstance(text, str) or not text:
return text
@@ -430,7 +435,7 @@ class CommandRegistrar:
body = body.replace("{AGENT_SCRIPT}", agent_script_command)
body = body.replace("{ARGS}", "$ARGUMENTS").replace("__AGENT__", agent_name)
- return CommandRegistrar._rewrite_project_relative_paths(body)
+ return CommandRegistrar.rewrite_project_relative_paths(body)
def _convert_argument_placeholder(self, content: str, from_placeholder: str, to_placeholder: str) -> str:
"""Convert argument placeholder format.
diff --git a/src/specify_cli/integrations/__init__.py b/src/specify_cli/integrations/__init__.py
new file mode 100644
index 000000000..0d7a71242
--- /dev/null
+++ b/src/specify_cli/integrations/__init__.py
@@ -0,0 +1,93 @@
+"""Integration registry for AI coding assistants.
+
+Each integration is a self-contained subpackage that handles setup/teardown
+for a specific AI assistant (Copilot, Claude, Gemini, etc.).
+"""
+
+from __future__ import annotations
+
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from .base import IntegrationBase
+
+# Maps integration key β IntegrationBase instance.
+# Populated by later stages as integrations are migrated.
+INTEGRATION_REGISTRY: dict[str, IntegrationBase] = {}
+
+
+def _register(integration: IntegrationBase) -> None:
+ """Register an integration instance in the global registry.
+
+ Raises ``ValueError`` for falsy keys and ``KeyError`` for duplicates.
+ """
+ key = integration.key
+ if not key:
+ raise ValueError("Cannot register integration with an empty key.")
+ if key in INTEGRATION_REGISTRY:
+ raise KeyError(f"Integration with key {key!r} is already registered.")
+ INTEGRATION_REGISTRY[key] = integration
+
+
+def get_integration(key: str) -> IntegrationBase | None:
+ """Return the integration for *key*, or ``None`` if not registered."""
+ return INTEGRATION_REGISTRY.get(key)
+
+
+# -- Register built-in integrations --------------------------------------
+
+def _register_builtins() -> None:
+ """Register all built-in integrations.
+
+ Package directories use Python-safe identifiers (e.g. ``kiro_cli``,
+ ``cursor_agent``). The user-facing integration key stored in
+ ``IntegrationBase.key`` stays hyphenated (``"kiro-cli"``,
+ ``"cursor-agent"``) to match the actual CLI tool / binary name that
+ users install and invoke.
+ """
+ # -- Imports (alphabetical) -------------------------------------------
+ from .amp import AmpIntegration
+ from .auggie import AuggieIntegration
+ from .bob import BobIntegration
+ from .claude import ClaudeIntegration
+ from .codebuddy import CodebuddyIntegration
+ from .copilot import CopilotIntegration
+ from .cursor_agent import CursorAgentIntegration
+ from .iflow import IflowIntegration
+ from .junie import JunieIntegration
+ from .kilocode import KilocodeIntegration
+ from .kiro_cli import KiroCliIntegration
+ from .opencode import OpencodeIntegration
+ from .pi import PiIntegration
+ from .qodercli import QodercliIntegration
+ from .qwen import QwenIntegration
+ from .roo import RooIntegration
+ from .shai import ShaiIntegration
+ from .trae import TraeIntegration
+ from .vibe import VibeIntegration
+ from .windsurf import WindsurfIntegration
+
+ # -- Registration (alphabetical) --------------------------------------
+ _register(AmpIntegration())
+ _register(AuggieIntegration())
+ _register(BobIntegration())
+ _register(ClaudeIntegration())
+ _register(CodebuddyIntegration())
+ _register(CopilotIntegration())
+ _register(CursorAgentIntegration())
+ _register(IflowIntegration())
+ _register(JunieIntegration())
+ _register(KilocodeIntegration())
+ _register(KiroCliIntegration())
+ _register(OpencodeIntegration())
+ _register(PiIntegration())
+ _register(QodercliIntegration())
+ _register(QwenIntegration())
+ _register(RooIntegration())
+ _register(ShaiIntegration())
+ _register(TraeIntegration())
+ _register(VibeIntegration())
+ _register(WindsurfIntegration())
+
+
+_register_builtins()
diff --git a/src/specify_cli/integrations/amp/__init__.py b/src/specify_cli/integrations/amp/__init__.py
new file mode 100644
index 000000000..39df0a9bb
--- /dev/null
+++ b/src/specify_cli/integrations/amp/__init__.py
@@ -0,0 +1,21 @@
+"""Amp CLI integration."""
+
+from ..base import MarkdownIntegration
+
+
+class AmpIntegration(MarkdownIntegration):
+ key = "amp"
+ config = {
+ "name": "Amp",
+ "folder": ".agents/",
+ "commands_subdir": "commands",
+ "install_url": "https://ampcode.com/manual#install",
+ "requires_cli": True,
+ }
+ registrar_config = {
+ "dir": ".agents/commands",
+ "format": "markdown",
+ "args": "$ARGUMENTS",
+ "extension": ".md",
+ }
+ context_file = "AGENTS.md"
diff --git a/src/specify_cli/integrations/amp/scripts/update-context.ps1 b/src/specify_cli/integrations/amp/scripts/update-context.ps1
new file mode 100644
index 000000000..c217b99f9
--- /dev/null
+++ b/src/specify_cli/integrations/amp/scripts/update-context.ps1
@@ -0,0 +1,23 @@
+# update-context.ps1 β Amp integration: create/update AGENTS.md
+#
+# Thin wrapper that delegates to the shared update-agent-context script.
+# Activated in Stage 7 when the shared script uses integration.json dispatch.
+#
+# Until then, this delegates to the shared script as a subprocess.
+
+$ErrorActionPreference = 'Stop'
+
+# Derive repo root from script location (walks up to find .specify/)
+$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Definition
+$repoRoot = try { git rev-parse --show-toplevel 2>$null } catch { $null }
+# If git did not return a repo root, or the git root does not contain .specify,
+# fall back to walking up from the script directory to find the initialized project root.
+if (-not $repoRoot -or -not (Test-Path (Join-Path $repoRoot '.specify'))) {
+ $repoRoot = $scriptDir
+ $fsRoot = [System.IO.Path]::GetPathRoot($repoRoot)
+ while ($repoRoot -and $repoRoot -ne $fsRoot -and -not (Test-Path (Join-Path $repoRoot '.specify'))) {
+ $repoRoot = Split-Path -Parent $repoRoot
+ }
+}
+
+& "$repoRoot/.specify/scripts/powershell/update-agent-context.ps1" -AgentType amp
diff --git a/src/specify_cli/integrations/amp/scripts/update-context.sh b/src/specify_cli/integrations/amp/scripts/update-context.sh
new file mode 100755
index 000000000..56cbf6e78
--- /dev/null
+++ b/src/specify_cli/integrations/amp/scripts/update-context.sh
@@ -0,0 +1,28 @@
+#!/usr/bin/env bash
+# update-context.sh β Amp integration: create/update AGENTS.md
+#
+# Thin wrapper that delegates to the shared update-agent-context script.
+# Activated in Stage 7 when the shared script uses integration.json dispatch.
+#
+# Until then, this delegates to the shared script as a subprocess.
+
+set -euo pipefail
+
+# Derive repo root from script location (walks up to find .specify/)
+_script_dir="$(cd "$(dirname "$0")" && pwd)"
+_root="$_script_dir"
+while [ "$_root" != "/" ] && [ ! -d "$_root/.specify" ]; do _root="$(dirname "$_root")"; done
+if [ -z "${REPO_ROOT:-}" ]; then
+ if [ -d "$_root/.specify" ]; then
+ REPO_ROOT="$_root"
+ else
+ git_root="$(git rev-parse --show-toplevel 2>/dev/null || true)"
+ if [ -n "$git_root" ] && [ -d "$git_root/.specify" ]; then
+ REPO_ROOT="$git_root"
+ else
+ REPO_ROOT="$_root"
+ fi
+ fi
+fi
+
+exec "$REPO_ROOT/.specify/scripts/bash/update-agent-context.sh" amp
diff --git a/src/specify_cli/integrations/auggie/__init__.py b/src/specify_cli/integrations/auggie/__init__.py
new file mode 100644
index 000000000..9715e936e
--- /dev/null
+++ b/src/specify_cli/integrations/auggie/__init__.py
@@ -0,0 +1,21 @@
+"""Auggie CLI integration."""
+
+from ..base import MarkdownIntegration
+
+
+class AuggieIntegration(MarkdownIntegration):
+ key = "auggie"
+ config = {
+ "name": "Auggie CLI",
+ "folder": ".augment/",
+ "commands_subdir": "commands",
+ "install_url": "https://docs.augmentcode.com/cli/setup-auggie/install-auggie-cli",
+ "requires_cli": True,
+ }
+ registrar_config = {
+ "dir": ".augment/commands",
+ "format": "markdown",
+ "args": "$ARGUMENTS",
+ "extension": ".md",
+ }
+ context_file = ".augment/rules/specify-rules.md"
diff --git a/src/specify_cli/integrations/auggie/scripts/update-context.ps1 b/src/specify_cli/integrations/auggie/scripts/update-context.ps1
new file mode 100644
index 000000000..49e7e6b5f
--- /dev/null
+++ b/src/specify_cli/integrations/auggie/scripts/update-context.ps1
@@ -0,0 +1,23 @@
+# update-context.ps1 β Auggie CLI integration: create/update .augment/rules/specify-rules.md
+#
+# Thin wrapper that delegates to the shared update-agent-context script.
+# Activated in Stage 7 when the shared script uses integration.json dispatch.
+#
+# Until then, this delegates to the shared script as a subprocess.
+
+$ErrorActionPreference = 'Stop'
+
+# Derive repo root from script location (walks up to find .specify/)
+$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Definition
+$repoRoot = try { git rev-parse --show-toplevel 2>$null } catch { $null }
+# If git did not return a repo root, or the git root does not contain .specify,
+# fall back to walking up from the script directory to find the initialized project root.
+if (-not $repoRoot -or -not (Test-Path (Join-Path $repoRoot '.specify'))) {
+ $repoRoot = $scriptDir
+ $fsRoot = [System.IO.Path]::GetPathRoot($repoRoot)
+ while ($repoRoot -and $repoRoot -ne $fsRoot -and -not (Test-Path (Join-Path $repoRoot '.specify'))) {
+ $repoRoot = Split-Path -Parent $repoRoot
+ }
+}
+
+& "$repoRoot/.specify/scripts/powershell/update-agent-context.ps1" -AgentType auggie
diff --git a/src/specify_cli/integrations/auggie/scripts/update-context.sh b/src/specify_cli/integrations/auggie/scripts/update-context.sh
new file mode 100755
index 000000000..4cf80bba2
--- /dev/null
+++ b/src/specify_cli/integrations/auggie/scripts/update-context.sh
@@ -0,0 +1,28 @@
+#!/usr/bin/env bash
+# update-context.sh β Auggie CLI integration: create/update .augment/rules/specify-rules.md
+#
+# Thin wrapper that delegates to the shared update-agent-context script.
+# Activated in Stage 7 when the shared script uses integration.json dispatch.
+#
+# Until then, this delegates to the shared script as a subprocess.
+
+set -euo pipefail
+
+# Derive repo root from script location (walks up to find .specify/)
+_script_dir="$(cd "$(dirname "$0")" && pwd)"
+_root="$_script_dir"
+while [ "$_root" != "/" ] && [ ! -d "$_root/.specify" ]; do _root="$(dirname "$_root")"; done
+if [ -z "${REPO_ROOT:-}" ]; then
+ if [ -d "$_root/.specify" ]; then
+ REPO_ROOT="$_root"
+ else
+ git_root="$(git rev-parse --show-toplevel 2>/dev/null || true)"
+ if [ -n "$git_root" ] && [ -d "$git_root/.specify" ]; then
+ REPO_ROOT="$git_root"
+ else
+ REPO_ROOT="$_root"
+ fi
+ fi
+fi
+
+exec "$REPO_ROOT/.specify/scripts/bash/update-agent-context.sh" auggie
diff --git a/src/specify_cli/integrations/base.py b/src/specify_cli/integrations/base.py
new file mode 100644
index 000000000..0320d7f7a
--- /dev/null
+++ b/src/specify_cli/integrations/base.py
@@ -0,0 +1,500 @@
+"""Base classes for AI-assistant integrations.
+
+Provides:
+- ``IntegrationOption`` β declares a CLI option an integration accepts.
+- ``IntegrationBase`` β abstract base every integration must implement.
+- ``MarkdownIntegration`` β concrete base for standard Markdown-format
+ integrations (the common case β subclass, set three class attrs, done).
+"""
+
+from __future__ import annotations
+
+import re
+import shutil
+from abc import ABC
+from dataclasses import dataclass
+from pathlib import Path
+from typing import TYPE_CHECKING, Any
+
+if TYPE_CHECKING:
+ from .manifest import IntegrationManifest
+
+
+# ---------------------------------------------------------------------------
+# IntegrationOption
+# ---------------------------------------------------------------------------
+
+@dataclass(frozen=True)
+class IntegrationOption:
+ """Declares an option that an integration accepts via ``--integration-options``.
+
+ Attributes:
+ name: The flag name (e.g. ``"--commands-dir"``).
+ is_flag: ``True`` for boolean flags (``--skills``).
+ required: ``True`` if the option must be supplied.
+ default: Default value when not supplied (``None`` β no default).
+ help: One-line description shown in ``specify integrate info``.
+ """
+
+ name: str
+ is_flag: bool = False
+ required: bool = False
+ default: Any = None
+ help: str = ""
+
+
+# ---------------------------------------------------------------------------
+# IntegrationBase β abstract base class
+# ---------------------------------------------------------------------------
+
+class IntegrationBase(ABC):
+ """Abstract base class every integration must implement.
+
+ Subclasses must set the following class-level attributes:
+
+ * ``key`` β unique identifier, matches actual CLI tool name
+ * ``config`` β dict compatible with ``AGENT_CONFIG`` entries
+ * ``registrar_config`` β dict compatible with ``CommandRegistrar.AGENT_CONFIGS``
+
+ And may optionally set:
+
+ * ``context_file`` β path (relative to project root) of the agent
+ context/instructions file (e.g. ``"CLAUDE.md"``)
+ """
+
+ # -- Must be set by every subclass ------------------------------------
+
+ key: str = ""
+ """Unique integration key β should match the actual CLI tool name."""
+
+ config: dict[str, Any] | None = None
+ """Metadata dict matching the ``AGENT_CONFIG`` shape."""
+
+ registrar_config: dict[str, Any] | None = None
+ """Registration dict matching ``CommandRegistrar.AGENT_CONFIGS`` shape."""
+
+ # -- Optional ---------------------------------------------------------
+
+ context_file: str | None = None
+ """Relative path to the agent context file (e.g. ``CLAUDE.md``)."""
+
+ # -- Public API -------------------------------------------------------
+
+ @classmethod
+ def options(cls) -> list[IntegrationOption]:
+ """Return options this integration accepts. Default: none."""
+ return []
+
+ # -- Primitives β building blocks for setup() -------------------------
+
+ def shared_commands_dir(self) -> Path | None:
+ """Return path to the shared command templates directory.
+
+ Checks ``core_pack/commands/`` (wheel install) first, then
+ ``templates/commands/`` (source checkout). Returns ``None``
+ if neither exists.
+ """
+ import inspect
+
+ pkg_dir = Path(inspect.getfile(IntegrationBase)).resolve().parent.parent
+ for candidate in [
+ pkg_dir / "core_pack" / "commands",
+ pkg_dir.parent.parent / "templates" / "commands",
+ ]:
+ if candidate.is_dir():
+ return candidate
+ return None
+
+ def shared_templates_dir(self) -> Path | None:
+ """Return path to the shared page templates directory.
+
+ Contains ``vscode-settings.json``, ``spec-template.md``, etc.
+ Checks ``core_pack/templates/`` then ``templates/``.
+ """
+ import inspect
+
+ pkg_dir = Path(inspect.getfile(IntegrationBase)).resolve().parent.parent
+ for candidate in [
+ pkg_dir / "core_pack" / "templates",
+ pkg_dir.parent.parent / "templates",
+ ]:
+ if candidate.is_dir():
+ return candidate
+ return None
+
+ def list_command_templates(self) -> list[Path]:
+ """Return sorted list of command template files from the shared directory."""
+ cmd_dir = self.shared_commands_dir()
+ if not cmd_dir or not cmd_dir.is_dir():
+ return []
+ return sorted(f for f in cmd_dir.iterdir() if f.is_file() and f.suffix == ".md")
+
+ def command_filename(self, template_name: str) -> str:
+ """Return the destination filename for a command template.
+
+ *template_name* is the stem of the source file (e.g. ``"plan"``).
+ Default: ``speckit.{template_name}.md``. Subclasses override
+ to change the extension or naming convention.
+ """
+ return f"speckit.{template_name}.md"
+
+ def commands_dest(self, project_root: Path) -> Path:
+ """Return the absolute path to the commands output directory.
+
+ Derived from ``config["folder"]`` and ``config["commands_subdir"]``.
+ Raises ``ValueError`` if ``config`` or ``folder`` is missing.
+ """
+ if not self.config:
+ raise ValueError(
+ f"{type(self).__name__}.config is not set; integration "
+ "subclasses must define a non-empty 'config' mapping."
+ )
+ folder = self.config.get("folder")
+ if not folder:
+ raise ValueError(
+ f"{type(self).__name__}.config is missing required 'folder' entry."
+ )
+ subdir = self.config.get("commands_subdir", "commands")
+ return project_root / folder / subdir
+
+ # -- File operations β granular primitives for setup() ----------------
+
+ @staticmethod
+ def copy_command_to_directory(
+ src: Path,
+ dest_dir: Path,
+ filename: str,
+ ) -> Path:
+ """Copy a command template to *dest_dir* with the given *filename*.
+
+ Creates *dest_dir* if needed. Returns the absolute path of the
+ written file. The caller can post-process the file before
+ recording it in the manifest.
+ """
+ dest_dir.mkdir(parents=True, exist_ok=True)
+ dst = dest_dir / filename
+ shutil.copy2(src, dst)
+ return dst
+
+ @staticmethod
+ def record_file_in_manifest(
+ file_path: Path,
+ project_root: Path,
+ manifest: IntegrationManifest,
+ ) -> None:
+ """Hash *file_path* and record it in *manifest*.
+
+ *file_path* must be inside *project_root*.
+ """
+ rel = file_path.resolve().relative_to(project_root.resolve())
+ manifest.record_existing(rel)
+
+ @staticmethod
+ def write_file_and_record(
+ content: str,
+ dest: Path,
+ project_root: Path,
+ manifest: IntegrationManifest,
+ ) -> Path:
+ """Write *content* to *dest*, hash it, and record in *manifest*.
+
+ Creates parent directories as needed. Returns *dest*.
+ """
+ dest.parent.mkdir(parents=True, exist_ok=True)
+ dest.write_text(content, encoding="utf-8")
+ rel = dest.resolve().relative_to(project_root.resolve())
+ manifest.record_existing(rel)
+ return dest
+
+ def integration_scripts_dir(self) -> Path | None:
+ """Return path to this integration's bundled ``scripts/`` directory.
+
+ Looks for a ``scripts/`` sibling of the module that defines the
+ concrete subclass (not ``IntegrationBase`` itself).
+ Returns ``None`` if the directory doesn't exist.
+ """
+ import inspect
+
+ cls_file = inspect.getfile(type(self))
+ scripts = Path(cls_file).resolve().parent / "scripts"
+ return scripts if scripts.is_dir() else None
+
+ def install_scripts(
+ self,
+ project_root: Path,
+ manifest: IntegrationManifest,
+ ) -> list[Path]:
+ """Copy integration-specific scripts into the project.
+
+ Copies files from this integration's ``scripts/`` directory to
+ ``.specify/integrations//scripts/`` in the project. Shell
+ scripts are made executable. All copied files are recorded in
+ *manifest*.
+
+ Returns the list of files created.
+ """
+ scripts_src = self.integration_scripts_dir()
+ if not scripts_src:
+ return []
+
+ created: list[Path] = []
+ scripts_dest = project_root / ".specify" / "integrations" / self.key / "scripts"
+ scripts_dest.mkdir(parents=True, exist_ok=True)
+
+ for src_script in sorted(scripts_src.iterdir()):
+ if not src_script.is_file():
+ continue
+ dst_script = scripts_dest / src_script.name
+ shutil.copy2(src_script, dst_script)
+ if dst_script.suffix == ".sh":
+ dst_script.chmod(dst_script.stat().st_mode | 0o111)
+ self.record_file_in_manifest(dst_script, project_root, manifest)
+ created.append(dst_script)
+
+ return created
+
+ @staticmethod
+ def process_template(
+ content: str,
+ agent_name: str,
+ script_type: str,
+ arg_placeholder: str = "$ARGUMENTS",
+ ) -> str:
+ """Process a raw command template into agent-ready content.
+
+ Performs the same transformations as the release script:
+ 1. Extract ``scripts.`` value from YAML frontmatter
+ 2. Replace ``{SCRIPT}`` with the extracted script command
+ 3. Extract ``agent_scripts.`` and replace ``{AGENT_SCRIPT}``
+ 4. Strip ``scripts:`` and ``agent_scripts:`` sections from frontmatter
+ 5. Replace ``{ARGS}`` with *arg_placeholder*
+ 6. Replace ``__AGENT__`` with *agent_name*
+ 7. Rewrite paths: ``scripts/`` β ``.specify/scripts/`` etc.
+ """
+ # 1. Extract script command from frontmatter
+ script_command = ""
+ script_pattern = re.compile(
+ rf"^\s*{re.escape(script_type)}:\s*(.+)$", re.MULTILINE
+ )
+ # Find the scripts: block
+ in_scripts = False
+ for line in content.splitlines():
+ if line.strip() == "scripts:":
+ in_scripts = True
+ continue
+ if in_scripts and line and not line[0].isspace():
+ in_scripts = False
+ if in_scripts:
+ m = script_pattern.match(line)
+ if m:
+ script_command = m.group(1).strip()
+ break
+
+ # 2. Replace {SCRIPT}
+ if script_command:
+ content = content.replace("{SCRIPT}", script_command)
+
+ # 3. Extract agent_script command
+ agent_script_command = ""
+ in_agent_scripts = False
+ for line in content.splitlines():
+ if line.strip() == "agent_scripts:":
+ in_agent_scripts = True
+ continue
+ if in_agent_scripts and line and not line[0].isspace():
+ in_agent_scripts = False
+ if in_agent_scripts:
+ m = script_pattern.match(line)
+ if m:
+ agent_script_command = m.group(1).strip()
+ break
+
+ if agent_script_command:
+ content = content.replace("{AGENT_SCRIPT}", agent_script_command)
+
+ # 4. Strip scripts: and agent_scripts: sections from frontmatter
+ lines = content.splitlines(keepends=True)
+ output_lines: list[str] = []
+ in_frontmatter = False
+ skip_section = False
+ dash_count = 0
+ for line in lines:
+ stripped = line.rstrip("\n\r")
+ if stripped == "---":
+ dash_count += 1
+ if dash_count == 1:
+ in_frontmatter = True
+ else:
+ in_frontmatter = False
+ skip_section = False
+ output_lines.append(line)
+ continue
+ if in_frontmatter:
+ if stripped in ("scripts:", "agent_scripts:"):
+ skip_section = True
+ continue
+ if skip_section:
+ if line[0:1].isspace():
+ continue # skip indented content under scripts/agent_scripts
+ skip_section = False
+ output_lines.append(line)
+ content = "".join(output_lines)
+
+ # 5. Replace {ARGS}
+ content = content.replace("{ARGS}", arg_placeholder)
+
+ # 6. Replace __AGENT__
+ content = content.replace("__AGENT__", agent_name)
+
+ # 7. Rewrite paths β delegate to the shared implementation in
+ # CommandRegistrar so extension-local paths are preserved and
+ # boundary rules stay consistent across the codebase.
+ from specify_cli.agents import CommandRegistrar
+ content = CommandRegistrar.rewrite_project_relative_paths(content)
+
+ return content
+
+ def setup(
+ self,
+ project_root: Path,
+ manifest: IntegrationManifest,
+ parsed_options: dict[str, Any] | None = None,
+ **opts: Any,
+ ) -> list[Path]:
+ """Install integration command files into *project_root*.
+
+ Returns the list of files created. Copies raw templates without
+ processing. Integrations that need placeholder replacement
+ (e.g. ``{SCRIPT}``, ``__AGENT__``) should override ``setup()``
+ and call ``process_template()`` in their own loop β see
+ ``CopilotIntegration`` for an example.
+ """
+ templates = self.list_command_templates()
+ if not templates:
+ return []
+
+ project_root_resolved = project_root.resolve()
+ if manifest.project_root != project_root_resolved:
+ raise ValueError(
+ f"manifest.project_root ({manifest.project_root}) does not match "
+ f"project_root ({project_root_resolved})"
+ )
+
+ dest = self.commands_dest(project_root).resolve()
+ try:
+ dest.relative_to(project_root_resolved)
+ except ValueError as exc:
+ raise ValueError(
+ f"Integration destination {dest} escapes "
+ f"project root {project_root_resolved}"
+ ) from exc
+
+ created: list[Path] = []
+
+ for src_file in templates:
+ dst_name = self.command_filename(src_file.stem)
+ dst_file = self.copy_command_to_directory(src_file, dest, dst_name)
+ self.record_file_in_manifest(dst_file, project_root, manifest)
+ created.append(dst_file)
+
+ return created
+
+ def teardown(
+ self,
+ project_root: Path,
+ manifest: IntegrationManifest,
+ *,
+ force: bool = False,
+ ) -> tuple[list[Path], list[Path]]:
+ """Uninstall integration files from *project_root*.
+
+ Delegates to ``manifest.uninstall()`` which only removes files
+ whose hash still matches the recorded value (unless *force*).
+
+ Returns ``(removed, skipped)`` file lists.
+ """
+ return manifest.uninstall(project_root, force=force)
+
+ # -- Convenience helpers for subclasses -------------------------------
+
+ def install(
+ self,
+ project_root: Path,
+ manifest: IntegrationManifest,
+ parsed_options: dict[str, Any] | None = None,
+ **opts: Any,
+ ) -> list[Path]:
+ """High-level install β calls ``setup()`` and returns created files."""
+ return self.setup(
+ project_root, manifest, parsed_options=parsed_options, **opts
+ )
+
+ def uninstall(
+ self,
+ project_root: Path,
+ manifest: IntegrationManifest,
+ *,
+ force: bool = False,
+ ) -> tuple[list[Path], list[Path]]:
+ """High-level uninstall β calls ``teardown()``."""
+ return self.teardown(project_root, manifest, force=force)
+
+
+# ---------------------------------------------------------------------------
+# MarkdownIntegration β covers ~20 standard agents
+# ---------------------------------------------------------------------------
+
+class MarkdownIntegration(IntegrationBase):
+ """Concrete base for integrations that use standard Markdown commands.
+
+ Subclasses only need to set ``key``, ``config``, ``registrar_config``
+ (and optionally ``context_file``). Everything else is inherited.
+
+ ``setup()`` processes command templates (replacing ``{SCRIPT}``,
+ ``{ARGS}``, ``__AGENT__``, rewriting paths) and installs
+ integration-specific scripts (``update-context.sh`` / ``.ps1``).
+ """
+
+ def setup(
+ self,
+ project_root: Path,
+ manifest: IntegrationManifest,
+ parsed_options: dict[str, Any] | None = None,
+ **opts: Any,
+ ) -> list[Path]:
+ templates = self.list_command_templates()
+ if not templates:
+ return []
+
+ project_root_resolved = project_root.resolve()
+ if manifest.project_root != project_root_resolved:
+ raise ValueError(
+ f"manifest.project_root ({manifest.project_root}) does not match "
+ f"project_root ({project_root_resolved})"
+ )
+
+ dest = self.commands_dest(project_root).resolve()
+ try:
+ dest.relative_to(project_root_resolved)
+ except ValueError as exc:
+ raise ValueError(
+ f"Integration destination {dest} escapes "
+ f"project root {project_root_resolved}"
+ ) from exc
+ dest.mkdir(parents=True, exist_ok=True)
+
+ script_type = opts.get("script_type", "sh")
+ arg_placeholder = self.registrar_config.get("args", "$ARGUMENTS") if self.registrar_config else "$ARGUMENTS"
+ created: list[Path] = []
+
+ for src_file in templates:
+ raw = src_file.read_text(encoding="utf-8")
+ processed = self.process_template(raw, self.key, script_type, arg_placeholder)
+ dst_name = self.command_filename(src_file.stem)
+ dst_file = self.write_file_and_record(
+ processed, dest / dst_name, project_root, manifest
+ )
+ created.append(dst_file)
+
+ created.extend(self.install_scripts(project_root, manifest))
+ return created
diff --git a/src/specify_cli/integrations/bob/__init__.py b/src/specify_cli/integrations/bob/__init__.py
new file mode 100644
index 000000000..78f2df037
--- /dev/null
+++ b/src/specify_cli/integrations/bob/__init__.py
@@ -0,0 +1,21 @@
+"""IBM Bob integration."""
+
+from ..base import MarkdownIntegration
+
+
+class BobIntegration(MarkdownIntegration):
+ key = "bob"
+ config = {
+ "name": "IBM Bob",
+ "folder": ".bob/",
+ "commands_subdir": "commands",
+ "install_url": None,
+ "requires_cli": False,
+ }
+ registrar_config = {
+ "dir": ".bob/commands",
+ "format": "markdown",
+ "args": "$ARGUMENTS",
+ "extension": ".md",
+ }
+ context_file = "AGENTS.md"
diff --git a/src/specify_cli/integrations/bob/scripts/update-context.ps1 b/src/specify_cli/integrations/bob/scripts/update-context.ps1
new file mode 100644
index 000000000..188860899
--- /dev/null
+++ b/src/specify_cli/integrations/bob/scripts/update-context.ps1
@@ -0,0 +1,23 @@
+# update-context.ps1 β IBM Bob integration: create/update AGENTS.md
+#
+# Thin wrapper that delegates to the shared update-agent-context script.
+# Activated in Stage 7 when the shared script uses integration.json dispatch.
+#
+# Until then, this delegates to the shared script as a subprocess.
+
+$ErrorActionPreference = 'Stop'
+
+# Derive repo root from script location (walks up to find .specify/)
+$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Definition
+$repoRoot = try { git rev-parse --show-toplevel 2>$null } catch { $null }
+# If git did not return a repo root, or the git root does not contain .specify,
+# fall back to walking up from the script directory to find the initialized project root.
+if (-not $repoRoot -or -not (Test-Path (Join-Path $repoRoot '.specify'))) {
+ $repoRoot = $scriptDir
+ $fsRoot = [System.IO.Path]::GetPathRoot($repoRoot)
+ while ($repoRoot -and $repoRoot -ne $fsRoot -and -not (Test-Path (Join-Path $repoRoot '.specify'))) {
+ $repoRoot = Split-Path -Parent $repoRoot
+ }
+}
+
+& "$repoRoot/.specify/scripts/powershell/update-agent-context.ps1" -AgentType bob
diff --git a/src/specify_cli/integrations/bob/scripts/update-context.sh b/src/specify_cli/integrations/bob/scripts/update-context.sh
new file mode 100755
index 000000000..0228603fe
--- /dev/null
+++ b/src/specify_cli/integrations/bob/scripts/update-context.sh
@@ -0,0 +1,28 @@
+#!/usr/bin/env bash
+# update-context.sh β IBM Bob integration: create/update AGENTS.md
+#
+# Thin wrapper that delegates to the shared update-agent-context script.
+# Activated in Stage 7 when the shared script uses integration.json dispatch.
+#
+# Until then, this delegates to the shared script as a subprocess.
+
+set -euo pipefail
+
+# Derive repo root from script location (walks up to find .specify/)
+_script_dir="$(cd "$(dirname "$0")" && pwd)"
+_root="$_script_dir"
+while [ "$_root" != "/" ] && [ ! -d "$_root/.specify" ]; do _root="$(dirname "$_root")"; done
+if [ -z "${REPO_ROOT:-}" ]; then
+ if [ -d "$_root/.specify" ]; then
+ REPO_ROOT="$_root"
+ else
+ git_root="$(git rev-parse --show-toplevel 2>/dev/null || true)"
+ if [ -n "$git_root" ] && [ -d "$git_root/.specify" ]; then
+ REPO_ROOT="$git_root"
+ else
+ REPO_ROOT="$_root"
+ fi
+ fi
+fi
+
+exec "$REPO_ROOT/.specify/scripts/bash/update-agent-context.sh" bob
diff --git a/src/specify_cli/integrations/claude/__init__.py b/src/specify_cli/integrations/claude/__init__.py
new file mode 100644
index 000000000..00375ead5
--- /dev/null
+++ b/src/specify_cli/integrations/claude/__init__.py
@@ -0,0 +1,21 @@
+"""Claude Code integration."""
+
+from ..base import MarkdownIntegration
+
+
+class ClaudeIntegration(MarkdownIntegration):
+ key = "claude"
+ config = {
+ "name": "Claude Code",
+ "folder": ".claude/",
+ "commands_subdir": "commands",
+ "install_url": "https://docs.anthropic.com/en/docs/claude-code/setup",
+ "requires_cli": True,
+ }
+ registrar_config = {
+ "dir": ".claude/commands",
+ "format": "markdown",
+ "args": "$ARGUMENTS",
+ "extension": ".md",
+ }
+ context_file = "CLAUDE.md"
diff --git a/src/specify_cli/integrations/claude/scripts/update-context.ps1 b/src/specify_cli/integrations/claude/scripts/update-context.ps1
new file mode 100644
index 000000000..837974d47
--- /dev/null
+++ b/src/specify_cli/integrations/claude/scripts/update-context.ps1
@@ -0,0 +1,23 @@
+# update-context.ps1 β Claude Code integration: create/update CLAUDE.md
+#
+# Thin wrapper that delegates to the shared update-agent-context script.
+# Activated in Stage 7 when the shared script uses integration.json dispatch.
+#
+# Until then, this delegates to the shared script as a subprocess.
+
+$ErrorActionPreference = 'Stop'
+
+# Derive repo root from script location (walks up to find .specify/)
+$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Definition
+$repoRoot = try { git rev-parse --show-toplevel 2>$null } catch { $null }
+# If git did not return a repo root, or the git root does not contain .specify,
+# fall back to walking up from the script directory to find the initialized project root.
+if (-not $repoRoot -or -not (Test-Path (Join-Path $repoRoot '.specify'))) {
+ $repoRoot = $scriptDir
+ $fsRoot = [System.IO.Path]::GetPathRoot($repoRoot)
+ while ($repoRoot -and $repoRoot -ne $fsRoot -and -not (Test-Path (Join-Path $repoRoot '.specify'))) {
+ $repoRoot = Split-Path -Parent $repoRoot
+ }
+}
+
+& "$repoRoot/.specify/scripts/powershell/update-agent-context.ps1" -AgentType claude
diff --git a/src/specify_cli/integrations/claude/scripts/update-context.sh b/src/specify_cli/integrations/claude/scripts/update-context.sh
new file mode 100755
index 000000000..4b83855a2
--- /dev/null
+++ b/src/specify_cli/integrations/claude/scripts/update-context.sh
@@ -0,0 +1,28 @@
+#!/usr/bin/env bash
+# update-context.sh β Claude Code integration: create/update CLAUDE.md
+#
+# Thin wrapper that delegates to the shared update-agent-context script.
+# Activated in Stage 7 when the shared script uses integration.json dispatch.
+#
+# Until then, this delegates to the shared script as a subprocess.
+
+set -euo pipefail
+
+# Derive repo root from script location (walks up to find .specify/)
+_script_dir="$(cd "$(dirname "$0")" && pwd)"
+_root="$_script_dir"
+while [ "$_root" != "/" ] && [ ! -d "$_root/.specify" ]; do _root="$(dirname "$_root")"; done
+if [ -z "${REPO_ROOT:-}" ]; then
+ if [ -d "$_root/.specify" ]; then
+ REPO_ROOT="$_root"
+ else
+ git_root="$(git rev-parse --show-toplevel 2>/dev/null || true)"
+ if [ -n "$git_root" ] && [ -d "$git_root/.specify" ]; then
+ REPO_ROOT="$git_root"
+ else
+ REPO_ROOT="$_root"
+ fi
+ fi
+fi
+
+exec "$REPO_ROOT/.specify/scripts/bash/update-agent-context.sh" claude
diff --git a/src/specify_cli/integrations/codebuddy/__init__.py b/src/specify_cli/integrations/codebuddy/__init__.py
new file mode 100644
index 000000000..061ac7641
--- /dev/null
+++ b/src/specify_cli/integrations/codebuddy/__init__.py
@@ -0,0 +1,21 @@
+"""CodeBuddy CLI integration."""
+
+from ..base import MarkdownIntegration
+
+
+class CodebuddyIntegration(MarkdownIntegration):
+ key = "codebuddy"
+ config = {
+ "name": "CodeBuddy",
+ "folder": ".codebuddy/",
+ "commands_subdir": "commands",
+ "install_url": "https://www.codebuddy.ai/cli",
+ "requires_cli": True,
+ }
+ registrar_config = {
+ "dir": ".codebuddy/commands",
+ "format": "markdown",
+ "args": "$ARGUMENTS",
+ "extension": ".md",
+ }
+ context_file = "CODEBUDDY.md"
diff --git a/src/specify_cli/integrations/codebuddy/scripts/update-context.ps1 b/src/specify_cli/integrations/codebuddy/scripts/update-context.ps1
new file mode 100644
index 000000000..0269392c0
--- /dev/null
+++ b/src/specify_cli/integrations/codebuddy/scripts/update-context.ps1
@@ -0,0 +1,23 @@
+# update-context.ps1 β CodeBuddy integration: create/update CODEBUDDY.md
+#
+# Thin wrapper that delegates to the shared update-agent-context script.
+# Activated in Stage 7 when the shared script uses integration.json dispatch.
+#
+# Until then, this delegates to the shared script as a subprocess.
+
+$ErrorActionPreference = 'Stop'
+
+# Derive repo root from script location (walks up to find .specify/)
+$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Definition
+$repoRoot = try { git rev-parse --show-toplevel 2>$null } catch { $null }
+# If git did not return a repo root, or the git root does not contain .specify,
+# fall back to walking up from the script directory to find the initialized project root.
+if (-not $repoRoot -or -not (Test-Path (Join-Path $repoRoot '.specify'))) {
+ $repoRoot = $scriptDir
+ $fsRoot = [System.IO.Path]::GetPathRoot($repoRoot)
+ while ($repoRoot -and $repoRoot -ne $fsRoot -and -not (Test-Path (Join-Path $repoRoot '.specify'))) {
+ $repoRoot = Split-Path -Parent $repoRoot
+ }
+}
+
+& "$repoRoot/.specify/scripts/powershell/update-agent-context.ps1" -AgentType codebuddy
diff --git a/src/specify_cli/integrations/codebuddy/scripts/update-context.sh b/src/specify_cli/integrations/codebuddy/scripts/update-context.sh
new file mode 100755
index 000000000..d57ddc356
--- /dev/null
+++ b/src/specify_cli/integrations/codebuddy/scripts/update-context.sh
@@ -0,0 +1,28 @@
+#!/usr/bin/env bash
+# update-context.sh β CodeBuddy integration: create/update CODEBUDDY.md
+#
+# Thin wrapper that delegates to the shared update-agent-context script.
+# Activated in Stage 7 when the shared script uses integration.json dispatch.
+#
+# Until then, this delegates to the shared script as a subprocess.
+
+set -euo pipefail
+
+# Derive repo root from script location (walks up to find .specify/)
+_script_dir="$(cd "$(dirname "$0")" && pwd)"
+_root="$_script_dir"
+while [ "$_root" != "/" ] && [ ! -d "$_root/.specify" ]; do _root="$(dirname "$_root")"; done
+if [ -z "${REPO_ROOT:-}" ]; then
+ if [ -d "$_root/.specify" ]; then
+ REPO_ROOT="$_root"
+ else
+ git_root="$(git rev-parse --show-toplevel 2>/dev/null || true)"
+ if [ -n "$git_root" ] && [ -d "$git_root/.specify" ]; then
+ REPO_ROOT="$git_root"
+ else
+ REPO_ROOT="$_root"
+ fi
+ fi
+fi
+
+exec "$REPO_ROOT/.specify/scripts/bash/update-agent-context.sh" codebuddy
diff --git a/src/specify_cli/integrations/copilot/__init__.py b/src/specify_cli/integrations/copilot/__init__.py
new file mode 100644
index 000000000..036f2e1db
--- /dev/null
+++ b/src/specify_cli/integrations/copilot/__init__.py
@@ -0,0 +1,185 @@
+"""Copilot integration β GitHub Copilot in VS Code.
+
+Copilot has several unique behaviors compared to standard markdown agents:
+- Commands use ``.agent.md`` extension (not ``.md``)
+- Each command gets a companion ``.prompt.md`` file in ``.github/prompts/``
+- Installs ``.vscode/settings.json`` with prompt file recommendations
+- Context file lives at ``.github/copilot-instructions.md``
+"""
+
+from __future__ import annotations
+
+import json
+import shutil
+from pathlib import Path
+from typing import Any
+
+from ..base import IntegrationBase
+from ..manifest import IntegrationManifest
+
+
+class CopilotIntegration(IntegrationBase):
+ """Integration for GitHub Copilot in VS Code."""
+
+ key = "copilot"
+ config = {
+ "name": "GitHub Copilot",
+ "folder": ".github/",
+ "commands_subdir": "agents",
+ "install_url": None,
+ "requires_cli": False,
+ }
+ registrar_config = {
+ "dir": ".github/agents",
+ "format": "markdown",
+ "args": "$ARGUMENTS",
+ "extension": ".agent.md",
+ }
+ context_file = ".github/copilot-instructions.md"
+
+ def command_filename(self, template_name: str) -> str:
+ """Copilot commands use ``.agent.md`` extension."""
+ return f"speckit.{template_name}.agent.md"
+
+ def setup(
+ self,
+ project_root: Path,
+ manifest: IntegrationManifest,
+ parsed_options: dict[str, Any] | None = None,
+ **opts: Any,
+ ) -> list[Path]:
+ """Install copilot commands, companion prompts, and VS Code settings.
+
+ Uses base class primitives to: read templates, process them
+ (replace placeholders, strip script blocks, rewrite paths),
+ write as ``.agent.md``, then add companion prompts and VS Code settings.
+ """
+ project_root_resolved = project_root.resolve()
+ if manifest.project_root != project_root_resolved:
+ raise ValueError(
+ f"manifest.project_root ({manifest.project_root}) does not match "
+ f"project_root ({project_root_resolved})"
+ )
+
+ templates = self.list_command_templates()
+ if not templates:
+ return []
+
+ dest = self.commands_dest(project_root)
+ dest_resolved = dest.resolve()
+ try:
+ dest_resolved.relative_to(project_root_resolved)
+ except ValueError as exc:
+ raise ValueError(
+ f"Integration destination {dest_resolved} escapes "
+ f"project root {project_root_resolved}"
+ ) from exc
+ dest.mkdir(parents=True, exist_ok=True)
+ created: list[Path] = []
+
+ script_type = opts.get("script_type", "sh")
+ arg_placeholder = self.registrar_config.get("args", "$ARGUMENTS")
+
+ # 1. Process and write command files as .agent.md
+ for src_file in templates:
+ raw = src_file.read_text(encoding="utf-8")
+ processed = self.process_template(raw, self.key, script_type, arg_placeholder)
+ dst_name = self.command_filename(src_file.stem)
+ dst_file = self.write_file_and_record(
+ processed, dest / dst_name, project_root, manifest
+ )
+ created.append(dst_file)
+
+ # 2. Generate companion .prompt.md files from the templates we just wrote
+ prompts_dir = project_root / ".github" / "prompts"
+ for src_file in templates:
+ cmd_name = f"speckit.{src_file.stem}"
+ prompt_content = f"---\nagent: {cmd_name}\n---\n"
+ prompt_file = self.write_file_and_record(
+ prompt_content,
+ prompts_dir / f"{cmd_name}.prompt.md",
+ project_root,
+ manifest,
+ )
+ created.append(prompt_file)
+
+ # Write .vscode/settings.json
+ settings_src = self._vscode_settings_path()
+ if settings_src and settings_src.is_file():
+ dst_settings = project_root / ".vscode" / "settings.json"
+ dst_settings.parent.mkdir(parents=True, exist_ok=True)
+ if dst_settings.exists():
+ # Merge into existing β don't track since we can't safely
+ # remove the user's settings file on uninstall.
+ self._merge_vscode_settings(settings_src, dst_settings)
+ else:
+ shutil.copy2(settings_src, dst_settings)
+ self.record_file_in_manifest(dst_settings, project_root, manifest)
+ created.append(dst_settings)
+
+ # 4. Install integration-specific update-context scripts
+ created.extend(self.install_scripts(project_root, manifest))
+
+ return created
+
+ def _vscode_settings_path(self) -> Path | None:
+ """Return path to the bundled vscode-settings.json template."""
+ tpl_dir = self.shared_templates_dir()
+ if tpl_dir:
+ candidate = tpl_dir / "vscode-settings.json"
+ if candidate.is_file():
+ return candidate
+ return None
+
+ @staticmethod
+ def _merge_vscode_settings(src: Path, dst: Path) -> None:
+ """Merge settings from *src* into existing *dst* JSON file.
+
+ Top-level keys from *src* are added only if missing in *dst*.
+ For dict-valued keys, sub-keys are merged the same way.
+
+ If *dst* cannot be parsed (e.g. JSONC with comments), the merge
+ is skipped to avoid overwriting user settings.
+ """
+ try:
+ existing = json.loads(dst.read_text(encoding="utf-8"))
+ except (json.JSONDecodeError, OSError):
+ # Cannot parse existing file (likely JSONC with comments).
+ # Skip merge to preserve the user's settings, but show
+ # what they should add manually.
+ import logging
+ template_content = src.read_text(encoding="utf-8")
+ logging.getLogger(__name__).warning(
+ "Could not parse %s (may contain JSONC comments). "
+ "Skipping settings merge to preserve existing file.\n"
+ "Please add the following settings manually:\n%s",
+ dst, template_content,
+ )
+ return
+
+ new_settings = json.loads(src.read_text(encoding="utf-8"))
+
+ if not isinstance(existing, dict) or not isinstance(new_settings, dict):
+ import logging
+ logging.getLogger(__name__).warning(
+ "Skipping settings merge: %s or template is not a JSON object.", dst
+ )
+ return
+
+ changed = False
+ for key, value in new_settings.items():
+ if key not in existing:
+ existing[key] = value
+ changed = True
+ elif isinstance(existing[key], dict) and isinstance(value, dict):
+ for sub_key, sub_value in value.items():
+ if sub_key not in existing[key]:
+ existing[key][sub_key] = sub_value
+ changed = True
+
+ if not changed:
+ return
+
+ dst.write_text(
+ json.dumps(existing, indent=4) + "\n", encoding="utf-8"
+ )
diff --git a/src/specify_cli/integrations/copilot/scripts/update-context.ps1 b/src/specify_cli/integrations/copilot/scripts/update-context.ps1
new file mode 100644
index 000000000..26e746a78
--- /dev/null
+++ b/src/specify_cli/integrations/copilot/scripts/update-context.ps1
@@ -0,0 +1,32 @@
+# update-context.ps1 β Copilot integration: create/update .github/copilot-instructions.md
+#
+# This is the copilot-specific implementation that produces the GitHub
+# Copilot instructions file. The shared dispatcher reads
+# .specify/integration.json and calls this script.
+#
+# NOTE: This script is not yet active. It will be activated in Stage 7
+# when the shared update-agent-context.ps1 replaces its switch statement
+# with integration.json-based dispatch. The shared script must also be
+# refactored to support SPECKIT_SOURCE_ONLY (guard the Main call) before
+# dot-sourcing will work.
+#
+# Until then, this delegates to the shared script as a subprocess.
+
+$ErrorActionPreference = 'Stop'
+
+# Derive repo root from script location (walks up to find .specify/)
+$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Definition
+$repoRoot = try { git rev-parse --show-toplevel 2>$null } catch { $null }
+# If git did not return a repo root, or the git root does not contain .specify,
+# fall back to walking up from the script directory to find the initialized project root.
+if (-not $repoRoot -or -not (Test-Path (Join-Path $repoRoot '.specify'))) {
+ $repoRoot = $scriptDir
+ $fsRoot = [System.IO.Path]::GetPathRoot($repoRoot)
+ while ($repoRoot -and $repoRoot -ne $fsRoot -and -not (Test-Path (Join-Path $repoRoot '.specify'))) {
+ $repoRoot = Split-Path -Parent $repoRoot
+ }
+}
+
+# Invoke shared update-agent-context script as a separate process.
+# Dot-sourcing is unsafe until that script guards its Main call.
+& "$repoRoot/.specify/scripts/powershell/update-agent-context.ps1" -AgentType copilot
diff --git a/src/specify_cli/integrations/copilot/scripts/update-context.sh b/src/specify_cli/integrations/copilot/scripts/update-context.sh
new file mode 100644
index 000000000..c7f3bc60b
--- /dev/null
+++ b/src/specify_cli/integrations/copilot/scripts/update-context.sh
@@ -0,0 +1,37 @@
+#!/usr/bin/env bash
+# update-context.sh β Copilot integration: create/update .github/copilot-instructions.md
+#
+# This is the copilot-specific implementation that produces the GitHub
+# Copilot instructions file. The shared dispatcher reads
+# .specify/integration.json and calls this script.
+#
+# NOTE: This script is not yet active. It will be activated in Stage 7
+# when the shared update-agent-context.sh replaces its case statement
+# with integration.json-based dispatch. The shared script must also be
+# refactored to support SPECKIT_SOURCE_ONLY (guard the main logic)
+# before sourcing will work.
+#
+# Until then, this delegates to the shared script as a subprocess.
+
+set -euo pipefail
+
+# Derive repo root from script location (walks up to find .specify/)
+_script_dir="$(cd "$(dirname "$0")" && pwd)"
+_root="$_script_dir"
+while [ "$_root" != "/" ] && [ ! -d "$_root/.specify" ]; do _root="$(dirname "$_root")"; done
+if [ -z "${REPO_ROOT:-}" ]; then
+ if [ -d "$_root/.specify" ]; then
+ REPO_ROOT="$_root"
+ else
+ git_root="$(git rev-parse --show-toplevel 2>/dev/null || true)"
+ if [ -n "$git_root" ] && [ -d "$git_root/.specify" ]; then
+ REPO_ROOT="$git_root"
+ else
+ REPO_ROOT="$_root"
+ fi
+ fi
+fi
+
+# Invoke shared update-agent-context script as a separate process.
+# Sourcing is unsafe until that script guards its main logic.
+exec "$REPO_ROOT/.specify/scripts/bash/update-agent-context.sh" copilot
diff --git a/src/specify_cli/integrations/cursor_agent/__init__.py b/src/specify_cli/integrations/cursor_agent/__init__.py
new file mode 100644
index 000000000..c244a7c01
--- /dev/null
+++ b/src/specify_cli/integrations/cursor_agent/__init__.py
@@ -0,0 +1,21 @@
+"""Cursor IDE integration."""
+
+from ..base import MarkdownIntegration
+
+
+class CursorAgentIntegration(MarkdownIntegration):
+ key = "cursor-agent"
+ config = {
+ "name": "Cursor",
+ "folder": ".cursor/",
+ "commands_subdir": "commands",
+ "install_url": None,
+ "requires_cli": False,
+ }
+ registrar_config = {
+ "dir": ".cursor/commands",
+ "format": "markdown",
+ "args": "$ARGUMENTS",
+ "extension": ".md",
+ }
+ context_file = ".cursor/rules/specify-rules.mdc"
diff --git a/src/specify_cli/integrations/cursor_agent/scripts/update-context.ps1 b/src/specify_cli/integrations/cursor_agent/scripts/update-context.ps1
new file mode 100644
index 000000000..4ce50a487
--- /dev/null
+++ b/src/specify_cli/integrations/cursor_agent/scripts/update-context.ps1
@@ -0,0 +1,23 @@
+# update-context.ps1 β Cursor integration: create/update .cursor/rules/specify-rules.mdc
+#
+# Thin wrapper that delegates to the shared update-agent-context script.
+# Activated in Stage 7 when the shared script uses integration.json dispatch.
+#
+# Until then, this delegates to the shared script as a subprocess.
+
+$ErrorActionPreference = 'Stop'
+
+# Derive repo root from script location (walks up to find .specify/)
+$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Definition
+$repoRoot = try { git rev-parse --show-toplevel 2>$null } catch { $null }
+# If git did not return a repo root, or the git root does not contain .specify,
+# fall back to walking up from the script directory to find the initialized project root.
+if (-not $repoRoot -or -not (Test-Path (Join-Path $repoRoot '.specify'))) {
+ $repoRoot = $scriptDir
+ $fsRoot = [System.IO.Path]::GetPathRoot($repoRoot)
+ while ($repoRoot -and $repoRoot -ne $fsRoot -and -not (Test-Path (Join-Path $repoRoot '.specify'))) {
+ $repoRoot = Split-Path -Parent $repoRoot
+ }
+}
+
+& "$repoRoot/.specify/scripts/powershell/update-agent-context.ps1" -AgentType cursor-agent
diff --git a/src/specify_cli/integrations/cursor_agent/scripts/update-context.sh b/src/specify_cli/integrations/cursor_agent/scripts/update-context.sh
new file mode 100755
index 000000000..597ca2289
--- /dev/null
+++ b/src/specify_cli/integrations/cursor_agent/scripts/update-context.sh
@@ -0,0 +1,28 @@
+#!/usr/bin/env bash
+# update-context.sh β Cursor integration: create/update .cursor/rules/specify-rules.mdc
+#
+# Thin wrapper that delegates to the shared update-agent-context script.
+# Activated in Stage 7 when the shared script uses integration.json dispatch.
+#
+# Until then, this delegates to the shared script as a subprocess.
+
+set -euo pipefail
+
+# Derive repo root from script location (walks up to find .specify/)
+_script_dir="$(cd "$(dirname "$0")" && pwd)"
+_root="$_script_dir"
+while [ "$_root" != "/" ] && [ ! -d "$_root/.specify" ]; do _root="$(dirname "$_root")"; done
+if [ -z "${REPO_ROOT:-}" ]; then
+ if [ -d "$_root/.specify" ]; then
+ REPO_ROOT="$_root"
+ else
+ git_root="$(git rev-parse --show-toplevel 2>/dev/null || true)"
+ if [ -n "$git_root" ] && [ -d "$git_root/.specify" ]; then
+ REPO_ROOT="$git_root"
+ else
+ REPO_ROOT="$_root"
+ fi
+ fi
+fi
+
+exec "$REPO_ROOT/.specify/scripts/bash/update-agent-context.sh" cursor-agent
diff --git a/src/specify_cli/integrations/iflow/__init__.py b/src/specify_cli/integrations/iflow/__init__.py
new file mode 100644
index 000000000..4acc2cf37
--- /dev/null
+++ b/src/specify_cli/integrations/iflow/__init__.py
@@ -0,0 +1,21 @@
+"""iFlow CLI integration."""
+
+from ..base import MarkdownIntegration
+
+
+class IflowIntegration(MarkdownIntegration):
+ key = "iflow"
+ config = {
+ "name": "iFlow CLI",
+ "folder": ".iflow/",
+ "commands_subdir": "commands",
+ "install_url": "https://docs.iflow.cn/en/cli/quickstart",
+ "requires_cli": True,
+ }
+ registrar_config = {
+ "dir": ".iflow/commands",
+ "format": "markdown",
+ "args": "$ARGUMENTS",
+ "extension": ".md",
+ }
+ context_file = "IFLOW.md"
diff --git a/src/specify_cli/integrations/iflow/scripts/update-context.ps1 b/src/specify_cli/integrations/iflow/scripts/update-context.ps1
new file mode 100644
index 000000000..b502d4182
--- /dev/null
+++ b/src/specify_cli/integrations/iflow/scripts/update-context.ps1
@@ -0,0 +1,23 @@
+# update-context.ps1 β iFlow CLI integration: create/update IFLOW.md
+#
+# Thin wrapper that delegates to the shared update-agent-context script.
+# Activated in Stage 7 when the shared script uses integration.json dispatch.
+#
+# Until then, this delegates to the shared script as a subprocess.
+
+$ErrorActionPreference = 'Stop'
+
+# Derive repo root from script location (walks up to find .specify/)
+$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Definition
+$repoRoot = try { git rev-parse --show-toplevel 2>$null } catch { $null }
+# If git did not return a repo root, or the git root does not contain .specify,
+# fall back to walking up from the script directory to find the initialized project root.
+if (-not $repoRoot -or -not (Test-Path (Join-Path $repoRoot '.specify'))) {
+ $repoRoot = $scriptDir
+ $fsRoot = [System.IO.Path]::GetPathRoot($repoRoot)
+ while ($repoRoot -and $repoRoot -ne $fsRoot -and -not (Test-Path (Join-Path $repoRoot '.specify'))) {
+ $repoRoot = Split-Path -Parent $repoRoot
+ }
+}
+
+& "$repoRoot/.specify/scripts/powershell/update-agent-context.ps1" -AgentType iflow
diff --git a/src/specify_cli/integrations/iflow/scripts/update-context.sh b/src/specify_cli/integrations/iflow/scripts/update-context.sh
new file mode 100755
index 000000000..508040207
--- /dev/null
+++ b/src/specify_cli/integrations/iflow/scripts/update-context.sh
@@ -0,0 +1,28 @@
+#!/usr/bin/env bash
+# update-context.sh β iFlow CLI integration: create/update IFLOW.md
+#
+# Thin wrapper that delegates to the shared update-agent-context script.
+# Activated in Stage 7 when the shared script uses integration.json dispatch.
+#
+# Until then, this delegates to the shared script as a subprocess.
+
+set -euo pipefail
+
+# Derive repo root from script location (walks up to find .specify/)
+_script_dir="$(cd "$(dirname "$0")" && pwd)"
+_root="$_script_dir"
+while [ "$_root" != "/" ] && [ ! -d "$_root/.specify" ]; do _root="$(dirname "$_root")"; done
+if [ -z "${REPO_ROOT:-}" ]; then
+ if [ -d "$_root/.specify" ]; then
+ REPO_ROOT="$_root"
+ else
+ git_root="$(git rev-parse --show-toplevel 2>/dev/null || true)"
+ if [ -n "$git_root" ] && [ -d "$git_root/.specify" ]; then
+ REPO_ROOT="$git_root"
+ else
+ REPO_ROOT="$_root"
+ fi
+ fi
+fi
+
+exec "$REPO_ROOT/.specify/scripts/bash/update-agent-context.sh" iflow
diff --git a/src/specify_cli/integrations/junie/__init__.py b/src/specify_cli/integrations/junie/__init__.py
new file mode 100644
index 000000000..0cc3b3f0f
--- /dev/null
+++ b/src/specify_cli/integrations/junie/__init__.py
@@ -0,0 +1,21 @@
+"""Junie integration (JetBrains)."""
+
+from ..base import MarkdownIntegration
+
+
+class JunieIntegration(MarkdownIntegration):
+ key = "junie"
+ config = {
+ "name": "Junie",
+ "folder": ".junie/",
+ "commands_subdir": "commands",
+ "install_url": "https://junie.jetbrains.com/",
+ "requires_cli": True,
+ }
+ registrar_config = {
+ "dir": ".junie/commands",
+ "format": "markdown",
+ "args": "$ARGUMENTS",
+ "extension": ".md",
+ }
+ context_file = ".junie/AGENTS.md"
diff --git a/src/specify_cli/integrations/junie/scripts/update-context.ps1 b/src/specify_cli/integrations/junie/scripts/update-context.ps1
new file mode 100644
index 000000000..5a3243213
--- /dev/null
+++ b/src/specify_cli/integrations/junie/scripts/update-context.ps1
@@ -0,0 +1,23 @@
+# update-context.ps1 β Junie integration: create/update .junie/AGENTS.md
+#
+# Thin wrapper that delegates to the shared update-agent-context script.
+# Activated in Stage 7 when the shared script uses integration.json dispatch.
+#
+# Until then, this delegates to the shared script as a subprocess.
+
+$ErrorActionPreference = 'Stop'
+
+# Derive repo root from script location (walks up to find .specify/)
+$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Definition
+$repoRoot = try { git rev-parse --show-toplevel 2>$null } catch { $null }
+# If git did not return a repo root, or the git root does not contain .specify,
+# fall back to walking up from the script directory to find the initialized project root.
+if (-not $repoRoot -or -not (Test-Path (Join-Path $repoRoot '.specify'))) {
+ $repoRoot = $scriptDir
+ $fsRoot = [System.IO.Path]::GetPathRoot($repoRoot)
+ while ($repoRoot -and $repoRoot -ne $fsRoot -and -not (Test-Path (Join-Path $repoRoot '.specify'))) {
+ $repoRoot = Split-Path -Parent $repoRoot
+ }
+}
+
+& "$repoRoot/.specify/scripts/powershell/update-agent-context.ps1" -AgentType junie
diff --git a/src/specify_cli/integrations/junie/scripts/update-context.sh b/src/specify_cli/integrations/junie/scripts/update-context.sh
new file mode 100755
index 000000000..f4c8ba6c0
--- /dev/null
+++ b/src/specify_cli/integrations/junie/scripts/update-context.sh
@@ -0,0 +1,28 @@
+#!/usr/bin/env bash
+# update-context.sh β Junie integration: create/update .junie/AGENTS.md
+#
+# Thin wrapper that delegates to the shared update-agent-context script.
+# Activated in Stage 7 when the shared script uses integration.json dispatch.
+#
+# Until then, this delegates to the shared script as a subprocess.
+
+set -euo pipefail
+
+# Derive repo root from script location (walks up to find .specify/)
+_script_dir="$(cd "$(dirname "$0")" && pwd)"
+_root="$_script_dir"
+while [ "$_root" != "/" ] && [ ! -d "$_root/.specify" ]; do _root="$(dirname "$_root")"; done
+if [ -z "${REPO_ROOT:-}" ]; then
+ if [ -d "$_root/.specify" ]; then
+ REPO_ROOT="$_root"
+ else
+ git_root="$(git rev-parse --show-toplevel 2>/dev/null || true)"
+ if [ -n "$git_root" ] && [ -d "$git_root/.specify" ]; then
+ REPO_ROOT="$git_root"
+ else
+ REPO_ROOT="$_root"
+ fi
+ fi
+fi
+
+exec "$REPO_ROOT/.specify/scripts/bash/update-agent-context.sh" junie
diff --git a/src/specify_cli/integrations/kilocode/__init__.py b/src/specify_cli/integrations/kilocode/__init__.py
new file mode 100644
index 000000000..ffd38f741
--- /dev/null
+++ b/src/specify_cli/integrations/kilocode/__init__.py
@@ -0,0 +1,21 @@
+"""Kilo Code integration."""
+
+from ..base import MarkdownIntegration
+
+
+class KilocodeIntegration(MarkdownIntegration):
+ key = "kilocode"
+ config = {
+ "name": "Kilo Code",
+ "folder": ".kilocode/",
+ "commands_subdir": "workflows",
+ "install_url": None,
+ "requires_cli": False,
+ }
+ registrar_config = {
+ "dir": ".kilocode/workflows",
+ "format": "markdown",
+ "args": "$ARGUMENTS",
+ "extension": ".md",
+ }
+ context_file = ".kilocode/rules/specify-rules.md"
diff --git a/src/specify_cli/integrations/kilocode/scripts/update-context.ps1 b/src/specify_cli/integrations/kilocode/scripts/update-context.ps1
new file mode 100644
index 000000000..d87e7ef59
--- /dev/null
+++ b/src/specify_cli/integrations/kilocode/scripts/update-context.ps1
@@ -0,0 +1,23 @@
+# update-context.ps1 β Kilo Code integration: create/update .kilocode/rules/specify-rules.md
+#
+# Thin wrapper that delegates to the shared update-agent-context script.
+# Activated in Stage 7 when the shared script uses integration.json dispatch.
+#
+# Until then, this delegates to the shared script as a subprocess.
+
+$ErrorActionPreference = 'Stop'
+
+# Derive repo root from script location (walks up to find .specify/)
+$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Definition
+$repoRoot = try { git rev-parse --show-toplevel 2>$null } catch { $null }
+# If git did not return a repo root, or the git root does not contain .specify,
+# fall back to walking up from the script directory to find the initialized project root.
+if (-not $repoRoot -or -not (Test-Path (Join-Path $repoRoot '.specify'))) {
+ $repoRoot = $scriptDir
+ $fsRoot = [System.IO.Path]::GetPathRoot($repoRoot)
+ while ($repoRoot -and $repoRoot -ne $fsRoot -and -not (Test-Path (Join-Path $repoRoot '.specify'))) {
+ $repoRoot = Split-Path -Parent $repoRoot
+ }
+}
+
+& "$repoRoot/.specify/scripts/powershell/update-agent-context.ps1" -AgentType kilocode
diff --git a/src/specify_cli/integrations/kilocode/scripts/update-context.sh b/src/specify_cli/integrations/kilocode/scripts/update-context.sh
new file mode 100755
index 000000000..132c0403f
--- /dev/null
+++ b/src/specify_cli/integrations/kilocode/scripts/update-context.sh
@@ -0,0 +1,28 @@
+#!/usr/bin/env bash
+# update-context.sh β Kilo Code integration: create/update .kilocode/rules/specify-rules.md
+#
+# Thin wrapper that delegates to the shared update-agent-context script.
+# Activated in Stage 7 when the shared script uses integration.json dispatch.
+#
+# Until then, this delegates to the shared script as a subprocess.
+
+set -euo pipefail
+
+# Derive repo root from script location (walks up to find .specify/)
+_script_dir="$(cd "$(dirname "$0")" && pwd)"
+_root="$_script_dir"
+while [ "$_root" != "/" ] && [ ! -d "$_root/.specify" ]; do _root="$(dirname "$_root")"; done
+if [ -z "${REPO_ROOT:-}" ]; then
+ if [ -d "$_root/.specify" ]; then
+ REPO_ROOT="$_root"
+ else
+ git_root="$(git rev-parse --show-toplevel 2>/dev/null || true)"
+ if [ -n "$git_root" ] && [ -d "$git_root/.specify" ]; then
+ REPO_ROOT="$git_root"
+ else
+ REPO_ROOT="$_root"
+ fi
+ fi
+fi
+
+exec "$REPO_ROOT/.specify/scripts/bash/update-agent-context.sh" kilocode
diff --git a/src/specify_cli/integrations/kiro_cli/__init__.py b/src/specify_cli/integrations/kiro_cli/__init__.py
new file mode 100644
index 000000000..b316cb4bd
--- /dev/null
+++ b/src/specify_cli/integrations/kiro_cli/__init__.py
@@ -0,0 +1,21 @@
+"""Kiro CLI integration."""
+
+from ..base import MarkdownIntegration
+
+
+class KiroCliIntegration(MarkdownIntegration):
+ key = "kiro-cli"
+ config = {
+ "name": "Kiro CLI",
+ "folder": ".kiro/",
+ "commands_subdir": "prompts",
+ "install_url": "https://kiro.dev/docs/cli/",
+ "requires_cli": True,
+ }
+ registrar_config = {
+ "dir": ".kiro/prompts",
+ "format": "markdown",
+ "args": "$ARGUMENTS",
+ "extension": ".md",
+ }
+ context_file = "AGENTS.md"
diff --git a/src/specify_cli/integrations/kiro_cli/scripts/update-context.ps1 b/src/specify_cli/integrations/kiro_cli/scripts/update-context.ps1
new file mode 100644
index 000000000..7dd2b35fb
--- /dev/null
+++ b/src/specify_cli/integrations/kiro_cli/scripts/update-context.ps1
@@ -0,0 +1,23 @@
+# update-context.ps1 β Kiro CLI integration: create/update AGENTS.md
+#
+# Thin wrapper that delegates to the shared update-agent-context script.
+# Activated in Stage 7 when the shared script uses integration.json dispatch.
+#
+# Until then, this delegates to the shared script as a subprocess.
+
+$ErrorActionPreference = 'Stop'
+
+# Derive repo root from script location (walks up to find .specify/)
+$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Definition
+$repoRoot = try { git rev-parse --show-toplevel 2>$null } catch { $null }
+# If git did not return a repo root, or the git root does not contain .specify,
+# fall back to walking up from the script directory to find the initialized project root.
+if (-not $repoRoot -or -not (Test-Path (Join-Path $repoRoot '.specify'))) {
+ $repoRoot = $scriptDir
+ $fsRoot = [System.IO.Path]::GetPathRoot($repoRoot)
+ while ($repoRoot -and $repoRoot -ne $fsRoot -and -not (Test-Path (Join-Path $repoRoot '.specify'))) {
+ $repoRoot = Split-Path -Parent $repoRoot
+ }
+}
+
+& "$repoRoot/.specify/scripts/powershell/update-agent-context.ps1" -AgentType kiro-cli
diff --git a/src/specify_cli/integrations/kiro_cli/scripts/update-context.sh b/src/specify_cli/integrations/kiro_cli/scripts/update-context.sh
new file mode 100755
index 000000000..fa258edc7
--- /dev/null
+++ b/src/specify_cli/integrations/kiro_cli/scripts/update-context.sh
@@ -0,0 +1,28 @@
+#!/usr/bin/env bash
+# update-context.sh β Kiro CLI integration: create/update AGENTS.md
+#
+# Thin wrapper that delegates to the shared update-agent-context script.
+# Activated in Stage 7 when the shared script uses integration.json dispatch.
+#
+# Until then, this delegates to the shared script as a subprocess.
+
+set -euo pipefail
+
+# Derive repo root from script location (walks up to find .specify/)
+_script_dir="$(cd "$(dirname "$0")" && pwd)"
+_root="$_script_dir"
+while [ "$_root" != "/" ] && [ ! -d "$_root/.specify" ]; do _root="$(dirname "$_root")"; done
+if [ -z "${REPO_ROOT:-}" ]; then
+ if [ -d "$_root/.specify" ]; then
+ REPO_ROOT="$_root"
+ else
+ git_root="$(git rev-parse --show-toplevel 2>/dev/null || true)"
+ if [ -n "$git_root" ] && [ -d "$git_root/.specify" ]; then
+ REPO_ROOT="$git_root"
+ else
+ REPO_ROOT="$_root"
+ fi
+ fi
+fi
+
+exec "$REPO_ROOT/.specify/scripts/bash/update-agent-context.sh" kiro-cli
diff --git a/src/specify_cli/integrations/manifest.py b/src/specify_cli/integrations/manifest.py
new file mode 100644
index 000000000..50ac08ea3
--- /dev/null
+++ b/src/specify_cli/integrations/manifest.py
@@ -0,0 +1,265 @@
+"""Hash-tracked installation manifest for integrations.
+
+Each installed integration records the files it created together with
+their SHA-256 hashes. On uninstall only files whose hash still matches
+the recorded value are removed β modified files are left in place and
+reported to the caller.
+"""
+
+from __future__ import annotations
+
+import hashlib
+import json
+import os
+from datetime import datetime, timezone
+from pathlib import Path
+from typing import Any
+
+
+def _sha256(path: Path) -> str:
+ """Return the hex SHA-256 digest of *path*."""
+ h = hashlib.sha256()
+ with open(path, "rb") as fh:
+ for chunk in iter(lambda: fh.read(8192), b""):
+ h.update(chunk)
+ return h.hexdigest()
+
+
+def _validate_rel_path(rel: Path, root: Path) -> Path:
+ """Resolve *rel* against *root* and verify it stays within *root*.
+
+ Raises ``ValueError`` if *rel* is absolute, contains ``..`` segments
+ that escape *root*, or otherwise resolves outside the project root.
+ """
+ if rel.is_absolute():
+ raise ValueError(
+ f"Absolute paths are not allowed in manifests: {rel}"
+ )
+ resolved = (root / rel).resolve()
+ root_resolved = root.resolve()
+ try:
+ resolved.relative_to(root_resolved)
+ except ValueError:
+ raise ValueError(
+ f"Path {rel} resolves to {resolved} which is outside "
+ f"the project root {root_resolved}"
+ ) from None
+ return resolved
+
+
+class IntegrationManifest:
+ """Tracks files installed by a single integration.
+
+ Parameters:
+ key: Integration identifier (e.g. ``"copilot"``).
+ project_root: Absolute path to the project directory.
+ version: CLI version string recorded in the manifest.
+ """
+
+ def __init__(self, key: str, project_root: Path, version: str = "") -> None:
+ self.key = key
+ self.project_root = project_root.resolve()
+ self.version = version
+ self._files: dict[str, str] = {} # rel_path β sha256 hex
+ self._installed_at: str = ""
+
+ # -- Manifest file location -------------------------------------------
+
+ @property
+ def manifest_path(self) -> Path:
+ """Path to the on-disk manifest JSON."""
+ return self.project_root / ".specify" / "integrations" / f"{self.key}.manifest.json"
+
+ # -- Recording files --------------------------------------------------
+
+ def record_file(self, rel_path: str | Path, content: bytes | str) -> Path:
+ """Write *content* to *rel_path* (relative to project root) and record its hash.
+
+ Creates parent directories as needed. Returns the absolute path
+ of the written file.
+
+ Raises ``ValueError`` if *rel_path* resolves outside the project root.
+ """
+ rel = Path(rel_path)
+ abs_path = _validate_rel_path(rel, self.project_root)
+ abs_path.parent.mkdir(parents=True, exist_ok=True)
+
+ if isinstance(content, str):
+ content = content.encode("utf-8")
+ abs_path.write_bytes(content)
+
+ normalized = abs_path.relative_to(self.project_root).as_posix()
+ self._files[normalized] = hashlib.sha256(content).hexdigest()
+ return abs_path
+
+ def record_existing(self, rel_path: str | Path) -> None:
+ """Record the hash of an already-existing file at *rel_path*.
+
+ Raises ``ValueError`` if *rel_path* resolves outside the project root.
+ """
+ rel = Path(rel_path)
+ abs_path = _validate_rel_path(rel, self.project_root)
+ normalized = abs_path.relative_to(self.project_root).as_posix()
+ self._files[normalized] = _sha256(abs_path)
+
+ # -- Querying ---------------------------------------------------------
+
+ @property
+ def files(self) -> dict[str, str]:
+ """Return a copy of the ``{rel_path: sha256}`` mapping."""
+ return dict(self._files)
+
+ def check_modified(self) -> list[str]:
+ """Return relative paths of tracked files whose content changed on disk."""
+ modified: list[str] = []
+ for rel, expected_hash in self._files.items():
+ rel_path = Path(rel)
+ # Skip paths that are absolute or attempt to escape the project root
+ if rel_path.is_absolute() or ".." in rel_path.parts:
+ continue
+ abs_path = self.project_root / rel_path
+ if not abs_path.exists() and not abs_path.is_symlink():
+ continue
+ # Treat symlinks and non-regular-files as modified
+ if abs_path.is_symlink() or not abs_path.is_file():
+ modified.append(rel)
+ continue
+ if _sha256(abs_path) != expected_hash:
+ modified.append(rel)
+ return modified
+
+ # -- Uninstall --------------------------------------------------------
+
+ def uninstall(
+ self,
+ project_root: Path | None = None,
+ *,
+ force: bool = False,
+ ) -> tuple[list[Path], list[Path]]:
+ """Remove tracked files whose hash still matches.
+
+ Parameters:
+ project_root: Override for the project root.
+ force: If ``True``, remove files even if modified.
+
+ Returns:
+ ``(removed, skipped)`` β absolute paths.
+ """
+ root = (project_root or self.project_root).resolve()
+ removed: list[Path] = []
+ skipped: list[Path] = []
+
+ for rel, expected_hash in self._files.items():
+ # Use non-resolved path for deletion so symlinks themselves
+ # are removed, not their targets.
+ path = root / rel
+ # Validate containment lexically (without following symlinks)
+ # by collapsing .. segments via Path resolution on the string parts.
+ try:
+ normed = Path(os.path.normpath(path))
+ normed.relative_to(root)
+ except (ValueError, OSError):
+ continue
+ if not path.exists() and not path.is_symlink():
+ continue
+ # Skip directories β manifest only tracks files
+ if not path.is_file() and not path.is_symlink():
+ skipped.append(path)
+ continue
+ # Never follow symlinks when comparing hashes. Only remove
+ # symlinks when forced, to avoid acting on tampered entries.
+ if path.is_symlink():
+ if not force:
+ skipped.append(path)
+ continue
+ else:
+ if not force and _sha256(path) != expected_hash:
+ skipped.append(path)
+ continue
+ try:
+ path.unlink()
+ except OSError:
+ skipped.append(path)
+ continue
+ removed.append(path)
+ # Clean up empty parent directories up to project root
+ parent = path.parent
+ while parent != root:
+ try:
+ parent.rmdir() # only succeeds if empty
+ except OSError:
+ break
+ parent = parent.parent
+
+ # Remove the manifest file itself
+ manifest = root / ".specify" / "integrations" / f"{self.key}.manifest.json"
+ if manifest.exists():
+ manifest.unlink()
+ parent = manifest.parent
+ while parent != root:
+ try:
+ parent.rmdir()
+ except OSError:
+ break
+ parent = parent.parent
+
+ return removed, skipped
+
+ # -- Persistence ------------------------------------------------------
+
+ def save(self) -> Path:
+ """Write the manifest to disk. Returns the manifest path."""
+ self._installed_at = self._installed_at or datetime.now(timezone.utc).isoformat()
+ data: dict[str, Any] = {
+ "integration": self.key,
+ "version": self.version,
+ "installed_at": self._installed_at,
+ "files": self._files,
+ }
+ path = self.manifest_path
+ path.parent.mkdir(parents=True, exist_ok=True)
+ path.write_text(json.dumps(data, indent=2) + "\n", encoding="utf-8")
+ return path
+
+ @classmethod
+ def load(cls, key: str, project_root: Path) -> IntegrationManifest:
+ """Load an existing manifest from disk.
+
+ Raises ``FileNotFoundError`` if the manifest does not exist.
+ """
+ inst = cls(key, project_root)
+ path = inst.manifest_path
+ try:
+ data = json.loads(path.read_text(encoding="utf-8"))
+ except json.JSONDecodeError as exc:
+ raise ValueError(
+ f"Integration manifest at {path} contains invalid JSON"
+ ) from exc
+
+ if not isinstance(data, dict):
+ raise ValueError(
+ f"Integration manifest at {path} must be a JSON object, "
+ f"got {type(data).__name__}"
+ )
+
+ files = data.get("files", {})
+ if not isinstance(files, dict) or not all(
+ isinstance(k, str) and isinstance(v, str) for k, v in files.items()
+ ):
+ raise ValueError(
+ f"Integration manifest 'files' at {path} must be a "
+ "mapping of string paths to string hashes"
+ )
+
+ inst.version = data.get("version", "")
+ inst._installed_at = data.get("installed_at", "")
+ inst._files = files
+
+ stored_key = data.get("integration", "")
+ if stored_key and stored_key != key:
+ raise ValueError(
+ f"Manifest at {path} belongs to integration {stored_key!r}, "
+ f"not {key!r}"
+ )
+
+ return inst
diff --git a/src/specify_cli/integrations/opencode/__init__.py b/src/specify_cli/integrations/opencode/__init__.py
new file mode 100644
index 000000000..be4dcc309
--- /dev/null
+++ b/src/specify_cli/integrations/opencode/__init__.py
@@ -0,0 +1,21 @@
+"""opencode integration."""
+
+from ..base import MarkdownIntegration
+
+
+class OpencodeIntegration(MarkdownIntegration):
+ key = "opencode"
+ config = {
+ "name": "opencode",
+ "folder": ".opencode/",
+ "commands_subdir": "command",
+ "install_url": "https://opencode.ai",
+ "requires_cli": True,
+ }
+ registrar_config = {
+ "dir": ".opencode/command",
+ "format": "markdown",
+ "args": "$ARGUMENTS",
+ "extension": ".md",
+ }
+ context_file = "AGENTS.md"
diff --git a/src/specify_cli/integrations/opencode/scripts/update-context.ps1 b/src/specify_cli/integrations/opencode/scripts/update-context.ps1
new file mode 100644
index 000000000..4bba02b45
--- /dev/null
+++ b/src/specify_cli/integrations/opencode/scripts/update-context.ps1
@@ -0,0 +1,23 @@
+# update-context.ps1 β opencode integration: create/update AGENTS.md
+#
+# Thin wrapper that delegates to the shared update-agent-context script.
+# Activated in Stage 7 when the shared script uses integration.json dispatch.
+#
+# Until then, this delegates to the shared script as a subprocess.
+
+$ErrorActionPreference = 'Stop'
+
+# Derive repo root from script location (walks up to find .specify/)
+$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Definition
+$repoRoot = try { git rev-parse --show-toplevel 2>$null } catch { $null }
+# If git did not return a repo root, or the git root does not contain .specify,
+# fall back to walking up from the script directory to find the initialized project root.
+if (-not $repoRoot -or -not (Test-Path (Join-Path $repoRoot '.specify'))) {
+ $repoRoot = $scriptDir
+ $fsRoot = [System.IO.Path]::GetPathRoot($repoRoot)
+ while ($repoRoot -and $repoRoot -ne $fsRoot -and -not (Test-Path (Join-Path $repoRoot '.specify'))) {
+ $repoRoot = Split-Path -Parent $repoRoot
+ }
+}
+
+& "$repoRoot/.specify/scripts/powershell/update-agent-context.ps1" -AgentType opencode
diff --git a/src/specify_cli/integrations/opencode/scripts/update-context.sh b/src/specify_cli/integrations/opencode/scripts/update-context.sh
new file mode 100755
index 000000000..24c7e6025
--- /dev/null
+++ b/src/specify_cli/integrations/opencode/scripts/update-context.sh
@@ -0,0 +1,28 @@
+#!/usr/bin/env bash
+# update-context.sh β opencode integration: create/update AGENTS.md
+#
+# Thin wrapper that delegates to the shared update-agent-context script.
+# Activated in Stage 7 when the shared script uses integration.json dispatch.
+#
+# Until then, this delegates to the shared script as a subprocess.
+
+set -euo pipefail
+
+# Derive repo root from script location (walks up to find .specify/)
+_script_dir="$(cd "$(dirname "$0")" && pwd)"
+_root="$_script_dir"
+while [ "$_root" != "/" ] && [ ! -d "$_root/.specify" ]; do _root="$(dirname "$_root")"; done
+if [ -z "${REPO_ROOT:-}" ]; then
+ if [ -d "$_root/.specify" ]; then
+ REPO_ROOT="$_root"
+ else
+ git_root="$(git rev-parse --show-toplevel 2>/dev/null || true)"
+ if [ -n "$git_root" ] && [ -d "$git_root/.specify" ]; then
+ REPO_ROOT="$git_root"
+ else
+ REPO_ROOT="$_root"
+ fi
+ fi
+fi
+
+exec "$REPO_ROOT/.specify/scripts/bash/update-agent-context.sh" opencode
diff --git a/src/specify_cli/integrations/pi/__init__.py b/src/specify_cli/integrations/pi/__init__.py
new file mode 100644
index 000000000..8a25f326b
--- /dev/null
+++ b/src/specify_cli/integrations/pi/__init__.py
@@ -0,0 +1,21 @@
+"""Pi Coding Agent integration."""
+
+from ..base import MarkdownIntegration
+
+
+class PiIntegration(MarkdownIntegration):
+ key = "pi"
+ config = {
+ "name": "Pi Coding Agent",
+ "folder": ".pi/",
+ "commands_subdir": "prompts",
+ "install_url": "https://www.npmjs.com/package/@mariozechner/pi-coding-agent",
+ "requires_cli": True,
+ }
+ registrar_config = {
+ "dir": ".pi/prompts",
+ "format": "markdown",
+ "args": "$ARGUMENTS",
+ "extension": ".md",
+ }
+ context_file = "AGENTS.md"
diff --git a/src/specify_cli/integrations/pi/scripts/update-context.ps1 b/src/specify_cli/integrations/pi/scripts/update-context.ps1
new file mode 100644
index 000000000..6362118a5
--- /dev/null
+++ b/src/specify_cli/integrations/pi/scripts/update-context.ps1
@@ -0,0 +1,23 @@
+# update-context.ps1 β Pi Coding Agent integration: create/update AGENTS.md
+#
+# Thin wrapper that delegates to the shared update-agent-context script.
+# Activated in Stage 7 when the shared script uses integration.json dispatch.
+#
+# Until then, this delegates to the shared script as a subprocess.
+
+$ErrorActionPreference = 'Stop'
+
+# Derive repo root from script location (walks up to find .specify/)
+$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Definition
+$repoRoot = try { git rev-parse --show-toplevel 2>$null } catch { $null }
+# If git did not return a repo root, or the git root does not contain .specify,
+# fall back to walking up from the script directory to find the initialized project root.
+if (-not $repoRoot -or -not (Test-Path (Join-Path $repoRoot '.specify'))) {
+ $repoRoot = $scriptDir
+ $fsRoot = [System.IO.Path]::GetPathRoot($repoRoot)
+ while ($repoRoot -and $repoRoot -ne $fsRoot -and -not (Test-Path (Join-Path $repoRoot '.specify'))) {
+ $repoRoot = Split-Path -Parent $repoRoot
+ }
+}
+
+& "$repoRoot/.specify/scripts/powershell/update-agent-context.ps1" -AgentType pi
diff --git a/src/specify_cli/integrations/pi/scripts/update-context.sh b/src/specify_cli/integrations/pi/scripts/update-context.sh
new file mode 100755
index 000000000..1ad84c95a
--- /dev/null
+++ b/src/specify_cli/integrations/pi/scripts/update-context.sh
@@ -0,0 +1,28 @@
+#!/usr/bin/env bash
+# update-context.sh β Pi Coding Agent integration: create/update AGENTS.md
+#
+# Thin wrapper that delegates to the shared update-agent-context script.
+# Activated in Stage 7 when the shared script uses integration.json dispatch.
+#
+# Until then, this delegates to the shared script as a subprocess.
+
+set -euo pipefail
+
+# Derive repo root from script location (walks up to find .specify/)
+_script_dir="$(cd "$(dirname "$0")" && pwd)"
+_root="$_script_dir"
+while [ "$_root" != "/" ] && [ ! -d "$_root/.specify" ]; do _root="$(dirname "$_root")"; done
+if [ -z "${REPO_ROOT:-}" ]; then
+ if [ -d "$_root/.specify" ]; then
+ REPO_ROOT="$_root"
+ else
+ git_root="$(git rev-parse --show-toplevel 2>/dev/null || true)"
+ if [ -n "$git_root" ] && [ -d "$git_root/.specify" ]; then
+ REPO_ROOT="$git_root"
+ else
+ REPO_ROOT="$_root"
+ fi
+ fi
+fi
+
+exec "$REPO_ROOT/.specify/scripts/bash/update-agent-context.sh" pi
diff --git a/src/specify_cli/integrations/qodercli/__init__.py b/src/specify_cli/integrations/qodercli/__init__.py
new file mode 100644
index 000000000..541001be1
--- /dev/null
+++ b/src/specify_cli/integrations/qodercli/__init__.py
@@ -0,0 +1,21 @@
+"""Qoder CLI integration."""
+
+from ..base import MarkdownIntegration
+
+
+class QodercliIntegration(MarkdownIntegration):
+ key = "qodercli"
+ config = {
+ "name": "Qoder CLI",
+ "folder": ".qoder/",
+ "commands_subdir": "commands",
+ "install_url": "https://qoder.com/cli",
+ "requires_cli": True,
+ }
+ registrar_config = {
+ "dir": ".qoder/commands",
+ "format": "markdown",
+ "args": "$ARGUMENTS",
+ "extension": ".md",
+ }
+ context_file = "QODER.md"
diff --git a/src/specify_cli/integrations/qodercli/scripts/update-context.ps1 b/src/specify_cli/integrations/qodercli/scripts/update-context.ps1
new file mode 100644
index 000000000..1fa007a16
--- /dev/null
+++ b/src/specify_cli/integrations/qodercli/scripts/update-context.ps1
@@ -0,0 +1,23 @@
+# update-context.ps1 β Qoder CLI integration: create/update QODER.md
+#
+# Thin wrapper that delegates to the shared update-agent-context script.
+# Activated in Stage 7 when the shared script uses integration.json dispatch.
+#
+# Until then, this delegates to the shared script as a subprocess.
+
+$ErrorActionPreference = 'Stop'
+
+# Derive repo root from script location (walks up to find .specify/)
+$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Definition
+$repoRoot = try { git rev-parse --show-toplevel 2>$null } catch { $null }
+# If git did not return a repo root, or the git root does not contain .specify,
+# fall back to walking up from the script directory to find the initialized project root.
+if (-not $repoRoot -or -not (Test-Path (Join-Path $repoRoot '.specify'))) {
+ $repoRoot = $scriptDir
+ $fsRoot = [System.IO.Path]::GetPathRoot($repoRoot)
+ while ($repoRoot -and $repoRoot -ne $fsRoot -and -not (Test-Path (Join-Path $repoRoot '.specify'))) {
+ $repoRoot = Split-Path -Parent $repoRoot
+ }
+}
+
+& "$repoRoot/.specify/scripts/powershell/update-agent-context.ps1" -AgentType qodercli
diff --git a/src/specify_cli/integrations/qodercli/scripts/update-context.sh b/src/specify_cli/integrations/qodercli/scripts/update-context.sh
new file mode 100755
index 000000000..d371ad795
--- /dev/null
+++ b/src/specify_cli/integrations/qodercli/scripts/update-context.sh
@@ -0,0 +1,28 @@
+#!/usr/bin/env bash
+# update-context.sh β Qoder CLI integration: create/update QODER.md
+#
+# Thin wrapper that delegates to the shared update-agent-context script.
+# Activated in Stage 7 when the shared script uses integration.json dispatch.
+#
+# Until then, this delegates to the shared script as a subprocess.
+
+set -euo pipefail
+
+# Derive repo root from script location (walks up to find .specify/)
+_script_dir="$(cd "$(dirname "$0")" && pwd)"
+_root="$_script_dir"
+while [ "$_root" != "/" ] && [ ! -d "$_root/.specify" ]; do _root="$(dirname "$_root")"; done
+if [ -z "${REPO_ROOT:-}" ]; then
+ if [ -d "$_root/.specify" ]; then
+ REPO_ROOT="$_root"
+ else
+ git_root="$(git rev-parse --show-toplevel 2>/dev/null || true)"
+ if [ -n "$git_root" ] && [ -d "$git_root/.specify" ]; then
+ REPO_ROOT="$git_root"
+ else
+ REPO_ROOT="$_root"
+ fi
+ fi
+fi
+
+exec "$REPO_ROOT/.specify/scripts/bash/update-agent-context.sh" qodercli
diff --git a/src/specify_cli/integrations/qwen/__init__.py b/src/specify_cli/integrations/qwen/__init__.py
new file mode 100644
index 000000000..d9d930152
--- /dev/null
+++ b/src/specify_cli/integrations/qwen/__init__.py
@@ -0,0 +1,21 @@
+"""Qwen Code integration."""
+
+from ..base import MarkdownIntegration
+
+
+class QwenIntegration(MarkdownIntegration):
+ key = "qwen"
+ config = {
+ "name": "Qwen Code",
+ "folder": ".qwen/",
+ "commands_subdir": "commands",
+ "install_url": "https://github.com/QwenLM/qwen-code",
+ "requires_cli": True,
+ }
+ registrar_config = {
+ "dir": ".qwen/commands",
+ "format": "markdown",
+ "args": "$ARGUMENTS",
+ "extension": ".md",
+ }
+ context_file = "QWEN.md"
diff --git a/src/specify_cli/integrations/qwen/scripts/update-context.ps1 b/src/specify_cli/integrations/qwen/scripts/update-context.ps1
new file mode 100644
index 000000000..24e4c90fa
--- /dev/null
+++ b/src/specify_cli/integrations/qwen/scripts/update-context.ps1
@@ -0,0 +1,23 @@
+# update-context.ps1 β Qwen Code integration: create/update QWEN.md
+#
+# Thin wrapper that delegates to the shared update-agent-context script.
+# Activated in Stage 7 when the shared script uses integration.json dispatch.
+#
+# Until then, this delegates to the shared script as a subprocess.
+
+$ErrorActionPreference = 'Stop'
+
+# Derive repo root from script location (walks up to find .specify/)
+$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Definition
+$repoRoot = try { git rev-parse --show-toplevel 2>$null } catch { $null }
+# If git did not return a repo root, or the git root does not contain .specify,
+# fall back to walking up from the script directory to find the initialized project root.
+if (-not $repoRoot -or -not (Test-Path (Join-Path $repoRoot '.specify'))) {
+ $repoRoot = $scriptDir
+ $fsRoot = [System.IO.Path]::GetPathRoot($repoRoot)
+ while ($repoRoot -and $repoRoot -ne $fsRoot -and -not (Test-Path (Join-Path $repoRoot '.specify'))) {
+ $repoRoot = Split-Path -Parent $repoRoot
+ }
+}
+
+& "$repoRoot/.specify/scripts/powershell/update-agent-context.ps1" -AgentType qwen
diff --git a/src/specify_cli/integrations/qwen/scripts/update-context.sh b/src/specify_cli/integrations/qwen/scripts/update-context.sh
new file mode 100755
index 000000000..d1c62eb16
--- /dev/null
+++ b/src/specify_cli/integrations/qwen/scripts/update-context.sh
@@ -0,0 +1,28 @@
+#!/usr/bin/env bash
+# update-context.sh β Qwen Code integration: create/update QWEN.md
+#
+# Thin wrapper that delegates to the shared update-agent-context script.
+# Activated in Stage 7 when the shared script uses integration.json dispatch.
+#
+# Until then, this delegates to the shared script as a subprocess.
+
+set -euo pipefail
+
+# Derive repo root from script location (walks up to find .specify/)
+_script_dir="$(cd "$(dirname "$0")" && pwd)"
+_root="$_script_dir"
+while [ "$_root" != "/" ] && [ ! -d "$_root/.specify" ]; do _root="$(dirname "$_root")"; done
+if [ -z "${REPO_ROOT:-}" ]; then
+ if [ -d "$_root/.specify" ]; then
+ REPO_ROOT="$_root"
+ else
+ git_root="$(git rev-parse --show-toplevel 2>/dev/null || true)"
+ if [ -n "$git_root" ] && [ -d "$git_root/.specify" ]; then
+ REPO_ROOT="$git_root"
+ else
+ REPO_ROOT="$_root"
+ fi
+ fi
+fi
+
+exec "$REPO_ROOT/.specify/scripts/bash/update-agent-context.sh" qwen
diff --git a/src/specify_cli/integrations/roo/__init__.py b/src/specify_cli/integrations/roo/__init__.py
new file mode 100644
index 000000000..3c680e7e3
--- /dev/null
+++ b/src/specify_cli/integrations/roo/__init__.py
@@ -0,0 +1,21 @@
+"""Roo Code integration."""
+
+from ..base import MarkdownIntegration
+
+
+class RooIntegration(MarkdownIntegration):
+ key = "roo"
+ config = {
+ "name": "Roo Code",
+ "folder": ".roo/",
+ "commands_subdir": "commands",
+ "install_url": None,
+ "requires_cli": False,
+ }
+ registrar_config = {
+ "dir": ".roo/commands",
+ "format": "markdown",
+ "args": "$ARGUMENTS",
+ "extension": ".md",
+ }
+ context_file = ".roo/rules/specify-rules.md"
diff --git a/src/specify_cli/integrations/roo/scripts/update-context.ps1 b/src/specify_cli/integrations/roo/scripts/update-context.ps1
new file mode 100644
index 000000000..d1dec923e
--- /dev/null
+++ b/src/specify_cli/integrations/roo/scripts/update-context.ps1
@@ -0,0 +1,23 @@
+# update-context.ps1 β Roo Code integration: create/update .roo/rules/specify-rules.md
+#
+# Thin wrapper that delegates to the shared update-agent-context script.
+# Activated in Stage 7 when the shared script uses integration.json dispatch.
+#
+# Until then, this delegates to the shared script as a subprocess.
+
+$ErrorActionPreference = 'Stop'
+
+# Derive repo root from script location (walks up to find .specify/)
+$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Definition
+$repoRoot = try { git rev-parse --show-toplevel 2>$null } catch { $null }
+# If git did not return a repo root, or the git root does not contain .specify,
+# fall back to walking up from the script directory to find the initialized project root.
+if (-not $repoRoot -or -not (Test-Path (Join-Path $repoRoot '.specify'))) {
+ $repoRoot = $scriptDir
+ $fsRoot = [System.IO.Path]::GetPathRoot($repoRoot)
+ while ($repoRoot -and $repoRoot -ne $fsRoot -and -not (Test-Path (Join-Path $repoRoot '.specify'))) {
+ $repoRoot = Split-Path -Parent $repoRoot
+ }
+}
+
+& "$repoRoot/.specify/scripts/powershell/update-agent-context.ps1" -AgentType roo
diff --git a/src/specify_cli/integrations/roo/scripts/update-context.sh b/src/specify_cli/integrations/roo/scripts/update-context.sh
new file mode 100755
index 000000000..8fe255cb1
--- /dev/null
+++ b/src/specify_cli/integrations/roo/scripts/update-context.sh
@@ -0,0 +1,28 @@
+#!/usr/bin/env bash
+# update-context.sh β Roo Code integration: create/update .roo/rules/specify-rules.md
+#
+# Thin wrapper that delegates to the shared update-agent-context script.
+# Activated in Stage 7 when the shared script uses integration.json dispatch.
+#
+# Until then, this delegates to the shared script as a subprocess.
+
+set -euo pipefail
+
+# Derive repo root from script location (walks up to find .specify/)
+_script_dir="$(cd "$(dirname "$0")" && pwd)"
+_root="$_script_dir"
+while [ "$_root" != "/" ] && [ ! -d "$_root/.specify" ]; do _root="$(dirname "$_root")"; done
+if [ -z "${REPO_ROOT:-}" ]; then
+ if [ -d "$_root/.specify" ]; then
+ REPO_ROOT="$_root"
+ else
+ git_root="$(git rev-parse --show-toplevel 2>/dev/null || true)"
+ if [ -n "$git_root" ] && [ -d "$git_root/.specify" ]; then
+ REPO_ROOT="$git_root"
+ else
+ REPO_ROOT="$_root"
+ fi
+ fi
+fi
+
+exec "$REPO_ROOT/.specify/scripts/bash/update-agent-context.sh" roo
diff --git a/src/specify_cli/integrations/shai/__init__.py b/src/specify_cli/integrations/shai/__init__.py
new file mode 100644
index 000000000..7a9d1deb0
--- /dev/null
+++ b/src/specify_cli/integrations/shai/__init__.py
@@ -0,0 +1,21 @@
+"""SHAI CLI integration."""
+
+from ..base import MarkdownIntegration
+
+
+class ShaiIntegration(MarkdownIntegration):
+ key = "shai"
+ config = {
+ "name": "SHAI",
+ "folder": ".shai/",
+ "commands_subdir": "commands",
+ "install_url": "https://github.com/ovh/shai",
+ "requires_cli": True,
+ }
+ registrar_config = {
+ "dir": ".shai/commands",
+ "format": "markdown",
+ "args": "$ARGUMENTS",
+ "extension": ".md",
+ }
+ context_file = "SHAI.md"
diff --git a/src/specify_cli/integrations/shai/scripts/update-context.ps1 b/src/specify_cli/integrations/shai/scripts/update-context.ps1
new file mode 100644
index 000000000..2c621c76a
--- /dev/null
+++ b/src/specify_cli/integrations/shai/scripts/update-context.ps1
@@ -0,0 +1,23 @@
+# update-context.ps1 β SHAI integration: create/update SHAI.md
+#
+# Thin wrapper that delegates to the shared update-agent-context script.
+# Activated in Stage 7 when the shared script uses integration.json dispatch.
+#
+# Until then, this delegates to the shared script as a subprocess.
+
+$ErrorActionPreference = 'Stop'
+
+# Derive repo root from script location (walks up to find .specify/)
+$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Definition
+$repoRoot = try { git rev-parse --show-toplevel 2>$null } catch { $null }
+# If git did not return a repo root, or the git root does not contain .specify,
+# fall back to walking up from the script directory to find the initialized project root.
+if (-not $repoRoot -or -not (Test-Path (Join-Path $repoRoot '.specify'))) {
+ $repoRoot = $scriptDir
+ $fsRoot = [System.IO.Path]::GetPathRoot($repoRoot)
+ while ($repoRoot -and $repoRoot -ne $fsRoot -and -not (Test-Path (Join-Path $repoRoot '.specify'))) {
+ $repoRoot = Split-Path -Parent $repoRoot
+ }
+}
+
+& "$repoRoot/.specify/scripts/powershell/update-agent-context.ps1" -AgentType shai
diff --git a/src/specify_cli/integrations/shai/scripts/update-context.sh b/src/specify_cli/integrations/shai/scripts/update-context.sh
new file mode 100755
index 000000000..093b9d1f7
--- /dev/null
+++ b/src/specify_cli/integrations/shai/scripts/update-context.sh
@@ -0,0 +1,28 @@
+#!/usr/bin/env bash
+# update-context.sh β SHAI integration: create/update SHAI.md
+#
+# Thin wrapper that delegates to the shared update-agent-context script.
+# Activated in Stage 7 when the shared script uses integration.json dispatch.
+#
+# Until then, this delegates to the shared script as a subprocess.
+
+set -euo pipefail
+
+# Derive repo root from script location (walks up to find .specify/)
+_script_dir="$(cd "$(dirname "$0")" && pwd)"
+_root="$_script_dir"
+while [ "$_root" != "/" ] && [ ! -d "$_root/.specify" ]; do _root="$(dirname "$_root")"; done
+if [ -z "${REPO_ROOT:-}" ]; then
+ if [ -d "$_root/.specify" ]; then
+ REPO_ROOT="$_root"
+ else
+ git_root="$(git rev-parse --show-toplevel 2>/dev/null || true)"
+ if [ -n "$git_root" ] && [ -d "$git_root/.specify" ]; then
+ REPO_ROOT="$git_root"
+ else
+ REPO_ROOT="$_root"
+ fi
+ fi
+fi
+
+exec "$REPO_ROOT/.specify/scripts/bash/update-agent-context.sh" shai
diff --git a/src/specify_cli/integrations/trae/__init__.py b/src/specify_cli/integrations/trae/__init__.py
new file mode 100644
index 000000000..7037eecb8
--- /dev/null
+++ b/src/specify_cli/integrations/trae/__init__.py
@@ -0,0 +1,21 @@
+"""Trae IDE integration."""
+
+from ..base import MarkdownIntegration
+
+
+class TraeIntegration(MarkdownIntegration):
+ key = "trae"
+ config = {
+ "name": "Trae",
+ "folder": ".trae/",
+ "commands_subdir": "rules",
+ "install_url": None,
+ "requires_cli": False,
+ }
+ registrar_config = {
+ "dir": ".trae/rules",
+ "format": "markdown",
+ "args": "$ARGUMENTS",
+ "extension": ".md",
+ }
+ context_file = ".trae/rules/AGENTS.md"
diff --git a/src/specify_cli/integrations/trae/scripts/update-context.ps1 b/src/specify_cli/integrations/trae/scripts/update-context.ps1
new file mode 100644
index 000000000..f72d96318
--- /dev/null
+++ b/src/specify_cli/integrations/trae/scripts/update-context.ps1
@@ -0,0 +1,23 @@
+# update-context.ps1 β Trae integration: create/update .trae/rules/AGENTS.md
+#
+# Thin wrapper that delegates to the shared update-agent-context script.
+# Activated in Stage 7 when the shared script uses integration.json dispatch.
+#
+# Until then, this delegates to the shared script as a subprocess.
+
+$ErrorActionPreference = 'Stop'
+
+# Derive repo root from script location (walks up to find .specify/)
+$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Definition
+$repoRoot = try { git rev-parse --show-toplevel 2>$null } catch { $null }
+# If git did not return a repo root, or the git root does not contain .specify,
+# fall back to walking up from the script directory to find the initialized project root.
+if (-not $repoRoot -or -not (Test-Path (Join-Path $repoRoot '.specify'))) {
+ $repoRoot = $scriptDir
+ $fsRoot = [System.IO.Path]::GetPathRoot($repoRoot)
+ while ($repoRoot -and $repoRoot -ne $fsRoot -and -not (Test-Path (Join-Path $repoRoot '.specify'))) {
+ $repoRoot = Split-Path -Parent $repoRoot
+ }
+}
+
+& "$repoRoot/.specify/scripts/powershell/update-agent-context.ps1" -AgentType trae
diff --git a/src/specify_cli/integrations/trae/scripts/update-context.sh b/src/specify_cli/integrations/trae/scripts/update-context.sh
new file mode 100755
index 000000000..b868a7c98
--- /dev/null
+++ b/src/specify_cli/integrations/trae/scripts/update-context.sh
@@ -0,0 +1,28 @@
+#!/usr/bin/env bash
+# update-context.sh β Trae integration: create/update .trae/rules/AGENTS.md
+#
+# Thin wrapper that delegates to the shared update-agent-context script.
+# Activated in Stage 7 when the shared script uses integration.json dispatch.
+#
+# Until then, this delegates to the shared script as a subprocess.
+
+set -euo pipefail
+
+# Derive repo root from script location (walks up to find .specify/)
+_script_dir="$(cd "$(dirname "$0")" && pwd)"
+_root="$_script_dir"
+while [ "$_root" != "/" ] && [ ! -d "$_root/.specify" ]; do _root="$(dirname "$_root")"; done
+if [ -z "${REPO_ROOT:-}" ]; then
+ if [ -d "$_root/.specify" ]; then
+ REPO_ROOT="$_root"
+ else
+ git_root="$(git rev-parse --show-toplevel 2>/dev/null || true)"
+ if [ -n "$git_root" ] && [ -d "$git_root/.specify" ]; then
+ REPO_ROOT="$git_root"
+ else
+ REPO_ROOT="$_root"
+ fi
+ fi
+fi
+
+exec "$REPO_ROOT/.specify/scripts/bash/update-agent-context.sh" trae
diff --git a/src/specify_cli/integrations/vibe/__init__.py b/src/specify_cli/integrations/vibe/__init__.py
new file mode 100644
index 000000000..dcc4a60dd
--- /dev/null
+++ b/src/specify_cli/integrations/vibe/__init__.py
@@ -0,0 +1,21 @@
+"""Mistral Vibe CLI integration."""
+
+from ..base import MarkdownIntegration
+
+
+class VibeIntegration(MarkdownIntegration):
+ key = "vibe"
+ config = {
+ "name": "Mistral Vibe",
+ "folder": ".vibe/",
+ "commands_subdir": "prompts",
+ "install_url": "https://github.com/mistralai/mistral-vibe",
+ "requires_cli": True,
+ }
+ registrar_config = {
+ "dir": ".vibe/prompts",
+ "format": "markdown",
+ "args": "$ARGUMENTS",
+ "extension": ".md",
+ }
+ context_file = ".vibe/agents/specify-agents.md"
diff --git a/src/specify_cli/integrations/vibe/scripts/update-context.ps1 b/src/specify_cli/integrations/vibe/scripts/update-context.ps1
new file mode 100644
index 000000000..d82ce3389
--- /dev/null
+++ b/src/specify_cli/integrations/vibe/scripts/update-context.ps1
@@ -0,0 +1,23 @@
+# update-context.ps1 β Mistral Vibe integration: create/update .vibe/agents/specify-agents.md
+#
+# Thin wrapper that delegates to the shared update-agent-context script.
+# Activated in Stage 7 when the shared script uses integration.json dispatch.
+#
+# Until then, this delegates to the shared script as a subprocess.
+
+$ErrorActionPreference = 'Stop'
+
+# Derive repo root from script location (walks up to find .specify/)
+$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Definition
+$repoRoot = try { git rev-parse --show-toplevel 2>$null } catch { $null }
+# If git did not return a repo root, or the git root does not contain .specify,
+# fall back to walking up from the script directory to find the initialized project root.
+if (-not $repoRoot -or -not (Test-Path (Join-Path $repoRoot '.specify'))) {
+ $repoRoot = $scriptDir
+ $fsRoot = [System.IO.Path]::GetPathRoot($repoRoot)
+ while ($repoRoot -and $repoRoot -ne $fsRoot -and -not (Test-Path (Join-Path $repoRoot '.specify'))) {
+ $repoRoot = Split-Path -Parent $repoRoot
+ }
+}
+
+& "$repoRoot/.specify/scripts/powershell/update-agent-context.ps1" -AgentType vibe
diff --git a/src/specify_cli/integrations/vibe/scripts/update-context.sh b/src/specify_cli/integrations/vibe/scripts/update-context.sh
new file mode 100755
index 000000000..f924cdb89
--- /dev/null
+++ b/src/specify_cli/integrations/vibe/scripts/update-context.sh
@@ -0,0 +1,28 @@
+#!/usr/bin/env bash
+# update-context.sh β Mistral Vibe integration: create/update .vibe/agents/specify-agents.md
+#
+# Thin wrapper that delegates to the shared update-agent-context script.
+# Activated in Stage 7 when the shared script uses integration.json dispatch.
+#
+# Until then, this delegates to the shared script as a subprocess.
+
+set -euo pipefail
+
+# Derive repo root from script location (walks up to find .specify/)
+_script_dir="$(cd "$(dirname "$0")" && pwd)"
+_root="$_script_dir"
+while [ "$_root" != "/" ] && [ ! -d "$_root/.specify" ]; do _root="$(dirname "$_root")"; done
+if [ -z "${REPO_ROOT:-}" ]; then
+ if [ -d "$_root/.specify" ]; then
+ REPO_ROOT="$_root"
+ else
+ git_root="$(git rev-parse --show-toplevel 2>/dev/null || true)"
+ if [ -n "$git_root" ] && [ -d "$git_root/.specify" ]; then
+ REPO_ROOT="$git_root"
+ else
+ REPO_ROOT="$_root"
+ fi
+ fi
+fi
+
+exec "$REPO_ROOT/.specify/scripts/bash/update-agent-context.sh" vibe
diff --git a/src/specify_cli/integrations/windsurf/__init__.py b/src/specify_cli/integrations/windsurf/__init__.py
new file mode 100644
index 000000000..f0f77d318
--- /dev/null
+++ b/src/specify_cli/integrations/windsurf/__init__.py
@@ -0,0 +1,21 @@
+"""Windsurf IDE integration."""
+
+from ..base import MarkdownIntegration
+
+
+class WindsurfIntegration(MarkdownIntegration):
+ key = "windsurf"
+ config = {
+ "name": "Windsurf",
+ "folder": ".windsurf/",
+ "commands_subdir": "workflows",
+ "install_url": None,
+ "requires_cli": False,
+ }
+ registrar_config = {
+ "dir": ".windsurf/workflows",
+ "format": "markdown",
+ "args": "$ARGUMENTS",
+ "extension": ".md",
+ }
+ context_file = ".windsurf/rules/specify-rules.md"
diff --git a/src/specify_cli/integrations/windsurf/scripts/update-context.ps1 b/src/specify_cli/integrations/windsurf/scripts/update-context.ps1
new file mode 100644
index 000000000..b5fe1d0c0
--- /dev/null
+++ b/src/specify_cli/integrations/windsurf/scripts/update-context.ps1
@@ -0,0 +1,23 @@
+# update-context.ps1 β Windsurf integration: create/update .windsurf/rules/specify-rules.md
+#
+# Thin wrapper that delegates to the shared update-agent-context script.
+# Activated in Stage 7 when the shared script uses integration.json dispatch.
+#
+# Until then, this delegates to the shared script as a subprocess.
+
+$ErrorActionPreference = 'Stop'
+
+# Derive repo root from script location (walks up to find .specify/)
+$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Definition
+$repoRoot = try { git rev-parse --show-toplevel 2>$null } catch { $null }
+# If git did not return a repo root, or the git root does not contain .specify,
+# fall back to walking up from the script directory to find the initialized project root.
+if (-not $repoRoot -or -not (Test-Path (Join-Path $repoRoot '.specify'))) {
+ $repoRoot = $scriptDir
+ $fsRoot = [System.IO.Path]::GetPathRoot($repoRoot)
+ while ($repoRoot -and $repoRoot -ne $fsRoot -and -not (Test-Path (Join-Path $repoRoot '.specify'))) {
+ $repoRoot = Split-Path -Parent $repoRoot
+ }
+}
+
+& "$repoRoot/.specify/scripts/powershell/update-agent-context.ps1" -AgentType windsurf
diff --git a/src/specify_cli/integrations/windsurf/scripts/update-context.sh b/src/specify_cli/integrations/windsurf/scripts/update-context.sh
new file mode 100755
index 000000000..b9a78d320
--- /dev/null
+++ b/src/specify_cli/integrations/windsurf/scripts/update-context.sh
@@ -0,0 +1,28 @@
+#!/usr/bin/env bash
+# update-context.sh β Windsurf integration: create/update .windsurf/rules/specify-rules.md
+#
+# Thin wrapper that delegates to the shared update-agent-context script.
+# Activated in Stage 7 when the shared script uses integration.json dispatch.
+#
+# Until then, this delegates to the shared script as a subprocess.
+
+set -euo pipefail
+
+# Derive repo root from script location (walks up to find .specify/)
+_script_dir="$(cd "$(dirname "$0")" && pwd)"
+_root="$_script_dir"
+while [ "$_root" != "/" ] && [ ! -d "$_root/.specify" ]; do _root="$(dirname "$_root")"; done
+if [ -z "${REPO_ROOT:-}" ]; then
+ if [ -d "$_root/.specify" ]; then
+ REPO_ROOT="$_root"
+ else
+ git_root="$(git rev-parse --show-toplevel 2>/dev/null || true)"
+ if [ -n "$git_root" ] && [ -d "$git_root/.specify" ]; then
+ REPO_ROOT="$git_root"
+ else
+ REPO_ROOT="$_root"
+ fi
+ fi
+fi
+
+exec "$REPO_ROOT/.specify/scripts/bash/update-agent-context.sh" windsurf
diff --git a/tests/integrations/__init__.py b/tests/integrations/__init__.py
new file mode 100644
index 000000000..e69de29bb
diff --git a/tests/integrations/conftest.py b/tests/integrations/conftest.py
new file mode 100644
index 000000000..54f59e23a
--- /dev/null
+++ b/tests/integrations/conftest.py
@@ -0,0 +1,23 @@
+"""Shared test helpers for integration tests."""
+
+from specify_cli.integrations.base import MarkdownIntegration
+
+
+class StubIntegration(MarkdownIntegration):
+ """Minimal concrete integration for testing."""
+
+ key = "stub"
+ config = {
+ "name": "Stub Agent",
+ "folder": ".stub/",
+ "commands_subdir": "commands",
+ "install_url": None,
+ "requires_cli": False,
+ }
+ registrar_config = {
+ "dir": ".stub/commands",
+ "format": "markdown",
+ "args": "$ARGUMENTS",
+ "extension": ".md",
+ }
+ context_file = "STUB.md"
diff --git a/tests/integrations/test_base.py b/tests/integrations/test_base.py
new file mode 100644
index 000000000..03b5eb306
--- /dev/null
+++ b/tests/integrations/test_base.py
@@ -0,0 +1,169 @@
+"""Tests for IntegrationOption, IntegrationBase, MarkdownIntegration, and primitives."""
+
+import pytest
+
+from specify_cli.integrations.base import (
+ IntegrationBase,
+ IntegrationOption,
+ MarkdownIntegration,
+)
+from specify_cli.integrations.manifest import IntegrationManifest
+from .conftest import StubIntegration
+
+
+class TestIntegrationOption:
+ def test_defaults(self):
+ opt = IntegrationOption(name="--flag")
+ assert opt.name == "--flag"
+ assert opt.is_flag is False
+ assert opt.required is False
+ assert opt.default is None
+ assert opt.help == ""
+
+ def test_flag_option(self):
+ opt = IntegrationOption(name="--skills", is_flag=True, default=True, help="Enable skills")
+ assert opt.is_flag is True
+ assert opt.default is True
+ assert opt.help == "Enable skills"
+
+ def test_required_option(self):
+ opt = IntegrationOption(name="--commands-dir", required=True, help="Dir path")
+ assert opt.required is True
+
+ def test_frozen(self):
+ opt = IntegrationOption(name="--x")
+ with pytest.raises(AttributeError):
+ opt.name = "--y" # type: ignore[misc]
+
+
+class TestIntegrationBase:
+ def test_key_and_config(self):
+ i = StubIntegration()
+ assert i.key == "stub"
+ assert i.config["name"] == "Stub Agent"
+ assert i.registrar_config["format"] == "markdown"
+ assert i.context_file == "STUB.md"
+
+ def test_options_default_empty(self):
+ assert StubIntegration.options() == []
+
+ def test_shared_commands_dir(self):
+ i = StubIntegration()
+ cmd_dir = i.shared_commands_dir()
+ assert cmd_dir is not None
+ assert cmd_dir.is_dir()
+
+ def test_setup_uses_shared_templates(self, tmp_path):
+ i = StubIntegration()
+ manifest = IntegrationManifest("stub", tmp_path)
+ created = i.setup(tmp_path, manifest)
+ assert len(created) > 0
+ for f in created:
+ assert f.parent == tmp_path / ".stub" / "commands"
+ assert f.name.startswith("speckit.")
+ assert f.name.endswith(".md")
+
+ def test_setup_copies_templates(self, tmp_path, monkeypatch):
+ tpl = tmp_path / "_templates"
+ tpl.mkdir()
+ (tpl / "plan.md").write_text("plan content", encoding="utf-8")
+ (tpl / "specify.md").write_text("spec content", encoding="utf-8")
+
+ i = StubIntegration()
+ monkeypatch.setattr(type(i), "list_command_templates", lambda self: sorted(tpl.glob("*.md")))
+
+ project = tmp_path / "project"
+ project.mkdir()
+ created = i.setup(project, IntegrationManifest("stub", project))
+ assert len(created) == 2
+ assert (project / ".stub" / "commands" / "speckit.plan.md").exists()
+ assert (project / ".stub" / "commands" / "speckit.specify.md").exists()
+
+ def test_install_delegates_to_setup(self, tmp_path):
+ i = StubIntegration()
+ manifest = IntegrationManifest("stub", tmp_path)
+ result = i.install(tmp_path, manifest)
+ assert len(result) > 0
+
+ def test_uninstall_delegates_to_teardown(self, tmp_path):
+ i = StubIntegration()
+ manifest = IntegrationManifest("stub", tmp_path)
+ removed, skipped = i.uninstall(tmp_path, manifest)
+ assert removed == []
+ assert skipped == []
+
+
+class TestMarkdownIntegration:
+ def test_is_subclass_of_base(self):
+ assert issubclass(MarkdownIntegration, IntegrationBase)
+
+ def test_stub_is_markdown(self):
+ assert isinstance(StubIntegration(), MarkdownIntegration)
+
+
+class TestBasePrimitives:
+ def test_shared_commands_dir_returns_path(self):
+ i = StubIntegration()
+ cmd_dir = i.shared_commands_dir()
+ assert cmd_dir is not None
+ assert cmd_dir.is_dir()
+
+ def test_shared_templates_dir_returns_path(self):
+ i = StubIntegration()
+ tpl_dir = i.shared_templates_dir()
+ assert tpl_dir is not None
+ assert tpl_dir.is_dir()
+
+ def test_list_command_templates_returns_md_files(self):
+ i = StubIntegration()
+ templates = i.list_command_templates()
+ assert len(templates) > 0
+ assert all(t.suffix == ".md" for t in templates)
+
+ def test_command_filename_default(self):
+ i = StubIntegration()
+ assert i.command_filename("plan") == "speckit.plan.md"
+
+ def test_commands_dest(self, tmp_path):
+ i = StubIntegration()
+ dest = i.commands_dest(tmp_path)
+ assert dest == tmp_path / ".stub" / "commands"
+
+ def test_commands_dest_no_config_raises(self, tmp_path):
+ class NoConfig(MarkdownIntegration):
+ key = "noconfig"
+ with pytest.raises(ValueError, match="config is not set"):
+ NoConfig().commands_dest(tmp_path)
+
+ def test_copy_command_to_directory(self, tmp_path):
+ src = tmp_path / "source.md"
+ src.write_text("content", encoding="utf-8")
+ dest_dir = tmp_path / "output"
+ result = IntegrationBase.copy_command_to_directory(src, dest_dir, "speckit.plan.md")
+ assert result == dest_dir / "speckit.plan.md"
+ assert result.read_text(encoding="utf-8") == "content"
+
+ def test_record_file_in_manifest(self, tmp_path):
+ f = tmp_path / "f.txt"
+ f.write_text("hello", encoding="utf-8")
+ m = IntegrationManifest("test", tmp_path)
+ IntegrationBase.record_file_in_manifest(f, tmp_path, m)
+ assert "f.txt" in m.files
+
+ def test_write_file_and_record(self, tmp_path):
+ m = IntegrationManifest("test", tmp_path)
+ dest = tmp_path / "sub" / "f.txt"
+ result = IntegrationBase.write_file_and_record("content", dest, tmp_path, m)
+ assert result == dest
+ assert dest.read_text(encoding="utf-8") == "content"
+ assert "sub/f.txt" in m.files
+
+ def test_setup_copies_shared_templates(self, tmp_path):
+ i = StubIntegration()
+ m = IntegrationManifest("stub", tmp_path)
+ created = i.setup(tmp_path, m)
+ assert len(created) > 0
+ for f in created:
+ assert f.parent.name == "commands"
+ assert f.name.startswith("speckit.")
+ assert f.name.endswith(".md")
diff --git a/tests/integrations/test_cli.py b/tests/integrations/test_cli.py
new file mode 100644
index 000000000..03b0e1186
--- /dev/null
+++ b/tests/integrations/test_cli.py
@@ -0,0 +1,122 @@
+"""Tests for --integration flag on specify init (CLI-level)."""
+
+import json
+import os
+
+import pytest
+
+
+class TestInitIntegrationFlag:
+ def test_integration_and_ai_mutually_exclusive(self):
+ from typer.testing import CliRunner
+ from specify_cli import app
+ runner = CliRunner()
+ result = runner.invoke(app, [
+ "init", "test-project", "--ai", "claude", "--integration", "copilot",
+ ])
+ assert result.exit_code != 0
+ assert "mutually exclusive" in result.output
+
+ def test_unknown_integration_rejected(self):
+ from typer.testing import CliRunner
+ from specify_cli import app
+ runner = CliRunner()
+ result = runner.invoke(app, [
+ "init", "test-project", "--integration", "nonexistent",
+ ])
+ assert result.exit_code != 0
+ assert "Unknown integration" in result.output
+
+ def test_integration_copilot_creates_files(self, tmp_path):
+ from typer.testing import CliRunner
+ from specify_cli import app
+ runner = CliRunner()
+ project = tmp_path / "int-test"
+ project.mkdir()
+ old_cwd = os.getcwd()
+ try:
+ os.chdir(project)
+ result = runner.invoke(app, [
+ "init", "--here", "--integration", "copilot", "--script", "sh", "--no-git",
+ ], catch_exceptions=False)
+ finally:
+ os.chdir(old_cwd)
+ assert result.exit_code == 0, f"init failed: {result.output}"
+ assert (project / ".github" / "agents" / "speckit.plan.agent.md").exists()
+ assert (project / ".github" / "prompts" / "speckit.plan.prompt.md").exists()
+ assert (project / ".specify" / "scripts" / "bash" / "common.sh").exists()
+
+ data = json.loads((project / ".specify" / "integration.json").read_text(encoding="utf-8"))
+ assert data["integration"] == "copilot"
+ assert "scripts" in data
+ assert "update-context" in data["scripts"]
+
+ opts = json.loads((project / ".specify" / "init-options.json").read_text(encoding="utf-8"))
+ assert opts["integration"] == "copilot"
+
+ assert (project / ".specify" / "integrations" / "copilot.manifest.json").exists()
+ assert (project / ".specify" / "integrations" / "copilot" / "scripts" / "update-context.sh").exists()
+
+ shared_manifest = project / ".specify" / "integrations" / "speckit.manifest.json"
+ assert shared_manifest.exists()
+
+ def test_ai_copilot_auto_promotes(self, tmp_path):
+ from typer.testing import CliRunner
+ from specify_cli import app
+ project = tmp_path / "promote-test"
+ project.mkdir()
+ old_cwd = os.getcwd()
+ try:
+ os.chdir(project)
+ runner = CliRunner()
+ result = runner.invoke(app, [
+ "init", "--here", "--ai", "copilot", "--script", "sh", "--no-git",
+ ], catch_exceptions=False)
+ finally:
+ os.chdir(old_cwd)
+ assert result.exit_code == 0
+ assert "--integration copilot" in result.output
+ assert (project / ".github" / "agents" / "speckit.plan.agent.md").exists()
+
+ def test_shared_infra_skips_existing_files(self, tmp_path):
+ """Pre-existing shared files are not overwritten by _install_shared_infra."""
+ from typer.testing import CliRunner
+ from specify_cli import app
+
+ project = tmp_path / "skip-test"
+ project.mkdir()
+
+ # Pre-create a shared script with custom content
+ scripts_dir = project / ".specify" / "scripts" / "bash"
+ scripts_dir.mkdir(parents=True)
+ custom_content = "# user-modified common.sh\n"
+ (scripts_dir / "common.sh").write_text(custom_content, encoding="utf-8")
+
+ # Pre-create a shared template with custom content
+ templates_dir = project / ".specify" / "templates"
+ templates_dir.mkdir(parents=True)
+ custom_template = "# user-modified spec-template\n"
+ (templates_dir / "spec-template.md").write_text(custom_template, encoding="utf-8")
+
+ old_cwd = os.getcwd()
+ try:
+ os.chdir(project)
+ runner = CliRunner()
+ result = runner.invoke(app, [
+ "init", "--here", "--force",
+ "--integration", "copilot",
+ "--script", "sh",
+ "--no-git",
+ ], catch_exceptions=False)
+ finally:
+ os.chdir(old_cwd)
+
+ assert result.exit_code == 0
+
+ # User's files should be preserved
+ assert (scripts_dir / "common.sh").read_text(encoding="utf-8") == custom_content
+ assert (templates_dir / "spec-template.md").read_text(encoding="utf-8") == custom_template
+
+ # Other shared files should still be installed
+ assert (scripts_dir / "setup-plan.sh").exists()
+ assert (templates_dir / "plan-template.md").exists()
diff --git a/tests/integrations/test_integration_amp.py b/tests/integrations/test_integration_amp.py
new file mode 100644
index 000000000..a36dd4713
--- /dev/null
+++ b/tests/integrations/test_integration_amp.py
@@ -0,0 +1,11 @@
+"""Tests for AmpIntegration."""
+
+from .test_integration_base_markdown import MarkdownIntegrationTests
+
+
+class TestAmpIntegration(MarkdownIntegrationTests):
+ KEY = "amp"
+ FOLDER = ".agents/"
+ COMMANDS_SUBDIR = "commands"
+ REGISTRAR_DIR = ".agents/commands"
+ CONTEXT_FILE = "AGENTS.md"
diff --git a/tests/integrations/test_integration_auggie.py b/tests/integrations/test_integration_auggie.py
new file mode 100644
index 000000000..e4033a23e
--- /dev/null
+++ b/tests/integrations/test_integration_auggie.py
@@ -0,0 +1,11 @@
+"""Tests for AuggieIntegration."""
+
+from .test_integration_base_markdown import MarkdownIntegrationTests
+
+
+class TestAuggieIntegration(MarkdownIntegrationTests):
+ KEY = "auggie"
+ FOLDER = ".augment/"
+ COMMANDS_SUBDIR = "commands"
+ REGISTRAR_DIR = ".augment/commands"
+ CONTEXT_FILE = ".augment/rules/specify-rules.md"
diff --git a/tests/integrations/test_integration_base_markdown.py b/tests/integrations/test_integration_base_markdown.py
new file mode 100644
index 000000000..75319eb94
--- /dev/null
+++ b/tests/integrations/test_integration_base_markdown.py
@@ -0,0 +1,296 @@
+"""Reusable test mixin for standard MarkdownIntegration subclasses.
+
+Each per-agent test file sets ``KEY``, ``FOLDER``, ``COMMANDS_SUBDIR``,
+``REGISTRAR_DIR``, and ``CONTEXT_FILE``, then inherits all verification
+logic from ``MarkdownIntegrationTests``.
+"""
+
+import os
+
+from specify_cli.integrations import INTEGRATION_REGISTRY, get_integration
+from specify_cli.integrations.base import MarkdownIntegration
+from specify_cli.integrations.manifest import IntegrationManifest
+
+
+class MarkdownIntegrationTests:
+ """Mixin β set class-level constants and inherit these tests.
+
+ Required class attrs on subclass::
+
+ KEY: str β integration registry key
+ FOLDER: str β e.g. ".claude/"
+ COMMANDS_SUBDIR: str β e.g. "commands"
+ REGISTRAR_DIR: str β e.g. ".claude/commands"
+ CONTEXT_FILE: str β e.g. "CLAUDE.md"
+ """
+
+ KEY: str
+ FOLDER: str
+ COMMANDS_SUBDIR: str
+ REGISTRAR_DIR: str
+ CONTEXT_FILE: str
+
+ # -- Registration -----------------------------------------------------
+
+ def test_registered(self):
+ assert self.KEY in INTEGRATION_REGISTRY
+ assert get_integration(self.KEY) is not None
+
+ def test_is_markdown_integration(self):
+ assert isinstance(get_integration(self.KEY), MarkdownIntegration)
+
+ # -- Config -----------------------------------------------------------
+
+ def test_config_folder(self):
+ i = get_integration(self.KEY)
+ assert i.config["folder"] == self.FOLDER
+
+ def test_config_commands_subdir(self):
+ i = get_integration(self.KEY)
+ assert i.config["commands_subdir"] == self.COMMANDS_SUBDIR
+
+ def test_registrar_config(self):
+ i = get_integration(self.KEY)
+ assert i.registrar_config["dir"] == self.REGISTRAR_DIR
+ assert i.registrar_config["format"] == "markdown"
+ assert i.registrar_config["args"] == "$ARGUMENTS"
+ assert i.registrar_config["extension"] == ".md"
+
+ def test_context_file(self):
+ i = get_integration(self.KEY)
+ assert i.context_file == self.CONTEXT_FILE
+
+ # -- Setup / teardown -------------------------------------------------
+
+ def test_setup_creates_files(self, tmp_path):
+ i = get_integration(self.KEY)
+ m = IntegrationManifest(self.KEY, tmp_path)
+ created = i.setup(tmp_path, m)
+ assert len(created) > 0
+ cmd_files = [f for f in created if "scripts" not in f.parts]
+ for f in cmd_files:
+ assert f.exists()
+ assert f.name.startswith("speckit.")
+ assert f.name.endswith(".md")
+
+ def test_setup_writes_to_correct_directory(self, tmp_path):
+ i = get_integration(self.KEY)
+ m = IntegrationManifest(self.KEY, tmp_path)
+ created = i.setup(tmp_path, m)
+ expected_dir = i.commands_dest(tmp_path)
+ assert expected_dir.exists(), f"Expected directory {expected_dir} was not created"
+ cmd_files = [f for f in created if "scripts" not in f.parts]
+ assert len(cmd_files) > 0, "No command files were created"
+ for f in cmd_files:
+ assert f.resolve().parent == expected_dir.resolve(), (
+ f"{f} is not under {expected_dir}"
+ )
+
+ def test_templates_are_processed(self, tmp_path):
+ """Command files must have placeholders replaced, not raw templates."""
+ i = get_integration(self.KEY)
+ m = IntegrationManifest(self.KEY, tmp_path)
+ created = i.setup(tmp_path, m)
+ cmd_files = [f for f in created if "scripts" not in f.parts]
+ assert len(cmd_files) > 0
+ for f in cmd_files:
+ content = f.read_text(encoding="utf-8")
+ assert "{SCRIPT}" not in content, f"{f.name} has unprocessed {{SCRIPT}}"
+ assert "__AGENT__" not in content, f"{f.name} has unprocessed __AGENT__"
+ assert "{ARGS}" not in content, f"{f.name} has unprocessed {{ARGS}}"
+ assert "\nscripts:\n" not in content, f"{f.name} has unstripped scripts: block"
+ assert "\nagent_scripts:\n" not in content, f"{f.name} has unstripped agent_scripts: block"
+
+ def test_all_files_tracked_in_manifest(self, tmp_path):
+ i = get_integration(self.KEY)
+ m = IntegrationManifest(self.KEY, tmp_path)
+ created = i.setup(tmp_path, m)
+ for f in created:
+ rel = f.resolve().relative_to(tmp_path.resolve()).as_posix()
+ assert rel in m.files, f"{rel} not tracked in manifest"
+
+ def test_install_uninstall_roundtrip(self, tmp_path):
+ i = get_integration(self.KEY)
+ m = IntegrationManifest(self.KEY, tmp_path)
+ created = i.install(tmp_path, m)
+ assert len(created) > 0
+ m.save()
+ for f in created:
+ assert f.exists()
+ removed, skipped = i.uninstall(tmp_path, m)
+ assert len(removed) == len(created)
+ assert skipped == []
+
+ def test_modified_file_survives_uninstall(self, tmp_path):
+ i = get_integration(self.KEY)
+ m = IntegrationManifest(self.KEY, tmp_path)
+ created = i.install(tmp_path, m)
+ m.save()
+ modified_file = created[0]
+ modified_file.write_text("user modified this", encoding="utf-8")
+ removed, skipped = i.uninstall(tmp_path, m)
+ assert modified_file.exists()
+ assert modified_file in skipped
+
+ # -- Scripts ----------------------------------------------------------
+
+ def test_setup_installs_update_context_scripts(self, tmp_path):
+ i = get_integration(self.KEY)
+ m = IntegrationManifest(self.KEY, tmp_path)
+ created = i.setup(tmp_path, m)
+ scripts_dir = tmp_path / ".specify" / "integrations" / self.KEY / "scripts"
+ assert scripts_dir.is_dir(), f"Scripts directory not created for {self.KEY}"
+ assert (scripts_dir / "update-context.sh").exists()
+ assert (scripts_dir / "update-context.ps1").exists()
+
+ def test_scripts_tracked_in_manifest(self, tmp_path):
+ i = get_integration(self.KEY)
+ m = IntegrationManifest(self.KEY, tmp_path)
+ i.setup(tmp_path, m)
+ script_rels = [k for k in m.files if "update-context" in k]
+ assert len(script_rels) >= 2
+
+ def test_sh_script_is_executable(self, tmp_path):
+ i = get_integration(self.KEY)
+ m = IntegrationManifest(self.KEY, tmp_path)
+ i.setup(tmp_path, m)
+ sh = tmp_path / ".specify" / "integrations" / self.KEY / "scripts" / "update-context.sh"
+ assert os.access(sh, os.X_OK)
+
+ # -- CLI auto-promote -------------------------------------------------
+
+ def test_ai_flag_auto_promotes(self, tmp_path):
+ from typer.testing import CliRunner
+ from specify_cli import app
+
+ project = tmp_path / f"promote-{self.KEY}"
+ project.mkdir()
+ old_cwd = os.getcwd()
+ try:
+ os.chdir(project)
+ runner = CliRunner()
+ result = runner.invoke(app, [
+ "init", "--here", "--ai", self.KEY, "--script", "sh", "--no-git",
+ "--ignore-agent-tools",
+ ], catch_exceptions=False)
+ finally:
+ os.chdir(old_cwd)
+ assert result.exit_code == 0, f"init --ai {self.KEY} failed: {result.output}"
+ assert f"--integration {self.KEY}" in result.output
+
+ def test_integration_flag_creates_files(self, tmp_path):
+ from typer.testing import CliRunner
+ from specify_cli import app
+
+ project = tmp_path / f"int-{self.KEY}"
+ project.mkdir()
+ old_cwd = os.getcwd()
+ try:
+ os.chdir(project)
+ runner = CliRunner()
+ result = runner.invoke(app, [
+ "init", "--here", "--integration", self.KEY, "--script", "sh", "--no-git",
+ "--ignore-agent-tools",
+ ], catch_exceptions=False)
+ finally:
+ os.chdir(old_cwd)
+ assert result.exit_code == 0, f"init --integration {self.KEY} failed: {result.output}"
+ i = get_integration(self.KEY)
+ cmd_dir = i.commands_dest(project)
+ assert cmd_dir.is_dir(), f"Commands directory {cmd_dir} not created"
+ commands = sorted(cmd_dir.glob("speckit.*"))
+ assert len(commands) > 0, f"No command files in {cmd_dir}"
+
+ # -- Complete file inventory ------------------------------------------
+
+ COMMAND_STEMS = [
+ "analyze", "checklist", "clarify", "constitution",
+ "implement", "plan", "specify", "tasks", "taskstoissues",
+ ]
+
+ def _expected_files(self, script_variant: str) -> list[str]:
+ """Build the expected file list for this integration + script variant."""
+ i = get_integration(self.KEY)
+ cmd_dir = i.registrar_config["dir"]
+ files = []
+
+ # Command files
+ for stem in self.COMMAND_STEMS:
+ files.append(f"{cmd_dir}/speckit.{stem}.md")
+
+ # Integration scripts
+ files.append(f".specify/integrations/{self.KEY}/scripts/update-context.ps1")
+ files.append(f".specify/integrations/{self.KEY}/scripts/update-context.sh")
+
+ # Framework files
+ files.append(f".specify/integration.json")
+ files.append(f".specify/init-options.json")
+ files.append(f".specify/integrations/{self.KEY}.manifest.json")
+ files.append(f".specify/integrations/speckit.manifest.json")
+
+ if script_variant == "sh":
+ for name in ["check-prerequisites.sh", "common.sh", "create-new-feature.sh",
+ "setup-plan.sh", "update-agent-context.sh"]:
+ files.append(f".specify/scripts/bash/{name}")
+ else:
+ for name in ["check-prerequisites.ps1", "common.ps1", "create-new-feature.ps1",
+ "setup-plan.ps1", "update-agent-context.ps1"]:
+ files.append(f".specify/scripts/powershell/{name}")
+
+ for name in ["agent-file-template.md", "checklist-template.md",
+ "constitution-template.md", "plan-template.md",
+ "spec-template.md", "tasks-template.md"]:
+ files.append(f".specify/templates/{name}")
+
+ files.append(".specify/memory/constitution.md")
+ return sorted(files)
+
+ def test_complete_file_inventory_sh(self, tmp_path):
+ """Every file produced by specify init --integration --script sh."""
+ from typer.testing import CliRunner
+ from specify_cli import app
+
+ project = tmp_path / f"inventory-sh-{self.KEY}"
+ project.mkdir()
+ old_cwd = os.getcwd()
+ try:
+ os.chdir(project)
+ result = CliRunner().invoke(app, [
+ "init", "--here", "--integration", self.KEY, "--script", "sh",
+ "--no-git", "--ignore-agent-tools",
+ ], catch_exceptions=False)
+ finally:
+ os.chdir(old_cwd)
+ assert result.exit_code == 0, f"init failed: {result.output}"
+ actual = sorted(p.relative_to(project).as_posix()
+ for p in project.rglob("*") if p.is_file())
+ expected = self._expected_files("sh")
+ assert actual == expected, (
+ f"Missing: {sorted(set(expected) - set(actual))}\n"
+ f"Extra: {sorted(set(actual) - set(expected))}"
+ )
+
+ def test_complete_file_inventory_ps(self, tmp_path):
+ """Every file produced by specify init --integration --script ps."""
+ from typer.testing import CliRunner
+ from specify_cli import app
+
+ project = tmp_path / f"inventory-ps-{self.KEY}"
+ project.mkdir()
+ old_cwd = os.getcwd()
+ try:
+ os.chdir(project)
+ result = CliRunner().invoke(app, [
+ "init", "--here", "--integration", self.KEY, "--script", "ps",
+ "--no-git", "--ignore-agent-tools",
+ ], catch_exceptions=False)
+ finally:
+ os.chdir(old_cwd)
+ assert result.exit_code == 0, f"init failed: {result.output}"
+ actual = sorted(p.relative_to(project).as_posix()
+ for p in project.rglob("*") if p.is_file())
+ expected = self._expected_files("ps")
+ assert actual == expected, (
+ f"Missing: {sorted(set(expected) - set(actual))}\n"
+ f"Extra: {sorted(set(actual) - set(expected))}"
+ )
diff --git a/tests/integrations/test_integration_bob.py b/tests/integrations/test_integration_bob.py
new file mode 100644
index 000000000..1562f0100
--- /dev/null
+++ b/tests/integrations/test_integration_bob.py
@@ -0,0 +1,11 @@
+"""Tests for BobIntegration."""
+
+from .test_integration_base_markdown import MarkdownIntegrationTests
+
+
+class TestBobIntegration(MarkdownIntegrationTests):
+ KEY = "bob"
+ FOLDER = ".bob/"
+ COMMANDS_SUBDIR = "commands"
+ REGISTRAR_DIR = ".bob/commands"
+ CONTEXT_FILE = "AGENTS.md"
diff --git a/tests/integrations/test_integration_claude.py b/tests/integrations/test_integration_claude.py
new file mode 100644
index 000000000..6867a295e
--- /dev/null
+++ b/tests/integrations/test_integration_claude.py
@@ -0,0 +1,11 @@
+"""Tests for ClaudeIntegration."""
+
+from .test_integration_base_markdown import MarkdownIntegrationTests
+
+
+class TestClaudeIntegration(MarkdownIntegrationTests):
+ KEY = "claude"
+ FOLDER = ".claude/"
+ COMMANDS_SUBDIR = "commands"
+ REGISTRAR_DIR = ".claude/commands"
+ CONTEXT_FILE = "CLAUDE.md"
diff --git a/tests/integrations/test_integration_codebuddy.py b/tests/integrations/test_integration_codebuddy.py
new file mode 100644
index 000000000..dcc2153a7
--- /dev/null
+++ b/tests/integrations/test_integration_codebuddy.py
@@ -0,0 +1,11 @@
+"""Tests for CodebuddyIntegration."""
+
+from .test_integration_base_markdown import MarkdownIntegrationTests
+
+
+class TestCodebuddyIntegration(MarkdownIntegrationTests):
+ KEY = "codebuddy"
+ FOLDER = ".codebuddy/"
+ COMMANDS_SUBDIR = "commands"
+ REGISTRAR_DIR = ".codebuddy/commands"
+ CONTEXT_FILE = "CODEBUDDY.md"
diff --git a/tests/integrations/test_integration_copilot.py b/tests/integrations/test_integration_copilot.py
new file mode 100644
index 000000000..5db0155bd
--- /dev/null
+++ b/tests/integrations/test_integration_copilot.py
@@ -0,0 +1,266 @@
+"""Tests for CopilotIntegration."""
+
+import json
+import os
+
+from specify_cli.integrations import get_integration
+from specify_cli.integrations.manifest import IntegrationManifest
+
+
+class TestCopilotIntegration:
+ def test_copilot_key_and_config(self):
+ copilot = get_integration("copilot")
+ assert copilot is not None
+ assert copilot.key == "copilot"
+ assert copilot.config["folder"] == ".github/"
+ assert copilot.config["commands_subdir"] == "agents"
+ assert copilot.registrar_config["extension"] == ".agent.md"
+ assert copilot.context_file == ".github/copilot-instructions.md"
+
+ def test_command_filename_agent_md(self):
+ copilot = get_integration("copilot")
+ assert copilot.command_filename("plan") == "speckit.plan.agent.md"
+
+ def test_setup_creates_agent_md_files(self, tmp_path):
+ from specify_cli.integrations.copilot import CopilotIntegration
+ copilot = CopilotIntegration()
+ m = IntegrationManifest("copilot", tmp_path)
+ created = copilot.setup(tmp_path, m)
+ assert len(created) > 0
+ agent_files = [f for f in created if ".agent." in f.name]
+ assert len(agent_files) > 0
+ for f in agent_files:
+ assert f.parent == tmp_path / ".github" / "agents"
+ assert f.name.endswith(".agent.md")
+
+ def test_setup_creates_companion_prompts(self, tmp_path):
+ from specify_cli.integrations.copilot import CopilotIntegration
+ copilot = CopilotIntegration()
+ m = IntegrationManifest("copilot", tmp_path)
+ created = copilot.setup(tmp_path, m)
+ prompt_files = [f for f in created if f.parent.name == "prompts"]
+ assert len(prompt_files) > 0
+ for f in prompt_files:
+ assert f.name.endswith(".prompt.md")
+ content = f.read_text(encoding="utf-8")
+ assert content.startswith("---\nagent: speckit.")
+
+ def test_agent_and_prompt_counts_match(self, tmp_path):
+ from specify_cli.integrations.copilot import CopilotIntegration
+ copilot = CopilotIntegration()
+ m = IntegrationManifest("copilot", tmp_path)
+ created = copilot.setup(tmp_path, m)
+ agents = [f for f in created if ".agent.md" in f.name]
+ prompts = [f for f in created if ".prompt.md" in f.name]
+ assert len(agents) == len(prompts)
+
+ def test_setup_creates_vscode_settings_new(self, tmp_path):
+ from specify_cli.integrations.copilot import CopilotIntegration
+ copilot = CopilotIntegration()
+ assert copilot._vscode_settings_path() is not None
+ m = IntegrationManifest("copilot", tmp_path)
+ created = copilot.setup(tmp_path, m)
+ settings = tmp_path / ".vscode" / "settings.json"
+ assert settings.exists()
+ assert settings in created
+ assert any("settings.json" in k for k in m.files)
+
+ def test_setup_merges_existing_vscode_settings(self, tmp_path):
+ from specify_cli.integrations.copilot import CopilotIntegration
+ copilot = CopilotIntegration()
+ vscode_dir = tmp_path / ".vscode"
+ vscode_dir.mkdir(parents=True)
+ existing = {"editor.fontSize": 14, "custom.setting": True}
+ (vscode_dir / "settings.json").write_text(json.dumps(existing, indent=4), encoding="utf-8")
+ m = IntegrationManifest("copilot", tmp_path)
+ created = copilot.setup(tmp_path, m)
+ settings = tmp_path / ".vscode" / "settings.json"
+ data = json.loads(settings.read_text(encoding="utf-8"))
+ assert data["editor.fontSize"] == 14
+ assert data["custom.setting"] is True
+ assert settings not in created
+ assert not any("settings.json" in k for k in m.files)
+
+ def test_all_created_files_tracked_in_manifest(self, tmp_path):
+ from specify_cli.integrations.copilot import CopilotIntegration
+ copilot = CopilotIntegration()
+ m = IntegrationManifest("copilot", tmp_path)
+ created = copilot.setup(tmp_path, m)
+ for f in created:
+ rel = f.resolve().relative_to(tmp_path.resolve()).as_posix()
+ assert rel in m.files, f"Created file {rel} not tracked in manifest"
+
+ def test_install_uninstall_roundtrip(self, tmp_path):
+ from specify_cli.integrations.copilot import CopilotIntegration
+ copilot = CopilotIntegration()
+ m = IntegrationManifest("copilot", tmp_path)
+ created = copilot.install(tmp_path, m)
+ assert len(created) > 0
+ m.save()
+ for f in created:
+ assert f.exists()
+ removed, skipped = copilot.uninstall(tmp_path, m)
+ assert len(removed) == len(created)
+ assert skipped == []
+
+ def test_modified_file_survives_uninstall(self, tmp_path):
+ from specify_cli.integrations.copilot import CopilotIntegration
+ copilot = CopilotIntegration()
+ m = IntegrationManifest("copilot", tmp_path)
+ created = copilot.install(tmp_path, m)
+ m.save()
+ modified_file = created[0]
+ modified_file.write_text("user modified this", encoding="utf-8")
+ removed, skipped = copilot.uninstall(tmp_path, m)
+ assert modified_file.exists()
+ assert modified_file in skipped
+
+ def test_directory_structure(self, tmp_path):
+ from specify_cli.integrations.copilot import CopilotIntegration
+ copilot = CopilotIntegration()
+ m = IntegrationManifest("copilot", tmp_path)
+ copilot.setup(tmp_path, m)
+ agents_dir = tmp_path / ".github" / "agents"
+ assert agents_dir.is_dir()
+ agent_files = sorted(agents_dir.glob("speckit.*.agent.md"))
+ assert len(agent_files) == 9
+ expected_commands = {
+ "analyze", "checklist", "clarify", "constitution",
+ "implement", "plan", "specify", "tasks", "taskstoissues",
+ }
+ actual_commands = {f.name.removeprefix("speckit.").removesuffix(".agent.md") for f in agent_files}
+ assert actual_commands == expected_commands
+
+ def test_templates_are_processed(self, tmp_path):
+ from specify_cli.integrations.copilot import CopilotIntegration
+ copilot = CopilotIntegration()
+ m = IntegrationManifest("copilot", tmp_path)
+ copilot.setup(tmp_path, m)
+ agents_dir = tmp_path / ".github" / "agents"
+ for agent_file in agents_dir.glob("speckit.*.agent.md"):
+ content = agent_file.read_text(encoding="utf-8")
+ assert "{SCRIPT}" not in content, f"{agent_file.name} has unprocessed {{SCRIPT}}"
+ assert "__AGENT__" not in content, f"{agent_file.name} has unprocessed __AGENT__"
+ assert "{ARGS}" not in content, f"{agent_file.name} has unprocessed {{ARGS}}"
+ assert "\nscripts:\n" not in content
+ assert "\nagent_scripts:\n" not in content
+
+ def test_complete_file_inventory_sh(self, tmp_path):
+ """Every file produced by specify init --integration copilot --script sh."""
+ from typer.testing import CliRunner
+ from specify_cli import app
+ project = tmp_path / "inventory-sh"
+ project.mkdir()
+ old_cwd = os.getcwd()
+ try:
+ os.chdir(project)
+ result = CliRunner().invoke(app, [
+ "init", "--here", "--integration", "copilot", "--script", "sh", "--no-git",
+ ], catch_exceptions=False)
+ finally:
+ os.chdir(old_cwd)
+ assert result.exit_code == 0
+ actual = sorted(p.relative_to(project).as_posix() for p in project.rglob("*") if p.is_file())
+ expected = sorted([
+ ".github/agents/speckit.analyze.agent.md",
+ ".github/agents/speckit.checklist.agent.md",
+ ".github/agents/speckit.clarify.agent.md",
+ ".github/agents/speckit.constitution.agent.md",
+ ".github/agents/speckit.implement.agent.md",
+ ".github/agents/speckit.plan.agent.md",
+ ".github/agents/speckit.specify.agent.md",
+ ".github/agents/speckit.tasks.agent.md",
+ ".github/agents/speckit.taskstoissues.agent.md",
+ ".github/prompts/speckit.analyze.prompt.md",
+ ".github/prompts/speckit.checklist.prompt.md",
+ ".github/prompts/speckit.clarify.prompt.md",
+ ".github/prompts/speckit.constitution.prompt.md",
+ ".github/prompts/speckit.implement.prompt.md",
+ ".github/prompts/speckit.plan.prompt.md",
+ ".github/prompts/speckit.specify.prompt.md",
+ ".github/prompts/speckit.tasks.prompt.md",
+ ".github/prompts/speckit.taskstoissues.prompt.md",
+ ".vscode/settings.json",
+ ".specify/integration.json",
+ ".specify/init-options.json",
+ ".specify/integrations/copilot.manifest.json",
+ ".specify/integrations/speckit.manifest.json",
+ ".specify/integrations/copilot/scripts/update-context.ps1",
+ ".specify/integrations/copilot/scripts/update-context.sh",
+ ".specify/scripts/bash/check-prerequisites.sh",
+ ".specify/scripts/bash/common.sh",
+ ".specify/scripts/bash/create-new-feature.sh",
+ ".specify/scripts/bash/setup-plan.sh",
+ ".specify/scripts/bash/update-agent-context.sh",
+ ".specify/templates/agent-file-template.md",
+ ".specify/templates/checklist-template.md",
+ ".specify/templates/constitution-template.md",
+ ".specify/templates/plan-template.md",
+ ".specify/templates/spec-template.md",
+ ".specify/templates/tasks-template.md",
+ ".specify/memory/constitution.md",
+ ])
+ assert actual == expected, (
+ f"Missing: {sorted(set(expected) - set(actual))}\n"
+ f"Extra: {sorted(set(actual) - set(expected))}"
+ )
+
+ def test_complete_file_inventory_ps(self, tmp_path):
+ """Every file produced by specify init --integration copilot --script ps."""
+ from typer.testing import CliRunner
+ from specify_cli import app
+ project = tmp_path / "inventory-ps"
+ project.mkdir()
+ old_cwd = os.getcwd()
+ try:
+ os.chdir(project)
+ result = CliRunner().invoke(app, [
+ "init", "--here", "--integration", "copilot", "--script", "ps", "--no-git",
+ ], catch_exceptions=False)
+ finally:
+ os.chdir(old_cwd)
+ assert result.exit_code == 0
+ actual = sorted(p.relative_to(project).as_posix() for p in project.rglob("*") if p.is_file())
+ expected = sorted([
+ ".github/agents/speckit.analyze.agent.md",
+ ".github/agents/speckit.checklist.agent.md",
+ ".github/agents/speckit.clarify.agent.md",
+ ".github/agents/speckit.constitution.agent.md",
+ ".github/agents/speckit.implement.agent.md",
+ ".github/agents/speckit.plan.agent.md",
+ ".github/agents/speckit.specify.agent.md",
+ ".github/agents/speckit.tasks.agent.md",
+ ".github/agents/speckit.taskstoissues.agent.md",
+ ".github/prompts/speckit.analyze.prompt.md",
+ ".github/prompts/speckit.checklist.prompt.md",
+ ".github/prompts/speckit.clarify.prompt.md",
+ ".github/prompts/speckit.constitution.prompt.md",
+ ".github/prompts/speckit.implement.prompt.md",
+ ".github/prompts/speckit.plan.prompt.md",
+ ".github/prompts/speckit.specify.prompt.md",
+ ".github/prompts/speckit.tasks.prompt.md",
+ ".github/prompts/speckit.taskstoissues.prompt.md",
+ ".vscode/settings.json",
+ ".specify/integration.json",
+ ".specify/init-options.json",
+ ".specify/integrations/copilot.manifest.json",
+ ".specify/integrations/speckit.manifest.json",
+ ".specify/integrations/copilot/scripts/update-context.ps1",
+ ".specify/integrations/copilot/scripts/update-context.sh",
+ ".specify/scripts/powershell/check-prerequisites.ps1",
+ ".specify/scripts/powershell/common.ps1",
+ ".specify/scripts/powershell/create-new-feature.ps1",
+ ".specify/scripts/powershell/setup-plan.ps1",
+ ".specify/scripts/powershell/update-agent-context.ps1",
+ ".specify/templates/agent-file-template.md",
+ ".specify/templates/checklist-template.md",
+ ".specify/templates/constitution-template.md",
+ ".specify/templates/plan-template.md",
+ ".specify/templates/spec-template.md",
+ ".specify/templates/tasks-template.md",
+ ".specify/memory/constitution.md",
+ ])
+ assert actual == expected, (
+ f"Missing: {sorted(set(expected) - set(actual))}\n"
+ f"Extra: {sorted(set(actual) - set(expected))}"
+ )
diff --git a/tests/integrations/test_integration_cursor_agent.py b/tests/integrations/test_integration_cursor_agent.py
new file mode 100644
index 000000000..71b7db1c9
--- /dev/null
+++ b/tests/integrations/test_integration_cursor_agent.py
@@ -0,0 +1,11 @@
+"""Tests for CursorAgentIntegration."""
+
+from .test_integration_base_markdown import MarkdownIntegrationTests
+
+
+class TestCursorAgentIntegration(MarkdownIntegrationTests):
+ KEY = "cursor-agent"
+ FOLDER = ".cursor/"
+ COMMANDS_SUBDIR = "commands"
+ REGISTRAR_DIR = ".cursor/commands"
+ CONTEXT_FILE = ".cursor/rules/specify-rules.mdc"
diff --git a/tests/integrations/test_integration_iflow.py b/tests/integrations/test_integration_iflow.py
new file mode 100644
index 000000000..ea2f5ef97
--- /dev/null
+++ b/tests/integrations/test_integration_iflow.py
@@ -0,0 +1,11 @@
+"""Tests for IflowIntegration."""
+
+from .test_integration_base_markdown import MarkdownIntegrationTests
+
+
+class TestIflowIntegration(MarkdownIntegrationTests):
+ KEY = "iflow"
+ FOLDER = ".iflow/"
+ COMMANDS_SUBDIR = "commands"
+ REGISTRAR_DIR = ".iflow/commands"
+ CONTEXT_FILE = "IFLOW.md"
diff --git a/tests/integrations/test_integration_junie.py b/tests/integrations/test_integration_junie.py
new file mode 100644
index 000000000..2b924ce43
--- /dev/null
+++ b/tests/integrations/test_integration_junie.py
@@ -0,0 +1,11 @@
+"""Tests for JunieIntegration."""
+
+from .test_integration_base_markdown import MarkdownIntegrationTests
+
+
+class TestJunieIntegration(MarkdownIntegrationTests):
+ KEY = "junie"
+ FOLDER = ".junie/"
+ COMMANDS_SUBDIR = "commands"
+ REGISTRAR_DIR = ".junie/commands"
+ CONTEXT_FILE = ".junie/AGENTS.md"
diff --git a/tests/integrations/test_integration_kilocode.py b/tests/integrations/test_integration_kilocode.py
new file mode 100644
index 000000000..8e441c083
--- /dev/null
+++ b/tests/integrations/test_integration_kilocode.py
@@ -0,0 +1,11 @@
+"""Tests for KilocodeIntegration."""
+
+from .test_integration_base_markdown import MarkdownIntegrationTests
+
+
+class TestKilocodeIntegration(MarkdownIntegrationTests):
+ KEY = "kilocode"
+ FOLDER = ".kilocode/"
+ COMMANDS_SUBDIR = "workflows"
+ REGISTRAR_DIR = ".kilocode/workflows"
+ CONTEXT_FILE = ".kilocode/rules/specify-rules.md"
diff --git a/tests/integrations/test_integration_kiro_cli.py b/tests/integrations/test_integration_kiro_cli.py
new file mode 100644
index 000000000..d6ae7afce
--- /dev/null
+++ b/tests/integrations/test_integration_kiro_cli.py
@@ -0,0 +1,11 @@
+"""Tests for KiroCliIntegration."""
+
+from .test_integration_base_markdown import MarkdownIntegrationTests
+
+
+class TestKiroCliIntegration(MarkdownIntegrationTests):
+ KEY = "kiro-cli"
+ FOLDER = ".kiro/"
+ COMMANDS_SUBDIR = "prompts"
+ REGISTRAR_DIR = ".kiro/prompts"
+ CONTEXT_FILE = "AGENTS.md"
diff --git a/tests/integrations/test_integration_opencode.py b/tests/integrations/test_integration_opencode.py
new file mode 100644
index 000000000..4f3aee5d9
--- /dev/null
+++ b/tests/integrations/test_integration_opencode.py
@@ -0,0 +1,11 @@
+"""Tests for OpencodeIntegration."""
+
+from .test_integration_base_markdown import MarkdownIntegrationTests
+
+
+class TestOpencodeIntegration(MarkdownIntegrationTests):
+ KEY = "opencode"
+ FOLDER = ".opencode/"
+ COMMANDS_SUBDIR = "command"
+ REGISTRAR_DIR = ".opencode/command"
+ CONTEXT_FILE = "AGENTS.md"
diff --git a/tests/integrations/test_integration_pi.py b/tests/integrations/test_integration_pi.py
new file mode 100644
index 000000000..5ac567650
--- /dev/null
+++ b/tests/integrations/test_integration_pi.py
@@ -0,0 +1,11 @@
+"""Tests for PiIntegration."""
+
+from .test_integration_base_markdown import MarkdownIntegrationTests
+
+
+class TestPiIntegration(MarkdownIntegrationTests):
+ KEY = "pi"
+ FOLDER = ".pi/"
+ COMMANDS_SUBDIR = "prompts"
+ REGISTRAR_DIR = ".pi/prompts"
+ CONTEXT_FILE = "AGENTS.md"
diff --git a/tests/integrations/test_integration_qodercli.py b/tests/integrations/test_integration_qodercli.py
new file mode 100644
index 000000000..1dbee480a
--- /dev/null
+++ b/tests/integrations/test_integration_qodercli.py
@@ -0,0 +1,11 @@
+"""Tests for QodercliIntegration."""
+
+from .test_integration_base_markdown import MarkdownIntegrationTests
+
+
+class TestQodercliIntegration(MarkdownIntegrationTests):
+ KEY = "qodercli"
+ FOLDER = ".qoder/"
+ COMMANDS_SUBDIR = "commands"
+ REGISTRAR_DIR = ".qoder/commands"
+ CONTEXT_FILE = "QODER.md"
diff --git a/tests/integrations/test_integration_qwen.py b/tests/integrations/test_integration_qwen.py
new file mode 100644
index 000000000..10a3c083f
--- /dev/null
+++ b/tests/integrations/test_integration_qwen.py
@@ -0,0 +1,11 @@
+"""Tests for QwenIntegration."""
+
+from .test_integration_base_markdown import MarkdownIntegrationTests
+
+
+class TestQwenIntegration(MarkdownIntegrationTests):
+ KEY = "qwen"
+ FOLDER = ".qwen/"
+ COMMANDS_SUBDIR = "commands"
+ REGISTRAR_DIR = ".qwen/commands"
+ CONTEXT_FILE = "QWEN.md"
diff --git a/tests/integrations/test_integration_roo.py b/tests/integrations/test_integration_roo.py
new file mode 100644
index 000000000..69d859c42
--- /dev/null
+++ b/tests/integrations/test_integration_roo.py
@@ -0,0 +1,11 @@
+"""Tests for RooIntegration."""
+
+from .test_integration_base_markdown import MarkdownIntegrationTests
+
+
+class TestRooIntegration(MarkdownIntegrationTests):
+ KEY = "roo"
+ FOLDER = ".roo/"
+ COMMANDS_SUBDIR = "commands"
+ REGISTRAR_DIR = ".roo/commands"
+ CONTEXT_FILE = ".roo/rules/specify-rules.md"
diff --git a/tests/integrations/test_integration_shai.py b/tests/integrations/test_integration_shai.py
new file mode 100644
index 000000000..74f93396b
--- /dev/null
+++ b/tests/integrations/test_integration_shai.py
@@ -0,0 +1,11 @@
+"""Tests for ShaiIntegration."""
+
+from .test_integration_base_markdown import MarkdownIntegrationTests
+
+
+class TestShaiIntegration(MarkdownIntegrationTests):
+ KEY = "shai"
+ FOLDER = ".shai/"
+ COMMANDS_SUBDIR = "commands"
+ REGISTRAR_DIR = ".shai/commands"
+ CONTEXT_FILE = "SHAI.md"
diff --git a/tests/integrations/test_integration_trae.py b/tests/integrations/test_integration_trae.py
new file mode 100644
index 000000000..307c3481d
--- /dev/null
+++ b/tests/integrations/test_integration_trae.py
@@ -0,0 +1,11 @@
+"""Tests for TraeIntegration."""
+
+from .test_integration_base_markdown import MarkdownIntegrationTests
+
+
+class TestTraeIntegration(MarkdownIntegrationTests):
+ KEY = "trae"
+ FOLDER = ".trae/"
+ COMMANDS_SUBDIR = "rules"
+ REGISTRAR_DIR = ".trae/rules"
+ CONTEXT_FILE = ".trae/rules/AGENTS.md"
diff --git a/tests/integrations/test_integration_vibe.py b/tests/integrations/test_integration_vibe.py
new file mode 100644
index 000000000..ea6dc85a8
--- /dev/null
+++ b/tests/integrations/test_integration_vibe.py
@@ -0,0 +1,11 @@
+"""Tests for VibeIntegration."""
+
+from .test_integration_base_markdown import MarkdownIntegrationTests
+
+
+class TestVibeIntegration(MarkdownIntegrationTests):
+ KEY = "vibe"
+ FOLDER = ".vibe/"
+ COMMANDS_SUBDIR = "prompts"
+ REGISTRAR_DIR = ".vibe/prompts"
+ CONTEXT_FILE = ".vibe/agents/specify-agents.md"
diff --git a/tests/integrations/test_integration_windsurf.py b/tests/integrations/test_integration_windsurf.py
new file mode 100644
index 000000000..fa8d1e622
--- /dev/null
+++ b/tests/integrations/test_integration_windsurf.py
@@ -0,0 +1,11 @@
+"""Tests for WindsurfIntegration."""
+
+from .test_integration_base_markdown import MarkdownIntegrationTests
+
+
+class TestWindsurfIntegration(MarkdownIntegrationTests):
+ KEY = "windsurf"
+ FOLDER = ".windsurf/"
+ COMMANDS_SUBDIR = "workflows"
+ REGISTRAR_DIR = ".windsurf/workflows"
+ CONTEXT_FILE = ".windsurf/rules/specify-rules.md"
diff --git a/tests/integrations/test_manifest.py b/tests/integrations/test_manifest.py
new file mode 100644
index 000000000..b5d5bc39f
--- /dev/null
+++ b/tests/integrations/test_manifest.py
@@ -0,0 +1,245 @@
+"""Tests for IntegrationManifest β record, hash, save, load, uninstall, modified detection."""
+
+import hashlib
+import json
+
+import pytest
+
+from specify_cli.integrations.manifest import IntegrationManifest, _sha256
+
+
+class TestManifestRecordFile:
+ def test_record_file_writes_and_hashes(self, tmp_path):
+ m = IntegrationManifest("test", tmp_path)
+ content = "hello world"
+ abs_path = m.record_file("a/b.txt", content)
+ assert abs_path == tmp_path / "a" / "b.txt"
+ assert abs_path.read_text(encoding="utf-8") == content
+ expected_hash = hashlib.sha256(content.encode()).hexdigest()
+ assert m.files["a/b.txt"] == expected_hash
+
+ def test_record_file_bytes(self, tmp_path):
+ m = IntegrationManifest("test", tmp_path)
+ data = b"\x00\x01\x02"
+ abs_path = m.record_file("bin.dat", data)
+ assert abs_path.read_bytes() == data
+ assert m.files["bin.dat"] == hashlib.sha256(data).hexdigest()
+
+ def test_record_existing(self, tmp_path):
+ f = tmp_path / "existing.txt"
+ f.write_text("content", encoding="utf-8")
+ m = IntegrationManifest("test", tmp_path)
+ m.record_existing("existing.txt")
+ assert m.files["existing.txt"] == _sha256(f)
+
+
+class TestManifestPathTraversal:
+ def test_record_file_rejects_parent_traversal(self, tmp_path):
+ m = IntegrationManifest("test", tmp_path)
+ with pytest.raises(ValueError, match="outside"):
+ m.record_file("../escape.txt", "bad")
+
+ def test_record_file_rejects_absolute_path(self, tmp_path):
+ m = IntegrationManifest("test", tmp_path)
+ with pytest.raises(ValueError, match="Absolute paths"):
+ m.record_file("/tmp/escape.txt", "bad")
+
+ def test_record_existing_rejects_parent_traversal(self, tmp_path):
+ escape = tmp_path.parent / "escape.txt"
+ escape.write_text("evil", encoding="utf-8")
+ try:
+ m = IntegrationManifest("test", tmp_path)
+ with pytest.raises(ValueError, match="outside"):
+ m.record_existing("../escape.txt")
+ finally:
+ escape.unlink(missing_ok=True)
+
+ def test_uninstall_skips_traversal_paths(self, tmp_path):
+ m = IntegrationManifest("test", tmp_path)
+ m.record_file("safe.txt", "good")
+ m._files["../outside.txt"] = "fakehash"
+ m.save()
+ removed, skipped = m.uninstall()
+ assert len(removed) == 1
+ assert removed[0].name == "safe.txt"
+
+
+class TestManifestCheckModified:
+ def test_unmodified_file(self, tmp_path):
+ m = IntegrationManifest("test", tmp_path)
+ m.record_file("f.txt", "original")
+ assert m.check_modified() == []
+
+ def test_modified_file(self, tmp_path):
+ m = IntegrationManifest("test", tmp_path)
+ m.record_file("f.txt", "original")
+ (tmp_path / "f.txt").write_text("changed", encoding="utf-8")
+ assert m.check_modified() == ["f.txt"]
+
+ def test_deleted_file_not_reported(self, tmp_path):
+ m = IntegrationManifest("test", tmp_path)
+ m.record_file("f.txt", "original")
+ (tmp_path / "f.txt").unlink()
+ assert m.check_modified() == []
+
+ def test_symlink_treated_as_modified(self, tmp_path):
+ m = IntegrationManifest("test", tmp_path)
+ m.record_file("f.txt", "original")
+ target = tmp_path / "target.txt"
+ target.write_text("target", encoding="utf-8")
+ (tmp_path / "f.txt").unlink()
+ (tmp_path / "f.txt").symlink_to(target)
+ assert m.check_modified() == ["f.txt"]
+
+
+class TestManifestUninstall:
+ def test_removes_unmodified(self, tmp_path):
+ m = IntegrationManifest("test", tmp_path)
+ m.record_file("d/f.txt", "content")
+ m.save()
+ removed, skipped = m.uninstall()
+ assert len(removed) == 1
+ assert not (tmp_path / "d" / "f.txt").exists()
+ assert not (tmp_path / "d").exists()
+ assert skipped == []
+
+ def test_skips_modified(self, tmp_path):
+ m = IntegrationManifest("test", tmp_path)
+ m.record_file("f.txt", "original")
+ m.save()
+ (tmp_path / "f.txt").write_text("modified", encoding="utf-8")
+ removed, skipped = m.uninstall()
+ assert removed == []
+ assert len(skipped) == 1
+ assert (tmp_path / "f.txt").exists()
+
+ def test_force_removes_modified(self, tmp_path):
+ m = IntegrationManifest("test", tmp_path)
+ m.record_file("f.txt", "original")
+ m.save()
+ (tmp_path / "f.txt").write_text("modified", encoding="utf-8")
+ removed, skipped = m.uninstall(force=True)
+ assert len(removed) == 1
+ assert skipped == []
+
+ def test_already_deleted_file(self, tmp_path):
+ m = IntegrationManifest("test", tmp_path)
+ m.record_file("f.txt", "content")
+ m.save()
+ (tmp_path / "f.txt").unlink()
+ removed, skipped = m.uninstall()
+ assert removed == []
+ assert skipped == []
+
+ def test_removes_manifest_file(self, tmp_path):
+ m = IntegrationManifest("test", tmp_path, version="1.0")
+ m.record_file("f.txt", "content")
+ m.save()
+ assert m.manifest_path.exists()
+ m.uninstall()
+ assert not m.manifest_path.exists()
+
+ def test_cleans_empty_parent_dirs(self, tmp_path):
+ m = IntegrationManifest("test", tmp_path)
+ m.record_file("a/b/c/f.txt", "content")
+ m.save()
+ m.uninstall()
+ assert not (tmp_path / "a").exists()
+
+ def test_preserves_nonempty_parent_dirs(self, tmp_path):
+ m = IntegrationManifest("test", tmp_path)
+ m.record_file("a/b/tracked.txt", "content")
+ (tmp_path / "a" / "b" / "other.txt").write_text("keep", encoding="utf-8")
+ m.save()
+ m.uninstall()
+ assert not (tmp_path / "a" / "b" / "tracked.txt").exists()
+ assert (tmp_path / "a" / "b" / "other.txt").exists()
+
+ def test_symlink_skipped_without_force(self, tmp_path):
+ m = IntegrationManifest("test", tmp_path)
+ m.record_file("f.txt", "original")
+ m.save()
+ target = tmp_path / "target.txt"
+ target.write_text("target", encoding="utf-8")
+ (tmp_path / "f.txt").unlink()
+ (tmp_path / "f.txt").symlink_to(target)
+ removed, skipped = m.uninstall()
+ assert removed == []
+ assert len(skipped) == 1
+
+ def test_symlink_removed_with_force(self, tmp_path):
+ m = IntegrationManifest("test", tmp_path)
+ m.record_file("f.txt", "original")
+ m.save()
+ target = tmp_path / "target.txt"
+ target.write_text("target", encoding="utf-8")
+ (tmp_path / "f.txt").unlink()
+ (tmp_path / "f.txt").symlink_to(target)
+ removed, skipped = m.uninstall(force=True)
+ assert len(removed) == 1
+ assert target.exists()
+
+
+class TestManifestPersistence:
+ def test_save_and_load_roundtrip(self, tmp_path):
+ m = IntegrationManifest("myagent", tmp_path, version="2.0.1")
+ m.record_file("dir/file.md", "# Hello")
+ m.save()
+ loaded = IntegrationManifest.load("myagent", tmp_path)
+ assert loaded.key == "myagent"
+ assert loaded.version == "2.0.1"
+ assert loaded.files == m.files
+
+ def test_manifest_path(self, tmp_path):
+ m = IntegrationManifest("copilot", tmp_path)
+ assert m.manifest_path == tmp_path / ".specify" / "integrations" / "copilot.manifest.json"
+
+ def test_load_missing_raises(self, tmp_path):
+ with pytest.raises(FileNotFoundError):
+ IntegrationManifest.load("nonexistent", tmp_path)
+
+ def test_save_creates_directories(self, tmp_path):
+ m = IntegrationManifest("test", tmp_path)
+ m.record_file("f.txt", "content")
+ path = m.save()
+ assert path.exists()
+ data = json.loads(path.read_text(encoding="utf-8"))
+ assert data["integration"] == "test"
+
+ def test_save_preserves_installed_at(self, tmp_path):
+ m = IntegrationManifest("test", tmp_path)
+ m.record_file("f.txt", "content")
+ m.save()
+ first_ts = m._installed_at
+ m.save()
+ assert m._installed_at == first_ts
+
+
+class TestManifestLoadValidation:
+ def test_load_non_dict_raises(self, tmp_path):
+ path = tmp_path / ".specify" / "integrations" / "bad.manifest.json"
+ path.parent.mkdir(parents=True)
+ path.write_text('"just a string"', encoding="utf-8")
+ with pytest.raises(ValueError, match="JSON object"):
+ IntegrationManifest.load("bad", tmp_path)
+
+ def test_load_bad_files_type_raises(self, tmp_path):
+ path = tmp_path / ".specify" / "integrations" / "bad.manifest.json"
+ path.parent.mkdir(parents=True)
+ path.write_text(json.dumps({"files": ["not", "a", "dict"]}), encoding="utf-8")
+ with pytest.raises(ValueError, match="mapping"):
+ IntegrationManifest.load("bad", tmp_path)
+
+ def test_load_bad_files_values_raises(self, tmp_path):
+ path = tmp_path / ".specify" / "integrations" / "bad.manifest.json"
+ path.parent.mkdir(parents=True)
+ path.write_text(json.dumps({"files": {"a.txt": 123}}), encoding="utf-8")
+ with pytest.raises(ValueError, match="mapping"):
+ IntegrationManifest.load("bad", tmp_path)
+
+ def test_load_invalid_json_raises(self, tmp_path):
+ path = tmp_path / ".specify" / "integrations" / "bad.manifest.json"
+ path.parent.mkdir(parents=True)
+ path.write_text("{not valid json", encoding="utf-8")
+ with pytest.raises(ValueError, match="invalid JSON"):
+ IntegrationManifest.load("bad", tmp_path)
diff --git a/tests/integrations/test_registry.py b/tests/integrations/test_registry.py
new file mode 100644
index 000000000..e70f3006a
--- /dev/null
+++ b/tests/integrations/test_registry.py
@@ -0,0 +1,76 @@
+"""Tests for INTEGRATION_REGISTRY β mechanics, completeness, and registrar alignment."""
+
+import pytest
+
+from specify_cli.integrations import (
+ INTEGRATION_REGISTRY,
+ _register,
+ get_integration,
+)
+from specify_cli.integrations.base import MarkdownIntegration
+from .conftest import StubIntegration
+
+
+# Every integration key that must be registered (Stage 2 + Stage 3).
+ALL_INTEGRATION_KEYS = [
+ "copilot",
+ # Stage 3 β standard markdown integrations
+ "claude", "qwen", "opencode", "junie", "kilocode", "auggie",
+ "roo", "codebuddy", "qodercli", "amp", "shai", "bob", "trae",
+ "pi", "iflow", "kiro-cli", "windsurf", "vibe", "cursor-agent",
+]
+
+
+class TestRegistry:
+ def test_registry_is_dict(self):
+ assert isinstance(INTEGRATION_REGISTRY, dict)
+
+ def test_register_and_get(self):
+ stub = StubIntegration()
+ _register(stub)
+ try:
+ assert get_integration("stub") is stub
+ finally:
+ INTEGRATION_REGISTRY.pop("stub", None)
+
+ def test_get_missing_returns_none(self):
+ assert get_integration("nonexistent-xyz") is None
+
+ def test_register_empty_key_raises(self):
+ class EmptyKey(MarkdownIntegration):
+ key = ""
+ with pytest.raises(ValueError, match="empty key"):
+ _register(EmptyKey())
+
+ def test_register_duplicate_raises(self):
+ stub = StubIntegration()
+ _register(stub)
+ try:
+ with pytest.raises(KeyError, match="already registered"):
+ _register(StubIntegration())
+ finally:
+ INTEGRATION_REGISTRY.pop("stub", None)
+
+
+class TestRegistryCompleteness:
+ """Every expected integration must be registered."""
+
+ @pytest.mark.parametrize("key", ALL_INTEGRATION_KEYS)
+ def test_key_registered(self, key):
+ assert key in INTEGRATION_REGISTRY, f"{key} missing from registry"
+
+
+class TestRegistrarKeyAlignment:
+ """Every integration key must have a matching AGENT_CONFIGS entry."""
+
+ @pytest.mark.parametrize("key", ALL_INTEGRATION_KEYS)
+ def test_integration_key_in_registrar(self, key):
+ from specify_cli.agents import CommandRegistrar
+ assert key in CommandRegistrar.AGENT_CONFIGS, (
+ f"Integration '{key}' is registered but has no AGENT_CONFIGS entry"
+ )
+
+ def test_no_stale_cursor_shorthand(self):
+ """The old 'cursor' shorthand must not appear in AGENT_CONFIGS."""
+ from specify_cli.agents import CommandRegistrar
+ assert "cursor" not in CommandRegistrar.AGENT_CONFIGS
diff --git a/tests/test_ai_skills.py b/tests/test_ai_skills.py
index f0e220e26..7f9ecf66a 100644
--- a/tests/test_ai_skills.py
+++ b/tests/test_ai_skills.py
@@ -1237,24 +1237,22 @@ class TestCliValidation:
assert "agent skills" in plain.lower()
def test_kiro_alias_normalized_to_kiro_cli(self, tmp_path):
- """--ai kiro should normalize to canonical kiro-cli agent key."""
+ """--ai kiro should normalize to canonical kiro-cli and auto-promote to integration path."""
+ import os
from typer.testing import CliRunner
runner = CliRunner()
target = tmp_path / "kiro-alias-proj"
+ target.mkdir()
- with patch("specify_cli.download_and_extract_template") as mock_download, \
- patch("specify_cli.scaffold_from_core_pack", create=True) as mock_scaffold, \
- patch("specify_cli.ensure_executable_scripts"), \
- patch("specify_cli.ensure_constitution_from_template"), \
- patch("specify_cli.is_git_repo", return_value=False), \
- patch("specify_cli.shutil.which", return_value="/usr/bin/git"):
- mock_scaffold.return_value = True
+ old_cwd = os.getcwd()
+ try:
+ os.chdir(target)
result = runner.invoke(
app,
[
"init",
- str(target),
+ "--here",
"--ai",
"kiro",
"--ignore-agent-tools",
@@ -1262,17 +1260,16 @@ class TestCliValidation:
"sh",
"--no-git",
],
+ catch_exceptions=False,
)
+ finally:
+ os.chdir(old_cwd)
assert result.exit_code == 0
- # Without --offline, the download path should be taken.
- assert mock_download.called, (
- "Expected download_and_extract_template to be called (default non-offline path)"
- )
- assert mock_download.call_args.args[1] == "kiro-cli"
- assert not mock_scaffold.called, (
- "scaffold_from_core_pack should not be called without --offline"
- )
+ # kiro alias should auto-promote to integration path with nudge
+ assert "--integration kiro-cli" in result.output
+ # Command files should be created via integration path
+ assert (target / ".kiro" / "prompts" / "speckit.plan.md").exists()
def test_q_removed_from_agent_config(self):
"""Amazon Q legacy key should not remain in AGENT_CONFIG."""
diff --git a/tests/test_extensions.py b/tests/test_extensions.py
index 64b38547d..a5ee4e03a 100644
--- a/tests/test_extensions.py
+++ b/tests/test_extensions.py
@@ -981,7 +981,7 @@ $ARGUMENTS
"Run scripts/bash/setup-plan.sh\n"
)
- rewritten = AgentCommandRegistrar._rewrite_project_relative_paths(body)
+ rewritten = AgentCommandRegistrar.rewrite_project_relative_paths(body)
assert ".specify/extensions/test-ext/templates/spec.md" in rewritten
assert ".specify/scripts/bash/setup-plan.sh" in rewritten