Token导航 LogoToken导航

Agent Skill · 待分类

ecto-patterns(外型)

用于辅助安全审计、权限检查、凭据风险、认证流程和常见漏洞排查。它适合让 Agent 梳理敏感配置、检查依赖风险、分析鉴权逻辑或生成安全复核清单。使用时不能把工具输出直接当最终结论,涉及密钥、令牌、用户数据或生产系统时,应先确认最小权限、脱敏方式和操作边界。

ecto-patterns 是待分类类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证为 MIT,第三方扫描已通过,按安装量在待分类类的 11,209 个 Skill 里排第 1,375。

总安装 3,609周安装 146GitHub Stars 39下载 1,133核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:ecto-patterns(外型)
来源仓库:https://github.com/bobmatnyc/claude-mpm-skills
仓库路径:skills/ecto-patterns
安装命令:
npx skills add https://github.com/bobmatnyc/claude-mpm-skills --skill ecto-patterns
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/bobmatnyc/claude-mpm-skills --skill ecto-patterns

这个 Skill 是做什么的

这个 Skill 的分类还没最终确定,用法以来源仓库的说明为准。

用于辅助安全审计、权限检查和认证流程分析,帮助识别凭据风险和常见漏洞。适合梳理敏感配置、检查依赖风险或生成安全复核清单。不能将工具输出直接作为最终结论,涉及密钥或生产系统时应先确认最小权限。安装方式:通过 npx skills add 命令从指定 GitHub 仓库安装。

建议确认权限范围和维护状态,避免触发不必要的文件操作或网络请求。

来源仓库内路径:skills/ecto-patterns

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/bobmatnyc/claude-mpm-skills --skill ecto-patte…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

ecto-patterns 怎么安装?

在终端执行 npx skills add https://github.com/bobmatnyc/claude-mpm-skills --skill ecto-patterns。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

ecto-patterns 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

ecto-patterns 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

ecto-patterns 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

ecto-patterns 用的人多吗?

公开数据是累计安装 3,609 次,近一周安装 146 次,下载 1,133 次,GitHub 39 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

ecto-patterns 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理待分类类任务、又不想每次都手写提示词的人。
  • 需要许可证清楚、并且有第三方扫描结果的团队项目。

不太适合

  • 需要厂商级技术支持和 SLA 的生产系统。

待分类类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
infsh-cli

infsh CLI · Codex、Claude

4,374,576382权限未标注未明确未收录
ai-video-generation

AI 视频生成 · Codex、Claude

4,313,376382调用外部服务未明确有提醒
lark-openapi-explorer

云雀 OpenAPI 浏览器 · Codex、Claude

2,064,1209,011需要联网未明确有提醒
lark-workflow-standup-report

Lark 工作流程站立报告 · Codex、Claude

2,041,6328,978需要联网未明确通过
use-my-browser

使用我的浏览器 · Codex、Claude

1,848,49140操作浏览器未明确未通过
ecto-patterns

外型 · 本页

3,60939需要联网MIT通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Ecto Patterns for Phoenix/Elixir

Ecto 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.

Schemas and Changesets

defmodule MyApp.Accounts.User do
  use Ecto.Schema
  import Ecto.Changeset

  schema "users" do
    field :email, :string
    field :hashed_password, :string
    field :confirmed_at, :naive_datetime
    has_many :memberships, MyApp.Orgs.Membership
    timestamps()
  end

  def registration_changeset(user, attrs) do
    user
    |> cast(attrs, [:email, :password])
    |> validate_required([:email, :password])
    |> validate_format(:email, ~r/@/)
    |> validate_length(:password, min: 12)
    |> unique_constraint(:email)
    |> hash_password()
  end

  defp hash_password(%{valid?: true} = cs),
    do: put_change(cs, :hashed_password, Argon2.hash_pwd_salt(get_change(cs, :password)))
  defp hash_password(cs), do: cs
end

Guidelines

  • Keep casting/validation in changesets; keep business logic in contexts.
  • Always pair validation with DB constraints (unique_constraint, foreign_key_constraint).
  • Use changeset/2 for updates; avoid mass assigning without casting.

Migrations

def change do
  create table(:users) do
    add :email, :citext, null: false
    add :hashed_password, :string, null: false
    add :confirmed_at, :naive_datetime
    timestamps()
  end

  create unique_index(:users, [:email])
end

Safe migration tips

  • Prefer additive changes: add columns nullable, backfill, then enforce null: false.
  • For large tables: use concurrently: true for indexes; disable in change and wrap in up/down for Postgres.
  • Data migrations belong in separate modules called from mix ecto.migrate via execute/1 or in distinct scripts; ensure idempotence.
  • Coordinate locks: avoid long transactions; break migrations into small steps.

Queries and Preloads

import Ecto.Query

def list_users(opts \\ %{}) do
  base =
    from u in MyApp.Accounts.User,
      preload: [:memberships],
      order_by: [desc: u.inserted_at]

  Repo.all(apply_pagination(base, opts))
end

defp apply_pagination(query, %{limit: limit, offset: offset}),
  do: query |> limit(^limit) |> offset(^offset)
defp apply_pagination(query, _), do: query

Patterns

  • Use preload rather than calling Repo in loops; prefer Repo.preload/2 after fetching.
  • Use select to avoid loading large blobs.
  • For concurrency, use Repo.transaction with lock: "FOR UPDATE" in queries that need row-level locks.

Transactions and Ecto.Multi

alias Ecto.Multi

def onboard_user(attrs) do
  Multi.new()
  |> Multi.insert(:user, User.registration_changeset(%User{}, attrs))
  |> Multi.insert(:org, fn %{user: user} ->
    Org.changeset(%Org{}, %{owner_id: user.id, name: attrs["org_name"]})
  end)
  |> Multi.run(:welcome, fn _repo, %{user: user} ->
    MyApp.Mailer.deliver_welcome(user)
    {:ok, :sent}
  end)
  |> Repo.transaction()
end

Guidelines

  • Prefer Multi.run/3 for side effects that can fail; return {:ok, value} or {:error, reason}.
  • Use Multi.update_all for batch updates; include where guards to prevent unbounded writes.
  • Propagate errors upward; translate them in controllers/LiveViews.

Associations and Constraints

  • Use on_replace::delete/:nilify to control nested changes.
  • Define foreign_key_constraint/3 and unique_constraint/3 in changesets to surface DB errors cleanly.
  • For many-to-many, prefer join schema (has_many:memberships) instead of automatic many_to_many when you need metadata.

Pagination and Filtering

  • Offset/limit for small datasets; cursor-based for large lists (Scrivener, Flop, Paginator).
  • Normalize filters in contexts; avoid letting controllers build queries directly.
  • Add composite indexes to match filter columns; verify with EXPLAIN ANALYZE.

Multi-Tenancy Patterns

  • Prefix-based: Postgres schemas per tenant (put_source/2 with prefix:) — good isolation, needs per-tenant migrations.
  • Row-based: tenant_id column + row filters — simpler migrations; add partial indexes per tenant when large.
  • Always scope queries by tenant in contexts; consider using policies/guards to enforce.

Performance and Ops

  • Use Repo.stream for large exports; wrap in Repo.transaction.
  • Cache hot reads with ETS/Cachex; invalidate on writes.
  • Watch query counts in LiveView/Channels; preload before rendering to avoid N+1.
  • Telemetry: OpentelemetryEcto exports query timings; add DB connection pool metrics.

Testing

use MyApp.DataCase, async: true

test "registration changeset validates email" do
  changeset = User.registration_changeset(%User{}, %{email: "bad", password: "secretsecret"})
  refute changeset.valid?
  assert %{email: ["has invalid format"]} = errors_on(changeset)
end
  • DataCase sets up sandboxed DB; keep tests async unless transactions conflict.
  • Use factories/fixtures in test/support to build valid structs quickly.
  • For migrations, add regression tests for constraints (unique/index-backed constraints).

Common Pitfalls

  • Running risky DDL in a single migration step (avoid locks; break apart).
  • Skipping DB constraints and relying only on changesets.
  • Querying associations in loops instead of preloading.
  • Missing transactions for multi-step writes (partial state on failure).
  • Forgetting tenant scoping on read/write in multi-tenant setups.

平台分布

Claude Code

27.26%
按下载量换算309

Gemini CLI

25.04%
按下载量换算284

OpenCode

18.07%
按下载量换算205

Antigravity

11.57%
按下载量换算131

github-copilot

8.42%
按下载量换算95

Codex

3.66%
按下载量换算41

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

继续浏览同类 Skills