From ark
Regenerates and debugs types in ARK stack from Kubernetes CRDs through Python SDK/Pydantic FastAPI models to TypeScript dashboard. Fixes type errors, schema mismatches, and adds SDK overlays.
npx claudepluginhub mckinsey/agents-at-scale-ark --plugin arkThis skill uses the workspace's default tool permissions.
Types flow through the ARK stack:
Applies Acme Corporation brand guidelines including colors, fonts, layouts, and messaging to generated PowerPoint, Excel, and PDF documents.
Builds DCF models with sensitivity analysis, Monte Carlo simulations, and scenario planning for investment valuation and risk assessment.
Calculates profitability (ROE, margins), liquidity (current ratio), leverage, efficiency, and valuation (P/E, EV/EBITDA) ratios from financial statements in CSV, JSON, text, or Excel for investment analysis.
Types flow through the ARK stack:
CRD YAML (ark/config/crd/)
↓ make ark-sdk-build (automatic)
ark-sdk Python types + overlay utilities
↓
ark-api Pydantic models (manual updates if exposing new fields)
↓ make ark-api-build → generates openapi.json
ark-dashboard TypeScript types
↓ npm run generate:api → generates types.ts
CRD types are automatically generated from Kubernetes CRD YAML files.
make ark-sdk-build
This runs:
crd_to_openapi.py - converts CRDs to OpenAPI schemaopenapi-generator-cli - generates Python types from schemaThe lib/ark-sdk/gen_sdk/overlay/python/ark_sdk/ directory contains custom Python modules that are copied on top of generated code. This is how utilities like client.py, k8s.py, and executor.py are added.
To add custom SDK functionality:
lib/ark-sdk/gen_sdk/overlay/python/ark_sdk/make ark-sdk-buildThe ark-api has manually written Pydantic models in services/ark-api/ark-api/src/ark_api/models/.
When to update ark-api models:
make ark-api-build
This generates services/ark-api/openapi.json from FastAPI routes and Pydantic models.
Pydantic model class names MUST be globally unique across all model files. When multiple files define classes with the same name (e.g., ConfigMapKeyRef, Header, ValueFrom), FastAPI generates non-deterministic OpenAPI schema names like ark_api__models__agents__Header-Input. These names depend on import order and cause CI failures when types.ts differs between environments.
Solution: Prefix class names with their domain context:
| File | Naming Pattern | Examples |
|---|---|---|
agents.py | Agent* | AgentHeader, AgentValueFrom, AgentParameter |
mcp_servers.py | MCPServer* | MCPServerHeader, MCPServerValueSource |
queries.py | Query* | QueryParameter, QueryLabelSelector |
models.py | Model* | ModelValueSource |
Safety net: generate_openapi.py fails if any schema name contains __models__, catching collisions at build time.
See: https://github.com/mckinsey/agents-at-scale-ark/issues/656
cd services/ark-dashboard/ark-dashboard
cp ../../ark-api/openapi.json ../out/
npm run generate:api
npm run build # verify types compile
When you see:
Property 'SomeSchema' does not exist on type
grep "SomeSchema" services/ark-dashboard/ark-dashboard/lib/api/generated/types.ts
If you see schema names with __models__ pattern (e.g., ark_api__models__agents__Header-Input):
__models__ name - fix the root cause| File | Purpose |
|---|---|
ark/config/crd/bases/*.yaml | Source of truth - Kubernetes CRDs |
lib/ark-sdk/gen_sdk/overlay/ | Custom SDK utilities (copied on top of generated) |
services/ark-api/ark-api/src/ark_api/models/ | Manually written Pydantic models |
services/ark-api/ark-api/generate_openapi.py | Generates openapi.json with collision safety net |
services/ark-api/openapi.json | Generated OpenAPI spec from FastAPI |
services/ark-dashboard/out/openapi.json | Copy used for dashboard type generation |
services/ark-dashboard/ark-dashboard/lib/api/generated/types.ts | Generated TypeScript types |