Generate vocabulary cards from a list of words. For Arabic decks, translates English→Arabic. For English decks, generates dictionary-style definitions with synonyms. Use when the user wants to generate translations/definitions for a list of words, or says "generate words from [text/file]".
This skill takes a list of words (from text or a file), generates card content based on the target language, checks for duplicates, and adds them to a selected deck.
Language modes:
https://learn.rocksbythesea.uk.env.local (API_TOKEN)-H "Authorization: Bearer $API_TOKEN"The user provides either:
/generate-words book, table, chair)/generate-words /path/to/words.txt)If a file path is provided, read it with the Read tool.
Split input into individual words:
Example input: "book, table, chair\nwindow"
Parsed: ["book", "table", "chair", "window"]
Search existing cards to find words that are already in the system:
# Get all vocabulary with search
curl -s -H "Authorization: Bearer $API_TOKEN" "https://learn.rocksbythesea.uk/api/vocab?search=WORD"
For each word in the list, search the vocab endpoint. If the word appears in any card's front field (for English decks) or back field (for Arabic decks), mark it as a duplicate.
For each non-duplicate word, look up the Arabic translation:
"{word} in Arabic translation MSA Modern Standard Arabic"Format each result as:
English: book → Arabic: كِتاب (kitāb)
For each non-duplicate word, generate a dictionary-style back:
"define {word}" OR "{word} definition synonyms"Format the card back like:
To speak in a very loud voice; to shout.
Synonyms: shout, cry, holler, scream, roar
Card mapping for English decks:
front = the English word (e.g., "yell")back = definition + synonyms (as above)| # | English | Arabic | Status |
|---|---------|--------|--------|
| 1 | book | كِتاب | NEW |
| 2 | table | طاولة | NEW |
| 3 | dog | كلب | DUPLICATE (in Nouns deck) |
| 4 | chair | كُرسي | NEW |
| # | Word | Definition | Status |
|---|------|-----------|--------|
| 1 | yell | To speak in a very loud voice; to shout. Syn: shout, cry, holler | NEW |
| 2 | happy | Feeling pleasure or contentment. Syn: glad, joyful, pleased | NEW |
| 3 | run | ... | DUPLICATE (in Verbs deck) |
Mark duplicates clearly so the user can decide whether to skip or re-add them.
Ask the user:
# Fetch available decks (filter by language to show relevant decks)
curl -s -H "Authorization: Bearer $API_TOKEN" https://learn.rocksbythesea.uk/api/decks | jq '.[] | "\(.id): \(.name) (\(.cardCount) cards, \(.language))"'
Determine the language from the selected deck's language field. This determines whether to use Arabic or English card format.
Bulk-add all confirmed cards:
curl -X POST "https://learn.rocksbythesea.uk/api/decks/{deck_id}/cards" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $API_TOKEN" \
-d '[
{"front": "كِتاب", "back": "book"},
{"front": "طاولة", "back": "table"}
]'
Note: front = Arabic, back = English.
curl -X POST "https://learn.rocksbythesea.uk/api/decks/{deck_id}/cards" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $API_TOKEN" \
-d '[
{"front": "yell", "back": "To speak in a very loud voice; to shout.\nSynonyms: shout, cry, holler, scream, roar"},
{"front": "happy", "back": "Feeling pleasure or contentment.\nSynonyms: glad, joyful, pleased, cheerful, delighted"}
]'
Note: front = English word, back = definition + synonyms.
Added 3 words to deck "Nouns (الأسماء)":
- كِتاب (book)
- طاولة (table)
- كُرسي (chair)
Skipped 1 duplicate:
- كلب (dog) - already in Nouns
User: /generate-words book, table, chair, window, door
1. Parse → ["book", "table", "chair", "window", "door"]
2. Check duplicates → none found
3. Translate each word via WebSearch
4. Show preview table
5. User selects deck → Nouns (ID: 6)
6. POST 5 cards to /api/decks/6/cards
7. Report: "Added 5 words to Nouns"
User: /generate-words ~/words.txt
1. Read file → "kitchen\nbathroom\nbedroom\nliving room"
2. Parse → ["kitchen", "bathroom", "bedroom", "living room"]
3. Check duplicates → "kitchen" already exists
4. Translate remaining 3 words
5. Show preview with kitchen marked as duplicate
6. User confirms → skip duplicate, add to "Home" deck
7. POST 3 cards
8. Report results
User: /generate-words cat, dog, bird, fish
1. Parse → ["cat", "dog", "bird", "fish"]
2. Check duplicates → "cat" and "dog" found in Nouns
3. Translate "bird" and "fish"
4. Show preview:
| cat | قطة | DUPLICATE |
| dog | كلب | DUPLICATE |
| bird | طائر | NEW |
| fish | سمكة | NEW |
5. User confirms → add new words only
6. POST 2 cards
7. Report results
language field (ar or en).env.local for the API_TOKEN value