Index of every page on this site: llms.txt
All skills
aomi-labs avatar

/aomi-build

@67226e1
by aomi labsaomi-labs/skills8 stars
4
Run it yourself

Scaffold new Aomi apps and plugins from API docs, OpenAPI/Swagger specs, or SDK references. aomi-build generates production-ready Rust SDK crates (lib.rs, client.rs, tool.rs) with tool schemas, preambles, host-interop flows, and validation — turning a vendor's API surface into AI-agent-callable tools. It covers the current `aomi-build` OpenAPI pipeline (`gen-specs` → `gen-client` → `gen-tool` → curate → compile/test) as well as greenfield apps. Use when the user wants to scaffold a new Aomi app from a spec, wrap a REST API as agent-callable tools, port an existing SDK, or extend an Aomi runtime with new integrations. Trigger with prompts about wrapping APIs, scaffolding Rust crates from specs, or adding protocol integrations that aomi-transact can drive. Output crates support progenitor-generated OpenAPI clients, curated tool layers, sync HTTP, async tools (DynAsyncSink), typed secrets, route plans (ToolReturn/RouteStep), EVM and SVM host handoffs, and multi-step quote→approval→swap flows. Same runtime that aomi-transact drives.

Use this Skill: https://skilld.dev/gh/aomi-labs/skills/aomi-build

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesaomi-sdk-patterns.md

≈2.4k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Aomi SDK Patterns

These patterns come from the SDK examples (sdk/examples/app-template-http), current SDK source, and inspected public apps in aomi-sdk/apps. Current SDK is v3.0.1, Rust 2024 edition.

Canonical Layout

Use this split unless there is a strong reason not to:

apps/my-app/
├─ Cargo.toml
└─ src/
   ├─ lib.rs
   ├─ client.rs
   └─ tool.rs
  • lib.rs: manifest, preamble, dyn_aomi_app!
  • client.rs: app struct, HTTP client, auth, models, helpers
  • tool.rs: DynAomiTool impls and user-facing tool surface

Cargo.toml must declare edition = "2024", crate-type = ["cdylib"], and depend on aomi-sdk = { workspace = true }. The host enforces an exact-match SDK version gate: after bumping sdk/Cargo.toml, all apps must be rebuilt — see docs/sdk-version-compatibility.md.

Minimal Manifest Shape

use aomi_sdk::*;

mod client;
mod tool;

const PREAMBLE: &str = r#"## Role
You are ...
"#;

dyn_aomi_app!(
    app = client::MyApp,
    name = "my-app",
    version = "0.1.0",
    preamble = PREAMBLE,
    tools = [
        client::SearchThing,
        client::GetThing,
    ],
    namespaces = ["evm-core"]
);

Keep lib.rs small. The manifest should be easy to audit at a glance.

The namespaces field is required. Current canonical host namespaces are explicit strings:

  • namespaces = ["evm-core"] for most EVM apps and generated OpenAPI apps. This injects the current EVM host tools such as encode_and_call, stage_tx, simulate_batch, commit_txs, and evm_commit_message.
  • namespaces = ["svm-reads", "svm-ix-broadcast", "svm-tx-broadcast"] for Solana apps that need SVM read/stage/commit host tools.
  • namespaces = [] only for apps that should receive no host namespace at all.

Do not copy the old "common" namespace into new apps. Current SDK docs note that legacy namespace was removed in host iter-39; the loader skips unknown namespaces.

The macro generates the C ABI exports (aomi_create, aomi_manifest, aomi_async_tool_start, aomi_dyn_exec_poll, etc.) and embeds the SDK version stamp the host uses for compatibility checks.

What The Real Apps Show

sdk/examples/app-template-http

Use as the default baseline for read-only HTTP APIs.

  • Simple reqwest::blocking client
  • Clean typed args
  • Small tool surface
  • Straightforward JSON normalization

apps/x

Use this pattern when the upstream API:

  • needs an env-backed API key
  • has a wrapper response envelope
  • benefits from normalized data models and formatting helpers

Notable conventions:

  • auth env vars live in client.rs
  • logical API failures are normalized before reaching tools
  • tools return concise, model-friendly JSON

apps/polymarket

Use this pattern when the app needs:

  • multiple upstream API surfaces
  • dynamic preamble context such as exact current date
  • intent resolution before execution
  • multi-step flows with explicit user confirmation

Notable conventions:

  • preamble explains exact flow order
  • tool surface separates search, details, intent resolution, preview, and submit
  • results include next-step hints without hiding uncertainty

apps/khalani and apps/polymarket

Use this pattern when execution must hand off to host wallet tools.

Notable conventions:

  • app tools never send the wallet request directly
  • build/submit tools return ToolReturn::with_routes(value, [...]) envelopes — never prose-based hints
  • routes use RouteStep::on_return("evm_commit_message", typed_data).bind_as("signature").prompt(...) for typed-message signing, or RouteStep::on_return("commit_txs", args) for EVM transaction commit, to declare what tool the host should call next, what args to pass, and what alias to bind the result under
  • subsequent routes use RouteStep::on_bound_event("submit_*", template, "signature") to wait for the bound alias before continuing
  • preamble tells the model to preserve exact host args and let the runtime resolve the route — the runtime never parses prose

apps/geckoterminal

Use this pattern for the current OpenAPI/progenitor app-local pipeline.

Notable conventions:

  • openapi.yaml is the editable source spec.
  • openapi.preprocessed.yaml is a regenerated debug artifact from gen-client; inspect it when progenitor fails, but do not edit it.
  • src/client/ is generated by progenitor and wrapped by a hand-curated tool.rs.
  • Cargo.toml includes progenitor-client, matching reqwest 0.13, and any dependency markers detected from the generated client.
  • gen-tool stubs one tool per operationId; the shipped app should curate those stubs into user-intent tools and a real preamble.

Executable product integrations

When the source material is mostly SDK docs, example repos, runtime notes, or architecture docs, first check whether it exposes or produces a client-facing interface such as:

  • REST or GraphQL
  • JSON-RPC
  • gRPC
  • webhooks
  • a stable CLI request/response contract
  • a local example service or reference node

If such a surface exists:

  • build the app against that executable interface
  • treat the SDK, example repo, and docs as implementation references
  • expose user-useful operations against the real service, not just summaries of the docs
  • validate with at least one real call when possible

Builder-oriented fallbacks

Use a builder-oriented shape only when the source material is mostly:

  • SDK documentation
  • example repositories
  • architecture notes
  • runtime / RPC references
  • config files and quickstarts

In that case:

  • do not pretend there is a public swap, quote, or portfolio API unless the source really documents one
  • do not hide the absence of a real integration target
  • prefer tools such as list_*_resources, get_*_overview, get_*_quickstart, get_*_rpc_surface, or get_*_network_defaults
  • make the preamble explicit that the app is a builder assistant, not an end-user trading agent
  • say clearly what would be needed to upgrade the app into a real client later, such as a base URL, running example service, or customer endpoint

Tool Authoring Checklist

Every tool should answer these:

  • What user intent does it serve?
  • What exact name should the model call?
  • What fields does the model need to provide?
  • What result shape will be easiest for the model to reason over?
  • If the upstream API is inconsistent, where will normalization happen?

Prefer names like:

  • search_*
  • get_*
  • list_*
  • resolve_*
  • build_*
  • submit_*

Client Conventions

Keep these in client.rs whenever possible:

  • base URLs
  • auth headers
  • shared request helpers
  • response envelopes
  • normalization helpers
  • typed upstream models

Prefer short actionable errors such as:

  • X_API_KEY environment variable not set
  • Gamma API error 404: ...
  • Failed to parse markets: ...

Validation Commands

Inside aomi-sdk, the standard loop is:

cargo run -p aomi-sdk --features cli --bin aomi-build -- init my-app
cargo run -p aomi-sdk --features cli --bin aomi-build -- compile --app my-app

For OpenAPI- or URL-driven scaffolds, use the staged pipeline or one-shot orchestrator:

cargo run -p aomi-sdk --features cli --bin aomi-build -- gen-specs geckoterminal --from-url https://api.geckoterminal.com/docs/v2/swagger.json
cargo run -p aomi-sdk --features cli --bin aomi-build -- gen-client geckoterminal --force
cargo run -p aomi-sdk --features cli --bin aomi-build -- gen-tool geckoterminal --all --force
cargo run -p aomi-sdk --features cli --bin aomi-build -- new-app geckoterminal --from-url https://api.geckoterminal.com/docs/v2/swagger.json

Default OpenAPI mode is app-local: apps/<platform>/openapi.yaml, apps/<platform>/src/client/, and apps/<platform>/src/tool.rs. Use --shared only for large reusable providers; then specs live under ext/specs/ and clients under ext/src/.

compile accepts --release and --target <triple>. It validates the manifest, codesigns the cdylib on macOS, and validates the produced plugin file.

One caveat from practice:

  • Current aomi-build compile scans tracked app manifests and falls back to the apps directory, so a brand-new app is less likely to be skipped than in older xtask builds.
  • Use cargo build --manifest-path apps/my-app/Cargo.toml for an immediate crate-level compile check when debugging package errors.
  • Apps with [package.metadata.aomi.skip] set are excluded intentionally — useful for in-progress crates.

For generated APIs:

  • aomi-build test-schema <platform> runs a Schemathesis smoke against the live API. It is GET-only by default; pass --write only for sandbox/testnet APIs where fuzzing writes is acceptable.
  • aomi-build tighten-spec <platform> --in-place can replace loose additionalProperties: true response bodies using captured JSON samples, then rerun gen-client --force.

For focused logic tests, use the SDK test helpers:

use aomi_sdk::testing::{TestCtxBuilder, run_tool, run_async_tool};

let ctx = TestCtxBuilder::new("search_thing").build();
let result = run_tool::<MyTool>(&MyApp, json!({"query": "eth"}), ctx)?;
// result is a ToolReturn — bare-value tools have empty routes; route-returning
// tools include the structured RouteStep list under result.routes

run_tool returns the full ToolReturn (handy for asserting routes alongside the JSON payload). run_async_tool returns (updates, terminal) so you can assert intermediate emit payloads as well as the final complete payload.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 warning1mo3 checks · Risk SAFE
  • Gen Agent Trust Hub1mo

    Aomi Build is a developer-centric skill for scaffolding Rust crates for AI agent tools. It implements a strong security posture by restricting file-system operations to the local workspace, explicitly denying access to sensitive identity files and build scripts, and limiting shell execution to specific cargo and git commands. The skill operates entirely offline according to its manifest, and all external resources trace back to the verified vendor's infrastructure.

  • Socket1mo

    No alerts

  • Snyk1mo

    Risk: MEDIUM · 1 issue

Signed by skilld at 67226e1. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last week.

Activeupdated 4 months ago
What it can do
Runs commands Reads files Edits files
version
0.1.1
author
aomi-labs <hello@aomi.dev>
risk_tier
L1
All 6 allowed tools
Bash(cargo:*)Bash(git:*)ReadWriteEditGrep
Other metadata
tags
[
  "crypto",
  "web3",
  "evm",
  "rust",
  "sdk-scaffolding",
  "openapi",
  "swagger",
  "agent-tools",
  "defi",
  "builder-tools"
]
compatibility
Best when a local aomi-sdk checkout is available, often at ../aomi-sdk. Falls back to bundled references when the SDK repo is not present. Last verified against aomi-sdk v3.0.1 (Rust 2024 edition) and the aomi-build Rust CLI at that time; re-verification is recommended for newer SDK releases (current aomi-sdk: v3.0.3). Install the current CLI with cargo install --git https://github.com/aomi-labs/aomi-sdk --features cli aomi-sdk, or run from source with cargo run -p aomi-sdk --features cli --bin aomi-build -- <command>. Designed for claude-code; also works with Cursor, Codex CLI, Gemini, and any agent runtime that supports the Anthropic skill spec.
metadata
{
  "author": "aomi-labs <hello@aomi.dev>",
  "version": "0.1.1",
  "repository": "aomi-labs/skills",
  "homepage": "https://github.com/aomi-labs/skills/tree/main/aomi-build"
}
permissions
{
  "files": {
    "read": [
      "./",
      "../aomi-sdk/"
    ],
    "write": [
      "./apps/",
      "./Cargo.toml",
      "./Cargo.lock",
      "./target/",
      "../aomi-sdk/apps/",
      "../aomi-sdk/Cargo.toml",
      "../aomi-sdk/Cargo.lock",
      "../aomi-sdk/target/"
    ],
    "deny_write": [
      "SOUL.md",
      "MEMORY.md",
      "AGENTS.md",
      "build.rs"
    ]
  },
  "network": {
    "allow": [],
    "deny": "*"
  },
  "shell": [
    "cargo",
    "git"
  ],
  "tools": []
}
requires
{
  "binaries": [
    "cargo",
    "git"
  ]
}

README badge

README badge for aomi-labs/skills/aomi-build