Skip to main content

Language Server Protocol implementation for MAID methodology validation

Project description

MAID LSP

Language Server Protocol implementation for MAID (Manifest-driven AI Development) methodology validation.

Status: v0.1.0 - Core implementation complete. All LSP capabilities functional.

Overview

MAID LSP provides real-time validation of MAID manifests in code editors and IDEs, including:

  • VS Code (via extension)
  • JetBrains IDEs (via plugin)
  • Claude Code (native LSP support)
  • Any LSP-compatible editor

Features

  • Real-time Diagnostics: Instant validation feedback as you edit manifests
  • Code Actions: Quick fixes for common validation errors (add missing fields, create referenced files)
  • Hover Information: Detailed artifact information on hover (functions, classes, attributes)
  • Push Diagnostics: Server pushes validation results on document changes with 100ms debouncing

Installation

Prerequisites

  • Python 3.10+
  • maid-runner >= 0.8.0
  • uv (package manager)

From Source

# Clone the repository
git clone https://github.com/mamertofabian/maid-lsp.git
cd maid-lsp

# Install dependencies
uv sync --all-extras

# Run the server
uv run maid-lsp --stdio

Usage

Running the Server

# Start in stdio mode (default)
maid-lsp --stdio

# Or via make
make run

# Check version
maid-lsp --version

Editor Integration

The server communicates via stdio and validates files matching *.manifest.json.

Claude Code: Configure .lsp.json in your project root (see .lsp.json in this repo for example).

VS Code: Use the vscode-maid extension (planned).

Architecture

See the docs/ directory for detailed architecture documentation:

Three-Layer Design

┌─────────────────────────────────────────────────────────┐
│                    Protocol Layer                        │
│                   (maid_lsp/server.py)                  │
│                    pygls + LSP handlers                  │
└─────────────────────────────────────────────────────────┘
                           │
┌─────────────────────────────────────────────────────────┐
│                  Capabilities Layer                      │
│              (maid_lsp/capabilities/)                   │
│         diagnostics.py │ code_actions.py │ hover.py     │
└─────────────────────────────────────────────────────────┘
                           │
┌─────────────────────────────────────────────────────────┐
│                  Validation Layer                        │
│               (maid_lsp/validation/)                    │
│           runner.py │ parser.py │ models.py             │
└─────────────────────────────────────────────────────────┘

Key design decision: The server wraps maid-runner CLI via subprocess rather than importing modules directly. This keeps validation logic separate and uses CLI output as a stable API contract.

Project Structure

maid-lsp/
├── maid_lsp/
│   ├── __init__.py           # Package init with version
│   ├── __main__.py           # CLI entry point
│   ├── server.py             # Main LSP server
│   ├── capabilities/         # LSP capability handlers
│   │   ├── diagnostics.py    # Diagnostic publishing
│   │   ├── code_actions.py   # Quick fix actions
│   │   └── hover.py          # Hover information
│   ├── validation/           # maid-runner integration
│   │   ├── models.py         # Data models
│   │   ├── runner.py         # CLI wrapper
│   │   └── parser.py         # Result to diagnostic conversion
│   └── utils/
│       └── debounce.py       # Async debouncer
├── tests/                    # Behavioral tests
├── docs/                     # Architecture documentation
├── manifests/                # MAID manifests (dogfooding)
├── .claude-plugin/
│   └── plugin.json           # Claude Code plugin config
└── .lsp.json                 # LSP server configuration

Diagnostic Codes

Code Severity Description
MAID-001 Error Schema validation errors
MAID-002 Error Missing required fields
MAID-003 Error File reference errors
MAID-004 Error Artifact validation errors
MAID-005 Error Behavioral validation errors
MAID-006 Error Implementation validation errors
MAID-007 Error Manifest chain errors
MAID-008 Warning Coherence validation warnings

Development

Commands

# Install dependencies
uv sync --all-extras

# Run all quality checks (lint + type-check + test)
make all

# Individual commands
make lint           # Run ruff linter
make lint-fix       # Auto-fix linting issues
make type-check     # Run mypy type checker
make test           # Run pytest
make test-cov       # Run tests with coverage report
make format         # Format code with black
make format-check   # Check formatting without changes

# Run a single test
uv run pytest tests/test_task_002_debounce.py -v

MAID Methodology

This project uses the MAID methodology for all implementation. Each feature was developed following the MAID workflow with manifests in the manifests/ directory.

Task Component Status
task-001 Package initialization Complete
task-002 Async debouncer Complete
task-003 Validation models Complete
task-004 MaidRunner CLI wrapper Complete
task-005 Validation parser Complete
task-006 Diagnostics handler Complete
task-007 Code actions handler Complete
task-008 Hover handler Complete
task-009 Main server Complete
task-010 CLI entry point Complete

Related Projects

License

MIT License - see LICENSE for details.

Acknowledgments

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

maid_lsp-0.1.2.tar.gz (48.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

maid_lsp-0.1.2-py3-none-any.whl (18.3 kB view details)

Uploaded Python 3

File details

Details for the file maid_lsp-0.1.2.tar.gz.

File metadata

  • Download URL: maid_lsp-0.1.2.tar.gz
  • Upload date:
  • Size: 48.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for maid_lsp-0.1.2.tar.gz
Algorithm Hash digest
SHA256 0568994013053d4fa96fa935ef881a18b75ac0f3f0fd960f7488ff127124fed8
MD5 0f5c6cb32502d55b229ade576aaa45a4
BLAKE2b-256 e99d1b9cb1be36e658cba8717274995ce0858e1bcce654373dab093220a60f73

See more details on using hashes here.

Provenance

The following attestation bundles were made for maid_lsp-0.1.2.tar.gz:

Publisher: publish.yml on mamertofabian/maid-lsp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file maid_lsp-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: maid_lsp-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 18.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for maid_lsp-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b704e8735898e57e86ac1ce3c15ad6ebb5b0259ef05fd241d7439c7a496f4802
MD5 b5b51c8dbe618cb6c89f79c8b3c58c46
BLAKE2b-256 c70f5728c072e22ccfac02d5b4f3fee8f7f9ff3ef1fe86b4e490cf41f5675d4c

See more details on using hashes here.

Provenance

The following attestation bundles were made for maid_lsp-0.1.2-py3-none-any.whl:

Publisher: publish.yml on mamertofabian/maid-lsp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page