| name | learn |
| description | Correct or translate text for language learning. Detailed scoring, error analysis, and alternatives. |
| allowed-tools | Read Glob Bash |
| user-invocable | true |
| argument-hint | <text> | last |
Language Coach โ Learn
1. Load config
Read ~/.claude-lang-coach/config.json via Bash.
If missing, tell the user: /lang-coach:setup ja en
2. Check for "last" mode
If the argument is last:
- Find the most recent correction:
ls -t ~/.claude-lang-coach/corrections/*.json | head -1
- Read it
- Re-analyze the
input field with full detail (step 3)
- Skip saving (already saved)
3. Analyze
Detect whether input is in target or native language.
Correct like a friendly native speaker โ prioritize natural, idiomatic expression.
Target language โ Correction:
- Detect errors (grammar, vocabulary, tense, spelling, collocation)
- Corrected text
- Explain each error in native language
- Score (0-100): Accuracy, Fluency, Naturalness, Overall
- 2-3 alternatives
- If error-free, note what was done well
Native language โ Translation coaching:
- Most natural translation
- 2-3 variants (casual / formal / advanced) with nuance
- Grammar points
- Key vocabulary
4. Save
cat << 'JSONEOF' | ~/.claude-lang-coach/save-correction.sh
{
"timestamp": "ISO 8601",
"native_language": "...",
"target_language": "...",
"input_type": "target|native",
"input": "original text",
"result": {
"output_text": "corrected or translated text",
"errors": [{"type":"...","original":"...","corrected":"...","explanation":"...","severity":"high|medium|low"}],
"score": {"accuracy":0,"fluency":0,"naturalness":0,"overall":0},
"feedback": "...",
"alternatives": ["..."]
}
}
JSONEOF
5. Display
Localize labels to native language:
| Key | en | ja | ko | zh | fr | de | es |
|---|
| accuracy | Accuracy | ๆญฃ็ขบใ | ์ ํ์ฑ | ๅ็กฎๆง | Prรฉcision | Genauigkeit | Precisiรณn |
| fluency | Fluency | ๆตๆขใ | ์ ์ฐฝ์ฑ | ๆต็
ๅบฆ | Fluiditรฉ | Flรผssigkeit | Fluidez |
| naturalness | Naturalness | ่ช็ถใ | ์์ฐ์ค๋ฌ์ | ่ช็ถๅบฆ | Naturel | Natรผrlichkeit | Naturalidad |
| overall | Overall | ็ทๅ | ์ข
ํฉ | ็ปผๅ | Global | Gesamt | General |
Score bars: โโ 20 segments. Severity: โฒ high ยท โ medium ยท โ low.
Correction:
โ {original}
โ {corrected}
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ {Accuracy} {n} {โโโโโโโโโโโโโโโโโโโโ} โ
โ {Fluency} {n} {โโโโโโโโโโโโโโโโโโโโ} โ
โ {Naturalness} {n} {โโโโโโโโโโโโโโโโโโโโ} โ
โฃโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโซ
โ โ
{Overall} {n} {โโโโโโโโโโโโโโโโโโโโ} โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
| Before โ After | Why |
|---|
| โฒ | {orig} โ {fixed} | {explanation} |
Translation:
{native text} โ {main translation}
| Style | Translation | Nuance |
|---|
| ๐ฌ Casual | {text} | {note} |
| ๐ Formal | {text} | {note} |
| ๐ฏ Advanced | {text} | {note} |