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.
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
SkillHub CLI
skillhub install gchapim/phoenix-api-gen打开来源仓库,查看说明和兼容环境后,按来源提供的命令或步骤安装。
将来源链接提供给你的 Agent,让它先读取说明、核对依赖,并向你说明将执行的安装步骤。
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...
这些信息来自收录时的来源分析,可能滞后;使用前请核对最新来源文件。
# 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.