A workbench for the Codewars kata trainer: an AI tutor that hints instead of solving, in-place kata translation, real formatters for C, C++, Python, Kotlin and Rust, a trainer laid out for the code rather than the chrome, and a practice history on the dashboard.
A workbench for the Codewars kata trainer. Three things it adds, and a lot of small repairs to the page around them.
A collapsible sidebar backed by any OpenAI-compatible endpoint — yours, not mine. It is prompted to work out which layer you are stuck on and answer only that one: misread requirement, missing building block, approach that cannot work, right approach with a bug, or an error message that means nothing to you. It will not hand over a solution, and says so rather than quietly complying.
Context is pointed at rather than configured. Select code in either editor, or text in the description, and an Ask button appears over the selection; it becomes a chip on the composer. The test output carries its own button, so a failing run reaches the conversation without being retyped. The kata description, your current code and the last run's output travel along on every turn, rebuilt each time so the model sees the code as it is now rather than as it was when you started.
Replies stream. Esc stops one mid-flight. Alt+A opens the panel, as does the edge
tab or a swipe in from the right.
One press in the panel header rewrites the description into your language; another puts the original back. Code blocks, inline code and identifiers are left alone. Fragments land as they arrive rather than all at the end, and the result is cached per kata.
Two-space indentation, int* p, attached braces, four-space continuations, case one
level in from switch. It runs on Alt+Shift+F, once when you open a kata, and once
before test, attempt and submit. One Ctrl+Z undoes a format.
It lexes before it formats, so operators inside strings and comments are left alone.
Deliberate limits, so you know where the edges are:
The trainer's top strip folds away: the page title names the page you are already on, and the account bar is not something you open mid-kata, so it moves into a menu behind your avatar, which now sits with the VIM / EMACS / fullscreen controls at matching size. Codewars' own nodes are moved rather than rebuilt, so the theme toggle, the notification drawer and the profile links keep working. The reclaimed strip goes to the editor.
The description column sizes to its content, so a short kata no longer leaves a tall empty card under the text while a long one still scrolls.
Also: promotion and house-ad blocks hidden, Maple Mono when you have it installed,
line wrapping and tuned editor typography, C autocomplete over your own identifiers and
#define names, Tab inserts two spaces, an optional symbol bar for tablets, and small
typing sparks you can turn off.
The panel reads Codewars' own CSS variables instead of copying their values, so it follows the site's light and dark themes rather than fighting them.
Open settings from the panel header, or from your userscript manager's menu. You need a base URL, a key and a model name:
/v1. Tested
shapes: https://api.openai.com/v1, https://api.deepseek.com/v1,
https://openrouter.ai/api/v1, and a local http://localhost:11434/v1.Authorization header.Test checks the settings before you close the dialog. No temperature is sent; several current models reject any non-default value.
The script asks for @connect * because the endpoint is yours to choose, not because it
talks to anywhere else. Nothing is sent anywhere except the endpoint you configure.
Without a key the tutor and the translation are simply unavailable; the formatter, layout and typography work on their own.