Skip to content

spenceriam/OpenSpecification

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

181 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

OpenSpecification πŸš€

AI-Powered Specification Generation for Modern Development

OpenSpecification is an open-source web application that democratizes spec-driven development by replicating Kiro IDE's Spec Mode functionality. Generate comprehensive technical specifications using any AI model from OpenRouter's API, following a structured three-phase workflow with iterative refinement capabilities.

Next.js TypeScript Tailwind CSS OpenRouter

Live: https://www.openspec.app/

✨ Features

  • πŸ€– AI-Powered Generation: Use any AI model from OpenRouter's extensive catalog
  • πŸ“‹ Three-Phase Workflow: Requirements β†’ Design β†’ Implementation Tasks
  • πŸ”„ Iterative Refinement: Refine and improve each phase with AI assistance
  • πŸ“Š Automatic Diagrams: Generate Mermaid diagrams for architecture, workflows, and data models
  • πŸ’Ύ Local Storage: All data stays in your browser - no backend required
  • πŸ“€ Multiple Export Options: Markdown, HTML, PDF, and ZIP formats
  • β™Ώ Accessibility First: WCAG 2.1 compliant with keyboard navigation
  • πŸ“± Responsive Design: Works seamlessly on desktop and mobile devices

πŸ—οΈ Technology Stack

  • Framework: Next.js 14 with App Router
  • Language: TypeScript with strict mode
  • Styling: Tailwind CSS + shadcn/ui components
  • Markdown: react-markdown with syntax highlighting
  • Diagrams: Mermaid.js for automatic diagram generation
  • AI Integration: OpenRouter API for model access
  • Storage: Browser localStorage (client-side only)
  • Testing: Jest + React Testing Library + 100+ test cases

πŸš€ Quick Start

Prerequisites

Installation

  1. Clone the repository

    git clone https://github.com/openspec/openspec.git
    cd openspec
  2. Install dependencies

    npm install
    # or
    yarn install
    # or
    pnpm install
  3. Start development server

    npm run dev
    # or
    yarn dev
    # or
    pnpm dev
  4. Open in browser

    Navigate to http://localhost:3000

  5. Enter your OpenRouter API key

    The application will prompt you to enter your OpenRouter API key on first use.

πŸ“– Usage Guide

Basic Workflow

  1. Setup πŸ”§

    • Enter your OpenRouter API key
    • Select an AI model (Claude 3 Sonnet recommended)
    • Describe your feature or project
    • Upload context files (optional)
  2. Generate ⚑

    • Requirements Phase: Generate comprehensive requirements
    • Design Phase: Create technical design specifications
    • Tasks Phase: Generate actionable implementation tasks
  3. Refine 🎯

    • Request refinements for any phase
    • Iterate until satisfied
    • Approve each phase to progress
  4. Export πŸ“€

    • Choose from multiple formats
    • Include diagrams and metadata
    • Download as individual files or ZIP

Supported File Types

  • Code: .ts, .js, .py, .go, .rs, .java, .cpp, .c#
  • Markup: .md, .html, .xml, .json, .yaml, .toml
  • Config: .env, .cfg, .ini, .conf
  • Documentation: .txt, .rtf

πŸ§ͺ Testing

OpenSpecification includes a comprehensive testing suite with 100+ test cases:

# Run all tests
npm test

# Run tests in watch mode
npm run test:watch

# Run with coverage report
npm run test:coverage

# Run specific test suites
npm run test:unit        # Unit tests
npm run test:components  # Component tests
npm run test:integration # Integration tests

# CI/CD testing
npm run test:ci

Test Coverage

  • Unit Tests: Core utilities and hooks (25+ tests)
  • Component Tests: UI components with user interactions (60+ tests)
  • Integration Tests: OpenRouter API integration (20+ tests)
  • Accessibility Tests: ARIA compliance and keyboard navigation
  • Error Handling: Edge cases and error recovery

πŸ—οΈ Project Structure

openspec/
β”œβ”€β”€ app/                     # Next.js 14 App Router
β”‚   β”œβ”€β”€ page.tsx            # Main application page
β”‚   β”œβ”€β”€ layout.tsx          # Root layout with metadata
β”‚   └── globals.css         # Global styles
β”œβ”€β”€ components/             # React components
β”‚   β”œβ”€β”€ ui/                 # shadcn/ui components
β”‚   β”œβ”€β”€ ApiKeyInput.tsx     # API key management
β”‚   β”œβ”€β”€ ModelSelector.tsx   # AI model selection
β”‚   β”œβ”€β”€ PromptInput.tsx     # Feature description input
β”‚   β”œβ”€β”€ WorkflowProgress.tsx # Progress indicator
β”‚   β”œβ”€β”€ MarkdownPreview.tsx # Content preview
β”‚   β”œβ”€β”€ ContentRefinement.tsx # Refinement interface
β”‚   β”œβ”€β”€ ApprovalControls.tsx # Phase approval
β”‚   β”œβ”€β”€ ExportDialog.tsx    # Export functionality
β”‚   β”œβ”€β”€ ErrorBoundary.tsx   # Error handling
β”‚   β”œβ”€β”€ Header.tsx          # Navigation header
β”‚   └── Footer.tsx          # Site footer
β”œβ”€β”€ lib/                    # Utility libraries
β”‚   β”œβ”€β”€ openrouter/         # OpenRouter API client
β”‚   β”œβ”€β”€ prompts/           # AI prompts for each phase
β”‚   β”œβ”€β”€ diagram/           # Mermaid diagram utilities
β”‚   β”œβ”€β”€ file-export.ts     # File export functionality
β”‚   └── storage.ts         # Browser storage management
β”œβ”€β”€ hooks/                  # Custom React hooks
β”‚   └── useSpecWorkflow.ts  # Main workflow state
β”œβ”€β”€ types/                  # TypeScript type definitions
β”œβ”€β”€ __tests__/             # Test suites
β”‚   β”œβ”€β”€ unit/              # Unit tests
β”‚   β”œβ”€β”€ components/        # Component tests
β”‚   └── integration/       # Integration tests
└── public/                # Static assets

πŸ”§ Development

Available Scripts

  • npm run dev - Start development server
  • npm run build - Build for production
  • npm start - Start production server
  • npm run lint - Run ESLint
  • npm test - Run test suite
  • npm run test:watch - Run tests in watch mode
  • npm run test:coverage - Generate coverage report

Environment Setup

# Install dependencies
npm install

# Install additional shadcn/ui components (if needed)
npx shadcn@latest add [component-name]

# Run type checking
npx tsc --noEmit

# Run linting
npm run lint

Code Style

  • TypeScript: Strict mode enabled
  • ESLint: Next.js configuration
  • Prettier: Code formatting
  • Tailwind CSS: Utility-first styling
  • shadcn/ui: Consistent component patterns

🚒 Deployment

Vercel (Recommended)

  1. Connect your repository to Vercel
  2. No environment variables needed (client-side only)
  3. Automatic deployments on push to main

Other Platforms

# Build the application
npm run build

# Start production server
npm start

OpenSpecification is a fully static Next.js application with no backend dependencies.

πŸ” Security & Privacy

  • API Keys: Stored only in browser memory, never persisted
  • No Backend: All processing happens client-side
  • Local Storage: Specifications stored locally in your browser
  • No Tracking: No analytics or user tracking
  • HTTPS: All API communications use secure protocols

🀝 Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

Development Workflow

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests for new functionality
  5. Run the test suite
  6. Submit a pull request

Commit Convention

We use Conventional Commits:

  • feat: - New features
  • fix: - Bug fixes
  • docs: - Documentation changes
  • test: - Adding tests
  • refactor: - Code refactoring
  • style: - Formatting changes
  • chore: - Maintenance tasks

πŸ“„ License

OpenSpecification is open source software licensed under the MIT License.

πŸ™ Acknowledgments

πŸ“ž Support


Made with ❀️ for open source agentic coding

Built to solve agentic coding needs for open source development.

About

Nano web inspired version of Kiro IDE's Spec Mode

Resources

Contributing

Stars

Watchers

Forks