# API Schema Asyncapi CLI

> Authors event API schemas with AsyncAPI and Apache Avro: AsyncAPI document validation and generation, Avro schema tooling, and Kafka payload contracts. Use when working with asyncapi cli, avro tools or when the user mentions asyncapi cli, avro tools.

- Skill: `opknock/api-schema-asyncapi-cli` (Agent Skill)
- Install (CLI): `npx get-skill add opknock/api-schema-asyncapi-cli`
- Raw SKILL.md: https://api.skillmd.com/api/skills/opknock/api-schema-asyncapi-cli/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Integrations & APIs
- License: MIT
- Author: OpKnock (https://skillmd.com/u/opknock)
- Updated: 2026-11-23
- Page: https://skillmd.com/skills/opknock/api-schema-asyncapi-cli

---


Authors event API schemas with AsyncAPI and Apache Avro: AsyncAPI document validation and generation, Avro schema tooling, and Kafka payload contracts.

## Agentic Workflow: Read -> Reason -> Act (api-schema-asyncapi-cli)

You are **Api Schema Asyncapi Cli** (data) — a sub-agent that **Reads, Reasons, and Acts** via `allowed-tools`.

### 1. Read — data context for `api-schema-asyncapi-cli`
- Domain: Authors event API schemas with AsyncAPI and Apache Avro: AsyncAPI document validation and generation, Avro schema tooling, and Kafka payload contracts.
- **asyncapi-cli**: Validate and generate AsyncAPI documents — `npm install -g @asyncapi/cli`
- **avro-tools**: Compile and inspect Avro schemas — `java -jar avro-tools-1.11.3.jar compile schema user.avsc .`
- Check `knowledge` and `prerequisites: openapi, json-schema, node.js, python`

### 2. Reason — think for `api-schema-asyncapi-cli`
- For `asyncapi-cli`: Validate and generate AsyncAPI documents — decide which checks to run
- For `avro-tools`: Compile and inspect Avro schemas — decide which checks to run
- Evaluate trust/policy: `kdesk trust` + `kdesk doctor` patterns for your inputs

### 3. Act — execute with `api-schema-asyncapi-cli` tools
- Tools: `Glob`, `Grep`, `Read`, `Bash`, `Asyncapi` (see frontmatter `tools`/`allowed-tools`)
- Use `safe_path` for any write; record evidence (paths, checksums)
- Fingerprint: `api-schema-asyncapi-cli:d4f2d824`

# API Schema v4 - AsyncAPI/Avro

Event schema authoring.

## What This Skill Does
- Documents event-driven APIs with AsyncAPI
- Compiles Avro schemas for Kafka
- Generates docs and stubs

## When to Use
- Kafka/Kinesis event contracts
- Event-driven microservices
- Schema registry management

## Real Commands

```bash
npm install -g @asyncapi/cli
asyncapi validate asyncapi.yaml
asyncapi generate fromTemplate asyncapi.yaml @asyncapi/html-template -o docs
java -jar avro-tools-1.11.3.jar compile schema user.avsc .
```

## Avro Schema

```json
{
  "type": "record",
  "name": "User",
  "fields": [
    { "name": "id", "type": "long" },
    { "name": "email", "type": "string" }
  ]
}
```

## Testing
- Validate documents in CI
- Round-trip JSON to Avro and back
- Check schema registry compatibility

## Best Practices
- Version event schemas with a registry
- Use forward/backward compatible fields
- Keep AsyncAPI docs in sync with topics

## Capabilities

### asyncapi-cli
Validate and generate AsyncAPI documents

**Parameters:**
- `spec` (string): AsyncAPI document path
- `template` (string): Generator template
- `output` (string): Output directory

**Commands:**
- `npm install -g @asyncapi/cli`
- `asyncapi validate asyncapi.yaml`
- `asyncapi new --example=tutorial`
- `asyncapi generate fromTemplate asyncapi.yaml @asyncapi/html-template -o docs`
- `asyncapi bundle asyncapi.yaml -o bundled.yaml`

**Examples:**
- asyncapi validate checks document structure
- asyncapi new scaffolds an example
- generate fromTemplate builds HTML docs

### avro-tools
Compile and inspect Avro schemas

**Commands:**
- `java -jar avro-tools-1.11.3.jar compile schema user.avsc .`
- `java -jar avro-tools-1.11.3.jar getmeta user.avsc`
- `java -jar avro-tools-1.11.3.jar tojson users.avro`
- `java -jar avro-tools-1.11.3.jar fromjson --schema-file user.avsc users.json > users.avro`

**Examples:**
- -cli --help
- -api --help

## References
- [AsyncAPI CLI](https://www.asyncapi.com/docs/tools/cli)
- [Avro Spec](https://avro.apache.org/docs/current/specification/)

