OpenSpec with Cursor

Cursor is one of the environments where OpenSpec’s slash-command workflow shines. This page summarizes setup and habits that keep your specs and code aligned.

1. Install and initialize

From a terminal (integrated or external):

npm install -g @fission-ai/openspec@latest
cd /path/to/your/repo
openspec init

Commit the generated openspec/ layout and AGENTS.md so Cursor and teammates see the same structure.

2. Use opsx commands in chat

After your project follows OpenSpec conventions, use commands like /opsx:new my-feature in Cursor’s AI chat. The model uses repo files—not just the current message—for planning.

3. Pin spec files while implementing

When running /opsx:apply or equivalent, attach or @-reference tasks.md and relevant specs/ files so the model does not improvise requirements from memory.

4. Keep AGENTS.md honest

Document team rules (test commands, lint, branch naming) in AGENTS.md. Cursor uses it as persistent guidance across sessions.

5. Optional: MCP

If you use MCP-enabled tooling, see MCP integration for wiring OpenSpec into broader agent setups.

Related