moai-workflow-ddd

Automate domain-driven refactoring with the ANALYZE-PRESERVE-IMPROVE cycle.

Updated Apr 19, 2026
One-click install
npx skills add https://github.com/windysky/snake-game --skill moai-workflow-ddd-windysky
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: moai-workflow-ddd
Source: https://github.com/windysky/snake-game/tree/main/.claude/skills/moai-workflow-ddd
Command: npx skills add https://github.com/windysky/snake-game --skill moai-workflow-ddd-windysky

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Domain-Driven Development workflow that makes refactoring safe and auditable by enforcing ANALYZE-PRESERVE-IMPROVE cycle to preserve observable behavior.

Core Features & Use Cases

  • Structured refactoring guidance that prevents unintended behavior changes.
  • Characterization tests, behavior snapshots, and test safety nets to document current behavior.
  • AST-based analysis and safe transformations guided by AST-Grep rules.
  • Integrated quality checks and TRUST-5 validation within existing testing workflows.

Quick Start

Begin a safe refactor by following the ANALYZE-PRESERVE-IMPROVE cycle to preserve behavior.

Frequently Asked Questions about moai-workflow-ddd

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I refactor legacy code safely without changing behavior?

Safe domain-driven refactoring uses the ANALYZE-PRESERVE-IMPROVE cycle to ensure behavior preservation. It defines domain boundaries through AST analysis and captures current behavior using characterization tests before applying incremental code transformations.

What are characterization tests and when do I need them for refactoring?

Characterization tests document current observable behavior by capturing behavior snapshots. They are needed before refactoring legacy code to create a safety net that validates incremental changes do not alter intended functionality.

How does AST-grep guide safe code transformations during refactoring?

AST-grep enables safe AST-guided transformations by analyzing the abstract syntax tree to define domain boundaries and enforce structural rules. This ensures incremental changes remain auditable and preserve observable behavior during refactoring.

Can I integrate domain-driven refactoring with my existing testing workflows?

Domain-driven refactoring integrates with existing testing workflows through continuous validation. The process applies integrated quality checks and TRUST-5 validation to verify behavior preservation within your current testing pipelines.

What is the best way to define domain boundaries in a legacy codebase?

Defining domain boundaries in a legacy codebase is best achieved through AST-based analysis. This structural approach identifies logical domains and establishes safe transformation targets for the incremental refactoring cycle.

When should I not use an incremental refactoring approach on legacy code?

Avoid incremental refactoring when you cannot establish characterization tests or behavior snapshots first. Without these safety nets, the ANALYZE-PRESERVE-IMPROVE cycle cannot validate behavior preservation or guarantee safe AST-guided transformations.