Elixir Architect is a Claude Code skill for designing production-ready Elixir/Phoenix applications. It generates documentation, ADRs, and handoff materials for operations teams. Connects to Ash and Claude Code workflows.
git clone https://github.com/maxim-ist/elixir-architect.gitElixir Architect is a Claude Code skill for designing production-ready Elixir/Phoenix applications. It generates documentation, ADRs, and handoff materials for operations teams. Connects to Ash and Claude Code workflows.
[{"step":"Define your project scope","action":"Replace [ELIXIR_APP_NAME] with your app name (e.g., `UserAuth`), [SCALE_REQUIREMENTS] with expected load (e.g., `10k concurrent users`), and [TEAM_ROLE] with your audience (e.g., `DevOps team`).","tip":"Be specific about scale (e.g., `50k requests/minute`) and team constraints (e.g., `no Kubernetes expertise`)."},{"step":"Generate the architecture","action":"Run the prompt in Claude Code or ChatGPT. Save the output to files: `architecture.md`, `adr-001-db.md`, `adr-002-cache.md`, `deployment-runbook.md`, and `monitoring-setup.md`.","tip":"Use `---` to separate sections for easy parsing into individual files."},{"step":"Review and customize","action":"Edit the generated ADRs and runbook to match your team’s conventions (e.g., naming, tooling). Validate the Mermaid diagram using a [Mermaid live editor](https://mermaid.live).","tip":"Replace placeholder values (e.g., `ghcr.io/yourorg/order_flow`) with your actual container registry."},{"step":"Integrate into workflow","action":"Add the runbook to your project’s `docs/` folder. Use the ADRs as a starting point for RFCs. Reference the architecture diagram in your README.","tip":"Link ADRs in your GitHub issues (e.g., `Fixes #123 (see ADR-001)`)."},{"step":"Iterate with Ash Framework","action":"Use the generated Ash domain models as a foundation. Run `mix ash.gen.domain` and adjust based on the ADRs (e.g., resource names, relationships).","tip":"Test Ash resources with `mix ash.gen.context` and validate against the monitoring recommendations."}]
No install command available. Check the GitHub repository for manual installation instructions.
git clone https://github.com/maxim-ist/elixir-architectCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Act as an Elixir Architect. Design a production-ready [ELIXIR_APP_NAME] Phoenix application with [SCALE_REQUIREMENTS] scalability needs. Generate: 1) A high-level architecture diagram in Mermaid syntax, 2) ADRs (Architecture Decision Records) for critical choices like database layer, caching strategy, and deployment topology, 3) A deployment runbook with Docker, Kubernetes, and CI/CD pipeline snippets, 4) Monitoring and observability recommendations using Prometheus/Grafana. Use Ash Framework for domain modeling. Include trade-offs and failure mode analysis. Target audience: [TEAM_ROLE] (e.g., backend engineers, DevOps, or startup CTO).
## Architecture Overview for `OrderFlow` (Elixir/Phoenix)
### High-Level Architecture
```mermaid
graph TD
A[Client] -->|HTTP/GraphQL| B[Phoenix Load Balancer]
B --> C[Phoenix App 1]
B --> D[Phoenix App 2]
C --> E[PostgreSQL Primary]
D --> F[PostgreSQL Replica]
C --> G[Redis Cluster]
D --> G
G --> H[RabbitMQ]
H --> I[Order Processing Workers]
I --> J[S3 Media Storage]
```
### ADRs
**ADR-001: Database Layer**
- Decision: Use Ash Framework with PostgreSQL for domain modeling.
- Rationale: Ash provides domain-driven design patterns and reduces boilerplate. PostgreSQL offers ACID compliance and horizontal scaling via read replicas.
- Trade-offs: Higher operational overhead than DynamoDB for simple CRUD. Mitigation: Use AshPostgres for schema management.
**ADR-002: Caching Strategy**
- Decision: Redis Cluster with write-through caching for hot paths (e.g., product catalog).
- Rationale: Redis offers low-latency reads and pub/sub for real-time updates. Cluster mode ensures high availability.
- Trade-offs: Cache invalidation complexity. Mitigation: Use Ash’s `cache_ttl` and event-driven invalidation via Phoenix PubSub.
### Deployment Runbook
**Docker Setup**
```dockerfile
FROM elixir:1.16-alpine AS builder
WORKDIR /app
RUN mix local.hex --force && mix local.rebar --force
COPY . .
RUN mix deps.get && mix release --overwrite
FROM alpine:latest
RUN apk add --no-cache libstdc++ postgresql-client
COPY --from=builder /app/_build/prod/rel/order_flow .
COPY config/prod.secret.exs .
CMD ["./bin/order_flow", "start"]
```
**Kubernetes Manifest (excerpt)**
```yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: order-flow-app
spec:
replicas: 3
selector:
matchLabels:
app: order-flow
template:
spec:
containers:
- name: app
image: ghcr.io/yourorg/order_flow:1.0.0
ports:
- containerPort: 4000
envFrom:
- secretRef:
name: order-flow-secrets
resources:
requests:
cpu: "500m"
memory: "1Gi"
limits:
cpu: "1"
memory: "2Gi"
```
### Monitoring & Observability
- **Metrics**: Track Phoenix endpoint latency, Ecto query performance, and Ash domain event throughput via Prometheus exporter.
- **Alerts**: Configure Grafana dashboards for:
- 95th percentile API latency > 500ms
- Database connection pool exhaustion
- Redis memory usage > 80% of cluster capacity
- **Logs**: Structured logging with `logger_json` and Loki for aggregation.
### Failure Mode Analysis
1. **PostgreSQL Primary Failure**: Failover to replica via Patroni (handled by Kubernetes operator). Expected RTO: < 30s.
2. **Redis Cluster Split-Brain**: Use Redis Sentinel for automatic failover. Monitor with `redis-cli --cluster check`.
3. **Phoenix App OOM**: Kubernetes HPA scales pods based on memory usage. Pods restart automatically.
**Next Steps**:
1. Review ADRs with the team and adjust based on feedback.
2. Implement CI/CD pipeline in GitHub Actions (see `.github/workflows/deploy.yml`).
3. Set up staging environment with synthetic load testing (e.g., `benchee` for GraphQL queries).
---AI assistant built for thoughtful, nuanced conversation
IronCalc is a spreadsheet engine and ecosystem
ITIL-aligned IT service management platform
Customer feedback management made simple
Enterprise workflow automation and service management platform
Automate your spreadsheet tasks with AI power
Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan