Skip to content
Agentmart
Submit a tool

landing_page-contexts

Guide to Context module patterns in landing_page_backend — Ecto queries, dynamic query building, Ecto.Multi, and Outbox messaging.

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-landing-page-contexts

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

Guide to Context module patterns in landing_page_backend — Ecto queries, dynamic query building, Ecto.Multi, and Outbox messaging.

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/landing-page-contexts

What's inside

Skill name
landing_page-contexts
Description
Guide to Context module patterns in landing_page_backend — Ecto queries, dynamic query building, Ecto.Multi, and Outbox messaging.
License
MIT
Metadata
author: Vũ Lưu · source: Source code landing_page_backend · version: 2026.03.30
Instructions
81 lines in SKILL.md · view on GitHub

Agent Skills spec issues

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

Files (3)

  • SKILL.md
  • core-multi-outbox.md · references/
  • core-queries.md · references/

SKILL.md (first lines)

# Landing Page — Contexts

> Context module conventions for business logic, queries, and transactions.

## Core

| Topic | Description | Reference |
|-------|-------------|-----------|
| Query Building | Ecto.Query, from macros, select fields, dynamic queries | [core-queries](references/core-queries.md) |
| Transactions & Outbox | Ecto.Multi transactions with Outbox messaging | [core-multi-outbox](references/core-multi-outbox.md) |

## Quick Reference

```elixir
defmodule LandingPage.Pages do
  import Ecto.Query, warn: false
  alias LandingPage.{Repo, Tools}
  alias LandingPage.Pages.{Page, PageVersion, PagePublished}
  alias LandingPage.Organizations.{PageRight, TeamPage}
  alias LandingPage.Permissions.PageAccountPermission

  @light_page_fields [
    :id, :status, :html, :css, :head, :settings, :extra_script, :extra_css,
    :inserted_at, :updated_at, :organization_id
  ]

  # --- Simple query ---
  def get_page(page_id) do
    case Repo.get(Page, page_id) do
      nil -> {:error, :not_found}
      page -> {:ok, page}
    end
  end

  # --- Query with preloads ---
  def get_page_detail(%Page{} = page) do
    page_id = Ecto.UUID.cast!(page.id)

    query_shared = from pap in PageAccountPermission, preload: [:account]
    query_pub = from pp in PagePublished, select: [:domain, :path, :status]

    query = from p in Page,
      where: p.id == ^page_id,
      preload: [:owner, shared_accounts: ^query_shared, published: ^query_pub]

    Repo.one(query)
  end

  # --- Optimized select ---
  def get_page_by_custom_domain(host, path) do
    query = from p in Page,
      where: p.custom_domain == ^host and p.custom_path == ^path
             and p.status == ^Enum.PageStatus.value(:active),
      select: ^@light_page_fields

    if res = Repo.one(query), do: {:ok, res}, else: {:error, :not_found}
  end

  # --- Dynamic query ---
  def search_form_data(page_id, filters) do
    dyn = dynamic([f], f.page_id == ^page_id)

    dyn = if phone = filters["phone_number"] do
      dynamic([f], ^dyn and f.phone_number == ^phone)
    else
      dyn
    end

    dyn = if status = filters["status"] do
      dynamic([f], ^dyn and f.status == ^status)
    else
      dyn
    end

    from(f in PageFormData, where: ^dyn, order_by: [desc: :inserted_at])
    |> Repo.all()
  end
end
```

From vuluu2k/skills, MIT.

More from vuluu2k/skills

Signals

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

From GitHub (fetched Oct 24, 2026).

Details

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

More from Vũ Lưu

Cite this page

landing_page-contexts skill. Agent Mart. https://agentmart.dev/skills/vuluu2k-landing-page-contexts (last updated 2026-10-24)