Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .claude/rules/moai/core/moai-constitution.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
description: Core constitutional principles for MoAI orchestrator - HARD rules that must always be followed
globs:
paths: "**/.claude/**"
---

# MoAI Constitution
Expand Down
3 changes: 1 addition & 2 deletions .claude/rules/moai/development/coding-standards.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
description: MoAI-specific coding standards for instruction documents and configuration files
globs: .claude/**/*.md, .claude/**/*.yaml, .moai/**/*.yaml, CLAUDE.md
paths: ".claude/**/*.md,.claude/**/*.yaml,.moai/**/*.yaml,CLAUDE.md"
---

# Coding Standards
Expand Down
2 changes: 1 addition & 1 deletion .claude/rules/moai/workflow/context-window-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ This rule applies to all MoAI workflows:
## Cross-references

- `feedback_large_spec_wave_split.md` (auto-memory) — wave-split mitigation for SPECs with 30+ tasks
- `.claude/rules/moai/workflow/file-reading-optimization.md` — token budget per file read
- `.claude/skills/moai/references/file-reading-optimization.md` — token budget per file read
- `output-styles/moai/moai.md` §6 (Persistence & Context Awareness) — orchestrator persistence pattern
- CLAUDE.md §11 (Error Handling) — token-limit recovery flow

Expand Down
52 changes: 49 additions & 3 deletions .claude/rules/moai/workflow/spec-workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,55 @@ Token Strategy:
- Selective file loading
- Enables 70% larger implementations

Development Methodology:
- Configured in quality.yaml (development_mode: ddd or tdd)
- See @workflow-modes.md for detailed methodology cycles
Development Methodology (configured in quality.yaml development_mode):

### DDD Mode — ANALYZE-PRESERVE-IMPROVE

Best for existing projects with < 10% test coverage. Uses manager-ddd agent.

**ANALYZE**: Read existing code, map domain boundaries, identify side effects and implicit contracts.
**PRESERVE**: Write characterization tests capturing current behavior. Create behavior snapshots for regression detection.
**IMPROVE**: Make small incremental changes. Run characterization tests after each change. Refactor with test validation.

### TDD Mode — RED-GREEN-REFACTOR (default)

Best for all development work, new projects, and brownfield with 10%+ coverage. Uses manager-tdd agent.

**RED**: Write a failing test describing desired behavior. Verify it fails. One test at a time.
**GREEN**: Write simplest implementation that passes. No premature optimization.
**REFACTOR**: Clean up while keeping tests green. Extract patterns, remove duplication.

Brownfield enhancement: Pre-RED step reads existing code to understand current behavior before writing the failing test.

### Methodology Auto-Detection

| Project State | Test Coverage | Recommendation |
|--------------|---------------|----------------|
| Greenfield (new) | N/A | TDD |
| Brownfield | >= 10% | TDD |
| Brownfield | < 10% | DDD |

Manual override: `quality.development_mode` in quality.yaml, `MOAI_DEVELOPMENT_MODE` env var, or `moai init --mode <ddd|tdd>`.

### Pre-submission Self-Review

Before marking implementation complete: review full diff against SPEC acceptance criteria. Ask "Is there a simpler approach?" and "Would removing any changes still satisfy the SPEC?" Skip for single-file changes under 50 lines, bug fixes with reproduction test, or user-approved annotation cycle changes.

### Drift Guard

After each methodology cycle, compare planned files against actual modifications. Warns at <= 30% drift. Triggers re-planning (Phase 2.7) above 30%.

### Team Mode Methodology

Each teammate applies the methodology within their file ownership scope. team-validator validates compliance. team-tester exclusively owns test files.

### MX Tag Integration

| Phase | TDD Action | DDD Action |
|-------|-----------|-----------|
| Test/Analyze | RED: add `@MX:TODO` | ANALYZE: 3-Pass scan, identify targets |
| Implement/Preserve | GREEN: remove `@MX:TODO` | PRESERVE: validate tags, add `@MX:LEGACY` |
| Refactor/Improve | REFACTOR: add `@MX:NOTE` | IMPROVE: update tags, add `@MX:NOTE` |

Success Criteria:
- All SPEC requirements implemented
Expand Down
2 changes: 1 addition & 1 deletion .claude/rules/moai/workflow/team-pattern-cookbook.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: "Five team execution patterns with role profiles and communication protocols"
paths: ".moai/config/sections/workflow.yaml,.claude/rules/moai/workflow/team-protocol.md"
paths: ".moai/config/sections/workflow.yaml,.claude/rules/moai/workflow/worktree-integration.md"
---

<!-- Source: revfactory/harness — Apache License 2.0 — see .claude/rules/moai/NOTICE.md -->
Expand Down
54 changes: 0 additions & 54 deletions .claude/rules/moai/workflow/team-protocol.md

This file was deleted.

195 changes: 0 additions & 195 deletions .claude/rules/moai/workflow/workflow-modes.md

This file was deleted.

Loading
Loading