Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Generate Baml Llm Extraction Code

ASecurity

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 M…

19 stars
0 votes
0 copies
1 views
Added 9/19/2026
ai-agentstypescriptpythongorubyreactnextjsnodefastapiazureapi

Works with

cliapimcp

Security Analysis

A100/100

Scanned 9/19/2026

Install to Claude Code

$npx -y skills add rondoflow/rondoflow --skill generate-baml-llm-extraction-code --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Generate Baml Llm Extraction Code?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Generate Baml Llm Extraction Code
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/rondoflow-generate-baml-llm-extraction-code/badge)](https://www.skillsdirectory.com/skills/rondoflow-generate-baml-llm-extraction-code)

More formats (shields.io, HTML) on the badges page.

Download with Pro
Files
SKILL.md
---
name: generate-baml-llm-extraction-code
description: "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 M…"
category: "AI & Agents"
author: community
version: "2.0.0"
icon: bot
---

# 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

| Element | Example |
|---------|---------|
| Class | `class Invoice { total float @description("Amount") @assert(this > 0) @alias("amt") }` |
| Enum | `enum Category { Tech @alias("technology") @description("Tech sector"), Finance, Other }` |
| Function | `function Extract(text: string, img: image?) -> Invoice { client GPT5 prompt #"{{ text }} {{ img }} {{ ctx.output_format }}"# }` |
| Client | `client<llm> GPT5 { provider openai options { model gpt-5 } retry_policy Exponential }` |
| Fallback | `client<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

| Pattern | Use Case | Model | Framework Markers |
|---------|----------|-------|-------------------|
| Extraction | Unstructured → structured | GPT-5 | fastapi, next.js |
| Classification | Categorization | GPT-5-mini | any |
| RAG | Answers with citations | GPT-5 | langgraph |
| Agents | Multi-step reasoning | GPT-5 | langgraph |
| Vision | Image/audio data extraction | GPT-5-Vision | multimodal |

## 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

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

## References

- [providers.md](references/providers.md) - OpenAI, Anthropic, Google, Ollama, Azure, Bedrock, openai-generic
- [types-and-schemas.md](references/types-and-schemas.md) - Full type system, classes, enums, unions, map, image, audio
- [validation.md](references/validation.md) - @assert, @check, @alias, block-level @@assert
- [patterns.md](references/patterns.md) - Pattern library with code examples
- [philosophy.md](references/philosophy.md) - BAML principles, golden rules
- [mcp-interface.md](references/mcp-interface.md) - Query workflow, caching
- [languages-python.md](references/languages-python.md) - Python/Pydantic, async
- [languages-typescript.md](references/languages-typescript.md) - TypeScript, React/Next.js
- [frameworks-langgraph.md](references/frameworks-langgraph.md) - LangGraph integration

Attribution

rondoflowrondoflow
View sourceMore from rondoflow →
SSkills DirectorySkills Directory

Know which skills are safe — weekly.

Best new skills + every skill we flagged as malicious. From the team that scanned 103,619.

Join free

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Know which skills are safe — weekly.

Best new skills + every skill we flagged as malicious. From the team that scanned 103,619.

Join free

Related Skills

Caveman

Ultra-compressed communication mode that cuts output tokens while keeping technical accuracy. Levels: lite, full, ultra and the wenyan variants. Use for /caveman, "caveman mode", "talk like caveman", "be brief" or "less tokens".

1066601 votes

Hyperplan

Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...

693161 votes

Mcp Code Execution

Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.

3351 votes

catchup

Recovers the conversation and failed tool calls of a previous Codex, Claude Code, Antigravity, Cline, Copilot CLI, Cursor, DeepSeek Harness, Kimi, OpenCode, Pi Agent, or ZCode session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", asks to recover/summarize a previous session before continuing, or asks to diagnose or report a catchup failure. Do NOT use for the current conversation, git history, or any non-agent log.

691 votes

math-skill

A comprehensive mathematical reasoning skill for AI assistants — handles arithmetic to research-level problems with rigorous step-by-step reasoning, systematic verification, and transparent uncertainty handling

381 votes
View all in ai-agents →