Skip to main content
IronClaw includes a powerful software builder that can create tools, applications, and libraries using LLM-driven code generation. Location: src/tools/builder/

Overview

The software builder provides:
  • LLM-driven development: Uses an agent loop similar to Codex for iterative development
  • Multiple software types: WASM tools, CLI apps, libraries, scripts
  • Build loop: Analyze → Scaffold → Implement → Build → Fix → Test → Validate → Package
  • Language support: Rust, Python, JavaScript/TypeScript, Bash
  • WASM tool specialization: Automatic WIT interface compliance and capability generation

Architecture

Location: src/tools/builder/mod.rs:11-24

Build Tool

build_software

Location: src/tools/builder/core.rs Create software using LLM-driven iterative development.
Parameters: Domain: Container
Approval: Always
Rate Limit: 5/min, 20/hour

Software Types

Location: src/tools/builder/core.rs:28-45

WASM Tool

Sandboxed tool that compiles to WebAssembly. Features:
  • Automatic WIT interface implementation
  • Capability file generation
  • Host function usage (log, http, workspace_read)
  • Integration with tool registry
Template: src/tools/builder/templates.rs:WasmToolTemplate

CLI App

Standalone command-line application. Features:
  • Argument parsing (clap for Rust, argparse for Python)
  • Error handling
  • Help documentation
  • Exit codes

Library

Reusable library with public API. Features:
  • Module structure
  • Public API design
  • Documentation
  • Example usage

Script

Single-file executable script. Features:
  • Shebang line
  • Inline dependencies (Rust scripts use cargo-script)
  • Simple execution model

Languages

Location: src/tools/builder/core.rs:47-60

Rust

Build system: Cargo
WASM target: wasm32-wasip2
Package manager: crates.io
Example Cargo.toml:

Python

Package manager: pip
Virtual env: venv
Testing: pytest
Example requirements.txt:

JavaScript/TypeScript

Runtime: Node.js
Package manager: npm
Build tool: esbuild, tsc
Example package.json:

Bash

Interpreter: bash
Testing: bats-core
Example script:

Build Phases

Location: src/tools/builder/core.rs:62-85
Each phase produces a BuildLog entry with details and outputs.

Templates

Location: src/tools/builder/templates.rs

Template Engine

WASM Tool Template

Files generated:
  • Cargo.toml - Rust project config
  • src/lib.rs - Tool implementation with WIT bindings
  • <name>.capabilities.json - Capability declarations
  • README.md - Documentation
  • .gitignore - Git ignore patterns
Example lib.rs:

Testing Framework

Location: src/tools/builder/testing.rs
Example test cases:

Validation

Location: src/tools/builder/validation.rs

WASM Validator

Validation checks:
  1. WASM binary is valid
  2. Exports required functions (name, description, parameters_schema, execute)
  3. Parameters schema is valid JSON Schema
  4. Tool can be instantiated
  5. Test execution doesn’t trap

Builder Configuration

Location: src/tools/builder/core.rs:87-110

LLM Software Builder

Location: src/tools/builder/core.rs:112-200

Usage Examples

Build WASM Tool

Build CLI App

Build with Agent Tool

Error Recovery

The builder automatically recovers from common errors:

Compilation Errors

Dependency Errors

Test Failures

Best Practices

  1. Provide clear requirements: Detailed descriptions lead to better results
  2. Include test cases: Tests guide the implementation and catch errors
  3. Set appropriate timeouts: Complex builds may need longer timeouts
  4. Review generated code: Always review before deploying to production
  5. Iterate on requirements: Refine the description if initial results are off
  6. Use context: Provide relevant context (API docs, examples, constraints)
  7. Monitor iterations: If max_iterations is reached, simplify the requirement

Limitations

  • LLM quality dependent: Results depend on the underlying LLM’s capabilities
  • Complex projects: Very large or complex projects may exceed context limits
  • External dependencies: May struggle with undocumented or obscure APIs
  • Architecture decisions: May not make optimal architectural choices
  • Security: Generated code should be reviewed for security issues

Next Steps

WASM Tools

Learn about the WASM tool system

Built-in Tools

Explore built-in tool reference