This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
C# SDK for the Leonardo.AI image generation platform, auto-generated from the Leonardo OpenAPI specification using AutoSDK. Published as a NuGet package named LeonardoAI under the tryAGI organization.
# Build the solution
dotnet build Leonardo.slnx
# Build for release (also produces NuGet package)
dotnet build Leonardo.slnx -c Release
# Run integration tests (requires LEONARDO_API_KEY env var)
dotnet test src/tests/Leonardo.IntegrationTests/Leonardo.IntegrationTests.csproj
# Regenerate SDK from OpenAPI spec
cd src/libs/Leonardo && ./generate.shThe SDK code is entirely auto-generated — do not manually edit files in src/libs/Leonardo/Generated/.
src/libs/Leonardo/openapi.yaml— the Leonardo OpenAPI spec (fetched fromhttps://api-docs-nine-delta.vercel.app/cloud/openapi.json)src/helpers/FixOpenApiSpec/— converts OpenAPI 3.1 → 3.0 format for compatibilitysrc/libs/Leonardo/generate.sh— orchestrates: download spec → fix spec → run AutoSDK CLI → output toGenerated/- CI auto-updates the spec every 3 hours and creates PRs if changes are detected
| Project | Purpose |
|---|---|
src/libs/Leonardo/ |
Main SDK library (LeonardoClient) |
src/tests/Leonardo.IntegrationTests/ |
Integration tests against real Leonardo API |
src/helpers/FixOpenApiSpec/ |
OpenAPI spec fixer tool |
src/helpers/GenerateDocs/ |
Documentation generator from integration tests |
src/helpers/TrimmingHelper/ |
NativeAOT/trimming compatibility validator |
- Target:
net10.0(single target) - NuGet Package ID:
LeonardoAI(differs from project nameLeonardo) - Language: C# 13 preview with nullable reference types
- Signing: Strong-named assemblies via
src/key.snk - Versioning: Semantic versioning from git tags (
vprefix) via MinVer - Analysis: All .NET analyzers enabled, AOT/trimming compatibility enforced
- Testing: MSTest + FluentAssertions
- Uses shared workflows from
HavenDV/workflowsrepo - Dependabot updates NuGet packages weekly (auto-merged)
- Documentation deployed to GitHub Pages via MkDocs Material