aiwf 0.3.0 → 0.3.1
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/CHANGELOG.md +38 -36
- package/CLAUDE.md +8 -209
- package/README.md +25 -5
- package/claude-code/aiwf/en/.claude/commands/aiwf/aiwf_docs.md +225 -0
- package/claude-code/aiwf/en/.claude/commands/aiwf/aiwf_language_manager.md +287 -0
- package/claude-code/aiwf/en/.claude/commands/aiwf/aiwf_language_status.md +246 -0
- package/claude-code/aiwf/en/.claude/commands/aiwf/aiwf_switch_language.md +160 -0
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_code_review.md +62 -62
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_commit.md +111 -111
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_create_general_task.md +106 -106
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_create_milestone_plan.md +127 -127
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_create_sprint_tasks.md +130 -130
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_create_sprints_from_milestone.md +87 -87
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_do_task.md +72 -72
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_docs.md +225 -0
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_initialize.md +86 -86
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_issue_create.md +3 -3
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_language_manager.md +287 -0
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_language_status.md +246 -0
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_pr_create.md +14 -14
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_prime.md +5 -5
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_project_review.md +39 -39
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_switch_language.md +160 -0
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_test.md +76 -77
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_testing_review.md +120 -120
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_ultrathink_general.md +209 -266
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_yolo.md +226 -226
- package/docs/AI-WORKFLOW.ko.md +9 -2
- package/docs/AI-WORKFLOW.md +9 -2
- package/docs/COMMANDS_GUIDE.ko.md +93 -3
- package/docs/COMMANDS_GUIDE.md +94 -4
- package/docs/Enhanced_Installation_Flow_Design.md +498 -0
- package/docs/PRD.ko.md +110 -58
- package/docs/PRD.md +110 -58
- package/index.js +1240 -20
- package/jest.config.js +4 -0
- package/language-cli.js +279 -0
- package/language-utils.js +330 -0
- package/package.json +12 -4
- package/scripts/validate-commands.cjs +338 -0
- package/scripts/validate-commands.js +254 -0
- package/tests/basic.test.js +62 -0
- package/tests/commands.test.js +127 -0
- package/tests/installer.test.js +129 -0
- package/tests/language-utils.test.js +271 -0
- package/claude-code/aiwf/en/.claude/commands/aiwf/aiwf_prime_context.md +0 -5
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_prime_context.md +0 -8
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
# AIWF Language Manager
|
|
2
|
+
|
|
3
|
+
A command that provides integrated management of language-related functions in the AIWF framework.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
/project:aiwf:language_manager [action] [arguments]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### Action Types
|
|
12
|
+
|
|
13
|
+
- `status` - Check current language status
|
|
14
|
+
- `switch <language_code>` - Switch language
|
|
15
|
+
- `detect` - Auto-detect system language
|
|
16
|
+
- `reset` - Reset language settings
|
|
17
|
+
- `test` - Test language system
|
|
18
|
+
- `config` - Manage configuration file
|
|
19
|
+
|
|
20
|
+
## Execution Steps
|
|
21
|
+
|
|
22
|
+
### 1. Argument Analysis and Action Routing
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
# Parse arguments
|
|
26
|
+
ACTION="${1:-status}"
|
|
27
|
+
ARGUMENT="${2:-}"
|
|
28
|
+
|
|
29
|
+
echo "=== AIWF Language Manager ==="
|
|
30
|
+
echo "Action: $ACTION"
|
|
31
|
+
echo "Argument: $ARGUMENT"
|
|
32
|
+
echo ""
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### 2. Action-Specific Execution
|
|
36
|
+
|
|
37
|
+
#### 2.1 Status Check (status)
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
if [ "$ACTION" = "status" ]; then
|
|
41
|
+
echo "📊 Checking language status..."
|
|
42
|
+
node -e "
|
|
43
|
+
import('./language-utils.js').then(async ({ getLanguageStatus }) => {
|
|
44
|
+
const status = await getLanguageStatus();
|
|
45
|
+
|
|
46
|
+
console.log('=== Language Settings Status ===');
|
|
47
|
+
console.log('Detected language:', status.detectedLanguage);
|
|
48
|
+
console.log('Configured language:', status.configuredLanguage || 'None');
|
|
49
|
+
console.log('Effective language:', status.effectiveLanguage);
|
|
50
|
+
console.log('Auto detection:', status.autoDetect ? 'Enabled' : 'Disabled');
|
|
51
|
+
console.log('Fallback language:', status.fallbackLanguage);
|
|
52
|
+
console.log('Supported languages:', status.supportedLanguages.join(', '));
|
|
53
|
+
|
|
54
|
+
if (status.error) {
|
|
55
|
+
console.log('⚠️ Error:', status.error);
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
"
|
|
59
|
+
fi
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
#### 2.2 Language Switch (switch)
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
if [ "$ACTION" = "switch" ]; then
|
|
66
|
+
if [ -z "$ARGUMENT" ]; then
|
|
67
|
+
echo "❌ Error: Please specify a language code"
|
|
68
|
+
echo "Usage: /project:aiwf:language_manager switch [ko|en]"
|
|
69
|
+
exit 1
|
|
70
|
+
fi
|
|
71
|
+
|
|
72
|
+
echo "🔄 Switching language to: $ARGUMENT"
|
|
73
|
+
node -e "
|
|
74
|
+
import('./language-utils.js').then(async ({ switchLanguage }) => {
|
|
75
|
+
const result = await switchLanguage(process.argv[1]);
|
|
76
|
+
|
|
77
|
+
if (result.success) {
|
|
78
|
+
console.log('✅ Language switch successful!');
|
|
79
|
+
console.log('Previous language:', result.previousLanguage);
|
|
80
|
+
console.log('New language:', result.newLanguage);
|
|
81
|
+
} else {
|
|
82
|
+
console.error('❌ Language switch failed:', result.error);
|
|
83
|
+
process.exit(1);
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
" -- "$ARGUMENT"
|
|
87
|
+
fi
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
#### 2.3 Language Detection (detect)
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
if [ "$ACTION" = "detect" ]; then
|
|
94
|
+
echo "🔍 Detecting system language..."
|
|
95
|
+
node -e "
|
|
96
|
+
import('./language-utils.js').then(async ({ detectLanguage }) => {
|
|
97
|
+
const detected = await detectLanguage();
|
|
98
|
+
|
|
99
|
+
console.log('=== Language Detection Results ===');
|
|
100
|
+
console.log('Detected language:', detected);
|
|
101
|
+
console.log('');
|
|
102
|
+
console.log('Environment variables:');
|
|
103
|
+
console.log(' LANG:', process.env.LANG || 'Not set');
|
|
104
|
+
console.log(' LC_ALL:', process.env.LC_ALL || 'Not set');
|
|
105
|
+
console.log(' LANGUAGE:', process.env.LANGUAGE || 'Not set');
|
|
106
|
+
});
|
|
107
|
+
"
|
|
108
|
+
fi
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
#### 2.4 Settings Reset (reset)
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
if [ "$ACTION" = "reset" ]; then
|
|
115
|
+
echo "🗑️ Resetting language settings..."
|
|
116
|
+
|
|
117
|
+
# Delete configuration file
|
|
118
|
+
if [ -f ".aiwf/config/language.json" ]; then
|
|
119
|
+
rm ".aiwf/config/language.json"
|
|
120
|
+
echo "✅ Language configuration file has been deleted"
|
|
121
|
+
else
|
|
122
|
+
echo "ℹ️ Language configuration file does not exist"
|
|
123
|
+
fi
|
|
124
|
+
|
|
125
|
+
# Perform re-detection
|
|
126
|
+
echo "🔄 Re-detecting language..."
|
|
127
|
+
node -e "
|
|
128
|
+
import('./language-utils.js').then(async ({ detectLanguage }) => {
|
|
129
|
+
const detected = await detectLanguage();
|
|
130
|
+
console.log('Re-detected language:', detected);
|
|
131
|
+
});
|
|
132
|
+
"
|
|
133
|
+
fi
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
#### 2.5 System Test (test)
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
if [ "$ACTION" = "test" ]; then
|
|
140
|
+
echo "🧪 Testing language system..."
|
|
141
|
+
node -e "
|
|
142
|
+
import('./language-utils.js').then(async (utils) => {
|
|
143
|
+
const { resolveCommandPath, detectLanguage, getLocalizedMessage } = utils;
|
|
144
|
+
|
|
145
|
+
console.log('=== Language System Test ===');
|
|
146
|
+
|
|
147
|
+
// 1. Language detection test
|
|
148
|
+
const detected = await detectLanguage();
|
|
149
|
+
console.log('✅ Language detection:', detected);
|
|
150
|
+
|
|
151
|
+
// 2. Command path resolution test
|
|
152
|
+
const testCommands = ['aiwf_do_task', 'aiwf_commit'];
|
|
153
|
+
console.log('\n📁 Command path test:');
|
|
154
|
+
|
|
155
|
+
for (const cmd of testCommands) {
|
|
156
|
+
const result = await resolveCommandPath(cmd);
|
|
157
|
+
if (result.path) {
|
|
158
|
+
console.log(' ✅', cmd, result.fallback ? '(fallback)' : '(direct)');
|
|
159
|
+
} else {
|
|
160
|
+
console.log(' ❌', cmd, 'failed');
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// 3. Message system test
|
|
165
|
+
console.log('\n💬 Message system test:');
|
|
166
|
+
const testMsg = getLocalizedMessage('LANGUAGE_NOT_SUPPORTED', detected);
|
|
167
|
+
console.log(' Message:', testMsg);
|
|
168
|
+
|
|
169
|
+
console.log('\n✅ All tests completed');
|
|
170
|
+
});
|
|
171
|
+
"
|
|
172
|
+
fi
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
#### 2.6 Configuration Management (config)
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
if [ "$ACTION" = "config" ]; then
|
|
179
|
+
echo "⚙️ Language configuration file management"
|
|
180
|
+
|
|
181
|
+
CONFIG_FILE=".aiwf/config/language.json"
|
|
182
|
+
|
|
183
|
+
if [ -f "$CONFIG_FILE" ]; then
|
|
184
|
+
echo "📄 Current configuration file contents:"
|
|
185
|
+
cat "$CONFIG_FILE" | jq . 2>/dev/null || cat "$CONFIG_FILE"
|
|
186
|
+
echo ""
|
|
187
|
+
|
|
188
|
+
echo "📊 Configuration file info:"
|
|
189
|
+
echo " Location: $CONFIG_FILE"
|
|
190
|
+
echo " Size: $(stat -f%z "$CONFIG_FILE" 2>/dev/null || stat -c%s "$CONFIG_FILE" 2>/dev/null) bytes"
|
|
191
|
+
echo " Modified: $(stat -f%Sm "$CONFIG_FILE" 2>/dev/null || stat -c%y "$CONFIG_FILE" 2>/dev/null)"
|
|
192
|
+
else
|
|
193
|
+
echo "❌ Configuration file does not exist: $CONFIG_FILE"
|
|
194
|
+
echo ""
|
|
195
|
+
echo "💡 To create a configuration file, set a language:"
|
|
196
|
+
echo " /project:aiwf:language_manager switch ko"
|
|
197
|
+
echo " /project:aiwf:language_manager switch en"
|
|
198
|
+
fi
|
|
199
|
+
fi
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### 3. Help (default)
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
if [ "$ACTION" = "help" ] || [ "$ACTION" = "--help" ]; then
|
|
206
|
+
echo "📖 AIWF Language Manager Help"
|
|
207
|
+
echo ""
|
|
208
|
+
echo "Usage:"
|
|
209
|
+
echo " /project:aiwf:language_manager [action] [arguments]"
|
|
210
|
+
echo ""
|
|
211
|
+
echo "Actions:"
|
|
212
|
+
echo " status Check current language status"
|
|
213
|
+
echo " switch <lang> Switch language (ko|en)"
|
|
214
|
+
echo " detect Auto-detect system language"
|
|
215
|
+
echo " reset Reset language settings"
|
|
216
|
+
echo " test Test language system"
|
|
217
|
+
echo " config Manage configuration file"
|
|
218
|
+
echo " help Show this help"
|
|
219
|
+
echo ""
|
|
220
|
+
echo "Examples:"
|
|
221
|
+
echo " /project:aiwf:language_manager status"
|
|
222
|
+
echo " /project:aiwf:language_manager switch ko"
|
|
223
|
+
echo " /project:aiwf:language_manager test"
|
|
224
|
+
fi
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
### 4. Result Summary
|
|
228
|
+
|
|
229
|
+
```bash
|
|
230
|
+
echo ""
|
|
231
|
+
echo "=== Execution Complete ==="
|
|
232
|
+
echo "Action: $ACTION"
|
|
233
|
+
echo "Time: $(date '+%Y-%m-%d %H:%M:%S')"
|
|
234
|
+
|
|
235
|
+
# Simple current language status display
|
|
236
|
+
node -e "
|
|
237
|
+
import('./language-utils.js').then(async ({ detectLanguage }) => {
|
|
238
|
+
const lang = await detectLanguage();
|
|
239
|
+
console.log('Current language:', lang);
|
|
240
|
+
});
|
|
241
|
+
" 2>/dev/null || echo "Current language: Unable to detect"
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
## Output Examples
|
|
245
|
+
|
|
246
|
+
### Status Check
|
|
247
|
+
```
|
|
248
|
+
=== AIWF Language Manager ===
|
|
249
|
+
Action: status
|
|
250
|
+
|
|
251
|
+
📊 Checking language status...
|
|
252
|
+
=== Language Settings Status ===
|
|
253
|
+
Detected language: en
|
|
254
|
+
Configured language: en
|
|
255
|
+
Effective language: en
|
|
256
|
+
Auto detection: Enabled
|
|
257
|
+
Fallback language: en
|
|
258
|
+
Supported languages: ko, en
|
|
259
|
+
|
|
260
|
+
=== Execution Complete ===
|
|
261
|
+
Action: status
|
|
262
|
+
Time: 2025-07-03 06:25:30
|
|
263
|
+
Current language: en
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
### Language Switch
|
|
267
|
+
```
|
|
268
|
+
=== AIWF Language Manager ===
|
|
269
|
+
Action: switch
|
|
270
|
+
Argument: ko
|
|
271
|
+
|
|
272
|
+
🔄 Switching language to: ko
|
|
273
|
+
✅ Language switch successful!
|
|
274
|
+
Previous language: en
|
|
275
|
+
New language: ko
|
|
276
|
+
|
|
277
|
+
=== Execution Complete ===
|
|
278
|
+
Action: switch
|
|
279
|
+
Time: 2025-07-03 06:25:35
|
|
280
|
+
Current language: ko
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
## Related Commands
|
|
284
|
+
|
|
285
|
+
- `/project:aiwf:switch_language` - Simple language switching
|
|
286
|
+
- `/project:aiwf:language_status` - Detailed status check
|
|
287
|
+
- `/project:aiwf:initialize` - AIWF initialization (includes language selection)
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
# AIWF Language Status Check
|
|
2
|
+
|
|
3
|
+
A command to check the detailed language configuration status of the AIWF framework.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
This command provides the following information:
|
|
8
|
+
- Currently detected system language
|
|
9
|
+
- User-configured language (if any)
|
|
10
|
+
- Actually used language
|
|
11
|
+
- Language configuration file status
|
|
12
|
+
- Command path resolution status
|
|
13
|
+
|
|
14
|
+
## Execution Process
|
|
15
|
+
|
|
16
|
+
### 1. Comprehensive Language Status Analysis
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
node -e "
|
|
20
|
+
import('./language-utils.js').then(async (utils) => {
|
|
21
|
+
const { getLanguageStatus, resolveCommandPath, getLocalizedMessage } = utils;
|
|
22
|
+
|
|
23
|
+
console.log('=== AIWF Language System Status Analysis ===\n');
|
|
24
|
+
|
|
25
|
+
// Basic status information
|
|
26
|
+
const status = await getLanguageStatus();
|
|
27
|
+
|
|
28
|
+
console.log('📍 Basic Information:');
|
|
29
|
+
console.log(' Detected language:', status.detectedLanguage);
|
|
30
|
+
console.log(' Configured language:', status.configuredLanguage || 'None');
|
|
31
|
+
console.log(' Effective language:', status.effectiveLanguage);
|
|
32
|
+
console.log(' Auto detection:', status.autoDetect ? 'Enabled' : 'Disabled');
|
|
33
|
+
console.log(' Fallback language:', status.fallbackLanguage);
|
|
34
|
+
console.log(' Supported languages:', status.supportedLanguages.join(', '));
|
|
35
|
+
console.log(' Config file:', status.configPath);
|
|
36
|
+
|
|
37
|
+
if (status.error) {
|
|
38
|
+
console.log(' ⚠️ Error:', status.error);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
console.log('\n📂 Config File Status:');
|
|
42
|
+
try {
|
|
43
|
+
const fs = await import('fs/promises');
|
|
44
|
+
const configExists = await fs.access(status.configPath).then(() => true).catch(() => false);
|
|
45
|
+
|
|
46
|
+
if (configExists) {
|
|
47
|
+
const configContent = await fs.readFile(status.configPath, 'utf8');
|
|
48
|
+
const config = JSON.parse(configContent);
|
|
49
|
+
console.log(' ✅ Config file exists');
|
|
50
|
+
console.log(' 📄 Contents:', JSON.stringify(config, null, 4));
|
|
51
|
+
} else {
|
|
52
|
+
console.log(' ❌ Config file not found');
|
|
53
|
+
}
|
|
54
|
+
} catch (error) {
|
|
55
|
+
console.log(' ⚠️ Config file read error:', error.message);
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
"
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### 2. Environment Variables Analysis
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
node -e "
|
|
65
|
+
console.log('\n🌍 System Environment Variables:');
|
|
66
|
+
console.log(' LANG:', process.env.LANG || 'Not set');
|
|
67
|
+
console.log(' LC_ALL:', process.env.LC_ALL || 'Not set');
|
|
68
|
+
console.log(' LANGUAGE:', process.env.LANGUAGE || 'Not set');
|
|
69
|
+
console.log(' NODE_ENV:', process.env.NODE_ENV || 'Not set');
|
|
70
|
+
"
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### 3. Command Path Testing
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
node -e "
|
|
77
|
+
import('./language-utils.js').then(async ({ resolveCommandPath, detectLanguage }) => {
|
|
78
|
+
console.log('\n🔍 Command Path Resolution Testing:');
|
|
79
|
+
|
|
80
|
+
const currentLang = await detectLanguage();
|
|
81
|
+
console.log(' Current language:', currentLang);
|
|
82
|
+
|
|
83
|
+
const testCommands = [
|
|
84
|
+
'aiwf_do_task',
|
|
85
|
+
'aiwf_commit',
|
|
86
|
+
'aiwf_initialize',
|
|
87
|
+
'aiwf_switch_language',
|
|
88
|
+
'aiwf_test',
|
|
89
|
+
'aiwf_code_review',
|
|
90
|
+
'aiwf_project_review'
|
|
91
|
+
];
|
|
92
|
+
|
|
93
|
+
for (const cmd of testCommands) {
|
|
94
|
+
const result = await resolveCommandPath(cmd);
|
|
95
|
+
if (result.path) {
|
|
96
|
+
const status = result.fallback ? '🔄 Fallback' : '✅ Direct';
|
|
97
|
+
console.log(' ' + status, cmd + ':', result.language);
|
|
98
|
+
} else {
|
|
99
|
+
console.log(' ❌ Missing', cmd + ':', result.error);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
"
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### 4. Message System Testing
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
node -e "
|
|
110
|
+
import('./language-utils.js').then(async ({ getLocalizedMessage, detectLanguage }) => {
|
|
111
|
+
console.log('\n💬 Multilingual Message System Testing:');
|
|
112
|
+
|
|
113
|
+
const currentLang = await detectLanguage();
|
|
114
|
+
console.log(' Current language:', currentLang);
|
|
115
|
+
|
|
116
|
+
const testMessages = [
|
|
117
|
+
'LANGUAGE_NOT_SUPPORTED',
|
|
118
|
+
'CONFIG_LOAD_FAILED',
|
|
119
|
+
'CONFIG_SAVE_FAILED',
|
|
120
|
+
'COMMAND_NOT_FOUND',
|
|
121
|
+
'LANGUAGE_SWITCH_SUCCESS'
|
|
122
|
+
];
|
|
123
|
+
|
|
124
|
+
for (const msgKey of testMessages) {
|
|
125
|
+
const koMsg = getLocalizedMessage(msgKey, 'ko');
|
|
126
|
+
const enMsg = getLocalizedMessage(msgKey, 'en');
|
|
127
|
+
console.log(' ' + msgKey + ':');
|
|
128
|
+
console.log(' Korean: ' + koMsg);
|
|
129
|
+
console.log(' English: ' + enMsg);
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
"
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### 5. Directory Structure Check
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
node -e "
|
|
139
|
+
const fs = await import('fs/promises');
|
|
140
|
+
const path = await import('path');
|
|
141
|
+
|
|
142
|
+
console.log('\n📁 AIWF Directory Structure:');
|
|
143
|
+
|
|
144
|
+
const checkDirs = [
|
|
145
|
+
'.aiwf',
|
|
146
|
+
'.aiwf/config',
|
|
147
|
+
'.claude',
|
|
148
|
+
'.claude/commands',
|
|
149
|
+
'.claude/commands/aiwf',
|
|
150
|
+
'claude-code/aiwf/ko/.claude/commands/aiwf',
|
|
151
|
+
'claude-code/aiwf/en/.claude/commands/aiwf'
|
|
152
|
+
];
|
|
153
|
+
|
|
154
|
+
for (const dir of checkDirs) {
|
|
155
|
+
try {
|
|
156
|
+
const exists = await fs.access(dir).then(() => true).catch(() => false);
|
|
157
|
+
if (exists) {
|
|
158
|
+
const files = await fs.readdir(dir);
|
|
159
|
+
console.log(' ✅', dir + ':', files.length + ' files');
|
|
160
|
+
} else {
|
|
161
|
+
console.log(' ❌', dir + ':', 'Directory not found');
|
|
162
|
+
}
|
|
163
|
+
} catch (error) {
|
|
164
|
+
console.log(' ⚠️', dir + ':', 'Access error');
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
"
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## Diagnostics and Recommendations
|
|
171
|
+
|
|
172
|
+
### Language Detection Problem Resolution
|
|
173
|
+
|
|
174
|
+
The command provides the following recommendations:
|
|
175
|
+
|
|
176
|
+
1. **When config file is missing**:
|
|
177
|
+
```
|
|
178
|
+
💡 Recommendation: Explicitly set the language
|
|
179
|
+
/project:aiwf:switch_language ko
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
2. **Environment variable issues**:
|
|
183
|
+
```
|
|
184
|
+
💡 Recommendation: Check environment variables
|
|
185
|
+
export LANG=en_US.UTF-8
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
3. **Missing command files**:
|
|
189
|
+
```
|
|
190
|
+
💡 Recommendation: Reinstall AIWF
|
|
191
|
+
npx aiwf --force
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
## Output Example
|
|
195
|
+
|
|
196
|
+
```
|
|
197
|
+
=== AIWF Language System Status Analysis ===
|
|
198
|
+
|
|
199
|
+
📍 Basic Information:
|
|
200
|
+
Detected language: en
|
|
201
|
+
Configured language: en
|
|
202
|
+
Effective language: en
|
|
203
|
+
Auto detection: Enabled
|
|
204
|
+
Fallback language: en
|
|
205
|
+
Supported languages: ko, en
|
|
206
|
+
Config file: .aiwf/config/language.json
|
|
207
|
+
|
|
208
|
+
📂 Config File Status:
|
|
209
|
+
✅ Config file exists
|
|
210
|
+
📄 Contents: {
|
|
211
|
+
"language": "en",
|
|
212
|
+
"auto_detect": true,
|
|
213
|
+
"last_updated": "2025-07-03T06:25:00.000Z",
|
|
214
|
+
"fallback": "en"
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
🌍 System Environment Variables:
|
|
218
|
+
LANG: en_US.UTF-8
|
|
219
|
+
LC_ALL: Not set
|
|
220
|
+
LANGUAGE: Not set
|
|
221
|
+
NODE_ENV: Not set
|
|
222
|
+
|
|
223
|
+
🔍 Command Path Resolution Testing:
|
|
224
|
+
Current language: en
|
|
225
|
+
✅ Direct aiwf_do_task: en
|
|
226
|
+
✅ Direct aiwf_commit: en
|
|
227
|
+
✅ Direct aiwf_initialize: en
|
|
228
|
+
✅ Direct aiwf_switch_language: en
|
|
229
|
+
🔄 Fallback aiwf_test: ko
|
|
230
|
+
❌ Missing aiwf_unknown: Command file not found
|
|
231
|
+
|
|
232
|
+
💬 Multilingual Message System Testing:
|
|
233
|
+
Current language: en
|
|
234
|
+
LANGUAGE_NOT_SUPPORTED:
|
|
235
|
+
Korean: 지원되지 않는 언어입니다
|
|
236
|
+
English: Language not supported
|
|
237
|
+
|
|
238
|
+
📁 AIWF Directory Structure:
|
|
239
|
+
✅ .aiwf: 8 files
|
|
240
|
+
✅ .aiwf/config: 1 file
|
|
241
|
+
✅ .claude: 2 files
|
|
242
|
+
✅ .claude/commands: 1 file
|
|
243
|
+
❌ .claude/commands/aiwf: Directory not found
|
|
244
|
+
✅ claude-code/aiwf/ko/.claude/commands/aiwf: 15 files
|
|
245
|
+
✅ claude-code/aiwf/en/.claude/commands/aiwf: 14 files
|
|
246
|
+
```
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
# AIWF Language Switch
|
|
2
|
+
|
|
3
|
+
A command that allows users to change the language settings of the AIWF framework.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
This command is used in the following cases:
|
|
8
|
+
- When you want to change the current language setting to another language
|
|
9
|
+
- When you want to check the current language setting status
|
|
10
|
+
- When you want to resolve language detection issues
|
|
11
|
+
|
|
12
|
+
## Parameters
|
|
13
|
+
|
|
14
|
+
- `<language_code>` (optional): Language to switch to (`ko` or `en`)
|
|
15
|
+
- Running without parameters displays the current language status
|
|
16
|
+
|
|
17
|
+
## Execution Steps
|
|
18
|
+
|
|
19
|
+
### 1. Check Current Language Status
|
|
20
|
+
|
|
21
|
+
First, check the current language configuration status:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
node -e "
|
|
25
|
+
import('./language-utils.js').then(async ({ getLanguageStatus }) => {
|
|
26
|
+
const status = await getLanguageStatus();
|
|
27
|
+
console.log('=== AIWF Language Settings Status ===');
|
|
28
|
+
console.log('Detected language:', status.detectedLanguage);
|
|
29
|
+
console.log('Configured language:', status.configuredLanguage || 'None');
|
|
30
|
+
console.log('Effective language:', status.effectiveLanguage);
|
|
31
|
+
console.log('Auto detection:', status.autoDetect ? 'Enabled' : 'Disabled');
|
|
32
|
+
console.log('Fallback language:', status.fallbackLanguage);
|
|
33
|
+
console.log('Config file path:', status.configPath);
|
|
34
|
+
if (status.error) console.log('Error:', status.error);
|
|
35
|
+
});
|
|
36
|
+
"
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### 2. Argument Analysis
|
|
40
|
+
|
|
41
|
+
Check the `<$ARGUMENTS>` value and perform one of the following:
|
|
42
|
+
|
|
43
|
+
- **No arguments**: Display current status only and exit
|
|
44
|
+
- **Valid language code (`ko` or `en`)**: Switch to that language
|
|
45
|
+
- **Invalid argument**: Display error message and usage guide
|
|
46
|
+
|
|
47
|
+
### 3. Execute Language Switch
|
|
48
|
+
|
|
49
|
+
If a valid language code is provided, switch the language:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
node -e "
|
|
53
|
+
import('./language-utils.js').then(async ({ switchLanguage }) => {
|
|
54
|
+
const targetLanguage = process.argv[1];
|
|
55
|
+
const result = await switchLanguage(targetLanguage);
|
|
56
|
+
|
|
57
|
+
if (result.success) {
|
|
58
|
+
console.log('✅ Language switch successful!');
|
|
59
|
+
console.log('Previous language:', result.previousLanguage);
|
|
60
|
+
console.log('New language:', result.newLanguage);
|
|
61
|
+
console.log('Message:', result.message);
|
|
62
|
+
} else {
|
|
63
|
+
console.error('❌ Language switch failed:', result.error);
|
|
64
|
+
console.log('Message:', result.message);
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
" -- $ARGUMENTS
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### 4. Post-Switch Validation
|
|
71
|
+
|
|
72
|
+
Verify that the settings are properly applied after the language switch:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
node -e "
|
|
76
|
+
import('./language-utils.js').then(async ({ getLanguageStatus }) => {
|
|
77
|
+
const status = await getLanguageStatus();
|
|
78
|
+
console.log('\n=== Post-Switch Language Settings Status ===');
|
|
79
|
+
console.log('Current language:', status.effectiveLanguage);
|
|
80
|
+
console.log('Config file:', status.configuredLanguage ? 'Saved' : 'None');
|
|
81
|
+
});
|
|
82
|
+
"
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### 5. Command Path Testing
|
|
86
|
+
|
|
87
|
+
Test if command paths are properly resolved with the new language:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
node -e "
|
|
91
|
+
import('./language-utils.js').then(async ({ resolveCommandPath, detectLanguage }) => {
|
|
92
|
+
const currentLang = await detectLanguage();
|
|
93
|
+
const testCommands = ['aiwf_do_task', 'aiwf_commit', 'aiwf_initialize'];
|
|
94
|
+
|
|
95
|
+
console.log('\n=== Command Path Testing ===');
|
|
96
|
+
console.log('Current language:', currentLang);
|
|
97
|
+
|
|
98
|
+
for (const cmd of testCommands) {
|
|
99
|
+
const result = await resolveCommandPath(cmd);
|
|
100
|
+
if (result.path) {
|
|
101
|
+
console.log('✅', cmd, '->', result.path, result.fallback ? '(fallback)' : '(direct)');
|
|
102
|
+
} else {
|
|
103
|
+
console.log('❌', cmd, '-> Not found:', result.error);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
"
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## Output Format
|
|
111
|
+
|
|
112
|
+
### Successful Language Switch
|
|
113
|
+
```
|
|
114
|
+
✅ Language switch successful!
|
|
115
|
+
Previous language: en
|
|
116
|
+
New language: ko
|
|
117
|
+
Message: Language changed successfully
|
|
118
|
+
|
|
119
|
+
=== Post-Switch Language Settings Status ===
|
|
120
|
+
Current language: ko
|
|
121
|
+
Config file: Saved
|
|
122
|
+
|
|
123
|
+
=== Command Path Testing ===
|
|
124
|
+
Current language: ko
|
|
125
|
+
✅ aiwf_do_task -> claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_do_task.md (direct)
|
|
126
|
+
✅ aiwf_commit -> claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_commit.md (direct)
|
|
127
|
+
✅ aiwf_initialize -> claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_initialize.md (direct)
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### Status Check Only
|
|
131
|
+
```
|
|
132
|
+
=== AIWF Language Settings Status ===
|
|
133
|
+
Detected language: ko
|
|
134
|
+
Configured language: ko
|
|
135
|
+
Effective language: ko
|
|
136
|
+
Auto detection: Enabled
|
|
137
|
+
Fallback language: en
|
|
138
|
+
Config file path: .aiwf/config/language.json
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Error Occurred
|
|
142
|
+
```
|
|
143
|
+
❌ Language switch failed: Language not supported
|
|
144
|
+
Message: Failed to change language
|
|
145
|
+
|
|
146
|
+
Usage: /project:aiwf:switch_language [ko|en]
|
|
147
|
+
Supported languages: ko (Korean), en (English)
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Important Notes
|
|
151
|
+
|
|
152
|
+
1. **Config File Permissions**: Write permissions are required for the `.aiwf/config/` directory
|
|
153
|
+
2. **Command File Existence**: Command files for the target language must exist
|
|
154
|
+
3. **Project Root**: Can only be used in projects where AIWF has been initialized
|
|
155
|
+
|
|
156
|
+
## Related Commands
|
|
157
|
+
|
|
158
|
+
- `/project:aiwf:initialize` - Initialize AIWF project
|
|
159
|
+
- `/project:aiwf:update_docs` - Update documentation (language-specific)
|
|
160
|
+
- `/project:aiwf:help` - Help (displayed in current language)
|