moai-workflow-ddd

Orchestrate Domain-Driven Development refactors using AST-based analysis and characterization tests.

Updated Jan 16, 2026
One-click install
npx skills add https://github.com/yarang/fastapi-error-code --skill moai-workflow-ddd-yarang
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: moai-workflow-ddd
Source: https://github.com/yarang/fastapi-error-code/tree/main/.claude/skills/moai-workflow-ddd
Command: npx skills add https://github.com/yarang/fastapi-error-code --skill moai-workflow-ddd-yarang

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a disciplined workflow for refactoring large codebases by preserving observable behavior, enabling teams to improve structure without changing functionality.

Core Features & Use Cases

  • ANALYZE-PRESERVE-IMPROVE cycle: Orchestrates domain-driven refactoring steps with structured analysis, safety nets, and incremental changes.
  • Characterization tests & snapshots: Captures current behavior to ensure identical outcomes after refactors.
  • AST-Grep integration: Uses AST-based patterns to guide safe transformations within moai tooling.
  • Collaboration & traceability: Documents decisions and maintains a clear evolution history for audits.

Quick Start

Initiate a DDD session using moai in DDD mode, run AST-grep analysis, generate characterization tests, and apply incremental refactors while validating with tests.

Frequently Asked Questions about moai-workflow-ddd

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

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

To safely refactor legacy code without changing behavior, use an ANALYZE-PRESERVE-IMPROVE cycle with characterization tests to capture current behavior and validate incremental transformations. This workflow ensures structural improvements do not alter functionality.

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

Characterization tests capture and lock in the current behavior of existing code before refactoring. You need them when restructuring large legacy codebases to ensure observable outcomes remain identical after incremental changes are applied.

How do I use AST-grep to guide safe code transformations?

AST-grep uses AST-based patterns to identify and guide safe code transformations during refactoring. It pinpoints structural code matches within the workflow, enabling precise incremental changes while preserving the overall behavior of the application.

Can I apply Domain-Driven Design refactoring to large legacy codebases?

Yes, Domain-Driven Design refactoring applies to large legacy codebases by orchestrating structured domain analysis, establishing safety nets, and applying incremental changes. This automates workflow orchestration to improve structure without altering functionality.

What is the best way to document refactoring decisions for audits?

The best way to document refactoring decisions for audits is to use a workflow that maintains a clear evolution history and enforces traceability. This records incremental transformations and decision points throughout the refactoring session.

Why does my refactoring keep breaking existing application functionality?

Refactoring breaks functionality when lacking behavior-preserving safety nets like characterization tests and behavior snapshots. Applying an ANALYZE-PRESERVE-IMPROVE cycle validates changes against captured current behavior to prevent regressions.