
ddd-devops-integration
DDD DevOps integration — CI/CD pipeline with ArchUnit automated architecture validation, multi-module build optimization for DDD projects, containerized deployment with Docker/K8s for layered/hexagonal/clean architectures, database migration strategies for domain events, and monitoring domain health. Use when user asks about DevOps, CI/CD, DDD deployment, ArchUnit CI, or needs to automate DDD project builds.
- Installs
- 131
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/full-stack-skills/ddd-skills --skill ddd-devops-integration- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads ddd-devops-integration automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
DDD DevOps Integration
DevOps for DDD projects — ArchUnit quality gates (P0 block / P1 warn / P2 report) in CI/CD, multi-module incremental builds, architecture-type-aware Dockerfiles, event-driven DB migration, domain event health monitoring.
Workflow
Step 1: Code & Build — Compile all modules. Domain must compile last (zero framework contamination).
Step 2: Unit Test — Per-module unit tests run independently.
Step 3: ArchUnit Validate — P0 (zero deps, layer compliance) blocks CI; P1 (cycle-free) warns; P2 (naming) reports.
Step 4: Integration Test — Cross-module interaction tests with event store and outbox.
Step 5: Containerize — Build Docker images (monolith fat JAR or split CQRS with tuned JVM args).
Step 6: Deploy — K8s deploy with per-BC namespace, DB migration init containers, health probes.
Step 7: Monitor — Domain metrics (event rate, outbox depth, aggregate load) → Prometheus alerts.
Quality gates run at build time, never against production. Violations block merge, not deployment.
Boundary
✅ 擅长处理
- 为 DDD 项目配置 ArchUnit 质量门禁(P0/P1/P2),集成到 CI/CD Pipeline
- 多模块 DDD 项目增量编译优化(Maven/Gradle)、并行构建加速
- 架构类型感知的 Dockerfile 生成(单体/CQRS/六边形架构)
- K8s 部署模板:Per-BC Namespace、DB 迁移 initContainers、领域健康探针
- 事件驱动数据库迁移:Event Store、Outbox 表创建与索引策略
- 领域事件健康监控:Prometheus 指标暴露与告警规则配置
⚠️ 需要素材
- 项目结构:Maven/Gradle 模块列表、依赖关系图 → 自动生成 ArchUnit 规则
- 部署环境:K8s 集群版本、Ingress 策略 → 生成适配的 YAML 模板
- 数据库方案:采用 Layered/CQRS/Event Sourcing 何种模式 → 定制迁移策略
❌ 超出范围(不适用)
- 通用 CI/CD 配置(非 DDD 项目不适用)→ 使用通用 DevOps 工具
- 容器编排基础(K8s 入门教程)→ 参考官方文档
- K8s 集群运维(节点管理、RBAC 配置)→ 使用专业运维工具
- 通用数据库管理(备份、恢复、性能调优)→ 使用 DBA 工具
- 基础设施监控(CPU、内存、网络)→ 使用 Prometheus + Grafana
Audience
This skill is designed for: Backend developers (implementing DDD architectures), Software architects (evaluating and selecting patterns), Tech leads (reviewing team implementations), and DDD beginners (learning domain-driven design fundamentals).
Rules
- ArchUnit P0 checks (domain purity, layer compliance) must block CI pipeline on failure.
- Dockerfiles must be architecture-type-aware (Monolith/CQRS/Hexagonal each get different builds).
- Domain event monitoring must be configured before production deployment.
- Database migrations for event-driven systems must include event store and outbox tables.
CI/CD Pipeline
stages:
- build
- unit-test
- architecture-check # DDD gate
- integration-test
- containerize
- deploy
ArchUnit validation in architecture-check stage: P0 tests (DomainPurityTest, LayeringComplianceTest) block on failure; P1 (ModuleDependencyTest) warns with approval; P2 (NamingConventionTest) reports only. Key ArchUnit rules — domain must not depend on Spring/JPA/MyBatis; layer access restrictions (Domain only by Application, Infrastructure, Interface); no cyclic package dependencies. Full guide: references/ci-cd-archunit-setup.md
多模块构建策略
ddd-project/
├── domain/ (zero framework deps) → application/ (depends on domain only) → infrastructure/ (implements domain interfaces)
├── adapter/ (REST/event adapters) → start/ (boot entry)
Build optimization: mvn compile -pl domain -am (~60% faster changed-only), mvn -T 4 (~40% parallel), mvn verify -pl '!domain' (skip domain), actions/cache for target/ (~80%). Domain purity enforced via Maven Enforcer (bans Spring deps in domain module). Full config: references/multi-module-build-config.md
容器化部署
Monolith — Multi-stage fat JAR:
FROM eclipse-temurin:17-jdk-alpine AS builder
COPY . . && RUN mvn clean package -DskipTests
FROM eclipse-temurin:17-jre-alpine
COPY --from=builder start/target/*.jar app.jar
HEALTHCHECK --interval=30s CMD curl -f http://localhost:8080/actuator/health
CQRS — Separate images: Command (-Xms512m -Xmx2g -XX:+UseZGC, CPU-optimized); Query (-Xms1g -Xmx4g, memory-optimized). K8s Patterns: Per-BC Namespace, DB migration initContainers + Flyway, CQRS split HorizontalPodAutoscaler, NetworkPolicy isolation. Templates: dockerfile-patterns.md | k8s-ddd-reference.md
数据库迁移(事件驱动)
CREATE TABLE domain_event_store (id UUID PRIMARY KEY, aggregate_id VARCHAR(36) NOT NULL,
event_type VARCHAR(200) NOT NULL, event_data JSONB NOT NULL,
occurred_at TIMESTAMPTZ NOT NULL, published BOOLEAN DEFAULT FALSE);
CREATE INDEX idx_events_pending ON domain_event_store(published) WHERE published = FALSE;
CREATE TABLE outbox_message (id UUID PRIMARY KEY, event_id UUID UNIQUE NOT NULL,
payload JSONB NOT NULL, status VARCHAR(20) DEFAULT 'PENDING',
retry_count INT DEFAULT 0, created_at TIMESTAMPTZ DEFAULT NOW());
CREATE INDEX idx_outbox_pending ON outbox_message(status) WHERE status = 'PENDING';
Strategy: Layered single DB → Flyway/Liquibase sequential; CQRS L2 → Dual tracks + lag; Event Sourcing → Axon/EventStoreDB append-only; Per microservice → Per-BC Flyway. Full scripts: flyway-migration.md | db-strategies.md
监控与告警
Bus metrics: domain.events.published (Counter), domain.events.processing.duration (Histogram p50/p95/p99), domain.aggregate.load.duration (Histogram), domain.outbox.depth (Gauge).
Alert rules: DomainEventBacklog (rate > 100 for 2m, critical), OutboxQueueGrowing (depth > 1000 for 1m, critical), EventProcessingErrorRate (> 5% for 2m, warning). Full config: ddd-observability-config.md
Gotchas
- ArchUnit 过严导致开发受阻: 先用 warning 模式运行 2-3 个 sprint,P1/P2 不阻断 CI,团队适应后升级为 error。
- CQRS 读写容器未分离: 命令服务 CPU 密集,查询服务内存密集,应独立构建部署。
- 领域事件监控遗漏: Event 投递延迟、Outbox 堆积、Consumer Lag 是事件驱动架构中最易忽略的可靠性指标。
- 单体打成微服务镜像: 先评估 BC 是否需要独立部署,过度拆分失去聚合内强一致性优势。
- 数据库迁移未考虑事件存储: 添加 Event Store 表时需同步考虑回填、索引、清理策略。
- ArchUnit 不检查充血模型: 需结合 ddd-code-reviewer 做领域模型质量审查。
FAQ
Q: ArchUnit CI 失败但代码正确? A: 检查 Domain 层是否有框架注解污染(如 @Service),移到基础设施层。
Q: Monolith vs 微服务 DDD 部署策略? A: 从单体开始。仅当 BC 需独立扩缩容、单 BC 团队 > 8 人、BC 间部署节奏差异大时再拆分。
Q: 如何监控领域事件而不增加延迟? A: 异步指标(Micrometer Timer 百分比采样)+ 采样追踪(1/100 OpenTelemetry)。绝不阻塞事件发布。
Q: CQRS 读写应共享同一 pipeline? A: 只共享 Domain 模块测试。Command pipeline 跑完整 ArchUnit 门禁;Query pipeline 聚焦读模型 schema 兼容性。
Q: Event Sourcing schema 如何管理? A: Event Store append-only,不需 schema 迁移。版本兼容性通过事件版本号(event_type + version)管理。
Q: Bounded Context 金丝雀发布如何实现? A: Service Mesh(Istio)流量权重分配。新版本先接 5% 流量,监控 domain event 健康指标后全量。
Security & Safety
This skill is pure documentation. It does not collect user data, does not access external services or networks, and contains no executable scripts.
Keywords
ddd devops, ddd ci/cd, archunit ci, domain event monitoring, ddd docker, ddd kubernetes, ddd outbox, ddd database migration, ddd build optimization, ddd quality gate, ddd deployment, ddd alerting, ddd observability, cqrs deployment, event sourcing infrastructure
References
- CI/CD ArchUnit Setup — ArchUnit CI/CD integration guide
- Dockerfile Patterns — Dockerfiles by DDD architecture type
- K8s DDD Reference — K8s deployment for bounded contexts
- Flyway Domain Event Migration — Event store and outbox scripts
- Monitoring & Alerting — Prometheus metrics and alerting rules
- Multi-Module Build Config — Maven/Gradle build optimization
- DDD Observability Config — Micrometer/OTel/Logback configuration
- GitLab CI Pipeline Reference — GitLab CI complete pipeline
- Database Migration Strategies — Event-driven migration strategies
Examples
- GitHub Actions Pipeline — Complete GitHub Actions workflow with ArchUnit
- GitLab CI ArchUnit Pipeline — GitLab CI with architecture validation
- K8s DDD Deployment — K8s manifests for bounded context deployment
- Flyway Domain Event Migration — Complete migration SQL scripts
- Grafana Domain Health Dashboard — Domain event monitoring dashboard
FAQ
What does the ddd-devops-integration skill do?
DDD DevOps integration — CI/CD pipeline with ArchUnit automated architecture validation, multi-module build optimization for DDD projects, containerized deployment with Docker/K8s for layered/hexagonal/clean architectures, database migration strategies for domain events, and monitoring domain health. Use when user asks about DevOps, CI/CD, DDD deployment, ArchUnit CI, or needs to automate DDD project builds.
How do I install ddd-devops-integration?
Run npx skills add https://github.com/full-stack-skills/ddd-skills --skill ddd-devops-integration in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/ddd-devops-integration/ (personal) or .claude/skills/ddd-devops-integration/ (project).
Which AI agents can use ddd-devops-integration?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is ddd-devops-integration safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains ddd-devops-integration?
It is published by full-stack-skills in full-stack-skills/ddd-skills. It has 131 recorded installs.
More from full-stack-skills/ddd-skills
ddd-domain-designer
full-stack-skills/ddd-skills
Open the skill to read its SKILL.md instructions.
ddd-code-reviewer
full-stack-skills/ddd-skills
Open the skill to read its SKILL.md instructions.
ddd-event-storming
full-stack-skills/ddd-skills
Open the skill to read its SKILL.md instructions.
ddd-architecture-clean
full-stack-skills/ddd-skills
Open the skill to read its SKILL.md instructions.
ddd-api-designer
full-stack-skills/ddd-skills
Open the skill to read its SKILL.md instructions.
ddd-architecture-layered
full-stack-skills/ddd-skills
Open the skill to read its SKILL.md instructions.
Popular devops & cloud skills
microsoft-foundry
microsoft/azure-skills
Build, deploy, evaluate, optimize, fine-tune, and manage Microsoft Foundry agents, models, and resources end to end. USE FOR: foundry, azd ai agent, azd provision/deploy, hosted agent scaffold/develop/run/deploy/troubleshoot, prompt agent create, managed harness agent create, GitHub Copilot harness agent, create agent, update agent, add tool to agent, invoke agent, agent insights, evaluate agent, batch eval, continuous eval, continuous monitoring, agent CI/CD, optimize prompt, improve prompt, optimize agent instructions, Agent Optimizer scaffold, dataset curation from traces, deploy model, model fine-tuning (SFT/DPO/RFT), Foundry project, RBAC, role assignment, permissions, quota, capacity, region, deployment failure, AI Services, create Foundry resource, knowledge index, customize deployment, onboard, availability, training-data, grader, distillation, large file upload. DO NOT USE FOR: Azure Functions, App Service, general Azure deploy (use azure-deploy), general Azure prep (use azure
azure-diagnostics
microsoft/azure-skills
Debug Azure production issues on Azure using AppLens, Azure Monitor, resource health, and safe triage. WHEN: debug production issues, troubleshoot app service, app service high CPU, app service deployment failure, troubleshoot container apps, container app 503 or target port mismatch, troubleshoot functions, function telemetry missing or stopped after a config/connection-string change, troubleshoot AKS, VM RDP, Linux SSH, VM black screen, can't connect to VM, reset VM password, NSG or firewall blocking, kubectl cannot connect, kube-system/CoreDNS failures, pod pending, crashloop, node not ready, upgrade failures, analyze logs, KQL, insights, image pull failures, cold start issues, health probe failures, resource health, root cause of errors, troubleshoot event hubs, troubleshoot service bus, messaging SDK error, AMQP connection failure, message lock lost, lock renewal during long-running processing, service bus dead letter.
azure-prepare
microsoft/azure-skills
Prepare azd-based Azure projects for deployment: generates azure.yaml, infrastructure (Bicep/Terraform), and Dockerfiles for the Azure Developer CLI (azd) workflow. USE ONLY when the user explicitly wants to use azd as the deployment tool, or the project already has an azure.yaml file. DO NOT USE FOR: non-azd deployments, Python App Service code-only deploys (use python-appservice-deploy), or cross-cloud migration (use azure-cloud-migrate). WHEN: prepare app for azd, create azure.yaml, set up azd infrastructure, modernize app for Azure with azd, deploy with azd, function app, timer trigger, service bus trigger, event-driven function, managed identity, generate Bicep, generate Terraform, create and deploy to Azure.
azure-ai
microsoft/azure-skills
Use for Azure AI: Search, Speech, OpenAI, Document Intelligence. Helps with search, vector/hybrid search, speech-to-text, text-to-speech, transcription, OCR. WHEN: AI Search, query search, vector search, hybrid search, semantic search, speech-to-text, text-to-speech, transcribe, OCR, convert text to speech.
azure-deploy
microsoft/azure-skills
Execute Azure deployments for ALREADY-PREPARED applications that have existing .azure/deployment-plan.md and infrastructure files. DO NOT use this skill when the user asks to CREATE a new application — use azure-prepare instead. This skill runs azd up, azd deploy, terraform apply, and az deployment commands with built-in error recovery. Requires .azure/deployment-plan.md from azure-prepare and validated status from azure-validate. WHEN: "run azd up", "run azd deploy", "execute deployment", "push to production", "push to cloud", "go live", "ship it", "bicep deploy", "terraform apply", "publish to Azure", "launch on Azure". DO NOT USE WHEN: "create and deploy", "build and deploy", "create a new app", "set up infrastructure", "create and deploy to Azure using Terraform" — use azure-prepare for these.
azure-validate
microsoft/azure-skills
Pre-deployment validation for Azure readiness. Run deep checks on configuration, infrastructure (Bicep or Terraform), RBAC role assignments, managed identity permissions, and prerequisites before deploying. WHEN: validate my app, check deployment readiness, run preflight checks, verify configuration, check if ready to deploy, validate azure.yaml, validate Bicep, test before deploying, troubleshoot deployment errors, validate Azure Functions, validate function app, validate serverless deployment, verify RBAC roles, check role assignments, review managed identity permissions, what-if analysis, validate Container Apps deployment.