@musashishao/agent-kit 1.8.0 โ 1.8.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.
- package/.agent/rules/GEMINI.md +6 -4
- package/.agent/scripts/ak_cli.py +1 -1
- package/.agent/scripts/localize_workflows.py +54 -0
- package/.agent/scripts/memory_manager.py +24 -1
- package/.agent/workflows/autofix.md +2 -1
- package/.agent/workflows/brainstorm.md +2 -1
- package/.agent/workflows/context.md +2 -1
- package/.agent/workflows/create.md +2 -1
- package/.agent/workflows/dashboard.md +2 -1
- package/.agent/workflows/debug.md +2 -1
- package/.agent/workflows/deploy.md +2 -1
- package/.agent/workflows/enhance.md +2 -1
- package/.agent/workflows/next.md +2 -1
- package/.agent/workflows/orchestrate.md +2 -1
- package/.agent/workflows/plan.md +2 -1
- package/.agent/workflows/preview.md +2 -1
- package/.agent/workflows/quality.md +2 -1
- package/.agent/workflows/spec.md +2 -1
- package/.agent/workflows/status.md +2 -1
- package/.agent/workflows/test.md +2 -1
- package/.agent/workflows/ui-ux-pro-max.md +2 -1
- package/README.md +50 -22
- package/bin/cli.js +68 -3
- package/package.json +1 -1
package/.agent/rules/GEMINI.md
CHANGED
|
@@ -80,10 +80,12 @@ Agent activated โ Check frontmatter "skills:" field
|
|
|
80
80
|
|
|
81
81
|
### ๐ Language Handling
|
|
82
82
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
83
|
+
**MANDATORY:** Check `.agent/memory/user.json` > `preferences.language`.
|
|
84
|
+
|
|
85
|
+
1. **If set to 'vi':** Respond in Vietnamese.
|
|
86
|
+
2. **If set to 'en':** Respond in English.
|
|
87
|
+
3. **If unset:** Match user's communication language.
|
|
88
|
+
4. **Code comments/variables** always remain in English.
|
|
87
89
|
|
|
88
90
|
### ๐งน Clean Code (Global Mandatory)
|
|
89
91
|
|
package/.agent/scripts/ak_cli.py
CHANGED
|
@@ -699,7 +699,7 @@ Examples:
|
|
|
699
699
|
|
|
700
700
|
# memory command
|
|
701
701
|
memory_parser = subparsers.add_parser("memory", help="Manage JSON memory")
|
|
702
|
-
memory_parser.add_argument("mem_command", choices=["init", "get", "set", "update-task", "set-level"])
|
|
702
|
+
memory_parser.add_argument("mem_command", choices=["init", "get", "set", "update-task", "set-level", "set-lang"])
|
|
703
703
|
memory_parser.add_argument("--type", choices=["brain", "session", "user"], default="session")
|
|
704
704
|
memory_parser.add_argument("--key", help="Key to get or set")
|
|
705
705
|
memory_parser.add_argument("--value", help="Value to set")
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import re
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
|
|
5
|
+
def localize_workflows(lang, project_root):
|
|
6
|
+
workflow_dir = Path(project_root) / ".agent" / "workflows"
|
|
7
|
+
if not workflow_dir.exists():
|
|
8
|
+
return
|
|
9
|
+
|
|
10
|
+
for wf_file in workflow_dir.glob("*.md"):
|
|
11
|
+
with open(wf_file, "r", encoding="utf-8") as f:
|
|
12
|
+
content = f.read()
|
|
13
|
+
|
|
14
|
+
# Extract frontmatter
|
|
15
|
+
match = re.match(r"^---\n(.*?)\n---", content, re.DOTALL)
|
|
16
|
+
if not match:
|
|
17
|
+
continue
|
|
18
|
+
|
|
19
|
+
frontmatter = match.group(1)
|
|
20
|
+
remaining = content[match.end():]
|
|
21
|
+
|
|
22
|
+
# Parse fields
|
|
23
|
+
fields = {}
|
|
24
|
+
for line in frontmatter.split("\n"):
|
|
25
|
+
if ":" in line:
|
|
26
|
+
key, val = line.split(":", 1)
|
|
27
|
+
fields[key.strip()] = val.strip()
|
|
28
|
+
|
|
29
|
+
# Backup current description to description_en if not exists
|
|
30
|
+
if "description" in fields and "description_en" not in fields:
|
|
31
|
+
fields["description_en"] = fields["description"]
|
|
32
|
+
|
|
33
|
+
# Update description based on lang
|
|
34
|
+
target_key = f"description_{lang}"
|
|
35
|
+
if target_key in fields:
|
|
36
|
+
fields["description"] = fields[target_key]
|
|
37
|
+
elif lang == "en" and "description_en" in fields:
|
|
38
|
+
fields["description"] = fields["description_en"]
|
|
39
|
+
|
|
40
|
+
# Reconstruct frontmatter
|
|
41
|
+
new_frontmatter = "---\n"
|
|
42
|
+
for k, v in fields.items():
|
|
43
|
+
new_frontmatter += f"{k}: {v}\n"
|
|
44
|
+
new_frontmatter += "---"
|
|
45
|
+
|
|
46
|
+
new_content = new_frontmatter + remaining
|
|
47
|
+
|
|
48
|
+
with open(wf_file, "w", encoding="utf-8") as f:
|
|
49
|
+
f.write(new_content)
|
|
50
|
+
|
|
51
|
+
if __name__ == "__main__":
|
|
52
|
+
import sys
|
|
53
|
+
if len(sys.argv) > 2:
|
|
54
|
+
localize_workflows(sys.argv[1], sys.argv[2])
|
|
@@ -83,7 +83,7 @@ class MemoryManager:
|
|
|
83
83
|
if __name__ == "__main__":
|
|
84
84
|
import argparse
|
|
85
85
|
parser = argparse.ArgumentParser(description="Manage Agent Kit JSON Memory")
|
|
86
|
-
parser.add_argument("command", choices=["init", "get", "set", "update-task", "set-level"])
|
|
86
|
+
parser.add_argument("command", choices=["init", "get", "set", "update-task", "set-level", "set-lang"])
|
|
87
87
|
parser.add_argument("--type", choices=["brain", "session", "user"], default="session")
|
|
88
88
|
parser.add_argument("--key", help="Key to get or set")
|
|
89
89
|
parser.add_argument("--value", help="Value to set")
|
|
@@ -113,3 +113,26 @@ if __name__ == "__main__":
|
|
|
113
113
|
user["skill_level"] = args.level
|
|
114
114
|
manager.save("user", user)
|
|
115
115
|
print(f"โ
User skill level set to: {args.level}")
|
|
116
|
+
elif args.command == "set-lang":
|
|
117
|
+
if args.value:
|
|
118
|
+
user = manager.load("user")
|
|
119
|
+
if "preferences" not in user:
|
|
120
|
+
user["preferences"] = {}
|
|
121
|
+
user["preferences"]["language"] = args.value
|
|
122
|
+
manager.save("user", user)
|
|
123
|
+
print(f"โ
Language set to: {args.value}")
|
|
124
|
+
|
|
125
|
+
# Localize workflow descriptions in files
|
|
126
|
+
try:
|
|
127
|
+
from localize_workflows import localize_workflows
|
|
128
|
+
localize_workflows(args.value, manager.project_root)
|
|
129
|
+
print(f"โ
Workflow descriptions updated to: {args.value}")
|
|
130
|
+
except ImportError:
|
|
131
|
+
# Add current directory to path if needed
|
|
132
|
+
import sys
|
|
133
|
+
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
|
134
|
+
from localize_workflows import localize_workflows
|
|
135
|
+
localize_workflows(args.value, manager.project_root)
|
|
136
|
+
print(f"โ
Workflow descriptions updated to: {args.value}")
|
|
137
|
+
except Exception as e:
|
|
138
|
+
print(f"โ ๏ธ Failed to localize workflows: {str(e)}")
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: Autonomous self-healing loop for failed commands.
|
|
3
|
+
description_vi: Vรฒng lแบทp tแปฑ phแปฅc hแปi tแปฑ ฤแปng cho cรกc lแปnh bแป lแปi.
|
|
3
4
|
---
|
|
4
5
|
|
|
5
6
|
# /autofix - Autonomous Self-Healing Loop
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: Structured brainstorming for projects and features. Explore multiple options before implementation.
|
|
3
|
+
description_vi: Brainstorming cรณ cแบฅu trรบc cho dแปฑ รกn vร tรญnh nฤng. Khรกm phรก nhiแปu phฦฐฦกng รกn trฦฐแปc khi triแปn khai.
|
|
3
4
|
---
|
|
4
5
|
|
|
5
6
|
# /brainstorm - Structured Idea Exploration
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: Automatically generate optimal context for complex tasks using Context Engineering strategies.
|
|
3
|
+
description_vi: Tแปฑ ฤแปng tแบกo ngแปฏ cแบฃnh tแปi ฦฐu cho cรกc tรกc vแปฅ phแปฉc tแบกp bแบฑng chiแบฟn lฦฐแปฃc Context Engineering.
|
|
3
4
|
---
|
|
4
5
|
|
|
5
6
|
# Context Optimization Workflow
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: Command to create a new application. Activates the App Builder skill and initiates user dialogue.
|
|
3
|
+
description_vi: Tแบกo แปฉng dแปฅng mแปi vแปi kiแบฟn trรบc AI-Ready. Kรญch hoแบกt kแปน nฤng App Builder vร bแบฏt ฤแบงu ฤแปi thoแบกi vแปi ngฦฐแปi dรนng.
|
|
3
4
|
---
|
|
4
5
|
|
|
5
6
|
# /create - Create Application
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: Debug command. Activates DEBUG mode to systematically investigate issues.
|
|
3
|
+
description_vi: Lแปnh gแปก lแปi. Kรญch hoแบกt chแบฟ ฤแป DEBUG ฤแป ฤiแปu tra cรกc vแบฅn ฤแป mแปt cรกch hแป thแปng.
|
|
3
4
|
---
|
|
4
5
|
|
|
5
6
|
# /debug - Systematic Problem Investigation
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: Production deployment command. Performs pre-flight checks and executes deployment.
|
|
3
|
+
description_vi: Lแปnh triแปn khai sแบฃn phแบฉm. Thแปฑc hiแปn kiแปm tra trฦฐแปc khi bay vร thแปฑc thi triแปn khai.
|
|
3
4
|
---
|
|
4
5
|
|
|
5
6
|
# /deploy - Production Deployment
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: Add or update features in an existing application. Used for iterative development.
|
|
3
|
+
description_vi: Thรชm hoแบทc cแบญp nhแบญt tรญnh nฤng trong แปฉng dแปฅng hiแปn cรณ. ฤฦฐแปฃc sแปญ dแปฅng cho phรกt triแปn lแบทp.
|
|
3
4
|
---
|
|
4
5
|
|
|
5
6
|
# /enhance - Update Application
|
package/.agent/workflows/next.md
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: Coordinate multiple agents for complex tasks. Used for multi-perspective analysis, comprehensive reviews, or tasks requiring different expertise.
|
|
3
|
+
description_vi: ฤiแปu phแปi nhiแปu Agent cho cรกc tรกc vแปฅ phแปฉc tแบกp. ฤฦฐแปฃc sแปญ dแปฅng ฤแป phรขn tรญch ฤa chiแปu, ฤรกnh giรก toร n diแปn hoแบทc cรกc tรกc vแปฅ yรชu cแบงu chuyรชn mรดn khรกc nhau.
|
|
3
4
|
---
|
|
4
5
|
|
|
5
6
|
# Multi-Agent Orchestration
|
package/.agent/workflows/plan.md
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: Create a project plan using the project-planner agent. Only creates plan files - does not write code.
|
|
3
|
+
description_vi: Tแบกo kแบฟ hoแบกch dแปฑ รกn bแบฑng Agent project-planner. Chแป tแบกo file kแบฟ hoแบกch - khรดng viแบฟt code.
|
|
3
4
|
---
|
|
4
5
|
|
|
5
6
|
# /plan - Project Planning Mode
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: Manage preview server - start, stop, and status check. Manages local development server.
|
|
3
|
+
description_vi: Quแบฃn lรฝ mรกy chแปง xem trฦฐแปc - bแบฏt ฤแบงu, dแปซng vร kiแปm tra trแบกng thรกi. Quแบฃn lรฝ mรกy chแปง phรกt triแปn cแปฅc bแป.
|
|
3
4
|
---
|
|
4
5
|
|
|
5
6
|
# /preview - Preview Management
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: Optimize context and output quality for Codex CLI. Used for complex tasks requiring high-quality results.
|
|
3
|
+
description_vi: Tแปi ฦฐu hรณa ngแปฏ cแบฃnh vร chแบฅt lฦฐแปฃng ฤแบงu ra cho Codex CLI. ฤฦฐแปฃc sแปญ dแปฅng cho cรกc tรกc vแปฅ phแปฉc tแบกp ฤรฒi hแปi kแบฟt quแบฃ chแบฅt lฦฐแปฃng cao.
|
|
3
4
|
---
|
|
4
5
|
|
|
5
6
|
# /quality - Quality Optimization Workflow
|
package/.agent/workflows/spec.md
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: Create specification documents before planning. Used for complex features requiring clear requirements before implementation.
|
|
3
|
+
description_vi: Tแบกo tร i liแปu ฤแบทc tแบฃ trฦฐแปc khi lแบญp kแบฟ hoแบกch. ฤฦฐแปฃc sแปญ dแปฅng cho cรกc tรญnh nฤng phแปฉc tแบกp yรชu cแบงu yรชu cแบงu rรต rร ng trฦฐแปc khi triแปn khai.
|
|
3
4
|
---
|
|
4
5
|
|
|
5
6
|
# /spec - Specification Writing Mode
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: Display project and agent status. Track progress and status boards.
|
|
3
|
+
description_vi: Hiแปn thแป trแบกng thรกi dแปฑ รกn vร Agent. Theo dรตi tiแบฟn ฤแป vร bแบฃng trแบกng thรกi.
|
|
3
4
|
---
|
|
4
5
|
|
|
5
6
|
# /status - Show Status
|
package/.agent/workflows/test.md
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: Create and run tests. Create and execute tests for the code.
|
|
3
|
+
description_vi: Tแบกo vร chแบกy cรกc bร i kiแปm tra. Tแบกo vร thแปฑc thi kiแปm tra cho mรฃ nguแปn.
|
|
3
4
|
---
|
|
4
5
|
|
|
5
6
|
# /test - Test Generation and Execution
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> ๐ The Ultimate AI Agent System for Modern Development
|
|
4
4
|
>
|
|
5
|
-
> **16 Agents** โข **58 Skills** โข **
|
|
5
|
+
> **16 Agents** โข **58 Skills** โข **17 Workflows** โข **Multi-Platform Support**
|
|
6
6
|
|
|
7
7
|
[](https://www.npmjs.com/package/@musashishao/agent-kit)
|
|
8
8
|
[](https://opensource.org/licenses/MIT)
|
|
@@ -29,7 +29,7 @@ This installs the `.agent` folder containing all templates into your project.
|
|
|
29
29
|
| **Agents** | 16 | Specialist AI personas (frontend, backend, security, etc.) |
|
|
30
30
|
| **Skills** | 58 | Domain-specific knowledge modules |
|
|
31
31
|
| **Intelligence** | 4 | RAG, Knowledge Graph, Memory, and **Verification Gate** |
|
|
32
|
-
| **Workflows** |
|
|
32
|
+
| **Workflows** | 17 | Slash command procedures |
|
|
33
33
|
| **Templates** | 4 | Project templates (web, mobile, backend) |
|
|
34
34
|
|
|
35
35
|
## ๐ Multi-Platform Support
|
|
@@ -109,6 +109,7 @@ After running `setup-codex`, use Agent Kit workflows as slash commands:
|
|
|
109
109
|
| `status` | Check installation status |
|
|
110
110
|
| `sync` | Advanced Sync (Graph + RAG + Memory) |
|
|
111
111
|
| `memory` | Manage JSON Memory & Session state |
|
|
112
|
+
| `set-lang` | Set Agent & Workflow language (vi/en) |
|
|
112
113
|
|
|
113
114
|
### Options
|
|
114
115
|
|
|
@@ -129,10 +130,32 @@ agent-kit setup-codex --prefix my- # Custom prefix for slash commands
|
|
|
129
130
|
# Memory management
|
|
130
131
|
agent-kit memory get --type session # View current session state
|
|
131
132
|
agent-kit memory update-task --task "X" --status "completed"
|
|
133
|
+
|
|
134
|
+
# Language management
|
|
135
|
+
agent-kit set-lang vi # Switch to Vietnamese
|
|
136
|
+
agent-kit set-lang en # Switch to English (default)
|
|
132
137
|
```
|
|
133
138
|
|
|
134
139
|
---
|
|
135
140
|
|
|
141
|
+
## ๐ Localization & Multi-language
|
|
142
|
+
|
|
143
|
+
Agent Kit now supports full localization for the AI experience.
|
|
144
|
+
|
|
145
|
+
### Supported Languages
|
|
146
|
+
- ๐บ๐ธ **English (en)** - Default
|
|
147
|
+
- ๐ป๐ณ **Vietnamese (vi)** - Professional translation
|
|
148
|
+
|
|
149
|
+
### How it works
|
|
150
|
+
Running `ak set-lang vi` performs three actions:
|
|
151
|
+
1. **AI Instruction Update**: Updates `GEMINI.md` logic to ensure the AI responds in your chosen language.
|
|
152
|
+
2. **Workflow Swapping**: Physically updates the `description` field in all `.agent/workflows/*.md` files so that CLI tools (Codex, Antigravity) display localized help text.
|
|
153
|
+
3. **Internal Config**: Saves preference to `.agent/memory/user.json`.
|
|
154
|
+
|
|
155
|
+
> **Note:** If `ak` command is outdated, use `npx @musashishao/agent-kit@latest set-lang vi`
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
136
159
|
## ๐ MCP Integration
|
|
137
160
|
|
|
138
161
|
Agent Kit includes built-in MCP (Model Context Protocol) servers to extend your AI assistant's capabilities.
|
|
@@ -194,8 +217,8 @@ mcp featured # Show featured servers
|
|
|
194
217
|
.agent/
|
|
195
218
|
โโโ agents/ # 16 Specialist Agents
|
|
196
219
|
โโโ skills/ # 42 Skills
|
|
197
|
-
โโโ memory/ # ๐ง AI Session & State
|
|
198
|
-
โโโ workflows/ #
|
|
220
|
+
โโโ memory/ # ๐ง AI Session & State
|
|
221
|
+
โโโ workflows/ # 17 Slash Commands
|
|
199
222
|
โโโ rules/ # Platform-specific rules
|
|
200
223
|
โ โโโ CODEX.md # Codex CLI rules
|
|
201
224
|
โ โโโ GEMINI.md # Gemini CLI rules
|
|
@@ -223,30 +246,35 @@ Skills are loaded automatically based on task context. The AI reads skill descri
|
|
|
223
246
|
|
|
224
247
|
### Using Workflows
|
|
225
248
|
|
|
226
|
-
Invoke workflows with slash commands:
|
|
249
|
+
Invoke localized workflows with slash commands:
|
|
227
250
|
|
|
228
251
|
| Command | Description |
|
|
229
252
|
|---------|-------------|
|
|
230
|
-
| `/
|
|
231
|
-
| `/
|
|
232
|
-
| `/
|
|
233
|
-
| `/
|
|
234
|
-
| `/
|
|
235
|
-
| `/
|
|
236
|
-
| `/
|
|
237
|
-
| `/
|
|
238
|
-
| `/
|
|
239
|
-
| `/
|
|
240
|
-
| `/
|
|
241
|
-
| `/
|
|
242
|
-
| `/
|
|
253
|
+
| `/autofix` | Autonomous self-healing loop for failed commands |
|
|
254
|
+
| `/brainstorm` | Structured brainstorming for projects and features |
|
|
255
|
+
| `/context` | Auto-generate optimal context for complex tasks |
|
|
256
|
+
| `/create` | Create new applications with AI-Ready infra |
|
|
257
|
+
| `/dashboard` | Create and view visual project dashboards |
|
|
258
|
+
| `/debug` | Systematic problem investigation and root cause analysis |
|
|
259
|
+
| `/deploy` | Production deployment with pre-flight checks |
|
|
260
|
+
| `/enhance` | Add or update features in an existing app |
|
|
261
|
+
| `/next` | Suggest the next logical steps for development |
|
|
262
|
+
| `/orchestrate` | Coordinate 3+ specialized agents for complex tasks |
|
|
263
|
+
| `/plan` | Create detailed project plans and task breakdowns |
|
|
264
|
+
| `/preview` | Manage local development and preview servers |
|
|
265
|
+
| `/quality` | Optimize context and output for high-quality results |
|
|
266
|
+
| `/spec` | Create specification documents before planning |
|
|
267
|
+
| `/status` | Display project and agent health status |
|
|
268
|
+
| `/test` | Generate and execute comprehensive test suites |
|
|
269
|
+
| `/ui-ux-pro-max` | Professional UI/UX planning with 50+ styles |
|
|
270
|
+
|
|
271
|
+
> ๐ก **Tip:** Use `ak set-lang vi` to see these descriptions in Vietnamese!
|
|
243
272
|
|
|
244
273
|
Example:
|
|
245
274
|
```
|
|
246
|
-
/
|
|
247
|
-
/
|
|
248
|
-
/
|
|
249
|
-
/quality create production-ready API
|
|
275
|
+
/kit-create landing page with hero section
|
|
276
|
+
/kit-debug why login fails
|
|
277
|
+
/kit-ui-ux-pro-max dashboard with glassmorphism
|
|
250
278
|
```
|
|
251
279
|
|
|
252
280
|
---
|
package/bin/cli.js
CHANGED
|
@@ -47,6 +47,7 @@ ${colors.bright}Commands:${colors.reset}
|
|
|
47
47
|
${colors.cyan}doctor${colors.reset} Check configuration and diagnose issues
|
|
48
48
|
${colors.cyan}update${colors.reset} Update .agent folder to latest version
|
|
49
49
|
${colors.cyan}status${colors.reset} Check installation status
|
|
50
|
+
${colors.cyan}set-lang${colors.reset} Set Agent language (vi/en)
|
|
50
51
|
|
|
51
52
|
${colors.bright}AI Subcommands:${colors.reset}
|
|
52
53
|
${colors.cyan}ai init${colors.reset} Initialize AI infrastructure (AGENTS.md, Graph, RAG)
|
|
@@ -80,6 +81,7 @@ ${colors.bright}Examples:${colors.reset}
|
|
|
80
81
|
npx ${PACKAGE_NAME} mcp setup --client claude
|
|
81
82
|
npx ${PACKAGE_NAME} codex --template web
|
|
82
83
|
npx ${PACKAGE_NAME} doctor
|
|
84
|
+
npx ${PACKAGE_NAME} set-lang vi # Switch to Vietnamese
|
|
83
85
|
|
|
84
86
|
${colors.yellow}# To ensure you have the latest version from NPM:${colors.reset}
|
|
85
87
|
npx ${PACKAGE_NAME}@latest update
|
|
@@ -424,7 +426,17 @@ function skillsCommand() {
|
|
|
424
426
|
}
|
|
425
427
|
|
|
426
428
|
function workflowsCommand() {
|
|
427
|
-
const
|
|
429
|
+
const agentDir = path.join(process.cwd(), '.agent');
|
|
430
|
+
const workflowsDir = path.join(agentDir, 'workflows');
|
|
431
|
+
const userJson = path.join(agentDir, 'memory', 'user.json');
|
|
432
|
+
|
|
433
|
+
let language = 'en';
|
|
434
|
+
if (fs.existsSync(userJson)) {
|
|
435
|
+
try {
|
|
436
|
+
const userData = JSON.parse(fs.readFileSync(userJson, 'utf-8'));
|
|
437
|
+
language = (userData.preferences && userData.preferences.language) || 'en';
|
|
438
|
+
} catch (e) {}
|
|
439
|
+
}
|
|
428
440
|
|
|
429
441
|
log.title('โก Available Workflows (Slash Commands)');
|
|
430
442
|
|
|
@@ -441,8 +453,19 @@ function workflowsCommand() {
|
|
|
441
453
|
const name = wf.replace('.md', '');
|
|
442
454
|
const content = fs.readFileSync(path.join(workflowsDir, wf), 'utf-8');
|
|
443
455
|
|
|
444
|
-
|
|
445
|
-
|
|
456
|
+
let desc = 'No description';
|
|
457
|
+
if (language === 'vi') {
|
|
458
|
+
const viMatch = content.match(/description_vi:\s*(.+)/);
|
|
459
|
+
if (viMatch) {
|
|
460
|
+
desc = viMatch[1];
|
|
461
|
+
} else {
|
|
462
|
+
const enMatch = content.match(/description:\s*(.+)/);
|
|
463
|
+
desc = enMatch ? enMatch[1] : 'No description';
|
|
464
|
+
}
|
|
465
|
+
} else {
|
|
466
|
+
const enMatch = content.match(/description:\s*(.+)/);
|
|
467
|
+
desc = enMatch ? enMatch[1] : 'No description';
|
|
468
|
+
}
|
|
446
469
|
|
|
447
470
|
console.log(` ${colors.green}/${name}${colors.reset}`);
|
|
448
471
|
console.log(` ${desc}\n`);
|
|
@@ -530,6 +553,45 @@ function doctorCommand() {
|
|
|
530
553
|
}
|
|
531
554
|
}
|
|
532
555
|
|
|
556
|
+
// ============================================================================
|
|
557
|
+
// Language Command
|
|
558
|
+
// ============================================================================
|
|
559
|
+
|
|
560
|
+
function setLangCommand(lang) {
|
|
561
|
+
const agentDir = path.join(process.cwd(), '.agent');
|
|
562
|
+
const cliScript = path.join(agentDir, 'scripts', 'ak_cli.py');
|
|
563
|
+
|
|
564
|
+
if (!lang) {
|
|
565
|
+
log.error('Language code required.');
|
|
566
|
+
console.log(`Usage: npx ${PACKAGE_NAME} set-lang <code (vi/en)>`);
|
|
567
|
+
return;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
if (!fs.existsSync(cliScript)) {
|
|
571
|
+
log.error('AI CLI script not found. Make sure Agent Kit is initialized.');
|
|
572
|
+
log.info('Run: npx @musashishao/agent-kit init');
|
|
573
|
+
process.exit(1);
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
log.title(`๐ Setting Language to: ${lang}`);
|
|
577
|
+
|
|
578
|
+
try {
|
|
579
|
+
const { spawnSync } = require('child_process');
|
|
580
|
+
const result = spawnSync('python3', [cliScript, '--project-root', process.cwd(), 'memory', 'set-lang', '--value', lang], {
|
|
581
|
+
cwd: process.cwd(),
|
|
582
|
+
stdio: 'inherit',
|
|
583
|
+
});
|
|
584
|
+
|
|
585
|
+
if (result.status !== 0) {
|
|
586
|
+
log.error('Failed to set language.');
|
|
587
|
+
process.exit(result.status || 1);
|
|
588
|
+
}
|
|
589
|
+
} catch (error) {
|
|
590
|
+
log.error(`Failed to set language: ${error.message}`);
|
|
591
|
+
process.exit(1);
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
|
|
533
595
|
// ============================================================================
|
|
534
596
|
// AI Infrastructure Command
|
|
535
597
|
// ============================================================================
|
|
@@ -1353,6 +1415,9 @@ switch (command) {
|
|
|
1353
1415
|
case 'ai':
|
|
1354
1416
|
aiCommand(args.slice(1), options);
|
|
1355
1417
|
break;
|
|
1418
|
+
case 'set-lang':
|
|
1419
|
+
setLangCommand(args[1]);
|
|
1420
|
+
break;
|
|
1356
1421
|
case '--version':
|
|
1357
1422
|
case '-v':
|
|
1358
1423
|
showVersion();
|