[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7320WHSZYVXCFGBMXMBVCA4":3,"skill-same:01M7320WHSZYVXCFGBMXMBVCA4":64},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":43,"commitSha":44,"skillDirectory":45,"forksCount":14,"repositoryHtmlUrl":46,"repositoryHomepageUrl":6,"ownerHtmlUrl":47,"ownerBlogUrl":6,"ownerDescription":48,"updatedAt":49,"install":50,"resources":63},"01M7320WHSZYVXCFGBMXMBVCA4","ecto-patterns",null,"Ecto patterns for Phoenix\u002FElixir apps. Covers schemas, changesets, migrations, queries, Ecto.Multi, transactions, constraints, associations, pagination, tenant partitioning, performance, and testing.","julio211916\u002FTlantiCAD-Studio-V0.1-alpha","julio211916","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F128201165?v=4","01M730ENY015MHFY82VKR6AGGR","José Carlos amador garcia","01M730ENYT83EWH6EXRHF9FTXV",0,"MIT","https:\u002F\u002Fgithub.com\u002Fjulio211916\u002FTlantiCAD-Studio-V0.1-alpha\u002Fblob\u002Fmain\u002Fskills\u002Fju\u002Fskills\u002Fecto-patterns\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: ecto-patterns\ndescription: Ecto patterns for Phoenix\u002FElixir apps. Covers schemas, changesets, migrations, queries, Ecto.Multi, transactions, constraints, associations, pagination, tenant partitioning, performance, and testing.\nversion: 1.0.0\ncategory: toolchain\nauthor: Claude MPM Team\nlicense: MIT\nprogressive_disclosure:\n  entry_point:\n    summary: \"Ecto schemas\u002Fchangesets, migrations, queries, transactions, constraints, pagination, tenancy, and performance for Phoenix apps.\"\n    when_to_use:\n      - \"Designing schemas and changesets with validation\u002Fconstraints\"\n      - \"Running migrations safely (DDL ordering, locks) and managing data migrations\"\n      - \"Executing transactional flows with Ecto.Multi\"\n      - \"Implementing pagination, preloading, and multi-tenant partitioning\"\n    quick_start:\n      - \"mix ecto.create && mix ecto.migrate\"\n      - \"Define schemas + changesets; enforce DB constraints (unique\u002Fforeign keys)\"\n      - \"Use Repo.transaction \u002F Ecto.Multi for multi-step writes\"\n      - \"Preload associations; paginate with limit\u002Foffset or cursor libs (Scrivener\u002FFlop)\"\n  token_estimate:\n    entry: 170\n    full: 5400\n---\n\n# Ecto Patterns for Phoenix\u002FElixir\n\nEcto is the data layer for Phoenix applications: schemas, changesets, queries, migrations, and transactions. Good Ecto practice keeps domain logic in contexts, enforces constraints in the database, and uses transactions for multi-step workflows.\n\n## Schemas and Changesets\n\n```elixir\ndefmodule MyApp.Accounts.User do\n  use Ecto.Schema\n  import Ecto.Changeset\n\n  schema \"users\" do\n    field :email, :string\n    field :hashed_password, :string\n    field :confirmed_at, :naive_datetime\n    has_many :memberships, MyApp.Orgs.Membership\n    timestamps()\n  end\n\n  def registration_changeset(user, attrs) do\n    user\n    |> cast(attrs, [:email, :password])\n    |> validate_required([:email, :password])\n    |> validate_format(:email, ~r\u002F@\u002F)\n    |> validate_length(:password, min: 12)\n    |> unique_constraint(:email)\n    |> hash_password()\n  end\n\n  defp hash_password(%{valid?: true} = cs),\n    do: put_change(cs, :hashed_password, Argon2.hash_pwd_salt(get_change(cs, :password)))\n  defp hash_password(cs), do: cs\nend\n```\n\n**Guidelines**\n- Keep casting\u002Fvalidation in changesets; keep business logic in contexts.\n- Always pair validation with DB constraints (`unique_constraint`, `foreign_key_constraint`).\n- Use `changeset\u002F2` for updates; avoid mass assigning without casting.\n\n## Migrations\n\n```elixir\ndef change do\n  create table(:users) do\n    add :email, :citext, null: false\n    add :hashed_password, :string, null: false\n    add :confirmed_at, :naive_datetime\n    timestamps()\n  end\n\n  create unique_index(:users, [:email])\nend\n```\n\n**Safe migration tips**\n- Prefer additive changes: add columns nullable, backfill, then enforce null: false.\n- For large tables: use `concurrently: true` for indexes; disable in `change` and wrap in `up\u002Fdown` for Postgres.\n- Data migrations belong in separate modules called from `mix ecto.migrate` via `execute\u002F1` or in distinct scripts; ensure idempotence.\n- Coordinate locks: avoid long transactions; break migrations into small steps.\n\n## Queries and Preloads\n\n```elixir\nimport Ecto.Query\n\ndef list_users(opts \\\\ %{}) do\n  base =\n    from u in MyApp.Accounts.User,\n      preload: [:memberships],\n      order_by: [desc: u.inserted_at]\n\n  Repo.all(apply_pagination(base, opts))\nend\n\ndefp apply_pagination(query, %{limit: limit, offset: offset}),\n  do: query |> limit(^limit) |> offset(^offset)\ndefp apply_pagination(query, _), do: query\n```\n\n**Patterns**\n- Use `preload` rather than calling Repo in loops; prefer `Repo.preload\u002F2` after fetching.\n- Use `select` to avoid loading large blobs.\n- For concurrency, use `Repo.transaction` with `lock: \"FOR UPDATE\"` in queries that need row-level locks.\n\n## Transactions and Ecto.Multi\n\n```elixir\nalias Ecto.Multi\n\ndef onboard_user(attrs) do\n  Multi.new()\n  |> Multi.insert(:user, User.registration_changeset(%User{}, attrs))\n  |> Multi.insert(:org, fn %{user: user} ->\n    Org.changeset(%Org{}, %{owner_id: user.id, name: attrs[\"org_name\"]})\n  end)\n  |> Multi.run(:welcome, fn _repo, %{user: user} ->\n    MyApp.Mailer.deliver_welcome(user)\n    {:ok, :sent}\n  end)\n  |> Repo.transaction()\nend\n```\n\n**Guidelines**\n- Prefer `Multi.run\u002F3` for side effects that can fail; return `{:ok, value}` or `{:error, reason}`.\n- Use `Multi.update_all` for batch updates; include `where` guards to prevent unbounded writes.\n- Propagate errors upward; translate them in controllers\u002FLiveViews.\n\n## Associations and Constraints\n\n- Use `on_replace: :delete`\u002F`:nilify` to control nested changes.\n- Define `foreign_key_constraint\u002F3` and `unique_constraint\u002F3` in changesets to surface DB errors cleanly.\n- For many-to-many, prefer join schema (`has_many :memberships`) instead of automatic `many_to_many` when you need metadata.\n\n## Pagination and Filtering\n\n- Offset\u002Flimit for small datasets; cursor-based for large lists (`Scrivener`, `Flop`, `Paginator`).\n- Normalize filters in contexts; avoid letting controllers build queries directly.\n- Add composite indexes to match filter columns; verify with `EXPLAIN ANALYZE`.\n\n## Multi-Tenancy Patterns\n\n- **Prefix-based**: Postgres schemas per tenant (`put_source\u002F2` with `prefix:`) — good isolation, needs per-tenant migrations.\n- **Row-based**: `tenant_id` column + row filters — simpler migrations; add partial indexes per tenant when large.\n- Always scope queries by tenant in contexts; consider using policies\u002Fguards to enforce.\n\n## Performance and Ops\n\n- Use `Repo.stream` for large exports; wrap in `Repo.transaction`.\n- Cache hot reads with ETS\u002FCachex; invalidate on writes.\n- Watch query counts in LiveView\u002FChannels; preload before rendering to avoid N+1.\n- Telemetry: `OpentelemetryEcto` exports query timings; add DB connection pool metrics.\n\n## Testing\n\n```elixir\nuse MyApp.DataCase, async: true\n\ntest \"registration changeset validates email\" do\n  changeset = User.registration_changeset(%User{}, %{email: \"bad\", password: \"secretsecret\"})\n  refute changeset.valid?\n  assert %{email: [\"has invalid format\"]} = errors_on(changeset)\nend\n```\n\n- `DataCase` sets up sandboxed DB; keep tests async unless transactions conflict.\n- Use factories\u002Ffixtures in `test\u002Fsupport` to build valid structs quickly.\n- For migrations, add regression tests for constraints (unique\u002Findex-backed constraints).\n\n## Common Pitfalls\n\n- Running risky DDL in a single migration step (avoid locks; break apart).\n- Skipping DB constraints and relying only on changesets.\n- Querying associations in loops instead of preloading.\n- Missing transactions for multi-step writes (partial state on failure).\n- Forgetting tenant scoping on read\u002Fwrite in multi-tenant setups.\n","# Ecto Patterns for Phoenix\u002FElixir\n\nEcto is the data layer for Phoenix applications: schemas, changesets, queries, migrations, and transactions. Good Ecto practice keeps domain logic in contexts, enforces constraints in the database, and uses transactions for multi-step workflows.\n\n## Schemas and Changesets\n\n```elixir\ndefmodule MyApp.Accounts.User do\n  use Ecto.Schema\n  import Ecto.Changeset\n\n  schema \"users\" do\n    field :email, :string\n    field :hashed_password, :string\n    field :confirmed_at, :naive_datetime\n    has_many :memberships, MyApp.Orgs.Membership\n    timestamps()\n  end\n\n  def registration_changeset(user, attrs) do\n    user\n    |> cast(attrs, [:email, :password])\n    |> validate_required([:email, :password])\n    |> validate_format(:email, ~r\u002F@\u002F)\n    |> validate_length(:password, min: 12)\n    |> unique_constraint(:email)\n    |> hash_password()\n  end\n\n  defp hash_password(%{valid?: true} = cs),\n    do: put_change(cs, :hashed_password, Argon2.hash_pwd_salt(get_change(cs, :password)))\n  defp hash_password(cs), do: cs\nend\n```\n\n**Guidelines**\n- Keep casting\u002Fvalidation in changesets; keep business logic in contexts.\n- Always pair validation with DB constraints (`unique_constraint`, `foreign_key_constraint`).\n- Use `changeset\u002F2` for updates; avoid mass assigning without casting.\n\n## Migrations\n\n```elixir\ndef change do\n  create table(:users) do\n    add :email, :citext, null: false\n    add :hashed_password, :string, null: false\n    add :confirmed_at, :naive_datetime\n    timestamps()\n  end\n\n  create unique_index(:users, [:email])\nend\n```\n\n**Safe migration tips**\n- Prefer additive changes: add columns nullable, backfill, then enforce null: false.\n- For large tables: use `concurrently: true` for indexes; disable in `change` and wrap in `up\u002Fdown` for Postgres.\n- Data migrations belong in separate modules called from `mix ecto.migrate` via `execute\u002F1` or in distinct scripts; ensure idempotence.\n- Coordinate locks: avoid long transactions; break migrations into small steps.\n\n## Queries and Preloads\n\n```elixir\nimport Ecto.Query\n\ndef list_users(opts \\\\ %{}) do\n  base =\n    from u in MyApp.Accounts.User,\n      preload: [:memberships],\n      order_by: [desc: u.inserted_at]\n\n  Repo.all(apply_pagination(base, opts))\nend\n\ndefp apply_pagination(query, %{limit: limit, offset: offset}),\n  do: query |> limit(^limit) |> offset(^offset)\ndefp apply_pagination(query, _), do: query\n```\n\n**Patterns**\n- Use `preload` rather than calling Repo in loops; prefer `Repo.preload\u002F2` after fetching.\n- Use `select` to avoid loading large blobs.\n- For concurrency, use `Repo.transaction` with `lock: \"FOR UPDATE\"` in queries that need row-level locks.\n\n## Transactions and Ecto.Multi\n\n```elixir\nalias Ecto.Multi\n\ndef onboard_user(attrs) do\n  Multi.new()\n  |> Multi.insert(:user, User.registration_changeset(%User{}, attrs))\n  |> Multi.insert(:org, fn %{user: user} ->\n    Org.changeset(%Org{}, %{owner_id: user.id, name: attrs[\"org_name\"]})\n  end)\n  |> Multi.run(:welcome, fn _repo, %{user: user} ->\n    MyApp.Mailer.deliver_welcome(user)\n    {:ok, :sent}\n  end)\n  |> Repo.transaction()\nend\n```\n\n**Guidelines**\n- Prefer `Multi.run\u002F3` for side effects that can fail; return `{:ok, value}` or `{:error, reason}`.\n- Use `Multi.update_all` for batch updates; include `where` guards to prevent unbounded writes.\n- Propagate errors upward; translate them in controllers\u002FLiveViews.\n\n## Associations and Constraints\n\n- Use `on_replace: :delete`\u002F`:nilify` to control nested changes.\n- Define `foreign_key_constraint\u002F3` and `unique_constraint\u002F3` in changesets to surface DB errors cleanly.\n- For many-to-many, prefer join schema (`has_many :memberships`) instead of automatic `many_to_many` when you need metadata.\n\n## Pagination and Filtering\n\n- Offset\u002Flimit for small datasets; cursor-based for large lists (`Scrivener`, `Flop`, `Paginator`).\n- Normalize filters in contexts; avoid letting controllers build queries directly.\n- Add composite indexes to match filter columns; verify with `EXPLAIN ANALYZE`.\n\n## Multi-Tenancy Patterns\n\n- **Prefix-based**: Postgres schemas per tenant (`put_source\u002F2` with `prefix:`) — good isolation, needs per-tenant migrations.\n- **Row-based**: `tenant_id` column + row filters — simpler migrations; add partial indexes per tenant when large.\n- Always scope queries by tenant in contexts; consider using policies\u002Fguards to enforce.\n\n## Performance and Ops\n\n- Use `Repo.stream` for large exports; wrap in `Repo.transaction`.\n- Cache hot reads with ETS\u002FCachex; invalidate on writes.\n- Watch query counts in LiveView\u002FChannels; preload before rendering to avoid N+1.\n- Telemetry: `OpentelemetryEcto` exports query timings; add DB connection pool metrics.\n\n## Testing\n\n```elixir\nuse MyApp.DataCase, async: true\n\ntest \"registration changeset validates email\" do\n  changeset = User.registration_changeset(%User{}, %{email: \"bad\", password: \"secretsecret\"})\n  refute changeset.valid?\n  assert %{email: [\"has invalid format\"]} = errors_on(changeset)\nend\n```\n\n- `DataCase` sets up sandboxed DB; keep tests async unless transactions conflict.\n- Use factories\u002Ffixtures in `test\u002Fsupport` to build valid structs quickly.\n- For migrations, add regression tests for constraints (unique\u002Findex-backed constraints).\n\n## Common Pitfalls\n\n- Running risky DDL in a single migration step (avoid locks; break apart).\n- Skipping DB constraints and relying only on changesets.\n- Querying associations in loops instead of preloading.\n- Missing transactions for multi-step writes (partial state on failure).\n- Forgetting tenant scoping on read\u002Fwrite in multi-tenant setups.\n",{"name":5,"author":24,"license":15,"version":25,"category":26,"description":7,"progressive_disclosure":27},"Claude MPM Team","1.0.0","toolchain",{"entry_point":28,"token_estimate":40},{"summary":29,"quick_start":30,"when_to_use":35},"Ecto schemas\u002Fchangesets, migrations, queries, transactions, constraints, pagination, tenancy, and performance for Phoenix apps.",[31,32,33,34],"mix ecto.create && mix ecto.migrate","Define schemas + changesets; enforce DB constraints (unique\u002Fforeign keys)","Use Repo.transaction \u002F Ecto.Multi for multi-step writes","Preload associations; paginate with limit\u002Foffset or cursor libs (Scrivener\u002FFlop)",[36,37,38,39],"Designing schemas and changesets with validation\u002Fconstraints","Running migrations safely (DDL ordering, locks) and managing data migrations","Executing transactional flows with Ecto.Multi","Implementing pagination, preloading, and multi-tenant partitioning",{"full":41,"entry":42},5400,170,"main","590aa4fe05d1ec71a02ee9cc76c9a20508b5bcea","skills\u002Fju\u002Fskills\u002Fecto-patterns","https:\u002F\u002Fgithub.com\u002Fjulio211916\u002FTlantiCAD-Studio-V0.1-alpha","https:\u002F\u002Fgithub.com\u002Fjulio211916","Estudiante de ing sistemas y psicologia","2026-05-22 04:43:54",{"source":8,"skillName":5,"commands":51,"prompt":61,"zipAvailable":62},[52,55,58],{"tool":53,"command":54},"npx","npx skills add julio211916\u002FTlantiCAD-Studio-V0.1-alpha --skill ecto-patterns",{"tool":56,"command":57},"bunx","bunx skills add julio211916\u002FTlantiCAD-Studio-V0.1-alpha --skill ecto-patterns",{"tool":59,"command":60},"pnpm","pnpm dlx skills add julio211916\u002FTlantiCAD-Studio-V0.1-alpha --skill ecto-patterns","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjulio211916\u002FTlantiCAD-Studio-V0.1-alpha\u002Fblob\u002Fmain\u002Fskills\u002Fju\u002Fskills\u002Fecto-patterns\u002FSKILL.md",true,[],[65,72,79,86,93,100],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":19},"01M735PMP7K29TEC1BC5A3VJ3Z","simpy","Process-based discrete-event simulation framework in Python. Use this skill when building simulations of systems with processes, queues, resources, and time-based events such as manufacturing systems, service operations, network traffic, logistics, or any system where entities interact with shared resources over time.","https:\u002F\u002Fgithub.com\u002Fjulio211916\u002FTlantiCAD-Studio-V0.1-alpha\u002Fblob\u002Fmain\u002Fskills\u002Fju\u002Fskills\u002Fsimpy\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":19},"01M735NX56AZHYMV3BQ8GYZ7J0","shopify-expert","Builds and debugs Shopify themes (.liquid files, theme.json, sections), develops custom Shopify apps (shopify.app.toml, OAuth, webhooks), and implements Storefront API integrations for headless storefronts. Use when building or customizing Shopify themes, creating Hydrogen or custom React storefronts, developing Shopify apps, implementing checkout UI extensions or Shopify Functions, optimizing performance, or integrating third-party services. Invoke for Liquid templating, Storefront API, app development, checkout customization, Shopify Plus features, App Bridge, Polaris, or Shopify CLI workflows.","https:\u002F\u002Fgithub.com\u002Fjulio211916\u002FTlantiCAD-Studio-V0.1-alpha\u002Fblob\u002Fmain\u002Fskills\u002Fju\u002Fskills\u002Fshopify-expert\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":19},"01M735N9WTN69TVA2T5VS9W1CA","shap","Model interpretability and explainability using SHAP (SHapley Additive exPlanations). Use this skill when explaining machine learning model predictions, computing feature importance, generating SHAP plots (waterfall, beeswarm, bar, scatter, force, heatmap), debugging models, analyzing model bias or fairness, comparing models, or implementing explainable AI. Works with tree-based models (XGBoost, LightGBM, Random Forest), deep learning (TensorFlow, PyTorch), linear models, and any black-box model.","https:\u002F\u002Fgithub.com\u002Fjulio211916\u002FTlantiCAD-Studio-V0.1-alpha\u002Fblob\u002Fmain\u002Fskills\u002Fju\u002Fskills\u002Fshap\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M735N3VQ8R56TXFF16BMF19H","shadcn-ui","Deep expertise on shadcn\u002Fui component library including installation, customization, theming, and accessibility patterns. Use when building UI with shadcn\u002Fui components, integrating Radix UI primitives, configuring Tailwind CSS v4 themes, or implementing dark mode. Covers Next.js App Router, Pages Router, and Vite setups.","https:\u002F\u002Fgithub.com\u002Fjulio211916\u002FTlantiCAD-Studio-V0.1-alpha\u002Fblob\u002Fmain\u002Fskills\u002Fju\u002Fskills\u002Fshadcn-ui\u002FSKILL.md",[],[],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":19},"01M735KH64KS6Z58H6BJWX89BV","seoul-subway-arrival","Look up Seoul real-time subway arrival information with the official Seoul Open Data API. Use when the user asks when a train arrives, which trains are approaching a station, or how crowded Seoul subway timing looks right now.","https:\u002F\u002Fgithub.com\u002Fjulio211916\u002FTlantiCAD-Studio-V0.1-alpha\u002Fblob\u002Fmain\u002Fskills\u002Fju\u002Fskills\u002Fseoul-subway-arrival\u002FSKILL.md",[],[],{"skillNo":101,"name":102,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":104,"categories":105,"keywords":106,"publishedAt":19},"01M735K7KAFBZNACQ66PMDQMQD","seo-optimization","Comprehensive 7-phase SEO optimization workflow covering technical SEO auditing, keyword research strategy, on-page optimization, content SEO and E-E-A-T, structured data implementation, link building, and AI search optimization. Use when auditing search engine visibility, diagnosing ranking issues, implementing schema markup, conducting keyword research, optimizing content for E-E-A-T signals, or adapting for AI-driven search (AI Overviews, SGE).","https:\u002F\u002Fgithub.com\u002Fjulio211916\u002FTlantiCAD-Studio-V0.1-alpha\u002Fblob\u002Fmain\u002Fskills\u002Fju\u002Fskills\u002Fseo-optimization\u002FSKILL.md",[],[]]