Logo vun Moai Workflow Spec

Moai Workflow Spec

OrganisatiounBeléift
modu-ai
moai-workflow-spec

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.

Iwwersiicht

Editeurmodu-ai
Repositorymoai-adk
Skill-Nummmoai-workflow-spec
Stären
1.2K
Forks
226
Matgeliwwert Fichieren
7
LizenzApache-2.0
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 7 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    Vum modu-ai op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Moai Workflow Spec an TypingMind, fir e mat all LLM ze benotzen, oder füügt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vun GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier hei drënner an a bestätegt.
    https://github.com/modu-ai/moai-adk/tree/main/.claude/skills/moai-workflow-spec
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill afügen → Vu GitHub-URL, pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an de Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/modu-ai/moai-adk.git /tmp/moai-adk
mkdir -p .claude/skills
cp -r /tmp/moai-adk/.claude/skills/moai-workflow-spec .claude/skills/moai-workflow-spec
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Moai Workflow Spec an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Moai Workflow Spec automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Moai Workflow Spec net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Keys.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

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 shall ""The system shall "<subject> may be any noun: system, component, service, agent, function, artifact
Event-driven"When , the shall ""WHEN , the system shall "Unchanged trigger semantics
State-driven"While , the shall ""WHILE , the system shall "Unchanged — promoted as a first-class pattern
Capability gate"Where <capability / feature flag / static config>, the shall ""WHERE , the system shall "Reframed — represents capability gate / feature flag / static config (no longer "Optional")
Event-detected (replaces IF/THEN)"When , the shall "IF <condition> THEN <action> [DEPRECATED — use WHEN ]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: ] 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.

[HARD] A SPEC directory MUST contain every artifact its own tier names — and MUST NOT be judged incomplete for omitting one its tier does not name. A Tier S directory holding spec.md and plan.md alone is complete; adding acceptance.md there duplicates criteria that already live in spec.md §3, which is the drift this clause exists to prevent.

State files: .moai/state/last-session-state.json. Generated docs: .moai/docs/api-documentation.md.

SPEC Metadata Schema

Canonical 12 required fields (enforced by the SPEC frontmatter lint rule): id, title, version, status, created, updated, author, priority, phase, module, lifecycle, tags.

Status enum (8 values): draft → in-progress → implemented → completed | superseded | archived | rejected. (planned is retained in the enum as legacy-optional — NOT in the active flow; no agent authors a draft → planned transition. See .claude/rules/moai/development/spec-frontmatter-schema.md § Status Enum.)

Optional fields: issue_number, depends_on, lint.skip, bc_id, tier (S/M/L LEAN tier).

Full schema at .claude/rules/moai/development/spec-frontmatter-schema.md (SSOT).

SPEC Lifecycle Management

Three lifecycle levels:

LevelDescriptionMaintenance
spec-firstSPEC discarded after implementationNone
spec-anchoredSPEC maintained alongside implementationQuarterly review
spec-as-sourceSPEC is single source of truth, only SPEC edited by humansChanges regenerate impl

Transitions: spec-first → spec-anchored when production-critical, spec-anchored → spec-as-source when compliance or regeneration workflow required. Downgrade requires explicit justification.

Quality Metrics

SPEC Quality Indicators: requirement clarity (all EARS patterns used), test coverage (all requirements have scenarios), constraint completeness, success criteria measurability.

Validation Checklist: All EARS requirements testable, no ambiguous language ("should", "might", "usually"), all error cases documented, performance targets quantified, security requirements OWASP-compliant.

Token Management

PhaseToken Budget
PLAN~30%
RUN~60%
SYNC~10%

Context Optimization: SPEC document persists in .moai/specs/. Session state in .moai/state/. Minimal context transfer through SPEC ID reference. Agent delegation reduces token overhead.


SPEC Scope and Classification

What Belongs in .moai/specs/

The .moai/specs/ directory is EXCLUSIVELY for SPEC documents that define features to be implemented.

Valid SPEC Content: feature requirements in EARS format, implementation plans with milestones, acceptance criteria with Given/When/Then scenarios, technical specifications for new functionality, user stories with clear deliverables.

SPEC Characteristics: forward-looking (what WILL be built), actionable, testable, structured (EARS).

What Does NOT Belong in .moai/specs/

Document TypeWhy Not SPECCorrect Location
Security AuditAnalyzes existing code.moai/reports/security-audit-{DATE}/
Performance ReportDocuments current metrics.moai/reports/performance-{DATE}/
Dependency AnalysisReviews existing dependencies.moai/reports/dependency-review-{DATE}/
Architecture OverviewDocuments current state.moai/docs/architecture.md
API ReferenceDocuments existing APIs.moai/docs/api-reference.md
Meeting NotesRecords decisions made.moai/reports/meeting-{DATE}/
RetrospectiveAnalyzes past work.moai/reports/retro-{DATE}/

Out of Scope Classification Rules

These routing rules decide what is out of scope for a SPEC document (and where it belongs instead). When authoring a SPEC's own exclusions section, express each excluded item as a ### Out of Scope — <topic> H3 sub-heading with - bullets so the section satisfies the OutOfScopeRule lint.

[HARD] Reports analyze what EXISTS → .moai/reports/. SPECs define what will be BUILT → .moai/specs/.

[HARD] Documentation explains HOW TO USE → .moai/docs/. SPECs define WHAT TO BUILD → .moai/specs/.


Works Well With

  • moai-foundation-core: SPEC-First DDD methodology and TRUST 5 framework
  • moai-workflow-testing: DDD implementation and test automation
  • moai-workflow-project: Project initialization and configuration
  • moai-workflow-worktree: Git Worktree management for parallel development
  • manager-spec: SPEC creation and requirement analysis agent
  • manager-develop: DDD/TDD implementation based on SPEC requirements
  • /moai gate skill (or sync-phase-quality-gate.sh Stop hook): TRUST 5 quality validation and gate enforcement (former manager-quality role)

For migration scenarios and validation scripts: references/migration-guide.md.


Version: 1.3.1 (skill body compression pass) Integration Status: Complete - Plan-Run-Sync workflow with SDD 2025 features

Common Rationalizations

RationalizationReality
"The SPEC is obvious, I can skip EARS format"EARS exists because obvious requirements are the first to be misinterpreted. The format forces disambiguation.
"Acceptance criteria are redundant with the requirements"Requirements describe intent. Acceptance criteria describe observable evidence. Both are needed.
"I will refine the SPEC during implementation"Late refinement means wasted implementation. SPEC is the cheap place to change your mind.
"Research is a nice-to-have, not a blocker"Skipping research produces SPECs that conflict with existing code. research.md prevents rework.
"Annotation cycle is just user friction"Annotation catches misunderstandings before code is written. It is the cheapest feedback loop in the pipeline.
"This SPEC is small, I do not need a separate file"Every SPEC is a persistent contract. In-message SPECs cannot be referenced by /moai run SPEC-XXX.

Red Flags

  • Requirements written in imperative prose instead of EARS (WHEN X, SHALL Y)
  • Acceptance criteria phrased as subjective judgments ("feels fast", "looks clean")
  • SPEC document missing research.md sibling when modifying existing code
  • Annotation cycle skipped or reduced to a single-turn "looks good"
  • Requirements use "should" where they mean "shall" (optional vs mandatory ambiguity)
  • SPEC-ID not registered in .moai/specs/ directory

Verification

  • SPEC file exists at .moai/specs/SPEC-XXX/spec.md with unique ID
  • Every requirement uses EARS keywords (WHEN, WHILE, WHERE, IF, SHALL)
  • Every acceptance criterion is observable (test output, file existence, metric threshold)
  • AC verification commands follow the plain-command form — see worktree-integration.md § Refused Commands in a Worktree-Isolated Session (measured guard boundary + authoring rule)
  • research.md exists when the SPEC touches existing code
  • Annotation cycle completed with explicit user approval marker
  • SPEC references existing SPEC-IDs it depends on or supersedes
  • Out of Scope section present to prevent scope creep — at least one ### Out of Scope — <topic> H3 sub-heading with a - bullet entry (satisfies the OutOfScopeRule lint)

Matgeliwwert Fichieren

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill Moai Workflow Spec?

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.

Firwat Moai Workflow Spec op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Moai Workflow Spec besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt amplaz vun engem Abonnement pro Benotzerplaz. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Moai Workflow Spec an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/modu-ai/moai-adk/tree/main/.claude/skills/moai-workflow-spec an. TypingMind liest d'Datei SKILL.md, bündelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Moai Workflow Spec benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Moai Workflow Spec benotzen?

Esou vill Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Moai Workflow Spec domat benotzen – GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama a méi – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Moai Workflow Spec gratis?

Jo. De Skill gëtt vum modu-ai ënner der Lizenz Apache-2.0 op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbaart Pak vun Instruktiounen, dat engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt en nokënnt a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a keng Lafzäitëmfeld a funktionéiere mat all Modell.

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇