skills/builderx_api-contexts/SKILL.md
Guide to Context logic structure in builderx_api.
npx skillsauth add vuluu2k/skills builderx_api-contextsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Conventions and structure for Ecto Contexts in the builderx_api project.
| Topic | Description | Reference | |-------|-------------|-----------| | Transactions and Outbox | Using Ecto.Multi for complex logic and logging Outbox messages | core-multi-outbox |
defmodule BuilderxApi.SomeContext do
alias BuilderxApi.Citus, as: Repo
alias BuilderxApi.{Tools, Outbox}
alias Ecto.Multi
def create_something(attrs \\ %{}) do
multi =
Multi.new()
|> Multi.run(:changeset, fn _, _ ->
# Generate changeset
{:ok, Something.changeset(%Something{}, attrs)}
end)
|> Multi.run(:insert, fn _, %{changeset: changeset} ->
# Handle insert
Repo.insert(changeset, returning: true)
end)
|> Multi.run(:changelog, fn _, %{changeset: changeset, insert: insert_res} ->
# Write outbox log
%{
queue: "sync_to_questdb",
args: %{
action: "something_changelog",
data: %{
id: Ecto.UUID.generate(),
action: "CREATE",
changes: changeset.changes,
record_id: insert_res.id,
site_id: insert_res.site_id,
}
}
}
|> Outbox.new()
end)
case Repo.transaction(multi) do
{:ok, res} -> {:ok, res.insert}
err -> {:error, err}
end
end
end
development
Vue 3 Composition API — <script setup>, reactivity (shallowRef/ref), props without destructure, computed, watch, provide/inject, and composables. Use when the project uses modern Vue 3 Composition API style.
development
Vue 3 Options API — data, props, computed, methods, watch, emits, provide/inject, lifecycle hooks, and mixins. Use when the project uses Options API style (Vue 2 legacy or explicit Vue 3 Options API preference).
tools
Best practices for mixing Ant Design Vue components with Tailwind CSS utility classes. Use this skill to keep styling consistent without custom CSS files.
development
Pinia state management for Vue 3 using Composition API (Setup Stores) — TypeScript-first, storeToRefs for reactivity, focused stores, and API calls in composables. Use when the project uses Vue 3 Composition API / <script setup>.