Skip to content
Agentmart
Submit a tool

builderx_api-schemas

Guidelines for creating Ecto Schemas in builderx_api, including composite primary keys, custom json function and Ecto.Changeset.

Skill by Vũ Lưu

IndexedMIT★ 1
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/vuluu2k-builderx-api-schemas

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Guidelines for creating Ecto Schemas in builderx_api, including composite primary keys, custom json function and Ecto.Changeset.

Use cases: backend

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/builderx-api-schemas

What's inside

Skill name
builderx_api-schemas
Description
Guidelines for creating Ecto Schemas in builderx_api, including composite primary keys, custom json function and Ecto.Changeset.
License
MIT
Metadata
author: Vũ Lưu · source: Source code builderx_api · version: 2026.03.25
Instructions
69 lines in SKILL.md · view on GitHub

Before installing

  • Instructions call the network

Agent Skills spec issues

  • name: only lowercase letters, digits and single hyphens allowed

Files (2)

  • SKILL.md
  • core-schema.md · references/

SKILL.md (first lines)

# BuilderX API Schemas

> Conventions and structures for defining Ecto Schemas in the builderx_api project.

## Core

| Topic | Description | Reference |
|-------|-------------|-----------|
| Schema Definition | Primary keys, site_id attribute, timestamps | [core-schema](references/core-schema.md) |
| JSON Serialization | Custom `json/1` and `json/2` implementation in Ecto Schema | [core-schema](references/core-schema.md) |

## Quick Reference

```elixir
defmodule BuilderxApi.Products.Product do
  use Ecto.Schema
  import Ecto.Changeset

  alias BuilderxApi.Sites.Site

  @primary_key {:id, :binary_id, autogenerate: true}
  @foreign_key_type :binary_id
  @non_required_fields [:id, :inserted_at, :updated_at]

  schema "products" do
    belongs_to(:site, Site, type: Ecto.UUID, primary_key: true)
    
    field :name, :string
    
    timestamps(type: :utc_datetime_usec)
  end

  def changeset(%__MODULE__{} = product, attrs \\ %{}) do
    fields = __schema__(:fields) -- @non_required_fields

    product
    |> cast(attrs, fields)
    |> validate_required([:site_id, :name])
  end

  # Custom serializer instead of using Phoenix Views
  def json(%__MODULE__{} = product) do
    fields = __schema__(:fields)
    data = Map.take(product, fields)

    data =
      case Map.fetch(product, :site) do
        {:ok, %Ecto.Association.NotLoaded{}} ->
          data

        {:ok, value} ->
          Map.put(data, :site, Site.json(value))

        _ ->
          data
      end

    data
  end

  def json(products) when is_list(products) do
    Enum.map(products, &json(&1))
  end

  def json(_), do: nil
end
```

From vuluu2k/skills, MIT.

More from vuluu2k/skills

Signals

Stars
1
Forks
0
Open issues
0
Last commit (this folder)
Mar 25, 2026 (7 months ago)

From GitHub (fetched Oct 24, 2026).

Details

Version
2026.03.25
License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from Vũ Lưu

Cite this page

builderx_api-schemas skill. Agent Mart. https://agentmart.dev/skills/vuluu2k-builderx-api-schemas (last updated 2026-10-24)