Phoenix API Generator for Openclaw

Automate the creation of robust Phoenix JSON APIs including schemas, migrations, and tests using OpenAPI specs or natural language.

gchapim
v1.0.0
Feb 3, 2026
1
2.4k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install phoenix-api-gen

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install phoenix-api-gen using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Phoenix API Generator?

The Phoenix API Generator is a comprehensive tool within the Openclaw Skills ecosystem designed to eliminate the manual boilerplate involved in building Elixir-based web services. By analyzing an OpenAPI YAML specification or a natural language description, this skill generates a full-stack backend structure following the latest Phoenix 1.7+ conventions.

It ensures that your project remains maintainable by strictly adhering to domain-driven design through Context modules. This Openclaw Skills utility handles everything from database migrations with binary IDs to complex authentication plugs and multi-tenant scoping, allowing developers to focus on core business logic rather than repetitive scaffolding.

Phoenix API Generator Use Cases

  • Rapidly prototyping new RESTful services from a requirements document.
  • Migrating legacy API designs into modern Elixir/Phoenix projects using OpenAPI specs.
  • Implementing standardized CRUD operations for complex domain resources.
  • Scaffolding multi-tenant applications with built-in data isolation and tenant-aware queries.

How Phoenix API Generator Works

  1. The skill parses the input source, whether it is an OpenAPI YAML file or a descriptive natural language prompt, to identify resources and fields.
  2. It maps these resources to Ecto schemas and generates database migrations with high-precision timestamps.
  3. Context modules are created to act as the public API for the database, ensuring controllers never interact with the Repo directly.
  4. Phoenix controllers and JSON renderers (or Views) are generated, utilizing FallbackControllers for consistent error handling.
  5. The skill updates the router with the necessary scopes and pipelines.
  6. Finally, it generates comprehensive ExUnit tests and factories to ensure high code coverage from the start.

Phoenix API Generator Setup

To integrate this capability into your agent, ensure your environment is configured to run Elixir and Phoenix. Add the phoenix-api-gen skill to your local environment and invoke it by providing a path to your YAML specification:

# Example usage with a specification file
openclaw-agent run phoenix-api-gen --spec ./docs/openapi.yaml

Phoenix API Generator Data Schema & Taxonomy

File Type Generation Pattern Description
Migrations YYYYMMDDHHMMSS_name.exs Database tables with utc_datetime_usec
Ecto Schemas lib/app/context/schema.ex Data models with Changesets and Binary IDs
Contexts lib/app/context.ex Bounded domain logic and public API functions
Controllers lib/app_web/controllers/resource_controller.ex Request handling and delegation
Renderers lib/app_web/controllers/resource_json.ex Phoenix 1.7+ JSON formatting
Tests test/app_web/controllers/resource_controller_test.exs Controller and Context test suites

Phoenix API Generator Advanced Features

  • Integrated multi-tenancy support with automatic tenant_id scoping for all queries.
  • Ready-to-use authentication plugs for both API Key and Bearer Token strategies.
  • Advanced testing patterns using Mox for mocking external services and ExMachina for factory-based data setup.
  • Strict adherence to Phoenix 1.7 conventions, including the use of verified routes and the latest JSON rendering patterns as part of the Openclaw Skills standard.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*