| name | select-grammar-items |
| description | Select grammar patterns from data/grammar.json tailored to the learner's current week focus and recent performance, with examples and a practice prompt. |
select-grammar-items
When to Use
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.
Inputs
| 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. |
Outputs
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) |
Logic
Selection Priority
- Recurring mistake patterns (highest priority): If
recurring_mistakes contains a grammar-related error, find the matching grammar item and return it first with session_mode: "reinforce".
- Active grammar items: Items in
active_grammar_ids that have not been mastered — these need reinforcement.
- New items for grammar+shadowing weeks: During weeks 9–16, introduce 1–2 new patterns per session.
- Review mode for speaking+review weeks: During weeks 17–24, rotate through all previously introduced patterns.
- Low frequency in vocab+listening weeks: Only 1 grammar item per session during weeks 1–8.
Session Mode
"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.
Level Filtering
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.
Example
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"
}
]