# System Overview

> Generated by openlore on 2025-01-30
> Source files: package.json, src/cli/index.ts, src/core/init.ts

## Purpose

OpenSpec is an AI-native spec-driven development framework that helps teams define, validate, and evolve software specifications. It provides CLI tools for managing specs and changes, multi-tool AI integration, and artifact-guided workflows.

## Domains

| Domain | Description | Spec |
|--------|-------------|------|
| validation | Schema validation and rule enforcement | [spec.md](../validation/spec.md) |
| parsing | Markdown parsing and content extraction | [spec.md](../parsing/spec.md) |
| cli | Command-line interface and user interaction | [spec.md](../cli/spec.md) |
| artifact-graph | Dependency resolution and workflow ordering | [spec.md](../artifact-graph/spec.md) |

## Requirements

### Requirement: ProjectInitialization

The system SHALL initialize OpenSpec projects with proper directory structure and configuration files.

#### Scenario: NewProjectSetup
- **GIVEN** a directory without OpenSpec configuration
- **WHEN** the user runs `openspec init`
- **THEN** the system creates `openspec/` directory structure
- **AND** generates `openspec/config.yaml` with default settings

### Requirement: MultiToolSupport

The system SHALL support multiple AI tools through an adapter-based command generation system.

#### Scenario: ClaudeCodeSkillGeneration
- **GIVEN** a user selects Claude Code during initialization
- **WHEN** the init process completes
- **THEN** skill files are generated in `.claude/skills/`
- **AND** the skills follow Claude Code's expected format

#### Scenario: CursorCommandGeneration
- **GIVEN** a user selects Cursor during initialization
- **WHEN** the init process completes
- **THEN** command files are generated in `.cursor/commands/`

### Requirement: SpecDrivenWorkflow

The system SHALL enforce a spec-driven development workflow where specifications precede implementation.

#### Scenario: ChangeProposalFlow
- **GIVEN** a developer wants to make a change
- **WHEN** they run `openspec change my-feature`
- **THEN** a change directory is created with proposal template
- **AND** the workflow guides them through spec → design → tasks

## Technical Notes

- **Implementation**: `src/cli/index.ts`, `src/core/init.ts`
- **Framework**: Commander.js for CLI, Inquirer for prompts
- **Dependencies**: validation, parsing, artifact-graph
