moai-adk 0.4.1__py3-none-any.whl → 0.4.5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of moai-adk might be problematic. Click here for more details.

@@ -24,18 +24,21 @@ Automatically analyzes the project environment to create/update product/structur
24
24
 
25
25
  ## 📋 Execution flow
26
26
 
27
- 1. **Environment Analysis**: Automatically detect project type (new/legacy) and language
27
+ 0. **Conversation Language Selection**: User selects the language for all dialogs and documentation
28
+ 1. **Environment Analysis**: Automatically detect project type (new/legacy) and codebase language
28
29
  2. **Establishment of interview strategy**: Select question tree suited to project characteristics
29
30
  3. **User Verification**: Review and approve interview plan
30
- 4. **Create project documentation**: Create product/structure/tech.md
31
+ 4. **Create project documentation**: Create product/structure/tech.md in the selected language
31
32
  5. **Create configuration file**: config.json auto-configuration
32
33
 
33
- ## 🧠 Skill Loadout Overview
34
+ ## 🧠 Associated Skills & Agents
34
35
 
35
- | Agent | Auto core skill | Conditional skills |
36
- | ----- | ---------------- | ------------------ |
37
- | project-manager | Skill("moai-alfred-language-detection") | Skill("moai-foundation-ears"), Skill("moai-foundation-langs"), Detected domain skill (e.g., Skill("moai-domain-backend")), Skill("moai-alfred-tag-scanning"), Skill("moai-alfred-trust-validation"), Skill("moai-alfred-tui-survey") |
38
- | trust-checker | Skill("moai-alfred-trust-validation") | Skill("moai-alfred-tag-scanning"), Skill("moai-foundation-trust"), Skill("moai-alfred-code-reviewer"), Skill("moai-alfred-performance-optimizer"), Skill("moai-alfred-tui-survey") |
36
+ | Agent | Core Skill | Purpose |
37
+ | ----- | -------- | ------- |
38
+ | project-manager | `moai-alfred-language-detection` | Initialize project and interview requirements |
39
+ | trust-checker | `moai-alfred-trust-validation` | Verify initial project structure (optional) |
40
+
41
+ **Note**: TUI Survey Skill is used for user confirmations during project initialization and is shared across all interactive prompts.
39
42
 
40
43
  ## 🔗 Associated Agent
41
44
 
@@ -77,12 +80,70 @@ The user executes the `/alfred:8-project` command to start analyzing the project
77
80
 
78
81
  **Expressions to use**:
79
82
 
80
- - ✅ High/medium/low priority
81
- - ✅ Immediately needed”, step-by-step improvements
83
+ - ✅ "High/medium/low priority"
84
+ - ✅ "Immediately needed", "step-by-step improvements"
82
85
  - ✅ Current facts
83
86
  - ✅ Existing technology stack
84
87
  - ✅ Real problems
85
88
 
89
+ ---
90
+
91
+ ## 🚀 STEP 0: Conversation Language Selection (NEW in v0.4.2)
92
+
93
+ **Purpose**: Establish the conversation language before project initialization begins. This selection applies to all Alfred prompts, interview questions, and generated documentation.
94
+
95
+ ### 0.1 Display Language Selection Menu
96
+
97
+ Alfred displays a language selection menu as the **very first interaction** using `Skill("moai-alfred-tui-survey")`:
98
+
99
+ **Question**:
100
+ ```
101
+ Which language would you like to use for the project initialization and documentation?
102
+ ```
103
+
104
+ **Options** (AskUserQuestion with moai-alfred-tui-survey):
105
+ - **English** (en) — All dialogs and documentation in English
106
+ - **한국어** (ko) — All dialogs and documentation in Korean
107
+ - **日本語** (ja) — All dialogs and documentation in Japanese
108
+ - **中文** (zh) — All dialogs and documentation in Chinese
109
+ - **Other** — User can specify custom language (e.g., "Español", "Français", "Deutsch")
110
+
111
+ ### 0.2 Store Language Preference
112
+
113
+ Alfred records the selected language:
114
+
115
+ ```json
116
+ {
117
+ "conversation_language": "ko",
118
+ "conversation_language_name": "한국어",
119
+ "selected_at": "2025-10-22T12:34:56Z"
120
+ }
121
+ ```
122
+
123
+ This language preference is:
124
+ - Passed to all sub-agents as a context parameter
125
+ - Stored in `.moai/config.json` under `language` field
126
+ - Used to generate all documentation in the selected language
127
+ - Displayed in CLAUDE.md under "## Project Information"
128
+
129
+ ### 0.3 Transition to STEP 1
130
+
131
+ After language selection, all subsequent interactions proceed in the selected language:
132
+ - Alfred's prompts are translated
133
+ - project-manager sub-agent receives language parameter
134
+ - Interview questions are in the selected language
135
+ - Generated documents (product.md, structure.md, tech.md) are in the selected language
136
+ - CLAUDE.md displays the selected language prominently
137
+
138
+ **Example output for Korean selection**:
139
+ ```markdown
140
+ ✅ 언어 선택 완료: 한국어 (ko)
141
+
142
+ 이제 프로젝트 환경 분석으로 진행하겠습니다...
143
+ ```
144
+
145
+ ---
146
+
86
147
  ## 🚀 STEP 1: Environmental analysis and interview plan development
87
148
 
88
149
  Analyze the project environment and develop a systematic interview plan.
@@ -343,15 +404,37 @@ After Alfred receives the project-manager's interview plan report, calls `Skill(
343
404
 
344
405
  After user approval, the project-manager agent performs initialization.
345
406
 
346
- ### 2.1 Call project-manager agent (when user selects New)
407
+ ### 2.1 Call project-manager agent (when user selects "New")
408
+
409
+ Alfred starts project initialization by calling the project-manager agent with the following parameters:
347
410
 
348
- Alfred starts project initialization by calling the project-manager agent. We will proceed based on the following information:
349
- - Detected Languages: [Language List]
411
+ **Parameters passed to project-manager**:
412
+ - **conversation_language** (from STEP 0): Language code selected by user (e.g., "ko", "en", "ja", "zh")
413
+ - **language_name** (from STEP 0): Display name of selected language (e.g., "Korean", "English")
414
+ - Detected Languages: [Language List from codebase detection]
350
415
  - Project Type: [New/Existing]
351
416
  - Existing Document Status: [Existence/Absence]
352
417
  - Approved Interview Plan: [Plan Summary]
353
418
 
354
- Agents conduct structured interviews and create/update product/structure/tech.md documents.
419
+ **Execution**:
420
+ ```bash
421
+ # Pseudo-code showing parameter flow
422
+ Task(
423
+ subagent_type="project-manager",
424
+ description="Initialize project with conversation language support",
425
+ prompt=f"""You are project-manager. Initialize project with these parameters:
426
+ - conversation_language: "{conversation_language}" # e.g., "ko"
427
+ - language_name: "{language_name}" # e.g., "Korean"
428
+ - project_type: "{project_type}" # e.g., "new"
429
+ - detected_languages: {detected_languages}
430
+
431
+ All interviews and documentation must be generated in the conversation_language.
432
+ Update .moai/config.json with these language parameters.
433
+ """
434
+ )
435
+ ```
436
+
437
+ **Outcome**: The project-manager agent conducts structured interviews entirely in the selected language and creates/updates product/structure/tech.md documents in that language.
355
438
 
356
439
  ### 2.2 Automatic activation of Alfred Skills (optional)
357
440
 
@@ -66,13 +66,14 @@ allowed-tools:
66
66
  4. **Plan creation**: Generate specifications of EARS structure (spec.md, plan.md, acceptance.md)
67
67
  5. **Git operations**: Create branches/PRs via git-manager
68
68
 
69
- ## 🧠 Skill Loadout Overview
69
+ ## 🧠 Associated Skills & Agents
70
70
 
71
- | Agent | Auto core skill | Conditional skills |
72
- | ----- | ---------------- | ------------------ |
73
- | implementation-planner | Skill("moai-alfred-language-detection") | Skill("moai-foundation-langs"), Skill("moai-alfred-performance-optimizer"), Skill("moai-alfred-tag-scanning"), Detected domain skill (e.g., Skill("moai-domain-backend")), Skill("moai-alfred-trust-validation"), Skill("moai-alfred-tui-survey") |
74
- | spec-builder | Skill("moai-foundation-ears") | Skill("moai-alfred-ears-authoring"), Skill("moai-foundation-specs"), Skill("moai-alfred-spec-metadata-validation"), Skill("moai-alfred-tag-scanning"), Skill("moai-foundation-trust"), Skill("moai-alfred-trust-validation"), Skill("moai-alfred-tui-survey") |
75
- | git-manager | Skill("moai-alfred-git-workflow") | Skill("moai-foundation-git"), Skill("moai-alfred-trust-validation"), Skill("moai-alfred-tag-scanning"), Skill("moai-alfred-tui-survey") |
71
+ | Agent | Core Skill | Purpose |
72
+ | ----- | -------- | ------- |
73
+ | spec-builder | `moai-foundation-ears` | Write SPEC with EARS syntax |
74
+ | git-manager | `moai-alfred-git-workflow` | Create branch and PR |
75
+
76
+ **Note**: TUI Survey Skill is used for user confirmations during the plan phase and is shared across all interactive prompts.
76
77
 
77
78
  ## 🔗 Associated Agent
78
79
 
@@ -65,14 +65,16 @@ Analyze SPEC documents to execute planned tasks. It supports not only TDD implem
65
65
  4. **Execute work**: Perform work according to the approved plan
66
66
  5. **Git Operations**: Creating step-by-step commits with git-manager
67
67
 
68
- ## 🧠 Skill Loadout Overview
69
-
70
- | Agent | Auto core skill | Conditional skills |
71
- | ----- | ---------------- | ------------------ |
72
- | implementation-planner | Skill("moai-alfred-language-detection") | Skill("moai-foundation-langs"), Skill("moai-alfred-performance-optimizer"), Skill("moai-alfred-tag-scanning"), Detected domain skill (e.g., Skill("moai-domain-backend")), Skill("moai-alfred-trust-validation"), Skill("moai-alfred-tui-survey") |
73
- | tdd-implementer | Skill("moai-essentials-debug") | Detected language skill (e.g., Skill("moai-lang-python")), Skill("moai-essentials-refactor"), Skill("moai-alfred-git-workflow"), Skill("moai-essentials-perf"), Skill("moai-alfred-performance-optimizer"), Skill("moai-alfred-tui-survey") |
74
- | quality-gate | Skill("moai-alfred-trust-validation") | Skill("moai-alfred-tag-scanning"), Skill("moai-alfred-code-reviewer"), Skill("moai-essentials-review"), Skill("moai-essentials-perf"), Skill("moai-alfred-performance-optimizer"), Skill("moai-foundation-trust"), Skill("moai-alfred-tui-survey") |
75
- | git-manager | Skill("moai-alfred-git-workflow") | Skill("moai-foundation-git"), Skill("moai-alfred-trust-validation"), Skill("moai-alfred-tag-scanning"), Skill("moai-alfred-tui-survey") |
68
+ ## 🧠 Associated Skills & Agents
69
+
70
+ | Agent | Core Skill | Purpose |
71
+ | ----- | -------- | ------- |
72
+ | implementation-planner | `moai-alfred-language-detection` | Detect language and design architecture |
73
+ | tdd-implementer | `moai-essentials-debug` | Implement TDD (RED GREEN REFACTOR) |
74
+ | quality-gate | `moai-alfred-trust-validation` | Verify TRUST 5 principles |
75
+ | git-manager | `moai-alfred-git-workflow` | Commit and manage Git workflows |
76
+
77
+ **Note**: TUI Survey Skill is used for user confirmations during the run phase and is shared across all interactive prompts.
76
78
 
77
79
  ## 🔗 Associated Agent
78
80
 
@@ -19,6 +19,16 @@ allowed-tools:
19
19
  # 📚 MoAI-ADK Step 3: Document Synchronization (+Optional PR Ready)
20
20
  > Interactive prompts rely on `Skill("moai-alfred-tui-survey")` so AskUserQuestion renders TUI selection menus for user surveys and approvals.
21
21
 
22
+ ## 🚀 START HERE
23
+
24
+ **CRITICAL**: Load the TUI Survey Skill FIRST before any user interaction:
25
+
26
+ ```
27
+ Skill("moai-alfred-tui-survey")
28
+ ```
29
+
30
+ This Skill MUST be loaded at the very beginning to enable TUI menu rendering for AskUserQuestion calls throughout this workflow.
31
+
22
32
  ## 🎯 Command Purpose
23
33
 
24
34
  Synchronize code changes to Living Documents and verify @TAG system to ensure complete traceability.
@@ -29,20 +39,31 @@ Synchronize code changes to Living Documents and verify @TAG system to ensure co
29
39
 
30
40
  ## 📋 Execution flow
31
41
 
42
+ **Phase 0: Skill Loading** (IMMEDIATE)
43
+ - Load `Skill("moai-alfred-tui-survey")` at the very start
44
+ - This enables TUI menu rendering for all user interactions
45
+
46
+ **Phase 1: Analysis & Planning**
32
47
  1. **Project status analysis**: Git changes and TAG system verification
33
48
  2. **Determine the scope of synchronization**: Full/partial/selective synchronization strategy
34
- 3. **User Confirmation**: Review and approve synchronization plan
35
- 4. **Document Synchronization**: Living Document updates and TAG integrity guaranteed
36
- 5. **Git operations**: Commit and PR state transitions via git-manager
37
-
38
- ## 🧠 Skill Loadout Overview
39
-
40
- | Agent | Auto core skill | Conditional skills |
41
- | ----- | ---------------- | ------------------ |
42
- | tag-agent | Skill("moai-alfred-tag-scanning") | Skill("moai-foundation-tags"), Skill("moai-alfred-trust-validation"), Skill("moai-foundation-specs"), Skill("moai-alfred-tui-survey") |
43
- | quality-gate | Skill("moai-alfred-trust-validation") | Skill("moai-alfred-tag-scanning"), Skill("moai-alfred-code-reviewer"), Skill("moai-essentials-review"), Skill("moai-essentials-perf"), Skill("moai-alfred-performance-optimizer"), Skill("moai-foundation-trust"), Skill("moai-alfred-tui-survey") |
44
- | doc-syncer | Skill("moai-alfred-tag-scanning") | Skill("moai-foundation-tags"), Skill("moai-alfred-trust-validation"), Skill("moai-foundation-specs"), Skill("moai-alfred-git-workflow"), Skill("moai-alfred-code-reviewer"), Skill("moai-alfred-tui-survey") |
45
- | git-manager | Skill("moai-alfred-git-workflow") | Skill("moai-foundation-git"), Skill("moai-alfred-trust-validation"), Skill("moai-alfred-tag-scanning"), Skill("moai-alfred-tui-survey") |
49
+ 3. **User Confirmation**: Review and approve synchronization plan via AskUserQuestion (TUI menu)
50
+
51
+ **Phase 2: Conditional Execution** (based on user choice)
52
+ 4. **Document Synchronization**: Living Document updates and TAG integrity guaranteed (IF user selects "Proceed")
53
+ 5. **Git operations**: Commit and PR state transitions via git-manager (IF user selects "Proceed")
54
+ - OR abort workflow (IF user selects "Abort")
55
+ - OR revise plan (IF user selects "Modify")
56
+
57
+ ## 🧠 Associated Skills & Agents
58
+
59
+ | Agent | Core Skill | Purpose |
60
+ | ----- | -------- | ------- |
61
+ | tag-agent | `moai-alfred-tag-scanning` | Verify TAG system integrity |
62
+ | quality-gate | `moai-alfred-trust-validation` | Check code quality before sync |
63
+ | doc-syncer | `moai-alfred-tag-scanning` | Synchronize Living Documents |
64
+ | git-manager | `moai-alfred-git-workflow` | Handle Git operations |
65
+
66
+ **Note**: TUI Survey Skill is loaded once at Phase 0 and reused throughout all user interactions.
46
67
 
47
68
  ## 🔗 Associated Agent
48
69
 
@@ -245,6 +245,86 @@ labels:
245
245
  - maintenance
246
246
  ```
247
247
 
248
+ ### Updating config.json for Language Support (v0.4.2+)
249
+
250
+ **Background**: MoAI-ADK v0.4.2 introduces conversation language selection in `/alfred:0-project`. Existing projects need to add language metadata to `.moai/config.json`.
251
+
252
+ #### Migration Steps
253
+
254
+ **For Existing Projects** (before v0.4.2):
255
+
256
+ Current config.json structure:
257
+ ```json
258
+ {
259
+ "project": {
260
+ "locale": "en",
261
+ "mode": "personal",
262
+ "language": "python"
263
+ }
264
+ }
265
+ ```
266
+
267
+ **Updated Structure** (v0.4.2+):
268
+ ```json
269
+ {
270
+ "project": {
271
+ "locale": "en",
272
+ "mode": "personal",
273
+ "language": "python",
274
+ "conversation_language": "en",
275
+ "conversation_language_name": "English",
276
+ "codebase_languages": ["python"]
277
+ }
278
+ }
279
+ ```
280
+
281
+ #### New Fields
282
+
283
+ | Field | Type | Required | Description | Example |
284
+ |-------|------|----------|-------------|---------|
285
+ | `conversation_language` | string (ISO 639-1 code) | ✅ Yes | Two-letter language code for Alfred dialogs | `"ko"`, `"en"`, `"ja"`, `"zh"` |
286
+ | `conversation_language_name` | string | ✅ Yes | Display name of conversation language | `"Korean"`, `"English"` |
287
+ | `codebase_languages` | array of strings | ✅ Yes | List of programming languages detected | `["python"]`, `["typescript", "python"]` |
288
+
289
+ #### Manual Update Process
290
+
291
+ 1. Open `.moai/config.json`
292
+ 2. Add the three new fields under `project`:
293
+ ```json
294
+ "conversation_language": "en",
295
+ "conversation_language_name": "English",
296
+ "codebase_languages": ["python"]
297
+ ```
298
+ 3. Save and commit:
299
+ ```bash
300
+ git add .moai/config.json
301
+ git commit -m "chore: add language metadata to config.json for v0.4.2+"
302
+ ```
303
+
304
+ #### Automated Update (via `/alfred:0-project`)
305
+
306
+ Running `/alfred:0-project` on an existing project will:
307
+ 1. Detect current language settings
308
+ 2. Add new fields automatically
309
+ 3. Preserve existing values
310
+
311
+ **No manual action required if running `/alfred:0-project` after upgrade.**
312
+
313
+ #### Field Mapping (Legacy → New)
314
+
315
+ | Old Field | New Field | Migration Rule |
316
+ |-----------|-----------|-----------------|
317
+ | `locale` | `conversation_language` | Keep as-is (or run `/alfred:0-project` to re-select) |
318
+ | (none) | `conversation_language_name` | Auto-populate from locale mapping |
319
+ | `language` | `codebase_languages` | Wrap in array: `"python"` → `["python"]` |
320
+
321
+ #### Backward Compatibility
322
+
323
+ - ✅ Projects without new fields will continue working
324
+ - ⚠️ New language features (multilingual documentation) unavailable without migration
325
+ - ✅ `/alfred:0-project` automatically migrates on next run
326
+ - ✅ Auto-detection will prefer new fields if present
327
+
248
328
  ---
249
329
 
250
330
  ## Design Principles
@@ -295,6 +295,221 @@ Refs: @TAG-ID (if applicable)
295
295
  - Use `/alfred:3-sync` to update Living Docs and TAG references.
296
296
  - Record rationale for deviations from the SPEC.
297
297
 
298
+ ## Clarification & Interactive Prompting
299
+
300
+ ### The "Vibe Coding" Challenge
301
+
302
+ **Vibe Coding** refers to requesting AI assistance with minimal context, expecting the AI to infer intent from incomplete instructions. While this approach works for experienced developers with high-context understanding of their codebase, it often results in:
303
+
304
+ - ❌ Ambiguous or conflicting implementations
305
+ - ❌ Unnecessary modifications to existing code
306
+ - ❌ Multiple rounds of back-and-forth refinement
307
+ - ❌ Wasted time clarifying intent
308
+
309
+ **Root cause**: AI must *guess* user intent without explicit guidance.
310
+
311
+ ### Solution: Interactive Question Tool + TUI Survey Skill
312
+
313
+ Claude Code now features an **Interactive Question Tool** powered by the `moai-alfred-tui-survey` Skill that transforms vague requests into precise, contextual specifications through guided clarification. Instead of AI making assumptions, the tool actively:
314
+
315
+ 1. **Analyzes** existing code and project context
316
+ 2. **Identifies** ambiguity and competing approaches
317
+ 3. **Presents** concrete options with clear trade-offs via **TUI menu**
318
+ 4. **Captures** explicit user choices (arrow keys, enter)
319
+ 5. **Executes** with certainty based on confirmed intent
320
+
321
+ **Implementation**: The `moai-alfred-tui-survey` Skill provides interactive survey menus that render as terminal UI elements, allowing users to navigate options with arrow keys and confirm with enter.
322
+
323
+ ### How It Works
324
+
325
+ When you provide a high-level request, Alfred may invoke the `moai-alfred-tui-survey` Skill to clarify implementation details through structured TUI menus:
326
+
327
+ ```
328
+ User: "Add a completion page for the competition."
329
+
330
+ Alfred analyzes codebase & context
331
+
332
+ [QUESTION 1] How should the completion page be implemented?
333
+ ┌─────────────────────────────────────────────────────┐
334
+ │ ▶ Create a new public page │ ← arrow keys to select
335
+ │ Modify existing page structure │
336
+ │ Use environment-based gating │
337
+ │ │
338
+ │ (press ↑↓ to navigate, enter to confirm) │
339
+ └─────────────────────────────────────────────────────┘
340
+
341
+ [QUESTION 2] Who should see the completion page?
342
+ ┌─────────────────────────────────────────────────────┐
343
+ │ Only participants (authenticated users) │
344
+ │ ▶ All visitors (public) │
345
+ │ Based on time window │
346
+ │ │
347
+ │ (press ↑↓ to navigate, enter to confirm) │
348
+ └─────────────────────────────────────────────────────┘
349
+
350
+ [REVIEW] Summary of your selections
351
+ ┌─────────────────────────────────────────────────────┐
352
+ │ ✓ Implementation: New public page │
353
+ │ ✓ User experience: All visitors (public) │
354
+ │ │
355
+ │ Ready to submit? │
356
+ │ [Submit answers] [← Go back] │
357
+ └─────────────────────────────────────────────────────┘
358
+
359
+ Execution with confirmed specifications
360
+ ```
361
+
362
+ **Where it's used**:
363
+ - Sub-agents (spec-builder, code-builder pipeline) invoke this skill when ambiguity is detected
364
+ - Alfred commands may trigger interactive surveys during Plan/Run/Sync phases
365
+ - User approvals and architectural decisions benefit most from TUI-based selection
366
+
367
+ ### Key Benefits
368
+
369
+ | Benefit | Impact |
370
+ | --- | --- |
371
+ | **Reduced ambiguity** | AI asks before acting; eliminates guess work |
372
+ | **Faster iteration** | Choices are presented upfront, not discovered after implementation |
373
+ | **Higher quality** | Implementation matches intent precisely |
374
+ | **Lower communication cost** | Answering 3-5 specific questions beats endless refinement |
375
+ | **Active collaboration** | AI becomes a partner, not just a code generator |
376
+
377
+ ### When to Use Interactive Questions
378
+
379
+ **Ideal for**:
380
+ - 🎯 Complex features with multiple valid approaches
381
+ - 🎯 Architectural decisions with trade-offs
382
+ - 🎯 Ambiguous or high-level requirements
383
+ - 🎯 Requests that affect multiple existing components
384
+ - 🎯 Decisions involving user experience or data flow
385
+
386
+ **Example triggers**:
387
+ - "Add a dashboard" → needs clarification on layout, data sources, authentication
388
+ - "Refactor the auth system" → needs clarification on scope, backwards compatibility, migration strategy
389
+ - "Optimize performance" → needs clarification on which bottleneck, acceptable trade-offs
390
+ - "Add multi-language support" → needs clarification on scope, default language, i18n library
391
+
392
+ ### Best Practices for Interactive Prompting
393
+
394
+ 1. **Provide initial context** (even if vague)
395
+ - ✅ "Add a competition results page"
396
+ - ❌ "Do something"
397
+
398
+ 2. **Trust the guided questions**
399
+ - AI will ask if it detects ambiguity
400
+ - Answer each question honestly, don't over-explain
401
+ - Use "Other" option to provide custom input if preset options don't fit
402
+
403
+ 3. **Review before submission**
404
+ - The summary step lets you verify all choices
405
+ - Use "back" to revise any answer
406
+ - Only submit when you're confident in the selections
407
+
408
+ 4. **Iterative refinement is OK**
409
+ - If implementation doesn't match intent, re-run with clearer guidance
410
+ - Your answers inform Alfred's future prompting
411
+ - This feedback loop improves collaboration quality
412
+
413
+ 5. **Combine with Context Engineering**
414
+ - Provide high-level intent + let interactive questions fill in details
415
+ - Reference existing code patterns ("like the auth flow in `/src/auth.ts`")
416
+ - Mention constraints or non-negotiables upfront
417
+
418
+ ### Example: Competition Completion Page (TUI Survey)
419
+
420
+ **User Request**: "Competition is over. Add a completion page."
421
+
422
+ **Step 1: Code Analysis**
423
+ Alfred scans the codebase and detects:
424
+ - Existing `/end` page (auth required, shows results)
425
+ - Need for clarification on scope and user behavior
426
+
427
+ **Step 2: Interactive Survey (moai-alfred-tui-survey activated)**
428
+
429
+ ```
430
+ ────────────────────────────────────────────────────────────────
431
+ ALFRED: How should the completion page be implemented?
432
+ ────────────────────────────────────────────────────────────────
433
+
434
+ ┌─ IMPLEMENTATION APPROACH ────────────────────────────────────┐
435
+ │ │
436
+ │ ▶ Create a new public page (/competition-closed) │
437
+ │ • Unguarded route, visible to all visitors │
438
+ │ • No authentication required │
439
+ │ │
440
+ │ Modify existing /end page with conditional logic │
441
+ │ • Check if competition is active before showing results │
442
+ │ │
443
+ │ Use environment-based gating │
444
+ │ • Set NEXT_PUBLIC_COMPETITION_CLOSED=true │
445
+ │ • Redirect all traffic to completion screen │
446
+ │ │
447
+ │ Use ↑↓ arrows to navigate, ENTER to select │
448
+ │ Type custom answer or press ESC to cancel │
449
+ └──────────────────────────────────────────────────────────────┘
450
+
451
+ → Selection: Create a new public page (/competition-closed)
452
+ ```
453
+
454
+ ```
455
+ ────────────────────────────────────────────────────────────────
456
+ ALFRED: For logged-in participants accessing the new page?
457
+ ────────────────────────────────────────────────────────────────
458
+
459
+ ┌─ USER BEHAVIOR ──────────────────────────────────────────────┐
460
+ │ │
461
+ │ Show submission history │
462
+ │ • Redirect to /end page, display results & timeline │
463
+ │ │
464
+ │ ▶ Show simple completion message only │
465
+ │ • Display "Competition concluded" notice │
466
+ │ • No historical data shown │
467
+ │ │
468
+ │ Custom behavior based on user role │
469
+ │ • Different experience per role type │
470
+ │ │
471
+ │ Use ↑↓ arrows to navigate, ENTER to select │
472
+ │ Type custom answer or press ESC to cancel │
473
+ └──────────────────────────────────────────────────────────────┘
474
+
475
+ → Selection: Show simple completion message only
476
+ ```
477
+
478
+ **Step 3: Review & Confirmation**
479
+
480
+ ```
481
+ ────────────────────────────────────────────────────────────────
482
+ ALFRED: Review your answers
483
+ ────────────────────────────────────────────────────────────────
484
+
485
+ ┌─ SUMMARY ────────────────────────────────────────────────────┐
486
+ │ │
487
+ │ ✓ Implementation approach: │
488
+ │ Create a new public page (/competition-closed) │
489
+ │ │
490
+ │ ✓ User behavior: │
491
+ │ Show simple completion message only │
492
+ │ │
493
+ │ Ready to submit these answers? │
494
+ │ │
495
+ │ [✓ Submit answers] [← Go back and modify] │
496
+ │ │
497
+ └──────────────────────────────────────────────────────────────┘
498
+
499
+ → Action: Submit answers (enter)
500
+ ```
501
+
502
+ **Step 4: Execution**
503
+
504
+ Alfred now executes with **confirmed specifications**:
505
+ - ✅ Creates `/app/competition-closed/page.tsx` (public route)
506
+ - ✅ Implements simple "Competition concluded" message
507
+ - ✅ Handles authenticated users appropriately
508
+ - ✅ Generates with SPEC → TDD → Sync flow
509
+
510
+ **Result**: Clean, intentional implementation that exactly matches confirmed specifications.
511
+ No guessing. No ambiguity. Direct execution. 🎯
512
+
298
513
  ## Commands · Sub-agents · Skills · Hooks
299
514
 
300
515
  MoAI-ADK assigns every responsibility to a dedicated execution layer.
@@ -505,4 +720,16 @@ Alfred enforces these quality gates on every change:
505
720
  - **Description**: {{PROJECT_DESCRIPTION}}
506
721
  - **Version**: {{PROJECT_VERSION}}
507
722
  - **Mode**: {{PROJECT_MODE}}
723
+ - **Conversation Language**: {{CONVERSATION_LANGUAGE}} ({{CONVERSATION_LANGUAGE_NAME}})
724
+ - **Codebase Language**: {{CODEBASE_LANGUAGE}}
508
725
  - **Toolchain**: Automatically selects the best tools for the chosen language
726
+
727
+ ### Language Configuration
728
+
729
+ - **Conversation Language** (`{{CONVERSATION_LANGUAGE}}`): All Alfred dialogs, documentation, and project interviews conducted in this language
730
+ - **Codebase Language** (`{{CODEBASE_LANGUAGE}}`): Primary programming language(s) detected in this project
731
+ - **Documentation**: Generated in the conversation language ({{CONVERSATION_LANGUAGE_NAME}})
732
+
733
+ ---
734
+
735
+ **Note**: The conversation language is selected at the beginning of `/alfred:0-project` and applies to all subsequent project initialization steps. All generated documentation (product.md, structure.md, tech.md) will be created in the selected language.