modu-ai/moai-adk/moai-workflow-spec

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

SPEC workflow orchestration with EARS format requirements, acceptance criteria, and Plan-Run-Sync integration for MoAI-ADK development. Use when creating SPEC documents or defining acceptance criteria.

Install

npx vskill@latest install modu-ai/moai-adk/moai-workflow-spec

SKILL.md

SPEC Workflow Management

Quick Reference

SPEC Workflow Orchestration using GEARS notation (current) — backed by the EARS legacy backward-compatibility window — for systematic requirement definition and Plan-Run-Sync workflow integration.

Lint behavior canonicalized per the GEARS migration policy.

Core Capabilities:

  • GEARS-Format Specifications (current): Five requirement patterns with the unified compound clause [Where ...][While ...][When ...] The <subject> shall <behavior> and a generalized <subject> (any noun, not only "the system")
  • EARS Legacy Reference: All EARS patterns preserved per the lint engine's backward-compatibility policy to keep pre-v3 SPECs (those authored before GEARS became canonical) readable
  • Requirement Clarification: Four-step systematic process with assumption analysis
  • SPEC Document Templates: Standardized 3-file structure (spec.md / plan.md / acceptance.md)
  • Plan-Run-Sync Integration: Seamless workflow connection
  • Parallel Development: Git Worktree-based SPEC isolation
  • Quality Gates: TRUST 5 framework validation

GEARS Five Patterns (current notation):

PatternGEARS form (current)EARS form (legacy)Notes
Ubiquitous"The <subject> shall <behavior>""The system shall <behavior>"<subject> may be any noun: system, component, service, agent, function, artifact
Event-driven"When <event-detected>, the <subject> shall <behavior>""WHEN <event>, the system shall <action>"Unchanged trigger semantics
State-driven"While <state>, the <subject> shall <behavior>""WHILE <state>, the system shall <action>"Unchanged — promoted as a first-class pattern
Capability gate"Where <capability / feature flag / static config>, the <subject> shall <behavior>""WHERE <feature exists>, the system shall <action>"Reframed — represents capability gate / feature flag / static config (no longer "Optional")
Event-detected (replaces IF/THEN)"When <undesired-condition-detected>, the <subject> shall <response>"IF <condition> THEN <action> [DEPRECATED — use WHEN <event-detected>]The IF/THEN modality was removed; describe the same intent as a detected event

Unified compound clause: **Where** <precondition> **While** <state> **When** <event> the <subject> shall <behavior> — any subset of the three modifiers may chain.

See GEARS notation reference.

IF/THEN deprecated callout: Authoring guidance previously used IF <condition> THEN <action> to describe state-conditioned behavior. In GEARS that intent is expressed as When <condition-detected> (event-detected form). The lint engine emits a LegacyEARSKeyword warning (non-strict) or error (moai spec lint --strict) on residual IF/THEN in new SPECs. The 6-month backward-compatibility window remains active for legacy SPECs.

Generalized subject substitution: GEARS replaces the hardcoded "the system" subject with <subject>, which may be any noun. Authors writing NEW SPECs MAY use the generalized form. Examples of valid non-"the system" subjects:

  • "The skill shall present GEARS as the primary notation." (Ubiquitous, <subject> = skill)
  • "The agent shall return a blocker report instead of prompting the user." (Ubiquitous, <subject> = agent)
  • "When a SPEC author opens the file, the component shall display the deprecation banner." (Event-driven, <subject> = component)

Pre-v3 SPECs (those authored before GEARS became canonical) keep "The system" as the default subject for readability; existing readers do not need to relearn the canonical phrase.

EARS Five Patterns (legacy — 6-month backward-compatibility window):

PatternFormatUse
Ubiquitous"The system shall always X"Always active
Event-Driven"WHEN event THEN action"Trigger-response
State-Driven"WHILE state, the system shall ..."Conditional behavior (use WHILE, not legacy IF/THEN)
Unwanted"The system shall not X"Prohibition
Optional"Where possible, provide X"Nice-to-have

The legacy IF/THEN modality is replaced by GEARS When <event-detected> — see callout above.

When to Use:

  • Feature planning and requirement definition
  • SPEC document creation and maintenance
  • Parallel feature development coordination
  • Quality assurance and validation planning
  • Requirements gathering from user story narratives

Quick Commands:

bash
/moai plan "user authentication system" # Create new SPEC
/moai plan "login" "signup" # Parallel SPECs
/moai plan "payment processing" --branch # New branch
/moai plan SPEC-001 "add OAuth support" # Update existing

Implementation Guide

Core Concepts

SPEC-First Development Philosophy:

  • EARS format ensures unambiguous requirements
  • Requirement clarification prevents scope creep
  • Systematic validation through test scenarios
  • Integration with DDD workflow for implementation
  • Quality gates enforce completion criteria
  • Constitution reference ensures project-wide consistency
Constitution Reference (SDD 2025 Standard)

Constitution defines the project DNA that all SPECs must respect. Before creating any SPEC, verify alignment with .moai/project/tech.md.

Constitution Components: Technology Stack, Naming Conventions, Forbidden Libraries, Architectural Patterns, Security Standards, Logging Standards.

Constitution Verification: All SPEC technology choices align with Constitution stack versions, no forbidden libraries, naming conventions respected, architectural boundaries preserved.

WHY: Constitution prevents architectural drift and ensures maintainability.

SPEC Workflow Stages
StageActivity
1User Input Analysis — parse natural-language feature description
2Requirement Clarification — 4-step systematic process
3EARS Pattern Application — structure requirements using five patterns
4Success Criteria Definition — establish completion metrics
5Test Scenario Generation — create verification test cases
6SPEC Document Generation — produce standardized markdown
GEARS Format (current)

GEARS (Generalized EARS) is the canonical SPEC notation as of v3.0.0. It preserves Ubiquitous / When (event-driven) / While (state-driven) and reframes Where as a capability gate. The legacy IF/THEN modality is replaced by When <event-detected>.

GEARS notation is exhaustively described in docs-site GEARS notation reference and the canonical GEARS migration policy record.

Compound clause example (with non-"the system" subject):

Where the project is initialized While strict mode is active When a SPEC author runs moai spec lint, the lint engine shall emit a LegacyEARSKeyword finding for every residual IF/THEN modality.

This example chains all three GEARS modifiers (Where, While, When) and uses <subject> = "lint engine" rather than "the system".

EARS Format (legacy — 6-month backward-compatibility window)

Five patterns cover all requirement types. Each pattern has a specific use case and test strategy. Pre-v3 SPECs (those authored before GEARS became canonical) continue to use EARS notation and remain valid per the lint engine's backward-compatibility policy.

See EARS deep dive with examples per pattern for use cases, examples, and test strategies for Ubiquitous, Event-Driven, State-Driven, Unwanted, and Optional requirements.

Requirement Clarification Process

5-step systematic process:

  • Step 0: Assumption Analysis (Philosopher Framework) — surface technical, business, team, integration assumptions
  • Step 0.5: Root Cause Analysis (Five Whys) — surface problem to root cause for problem-driven SPECs
  • Step 1: Scope Definition — supported methods, validation rules, failure handling, session management
  • Step 2: Constraint Extraction — performance, security, compatibility, scalability
  • Step 3: Success Criteria — coverage targets, response time percentiles, functional completion, quality gates
  • Step 4: Test Scenario Creation — normal, error, edge, security cases

See requirement clarification detailed workflow for assumption documentation templates and Five Whys application.

[NEEDS CLARIFICATION] Marker Convention

[NEEDS CLARIFICATION: <topic>] markers identify unresolved questions in plan.md and research.md that MUST be settled before Implementation Kickoff Approval (plan→run HUMAN GATE).

Placement: ONLY in plan.md and research.md (NEVER in spec.md or acceptance.md).

Format:

  • [NEEDS CLARIFICATION: <specific topic>] — inline marker for open questions
  • Each marker MUST be addressable via the orchestrator's question-channel capability before run-phase entry
  • plan-auditor detects unclarified markers and flags as "clarification gate" finding

3-Layer Distinction:

  • [NEEDS CLARIFICATION: <topic>] — plan/research artifact blocker (user Q required)
  • TODO — code-level implementation debt (no user Q needed)
  • @MX:TODO — code-level annotation for untested/incomplete code

Processing:

  • plan-auditor scans for [NEEDS CLARIFICATION] markers during audit
  • If any remain, plan-auditor recommends resolution before Implementation Kickoff Approval
  • Orchestrator runs question-channel rounds to resolve each marked topic (where the harness lacks it, carry the unresolved marker into the blocker report rather than letting the gate pass silently)
  • Implementation Kickoff Approval (mandatory human gate) proceeds only after all clarifications are resolved
Plan-Run-Sync Workflow Integration

PLAN (/moai plan): manager-spec analyzes input → EARS requirements → clarification → SPEC creation in .moai/specs/ → optional --branch.

RUN (/moai run): manager-develop loads SPEC → ANALYZE-PRESERVE-IMPROVE (DDD) or RED-GREEN-REFACTOR (TDD) per quality.yaml constitution.development_mode → moai-workflow-testing reference → per-spawn Agent(general-purpose) domain delegation → quality-gate validation (Stop hook / /moai gate).

SYNC (/moai sync): manager-docs synchronizes documentation → API docs from SPEC → README and architecture updates → CHANGELOG → version control commit.

Parallel Development with Git Worktree

Worktree provides isolated working directories per SPEC for parallel development without branch switching. Benefits: parallel development, clear ownership boundaries, dependency isolation, risk reduction.

See worktree workflow patterns for creation commands and team collaboration examples.


Resources

SPEC File Organization

The artifact set is not fixed — it is determined by the SPEC's Tier, classified in the plan phase before authoring begins. Read the tier off the canonical table (.claude/rules/moai/workflow/spec-workflow.md § SPEC Complexity Tier) rather than counting files here.

  • .moai/specs/SPEC-{ID}/spec.md — GEARS specification (EARS accepted during the legacy window). Every tier.
  • .moai/specs/SPEC-{ID}/plan.md — implementation plan, milestones, technical approach. Every tier.
  • .moai/specs/SPEC-{ID}/acceptance.md — acceptance criteria, Given-When-Then scenarios. Tier M and above; at Tier S the criteria live inline in spec.md §3.
  • .moai/specs/SPEC-{ID}/design.md and .moai/specs/SPEC-{ID}/research.md — system design and codebase research. Tier L only.

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
797
Repository forks
139
7-day trend score
33

Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 16 Mar 2026, 7 months ago.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/modu-ai/moai-adk/moai-workflow-spec/badge)](https://verified-skill.com/skills/modu-ai/moai-adk/moai-workflow-spec)

Something wrong with this skill or its page? Tell us.