phoenix-api-gen
Generate a full Phoenix JSON API from an OpenAPI spec or natural language description. Creates contexts, Ecto schemas, migrations, controllers, JSON views/renderers, router entries, ExUnit tests with factories, auth plugs, and tenant scoping. Use when building a new Phoenix REST API, adding CRUD endpoints, scaffolding resources, or converting an OpenAPI YAML into a Phoenix project.
Why use this skill?
Instantly generate complete Phoenix Framework APIs from OpenAPI specs or natural language. Automate contexts, schemas, migrations, and tests with ease.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/gchapim/phoenix-api-genWhat This Skill Does
The phoenix-api-gen skill is a powerful scaffolding engine designed to accelerate the development of Phoenix Framework APIs. It automates the boilerplate-heavy process of building RESTful interfaces, whether you are starting from a formal OpenAPI/Swagger specification or a loose natural language description. By following strict Elixir and Phoenix conventions, the skill ensures that your codebase is production-ready, modular, and maintainable from day one. It handles everything from the database layer (migrations and Ecto schemas) and business logic (contexts) to the transport layer (controllers and views) and testing (ExUnit tests and factories).
Installation
To integrate this skill into your OpenClaw agent, execute the following command in your terminal or agent console:
clawhub install openclaw/skills/skills/gchapim/phoenix-api-gen
Use Cases
- Brownfield Projects: Converting existing documentation (OpenAPI YAML) into a functional Phoenix structure.
- Rapid Prototyping: Generating CRUD endpoints for new business domains by simply describing your entities and relationships.
- Standardization: Ensuring all team members follow established patterns for multi-tenancy, authorization plugs, and context-based API design.
- Test-Driven Development: Automatically scaffolding tests and factories to ensure your business logic is verified upon generation.
Example Prompts
- "Generate a Phoenix API for a task management system. Resources: Project (name: string, description: text) and Task (title: string, completed: boolean, due_date: datetime). Ensure multi-tenancy based on organization_id."
- "Import this OpenAPI spec file located at ./docs/api.yaml and scaffold the necessary contexts, controllers, and tests, including bearer token authentication for all routes."
- "Scaffold an 'Inventory' context for my existing Phoenix project with a 'Product' resource. Include CRUD operations, a fallback controller for error handling, and ExUnit tests with factories."
Tips & Limitations
- Context Boundaries: The tool works best when you explicitly define domain boundaries. Grouping resources effectively allows for cleaner, decoupled contexts.
- Validation: Always verify the generated changesets. While the tool generates robust default validations, business-specific constraints may require manual adjustments.
- Multi-Tenancy: When using multi-tenancy features, remember to run the migrations in the correct order to ensure indexes exist before application logic relies on them.
- Security: The skill provides templates for API Key and Bearer token auth; however, always ensure these are integrated into your
router.expipeline with the appropriate scopes. It is designed for internal architecture generation and should be audited during code review.
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-gchapim-phoenix-api-gen": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: file-write, file-read, code-execution
Related Skills
readwise
Manage Readwise highlights, books, daily review, and Reader documents (save-for-later / read-it-later). Use when the user wants to save articles or URLs to Reader, browse their reading list, search saved documents, review highlights, create or manage highlights and notes, check their daily review, list books/sources, or interact with Readwise/Reader in any way.
oban-designer
Design and implement Oban background job workers for Elixir. Configure queues, retry strategies, uniqueness constraints, cron scheduling, and error handling. Generate Oban workers, queue config, and test setups. Use when adding background jobs, async processing, scheduled tasks, or recurring cron jobs to an Elixir project using Oban.
elixir-dev
Elixir/Phoenix development companion. Run and interpret mix test, mix credo, mix dialyzer, mix format. Generate modules following OTP conventions: contexts, schemas, GenServers, supervisors, tasks. Debug compilation errors and warnings. Help with Ecto migrations, queries, changesets, and associations. Use for any Elixir or Phoenix development task including writing modules, fixing tests, refactoring code, or understanding OTP patterns.
oban-designer
Design and implement Oban background job workers for Elixir. Configure queues, retry strategies, uniqueness constraints, cron scheduling, and error handling. Generate Oban workers, queue config, and test setups. Use when adding background jobs, async processing, scheduled tasks, or recurring cron jobs to an Elixir project using Oban.
hackernews
Browse and search Hacker News. Fetch top, new, best, Ask HN, Show HN stories and job postings. View item details, comments, and user profiles. Search stories and comments via Algolia. Find "Who is hiring?" threads. Use for any HN-related queries like "what's trending on HN?", "search HN for AI", "show comments on story X", "who is hiring?", "latest Ask HN posts".