policyengine-api-v2
БесплатноБез исполняемых скриптовНе проверенPolicyEngine API v2 - Next-generation microservices architecture with monorepo structure
от FDU-INS★ 84 звезды на GitHubОб этом скилле
PolicyEngine API v2
The next-generation PolicyEngine API is a monorepo containing multiple microservices built with modern Python tooling.
For Users
What is API v2?
API v2 is the next generation of the PolicyEngine API, currently in active development. When complete, it will replace the current Flask API with a more scalable, maintainable microservices architecture.
Status: 🚧 Active development (not yet in production)
Key improvements over v1:
- Microservices architecture for better scalability
- Modern Python tooling (Python 3.13+, uv package manager)
- Docker-based development and deployment
- Auto-generated OpenAPI specs and clients
- Supabase for database management
For Analysts
When to Use v2
Currently, analysts should continue using the v1 API at https://api.policyengine.org.
API v2 is not yet ready for production use. Check the repository README for the latest status.
For Contributors
Repository
Location: PolicyEngine/policyengine-api-v2
Clone:
git clone https://github.com/PolicyEngine/policyengine-api-v2
cd policyengine-api-v2
Architecture Overview
API v2 is a monorepo containing multiple microservices:
To see current structure:
tree -L 2 .
# Expected structure:
# ├── api-full/ - Main API (port 8081)
# ├── api-simulation/ - Economic simulation (port 8082)
# ├── api-tagger/ - Deployment management (port 8083)
# ├── docker-compose.yml
# └── shared/ - Shared utilities
Microservices
1. api-full (port 8081)
- Main API service
- Household calculations
- Policy management
- Most endpoints from v1
2. api-simulation (port 8082)
- Economic simulation engine
- Population-wide impact calculations
- Resource-intensive operations
3. api-tagger (port 8083)
- Deployment management
- Version tagging
- Release coordination
Technology Stack
To see current dependencies:
# Check pyproject.toml in each service
cat api-full/pyproject.toml
cat api-simulation/pyproject.toml
cat api-tagger/pyproject.toml
Key technologies:
- Python 3.13+ - Latest Python version
- uv - Fast Python package manager
- Docker + Docker Compose - Local development and deployment
- Supabase - PostgreSQL database with auth
- OpenAPI - API specification generation
- FastAPI or Flask - (check current implementation)
Development Setup
To start all services locally:
# See current docker-compose setup
cat docker-compose.yml
# Start services
docker-compose up
# Services should be available at:
# - http://localhost:8081 (api-full)
# - http://localhost:8082 (api-simulation)
# - http://localhost:8083 (api-tagger)
Alternative: Run individual service:
cd api-full
uv pip install -e .
python main.py # or whatever the entry point is
Package Management with uv
API v2 uses uv instead of pip for faster dependency management:
To see current uv usage:
# Check if uv is used
cat pyproject.toml | grep -A 5 "tool.uv"
# Or check for uv.lock files
find . -name "uv.lock"
Common uv commands:
# Install dependencies
uv pip install -e .
# Add a dependency
uv add package-name
# Sync dependencies
uv sync
Supabase Integration
To see current Supabase setup:
# Check for Supabase configuration
cat .env.example | grep SUPABASE
grep -r "supabase" . --include="*.py" | head -10
# Supabase client initialization
grep -r "create_client" . --include="*.py"
Common patterns:
# Example (check actual implementation)
from supabase import create_client
supabase = create_client(supabase_url, supabase_key)
# Query
result = supabase.table('policies').select('*').execute()
# Insert
supabase.table('policies').insert({'data': policy}).execute()
Design Tokens Integration
API v2 may integrate with design tokens from policyengine-app-v2:
To check design token usage:
# Look for design token imports
grep -r "design.*token\|designTokens" . --include="*.py"
grep -r "@policyengine/design" package.json
# Check if tokens are in dependencies
cat package.json | grep -A 5 "dependencies"
If using npm design tokens:
# Design tokens from app-v2
bun install @policyengine/design-tokens
OpenAPI Specification
To see current API spec generation:
# Look for OpenAPI/Swagger setup
grep -r "openapi\|swagger" . --include="*.py"
# Check for spec files
find . -name "openapi*.json" -o -name "openapi*.yaml"
# If using FastAPI, specs auto-generated at /docs
Testing
To see current test setup:
ls -la tests/
cat pytest.ini # or pyproject.toml for pytest config
Run tests:
# All services
pytest
# Specific service
cd api-full && pytest
# With docker-compose
docker-compose run api-full pytest
Migration from v1
Key architectural differences:
| Aspect | v1 (Flask monolith) | v2 (Microservices) | |--------|-----
Установить policyengine-api-v2 в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл policyengine-api-v2?
PolicyEngine API v2 - Next-generation microservices architecture with monorepo structure
Как установить скилл policyengine-api-v2?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл policyengine-api-v2 запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic