Markdown-to-code generation system for LLM coding agents
Project description
blueprints.md ๐๏ธ
AI-Powered Code Generation from Markdown Blueprints
Transform your software architecture into production code using an agentic AI approach. Write markdown blueprints, let Claude handle the implementation details with intelligent verification and self-correction.
graph TD
A[๐ Write Blueprint.md] --> B[๐ค Claude Analyzes Structure]
B --> C[๐ง Intelligent Code Generation]
C --> D[โ
Multi-Stage Verification]
D --> E{Passes All Checks?}
E -->|No| F[๐ง Self-Correction]
F --> C
E -->|Yes| G[๐ฆ Production Code]
D --> D1[Syntax Check]
D --> D2[Import Validation]
D --> D3[Blueprint Requirements]
style A fill:#e1f5fe
style G fill:#c8e6c9
style F fill:#fff9c4
๐ The Agentic Approach
Unlike traditional code generators, blueprints.md uses an agentic AI system that:
- ๐ง Understands Context - Claude analyzes your entire project structure
- ๐ Verifies Correctness - Multi-stage verification catches issues before you do
- ๐ง Self-Corrects - Automatically fixes import errors and missing dependencies
- ๐ Learns & Adapts - Improves generation quality over time
- โก Processes Concurrently - Parallel blueprint processing for speed
๐ฏ Quick Example
# Write this blueprint ๐
๐ api/tasks.md
# api.tasks
Task CRUD operations with authentication.
Dependencies: @./models/task, @./auth
Requirements:
- FastAPI router for task endpoints
- Authentication required for all operations
- Full CRUD operations (create, read, update, delete)
- Filter tasks by user
- Proper error handling and validation
- Async database operations
Features:
- Get all tasks for authenticated user
- Create new task with validation
- Update existing task (owner only)
- Delete task (owner only)
- Mark task as completed
- Filter tasks by status
# Run this command ๐
uvx blueprints-md generate api/tasks.md
# Or if installed globally
pip install blueprints-md
blueprints generate api/tasks.md
# Get production-ready code with:
โ
Proper imports (auto-detected)
โ
Error handling
โ
Type hints
โ
Logging
โ
Database transactions
โ
Authentication checks
โ
200+ lines of production FastAPI code
๐๏ธ How It Works - The Agentic Pipeline
sequenceDiagram
participant U as User
participant B as Blueprints CLI
participant P as Parser
participant G as Generator
participant V as Verifier
participant C as Claude AI
U->>B: blueprints generate-project
B->>P: Parse all .md files
P->>P: Build dependency graph
P->>G: Process in parallel
par For each blueprint
G->>C: Generate code with context
C->>G: Return implementation
G->>V: Verify code
V->>V: Check syntax
V->>V: Validate imports
V->>C: Verify requirements
alt Verification fails
V->>G: Request fixes
G->>C: Fix issues
end
end
G->>U: Output production code
๐ Agentic Features
1. Intelligent Import Resolution
The system uses Claude to dynamically detect and fix import issues:
# Claude detects: ValidationError imported from wrong module
# Auto-corrects: from pydantic import ValidationError โ
# Not: from fastapi.exceptions import ValidationError โ
2. Concurrent Processing
Blueprints are processed in parallel using ThreadPoolExecutor:
# Old: Sequential processing (slow)
for blueprint in blueprints:
generate(blueprint) # 5 files = 5x time
# New: Concurrent processing (fast!)
with ThreadPoolExecutor() as executor:
executor.map(generate, blueprints) # 5 files = 1x time
3. Self-Healing Code Generation
When verification fails, the system automatically attempts fixes:
graph LR
A[Generate Code] --> B{Verify}
B -->|Pass| C[โ
Done]
B -->|Fail| D[Analyze Error]
D --> E[Generate Fix]
E --> B
4. Context-Aware Generation
Each file is generated with full awareness of:
- Project structure
- Dependencies
- Existing code patterns
- Framework conventions
๐จ AI-First Possibilities
1. Natural Language Blueprints
# services.email
Send emails with templates and retry logic
EmailService:
- Send welcome emails to new users
- Handle bounces and retries
- Use SendGrid in production, mock in tests
- Log all email events
Claude understands intent and generates complete implementation with SendGrid integration, retry decorators, and proper error handling.
2. Architecture from Requirements
# Describe what you want
echo "Build a REST API for a todo app with user auth,
PostgreSQL storage, and Redis caching" > requirements.txt
# Generate entire architecture
blueprints generate-from-requirements requirements.txt
# Get complete project structure with:
๐ generated/
โโโ ๐ main.py # FastAPI app
โโโ ๐ models/ # SQLAlchemy models
โโโ ๐ api/ # REST endpoints
โโโ ๐ services/ # Business logic
โโโ ๐ cache/ # Redis integration
โโโ ๐ docker-compose.yml
3. Cross-Language Generation
# Python blueprint (using uvx for one-off execution)
uvx blueprints-md generate api/users.md --language python
# Same blueprint โ TypeScript
uvx blueprints-md generate api/users.md --language typescript
# Same blueprint โ Go
uvx blueprints-md generate api/users.md --language go
4. Design Pattern Implementation
# patterns.repository
Repository pattern for data access layer.
Dependencies: @./models/user, @./models/task, @./core/database
Requirements:
- Implement repository pattern for data access
- Separate business logic from data persistence
- Support dependency injection
- Include unit of work pattern
- Async operations with SQLAlchemy
User Repository:
- Standard CRUD operations (create, read, update, delete)
- Find user by email address
- Find all active users
- Soft delete support
- Pagination for user lists
Task Repository:
- Standard CRUD operations
- Find tasks by user ID
- Find overdue tasks
- Filter by status and priority
- Bulk operations support
Claude recognizes patterns and generates complete implementations with interfaces, dependency injection, and unit of work.
5. Framework-Aware Generation
# services.payment
Payment processing service with Stripe integration.
Dependencies: @./models/order, @./models/user
Requirements:
- Stripe payment processing
- Webhook handling for payment events
- Refund processing
- Payment method storage (PCI compliant)
- Subscription management
- Invoice generation
Security:
- PCI compliance measures
- Webhook signature verification
- Idempotency key support
Claude understands payment processing requirements and generates secure, production-ready Stripe integration with proper error handling and webhook management.
๐ Getting Started
Installation Options
# Option 1: Use without installation (recommended for trying out)
uvx blueprints-md --help
# Option 2: Install as a tool with uv (recommended for regular use)
uv tool install blueprints-md
blueprints --version
# Option 3: Install with pip
pip install blueprints-md
# Option 4: Install from source
git clone https://github.com/yourusername/blueprints.md
cd blueprints.md && uv sync
Quick Start
# 1. Set your API key
export ANTHROPIC_API_KEY="your-key"
# 2. Generate code from a blueprint (no installation needed!)
uvx blueprints-md generate api/tasks.md
# 3. Create your first blueprint
mkdir my-app && cd my-app
cat > main.md << 'EOF'
# main
FastAPI e-commerce application with async PostgreSQL.
Requirements:
- User authentication with JWT tokens
- Product catalog with categories
- Shopping cart functionality
- Order management system
- Payment processing with Stripe
- Email notifications
- Admin dashboard
Database:
- PostgreSQL with async SQLAlchemy
- Redis for caching and sessions
- Database migrations with Alembic
Security:
- JWT-based authentication
- Role-based access control (RBAC)
- Rate limiting on API endpoints
- Input validation and sanitization
EOF
# 4. Generate your application
uvx blueprints-md generate-project .
# 5. Run it!
make run # Full app running at http://localhost:8000
๐ Real-World Example
# Generate a complete e-commerce backend (no installation needed!)
uvx blueprints-md generate-project examples/ecommerce/
# Or if you have it installed
blueprints generate-project examples/ecommerce/
# You get:
๐ ecommerce/
โโโ ๐ main.py # FastAPI application
โโโ ๐ models/ # 15+ SQLAlchemy models
โ โโโ user.py # User with auth
โ โโโ product.py # Product catalog
โ โโโ order.py # Order management
โ โโโ ...
โโโ ๐ api/ # 20+ REST endpoints
โ โโโ auth.py # JWT authentication
โ โโโ products.py # Product CRUD
โ โโโ cart.py # Shopping cart
โ โโโ checkout.py # Payment processing
โ โโโ ...
โโโ ๐ services/ # Business logic
โ โโโ email.py # Email notifications
โ โโโ payment.py # Stripe integration
โ โโโ inventory.py # Stock management
โ โโโ ...
โโโ ๐ workers/ # Background jobs
โ โโโ email_worker.py # Async email sending
โ โโโ cleanup_worker.py # Data cleanup
โโโ ๐ docker-compose.yml # Full deployment
โโโ ๐ Makefile # Development commands
# One command, production-ready code
make docker-up # Everything running with PostgreSQL, Redis, workers
๐ง Advanced Agentic Features
Blueprint Evolution
The system can suggest improvements to your blueprints:
blueprints analyze my-blueprint.md
# Suggestions:
๐ก Add error handling for external API calls
๐ก Implement caching for expensive operations
๐ก Add rate limiting to public endpoints
๐ก Consider adding pagination for list endpoints
Code Review & Refactoring
# Review existing code and generate improved blueprint
blueprints reverse-engineer src/legacy_code.py
# Refactor using better patterns
blueprints refactor src/legacy_code.py --pattern repository
# Get:
๐ legacy_code.md (cleaned blueprint)
๐ legacy_code_refactored.py (improved implementation)
Incremental Updates
# Modify blueprint
echo "add_payment_method(user_id: int, method: PaymentMethod)" >> api/users.md
# Regenerate only affected code
blueprints update api/users.md
# Smart updates:
โ
Preserves custom code sections
โ
Updates imports automatically
โ
Maintains existing functionality
๐ฌ Why Agentic AI Changes Everything
Traditional Codegen
Template โ Variable Substitution โ Static Output
โ
Limited flexibility
No context awareness
Can't handle complexity
Agentic Approach
Blueprint โ AI Understanding โ Contextual Generation โ Verification โ Self-Correction
โ โ โ โ
Understands intent Aware of full project Ensures quality Fixes own mistakes
๐ Performance Metrics
| Metric | Traditional Dev | Blueprints.md | Improvement |
|---|---|---|---|
| Time to MVP | 2 weeks | 2 hours | 7x faster |
| Lines of boilerplate | 5000+ | 0 | 100% reduction |
| Import errors | Common | Auto-fixed | Zero |
| Test coverage | Manual | Built-in validation | Production-ready |
| Documentation | Often skipped | Always included | 100% coverage |
๐ ๏ธ Configuration
# Core settings
export ANTHROPIC_API_KEY="your-key"
export BLUEPRINTS_MODEL="claude-3-5-sonnet-20241022"
# Advanced options
export BLUEPRINTS_CONCURRENCY=5 # Parallel processing
export BLUEPRINTS_VERIFY_IMPORTS=true # Import validation
export BLUEPRINTS_AUTO_RETRY=true # Automatic fixes
export BLUEPRINTS_AUTO_FIX=true # Auto-fix common issues
export BLUEPRINTS_LANGUAGE="python" # Target language
๐ค Contributing
We welcome contributions! The entire blueprints.md system is self-hosted:
# The CLI itself is built from blueprints
ls src/blueprints/*.md
# Modify a blueprint
vim src/blueprints/verifier.md
# Regenerate the implementation
blueprints generate src/blueprints/verifier.md
# Test your changes
uv run pytest
๐ Roadmap
- IDE Plugins - VS Code, IntelliJ integration
- Blueprint Marketplace - Share and discover blueprints
- Multi-Agent Collaboration - Multiple AI agents working together
- Visual Blueprint Designer - Drag-and-drop architecture design
- Automatic Optimization - Performance improvements suggestions
- Blueprint Versioning - Track architecture evolution
- Team Collaboration - Shared blueprint workspaces
๐ License
MIT - Build whatever you want!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file blueprints_md-1.0.1.tar.gz.
File metadata
- Download URL: blueprints_md-1.0.1.tar.gz
- Upload date:
- Size: 162.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f8fccd61acdc09f99f7121f5b5bd42fd4ed7a22f5c3ba31fb01ba6bf2c11a096
|
|
| MD5 |
b9acc4e6c732044e12838b75870d8fc3
|
|
| BLAKE2b-256 |
c774a4d401f71bfc7d9c2fa0f301e85079dca076366168c8e09fd9663aa5b581
|
Provenance
The following attestation bundles were made for blueprints_md-1.0.1.tar.gz:
Publisher:
publish.yml on vtemian/blueprints.md
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
blueprints_md-1.0.1.tar.gz -
Subject digest:
f8fccd61acdc09f99f7121f5b5bd42fd4ed7a22f5c3ba31fb01ba6bf2c11a096 - Sigstore transparency entry: 390996646
- Sigstore integration time:
-
Permalink:
vtemian/blueprints.md@3d53bd429e0a9de6a67b981fcf81c88c2b29606f -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/vtemian
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3d53bd429e0a9de6a67b981fcf81c88c2b29606f -
Trigger Event:
push
-
Statement type:
File details
Details for the file blueprints_md-1.0.1-py3-none-any.whl.
File metadata
- Download URL: blueprints_md-1.0.1-py3-none-any.whl
- Upload date:
- Size: 72.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f8de69c599c6ca6be1db89bef6c82ab0ac3c9833ac9244d3e931faaf8b1f2f07
|
|
| MD5 |
0c9f31ce1b06ce1f43c6de1ee92a670b
|
|
| BLAKE2b-256 |
dc266462559401e9066e654c93dee22468bdce52e10327509c49f4e58f440beb
|
Provenance
The following attestation bundles were made for blueprints_md-1.0.1-py3-none-any.whl:
Publisher:
publish.yml on vtemian/blueprints.md
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
blueprints_md-1.0.1-py3-none-any.whl -
Subject digest:
f8de69c599c6ca6be1db89bef6c82ab0ac3c9833ac9244d3e931faaf8b1f2f07 - Sigstore transparency entry: 390996668
- Sigstore integration time:
-
Permalink:
vtemian/blueprints.md@3d53bd429e0a9de6a67b981fcf81c88c2b29606f -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/vtemian
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3d53bd429e0a9de6a67b981fcf81c88c2b29606f -
Trigger Event:
push
-
Statement type: