So I vibecoded a [userscript] - Introducing WaniKani Ushi

Hello ladies and gentlemen. Procrastination has led me to making scripts instead of doing reviews.

So here I am, introducing WaniKani Ushi.

TLDR: Wanikani Ushi invokes Gemini API to build personalized grammar lessons and text comprehension lessons based on your studied material on WaniKani. (Too Short Want to Read More section is at the end.)

Get it on Greasyfork.

Dependency on WKOF.

To use this widget, you will have to get a Gemini API key, which should be available to free users and you can generate one in the Google AI studio.

How to use it

After installing, the widget will be displayed under the “Level Progress” widget. If you don’t have that in the page, it should be either on the top or the bottom:

  1. Click the “Settings” wheel and fill in your read-only Wanikani API key and Gemini API key.
  2. In the settings, you can also choose various options for the lesson, such as which Kanji and Vocab will be used, if you want to only focus on leeches, and which JLPT grammar levels should be considered when creating the lessons. Recent focuses only on your last 3 levels (And excludes items you have not seen in lessons on your current level yet).

  1. When you are done, click Save & Reload.
  2. On the main page, you should now see your Username and level, and the “Scan Progress” becomes available. Let’s click it.
  3. When progress is scanned, you will see how many items will be considered for the lesson. DISCLAIMER: Using more than 3000 items at once can bloat the prompt and present wildly inconsistent results.
  4. You will also see 2 options:
    1. “Generate Grammar Lesson”
      1. Creates a multiple-choice single sentence lesson where you have to choose the correct grammar structure for each sentence.
    2. “Generate Short Story”
      1. Generates a short story for you to read and answer questions about

  1. Generating a lesson takes about a minute, and when ready, you can start! For each question, select the correct answer from A to D.

  1. After finishing the quiz, you can review your answers, get some stats, and do it all again!

Is it perfect? No - especially since we’re using prompts to generate lesson content, the results will be wildly inconsistent. Even though I tried to include some constraints in the prompt to ensure that it will be as stable as possible, I can’t guarantee the results. One of the big issues I tried to fix was that sometimes two options in the grammar quiz could be considered correct, but I can’t guarantee that it will not happen.

Looking forward to your feedback!

TSWtRM (Too Short Want to Read More): I always found it a bit frustrating when I encountered a wild Kanji or vocab that I had either never seen, or thought I had never seen only to realize that I just forgot. Also got quite annoyed to have a second tab open and google stuff all the time, losing context of what’s going on in whatever I was reading (ADHD yayyy!). This, of course, would only get more frustrating with increasing difficulty of the text I was reading.

That’s when I though - Hey, it would be nice if there was a utility allowing you to create lessons based just on things that you already studied on WaniKani. And since I didn’t find one and we live in the age of AI, I thought I could just make it and also see what AI can do these days. Original plan was to keep it just for myself, but I find it quite useful and wanted to share.

I used Gemini CLI to make the script, so it’s probably not the most pretty or efficient code under the sun (For example Gemini chose to use React, having to include everything in the script, instead of JavaScript which I thought would be better, but I really wanted just to give instructions and let the agent do it’s thing. Here is a GitHub repo for anyone interested in going through the guts of the project.

If you read all the way until here, first of all, thank you for your interest. I hope this can be of some use, so enjoy and let me know your feedback if possible!

7 Likes

this looks extremely cool! i added it and enjoyed the first few tries of ‘generate a short story’ - thank you for making it, i’m going to keep giving it a shot :slight_smile:

1 Like

This is actually pretty fun, thank you for taking the time to make it! Some of the AI generated sentences are pretty ridiculous (“He baked candy while counting the balls,” stood out), but it works for recall in context, which I really appreciate :slight_smile:

1 Like