Skip to content

docs(installation): add an AI-assistant setup prompt - #1466

Merged
clay-good merged 6 commits into
mainfrom
docs/llm-assisted-install
Jul 28, 2026
Merged

docs(installation): add an AI-assistant setup prompt#1466
clay-good merged 6 commits into
mainfrom
docs/llm-assisted-install

Conversation

@clay-good

@clay-good clay-good commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Status

Ready for review. Docs plus one line of website copy — no CLI, template, or test changes.

What was missing

Installing OpenSpec meant reading the manual flow and translating it yourself: pick a package manager, install globally, run openspec init, then figure out whether it worked. Plenty of people would rather hand that to the coding agent already sitting in their terminal, but the docs gave them nothing to paste.

What it does

Adds an Install with your AI assistant section to docs/installation.md with one copyable, provider-neutral prompt. Five steps: check Node 20.19.0+ and stop if the runtime is wrong → show the global install command and wait for your okay → confirm the CLI on PATH is the one just installed → ask which tool(s) and run openspec init --tools <ids> → report what init actually printed.

The manual npm/pnpm/yarn/bun/Nix instructions stay the source of truth. They sit directly below the new section, which links back to them and to Troubleshooting for anything the assistant hands off.

Discovery, at every place installation is taught: README Quick Start, the docs map, Getting Started, Troubleshooting (the PATH entry — the flow's designed hand-off point), and the website's final CTA.

Proof it works

Two assistants ran the prompt end to end, in sandboxes, on different models and different tools. Both finished with a working, verified setup:

Assistant A Assistant B
Tool Cursor Codex (skills-only)
Project state clean messy: legacy .claude/commands/openspec/, an OpenSpec marker block in CLAUDE.md, ~/.codex/prompts/opsx-propose.md, and a pnpm-lock.yaml planted to mislead
Result 6 skills + 6 commands in .cursor/, openspec/config.yaml 6 skills in .codex/, 0 commands — correctly reported as success, not failure
Legacy files none found, continued found all three including the home-directory one, stopped and asked; left the hand-written my-own.md alone
Lockfile trap n/a not fooled — used npm, ignored pnpm-lock.yaml

Their findings are fixed in 06065a4: Cursor's commands are /opsx-propose, not /opsx:propose (the prompt and init's own summary both said the colon form, so the assistant would have handed back a command Cursor doesn't match — it now reads the spelling off the generated files); "wait for my go-ahead" was undefined when nothing is found, i.e. on every fresh project; openspec --version succeeding doesn't prove it's the copy just installed; and the global install now asks first, which the original request called for.

Three adversarial reviews ran against the first draft. Everything below was reproduced against the built CLI in isolated temp dirs, and each fix is in the diff:

What broke Fix
Verify step asserted openspec/config.yaml, but an existing config.yml is honored and never renamed — false failure on a healthy project Step 5 relays the config line init prints instead of asserting a filename
Verify step asserted command files exist. Codex, Hermes, Kimi, Vibe, ForgeCode and CodeArts create zero commands by design, as does delivery=skills for any tool "Some tools are skills-only and correctly create zero command files, so missing commands is not a failure on its own"
delivery=commands + a skills-only tool creates nothing at all, and init prints the fix "If init said nothing was generated, relay the fix it suggested instead of retrying"
"Tell me before overwriting any existing file" was unenforceable: passing --tools disables prompting, so legacy cleanup runs unattended — including deleting opsx-*.md under ~/.codex/prompts Step 4 has the assistant scan for legacy artifacts, project and home directory, and wait; clarifies an existing openspec/ is a harmless refresh
"Detect which package manager this project uses" is the wrong signal — a lockfile says nothing about what's on PATH or can install globally "Use whichever package manager is already on my PATH, preferring npm… don't pick based on this project's lockfile"
yarn global add was removed in Yarn 2+ (Berry) Scoped to (Yarn 1.x only); the yarn section now says so
pnpm add -g dead-ends without PNPM_HOME, and the standard fix (pnpm setup) edits the shell rc files the prompt forbids touching Stop-and-ask on "global bin directory is missing or unconfigured", and never run a setup command that edits them
npm EACCES on system Node — the common Linux setup — had no legal move Stop-and-ask on sudo/admin rights and permissions errors
PATH advice named only POSIX rc files; nvm/fnm/asdf/volta users get a working install the verify step still calls broken Step 3 covers this shell's PATH, names the PowerShell profile, and defers on version managers instead of editing around them
Monorepo subdir silently creates a nested OpenSpec root "init creates openspec/ wherever it runs, including inside a monorepo package"
--tools takes a comma-separated list; the prompt asked for one tool "Ask me which AI coding tool or tools I use… name all of them"

Also verified: github-copilot and roocode are real ids; openspec init --help really prints the id list (generated from AI_TOOLS, so it can't drift); a wrong id fails loudly with the full list; re-running init preserves existing specs; every command in the prompt matches the manual sections byte for byte.

Build and tests: pnpm run build and pnpm run types:check in website/ pass (26 doc pages, 87 routes). The install-with-your-ai-assistant anchor renders, and all four in-repo links to it resolve in the built HTML. test/vocabulary-sweep.test.ts passes. website/content/docs/ and website/out/ are generated and git-ignored.

Second commit: two doc inaccuracies found along the way

2e96ffe is a separate, independently reviewable commit — check it against src/core/profiles.ts:14 and src/core/config.ts:

  • The core profile is six workflows, not five. CORE_WORKFLOWS is propose, explore, apply, update, sync, archive, and a real openspec init generates six skills and six commands. Eleven pages listed five, omitting update. migration-guide.md listed four and filed sync under the expanded set. supported-tools.md also dropped update from the full workflow-ID list. docs/commands.md was already correct and is untouched, as are flow diagrams that show a typical path rather than a profile roster.
  • The tool count was written as both "25+" and "30+" against 34 supported tools. Now consistently "30+".

Notes

  • The prompt won't install or switch Node versions — version managers vary too much to automate safely, so it reports and stops.
  • Nix is deliberately out of the prompt: nix run needs no install step. The Nix section is untouched.
  • Two adjacent one-line fixes ride along because this PR routes users into them: the Berry note in the yarn section, and npm bin -g in Troubleshooting, which was removed in npm 9 (confirmed working on npm 8, gone on npm 9 — now npm prefix -g).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Added an “Install with your AI assistant” option across installation and getting-started content, including copy/paste prompts and verification steps.
    • Updated Yarn guidance for global installs and improved “command not found” troubleshooting with current PATH checks.
    • Expanded the default core workflow/CLI and slash-command docs to include update; refreshed related examples, migration guidance, FAQ, glossary, and supported-tools info.
    • Updated “AI tools” references to 30+.
  • Website
    • Added a CTA for AI-assisted CLI installation linking to the new docs section.

Adds a provider-neutral "Install with your AI assistant" section to
docs/installation.md with one copyable prompt that detects the runtime and
package manager, installs the CLI, runs `openspec init --tools <id>`, and
verifies the result. Surfaced from the README Quick Start and the docs map.
The manual package-manager instructions stay the source of truth.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@clay-good
clay-good requested a review from a team as a code owner July 27, 2026 23:25
@clay-good
clay-good requested review from alfred-openspec and removed request for a team July 27, 2026 23:25
@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 7f2c2f35-f3c9-49ce-a9ff-894eb46b8689

📥 Commits

Reviewing files that changed from the base of the PR and between 2e96ffe and f14361f.

📒 Files selected for processing (3)
  • docs/getting-started.md
  • docs/installation.md
  • docs/troubleshooting.md
🚧 Files skipped from review as they are similar to previous changes (3)
  • docs/getting-started.md
  • docs/installation.md
  • docs/troubleshooting.md

📝 Walkthrough

Walkthrough

The documentation adds a copy/paste workflow for AI assistants to install the OpenSpec CLI, initialize it with selected tools, and verify generated artifacts. Installation compatibility and troubleshooting guidance are updated, and core workflow references now include update.

Changes

Documentation updates

Layer / File(s) Summary
AI-assisted installation workflow
docs/installation.md, README.md, docs/README.md, docs/getting-started.md, website/app/(home)/page.tsx
The installation guide adds an AI setup prompt covering runtime checks, package-manager installation, openspec init --tools, and verification. Onboarding pages and the homepage link to or describe the prompt.
Installation compatibility and troubleshooting
docs/installation.md, docs/troubleshooting.md
Yarn 2+ guidance recommends alternative package managers, and command-not-found troubleshooting uses npm prefix -g for PATH setup.
Core update workflow references
docs/cli.md, docs/getting-started.md, docs/glossary.md, docs/how-commands-work.md, docs/migration-guide.md, docs/opsx.md, docs/supported-tools.md, docs/workflows.md, docs/examples.md, docs/explore.md, docs/faq.md
Core workflow and migration documentation now includes update, and expanded profiles are documented as requiring configuration followed by openspec update.
Supported-tool references
README.md, docs/README.md, docs/faq.md, docs/how-commands-work.md
Supported assistant counts are updated from 25+ to 30+ tools.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: alfred-openspec

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: adding an AI-assistant setup prompt to the installation docs.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/llm-assisted-install

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 27, 2026

Copy link
Copy Markdown

Deploying openspec-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: f14361f
Status: ✅  Deploy successful!
Preview URL: https://d7340397.openspec-docs.pages.dev
Branch Preview URL: https://docs-llm-assisted-install.openspec-docs.pages.dev

View logs

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/installation.md`:
- Around line 31-34: Update the installation instructions in step 3 to require
mapping the user’s display-name response to an exact tool ID from openspec init
--help, then confirm the canonical ID before constructing the non-interactive
openspec init command. Preserve the existing overwrite warning.
- Around line 20-25: Update the package-manager detection instructions to
explicitly handle Nix projects by directing the user to the documented Nix
installation section, and stop rather than selecting npm, pnpm, yarn, or bun
when the manager is unsupported or cannot be identified.
- Around line 26-29: Update the PATH-handling instructions in the installation
guidance so the assistant stops before running openspec init or verification
when the global bin directory is missing from PATH. Require resuming only after
the user updates PATH, or alternatively invoke the installed binary through the
package manager.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: bf11740f-7cb0-4d7d-8d07-7494e0ada5dd

📥 Commits

Reviewing files that changed from the base of the PR and between 5bcf057 and b2ac655.

📒 Files selected for processing (3)
  • README.md
  • docs/README.md
  • docs/installation.md

Comment thread docs/installation.md Outdated
Comment thread docs/installation.md Outdated
Comment thread docs/installation.md Outdated
…he install paths

Adversarial review found the first draft's verify step false-failing on healthy
installs and its guardrails unenforceable. The prompt now reports what init
actually printed instead of asserting config.yaml and command files (config.yml
is equally valid; six tools and delivery=skills correctly generate zero
commands), warns that --tools auto-cleans legacy files including opsx-*.md
prompts under $HOME, picks the package manager by what's on PATH rather than by
lockfile, scopes yarn to 1.x, and stops cleanly on EACCES, a missing pnpm global
bin dir, or a version-manager shim.

Also links the flow from getting-started, the docs map, troubleshooting, and the
website CTA; notes Berry dropped `yarn global`; replaces `npm bin -g` (removed in
npm 9) with `npm prefix -g`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/getting-started.md`:
- Line 28: Remove the standalone empty blockquote marker on line 28 in the
documentation, while preserving the blank separation between the two adjacent
callouts.

In `@docs/troubleshooting.md`:
- Line 16: Update the global npm PATH guidance in the troubleshooting
documentation to separate Unix-like and Windows instructions. Keep the npm
prefix lookup for both platforms, but direct Unix users to the prefix’s bin
subdirectory and Windows users to the prefix itself, including
platform-appropriate shell profile guidance.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: c6dc19c4-bb13-41b0-afa7-8a3335c33ec5

📥 Commits

Reviewing files that changed from the base of the PR and between b2ac655 and 1bf0706.

📒 Files selected for processing (5)
  • docs/README.md
  • docs/getting-started.md
  • docs/installation.md
  • docs/troubleshooting.md
  • website/app/(home)/page.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
  • docs/README.md
  • docs/installation.md

Comment thread docs/getting-started.md
Comment thread docs/troubleshooting.md Outdated
clay-good and others added 4 commits July 27, 2026 18:51
…prompt

Two assistants (different models) ran the prompt end to end in sandboxes, one
on Cursor and one on Codex with deliberately messy legacy files. Both finished
with a working, verified setup. Their findings:

- Cursor's commands are `/opsx-propose`, not `/opsx:propose`. The prompt named
  the colon form and init's summary agrees with it, so the assistant would have
  handed back a command the tool doesn't match. It now takes the spelling from
  the files init created.
- "List whatever you find and wait for my go-ahead" was undefined when the list
  is empty, i.e. on every fresh project. It now says to carry on.
- `openspec --version` succeeding doesn't prove it's the copy just installed;
  an older one earlier on PATH shadows it. Step 3 now compares the two.
- The request asked for confirmation before privileged/global changes; the
  prompt only stopped reactively on failure. It now shows the global install
  command and waits.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
… 30+

Two long-standing inaccuracies, found while verifying the install docs.

`CORE_WORKFLOWS` (src/core/profiles.ts:14) is six — propose, explore, apply,
update, sync, archive — and a real `openspec init` generates six skills and six
commands. Eleven pages listed five, omitting `update`; migration-guide listed
four and filed `sync` under the expanded set. supported-tools also dropped
`update` from the full workflow-ID list. docs/commands.md was already right and
is untouched, as are flow diagrams that show a typical path rather than a
profile roster.

The tool count was written as both "25+" and "30+" against 34 supported tools.
Now consistently "30+".

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
- Windows puts global npm binaries directly in the prefix directory, not in a
  `bin/` subdirectory; the troubleshooting fix I added said otherwise.
- Tell the assistant to stop rather than improvise when none of npm/pnpm/yarn/bun
  is available, and point Nix users at the Nix section.
- Drop the blockquote on the getting-started pointer so it isn't a second `>`
  block adjacent to the explore callout (markdownlint MD028).

Two other comments were already fixed in 1bf0706 (stop on a PATH problem; map
the user's answer to an exact tool id).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

@alfred-openspec alfred-openspec left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed at f14361f. The provider-neutral install prompt safely stops for runtime, privilege, PATH, version-manager, package-manager, legacy-cleanup, and monorepo decisions; the Windows npm prefix correction is now accurate. Vocabulary, lint, the 26-page/87-route docs build, typecheck, cross-platform suite, Cloudflare, CodeQL, audit, dependency review, and release tracking all pass.

@clay-good
clay-good added this pull request to the merge queue Jul 28, 2026
Merged via the queue into main with commit 9a61f3f Jul 28, 2026
17 checks passed
@clay-good
clay-good deleted the docs/llm-assisted-install branch July 28, 2026 00:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants