$ show Fission-AI/OpenSpec
OpenSpec is an AI-native spec-driven development CLI tool that provides a lightweight agreement layer between humans and AI coding assistants. It manages structured 'changes' with proposals, delta specs, designs, and tasks, supporting 30+ AI coding tools (Claude, Cursor, Devin, Copilot, etc.) by generating per-tool skills and slash commands. The CLI features a store system for cross-repo planning, an artifact graph for tracking change progress, shell completion generation, and a validation system. The codebase is well-structured with extensive test coverage, reusable components (artifact graph, markdown parser, command generation adapters, store foundation), and security-conscious patterns (atomic writes, prototype pollution guards). It is actively maintained with a large community (70k+ stars).
The LLM identified 5 files worth highlighting for reuse:
Implements a generic ArtifactGraph that resolves build order, detects completed artifacts, and identifies blockers for a DAG of artifacts. It is self-contained (imports only from its own submodules) and can be extracted for any workflow that needs to track progress through a directed acyclic graph of tasks or documents.
A markdown parser that extracts sections by heading level while respecting fenced code blocks (backtick and tilde fences). Handles CRLF normalization, BOM stripping, and blank-line sensitivity. Reusable for any project that needs to parse structured markdown documents with code blocks.
Provides file lock acquisition with ownership tokens, atomic writes via temp+rename, and registry state parsing/serialization. The lock mechanism avoids age-based stealing and uses token verification. Reusable for any application that needs safe concurrent file state management with diagnostic error envelopes.
A registry of per-tool adapters that maps tool IDs to file path resolution and format detection. Each adapter implements a consistent interface (formatFile, getFilePath). The registry supports lookup by tool ID and can be extended with new adapters. Reusable for any system that needs to generate commands for multiple external tools.
Generates Bash shell completion scripts with dynamic helper functions for flag and positional argument completion. Uses a shared CommandDefinition type and can be extracted for any CLI that needs shell completions. The generator produces standalone scripts that can be sourced.