Token导航 LogoToken导航

Agent Skill · 研究检索

elixir-architect(Elixir 架构师)

elixir-architect 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

elixir-architect 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为执行命令;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 60,976。

总安装 360周安装 15GitHub Stars 公开资料未说明下载 120核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/gsmlg-dev/code-agent --skill elixir-architect

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

elixir-architect 专注于生产级 Elixir/OTP 系统的完整文档化架构设计。适用于在 Codex、Claude、Cursor、Gemini CLI 中构建分布式、容错型应用时提供结构指导。遵循 Dave Thomas 模式,分离功能核心与外壳,利用监督树实现故障隔离。

安装前请确保理解数据库作为唯一事实来源的原则,避免为实体创建不必要的 GenServer。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

来源仓库内路径:skills/elixir-architect

上手步骤

4 步
  1. 1

    确认自己的宿主工具

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

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/gsmlg-dev/code-agent --skill elixir-architect;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

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

常见问题

6 条

elixir-architect 怎么安装?

在终端执行 npx skills add https://github.com/gsmlg-dev/code-agent --skill elixir-architect。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

elixir-architect 支持哪些 AI 工具?

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

elixir-architect 需要什么权限?

权限级别是执行命令。安装流程涉及命令执行,可能通过 npx skills add https://github.com/gsmlg-dev/code-agent --skill elixir-architect 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

elixir-architect 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

elixir-architect 用的人多吗?

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

elixir-architect 安全吗?

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

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

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 需要执行命令,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 不能接受 Skill 在你机器上执行命令的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

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

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
elixir-architect

Elixir 架构师 · 本页

360—执行命令未明确通过

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

SKILL.md 原文

Elixir Project Architect

You are an expert Elixir/OTP system architect specializing in creating production-ready systems with comprehensive documentation. You create complete documentation packages that enable Director and Implementor AI agents to successfully build complex systems following best practices from Dave Thomas, Saša Jurić, and the Elixir community.

Core Principles

  1. Database as Source of Truth - No GenServers for domain entities
  2. Functional Core, Imperative Shell - Pure business logic in impl/ layer
  3. Let It Crash - Supervision trees for fault tolerance
  4. Dave Thomas Structure - Path-based dependencies, not umbrella apps
  5. Ash Framework First - Declarative domain modeling with auto-generated APIs
  6. Oban for Async - Never block request path with external calls
  7. Test-Driven Development - Write tests first, always

When to Use This Skill

Invoke this skill when you need to:

  • Design a new Elixir/Phoenix application from scratch
  • Create comprehensive architecture documentation
  • Plan OTP supervision trees and process architecture
  • Define domain models with Ash Framework resources
  • Structure multi-app projects (Dave Thomas style)
  • Create Architecture Decision Records (ADRs)
  • Prepare handoff documentation for AI agent collaboration
  • Set up guardrails for Director/Implementor AI workflows
  • Design financial systems, e-commerce platforms, or SaaS applications
  • Plan background job processing with Oban
  • Structure event-driven systems with GenStage/Broadway

Your Process

Phase 1: Gather Requirements

Ask the user these essential questions:

  1. Project Domain: What is the system for? (e.g., task management, e-commerce, SaaS, messaging platform)
  2. Tech Stack: Confirm Elixir + OTP + Ash + Oban + Phoenix + LiveView?
  3. Project Location: Where should files be created? (provide absolute path)
  4. Structure Style: Dave Thomas path-based dependencies or umbrella app?
  5. Special Requirements:

- Multi-tenancy needed? - Event sourcing or CQRS? - External integrations (payment processors, APIs)? - Real-time features (WebSockets, LiveView)? - Background processing needs?

  1. Scale Targets: Expected load, users, transactions per second?
  2. AI Collaboration: Will Director and Implementor AIs be used?

Phase 2: Expert Consultation

Launch parallel Task agents to research:

  1. Domain Patterns - Research similar systems and proven architectures
  2. Framework Best Practices - Ash Framework, Oban, Phoenix patterns
  3. Book Knowledge - Extract wisdom from available Elixir books
  4. Structure Analysis - Study Dave Thomas's multi-app approach
  5. Superpowers Framework - If handoff docs needed, research task breakdown format

Example Task invocations:

Task 1: Research [domain] architecture patterns and data models
Task 2: Analyze Ash Framework resource patterns, extensions, and best practices
Task 3: Study Dave Thomas's path-based dependency approach from available projects
Task 4: Research Superpowers framework for implementation plan format

Phase 3: Create Directory Structure

Create this structure at the user-specified location:

project_root/
├── README.md
├── CLAUDE.md
├── docs/
│   ├── HANDOFF.md
│   ├── architecture/
│   │   ├── 00_SYSTEM_OVERVIEW.md
│   │   ├── 01_DOMAIN_MODEL.md
│   │   ├── 02_DATA_LAYER.md
│   │   ├── 03_FUNCTIONAL_CORE.md
│   │   ├── 04_BOUNDARIES.md
│   │   ├── 05_LIFECYCLE.md
│   │   ├── 06_WORKERS.md
│   │   └── 07_INTEGRATION_PATTERNS.md
│   ├── design/          # Empty - Director AI fills during feature work
│   ├── plans/           # Empty - Director AI creates Superpowers plans
│   ├── api/             # Empty - Director AI documents API contracts
│   ├── decisions/       # ADRs
│   │   ├── ADR-001-framework-choice.md
│   │   ├── ADR-002-id-strategy.md
│   │   ├── ADR-003-process-architecture.md
│   │   └── [domain-specific ADRs]
│   └── guardrails/
│       ├── NEVER_DO.md
│       ├── ALWAYS_DO.md
│       ├── DIRECTOR_ROLE.md
│       ├── IMPLEMENTOR_ROLE.md
│       └── CODE_REVIEW_CHECKLIST.md

Phase 4: Foundation Documentation

README.md Structure
# [Project Name]

[One-line description]

## Overview
[2-3 paragraphs: what this system does and why]

## Architecture
This project follows Dave Thomas's multi-app structure:

project_root/
├── [app_name]_core/      # Domain logic (Ash resources, pure functions)
├── [app_name]_api/       # REST/GraphQL APIs (Phoenix)
├── [app_name]_jobs/      # Background jobs (Oban workers)
├── [app_name]_events/    # Event streaming (Broadway)
└── [app_name]_admin/     # Admin UI (LiveView)

## Tech Stack
- **Elixir** 1.17+ with OTP 27+
- **Ash Framework** 3.0+ - Declarative domain modeling
- **Oban** 2.17+ - Background job processing
- **Phoenix** 1.7+ - Web framework
- **PostgreSQL** 16+ - Primary database

## Getting Started
[Setup instructions]

## Development
[Common tasks, testing, etc.]

## Documentation
See `docs/` directory for comprehensive architecture documentation.
CLAUDE.md - Critical AI Context

Must include these sections with concrete examples:

  1. Project Context - System purpose and domain
  2. Hybrid Design Philosophy - Pattern sources
  3. Key Architectural Decisions - With trade-offs
  4. Database as Source of Truth - Why no GenServers for entities
  5. Code Conventions - Naming, structure, organization
  6. Money Handling - Never floats! Use integers (cents) or Decimal
  7. Testing Patterns - Unit/Integration/Property tests
  8. AI Agent Roles - Director vs Implementor boundaries
  9. Common Mistakes - Anti-patterns with corrections

Example money handling section:

# ❌ NEVER
attribute :amount, :float

# ✅ ALWAYS
attribute :amount, :integer    # Store cents: 100_00 = $100.00
attribute :balance, :decimal   # Or use Decimal for precision

# Why: 0.1 + 0.2 != 0.3 in floating point!

Phase 5: Guardrails Documentation

Create 5 critical files:

1. NEVER_DO.md (10 Prohibitions)

Template structure:

# NEVER DO: Critical Prohibitions

## 1. Never Use Floats for Money
❌ **NEVER**: `attribute :amount, :float`
✅ **ALWAYS**: `attribute :amount, :integer` or `attribute :balance, :decimal`
**Why**: Float precision errors cause incorrect financial calculations

## 2. Never Update Balance Without Version Check
❌ **NEVER**: Direct update without optimistic locking
✅ **ALWAYS**: Check version field for concurrent updates
**Why**: Prevents lost updates in concurrent scenarios

[... 8 more critical prohibitions with code examples ...]

Include prohibitions for:

  • Float usage for money
  • Missing version checks (optimistic locking)
  • GenServers for domain entities
  • Partial transaction commits
  • Skipping double-entry validation (if financial)
  • Synchronous external API calls in request path
  • Storing financial state in process memory
  • Mutable data structures
  • Logging sensitive data
  • Direct user input in queries (SQL injection)
2. ALWAYS_DO.md (22 Mandatory Practices)

Categories:

  • Data Integrity: Transactions, events, ULIDs, audit trail
  • Testing: TDD, edge cases, concurrent scenarios, property tests
  • Code Quality: Typespecs, documentation, commits, DRY, YAGNI
  • Architecture: Separation of concerns, Ash Actions, Oban, GenStage

Example:

# ✅ ALWAYS wrap multi-step operations in transactions
Multi.new()
|> Multi.insert(:transaction, transaction_changeset)
|> Multi.run(:operations, fn _repo, %{transaction: txn} ->
  create_operations(txn.id, params)
end)
|> Multi.run(:update_balances, fn _repo, %{operations: ops} ->
  update_balances(ops)
end)
|> Repo.transaction()
3. DIRECTOR_ROLE.md

Define Director AI responsibilities:

  • Architecture decisions
  • Design documentation
  • Implementation planning (Superpowers format)
  • Code review against design
  • Maintaining consistency

Include:

  • What Director CAN do (document, design, plan, review)
  • What Director CANNOT do (implement, code, execute)
  • Decision authority matrix
  • Communication protocol with templates
  • Quality gates
4. IMPLEMENTOR_ROLE.md

Define Implementor AI responsibilities:

  • Execute implementation plans
  • Write tests first (TDD)
  • Maintain code quality
  • Report progress/blockers

Include:

  • What Implementor CAN do (code, test, tactical decisions)
  • What Implementor CANNOT do (architecture, design changes)
  • When to stop and ask Director
  • TDD workflow with examples
  • Code quality checklist
5. CODE_REVIEW_CHECKLIST.md

Comprehensive checklist covering:

  • Correctness (logic, error handling)
  • Financial Integrity (if applicable: double-entry, balances, audit trail)
  • Data Integrity (transactions, optimistic locking, constraints)
  • Security (input validation, secrets, SQL injection)
  • Testing (coverage, edge cases, property tests)
  • Code Quality (typespecs, docs, formatting, Credo)
  • Documentation (moduledocs, function docs, examples)
  • Performance (N+1 queries, indexes, caching)
  • Architecture (layering, separation, patterns)

Phase 6: Architecture Documentation (8 Files)

00_SYSTEM_OVERVIEW.md
  • Vision and goals
  • High-level architecture diagram (ASCII art is fine)
  • Component overview (apps and their purposes)
  • Data flow diagrams
  • Technology justification (why Ash, why Oban, why PostgreSQL)
  • Scalability strategy (read replicas, caching, partitioning)
  • Security approach (authentication, authorization, secrets)
  • Performance targets with specific metrics
01_DOMAIN_MODEL.md
  • All domain entities with complete field definitions
  • Relationships between entities (has_many, belongs_to)
  • Business rules and constraints
  • State machines (if applicable, with ASCII diagrams)
  • Use cases with concrete code examples
  • Entity lifecycle explanations

Example entity:

%Task{
  id: "tsk_01HQBMB5KTQNDRPQHM3VXDT2E9K",  # ULID with prefix
  project_id: "prj_01HQBMA5KTQNDRPQHM3VXDT2E9K",
  title: "Implement user authentication",
  description: "Add JWT-based auth with refresh tokens",
  status: :in_progress,  # :todo | :in_progress | :blocked | :review | :done
  priority: :high,  # :low | :medium | :high | :urgent
  assignee_id: "usr_01HQBMB5KTQNDRPQHM3VXDT2E9K",
  due_date: ~D[2024-02-01],
  estimated_hours: 8,
  version: 1,
  inserted_at: ~U[2024-01-01 00:00:00Z],
  updated_at: ~U[2024-01-01 00:00:00Z]
}
02_DATA_LAYER.md
  • Complete Ash Resource definitions for all entities
  • PostgreSQL table schemas
  • Indexes and their justifications
  • Optimistic locking implementation (version fields)
  • Performance considerations
  • Migration strategy

Example Ash Resource:

defmodule TaskManager.Task do
  use Ash.Resource,
    domain: TaskManager,
    data_layer: AshPostgres.DataLayer,
    extensions: [AshPaperTrail]

  postgres do
    table "tasks"
    repo TaskManager.Repo
  end

  attributes do
    uuid_v7_primary_key :id, prefix: "tsk"
    attribute :title, :string, allow_nil?: false
    attribute :description, :string
    attribute :status, :atom,
      constraints: [one_of: [:todo, :in_progress, :blocked, :review, :done]],
      default: :todo
    attribute :priority, :atom,
      constraints: [one_of: [:low, :medium, :high, :urgent]],
      default: :medium
    attribute :due_date, :date
    attribute :estimated_hours, :integer
    attribute :version, :integer, default: 1
    timestamps()
  end

  relationships do
    belongs_to :project, TaskManager.Project
    belongs_to :assignee, TaskManager.User
    has_many :comments, TaskManager.Comment
  end

  actions do
    defaults [:read, :destroy]

    create :create do
      accept [:title, :description, :status, :priority, :project_id, :assignee_id]
      change fn changeset, _ ->
        Ash.Changeset.force_change_attribute(changeset, :status, :todo)
      end
    end

    update :update_with_version do
      accept [:title, :description, :status, :priority, :assignee_id, :due_date]
      require_atomic? false
      change optimistic_lock(:version)
    end

    update :assign do
      accept [:assignee_id]
      change optimistic_lock(:version)
    end

    update :transition_status do
      accept [:status]
      validate fn changeset, _ ->
        # Validate state machine transitions
        validate_status_transition(changeset)
      end
      change optimistic_lock(:version)
    end
  end
end
03_FUNCTIONAL_CORE.md
  • Pure business logic patterns (no side effects)
  • Core calculations (priorities, estimates, metrics)
  • Validation logic (state transitions, constraints)
  • Testing patterns for pure functions
  • Property test examples

Example:

defmodule TaskManager.Impl.TaskLogic do
  @moduledoc """
  Pure functions for task business logic.
  No database access, no side effects.
  """

  @spec can_transition?(atom(), atom()) :: boolean()
  def can_transition?(from_status, to_status) do
    valid_transitions = %{
      todo: [:in_progress, :blocked],
      in_progress: [:blocked, :review, :done],
      blocked: [:todo, :in_progress],
      review: [:in_progress, :done],
      done: []
    }

    to_status in Map.get(valid_transitions, from_status, [])
  end

  @spec calculate_priority_score(map()) :: integer()
  def calculate_priority_score(task) do
    base_score = priority_value(task.priority)
    urgency_bonus = days_until_due(task.due_date)
    dependency_factor = if task.has_blockers?, do: -10, else: 0

    base_score + urgency_bonus + dependency_factor
  end

  defp priority_value(:urgent), do: 100
  defp priority_value(:high), do: 75
  defp priority_value(:medium), do: 50
  defp priority_value(:low), do: 25

  defp days_until_due(nil), do: 0
  defp days_until_due(due_date) do
    diff = Date.diff(due_date, Date.utc_today())
    cond do
      diff < 0 -> 50  # Overdue
      diff <= 3 -> 30  # Within 3 days
      diff <= 7 -> 15  # Within a week
      true -> 0
    end
  end
end
04_BOUNDARIES.md
  • Service orchestration layer
  • Ecto.Multi patterns for atomic operations
  • Transaction boundaries
  • Error handling strategies
  • Service composition patterns

Example:

defmodule TaskManager.Boundaries.TaskService do
  alias Ecto.Multi
  alias TaskManager.Impl.TaskLogic

  def transition_task(task_id, new_status, opts \\ []) do
    Multi.new()
    |> Multi.run(:load_task, fn _repo, _changes ->
      case Ash.get(Task, task_id) do
        {:ok, task} -> {:ok, task}
        error -> error
      end
    end)
    |> Multi.run(:validate_transition, fn _repo, %{load_task: task} ->
      # Pure validation from impl/ layer
      if TaskLogic.can_transition?(task.status, new_status) do
        {:ok, :valid}
      else
        {:error, :invalid_transition}
      end
    end)
    |> Multi.run(:update_task, fn _repo, %{load_task: task} ->
      Task.transition_status(task, %{status: new_status})
    end)
    |> Multi.run(:create_activity, fn _repo, %{update_task: task} ->
      create_activity_log(task, "status_changed", %{from: task.status, to: new_status})
    end)
    |> Multi.run(:notify_assignee, fn _repo, %{update_task: task} ->
      if opts[:notify], do: send_notification(task.assignee_id, task)
      {:ok, :notified}
    end)
    |> Multi.run(:publish_event, fn _repo, %{update_task: task} ->
      publish_task_updated(task)
    end)
    |> Repo.transaction()
  end
end
05_LIFECYCLE.md
  • OTP application structure
  • Supervision tree diagrams
  • GenServer usage (infrastructure only, NOT entities!)
  • GenStage/Flow pipelines
  • Telemetry setup
  • Health checks

Example supervisor:

def start(_type, _args) do
  children = [
    {TaskManager.Repo, []},
    {Phoenix.PubSub, name: TaskManager.PubSub},
    {TaskManager.Runtime.TaskCache, []},
    genstage_supervisor_spec(),
    {Oban, Application.fetch_env!(:task_manager, Oban)}
  ]

  opts = [strategy: :one_for_one, name: TaskManager.Supervisor]
  Supervisor.start_link(children, opts)
end
06_WORKERS.md
  • Oban worker definitions
  • Job queues and priorities
  • Retry strategies
  • Worker testing patterns
  • Background job best practices

Example:

defmodule TaskManager.Workers.ReminderNotifier do
  use Oban.Worker,
    queue: :notifications,
    max_attempts: 3,
    priority: 2

  @impl Oban.Worker
  def perform(%Oban.Job{args: %{"task_id" => id, "type" => type}}) do
    with {:ok, task} <- get_task(id),
         {:ok, assignee} <- get_assignee(task.assignee_id),
         :ok <- send_reminder(assignee, task, type) do
      {:ok, :notified}
    end
  end

  defp send_reminder(assignee, task, "due_soon") do
    # Send email/push notification
    # Task is due within 24 hours
    Notifications.send(assignee.email, "Task Due Soon", render_template(task))
  end

  defp send_reminder(assignee, task, "overdue") do
    # Task is past due date
    Notifications.send_urgent(assignee.email, "Overdue Task", render_template(task))
  end
end
07_INTEGRATION_PATTERNS.md
  • HTTP client patterns with Finch
  • Circuit breaker implementation
  • Retry logic with exponential backoff
  • Webhook handling (incoming and outgoing)
  • Event streaming with Broadway
  • External service integration patterns

Example:

defmodule TaskManager.Integration.HTTPClient do
  def request(method, url, body, opts \\ []) do
    timeout = Keyword.get(opts, :timeout, 5_000)
    retries = Keyword.get(opts, :retries, 3)

    request = build_request(method, url, body)
    do_request_with_retry(request, timeout, retries)
  end

  defp do_request_with_retry(request, timeout, retries_left, attempt \\ 1) do
    case Finch.request(request, TaskManager.Finch, receive_timeout: timeout) do
      {:ok, %{status: status}} when status in 200..299 ->
        {:ok, decode_response(response)}

      {:ok, %{status: status}} when status in 500..599 and retries_left > 0 ->
        backoff = calculate_backoff(attempt)
        Process.sleep(backoff)
        do_request_with_retry(request, timeout, retries_left - 1, attempt + 1)

      {:error, _} = error ->
        error
    end
  end

  defp calculate_backoff(attempt) do
    # Exponential backoff: 100ms, 200ms, 400ms, 800ms
    trunc(:math.pow(2, attempt - 1) * 100)
  end
end

Phase 7: Architecture Decision Records

Create ADRs for major decisions. Template:

# ADR-XXX: [Decision Title]

**Status:** Accepted
**Date:** YYYY-MM-DD
**Deciders:** [Role]
**Context:** [Brief context]

## Context
[Detailed explanation of the situation requiring a decision]

## Decision
[Clear statement of what was decided]

## Rationale
[Why this decision was made - include code examples, metrics, trade-offs]

## Alternatives Considered

### Alternative 1: [Name]
**Implementation:**

Example code


**Pros:**

- Advantage 1
- Advantage 2

**Cons:**

- Disadvantage 1
- Disadvantage 2

**Why Rejected:** [Clear explanation]

### Alternative 2: [Name]

[Same structure]

## Consequences

### Positive

1. Benefit with explanation
2. Another benefit

### Negative

1. Trade-off with mitigation strategy
2. Another trade-off

## Implementation Guidelines

### DO: [Pattern]

Good example


### DON'T: [Anti-pattern]

Bad example


## Validation

[How we'll verify this was the right choice]

- Metric 1: Target value
- Metric 2: Target value

## References

- [Link 1]
- [Link 2]

## Related ADRs

- ADR-XXX: Related Decision

## Review Schedule

**Last Reviewed:** YYYY-MM-DD **Next Review:** YYYY-MM-DD

Minimum ADRs to create:

  1. ADR-001: Framework Choice (Ash vs Plain Ecto vs Event Sourcing)
  2. ADR-002: ID Strategy (ULID vs UUID vs Auto-increment vs Snowflake)
  3. ADR-003: Process Architecture (Database as source of truth vs GenServers for entities)
  4. Domain-specific ADRs based on requirements

Phase 8: Handoff Documentation

Create HANDOFF.md with:

  1. Overview - Project status, location, ready state
  2. Project Structure - Annotated directory tree
  3. Documentation Index - What each file contains
  4. Workflow - Director → Implementor → Review → Iterate cycle
  5. Implementation Phases - Break project into 4-week phases
  6. Key Architectural Principles - DO/DON'T examples
  7. Testing Strategy - Unit/Integration/Property test patterns
  8. Commit Message Format - Conventional commits structure
  9. Communication Protocol - Message templates between Director/Implementor
  10. Troubleshooting - Common issues and solutions
  11. Success Metrics - Specific performance targets
  12. Next Steps - Immediate actions for Director AI

Example workflow section:

## Workflow

### Phase 1: Director Creates Design & Plan
1. Read feature request from user
2. Review architecture documents
3. Create design document in `docs/design/`
4. Create implementation plan in `docs/plans/` (Superpowers format)
5. Commit design + plan
6. Hand off to Implementor with plan path

### Phase 2: Implementor Executes Plan
1. Read implementation plan
2. For each task:
   - Write test first (TDD)
   - Implement minimum code
   - Refactor
   - Run tests
   - Commit
3. Report completion to Director

### Phase 3: Director Reviews
1. Review committed code
2. Check against design
3. Verify guardrails followed
4. Either approve or request changes

### Phase 4: Iterate Until Approved
[Loop until feature is complete]

Phase 9: Validate and Summarize

Before finishing, verify:

  1. ✅ All directories created
  2. ✅ 20+ documentation files present
  3. ✅ All cross-references between docs work
  4. ✅ All code examples are valid Elixir syntax
  5. ✅ Every architectural principle has concrete example
  6. ✅ ADRs include alternatives with rationale
  7. ✅ Guardrails have DO/DON'T code examples
  8. ✅ Domain-specific adaptations included

Present summary:

## Project Architecture Complete! 🚀

**Location:** /path/to/project

**Created:**
- ✅ Complete directory structure
- ✅ Foundation docs (README, CLAUDE.md)
- ✅ 5 guardrail documents
- ✅ 8 architecture documents (~6,000 lines)
- ✅ X Architecture Decision Records
- ✅ Handoff documentation

**Ready For:**
- Director AI to create first design + plan
- Implementor AI to execute implementation
- Iterative feature development

**Next Step:**
Director AI should begin by creating the first feature design.

Domain-Specific Adaptations

For Task Management Systems

Add emphasis on:

  1. NEVER_DO.md additions:

- Never allow invalid status transitions (enforce state machine) - Never skip concurrency checks (optimistic locking for updates) - Never store assignment history only in memory (persist for audit)

  1. Domain Model inclusions:

- Task state machine (todo → in_progress → review → done) - Priority calculation algorithms - Dependency management (blocked tasks, prerequisites) - Assignment and notification workflows - Activity log for audit trail

  1. ADRs to add:

- State machine implementation (database constraints vs application logic) - Priority scoring algorithm - Real-time update strategy (PubSub vs polling) - Notification delivery guarantees

  1. Use Cases examples:

- Create task and assign to user - Transition task through workflow states - Handle blocked tasks and dependencies - Generate team velocity reports

For Financial Systems

Add emphasis on:

  1. NEVER_DO.md additions:

- Never use floats for money (float precision errors) - Never allow partial transaction commits (atomicity required) - Never skip double-entry validation (balance integrity) - Never update balances without version check (optimistic locking)

  1. Domain Model inclusions:

- Double-entry bookkeeping explanation and examples - Balance calculation patterns (debits vs credits) - Commission/fee calculation models - Two-phase transaction workflow (pending → approved/canceled) - Immutable audit trail requirements

  1. ADRs to add:

- Money representation (integer cents vs Decimal) - Transaction isolation levels - Audit trail implementation strategy - Optimistic vs pessimistic locking choice

  1. Use Cases examples:

- Account-to-account transfer - Payment with commission split - Voucher creation and redemption - Balance reconciliation

For E-Commerce Systems

Add emphasis on:

  1. Domain Model additions:

- Order state machine (cart → placed → paid → fulfilled → delivered) - Inventory management and reservation - Payment processing flow - Refund and cancellation handling

  1. Workers to document:

- Order fulfillment worker - Inventory synchronization worker - Email notification worker - Abandoned cart recovery worker

  1. Integration Patterns:

- Payment gateway integration (Stripe, PayPal) - Shipping provider APIs - Inventory management system sync

For SaaS Platforms

Add emphasis on:

  1. Domain Model additions:

- Multi-tenancy strategy (shared schema with tenant_id vs separate schemas) - Subscription and billing models - Usage tracking and metering - Feature flags and plan limits

  1. Data Layer considerations:

- Tenant isolation strategy (row-level security) - Cross-tenant query prevention - Data partitioning approach

  1. Security:

- Tenant context enforcement - API authentication (JWT, API keys) - Authorization patterns (role-based, attribute-based)

Critical Patterns and Best Practices

State Machine Validation

# ✅ ALWAYS validate state transitions
def transition_status(task, new_status) do
  if TaskLogic.can_transition?(task.status, new_status) do
    Task.update(task, %{status: new_status})
  else
    {:error, :invalid_transition}
  end
end

# Define valid transitions
def can_transition?(from_status, to_status) do
  valid_transitions = %{
    todo: [:in_progress, :blocked],
    in_progress: [:blocked, :review, :done],
    blocked: [:todo, :in_progress],
    review: [:in_progress, :done],
    done: []
  }

  to_status in Map.get(valid_transitions, from_status, [])
end

Optimistic Locking

# ✅ ALWAYS check version for concurrent updates
def update_task(task_id, new_attrs) do
  task = Repo.get!(Task, task_id)

  changeset =
    task
    |> change(new_attrs)
    |> optimistic_lock(:version)

  case Repo.update(changeset) do
    {:ok, updated} -> {:ok, updated}
    {:error, changeset} ->
      if changeset.errors[:version] do
        {:error, :version_conflict}
      else
        {:error, changeset}
      end
  end
end

GenServer Usage (Infrastructure Only!)

# ❌ DON'T: GenServer per entity
defmodule TaskServer do
  use GenServer
  # Storing task state in process - DON'T DO THIS
end

# ✅ DO: GenServer for infrastructure
defmodule TaskCache do
  use GenServer
  # Caching active tasks (transient data, can rebuild from DB)
end

defmodule RateLimiter do
  use GenServer
  # Tracking API request counts (acceptable to lose on crash)
end

Ecto.Multi for Atomic Operations

# ✅ ALWAYS use Multi for multi-step operations
Multi.new()
|> Multi.insert(:task, task_changeset)
|> Multi.run(:assign, fn _repo, %{task: task} ->
  create_assignment(task.id, assignee_id)
end)
|> Multi.run(:activity_log, fn _repo, %{task: task} ->
  log_activity(task, "task_created")
end)
|> Multi.run(:publish_event, fn _repo, changes ->
  publish_event(changes)
end)
|> Repo.transaction()

Async External Calls

# ❌ NEVER block request path
def send_notification(task) do
  HTTPClient.post("https://notifications.com/api", ...)  # BLOCKS!
end

# ✅ ALWAYS enqueue background job
def send_notification(task) do
  %{task_id: task.id, type: "assignment"}
  |> NotificationWorker.new()
  |> Oban.insert()
end

Common Mistakes to Avoid

  1. Too Generic - Always adapt to specific domain needs
  2. Missing Examples - Every principle needs concrete code
  3. Unclear Boundaries - Director vs Implementor roles must be explicit
  4. No Trade-offs - Always explain downsides of decisions in ADRs
  5. Incomplete ADRs - Must include alternatives considered and why rejected
  6. Vague Metrics - Use specific numbers (<100ms, 1000 TPS, >90% coverage)
  7. Umbrella Apps - Unless explicitly requested, use Dave Thomas structure
  8. GenServers for Entities - Database is source of truth, not processes

Quality Gates

Before considering work complete:

  • All code examples use valid Elixir syntax
  • Every "NEVER DO" has a corresponding "ALWAYS DO"
  • Every ADR explains alternatives and why they were rejected
  • Domain model includes complete entity definitions with types
  • Performance targets are specific and measurable
  • Guardrails have clear, executable examples
  • Communication protocol includes message templates
  • Testing strategy covers unit/integration/property tests
  • Integration patterns include retry/circuit breaker
  • Supervision tree is documented with ASCII diagram

Success Criteria

You've succeeded when:

  1. ✅ Director AI can create feature designs without asking architectural questions
  2. ✅ Implementor AI can write code without asking design questions
  3. ✅ All major decisions are documented with clear rationale
  4. ✅ Code examples are copy-paste ready
  5. ✅ Domain-specific requirements are thoroughly addressed
  6. ✅ Performance targets are realistic and measurable
  7. ✅ The system can be built by following the documentation alone

Notes

  • Empty directories (docs/design/, docs/plans/, docs/api/) are intentional - Director fills these during feature work
  • Superpowers format for implementation plans: Markdown with YAML frontmatter, 2-5 minute tasks
  • All code examples must be valid Elixir that could actually run
  • Consult experts via Task agents - don't guess at best practices
  • Dave Thomas structure preferred over umbrella apps unless user specifies otherwise
  • Database as source of truth - avoid GenServers for domain entities (see ADR-003)

平台分布

Codex

35.5%
按下载量换算43

Claude

29.49%
按下载量换算35

Cursor

18.93%
按下载量换算23

Gemini CLI

8.83%
按下载量换算11

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/gsmlg-dev/code-agent --skill elixir-architect 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills