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:
- DDD Testing: Characterization tests (legacy) + specification tests (greenfield) + behavior snapshots
- AI-Powered Debugging: Error analysis, classification, solution candidates
- Performance Optimization: Profiling, bottleneck detection, optimization recommendations
- Automated Code Review: TRUST 5 framework validation
- PR Code Review: Multi-agent pattern (Haiku eligibility + 5 Sonnet parallel reviewers)
- Quality Assurance: CI/CD integration with quality gates
Workflow Progression: Debug → Refactor → Optimize → Review → Test → Profile
When to Use:
- Complete development lifecycle management
- Quality assurance and CI/CD integration
- Multi-language and performance-critical projects
- Technical debt reduction
- PR code review automation
Implementation Guide
Core Concepts
Five integrated components form the workflow:
- AI-Powered Debugging: Error classification (syntax/runtime/logic/integration/performance) and solution candidates ranked by likelihood
- Smart Refactoring: Technical debt analysis with complexity metrics and risk assessment
- Performance Optimization: CPU/memory/IO/network profiling with optimization strategies
- DDD Testing Management: Characterization tests (PRESERVE phase) for legacy + specification tests for greenfield + TRUST 5 validation
- Automated Code Review: TRUST 5 framework with actionable recommendations
TRUST 5 Framework
Quality assessment model with five dimensions:
- Testability: pure functions, injectable dependencies, modular design
- Readability: descriptive names, logical structure, documented complexity
- Understandability: clear business logic, appropriate abstractions, conceptual clarity
- Security: input validation, secret management, OWASP compliance (injection/XSS/CSRF)
- Transparency: comprehensive error handling, structured logs, traceable issues
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):
- Write characterization tests documenting current behavior (not aspirational)
- Organize tests by domain concepts to surface domain boundaries
- Use behavior snapshots as regression safeguards for complex scenarios
- Verify baseline: all characterization tests PASS before any change
- Apply refactoring with continuous test execution
- Run TRUST 5 validation post-refactor
Greenfield Development:
- Derive specification tests from domain requirements (each test = business rule)
- Organize tests by aggregates, entities, value objects (DDD ubiquitous language)
- Specify behavior in business language, not implementation details
- Implement to satisfy specifications
- Verify with integration tests (domain interactions + invariants)
- 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
- Scan codebase for review targets
- Apply TRUST 5 framework per file
- Identify critical issues
- Calculate per-file + aggregate scores
- Generate prioritized recommendations
- Create summary report with improvement roadmap
PR Code Review (Multi-Agent Pattern)
5-step multi-agent pipeline:
- Eligibility Check (Haiku): skip closed/draft/already-reviewed/trivial PRs
- Context Gathering: find CLAUDE.md per modified dir + summarize PR
- Parallel Review (5 Sonnet agents): CLAUDE.md compliance / obvious bugs / git blame / previous comments / code comment compliance
- Confidence Scoring (0-100): 0=false positive, 25=somewhat, 50=moderate, 75=high, 100=certain
- 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:
- Strict: all TRUST dimensions ≥ threshold, zero critical issues, full coverage
- Standard: average score ≥ threshold, no critical issues blocking, warnings allowed
- Lenient: only critical blockers prevent progression
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:
- AI-Powered Debugging — error classification + solution candidates
- Smart Refactoring — technical-debt analysis + safe transforms
- Performance Optimization — profiling + bottleneck detection
- Automated Code Review — TRUST 5 scoring + static analysis
Works Well With
- moai-domain-backend: Backend testing patterns
- moai-domain-frontend: Frontend UI testing
- moai-foundation-core: SPEC system integration
- moai-platform-supabase / moai-platform-vercel / moai-platform-firebase-auth: Platform-specific testing
- moai-workflow-project: Project management workflows
Status: Production Ready
Last Updated: 2026-07-10
Maintained by: MoAI-ADK Development Workflow Team
Version: 2.5.0 (audit remediation: language-neutrality + module re-linking)
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.
Red Flags
- Coverage report shows decreased coverage after a feature addition
- Test file contains
t.Skip() or skip without an accompanying issue tracker link
- Test names are auto-generated (test_1, test_2) instead of behavior-descriptive
- No test touches the error/failure branch of a new function
- Test file imports the concrete implementation instead of the interface
Verification
1---
2name: moai-workflow-testing
3description: >
4 Use when writing tests, measuring coverage, or running characterization,
5 performance, or PR-review QA. Comprehensive specialist combining DDD
6 testing, characterization tests, performance profiling, and TRUST 5
7 quality-assurance validation.
8
9when_to_use: >
10 Use for comprehensive testing and QA: DDD domain-driven testing,
11 characterization tests, behavior preservation, performance profiling,
12 code and PR review, CI/CD, and TRUST 5 quality-assurance validation.
13
14license: Apache-2.0
15compatibility: Designed for Claude Code
16allowed-tools: Read, Write, Edit, Bash(pytest:*), Bash(ruff:*), Bash(npm:*), Bash(npx:*), Bash(node:*), Bash(jest:*), Bash(vitest:*), Bash(go:*), Bash(cargo:*), Bash(mix:*), Bash(uv:*), Bash(bundle:*), Bash(php:*), Bash(phpunit:*), Grep, Glob
17user-invocable: false
18metadata:
19 source: https://skillmd.com/skills/modu-ai/moai-workflow-testing
20 version: "2.4.0"
21 category: "workflow"
22 status: "active"
23 updated: "2026-07-10"
24 modularized: "true"
25 tags: "workflow, ddd, testing, debugging, performance, quality, review, pr-review"
26 author: "MoAI-ADK Team"
27
28# MoAI Extension: Progressive Disclosure
29progressive_disclosure:
30 enabled: true
31 level1_tokens: 100
32 level2_tokens: 5000
33---
34
35# Development Workflow Specialist
36
37## Quick Reference
38
39Unified 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.
40
41Core Capabilities:
42
43- DDD Testing: Characterization tests (legacy) + specification tests (greenfield) + behavior snapshots
44- AI-Powered Debugging: Error analysis, classification, solution candidates
45- Performance Optimization: Profiling, bottleneck detection, optimization recommendations
46- Automated Code Review: TRUST 5 framework validation
47- PR Code Review: Multi-agent pattern (Haiku eligibility + 5 Sonnet parallel reviewers)
48- Quality Assurance: CI/CD integration with quality gates
49
50Workflow Progression: Debug → Refactor → Optimize → Review → Test → Profile
51
52When to Use:
53
54- Complete development lifecycle management
55- Quality assurance and CI/CD integration
56- Multi-language and performance-critical projects
57- Technical debt reduction
58- PR code review automation
59
60---
61
62## Implementation Guide
63
64### Core Concepts
65
66Five integrated components form the workflow:
67
68- AI-Powered Debugging: Error classification (syntax/runtime/logic/integration/performance) and solution candidates ranked by likelihood
69- Smart Refactoring: Technical debt analysis with complexity metrics and risk assessment
70- Performance Optimization: CPU/memory/IO/network profiling with optimization strategies
71- DDD Testing Management: Characterization tests (PRESERVE phase) for legacy + specification tests for greenfield + TRUST 5 validation
72- Automated Code Review: TRUST 5 framework with actionable recommendations
73
74### TRUST 5 Framework
75
76Quality assessment model with five dimensions:
77
78- Testability: pure functions, injectable dependencies, modular design
79- Readability: descriptive names, logical structure, documented complexity
80- Understandability: clear business logic, appropriate abstractions, conceptual clarity
81- Security: input validation, secret management, OWASP compliance (injection/XSS/CSRF)
82- Transparency: comprehensive error handling, structured logs, traceable issues
83
84Overall score: weighted average with critical-dimension override (security/testability cannot be masked).
85
86See [TRUST 5 detailed dimensions and scoring](${CLAUDE_SKILL_DIR}/references/trust5-framework.md) for full assessment rubric.
87
88### DDD Testing Process
89
90Legacy Code (PRESERVE phase):
91
921. Write characterization tests documenting current behavior (not aspirational)
932. Organize tests by domain concepts to surface domain boundaries
943. Use behavior snapshots as regression safeguards for complex scenarios
954. Verify baseline: all characterization tests PASS before any change
965. Apply refactoring with continuous test execution
976. Run TRUST 5 validation post-refactor
98
99Greenfield Development:
100
1011. Derive specification tests from domain requirements (each test = business rule)
1022. Organize tests by aggregates, entities, value objects (DDD ubiquitous language)
1033. Specify behavior in business language, not implementation details
1044. Implement to satisfy specifications
1055. Verify with integration tests (domain interactions + invariants)
1066. Apply TRUST 5 validation
107
108### Debugging, Refactoring, Performance Workflows
109
110All three follow a 6-step pattern: capture/analyze → classify → identify candidates → apply → verify → document.
111
112See [debugging/refactoring/performance step-by-step walkthroughs](${CLAUDE_SKILL_DIR}/references/workflow-processes.md) for detailed process tables.
113
114### Code Review Process
115
1161. Scan codebase for review targets
1172. Apply TRUST 5 framework per file
1183. Identify critical issues
1194. Calculate per-file + aggregate scores
1205. Generate prioritized recommendations
1216. Create summary report with improvement roadmap
122
123### PR Code Review (Multi-Agent Pattern)
124
1255-step multi-agent pipeline:
126
1271. Eligibility Check (Haiku): skip closed/draft/already-reviewed/trivial PRs
1282. Context Gathering: find CLAUDE.md per modified dir + summarize PR
1293. Parallel Review (5 Sonnet agents): CLAUDE.md compliance / obvious bugs / git blame / previous comments / code comment compliance
1304. Confidence Scoring (0-100): 0=false positive, 25=somewhat, 50=moderate, 75=high, 100=certain
1315. Filter & Report: drop issues <80 confidence, post via gh CLI with file/line/commit links
132
133See [PR review multi-agent architecture and output format](${CLAUDE_SKILL_DIR}/references/pr-review-multi-agent.md) for agent role detail and example output.
134
135### Multi-Language Support
136
137Per-language toolchain mappings (Python pytest+ruff+bandit, JS/TS Jest+ESLint+npm audit, Go go test+staticcheck+gosec, Rust cargo test+clippy+gosec equivalents).
138
139See [multi-language toolchain reference](${CLAUDE_SKILL_DIR}/references/multi-language-support.md) for per-language testing/lint/security/perf tool inventory.
140
141---
142
143## Advanced Features
144
145### Quality Gate Configuration
146
147Three strictness modes:
148
149- Strict: all TRUST dimensions ≥ threshold, zero critical issues, full coverage
150- Standard: average score ≥ threshold, no critical issues blocking, warnings allowed
151- Lenient: only critical blockers prevent progression
152
153Gate config: per-dimension thresholds, max issues by severity, coverage targets, perf benchmarks.
154
155### CI/CD Integration
156
157Four-stage pipeline: Code Quality → Testing → Performance → Security. Each stage terminates pipeline on failure with stage-specific failure report.
158
159See [CI/CD integration patterns (GitHub Actions + Docker)](${CLAUDE_SKILL_DIR}/references/integration-patterns.md) for job configuration walkthroughs.
160
161### E2E / Browser Testing
162
163Playwright patterns (Page Object Model, cross-browser, visual regression) and documentation-lookup integration. See [Playwright best practices](${CLAUDE_SKILL_DIR}/references/playwright-best-practices.md).
164
165---
166
167## Modules
168
169Deep-dive modules for each workflow stage. These describe conceptual workflows
170(not an importable SDK) — apply each with your project's own toolchain. Start at
171the [modules index](${CLAUDE_SKILL_DIR}/modules/INDEX.md), or jump to a stage:
172
173- [AI-Powered Debugging](${CLAUDE_SKILL_DIR}/modules/ai-debugging.md) — error classification + solution candidates
174- [Smart Refactoring](${CLAUDE_SKILL_DIR}/modules/smart-refactoring.md) — technical-debt analysis + safe transforms
175- [Performance Optimization](${CLAUDE_SKILL_DIR}/modules/performance-optimization.md) — profiling + bottleneck detection
176- [Automated Code Review](${CLAUDE_SKILL_DIR}/modules/automated-code-review.md) — TRUST 5 scoring + static analysis
177
178---
179
180## Works Well With
181
182- moai-domain-backend: Backend testing patterns
183- moai-domain-frontend: Frontend UI testing
184- moai-foundation-core: SPEC system integration
185- moai-platform-supabase / moai-platform-vercel / moai-platform-firebase-auth: Platform-specific testing
186- moai-workflow-project: Project management workflows
187
188---
189
190Status: Production Ready
191Last Updated: 2026-07-10
192Maintained by: MoAI-ADK Development Workflow Team
193Version: 2.5.0 (audit remediation: language-neutrality + module re-linking)
194
195<!-- moai:evolvable-start id="rationalizations" -->
196## Common Rationalizations
197
198| Rationalization | Reality |
199|---|---|
200| "This code is already covered by integration tests" | Integration tests catch different bugs than unit tests. The testing pyramid exists for a reason. |
201| "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. |
202| "80% coverage is good enough" | Coverage targets are floors, not ceilings. The missing 20% often contains the error handling paths. |
203| "These are just utility functions, they do not need tests" | Utility functions are the most reused code. A bug in a utility propagates everywhere. |
204| "I ran the tests locally, CI will pass" | Environment differences cause CI-only failures. Trust CI output, not local runs. |
205| "Flaky tests are normal, just re-run" | Flaky tests hide real failures. Fix the flakiness or quarantine the test explicitly. |
206
207**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.
208
209**Beyonce Rule**: If you liked it, you should have put a test on it. Untested behavior is unspecified behavior.
210
211<!-- moai:evolvable-end -->
212
213<!-- moai:evolvable-start id="red-flags" -->
214## Red Flags
215
216- Coverage report shows decreased coverage after a feature addition
217- Test file contains `t.Skip()` or `skip` without an accompanying issue tracker link
218- Test names are auto-generated (test_1, test_2) instead of behavior-descriptive
219- No test touches the error/failure branch of a new function
220- Test file imports the concrete implementation instead of the interface
221
222<!-- moai:evolvable-end -->
223
224<!-- moai:evolvable-start id="verification" -->
225## Verification
226
227- [ ] Test suite passes with zero failures (paste command output)
228- [ ] Coverage report generated and meets the 85% threshold for changed packages
229- [ ] Error paths have dedicated test cases (not just happy path)
230- [ ] No flaky tests introduced (run with -count=3 to verify stability)
231- [ ] Test isolation confirmed: each test uses its own fixtures or t.TempDir()
232- [ ] Race detector passed for concurrent code (go test -race or equivalent)
233
234<!-- moai:evolvable-end -->