Skip to content

fernandomenuk/openspec

Repository files navigation

English | 简体中文 | Português (Brasil)

OpenSpec — The universal AI context infrastructure.

🛑 Stop Context Drift.

The universal AI context infrastructure.
Sync your project rules across Cursor, Claude, Gemini, and Windsurf automatically.
One source of truth. Seven outputs. Zero manual work.

Quickstart · Why? · Architecture · Config · Contributing

Version License Node TypeScript PRs Welcome


✨ Why OpenSpec?

If you use more than one AI tool, you have a context fragmentation problem.

  • Cursor wants .cursorrules
  • Claude Code wants CLAUDE.md
  • Aider wants .aiderrules
  • Copilot wants .github/copilot-instructions.md

When your project conventions change, you have to manually update 7+ different files. Miss one, and your AI starts hallucinating outdated patterns.

OpenSpec is the "Transpiler" for AI context. You define your rules in clean, modular Markdown files, and OpenSpec generates the optimized format for every AI agent in your stack.

🚀 Key Features

  • 🤖 AI-Native Workflow: Designed to be managed by your AI agent.
  • 🔄 Universal Sync: Supports Cursor, Claude, Gemini, Copilot, Aider, Codex, and Windsurf.
  • 🧠 Zero-Knowledge Setup: openspec analyze scans your codebase and tells the AI what rules to write.
  • 🔌 Claude Code First: Native plugin for the newest, most powerful AI coding tool.
  • 🛠️ Watch Mode: Updates your context files in real-time as you edit your modules.

The Problem

Every AI tool has its own context file (CLAUDE.md, .cursorrules, GEMINI.md, etc.). When project conventions evolve, you have to manually update 7 different files. Miss one, and your AI agent starts writing inconsistent code.

OpenSpec solves this by acting as the context layer for your AI agents.

The Solution

.openspec/modules/           ← AI writes your rules HERE
  ├── shared.md
  ├── frontend.md
  └── backend.md
        │
        ▼  AI runs openspec sync
        │
  CLAUDE.md                  ← Generated
  .cursorrules               ← Generated
  GEMINI.md                  ← Generated
  ... (7+ outputs)           ← Generated

One source of truth. Seven outputs. Zero manual work.


⚡ Truly Zero Manual Work (Recommended)

OpenSpec is built for AI agents to manage autonomously. You don't even need to initialize the project—the AI does it for you.

1. Add to Claude Code

Simply run these commands inside your Claude Code session:

/plugin marketplace add fernandomenuk/openspec
/plugin install openspec@openspec

2. Configure Automatically

Run the configuration command:

/openspec:configure

That's it. Claude will analyze your codebase, create the rules, and sync them to every tool in your stack.


🛠️ CLI Workflow (Any Agent)

If you use Cursor, Windsurf, Aider, or any other agent, just tell them:

"Run npx @menukfernando/openspec analyze, use the output to write modular rules to .openspec/modules/, and then run sync."

OpenSpec's analyze command provides a high-density structured report specifically designed for AI agents to understand your codebase conventions instantly.


🔧 CLI Reference

Usage: openspec [command] [options]

Commands:
  analyze           Deep codebase analysis for AI-powered rule generation (auto-inits)
  sync [--quiet]    Compile modules → generate all AI context files
  watch             Watch for module changes, auto-sync on save
  status            Show modules, targets, and sync status
  diff              Preview what changes sync would make
  add <name>        Create a new rule module
  install           Install OpenSpec Claude Code Plugin (Local)
  hooks [--remove]  Install/remove git pre-commit hook
  clean             Remove all generated files (only openspec-managed)
  help [command]    Show help for a command

📋 Roadmap

  • Core transpiler engine
  • 7 target outputs (Claude, Cursor, Gemini, Copilot, Aider, Codex, Windsurf)
  • Claude Code Plugin & Marketplace support
  • Truly Zero-Init Workflow
  • MCP server mode for dynamic context
  • Module inheritance & composition
  • Monorepo support

📄 License

MIT — see LICENSE for details.


Stop copy-pasting AI rules.
npx @menukfernando/openspec analyze && npx @menukfernando/openspec sync

About

Universal AI context transpiler. Define once. Spec everywhere. Generates CLAUDE.md, .cursorrules, GEMINI.md, AGENTS.md, and more from a single source of truth.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

 
 
 

Contributors