VS Code Extension

Spec-first development directly in VS Code. Validate, scaffold, and explore your contract specifications with real-time feedback.

Installation

Option 1: Install from VS Code Marketplace

code --install-extension lssm.vscode-contractspec

Option 2: Search for "ContractSpec" in VS Code Extensions (Ctrl/Cmd+Shift+X)

Features

Core Functionality

  • -Real-time validation with instant feedback on spec errors
  • -Build/Scaffold handlers and components from specs
  • -Interactive spec creation wizard
  • -Watch mode for auto-rebuild on changes
  • -Sync all specs in workspace with one command

Visual Navigation

  • -Specs Explorer sidebar with organized tree view
  • -Dependencies view to visualize spec relationships
  • -Build Results tracking with history
  • -Circular dependency detection

Comparison & Export

  • -Semantic and text diff between specs
  • -Git comparison with baseline branches
  • -OpenAPI 3.1 specification export

Commands

Access commands via Command Palette (Ctrl/Cmd+Shift+P) with prefix ContractSpec:

Create New Spec

Interactive wizard to create specs

Validate Current Spec

Validate the currently open spec

Build/Scaffold from Current Spec

Generate handler/component

Toggle Watch Mode

Auto-rebuild on changes

Sync All Specs

Build all specs in workspace

Analyze Spec Dependencies

Visualize spec dependencies

Compare Specs

Semantic or text diff between specs

Export to OpenAPI

Generate OpenAPI specification

Sidebar Views

The extension adds a ContractSpec activity bar (icon in sidebar) with three views:

Specs Explorer

Browse all specs organized by type. Shows name, version, and stability. Click to open, right-click for actions.

Dependencies

Visualize spec relationships. Detect circular dependencies. Navigate to referenced specs.

Build Results

Track build history (last 20). Success/failure indicators. Click to open generated files.

Getting Started

  1. Install the extension from VS Code Marketplace
  2. Open a workspace with ContractSpec files (or create one)
  3. Start the walkthrough: Help - Welcome - ContractSpec
  4. Create your first spec: Click + in Specs Explorer or run ContractSpec: Create New Spec
  5. Build from it: Click the build icon in the editor title bar

Configuration

Configure the extension in VS Code Settings:

SettingDescriptionDefault
validation.onSaveRun validation on savetrue
validation.onOpenRun validation on opentrue
api.baseUrlBase URL for ContractSpec API(empty)