@leejungkiin/awkit 1.1.0 → 1.1.2

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.
Files changed (119) hide show
  1. package/README.md +3 -3
  2. package/VERSION +1 -1
  3. package/bin/awf.js +1 -1
  4. package/bin/awk.js +237 -26
  5. package/core/AGENTS.md +8 -9
  6. package/core/GEMINI.md +74 -199
  7. package/package.json +3 -2
  8. package/skill-packs/neural-memory/skills/nm-memory-sync/SKILL.md +2 -2
  9. package/skills/CATALOG.md +3 -2
  10. package/skills/README.md +109 -0
  11. package/skills/android-re-analyzer/SKILL.md +238 -0
  12. package/skills/android-re-analyzer/references/api-extraction-patterns.md +119 -0
  13. package/skills/android-re-analyzer/references/call-flow-analysis.md +176 -0
  14. package/skills/android-re-analyzer/references/fernflower-usage.md +115 -0
  15. package/skills/android-re-analyzer/references/jadx-usage.md +116 -0
  16. package/skills/android-re-analyzer/references/setup-guide.md +221 -0
  17. package/skills/android-re-analyzer/scripts/check-deps.sh +129 -0
  18. package/skills/android-re-analyzer/scripts/decompile.sh +375 -0
  19. package/skills/android-re-analyzer/scripts/find-api-calls.sh +118 -0
  20. package/skills/android-re-analyzer/scripts/install-dep.sh +448 -0
  21. package/skills/awf-session-restore/SKILL.md +108 -184
  22. package/skills/beads-manager/SKILL.md +2 -2
  23. package/skills/brainstorm-agent/SKILL.md +47 -2
  24. package/skills/gemini-conductor/SKILL.md +234 -0
  25. package/skills/memory-sync/SKILL.md +29 -1
  26. package/skills/nm-memory-sync/SKILL.md +2 -2
  27. package/skills/orchestrator/SKILL.md +29 -155
  28. package/skills/skills/nm-memory-sync/SKILL.md +2 -2
  29. package/skills/smali-to-kotlin/SKILL.md +1 -1
  30. package/skills/smali-to-swift/SKILL.md +1 -1
  31. package/skills/swiftui-pro/SKILL.md +108 -0
  32. package/skills/swiftui-pro/agents/openai.yaml +10 -0
  33. package/skills/swiftui-pro/assets/swiftui-pro-icon.png +0 -0
  34. package/skills/swiftui-pro/assets/swiftui-pro-icon.svg +29 -0
  35. package/skills/swiftui-pro/references/accessibility.md +13 -0
  36. package/skills/swiftui-pro/references/api.md +39 -0
  37. package/skills/swiftui-pro/references/data.md +43 -0
  38. package/skills/swiftui-pro/references/design.md +31 -0
  39. package/skills/swiftui-pro/references/hygiene.md +9 -0
  40. package/skills/swiftui-pro/references/navigation.md +14 -0
  41. package/skills/swiftui-pro/references/performance.md +46 -0
  42. package/skills/swiftui-pro/references/swift.md +56 -0
  43. package/skills/swiftui-pro/references/views.md +35 -0
  44. package/skills/symphony-enforcer/SKILL.md +362 -0
  45. package/skills/symphony-orchestrator/SKILL.md +301 -0
  46. package/skills/telegram-notify/SKILL.md +57 -0
  47. package/symphony/LICENSE +21 -0
  48. package/symphony/README.md +178 -0
  49. package/symphony/app/api/agents/route.js +152 -0
  50. package/symphony/app/api/events/route.js +22 -0
  51. package/symphony/app/api/knowledge/route.js +253 -0
  52. package/symphony/app/api/locks/route.js +29 -0
  53. package/symphony/app/api/notes/route.js +125 -0
  54. package/symphony/app/api/preflight/route.js +23 -0
  55. package/symphony/app/api/projects/route.js +116 -0
  56. package/symphony/app/api/roles/route.js +134 -0
  57. package/symphony/app/api/skills/route.js +82 -0
  58. package/symphony/app/api/status/route.js +18 -0
  59. package/symphony/app/api/tasks/route.js +157 -0
  60. package/symphony/app/api/workflows/route.js +61 -0
  61. package/symphony/app/api/workspaces/route.js +15 -0
  62. package/symphony/app/globals.css +2605 -0
  63. package/symphony/app/layout.js +20 -0
  64. package/symphony/app/page.js +2122 -0
  65. package/symphony/cli/index.js +1060 -0
  66. package/symphony/core/agent-manager.js +357 -0
  67. package/symphony/core/context-bus.js +100 -0
  68. package/symphony/core/db.js +223 -0
  69. package/symphony/core/file-lock-manager.js +154 -0
  70. package/symphony/core/merge-pipeline.js +234 -0
  71. package/symphony/core/orchestrator.js +236 -0
  72. package/symphony/core/task-manager.js +335 -0
  73. package/symphony/core/workspace-manager.js +168 -0
  74. package/symphony/jsconfig.json +7 -0
  75. package/symphony/lib/core.mjs +1034 -0
  76. package/symphony/mcp/index.js +29 -0
  77. package/symphony/mcp/server.js +110 -0
  78. package/symphony/mcp/tools/context.js +80 -0
  79. package/symphony/mcp/tools/locks.js +99 -0
  80. package/symphony/mcp/tools/status.js +82 -0
  81. package/symphony/mcp/tools/tasks.js +216 -0
  82. package/symphony/mcp/tools/workspace.js +143 -0
  83. package/symphony/next.config.mjs +7 -0
  84. package/symphony/package.json +53 -0
  85. package/symphony/scripts/postinstall.js +49 -0
  86. package/symphony/symphony.config.js +41 -0
  87. package/templates/conductor-tracks.md +38 -0
  88. package/templates/specs/PROJECT.md +50 -0
  89. package/templates/specs/ROADMAP.md +79 -0
  90. package/templates/specs/TECH-SPEC.md +81 -0
  91. package/templates/specs/task-spec-template.xml +65 -0
  92. package/templates/workflow_dual_mode_template.md +5 -5
  93. package/workflows/_uncategorized/AGENTS.md +38 -0
  94. package/workflows/_uncategorized/decompile.md +67 -0
  95. package/workflows/_uncategorized/skill-health.md +7 -7
  96. package/workflows/ads/ads-audit.md +5 -5
  97. package/workflows/ads/ads-optimize.md +10 -10
  98. package/workflows/ads/adsExpert.md +7 -7
  99. package/workflows/conductor.md +97 -0
  100. package/workflows/context/auto-implement.md +4 -4
  101. package/workflows/context/codebase-sync.md +19 -8
  102. package/workflows/context/next.md +27 -27
  103. package/workflows/context/user-intent-analysis-workflow.md +4 -4
  104. package/workflows/expert/codeExpert.md +28 -31
  105. package/workflows/expert/debugExpert.md +11 -11
  106. package/workflows/expert/planExpert.md +21 -36
  107. package/workflows/git/smart-git-ops.md +49 -6
  108. package/workflows/lifecycle/debug.md +7 -7
  109. package/workflows/lifecycle/deploy.md +10 -10
  110. package/workflows/lifecycle/init.md +103 -91
  111. package/workflows/lifecycle/master-code-workflow.md +3 -3
  112. package/workflows/lifecycle/plan.md +19 -21
  113. package/workflows/quality/audit.md +1 -1
  114. package/workflows/quality/project-audit.md +1 -1
  115. package/workflows/roles/vibe-coding-master-workflow.md +2 -2
  116. package/workflows/smart-git-ops.md +146 -0
  117. package/workflows/ui/app-screen-analyzer.md +4 -4
  118. package/workflows/ui/create-feature.md +8 -8
  119. package/workflows/ui/create-spec-architect.md +11 -11
@@ -58,15 +58,15 @@ description: 🐞 Sửa lỗi tự động (Expert Mode)
58
58
  - ✅ Linting issues
59
59
 
60
60
  **Need-Review:**
61
- - ⚠️ Logic errors → Create Beads task
62
- - ⚠️ Security issues → Create Beads task + Alert
63
- - ⚠️ Performance issues → Create Beads task
61
+ - ⚠️ Logic errors → Create Symphony task
62
+ - ⚠️ Security issues → Create Symphony task + Alert
63
+ - ⚠️ Performance issues → Create Symphony task
64
64
 
65
65
  ### 4. Verify Fix
66
66
 
67
67
  - Chạy lại test/linter
68
68
  - Nếu pass → Done
69
- - Nếu fail → Rollback + Create Beads task
69
+ - Nếu fail → Rollback + Create Symphony task
70
70
 
71
71
  ### 5. Report
72
72
 
@@ -81,7 +81,7 @@ Added null check before mapping products array
81
81
 
82
82
  ✅ **Verification:** Tests passed
83
83
 
84
- 📿 **Beads:** No new tasks (auto-fixed)
84
+ 🎵 **Symphony:** No new tasks (auto-fixed)
85
85
 
86
86
  ➡️ **Next:** /codeExpert (Continue coding)
87
87
  ```
@@ -105,15 +105,15 @@ AI sẽ tự động quyết định:
105
105
  ```
106
106
  ⚠️ Cannot auto-fix: Complex logic error
107
107
 
108
- 📿 Created task: #789 "Fix logic error in calculateTotal()"
108
+ 🎵 Created task: "Fix logic error in calculateTotal()"
109
109
 
110
110
  📋 **Analysis:**
111
111
  - Issue: Calculation returns negative value
112
112
  - Root cause: Missing validation for discount > price
113
113
  - Suggested fix: Add validation before calculation
114
114
 
115
- ➡️ **Next:**
116
- 1. Fix manually: Open task #789
115
+ ➡️ **Next:**
116
+ 1. Fix manually: Open task in Symphony
117
117
  2. Get help: /debug (Guided Mode)
118
118
  ```
119
119
 
@@ -122,15 +122,15 @@ AI sẽ tự động quyết định:
122
122
  ⚠️ Found 5 errors
123
123
 
124
124
  ✅ Auto-fixed: 3 errors
125
- 📿 Created tasks: 2 errors (#790, #791)
125
+ 🎵 Created Symphony tasks: 2 errors
126
126
 
127
- ➡️ **Next:** bd list --label bug
127
+ ➡️ **Next:** symphony_available_tasks(filter="ready")
128
128
  ```
129
129
 
130
130
  ---
131
131
 
132
132
  ## Integration
133
133
 
134
- - **Beads:** Auto-create tasks for complex bugs
134
+ - **Symphony:** Auto-create tasks for complex bugs
135
135
  - **Brain:** Save bug patterns to `brain/bugs/`
136
136
  - **Git:** Auto-commit fixes with message "fix: [description]"
@@ -42,34 +42,20 @@ description: 📝 Thiết kế tính năng (Expert Mode - Zero Questions)
42
42
  - Medium: 6 phases (+ Database + Integration)
43
43
  - Complex: 8+ phases (+ Auth + Deploy + Monitoring)
44
44
 
45
- ### 4. Sync to Beads (Hierarchical — v6.5)
46
- ```bash
47
- # Step 1: Create epic (1 per plan)
48
- EPIC_ID=$(bd create "<Feature Name>" -t epic -p 1 \
49
- --description "<feature summary>" \
50
- --acceptance "<high-level acceptance>" \
51
- --design "<architecture approach>" \
52
- --json | jq -r '.id')
53
-
54
- # Step 2: Create phase tasks as children of epic
45
+ ### 4. Sync to Symphony
46
+ ```
47
+ # Step 1: Create root task (1 per plan)
48
+ symphony_create_task(title="<Feature Name>", priority=1, description="<feature summary>")
49
+
50
+ # Step 2: Create phase tasks
55
51
  for each phase:
56
- PHASE_ID=$(bd create "Phase X: [Name]" \
57
- --parent $EPIC_ID -p 1 \
58
- --description "<phase summary>" \
59
- --json | jq -r '.id')
60
-
61
- # Step 3: Create subtasks as children of phase
62
- for each task in phase:
63
- bd create "[Task Name]" \
64
- --parent $PHASE_ID -p 2 \
65
- --acceptance "<definition of done>" \
66
- --json
67
-
68
- # Step 4: Set inter-phase dependencies
69
- bd dep add $PHASE2_ID $PHASE1_ID # Sequential phases
70
-
71
- # Step 5: Save to brain/active_plans.json
72
- # → { "current": { "epic_id": $EPIC_ID, "feature": "...", "phases": [...] } }
52
+ symphony_create_task(title="Phase X: [Name]", description="<phase summary>")
53
+
54
+ # Step 3: Create subtasks for each phase
55
+ for each task in phase:
56
+ symphony_create_task(title="[Task Name]", acceptance="<definition of done>")
57
+
58
+ # Step 4: Save to brain/active_plans.json
73
59
  ```
74
60
 
75
61
  ### 5. Report
@@ -80,15 +66,14 @@ bd dep add $PHASE2_ID $PHASE1_ID # Sequential phases
80
66
  📋 Spec: docs/specs/shopping-cart_spec.md
81
67
 
82
68
  📊 **Structure:**
83
- - 🏔️ 1 Epic
84
- - 📦 6 Phases (sequential dependencies)
69
+ - 🏔️ 1 Root Task
70
+ - 📦 6 Phases (sequential)
85
71
  - 📝 42 Subtasks (with acceptance criteria)
86
72
  - Estimated: 3-4 sessions
87
73
 
88
- 📿 **Beads (Hierarchical):**
89
- - Epic: bd-xxxx
90
- - Tree: bd list --parent bd-xxxx --tree
91
- - Ready: bd ready --parent bd-xxxx
74
+ 🎵 **Symphony:**
75
+ - Tasks: symphony_available_tasks()
76
+ - Status: symphony_status()
92
77
 
93
78
  ➡️ **Next:** /codeExpert (auto-picks first ready subtask)
94
79
  ```
@@ -129,7 +114,7 @@ Options:
129
114
 
130
115
  ## Integration
131
116
 
132
- - **Brain:** Auto-save epic mapping to `brain/active_plans.json` (with epic_id + phase IDs)
133
- - **Beads:** Auto-create epic → phase → subtask hierarchy with dependencies
134
- - **Skill:** Uses `plan_to_beads()` from `beads-manager` skill v6.5
117
+ - **Brain:** Auto-save task mapping to `brain/active_plans.json`
118
+ - **Symphony:** Auto-create task hierarchy via `symphony_create_task()`
119
+ - **Skill:** Uses `symphony-orchestrator` skill
135
120
  - **Git:** Auto-commit plan files (optional)
@@ -1,10 +1,10 @@
1
1
  ---
2
- description: 🤖 Tự động hóa git workflow hoàn chỉnh (audit → commit → push)
2
+ description: 🤖 Tự động hóa git workflow hoàn chỉnh (audit → commit → push → telegram report)
3
3
  ---
4
4
 
5
5
  # /smart-git-ops - Complete Git Automation
6
6
 
7
- **Tự động hóa toàn bộ:** Audit → Semantic Commit → Push
7
+ **Tự động hóa toàn bộ:** Audit → Semantic Commit → Push → Telegram Report
8
8
 
9
9
  ---
10
10
 
@@ -20,7 +20,7 @@ echo "🔍 Running pre-commit audit..."
20
20
 
21
21
  ---
22
22
 
23
- ## Phase 2: Status & Staging
23
+ ## Phase 2: Status & Smart Staging
24
24
 
25
25
  // turbo
26
26
  ```bash
@@ -78,6 +78,48 @@ git push origin HEAD
78
78
 
79
79
  ---
80
80
 
81
+ ## Phase 7: Telegram Report 📨
82
+
83
+ **Mục đích:** Sau khi push thành công, tự động tóm tắt các thay đổi và gửi báo cáo vào Telegram group.
84
+
85
+ **Logic:**
86
+ 1. Lấy thông tin commit vừa push:
87
+ ```bash
88
+ COMMIT_HASH=$(git log -1 --format='%h')
89
+ COMMIT_MSG=$(git log -1 --format='%s')
90
+ BRANCH=$(git branch --show-current)
91
+ AUTHOR=$(git log -1 --format='%an')
92
+ FILES_CHANGED=$(git diff --stat HEAD~1 HEAD | tail -1)
93
+ REPO_NAME=$(basename $(git rev-parse --show-toplevel))
94
+ ```
95
+
96
+ 2. Tạo message tóm tắt (Markdown):
97
+ ```
98
+ 🚀 *Git Push Report*
99
+
100
+ 📦 *Repo:* `{REPO_NAME}`
101
+ 🌿 *Branch:* `{BRANCH}`
102
+ 🔖 *Commit:* `{COMMIT_HASH}`
103
+ 👤 *Author:* {AUTHOR}
104
+
105
+ 📝 *Message:* {COMMIT_MSG}
106
+ 📊 *Changes:* {FILES_CHANGED}
107
+ 🕐 *Time:* {timestamp}
108
+ ```
109
+
110
+ 3. Gửi qua `awkit tg send`:
111
+ // turbo
112
+ ```bash
113
+ awkit tg send --parse-mode md "<generated-report>"
114
+ ```
115
+
116
+ **Fallback:** Nếu `awkit tg send` fail (chưa config), hiển thị hướng dẫn:
117
+ ```
118
+ ⚠️ Telegram chưa được cấu hình. Chạy: awkit tg setup
119
+ ```
120
+
121
+ ---
122
+
81
123
  ## 🎛️ Configuration
82
124
 
83
125
  User có thể config trong `.gemini/config.json`:
@@ -86,7 +128,8 @@ User có thể config trong `.gemini/config.json`:
86
128
  "smart_git_ops": {
87
129
  "auto_approve_timeout": 5,
88
130
  "run_audit": true,
89
- "run_tests_before_push": false
131
+ "run_tests_before_push": false,
132
+ "telegram_report": true
90
133
  }
91
134
  }
92
135
  ```
@@ -95,9 +138,9 @@ User có thể config trong `.gemini/config.json`:
95
138
 
96
139
  ## ⚠️ NEXT STEPS
97
140
 
98
- Sau khi push thành công:
141
+ Sau khi push & report thành công:
99
142
  ```
100
143
  1️⃣ Xem commit log (`git log --oneline -3`)
101
- 2️⃣ Đóng task Beads liên quan (`bd update <id> --status done`)
144
+ 2️⃣ Đóng task trong Symphony (`symphony_complete_task(task_id)`)
102
145
  3️⃣ Tiếp tục task tiếp theo (`/next`)
103
146
  ```
@@ -2,7 +2,7 @@
2
2
  description: 🐞 Sửa lỗi & Debug (Dual-Mode v5.0)
3
3
  ---
4
4
 
5
- # WORKFLOW: /debug - The Sherlock Holmes (Dual-Mode + Beads)
5
+ # WORKFLOW: /debug - The Sherlock Holmes (Dual-Mode + Symphony)
6
6
 
7
7
  > **Mode A (Expert):** `/debug --auto-fix` -> Tự động phân tích và sửa lỗi.
8
8
  > **Mode B (Guided):** `/debug` -> Hướng dẫn thu thập thông tin -> Phân tích -> Menu sửa.
@@ -27,8 +27,8 @@ description: 🐞 Sửa lỗi & Debug (Dual-Mode v5.0)
27
27
  3. **Auto-Fix (Safe Only):**
28
28
  - Lỗi *Safe-to-fix*: Missing import, typo, undefined check -> Sửa ngay.
29
29
  - Lỗi *Logic*: Báo cáo và đề xuất (không tự ý sửa).
30
- 4. **Beads Sync:**
31
- - Nếu lỗi Critical và không thể auto-fix -> `bd create "Fix Critical Bug in Cart.tsx" --label bug`.
30
+ 4. **Symphony Sync:**
31
+ - Nếu lỗi Critical và không thể auto-fix -> `symphony_create_task(title="Fix Critical Bug in Cart.tsx")`.
32
32
  5. **Report:** "✅ Fixed 1 issue. ⚠️ Created task #456 for manual review."
33
33
 
34
34
  ---
@@ -74,7 +74,7 @@ description: 🐞 Sửa lỗi & Debug (Dual-Mode v5.0)
74
74
  2. **Fix Options:**
75
75
  ```markdown
76
76
  1️⃣ 🔧 Em sửa ngay (Auto-fix)
77
- 2️⃣ 📿 Tạo task Beads để sửa sau
77
+ 2️⃣ 📿 Tạo task Symphony để sửa sau
78
78
  3️⃣ 📝 Hướng dẫn anh tự sửa
79
79
  4️⃣ 🔍 Điều tra sâu hơn
80
80
  ```
@@ -86,11 +86,11 @@ description: 🐞 Sửa lỗi & Debug (Dual-Mode v5.0)
86
86
 
87
87
  ---
88
88
 
89
- ## 🧠 Brain & Beads Logic
89
+ ## 🧠 Brain & Symphony Logic
90
90
 
91
91
  ### 1. Bug Tracking
92
92
  - Mọi lỗi được phát hiện -> Ghi vào `brain/bugs/[date]_[issue].md`.
93
- - Nếu lỗi Critical -> Auto-create Beads task với tag `bug` và `high-priority`.
93
+ - Nếu lỗi Critical -> Auto-create Symphony task với tag `bug` và `high-priority`.
94
94
 
95
95
  ### 2. Knowledge Base
96
96
  - Lỗi đã fix -> Lưu vào `brain/solutions/` để tham khảo sau.
@@ -104,7 +104,7 @@ description: 🐞 Sửa lỗi & Debug (Dual-Mode v5.0)
104
104
  ## 🛡️ Resilience Patterns
105
105
 
106
106
  - **False Fix Detection:** Sau khi sửa, tự động chạy test. Nếu fail -> Rollback ngay.
107
- - **Unknown Error:** Nếu không tìm ra nguyên nhân sau 3 lần -> Tạo task Beads "Investigate Unknown Error" và gợi ý user tìm expert.
107
+ - **Unknown Error:** Nếu không tìm ra nguyên nhân sau 3 lần -> Tạo task Symphony "Investigate Unknown Error" và gợi ý user tìm expert.
108
108
 
109
109
  ---
110
110
 
@@ -2,7 +2,7 @@
2
2
  description: 🚀 Deploy lên Production (Dual-Mode v5.0)
3
3
  ---
4
4
 
5
- # WORKFLOW: /deploy - The Release Manager (Dual-Mode + Beads)
5
+ # WORKFLOW: /deploy - The Release Manager (Dual-Mode + Symphony)
6
6
 
7
7
  > **Mode A (Expert):** `/deploy --prod --force` -> Bỏ qua checks, deploy ngay.
8
8
  > **Mode B (Guided):** `/deploy` -> Pre-flight Checks -> Config -> Deploy -> Verify.
@@ -23,9 +23,9 @@ description: 🚀 Deploy lên Production (Dual-Mode v5.0)
23
23
  2. **Execute:**
24
24
  - Chạy build script (`npm run build`).
25
25
  - Chạy deploy command (Vercel/Docker/AWS).
26
- 3. **Beads Sync:**
27
- - Tạo release tag trong Beads: `bd release create v1.0.0`.
28
- - Mark tất cả tasks `in_progress` -> `done` (Optional).
26
+ 3. **Symphony Sync:**
27
+ - Complete all in-progress tasks: `symphony_complete_task(task_id, summary)`.
28
+ - Report deployment progress.
29
29
  4. **Report:** "✅ Deployed to Production. URL: [Link]"
30
30
 
31
31
  ---
@@ -35,7 +35,7 @@ description: 🚀 Deploy lên Production (Dual-Mode v5.0)
35
35
  ### Phase 1: Pre-Audit & Health Check
36
36
  1. **Blocker Check:**
37
37
  - Check `session.json`: Có test nào đang `skipped` không?
38
- - Check `bd list`: Có task nào `critical` đang mở không?
38
+ - Check Symphony: Có task nào `critical` đang mở không?
39
39
  - *If Issue:* ❌ "Khoan! Còn 2 bugs nghiêm trọng chưa fix. Bạn chắc chắn muốn deploy?"
40
40
 
41
41
  2. **Environment Check:**
@@ -56,9 +56,9 @@ description: 🚀 Deploy lên Production (Dual-Mode v5.0)
56
56
  1. **Smoke Test:**
57
57
  - AI tự truy cập URL vừa deploy.
58
58
  - Check HTTP 200, check JS errors.
59
- 2. **Beads Release:**
59
+ 2. **Symphony Release:**
60
60
  - "Tạo Release Note từ các tasks đã làm?"
61
- - Action: `bd release create` kèm danh sách tasks.
61
+ - Action: Complete all related tasks in Symphony.
62
62
  3. **Action Menu:**
63
63
  ```markdown
64
64
  1️⃣ 📢 Thông báo team (Copy release note)
@@ -68,11 +68,11 @@ description: 🚀 Deploy lên Production (Dual-Mode v5.0)
68
68
 
69
69
  ---
70
70
 
71
- ## 🧠 Brain & Beads Logic
71
+ ## 🧠 Brain & Symphony Logic
72
72
 
73
73
  ### 1. Release Tracking
74
74
  - Mỗi lần deploy thành công -> Tạo bản ghi trong `brain/releases/`.
75
- - Nội dung: Version, Date, Commit Hash, Link tới Beads Release.
75
+ - Nội dung: Version, Date, Commit Hash.
76
76
 
77
77
  ### 2. Deployment Knowledge
78
78
  - Lưu các preferences của user (vd: "Luôn dung Vercel", "Luôn skip test ở Staging").
@@ -91,5 +91,5 @@ description: 🚀 Deploy lên Production (Dual-Mode v5.0)
91
91
  ```
92
92
  1️⃣ Monitor logs (`/logs`)
93
93
  2️⃣ Rollback nhanh (`/rollback`)
94
- 3️⃣ Đóng task trong Beads (`/done`)
94
+ 3️⃣ Đóng task trong Symphony (`/done`)
95
95
  ```
@@ -1,152 +1,164 @@
1
1
  ---
2
- description: ✨ Khởi tạo dự án chuẩn Antigravity (v4.1 - Master Orchestrator)
2
+ description: ✨ Khởi tạo dự án chuẩn Antigravity (v5.0 - Spec-First + CLI Hybrid)
3
3
  ---
4
4
 
5
- # WORKFLOW: /init - The Antigravity Orchestrator (v4.1)
5
+ # WORKFLOW: /init - The Antigravity Orchestrator (v5.0)
6
6
 
7
- > **Mission:** Không chỉ tạo file. `/init` thiết lập toàn bộ "Hệ điều hành phát triển" (OS for Development), tích hợp sẵn tư duy Spec-First, Clean Architecture và MCP Tools.
7
+ > **Mission:** Thiết lập "Hệ điều hành phát triển" (OS for Development) với Spec-First approach.
8
+ > **Key Change v5.0:** Tạo Project-Level Spec (PROJECT.md, REQUIREMENTS.md, ROADMAP.md, TECH-SPEC.md) ngay từ đầu.
9
+ > **Hybrid:** CLI scaffolds → AI fills content through brainstorm.
8
10
 
9
11
  ---
10
12
 
11
- ## 🚀 Giai đoạn 0: Environment & MCP Check (New in v4.1)
12
- Trước khi làm bất cứ điều gì, kiểm tra "vũ khí":
13
+ ## 🚀 Giai đoạn 0: Environment & MCP Check
13
14
 
14
15
  1. **MCP Status Check**:
15
- * `firebase-mcp-server`: [Check] -> Nếu thiếu, hỏi user có cần Backend/Auth không?
16
- * `maestro`: [Check] -> Nếu thiếu, warn "Sẽ không thể chạy test UI tự động".
17
- * `ios-simulator`: [Check] -> Nếu là dự án Mobile, yêu cầu bật Simulator.
18
- * `google-ads-mcp`: [Check] -> (Optional) Cho Marketing.
16
+ * `firebase-mcp-server`: [Check] Nếu thiếu, hỏi user có cần Backend/Auth không?
17
+ * `maestro`: [Check] Nếu thiếu, warn "Sẽ không thể chạy test UI tự động".
18
+ * `ios-simulator`: [Check] Nếu là dự án Mobile, yêu cầu bật Simulator.
19
19
 
20
- 2. **Dev Environment**:
21
- * Node/Ruby/Java/Swift versions.
22
- * Docker status (nếu là Backend).
20
+ 2. **Dev Environment**: Node/Ruby/Java/Swift versions.
23
21
 
24
22
  ---
25
23
 
26
24
  ## ⚡ Giai đoạn 1: Context Awareness & Smart Adoption
27
- *Thay vì hỏi máy móc, hãy quan sát:*
28
25
 
29
26
  **Kịch bản A: Thư mục trống (New Project)**
30
- * Chạy quy trình phỏng vấn **Vision Capture** (như bản cũ).
31
- * Hỏi thêm: "Anh muốn dùng template có sẵn không?" (Clean Arch, Boilerplate).
27
+ * Chạy quy trình phỏng vấn **Vision Capture**.
28
+ * Hỏi: "Anh muốn dùng template có sẵn không?" (Clean Arch, Boilerplate).
32
29
 
33
30
  **Kịch bản B: Thư mục có Code (Adoption Mode)**
34
31
  * AI quét cấu trúc hiện tại.
35
32
  * Tự động điền `.project-identity`.
36
- * Đề xuất: "Em thấy dự án này đang dùng [Stack]. Anh có muốn em setup lại folder `docs/` và `scripts/` để chuẩn hóa theo Antigravity Workflow không?"
33
+ * Đề xuất chuẩn hóa theo Antigravity Workflow.
37
34
 
38
35
  ---
39
36
 
40
- ## 🧠 Giai đoạn 2: The Antigravity Core Injection
41
- *Đây là "bí mật" tạo nên sự khác biệt. Setup nền tảng cho các workflow nâng cao.*
37
+ ## 🧠 Giai đoạn 2: Project Skeleton
42
38
 
43
- ### 2.1. Create Standard Ecosystem
44
- Tự động tạo các thư mục và file mẫu:
39
+ 1. **Generate `.project-identity`** (Bắt buộc):
40
+ * Copy template từ `~/.gemini/antigravity/templates/project-identity/[platform].json`.
41
+ * Customize: Thay thế `{{DATE}}`, `projectName` bằng thông tin thực tế.
45
42
 
46
- 1. **Antigravity Core**:
43
+ 2. **Create Standard Ecosystem**:
47
44
  ```bash
48
- mkdir -p docs/specs/_templates
45
+ mkdir -p docs/specs
49
46
  mkdir -p docs/architecture/decisions
50
- mkdir -p .gemini/scripts
47
+ mkdir -p .planning/research
51
48
  ```
52
49
 
53
- 2. **App Structure (Platform-Specific)**:
54
- * **Action:** Đọc template cấu trúc từ `~/.gemini/antigravity/templates/structures/[platform].txt`.
55
- * **Execute:** Tạo folder tree tương ứng.
56
- * *Ví dụ iOS:* `App/Features`, `App/Shared`, `Tests`, ...
50
+ 3. **App Structure (Platform-Specific)**:
51
+ * Đọc template từ `~/.gemini/antigravity/templates/structures/[platform].txt`.
52
+ * Tạo folder tree tương ứng.
57
53
 
58
- ### 2.2. Inject Templates (Spec & Architecture)
59
- Tạo file mẫu để workflow `/plan` (create-spec) hoạt động trơn tru:
54
+ 4. **Git Setup**: `.gitignore` thông minh theo stack.
60
55
 
61
- **`docs/specs/_templates/requirements_template.md`**:
62
- *(Mẫu chuẩn Requirements từng dùng ở `create-spec-architect`)*
56
+ ---
63
57
 
64
- **`docs/specs/_templates/architecture_template.md`**:
65
- *(Mẫu chuẩn Clean Architecture Decision)*
58
+ ## 📐 Giai đoạn 3: Project Spec Generation (NEW — Spec-First)
66
59
 
67
- ### 2.3. Inject Automation Scripts
68
- Tạo script để user lệnh tắt chạy workflow:
60
+ > **Đây bước mới quan trọng nhất.** AI brainstorm với user để tạo ra "hiến pháp" của dự án.
61
+ > Tất cả feature-level planning SAU NÀY phải tuân theo spec này.
69
62
 
70
- **`scripts/scaffold_feature.sh`**:
71
- *(Script gọi đến `structure-clean-architect` workflow)*
63
+ ### 3.1. Copy Templates
64
+ ```bash
65
+ # CLI tự động copy templates vào project
66
+ cp ~/.gemini/antigravity/templates/specs/PROJECT.md docs/specs/PROJECT.md
67
+ cp ~/.gemini/antigravity/templates/specs/requirements-template.md docs/specs/REQUIREMENTS.md
68
+ cp ~/.gemini/antigravity/templates/specs/ROADMAP.md docs/specs/ROADMAP.md
69
+ cp ~/.gemini/antigravity/templates/specs/TECH-SPEC.md docs/specs/TECH-SPEC.md
70
+ ```
72
71
 
73
- ---
72
+ ### 3.2. AI Fills Content (Brainstorm Session)
74
73
 
75
- ## 🏗️ Giai đoạn 3: Project Skeleton & Hidden Setup
76
- *(Kế thừa từ v4.0 nhưng mạnh mẽ hơn)*
77
-
78
- 1. **Generate `.project-identity`**: (Bắt buộc, là trái tim của mọi workflow).
79
- * **Action:** Copy template từ `~/.gemini/antigravity/templates/project-identity/`:
80
- * `ios.json` cho iOS.
81
- * `android.json` cho Android.
82
- * `expo.json` cho Cross-platform.
83
- * `web-nextjs.json` cho Web App.
84
- * `backend-nestjs.json` cho API.
85
- * **Customize:** Thay thế các placeholder (`{{DATE}}`, `projectName`) bằng thông tin thực tế.
86
- 2. **Git Setup**: `.gitignore` thông minh theo stack.
87
- 3. **Linter/Formatter**: Cài ESLint/SwiftLint/Detekt ngay lập tức.
88
- 4. **CI/CD Basics**: Tạo `.github/workflows/ci.yml` cơ bản (build test).
74
+ AI **chủ động** brainstorm với user để fill từng file:
89
75
 
90
- ---
76
+ 1. **PROJECT.md** — Hỏi về vision, goals, target audience, success metrics.
77
+ * "Dự án này giải quyết vấn đề gì?"
78
+ * "Ai là người dùng chính?"
79
+ * "Thành công sẽ trông như thế nào?"
91
80
 
92
- ## 🎨 Giai đoạn 4: Visual Vision (The WOW Factor)
93
- *Không để user chờ đợi với màn hình đen trắng.*
81
+ 2. **REQUIREMENTS.md** Hỏi về features, scope, priorities.
82
+ * "Features nào BẮT BUỘC trong v1?"
83
+ * "Có features nào nên để v2?"
84
+ * Dùng user story format: "As a [user], I want [action] so that [benefit]"
94
85
 
95
- 1. **Brainstorm UI Concept**:
96
- * Dựa trên ý tưởng user, AI tự nghĩ ra 1 `prompt` mô tả giao diện cực xịn (Dark/Light mode, Glassmorphism...).
97
- 2. **Generate Mockup**:
98
- * Gọi tool `generate_image` để tạo ngay 1 ảnh "Vision Art".
99
- * Hiển thị cho user: "App của anh trông sẽ ngầu như thế này này!"
86
+ 3. **ROADMAP.md** Tự động sinh từ requirements.
87
+ * Chia phases dựa trên priority + dependencies.
88
+ * Mỗi phase có Definition of Done rõ ràng.
89
+
90
+ 4. **TECH-SPEC.md** Hỏi về architecture constraints.
91
+ * "Có yêu cầu offline-first không?"
92
+ * "AI model nào sẽ dùng?"
93
+ * Ghi nhận Architecture Decisions (AD-1, AD-2...).
94
+
95
+ ### 3.3. Review & Confirm
96
+ * AI present tổng kết spec cho user review trước khi lưu.
97
+ * User approve → spec trở thành "source of truth".
100
98
 
101
99
  ---
102
100
 
103
- ## 🔗 Giai đoạn 5: Handover to Specialized Workflows
104
- *Sự kết nối chặt chẽ với các quy trình user yêu thích.*
101
+ ## 🎨 Giai đoạn 4: Visual Vision (Optional)
102
+
103
+ 1. **Brainstorm UI Concept** dựa trên spec vừa tạo.
104
+ 2. **Generate Mockup** via `generate_image` tool.
105
+ 3. Hiển thị cho user: "App trông sẽ như thế này!"
105
106
 
106
- Báo cáo hoàn tất và trỏ ngay sang các bước tiếp theo:
107
+ ---
107
108
 
108
- ### ⚠️ NEXT STEPS (Choose your path):
109
+ ## 🔗 Giai đoạn 5: Handover — Symphony + Next Steps
109
110
 
110
- **Path A: The Planner (Chậm mà chắc)**
111
- > "Tôi muốn lên kế hoạch chi tiết cho tính năng đầu tiên."
112
- 👉 Gõ: **/plan** (Sẽ chạy `create-spec-architect` dùng template vừa tạo).
111
+ 1. **Register project trong Symphony**:
112
+ ```bash
113
+ symphony project register --id <projectId> --name "<projectName>"
114
+ ```
113
115
 
114
- **Path B: The Builder (Mì ăn liền)**
115
- > "Tôi muốn thấy cấu trúc code ngay."
116
- 👉 Gõ: **/structure** (Sẽ chạy `structure-clean-architect` dựa trên `.project-identity`).
116
+ 2. **Tạo initial tasks từ ROADMAP.md Phase 1**:
117
+ * Mỗi feature trong Phase 1 1 Symphony task (status: ready).
117
118
 
118
- **Path C: The Artist (UI First)**
119
- > "Tôi muốn thiết kế giao diện trước."
120
- 👉 Gõ: **/visualize** (Sẽ chạy `design-to-ui` / `ui-first-methodology`).
119
+ 3. **Present next steps**:
120
+ ```
121
+ 🎉 SETUP COMPLETE!
122
+
123
+ 📐 Specs created:
124
+ + docs/specs/PROJECT.md
125
+ + docs/specs/REQUIREMENTS.md
126
+ + docs/specs/ROADMAP.md
127
+ + docs/specs/TECH-SPEC.md
128
+
129
+ 🎯 Symphony tasks created from Phase 1:
130
+ 📋 #sym-A1 — [Feature 1] (ready)
131
+ 📋 #sym-A2 — [Feature 2] (ready)
132
+
133
+ ➡️ Next: Pick a feature to start PLANNING mode.
134
+ AI will read your specs automatically.
135
+ ```
121
136
 
122
137
  ---
123
138
 
124
- ## 📝 Example Execution for User
139
+ ## 📝 Example Execution
125
140
 
126
141
  ```text
127
- Antigravity Initializer v4.1
142
+ Antigravity Initializer v5.0
128
143
  ----------------------------
129
144
  ✅ Checking Environment... OK
130
- ✅ Checking MCPs... Firebase (OFF), Maestro (ON)
145
+ ✅ Checking MCPs... Firebase (ON), Maestro (ON)
131
146
  📂 Project detected: Empty folder
132
147
 
133
148
  🤖 Let's build something great!
134
- ... [Vision Capture Questions] ...
135
-
136
- 🚀 Setting up Antigravity Core...
137
- + docs/specs/_templates
138
- + .project-identity
139
- + .gitignore
140
- + scripts/scaffold_feature.sh
149
+ ... [Vision Capture + Spec Brainstorm] ...
141
150
 
142
- 🎨 Generating Vision Concept... [Done]
143
- (Image: A sleek, dark-themed dashboard for [AppName])
151
+ 📐 Filling Project Specs...
152
+ docs/specs/PROJECT.md filled
153
+ ✅ docs/specs/REQUIREMENTS.md — filled (12 requirements)
154
+ ✅ docs/specs/ROADMAP.md — filled (3 phases)
155
+ ✅ docs/specs/TECH-SPEC.md — filled (5 architecture decisions)
144
156
 
145
- 🎉 SETUP COMPLETE!
146
- Your "Operating System" is ready.
157
+ 🎯 Symphony tasks created:
158
+ 📋 #sym-A1 User Authentication (P0, ready)
159
+ 📋 #sym-A2 — Onboarding Flow (P0, ready)
160
+ 📋 #sym-A3 — Dashboard UI (P1, ready)
147
161
 
148
- What's your first move?
149
- 1. /plan [FeatureName] (Recommended: Create Specs first)
150
- 2. /structure [FeatureName] (Scaffold Code)
151
- 3. /visualize (Design UI)
162
+ 🎉 SETUP COMPLETE! Your "Operating System" is ready.
163
+ ➡️ Pick a feature to start building.
152
164
  ```
@@ -23,7 +23,7 @@ description: Quy trình thiết kế tính năng toàn diện từ kiến trúc
23
23
  │ └── Domain → Data → Presentation layers │
24
24
  │ ↓ │
25
25
  │ Phase 3: FEATURE SPECS │
26
- │ └── requirements.md → design.md → bd tasks │
26
+ │ └── requirements.md → design.md → Symphony tasks │
27
27
  │ ↓ │
28
28
  │ Phase 4: UI/UX DESIGN │
29
29
  │ └── Design analysis + Platform guidelines │
@@ -206,9 +206,9 @@ Use `/auto-implement [feature-name]` for spec-driven auto-coding.
206
206
 
207
207
  ### 5.3. Progress Tracking
208
208
 
209
- Update `bd` status as you complete each task:
209
+ Update Symphony status as you complete each task:
210
210
  ```bash
211
- bd close [id]
211
+ symphony_complete_task(task_id)
212
212
  ```
213
213
 
214
214
  ---