# Send baml-codegen to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "baml-codegen",
    "name": "baml-codegen",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/killerapp/baml-codegen",
    "canonicalUrl": "https://clawhub.ai/killerapp/baml-codegen",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/baml-codegen",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=baml-codegen",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "SKILL.md",
      "assets/agents/README.md",
      "assets/classification/README.md",
      "assets/extraction/README.md",
      "assets/integrations/README.md",
      "assets/rag/README.md"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "slug": "baml-codegen",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-11T17:57:46.026Z",
      "expiresAt": "2026-05-18T17:57:46.026Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=baml-codegen",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=baml-codegen",
        "contentDisposition": "attachment; filename=\"baml-codegen-2.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "baml-codegen"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/baml-codegen"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/baml-codegen",
    "downloadUrl": "https://openagent3.xyz/downloads/baml-codegen",
    "agentUrl": "https://openagent3.xyz/skills/baml-codegen/agent",
    "manifestUrl": "https://openagent3.xyz/skills/baml-codegen/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/baml-codegen/agent.md"
  }
}
```
## Documentation

### BAML Code Generation

Generate type-safe LLM extraction code. Use when creating structured outputs, classification, RAG, or agent workflows.

### Golden Rules

NEVER edit baml_client/ - 100% generated, overwritten on every baml-cli generate; check baml_src/generators.baml for output_type (python, typescript, ruby, go)
ALWAYS edit baml_src/ - Source of truth for all BAML code
Run baml-cli generate after changes - Regenerates typed client code for target language

### Philosophy (TL;DR)

Schema Is The Prompt - Define data models first, compiler injects types
Types Over Strings - Use enums/classes/unions, not string parsing
Fuzzy Parsing Is BAML's Job - BAML extracts valid JSON from messy LLM output
Transpiler Not Library - Write .baml → generate native code (Python/TypeScript/Ruby/Go), no runtime dependency
Test-Driven Prompting - Use VS Code playground or baml-cli test to iterate

### Workflow

Analyze → Pattern Match (MCP) → Validate → Generate → Test → Deliver
         ↓ [IF ERRORS] Error Recovery (MCP) → Retry

### BAML Syntax

ElementExampleClassclass Invoice { total float @description("Amount") @assert(this > 0) @alias("amt") }Enumenum Category { Tech @alias("technology") @description("Tech sector"), Finance, Other }Functionfunction Extract(text: string, img: image?) -> Invoice { client GPT5 prompt #"{{ text }} {{ img }} {{ ctx.output_format }}"# }Clientclient<llm> GPT5 { provider openai options { model gpt-5 } retry_policy Exponential }Fallbackclient<llm> Resilient { provider fallback options { strategy [FastModel, SlowModel] } }

### Types

Primitives: string, int, float, bool | Multimodal: image, audio
Containers: Type[] (array), Type? (optional), map<string, Type> (key-value)
Composite: Type1 | Type2 (union), nested classes
Annotations: @description("..."), @assert(condition), @alias("json_name"), @check(name, condition)

### Providers

openai, anthropic, gemini, vertex, bedrock, ollama + any OpenAI-compatible via openai-generic

### Pattern Categories

PatternUse CaseModelFramework MarkersExtractionUnstructured → structuredGPT-5fastapi, next.jsClassificationCategorizationGPT-5-minianyRAGAnswers with citationsGPT-5langgraphAgentsMulti-step reasoningGPT-5langgraphVisionImage/audio data extractionGPT-5-Visionmultimodal

### Resilience

retry_policy: retry_policy Exp { max_retries 3 strategy { type exponential_backoff } }
fallback client: Chain models [FastCheap, SlowReliable] for cost/reliability tradeoff

### MCP Indicators

Found patterns from baml-examples | Validated against BoundaryML/baml | Fixed errors using docs | MCP unavailable, using fallback

### Output Artifacts

BAML Code - Complete .baml files (types, functions, clients, retry_policy)
Tests - pytest/Jest with 100% function coverage
Integration - Framework-specific client code (LangGraph nodes, FastAPI endpoints, Next.js API routes)
Metadata - Pattern used, token count, cost estimate

### References

providers.md - OpenAI, Anthropic, Google, Ollama, Azure, Bedrock, openai-generic
types-and-schemas.md - Full type system, classes, enums, unions, map, image, audio
validation.md - @assert, @check, @alias, block-level @@assert
patterns.md - Pattern library with code examples
philosophy.md - BAML principles, golden rules
mcp-interface.md - Query workflow, caching
languages-python.md - Python/Pydantic, async
languages-typescript.md - TypeScript, React/Next.js
frameworks-langgraph.md - LangGraph integration
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: killerapp
- Version: 2.0.0
## Source health
- Status: healthy
- Item download looks usable.
- Yavira can redirect you to the upstream package for this item.
- Health scope: item
- Reason: direct_download_ok
- Checked at: 2026-05-11T17:57:46.026Z
- Expires at: 2026-05-18T17:57:46.026Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/baml-codegen)
- [Send to Agent page](https://openagent3.xyz/skills/baml-codegen/agent)
- [JSON manifest](https://openagent3.xyz/skills/baml-codegen/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/baml-codegen/agent.md)
- [Download page](https://openagent3.xyz/downloads/baml-codegen)