Skip to main content

Meta-specification framework for generating Spec-Driven X (SD-X) toolkits for AI agents

Project description

MetaSpec

๐Ÿค– Meta-Specification Framework for generating Spec-Driven X (SD-X) speckits for AI Agents

License: MIT Python: 3.11+ Status: Alpha


๐ŸŽฏ What is Spec-Driven?

Spec-Driven is using structured specifications to drive workflows - from requirements to implementation. Define specs first, validate and generate, then execute. This ensures clarity, consistency, and enables AI agents to understand and assist throughout the process.

๐Ÿ’ก What is MetaSpec?

MetaSpec is a meta-specification framework that enables AI Agents to automatically generate production-ready speckits (Spec-Driven X toolkits).

Define your speckit once โ†’ Get complete development environment with CLI, parser, validator, templates, and AI agent support.

What are Speckits?

  • Specialized toolkits generated by MetaSpec
  • Carry domain specifications as core assets
  • Include built-in MetaSpec commands for development
  • Follow spec-driven architecture patterns
What you can generate:
  โœ… SD-Development  - Spec-driven development
  โœ… SD-Design       - Spec-driven design systems  
  โœ… SD-Testing      - Spec-driven testing frameworks
  โœ… SD-Documentation - Spec-driven documentation
  โœ… SD-Operations   - Spec-driven operations
  โœ… SD-X            - Spec-driven generation for any domain

๐ŸŒŸ Key Features

1. Meta-Level - A meta-specification framework that generates speckits

2. Any Domain - Supports any domain, not limited to development

3. Full Lifecycle - Covers complete lifecycle (creation, updates, maintenance)


๐Ÿš€ Quick Start

Installation

# Recommended: Use uv (10-100x faster) โšก
uv pip install git+https://github.com/ACNet-AI/MetaSpec.git

# Or use pip
pip install git+https://github.com/ACNet-AI/MetaSpec.git
Other installation methods

Development mode:

git clone https://github.com/ACNet-AI/MetaSpec.git && cd MetaSpec
uv pip install -e .

Coming soon: pip install metaspec ๐Ÿš€

Create Your First Speckit

Option 1: Interactive (Recommended)

metaspec init                       # Interactive wizard - guides you through

Option 2: Quick start with template

metaspec init my-spec-kit --template mcp     # One command, done!

Option 3: Preview first

metaspec init my-spec-kit --template api --dry-run    # Preview
metaspec init my-spec-kit --template api              # Create

Result: Complete speckit with CLI, parser, validator, templates, and AI agent support!



๐ŸŒฑ Why MetaSpec?

The Journey: From Practice to Insight

MetaSpec was born from real-world experience building spec-driven development tools:

๐Ÿ”ง Phase 1: Universal SDD Tools

  • Built spec-kit and OpenSpec - covering 0โ†’1โ†’N generic spec-driven development workflows
  • Proved SDD methodology works across different project scales

๐Ÿ’ก Phase 2: The Domain Insight

  • Discovery: While practicing SDD, we realized AI needs domain-specific specifications to generate expected results
  • Example: To help AI develop MCP projects effectively, we need MCP domain specifications - not just generic development specs
  • Vision: Modular domain specifications ๐Ÿงฉ that can be combined and composed to guide AI to generate content matching our expectations

๐Ÿš€ Phase 3: Beyond Development

  • Realization: This pattern isn't limited to software development
  • Breakthrough: Any domain can benefit from specification-driven workflows
  • Vision: A meta-framework that generates spec toolkits for ANY domain

Core Philosophy

MetaSpec is built on two fundamental concepts:

1๏ธโƒฃ Domain Refinement

  • Specifications refine from general to specific through multiple levels
  • Example: Development Spec โ†’ MCP Development Spec โ†’ Weather Query MCP Spec
  • Each level adds more context and constraints, enabling more precise AI guidance

2๏ธโƒฃ Modular Composition

  • Specifications are independent, reusable modules that can be composed in two ways:
    • Compose specs: Combine sub-domain specs into a complete domain spec (Full-stack Web = Frontend + Backend + Database)
    • Compose usage: Apply multiple specs to one project (MetaSpec uses SDS + SDD; MCP project uses MCP + Python + Testing)
  • This enables flexible reuse across different contexts and domains

Together, these create a flexible specification network where AI agents navigate domain knowledge through structured specs, combining them as needed to produce exactly what you envision.


๐Ÿ“ฆ Features

Simple, powerful commands:

Command Description
metaspec init [name] ๐Ÿš€ Create spec-driven speckit (interactive or template-based)
metaspec search <query> ๐Ÿ” Search community speckits
metaspec install <name> ๐Ÿ“ฆ Install speckit from community
metaspec list ๐Ÿ“‹ List installed speckits
metaspec info <name> โ„น๏ธ Show speckit information
metaspec contribute <name> ๐Ÿค Contribute to community registry

Common usage:

# Create speckit (interactive)
metaspec init

# Create with template (fast)
metaspec init my-api-speckit --template api

# Preview before creating
metaspec init my-spec-kit --template mcp --dry-run

# Discover and install speckits
metaspec search "api"                # Search community
metaspec install api-speckit         # Install from community
metaspec list                        # List installed speckits

# Use installed speckits directly
api-speckit info                     # Direct usage (no metaspec prefix!)

What you get: CLI tools, parser, validator, templates, AGENTS.md, constitution, and full Python package structure.

๐ŸŒŸ Generated Speckits

MetaSpec generates independent, production-ready toolkits:

# Each generated speckit is a standalone CLI tool
cd my-speckit
./scripts/init.sh              # Install dependencies
my-speckit info                # Use directly (no metaspec prefix!)

# Generated speckits include built-in MetaSpec commands (AI-assisted development)
# MetaSpec Commands: /metaspec.sds.*, /metaspec.sdd.*, /metaspec.* (16 commands total)

Key Principle: MetaSpec is a generator, not a runtime. Generated speckits are independent tools.

Built-in MetaSpec Workflow: Every speckit includes 16 MetaSpec commands for complete development lifecycle (5 SDS + 8 SDD + 3 Evolution)


๐ŸŒ Community

Discover and share speckits with the community:

๐Ÿ“ฆ Awesome Spec Kits - A curated list of community speckits

For Users

# Search community speckits
metaspec search "api validation"

# Install from community
metaspec install <speckit-name>

# List installed speckits
metaspec list

# Get detailed information
metaspec info <command>

For Developers

# Contribute your speckit
metaspec contribute my-speckit
# โ†’ Generates metadata JSON
# โ†’ Submit PR to awesome-spec-kits

Join the community:


๐Ÿค– AI Assistant Ready

MetaSpec is designed for AI agents with strong reasoning capabilities. Speckit creation requires meta-level system design, entity modeling, and domain research.

๐Ÿ‘‰ Complete AI workflow guide: AGENTS.md


๐Ÿค Works Well With

MetaSpec generates speckits. Since generated speckits are also projects, you can use spec-driven methodologies to develop them.

Tool Purpose Built-in? Access Method
MetaSpec Commands Complete spec-driven workflow (16 commands) โœ… Yes /metaspec.sds.*, /metaspec.sdd.*, /metaspec.* slash commands in generated speckits

Complete Workflow:

# 1๏ธโƒฃ CREATE: Generate speckit
metaspec init my-spec-kit --template generic

# 2๏ธโƒฃ DEVELOP: Use built-in MetaSpec slash commands (no installation needed)
cd my-spec-kit

# SDS Commands (5) - Define protocol specification
# /metaspec.sds.constitution - Define protocol principles
# /metaspec.sds.specify      - Define protocol entities and operations
# /metaspec.sds.clarify      - Resolve protocol ambiguities
# /metaspec.sds.checklist    - Generate quality checklist for protocol
# /metaspec.sds.analyze      - Check protocol consistency

# SDD Commands (8) - Develop spec-driven toolkit
# /metaspec.sdd.constitution - Define toolkit principles
# /metaspec.sdd.specify      - Define toolkit specifications
# /metaspec.sdd.clarify      - Resolve toolkit ambiguities
# /metaspec.sdd.plan         - Plan implementation architecture
# /metaspec.sdd.tasks        - Generate actionable task lists
# /metaspec.sdd.implement    - Execute implementation
# /metaspec.sdd.checklist    - Validate specification quality
# /metaspec.sdd.analyze      - Analyze consistency

# Evolution Commands (3) - Controlled changes (shared)
# /metaspec.proposal "change" --type sds|sdd - Create change proposals
# /metaspec.apply <proposal-id>              - Apply approved changes
# /metaspec.archive <proposal-id>            - Archive completed changes

Advantages:

  • โœ… Complete workflow built-in - Everything you need from day one
  • โœ… AI-assisted - MetaSpec commands guide development
  • โœ… No external dependencies - All tools included

๐Ÿš€ Ecosystem Vision

MetaSpec is not just a generatorโ€”it's a platform for speckits:

  1. Create speckits with metaspec init
  2. Develop with built-in MetaSpec commands
  3. Publish to community registry
  4. Install and use directly - no prefix needed!
# Example: Developer workflow
metaspec init api-speckit --template generic
cd api-speckit
# ... develop using MetaSpec commands ...
metaspec contribute api-speckit

# User workflow  
metaspec search "api"
metaspec install api-speckit

# Use directly (no metaspec prefix!)
api-speckit init my-api.json
api-speckit validate my-api.json

Future roadmap: Enhanced community features, version management, analytics

๐Ÿ“– Complete guide: See AGENTS.md


๐Ÿ“– Example

Quick Example: Create an API Speckit

# Step 1: Create speckit (interactive mode)
metaspec init
# Or use template mode for quick start
metaspec init api-spec-kit --template generic

# Step 2: What you get
# api-spec-kit/
#   โ”œโ”€โ”€ src/api_spec_kit/          # Python package
#   โ”‚   โ”œโ”€โ”€ cli/                    # CLI commands
#   โ”‚   โ”œโ”€โ”€ parser.py               # Parser
#   โ”‚   โ””โ”€โ”€ validator.py            # Validator
#   โ”œโ”€โ”€ .metaspec/
#   โ”‚   โ”œโ”€โ”€ commands/               # MetaSpec commands (11 total)
#   โ”‚   โ””โ”€โ”€ templates/              # MetaSpec templates
#   โ”œโ”€โ”€ specs/                      # Feature specifications
#   โ”œโ”€โ”€ templates/                  # User project templates
#   โ”œโ”€โ”€ AGENTS.md                   # AI workflow guide
#   โ”œโ”€โ”€ README.md                   # User documentation
#   โ””โ”€โ”€ pyproject.toml              # Package config

Develop the Generated Speckit

# Step 3: Install
cd api-spec-kit
pip install -e .

# Step 4: Define and implement using MetaSpec commands (in Cursor/AI editor)
# Phase 1: Define protocol (SDS)
# /metaspec.sds.constitution  - Define protocol principles
# /metaspec.sds.specify       - Define protocol entities and operations
# /metaspec.sds.analyze       - Check protocol consistency

# Phase 2: Develop toolkit (SDD)
# /metaspec.sdd.constitution  - Define toolkit principles
# /metaspec.sdd.specify       - Define toolkit specifications
# /metaspec.sdd.plan          - Plan implementation architecture
# /metaspec.sdd.tasks         - Break down implementation tasks
# /metaspec.sdd.implement     - Implement your speckit

๐Ÿ“‚ More examples: See examples/ (MCP, API testing, design systems)


๐Ÿ› ๏ธ Commands

# Generation
metaspec init [NAME] [OPTIONS]     # Create speckit (interactive or template-based)

# Community
metaspec search <query>            # Search community speckits
metaspec install <name>            # Install from community
metaspec contribute <name>         # Contribute to community

# Information
metaspec list                      # List installed speckits
metaspec info <name>               # Show speckit details
metaspec version                   # Show MetaSpec version

# Examples
metaspec init                      # Interactive mode
metaspec init my-speckit --template generic
metaspec search "api"              # Search community
metaspec install api-speckit       # Install
metaspec list                      # List installed

Use metaspec --help or metaspec <command> --help for detailed options


๐Ÿงช Development

# Clone and install
git clone https://github.com/ACNet-AI/MetaSpec.git && cd MetaSpec
uv pip install -e ".[dev]"

# Run tests
uv run pytest                  # 138 tests, 69% coverage

# Code quality checks
uv run ruff check .            # Lint
uv run mypy src/metaspec       # Type check

๐Ÿ“– Contributing Guide


๐Ÿ“š Documentation


๐Ÿ—๏ธ Status

v0.1.0 - Alpha Release ๐ŸŽ‰

Core features complete: YAML validation, multi-domain generation, CLI tools, AI agent support, built-in MetaSpec commands (16 commands: 5 SDS + 8 SDD + 3 Evolution), unified spec interface.


๐Ÿค Contributing

Contributions welcome! See contributing.md for guidelines.

git clone https://github.com/ACNet-AI/MetaSpec.git
git checkout -b feature/your-feature
# Make changes, test, commit
git push origin feature/your-feature

๐Ÿ“„ License

MIT License - see LICENSE


๐Ÿ™ Acknowledgments

Inspired by Spec-Kit, Protocol Buffers, and OpenAPI.


Built for the Spec-Driven Development Community

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

meta_spec-0.1.3.tar.gz (166.5 kB view details)

Uploaded Source

Built Distribution

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

meta_spec-0.1.3-py3-none-any.whl (213.6 kB view details)

Uploaded Python 3

File details

Details for the file meta_spec-0.1.3.tar.gz.

File metadata

  • Download URL: meta_spec-0.1.3.tar.gz
  • Upload date:
  • Size: 166.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for meta_spec-0.1.3.tar.gz
Algorithm Hash digest
SHA256 6b45e1af35dd6f30c4d6c61048ab5c2d910db686b18d75e1edc63bbf2e974f1b
MD5 b46432604c35defd9f7d5d17124db221
BLAKE2b-256 bb6b883785b3150d77d7896f6f3471be23691742a2541568c220dbae2c08f321

See more details on using hashes here.

File details

Details for the file meta_spec-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: meta_spec-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 213.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for meta_spec-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 69418428181af66d5ab4fa4a8a3f32ef5e428055c29136c39b2df2fe79e66721
MD5 5efbc0f692fc01c43fb70ecb18f6e2d2
BLAKE2b-256 da2347b0359491f72a8538564e9c80d39c77f9430a87662f1d0bbe6f5991dd39

See more details on using hashes here.

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