A tool-agnostic validation framework for the Manifest-driven AI Development (MAID) methodology. MAID Runner validates that code artifacts align with their declarative manifests, ensuring architectural integrity in AI-assisted development.
πΉ Watch the introductory video
LLMs generate code based on statistical likelihood, optimizing for "plausibility" rather than architectural soundness. Without intervention, this leads to "AI Slop"βcode that is syntactically valid but architecturally chaotic.
MAID Runner enforces dual-constraint validation:
- Behavioral (Coordinate A): Code must pass the test suite
- Structural (Coordinate B): Code must adhere to a pre-designed JSON manifest
This transforms AI from a "Junior Developer" requiring reactive code review into a "Stochastic Compiler" that translates rigid specifications into implementation details.
β Full philosophy documentation
| Language | Extensions | Parser | Key Features |
|---|---|---|---|
| Python | .py |
AST (built-in) | Classes, functions, methods, attributes, type hints, async/await, decorators |
| TypeScript/JS | .ts, .tsx, .js, .jsx |
tree-sitter | Classes, interfaces, type aliases, enums, namespaces, generics, JSX/TSX |
| Svelte | .svelte |
tree-sitter | Components, props, exports, script blocks, reactive statements |
# Install
pip install maid-runner # or: uv pip install maid-runner
# Initialize MAID in your project
maid init
# Interactive guide
maid howto --section quickstart/plugin marketplace add aidrivencoder/claude-plugins
/plugin install maid-runner@aidrivencoderpip install maid-runner # or: uv pip install maid-runnermaid init # Claude Code (default)
maid init --cursor # Cursor IDE
maid init --windsurf # Windsurf IDE
maid init --generic # Generic MAID.md
maid init --all # All tools| Command | Purpose | Key Options |
|---|---|---|
maid validate <manifest> |
Validate manifest against code | --validation-mode behavioral|implementation, --use-manifest-chain, --watch, --watch-all |
maid test |
Run validation commands from manifests | --manifest <path>, --watch, --watch-all, --fail-fast |
maid snapshot <file> |
Generate manifest from existing code | --output-dir, --force |
maid snapshot-system |
Aggregate all active manifests | --output, --manifest-dir |
maid manifests <file> |
List manifests referencing a file | --manifest-dir, --quiet |
maid files |
Show file tracking status | --manifest-dir, --quiet |
maid init |
Initialize MAID in project | --claude, --cursor, --windsurf, --generic, --all |
maid howto |
Interactive methodology guide | --section intro|principles|workflow|quickstart|patterns|commands|troubleshooting |
maid manifest create <file> |
Create manifest for a file | --goal, --artifacts, --dry-run |
Exit codes: 0 = success, 1 = failure. Use --quiet for automation.
Run maid howto --section commands for detailed usage and examples.
# Validate implementation (default mode)
maid validate manifests/task-013.manifest.json --use-manifest-chain
# Validate behavioral tests
maid validate manifests/task-013.manifest.json --validation-mode behavioral
# TDD watch mode (single manifest)
maid test --manifest manifests/task-013.manifest.json --watch
# Multi-manifest watch (entire codebase)
maid test --watch-all
# Run all validation commands
maid testWhen using --use-manifest-chain, MAID Runner reports file compliance status:
- π΄ UNDECLARED: Files not in any manifest (no audit trail)
- π‘ REGISTERED: Files tracked but incomplete (missing artifacts/tests)
- β TRACKED: Files with full MAID compliance
{
"goal": "Implement email validation",
"taskType": "create",
"supersedes": [],
"creatableFiles": ["validators/email_validator.py"],
"editableFiles": [],
"readonlyFiles": ["tests/test_email_validation.py"],
"expectedArtifacts": {
"file": "validators/email_validator.py",
"contains": [
{"type": "class", "name": "EmailValidator"},
{
"type": "function",
"name": "validate",
"class": "EmailValidator",
"parameters": [{"name": "email", "type": "str"}],
"returns": "bool"
}
]
},
"validationCommand": ["pytest", "tests/test_email_validation.py", "-v"]
}| Mode | Files | Behavior |
|---|---|---|
| Strict | creatableFiles |
Implementation must EXACTLY match expectedArtifacts |
| Permissive | editableFiles |
Implementation must CONTAIN expectedArtifacts |
Common: class, function, attribute
TypeScript-specific: interface, type, enum, namespace
Define the high-level feature or bug fix.
- Create manifest:
maid manifest create <file> --goal "Description" - Create behavioral tests in
tests/test_task_XXX_*.py - Validate:
maid validate <manifest> --validation-mode behavioral - Iterate until validation passes
- Implement code per manifest
- Validate:
maid validate <manifest> --use-manifest-chain - Run tests:
maid test --manifest <manifest> - Iterate until all tests pass
Verify complete chain: maid validate and maid test pass for all active manifests.
from maid_runner import (
validate_schema,
validate_with_ast,
discover_related_manifests,
generate_snapshot,
AlignmentError,
)
# Validate a manifest
validate_schema(manifest_data, schema_path)
validate_with_ast(manifest_data, file_path, use_manifest_chain=True)
# Generate snapshot manifest
generate_snapshot("path/to/file.py", output_dir="manifests")| Tool | Purpose |
|---|---|
| MAID Agents | Automated workflow orchestration using Claude Code agents |
| MAID Runner MCP | MCP server exposing validation to AI agents |
| MAID LSP | Language Server Protocol for real-time IDE validation |
| MAID for VS Code | VS Code/Cursor extension with manifest explorer and diagnostics |
| Claude Plugins | Plugin marketplace including MAID Runner |
# Install dependencies
uv sync
uv sync --group dev
# Run tests
uv run python -m pytest tests/ -v
# Code quality
make format # Auto-fix formatting
make lint # Check style
make type-check # Type checkingmaid-runner/
βββ docs/ # Documentation
βββ manifests/ # Task manifests (chronological)
βββ tests/ # Test suite
βββ maid_runner/
β βββ cli/ # CLI modules
β βββ validators/ # Core validation logic
βββ examples/ # Example scripts
βββ .claude/ # Claude Code configuration
uv run python -m pytest tests/ -v # All tests
uv run python -m pytest tests/test_task_*.py -v # Task-specific tests
maid test # MAID validation commands- Python 3.10+
- Core:
jsonschema,pytest,tree-sitter,tree-sitter-typescript - Dev:
black,ruff,mypy
This project dogfoods MAID methodology. All changes require:
- A manifest in
manifests/ - Behavioral tests in
tests/ - Passing structural validation
- Passing behavioral tests
See CONTRIBUTING.md and CLAUDE.md for guidelines.
MIT License. See LICENSE for details.