policyengine-api-v2
PolicyEngine API v2 - Next-generation microservices architecture with monorepo structure
What this skill does
# 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:**
```bash
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:**
```bash
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:**
```bash
# 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:**
```bash
# 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:**
```bash
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:**
```bash
# 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:**
```bash
# Install dependencies
uv pip install -e .
# Add a dependency
uv add package-name
# Sync dependencies
uv sync
```
### Supabase Integration
**To see current Supabase setup:**
```bash
# 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:**
```python
# 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:**
```bash
# 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 design tokens:**
```bash
# Design tokens currently live in PolicyEngine frontend repos, not a public npm package.
# Inspect local/workspace token sources instead of installing an unclaimed package name.
rg "design.*token|designTokens" ../policyengine-app-v2 ../policyengine-ui-kit package.json
# If a repo defines a local workspace package, install it by explicit local path.
bun add ./path/to/design-tokens
```
### OpenAPI Specification
**To see current API spec generation:**
```bash
# 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:**
```bash
ls -la tests/
cat pytest.ini # or pyproject.toml for pytest config
```
**Run tests:**
```bash
# 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) |
|--------|---------------------|-------------------|
| Structure | Single Flask app | Multiple services |
| Database | Redis + Cloud SQL | Supabase (PostgreSQL) |
| Deployment | Google App Engine | Docker containers |
| Package manager | pip | uv |
| Python version | 3.9+ | 3.13+ |
**To understand migration patterns:**
```bash
# Compare endpoint implementations
# v1: policyengine-api/policyengine_api/endpoints/
# v2: api-full/endpoints/ (or similar)
# See what's been ported
git log --grep="migrate\|port" --oneline
```
### Common Development Tasks
**Task 1: Add New Endpoint to api-full**
1. **Find current endpoint pattern:**
```bash
# Look at existing endpoints
ls api-full/endpoints/ # or api-full/routes/
cat api-full/endpoints/example.py
```
2. **Follow the pattern** (likely FastAPI or Flask)
3. **Update OpenAPI spec** (may be auto-generated)
4. **Add tests:**
```bash
cat tests/test_endpoints.py
```
**Task 2: Work with Supabase**
```bash
# See current database schema
cat supabase/migrations/*.sql # if using migrations
# Test database locally
docker-compose up supabase # if in docker-compose
```
**Task 3: Use Design Tokens**
```bash
# Check if design tokens are integrated
grep -r "design.*token" .
# If using from app-v2, import them:
# (Actual implementation depends on current setup)
```
### Environment Variables
**To see required environment variables:**
```bash
cat .env.example
# Common variables:
# - SUPABASE_URL
# - SUPABASE_KEY
# - DATABASE_URL
# - API_PORT (8081, 8082, 8083)
```
### Monorepo Best Practices
**To see current monorepo structure:**
```bash
# List all services
ls -d */
# Check for shared code
ls shared/ common/ lib/ # (if exists)
# See inter-service dependencies
grep -r "../api-" pyproject.toml
```
**Pattern:**
- Each service should be independently deployable
- Shared code goes in `shared/` or similar
- Each service has its own tests
- Docker Compose for local multi-service development
## Related Skills
- **policyengine-api-skill** - v1 API patterns (for migration reference)
- **policyengine-core-skill** - Understanding the simulation engine
- **policyengine-us-skill** - Country model integration
- **policyengine-design-skill** - Design tokens and branding
- **policyengine-standards-skill** - Code quality standards
## Resources
**Repository:** https://github.com/PolicyEngine/policyengine-api-v2
**Related:**
- v1 API: https://github.com/PolicyEngine/policyengine-api
- App v2 (design tokens): https://github.com/PolicyEngine/policyengine-app-v2
- Supabase: https://supabase.com/docs
## Development Status
โ ๏ธ **Important:** API v2 is in active development. Always check the repository RERelated in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only โ no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.