diff --git a/.claude/CHANGELOG.md b/.claude/CHANGELOG.md index ab2e544..b36f614 100644 --- a/.claude/CHANGELOG.md +++ b/.claude/CHANGELOG.md @@ -5,6 +5,28 @@ Each entry: **what** changed, **why** it was needed, **files** touched. --- +## 2026-05-25 — v0.6.1 — OpenSpec (spec-driven development CLI) + +**What** +- `lib/plugins.sh` — new `install_openspec()` (npm-global install of `@fission-ai/openspec`). +- `profiles/cli-bundle/09-plugins.sh` — `INSTALL_OPENSPEC=true` block, installs OpenSpec + appends `OPENSPEC_TELEMETRY=0` to `~/.bashrc` (default off; opt-in by setting `OPENSPEC_TELEMETRY=1`). +- `profiles/cli-bundle/.env.example` — `INSTALL_OPENSPEC`, `OPENSPEC_VERSION`, `OPENSPEC_TELEMETRY`. +- `profiles/cli-bundle/README.md` — OpenSpec section with `openspec init` + `/opsx:*` usage. +- `tests/test_plugins.bats` — 2 new tests (missing-npm error path; correct npm-install dispatch with PATH-isolated stub). + +**Why** +- OpenSpec is universal — any AI CLI (Claude, Codex, Cursor, OpenCode, Antigravity) can invoke it via the `/opsx:*` slash commands once a project has run `openspec init`. No per-CLI binding needed. +- Single npm-global install + telemetry-off default = same pattern already used for Codex/Claude CLIs. + +**Files** +- `lib/plugins.sh` (+ `install_openspec`) +- `profiles/cli-bundle/09-plugins.sh` (block) +- `profiles/cli-bundle/.env.example` (3 vars) +- `profiles/cli-bundle/README.md` (section) +- `tests/test_plugins.bats` (2 tests, total 31) + +--- + ## 2026-05-25 — v0.6.0 — Official plugins (Linear/Slack/etc) + headless browser as base tool **What** diff --git a/lib/plugins.sh b/lib/plugins.sh index 55b4c91..a13cc06 100644 --- a/lib/plugins.sh +++ b/lib/plugins.sh @@ -42,6 +42,20 @@ install_claude_plugin() { claude_headless "/reload-plugins" || true } +# Install OpenSpec — spec-driven development CLI. npm-global; works inside +# any AI assistant via /opsx:* slash commands (no per-CLI binding). +# Upstream: https://github.com/Fission-AI/OpenSpec +install_openspec() { + local version="${OPENSPEC_VERSION:-latest}" + if ! command -v npm >/dev/null 2>&1; then + echo "ERROR: npm not on PATH — OpenSpec requires Node.js." + return 1 + fi + echo "==> Installing @fission-ai/openspec@${version} globally" + npm install -g "@fission-ai/openspec@${version}" + openspec --version 2>/dev/null || true +} + # Install gstack into a target CLI's skills dir. # $1 = host name (claude, opencode, etc.) install_gstack_for() { diff --git a/profiles/cli-bundle/.env.example b/profiles/cli-bundle/.env.example index fafb02b..198ab8a 100644 --- a/profiles/cli-bundle/.env.example +++ b/profiles/cli-bundle/.env.example @@ -115,6 +115,14 @@ INSTALL_GSTACK=false # Space-separated list. Valid: claude opencode GSTACK_TARGETS=claude +# OpenSpec — spec-driven development. Universal (works in any AI CLI via +# /opsx:* slash commands once invoked from a project that ran `openspec init`). +# Upstream: https://github.com/Fission-AI/OpenSpec +INSTALL_OPENSPEC=false +OPENSPEC_VERSION=latest +# Telemetry off (industry standard). Set to 1 to opt in. +OPENSPEC_TELEMETRY=0 + # --- Official Anthropic marketplace plugins (Claude-only) --- # Bundle pre-configured MCP + skills + slash commands. Richer than the raw # MCP registrations in 06-mcp.sh — either can be used (or both). diff --git a/profiles/cli-bundle/09-plugins.sh b/profiles/cli-bundle/09-plugins.sh index 38e8523..d7c2936 100644 --- a/profiles/cli-bundle/09-plugins.sh +++ b/profiles/cli-bundle/09-plugins.sh @@ -94,6 +94,19 @@ if [[ "${INSTALL_SUPERPOWERS:-false}" == "true" ]]; then fi fi +# --- OpenSpec (universal: works in any AI CLI via slash commands) ---------- +if [[ "${INSTALL_OPENSPEC:-false}" == "true" ]]; then + install_openspec + # Telemetry off by default unless operator opts in. + if ! grep -q 'OPENSPEC_TELEMETRY' "$HOME/.bashrc" 2>/dev/null; then + cat >> "$HOME/.bashrc" < +# /opsx:plan +``` + ### Plugins oficiais da Anthropic (Claude only) Toggles separados pra cada plugin do marketplace `claude-plugins-official`: diff --git a/tests/test_plugins.bats b/tests/test_plugins.bats index 918d10e..c775511 100644 --- a/tests/test_plugins.bats +++ b/tests/test_plugins.bats @@ -74,6 +74,25 @@ EOF # ---------- print_manual_install_hint ---------- +@test "install_openspec: errors when npm missing" { + PATH="$STUB_DIR" run install_openspec + [ "$status" -ne 0 ] + [[ "$output" == *"npm not on PATH"* ]] +} + +@test "install_openspec: invokes npm install -g with @fission-ai/openspec" { + CALLS_FILE="$TEST_HOME/npm-calls.txt" + cat > "$STUB_DIR/npm" <> "$CALLS_FILE" +EOF + chmod +x "$STUB_DIR/npm" + # Keep /usr/bin + /bin on PATH so the stub's shebang (`env bash`) resolves. + PATH="$STUB_DIR:/usr/bin:/bin" run install_openspec + [ -f "$CALLS_FILE" ] + grep -q "install -g @fission-ai/openspec@latest" "$CALLS_FILE" +} + @test "print_manual_install_hint: prints CLI name and instruction" { run print_manual_install_hint "Codex CLI" "/plugins → search" [ "$status" -eq 0 ]