ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified developer tools Safety 4/5

baml-codegen

Use when generating BAML code for type-safe LLM extraction, classification, RAG, or agent workflows - creates complete .baml files with types, functions, clients, tests, and framework integrations from natural language requirements. Queries official BoundaryML repositories via MCP for real-time patterns. Supports multimodal inputs (images, audio), Python/TypeScript/Ruby/Go, 10+ frameworks, 50-70% token optimization, 95%+ compilation success.

Why use this skill?

Generate professional-grade BAML code for LLM extraction, classification, and agent workflows. Create type-safe schemas for Python, TS, and more.

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/killerapp/baml-codegen
Or

What This Skill Does

The baml-codegen skill provides a specialized interface for generating high-fidelity, type-safe BAML (Boundary AI Markup Language) code. It functions as an automated architect for your LLM-integrated applications, handling everything from data model definitions to complex agent workflows. By interacting with this skill, developers can translate natural language requirements into robust .baml files that define how data is extracted, classified, or retrieved. It bridges the gap between unstructured LLM outputs and structured, type-safe code for Python, TypeScript, Ruby, and Go. The skill leverages real-time pattern matching via MCP to ensure your implementation adheres to BoundaryML best practices, resulting in code that is resilient, performant, and ready for production.

Installation

To integrate this skill into your environment, use the OpenClaw command-line interface: clawhub install openclaw/skills/skills/killerapp/baml-codegen Ensure you have the baml-cli installed in your project path, as the generated files rely on the local compiler to produce the necessary client SDKs.

Use Cases

  • Structured Data Extraction: Automatically map unstructured text, PDFs, or multimodal inputs (images/audio) into validated JSON schemas.
  • Multi-Step Agent Workflows: Build complex reasoning chains for agents using LangGraph integrations with explicit state transition schemas.
  • Resilient LLM Pipelines: Implement automatic retry policies, fallback models (e.g., fast/cheap vs. slow/reliable), and input/output validation for production stability.
  • RAG Architectures: Define schema-based retrieval patterns that enforce citation requirements and source accuracy.

Example Prompts

  1. "Generate a BAML class for a Customer Support Ticket with fields for sentiment, urgency, and category. Include an enum for priority and a function that uses GPT-4o for classification."
  2. "I need a multimodal extraction function that takes an image of an invoice and returns a total amount as a float and a list of line items. Use a fallback client strategy."
  3. "Help me refactor my BAML file to implement a retry policy for my OpenAI client and add an assertion to ensure the total price is always greater than zero."

Tips & Limitations

  • Schema First: Always prioritize your data model definitions in baml_src/. Think of the schema as the prompt itself; BAML's compiler handles the complex string-to-type parsing.
  • Immutability of Client Files: Never manually edit the files inside baml_client/. These are automatically generated and will be overwritten during the build process.
  • Iterative Testing: Utilize baml-cli test frequently during development to validate your prompts against edge cases without deploying your entire application stack.
  • Context Awareness: The skill works best when provided with the specific target language (e.g., Python or TypeScript) and the intended orchestration framework (e.g., FastAPI, Next.js).

Metadata

Author@killerapp
Stars1776
Views1
Updated2026-03-02
View Author Profile
AI Skill Finder

Not sure this is the right skill?

Describe what you want to build — we'll match you to the best skill from 16,000+ options.

Find the right skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-killerapp-baml-codegen": {
      "enabled": true,
      "auto_update": true
    }
  }
}

Tags(AI)

#baml#llm-ops#type-safety#code-generation#structured-data
Safety Score: 4/5

Flags: file-write, file-read, code-execution

Related Skills

agentskills-io

Create, validate, and publish Agent Skills following the official open standard from agentskills.io. Use when (1) creating new skills for AI agents, (2) validating skill structure and metadata, (3) understanding the Agent Skills specification, (4) converting existing documentation into portable skills, or (5) ensuring cross-platform compatibility with Claude Code, Cursor, GitHub Copilot, and other tools.

killerapp 1776

aws-agentcore-langgraph

Deploy production LangGraph agents on AWS Bedrock AgentCore. Use for (1) multi-agent systems with orchestrator and specialist agent patterns, (2) building stateful agents with persistent cross-session memory, (3) connecting external tools via AgentCore Gateway (MCP, Lambda, APIs), (4) managing shared context across distributed agents, or (5) deploying complex agent ecosystems via CLI with production observability and scaling.

killerapp 1776

adversarial-coach

Adversarial implementation review based on Block's g3 dialectical autocoding research. Use when validating implementation completeness against requirements with fresh objectivity.

killerapp 1776

chain-of-density

Iteratively densify text summaries using Chain-of-Density technique. Use when compressing verbose documentation, condensing requirements, or creating executive summaries while preserving information density.

killerapp 1776

copywriter

Write compelling UX copy, marketing content, and product messaging. Use when writing button labels, error messages, landing pages, emails, CTAs, empty states, tooltips, or any user-facing text.

killerapp 1776