Moai workflow testing

From modu-ai/moai-adk · View interactive version

Moai workflow testing is an AI agent skill from the GitHub repository modu-ai/moai-adk. Use when writing tests, measuring coverage, or running characterization, performance, or PR-review QA. Comprehensive specialist combining DDD testing, characterization tests, performance profiling, and TRUST 5 quality-assurance validation.

How to use this skill

Skill file

Development Workflow Specialist

Quick Reference

Unified development workflow combining DDD (domain-driven development) testing, debugging guidance, performance optimization, automated code review, and CI/CD quality gates. Emphasizes behavior preservation during refactoring through characterization tests.

Core Capabilities:

Workflow Progression: Debug → Refactor → Optimize → Review → Test → Profile

When to Use:


Implementation Guide

Core Concepts

Five integrated components form the workflow:

TRUST 5 Framework

Quality assessment model with five dimensions:

Overall score: weighted average with critical-dimension override (security/testability cannot be masked).

See TRUST 5 detailed dimensions and scoring for full assessment rubric.

DDD Testing Process

Legacy Code (PRESERVE phase):

  1. Write characterization tests documenting current behavior (not aspirational)
  2. Organize tests by domain concepts to surface domain boundaries
  3. Use behavior snapshots as regression safeguards for complex scenarios
  4. Verify baseline: all characterization tests PASS before any change
  5. Apply refactoring with continuous test execution
  6. Run TRUST 5 validation post-refactor

Greenfield Development:

  1. Derive specification tests from domain requirements (each test = business rule)
  2. Organize tests by aggregates, entities, value objects (DDD ubiquitous language)
  3. Specify behavior in business language, not implementation details
  4. Implement to satisfy specifications
  5. Verify with integration tests (domain interactions + invariants)
  6. Apply TRUST 5 validation

Debugging, Refactoring, Performance Workflows

All three follow a 6-step pattern: capture/analyze → classify → identify candidates → apply → verify → document.

See debugging/refactoring/performance step-by-step walkthroughs for detailed process tables.

Code Review Process

  1. Scan codebase for review targets
  2. Apply TRUST 5 framework per file
  3. Identify critical issues
  4. Calculate per-file + aggregate scores
  5. Generate prioritized recommendations
  6. Create summary report with improvement roadmap

PR Code Review (Multi-Agent Pattern)

5-step multi-agent pipeline:

  1. Eligibility Check (Haiku): skip closed/draft/already-reviewed/trivial PRs
  2. Context Gathering: find AGENTS.md per modified dir + summarize PR
  3. Parallel Review (5 Sonnet agents): AGENTS.md compliance / obvious bugs / git blame / previous comments / code comment compliance
  4. Confidence Scoring (0-100): 0=false positive, 25=somewhat, 50=moderate, 75=high, 100=certain
  5. Filter & Report: drop issues <80 confidence, post via gh CLI with file/line/commit links

See PR review multi-agent architecture and output format for agent role detail and example output.

Multi-Language Support

Per-language toolchain mappings (Python pytest+ruff+bandit, JS/TS Jest+ESLint+npm audit, Go go test+staticcheck+gosec, Rust cargo test+clippy+gosec equivalents).

See multi-language toolchain reference for per-language testing/lint/security/perf tool inventory.


Advanced Features

Quality Gate Configuration

Three strictness modes:

Gate config: per-dimension thresholds, max issues by severity, coverage targets, perf benchmarks.

CI/CD Integration

Four-stage pipeline: Code Quality → Testing → Performance → Security. Each stage terminates pipeline on failure with stage-specific failure report.

See CI/CD integration patterns (GitHub Actions + Docker) for job configuration walkthroughs.

E2E / Browser Testing

Playwright patterns (Page Object Model, cross-browser, visual regression) and documentation-lookup integration. See Playwright best practices.


Modules

Deep-dive modules for each workflow stage. These describe conceptual workflows

(not an importable SDK) — apply each with your project's own toolchain. Start at

the modules index, or jump to a stage:


Works Well With


Status: Production Ready

Maintained by: MoAI-ADK Development Workflow Team

Version: 2.5.0 (audit remediation: language-neutrality + module re-linking)

<!-- moai:evolvable-start id="rationalizations" -->

Common Rationalizations

| Rationalization | Reality |

|---|---|

| "This code is already covered by integration tests" | Integration tests catch different bugs than unit tests. The testing pyramid exists for a reason. |

| "Mocking the database is too hard, I will skip that test" | If the test is hard to write because of coupling, the code needs a better abstraction boundary. |

| "80% coverage is good enough" | Coverage targets are floors, not ceilings. The missing 20% often contains the error handling paths. |

| "These are just utility functions, they do not need tests" | Utility functions are the most reused code. A bug in a utility propagates everywhere. |

| "I ran the tests locally, CI will pass" | Environment differences cause CI-only failures. Trust CI output, not local runs. |

| "Flaky tests are normal, just re-run" | Flaky tests hide real failures. Fix the flakiness or quarantine the test explicitly. |

Shift Left: Find and fix defects as early as possible. Every test that runs in CI instead of locally adds latency. Every test that could have been a unit test but is an E2E test adds fragility.

Beyonce Rule: If you liked it, you should have put a test on it. Untested behavior is unspecified behavior.

<!-- moai:evolvable-end -->

<!-- moai:evolvable-start id="red-flags" -->

Red Flags

<!-- moai:evolvable-end -->

<!-- moai:evolvable-start id="verification" -->

Verification

<!-- moai:evolvable-end -->

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.