stock-data-skill
OpenClaw Skill for stock data analysis
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.
Follow the repository instructions for this skill and your agent. Review the files and dependencies before adding it to your workflow.
SkillHub CLI
skillhub install gchapim/phoenix-api-genInspect the source and compatibility requirements, then follow its installation steps.
Give your agent the source link and ask it to inspect instructions and dependencies before explaining the installation steps.
securitySchemes.YYYYMMDDHHMMSS)*JSON modules, or *View for older)See references/phoenix-conventions.md for project structure, naming, context patterns.
Key rules:
Accounts, Billing, Notifications).MyApp.Accounts.User.{:ok, resource} or {:error, changeset}.FallbackController with action_fallback/1 to handle error tuples.See references/ecto-patterns.md for schema, changeset, migration details.
Key rules:
timestamps(type: :utc_datetime_usec).@primary_key {:id, :binary_id, autogenerate: true} + @foreign_key_type :binary_id.create_changeset/2 and update_changeset/2 when create/update fields differ.Add `tenant_id :bina...
These signals come from indexed source analysis and may lag behind changes. Check the current source files.
# Phoenix API Generator
## Workflow
### From OpenAPI YAML
1. Parse the OpenAPI spec — extract paths, schemas, request/response bodies.
2. Map each schema to an Ecto schema + migration.
3. Map each path to a controller action; group by resource context.
4. Generate auth plugs from `securitySchemes`.
5. Generate ExUnit tests covering happy path + validation errors.
### From Natural Language
1. Extract resources, fields, types, and relationships from the description.
2. Infer context boundaries (group related resources).
3. Generate schemas, migrations, controllers, views, router, and tests.
4. Ask the user to confirm before writing files.
## File Generation Order
1. Migrations (timestamps prefix: `YYYYMMDDHHMMSS`)
2. Ecto schemas + changesets
3. Context modules (CRUD functions)
4. Controllers + FallbackController
5. JSON renderers (Phoenix 1.7+ `*JSON` modules, or `*View` for older)
6. Router scope + pipelines
7. Auth plugs
8. Tests + factories
## Phoenix Conventions
See [references/phoenix-conventions.md](references/phoenix-conventions.md) for project structure, naming, context patterns.
Key rules:
- One context per bounded domain (e.g., `Accounts`, `Billing`, `Notifications`).
- Context is the public API — controllers never call Repo directly.
- Schemas live under contexts: `MyApp.Accounts.User`.
- Controllers delegate to contexts; return `{:ok, resource}` or `{:error, changeset}`.
- Use `FallbackController` with `action_fallback/1` to handle error tuples.
## Ecto Patterns
See [references/ecto-patterns.md](references/ecto-patterns.md) for schema, changeset, migration details.
Key rules:
- Always use `timestamps(type: :utc_datetime_usec)`.
- Binary IDs: `@primary_key {:id, :binary_id, autogenerate: true}` + `@foreign_key_type :binary_id`.
- Separate `create_changeset/2` and `update_changeset/2` when create/update fields differ.
- Validate required fields, formats, and constraints in changesets — not in controllers.
## Multi-Tenancy
Add `tenant_id :bina...OpenClaw Skill for stock data analysis
Search and hire real humans for tasks — photography, delivery, research, and more
Generative Engine Optimization (GEO) for AI search visibility. Optimize content to appear in ChatGPT, Perplexity, Claude, and Google AI Overviews. Use when optimizing websites, pages, or content for LLM discove...
Reusable skill templates for OpenClaw AI agents. Templates for API integration, data processing, web scraping, CLI tools, and file processing.