Select grammar patterns from data/grammar.json tailored to the learner's current week focus and recent performance, with examples and a practice prompt.
Invoke this skill when building a daily grammar task or when the learner runs /jp-grammar. It identifies which grammar patterns to teach or reinforce based on where the learner is in the 24-week plan.
| Parameter | Type | Required | Description |
|---|---|---|---|
level | string | yes | Learner's current JLPT level: "N5", "N4", "N3" |
current_week_focus | string | yes | Week focus area from study plan: "vocab+listening", "grammar+shadowing", "speaking+review" |
recent_performance | object | yes | From storage/progress.json: includes recurring_mistakes[], active_grammar_ids[], |
mastered_grammar_ids[]count | integer | no | Number of patterns to return. Default: 2. |
An array of grammar items, each augmented with:
| Field | Type | Description |
|---|---|---|
id | string | Grammar item ID |
pattern | string | Grammar pattern |
level | string | JLPT level |
explanation_zh | string | Full Chinese explanation |
examples | object[] | Example sentences |
topic | string | Topic category |
practice_prompt | string | Production task for the learner |
selection_reason | string | Why this item was chosen |
session_mode | string | "introduce" (new) or "reinforce" (seen before) |
recurring_mistakes contains a grammar-related error, find the matching grammar item and return it first with session_mode: "reinforce".active_grammar_ids that have not been mastered — these need reinforcement."introduce": Item is new. Show full explanation, all examples, then the practice prompt."reinforce": Item was seen before. Skip lengthy explanation; jump directly to 2 examples and the practice prompt. Show the explanation only if the learner asks.Only return items at or below the learner's current level. A level-N5 learner should not receive N4 patterns unless they have explicitly advanced.
Input:
{
"level": "N5",
"current_week_focus": "grammar+shadowing",
"recent_performance": {
"recurring_mistakes": [{ "pattern": "Omitting の in 〜するのが好き" }],
"active_grammar_ids": ["grammar_001", "grammar_002"],
"mastered_grammar_ids": []
},
"count": 2
}
Output:
[
{
"id": "grammar_003",
"pattern": "〜が好きです / 〜が嫌いです",
"session_mode": "reinforce",
"selection_reason": "matches recurring mistake about omitting の",
"practice_prompt": "說說你的喜好:你喜歡什麼食物?用「〜が好きです」造3句話。"
},
{
"id": "grammar_004",
"pattern": "〜に行きます / 〜へ行きます",
"session_mode": "introduce",
"selection_reason": "next pattern in N5 travel focus sequence"
}
]