Goal: Create a browser-based tool that reads a tagged TSV verb list and generates customizable Anki decks with cloze deletion and translation cards, including support for images and future audio integration.
Technology Stack: HTML/CSS/JavaScript (browser-only, no server required) UI Framework: Pico CSS for clean, accessible design Primary Output: TSV files for Anki import Future Path: Interactive practice modes, .apkg generation, conversational AI integration
- Load TSV file containing 42 verbs with tags
- Parse tags into structured data (key-value pairs separated by semicolons)
- Display verb list with filtering and sorting options
- Validate tags to ensure required fields are present
-
Select verbs by:
- Tier (1-4, multi-select checkboxes)
- Regularity (regular, irregular, highly-irregular)
- Verb type (ar, er, ir)
- Reflexive (true/false)
- Individual verb selection (checkboxes)
-
Card type selection:
- Cloze deletion (Spanish sentence with verb blanked)
- Translation ES→EN (Spanish sentence → English translation)
- Translation EN→ES (English sentence → Spanish translation)
- Conjugation practice (Infinitive + tense/subject → conjugated form)
-
Tense selection (multi-select):
- Present
- Preterite
- Future
- Imperfect (future phase)
- Present subjunctive (future phase)
-
Subject selection (multi-select):
- yo, tú, él/ella/usted, nosotros, vosotros, ellos/ellas/ustedes
- Pre-written templates for each verb with contextual sentences
- Template variables: {verb}, {subject}, {tense}, {context}
- Template library organized by:
- Tier level (simpler sentences for Tier 1)
- Verb type (reflexive templates different from non-reflexive)
- Multiple templates per verb for variety
Example templates:
{
"HABLAR": {
"tier": 1,
"templates": [
{
"spanish": "{subject} {verb} español todos los días.",
"english": "{subject_en} speak Spanish every day.",
"context": "daily"
},
{
"spanish": "{subject} {verb} con {mi/tu/su} familia.",
"english": "{subject_en} speak with {my/your/their} family.",
"context": "family"
}
]
}
}- Conjugate verbs based on tense and subject
- Handle regular patterns (-ar, -er, -ir)
- Handle irregular verbs with lookup tables
- Handle stem changes (e→ie, o→ue, e→i)
- Handle reflexive pronouns (me, te, se, nos, os, se)
- Handle spelling changes (preterite vowel changes)
Data structure:
{
"HABLAR": {
"present": {
"yo": "hablo",
"tú": "hablas",
// ... etc
},
"preterite": {
"yo": "hablé",
// ... etc
}
}
}- Generate Anki-formatted cards based on selections
- Cloze format:
Yo {{c1::hablo}} español. [TAB] I speak Spanish. [TAB] HABLAR [TAB] tier:1 - Translation format:
Yo hablo español. [TAB] I speak Spanish. [TAB] HABLAR [TAB] tier:1 - Include metadata: verb infinitive, tier, tags in additional fields
- Support images: Allow image filenames in output for manual Anki import
- Generate TSV file with proper tab separators
- Download file with timestamp in filename
- Preview output before download
- Copy to clipboard option
- Export statistics: number of cards by type, verbs included, etc.
spanish-verb-anki/
├── index.html # Main application
├── css/
│ ├── pico.min.css # Pico CSS framework
│ └── custom.css # Custom styles
├── js/
│ ├── main.js # Application entry point
│ ├── parser.js # TSV and tag parsing
│ ├── conjugator.js # Verb conjugation engine
│ ├── templates.js # Sentence templates
│ ├── generator.js # Card generation logic
│ ├── exporter.js # TSV export functionality
│ └── ui.js # UI interactions and state management
├── data/
│ ├── verbs.tsv # The 42-verb list
│ ├── conjugations.json # Pre-computed conjugations
│ └── templates.json # Sentence templates
└── README.md # Usage instructions
1. Load verbs.tsv → Parse into objects → Display in UI
2. User selects filters → Filter verb list → Update display
3. User selects card types/tenses → Generate cards → Preview
4. User clicks export → Format as TSV → Download file
class VerbParser {
static parseTSV(tsvContent) {
// Parse TSV file into array of verb objects
}
static parseTags(tagString) {
// Parse semicolon-separated key:value tags
// Returns: { tier: '1', 'word-type': 'verb', ... }
}
static validateVerb(verbObject) {
// Ensure required tags present
}
}class Conjugator {
constructor(conjugationsData) {
// Load pre-computed conjugations
}
conjugate(infinitive, tense, subject) {
// Return conjugated form
// Handle regular patterns if not in lookup
}
getReflexivePronoun(subject) {
// Return me, te, se, nos, os, se
}
isIrregular(infinitive, tense) {
// Check if verb is irregular in tense
}
}class TemplateEngine {
constructor(templatesData) {
// Load sentence templates
}
getSentence(verb, tense, subject, templateIndex = 0) {
// Return { spanish, english } with substitutions
}
substituteVariables(template, verb, tense, subject) {
// Replace {verb}, {subject}, etc.
}
getTemplateCount(verb) {
// Return number of available templates
}
}class CardGenerator {
constructor(conjugator, templateEngine) {
this.conjugator = conjugator;
this.templates = templateEngine;
}
generateClozeCard(verb, tense, subject, templateIndex) {
// Return Anki cloze card object
}
generateTranslationCard(verb, tense, subject, direction, templateIndex) {
// direction: 'es-en' or 'en-es'
}
generateConjugationCard(verb, tense, subject) {
// Infinitive + tense/subject → conjugated form
}
generateBatch(verbs, settings) {
// Generate all selected cards
}
}class AnkiExporter {
static formatClozeCard(card) {
// Format as TSV line for Anki cloze note type
}
static formatTranslationCard(card) {
// Format as TSV line for Anki basic note type
}
static generateTSV(cards) {
// Combine all cards into TSV format
}
static download(content, filename) {
// Trigger browser download
}
static copyToClipboard(content) {
// Copy to clipboard
}
}class UIManager {
constructor() {
this.verbs = [];
this.selectedVerbs = new Set();
this.settings = this.getDefaultSettings();
}
loadVerbs(tsvContent) {
// Parse and display verbs
}
applyFilters() {
// Filter verb display based on tier, regularity, etc.
}
toggleVerbSelection(verbId) {
// Add/remove verb from selected set
}
updatePreview() {
// Show preview of generated cards
}
exportCards() {
// Generate and download TSV
}
}- App title: "Spanish Verb Anki Deck Generator"
- Brief description
- Load TSV button (for custom verb lists)
<aside>
<h3>Filters</h3>
<fieldset>
<legend>Learning Tier</legend>
<label><input type="checkbox" checked> Tier 1 (10)</label>
<label><input type="checkbox"> Tier 2 (10)</label>
<label><input type="checkbox"> Tier 3 (12)</label>
<label><input type="checkbox"> Tier 4 (10)</label>
</fieldset>
<fieldset>
<legend>Regularity</legend>
<label><input type="checkbox" checked> Regular</label>
<label><input type="checkbox" checked> Irregular</label>
<label><input type="checkbox" checked> Highly Irregular</label>
</fieldset>
<fieldset>
<legend>Verb Type</legend>
<label><input type="checkbox" checked> -ar verbs</label>
<label><input type="checkbox" checked> -er verbs</label>
<label><input type="checkbox" checked> -ir verbs</label>
</fieldset>
<fieldset>
<legend>Special</legend>
<label><input type="checkbox"> Reflexive only</label>
<label><input type="checkbox"> Non-reflexive only</label>
</fieldset>
</aside>- Table with columns: [✓] Verb | English | Tier | Tags
- Clickable rows to select/deselect
- "Select All" / "Clear All" buttons
- Count: "15 verbs selected"
<section>
<h3>Card Settings</h3>
<fieldset>
<legend>Card Types</legend>
<label><input type="checkbox" checked> Cloze Deletion</label>
<label><input type="checkbox"> Translation (ES→EN)</label>
<label><input type="checkbox"> Translation (EN→ES)</label>
<label><input type="checkbox"> Conjugation Practice</label>
</fieldset>
<fieldset>
<legend>Tenses</legend>
<label><input type="checkbox" checked> Present</label>
<label><input type="checkbox"> Preterite</label>
<label><input type="checkbox"> Future</label>
</fieldset>
<fieldset>
<legend>Subjects</legend>
<label><input type="checkbox" checked> yo</label>
<label><input type="checkbox" checked> tú</label>
<label><input type="checkbox"> él/ella/usted</label>
<label><input type="checkbox"> nosotros</label>
<label><input type="checkbox"> vosotros</label>
<label><input type="checkbox"> ellos/ellas/ustedes</label>
</fieldset>
<button onclick="generatePreview()">Preview Cards</button>
</section>- Card count: "127 cards will be generated"
- Preview first 5-10 cards in scrollable box
- Export buttons:
- "Download TSV"
- "Copy to Clipboard"
- Statistics: Cards by type, verbs included
Use the refactored verb list with key-value pair tags
Pre-computed conjugations for all 42 verbs in present, preterite, future:
{
"HABLAR": {
"infinitive": "hablar",
"english": "to speak",
"present": {
"yo": "hablo",
"tú": "hablas",
"él/ella/usted": "habla",
"nosotros": "hablamos",
"vosotros": "habláis",
"ellos/ellas/ustedes": "hablan"
},
"preterite": {
"yo": "hablé",
"tú": "hablaste",
"él/ella/usted": "habló",
"nosotros": "hablamos",
"vosotros": "hablasteis",
"ellos/ellas/ustedes": "hablaron"
},
"future": {
"yo": "hablaré",
"tú": "hablarás",
"él/ella/usted": "hablará",
"nosotros": "hablaremos",
"vosotros": "hablaréis",
"ellos/ellas/ustedes": "hablarán"
}
}
}Sentence templates organized by verb:
{
"HABLAR": [
{
"spanish": "{subject} {verb} español todos los días.",
"english": "{subject_en} speak{s} Spanish every day.",
"time_marker": "todos los días",
"difficulty": 1
},
{
"spanish": "{subject} {verb} con mi familia.",
"english": "{subject_en} speak{s} with my family.",
"time_marker": null,
"difficulty": 1
}
],
"LLAMARSE": [
{
"spanish": "{subject} {reflexive} {verb} {name}.",
"english": "{subject_en} {verb_en} {name}.",
"context": "identity",
"difficulty": 2
}
]
}- Set up HTML structure with Pico CSS
- Implement TSV parser
- Implement tag parser with key-value pairs
- Display verb list in table
- Create conjugations.json for all 42 verbs (can be generated programmatically)
- Implement conjugator.js
- Create templates.json with 2-3 templates per verb
- Implement template engine with variable substitution
- Handle reflexive pronouns
- Test conjugations against known correct forms
- Implement cloze card generation
- Implement translation card generation (both directions)
- Implement conjugation drill cards
- Add card preview functionality
- Test with sample selections
- Implement filter panel with live filtering
- Implement verb selection (individual + batch)
- Implement card settings panel
- Implement TSV export with download
- Implement copy-to-clipboard
- Add statistics display
- Test with all tier combinations
- Validate TSV imports into Anki
- Create Anki note type templates (documentation)
- Write user documentation
- Handle edge cases (no verbs selected, etc.)
- Add localStorage for settings persistence
- .apkg file generation (requires library like genanki.js)
- AI-generated sentences via API calls
- Audio file integration (TTS or pre-recorded)
- Image association system
- Progress tracking (localStorage/IndexedDB)
- Browser-based flashcard practice
- Immediate feedback on answers
- Spaced repetition algorithm
- Statistics dashboard
- Study session history
- Chat interface for practice
- Context-aware verb usage
- Correction and explanation
- Conversational scenarios
- Target: Modern browsers (Chrome, Firefox, Safari, Edge)
- Use ES6+ features (modules, arrow functions, classes)
- No transpilation needed for modern browsers
- Fallbacks for older browsers not required
- All processing client-side
- No server calls required (except future AI features)
- TSV parsing should handle 100+ verbs easily
- Card generation should be near-instant (<1 second for 500 cards)
- Validate TSV format on load
- Validate required tags present
- Validate conjugations exist for selected tenses
- Warn user if selections result in 0 cards
- Graceful degradation if conjugation missing
- User-friendly error messages
- Console logging for debugging
- Validation before export
- Semantic HTML
- ARIA labels where needed
- Keyboard navigation support
- High contrast mode compatible
Key aspects to reference:
- Browser-side architecture patterns
- TTS implementation (for future audio)
- UX patterns and user flow
- File handling and export mechanisms
- State management approach
Key aspects to reference:
- Conversational AI integration patterns
- Spanish language handling
- User interaction patterns
- Any verb conjugation logic present
Fields:
- Text (with {{c1::word}})
- Extra (English translation)
- Verb (infinitive)
- Tags (tier, regularity, etc.)
Card Template:
Front: {{cloze:Text}}
Back: {{cloze:Text}}<br>{{Extra}}
Fields:
- Front (Spanish or English)
- Back (English or Spanish)
- Verb (infinitive)
- Tags
Card Template:
Front: {{Front}}
Back: {{Back}}
Fields:
- Prompt (Infinitive + tense + subject)
- Answer (conjugated form)
- Example (sentence using the form)
- Tags
Card Template:
Front: {{Prompt}}
Back: {{Answer}}<br><br>{{Example}}
- Open Anki
- File → Import
- Select downloaded TSV file
- Choose appropriate Note Type
- Map fields correctly
- Import
- Parse TSV correctly
- Parse all tag formats
- Conjugate all regular -ar verbs correctly
- Conjugate all regular -er verbs correctly
- Conjugate all regular -ir verbs correctly
- Handle all irregular verbs correctly
- Handle all stem changes correctly
- Handle all reflexive verbs correctly
- Generate cloze cards with correct format
- Generate translation cards correctly
- Export TSV with proper escaping
- Filter verbs by tier
- Filter verbs by regularity
- Filter verbs by type
- Select all / clear all works
- Card preview updates correctly
- Export produces valid TSV
- Import into Anki successfully
- Cards display correctly in Anki
- UI is intuitive
- Filter controls are clear
- Preview shows representative cards
- Export is fast (<2 seconds)
- File downloads with good filename
- Instructions are clear
- ✅ User can load verb list
- ✅ User can filter by tier, regularity, type
- ✅ User can select verbs individually or in batch
- ✅ User can choose card types and tenses
- ✅ App generates accurate Anki-formatted cards
- ✅ User can preview cards before export
- ✅ User can download TSV file
- ✅ TSV imports cleanly into Anki
- ✅ Cards are pedagogically sound (progressive difficulty)
- ✅ UI is clean, fast, and intuitive
-
Template variety: How many templates per verb? (Suggest 2-3 for Phase 1)
-
Conjugation fallback: If conjugation missing, generate algorithmically or show error? (Suggest error for Phase 1, since all 42 will be pre-computed)
-
Card ordering: Should exported cards be:
- Grouped by verb?
- Grouped by tense?
- Mixed randomly?
- User selectable?
-
Settings persistence: Save user's filter/card preferences in localStorage?
-
Multiple templates: Should user be able to:
- Get all templates (multiple cards per verb)?
- Choose specific template index?
- Random selection?
-
Vosotros inclusion: Include by default or make it opt-in? (Many learners skip vosotros)
# No build tools required for Phase 1
# Simply open index.html in browser
# Recommended: Use VS Code with Live Server extension
# or simple Python server:
python3 -m http.server 8000
# Navigate to: http://localhost:8000Provide Windsurf with:
- This design document
/Users/jeff/coding/apg-web(reference for patterns)/Users/jeff/coding/hablabot(reference for ideas)- The 42-verb TSV file with key-value tags
- Example Anki TSV output format
When starting with Windsurf, clarify:
- Should we generate conjugations.json programmatically or hand-craft it?
- How many sentence templates per verb for Phase 1?
- Should we include all 6 subjects or make vosotros optional?
- Default settings: what should be checked by default?
- Card ordering preference in export?
- Should we add any image placeholders in Phase 1?
User can generate a complete Anki deck of their Tier 1 verbs (10 verbs) with cloze deletion cards for present tense, all subjects, export as TSV, import into Anki, and successfully study the cards.
Estimated timeline: 4-5 weeks part-time development Lines of code: ~2000-3000 (including data files) Complexity: Medium (straightforward logic, some linguistic edge cases)