cd /news/artificial-intelligence/knitpurrcode-teaching-programming-wi… · home › topics › artificial-intelligence › article
[ARTICLE · art-178073] src=dev.to ↗ pub= topic=artificial-intelligence verified=true sentiment=↑ positive

KnitPurrCode: teaching programming with yarn blocks, with the teacher in the loop 🧶🐱

Two Industrial Electronics and Automation Engineering students, Alba and John of Universitat Rovira i Virgili, built KnitPurrCode, a Moodle-style virtual classroom for learning to program with a yarn-themed block editor that maps to real C, C++, Python and JavaScript code. The system pairs a student-side AI tutor, MichiCode, that gives progressive hints instead of solutions with teacher-side live screen mirroring, git-style submission history and a class assistant, backed by a custom Python lexer, parser and interpreter, Supabase Realtime with row-level security, and input/output guardrail filters. The team reported over 300 automated tests plus Playwright end-to-end tests, and built the project at HackEPS 2026 for the JetBrains no-code/low-code challenge.

recommendation

Pair tutor prompts with a code-level output filter that rejects any response containing the solution, since prompting alone failed to prevent answer leakage.

more in playbook: Verifying model output
by read4 min views9 publishedNov 29, 2026

Programming is like knitting: stitch by stitch, with your teacher by your side.

🌐 **Live demo:** [https://knitpurrcode.vercel.app](https://knitpurrcode.vercel.app)

💻 **Code:** [https://github.com/juniorgp-glitch/KnitPurrCode](https://github.com/juniorgp-glitch/KnitPurrCode)

We're Alba and John, two Industrial Electronics and Automation Engineering students at Universitat Rovira i Virgili (URV). At HackEPS 2026 we took on the JetBrains "No code / Low code" challenge: help people learn programming without writing code from scratch, with the teacher in the loop.

#

The problem 🤔

Most AI tools for learning to code are a 1:1 chatbot that gives students the answer, as if the teacher didn't exist. But real teaching happens in a classroom. A good teacher notices that half the class is stuck on the same point, explains it again in a different way, and knows who needs a push and who needs help.

So we asked ourselves: how do we make the teacher a better teacher, not just the student a faster copier?

#

What we built 🧶

KnitPurrCode is a Moodle-style virtual classroom with two sides.

For students: yarn blocks that are real code

  • A block editor shaped like yarn . Every blockis real code, inC, C++, Python and JavaScript , with the same blocks and colours in all four.
  • Blocks are tied to the program with a yarn thread , nested blocks braid into their parent, and errors show up asknots 🪢.
  • Blocks and code are always the same program: switch views at any time and see exactly what you built.
  • Real execution: an interactive terminal, automatic grading with hidden tests and a step-by-step debugger with breakpoints.

MichiCode 🐱, a crocheting-cat AI tutor thatteaches without solving : progressive hints, never the answer. Ask it for the solution and it gets angry, and your teacher finds out.

For teachers: watching the class live

  • A red "Online" button shows who is coding right now.
  • One click opens a live mirror of the student's screen , with the lines they just wrote highlighted in green.
  • When a student leaves, the teacher gets a notice and moves straight to their git-style version history : every submission compared with the previous one, so you seehow they got there.
  • A teacher assistant answers questions like "who is stuck?" or "most common errors" from real class data. It gives the teacher a read on the class, not a decision already made.

#

How it works under the hood ⚙️

Our own code engine in Python: a lexer, parser, checker and interpreter for C/C++, written during the hackathon. Python and JavaScript areparsed (withast andesprima ) into the same block tree and run in a sandbox with step, output and recursion limits. #

Live supervision: the student's editor sends its state toPOST /api/live (debounced, plus a 15-second heartbeat). The server compiles it and saves it, andSupabase Realtime pushes the changeonly to that class's teacher , enforced byRow Level Security . When the student closes the page, akeepalive request tells the teacher within seconds. #

AI with guardrails: prompting alone wasn't enough to stop the tutor from giving away answers. So there's aninput filter (prompt injection, harmful requests, insults, requests for the solution) and anoutput filter written in code that discards any answer containing the solution.

  • More than 300 automated tests , plus end-to-end tests with Playwright against production.

#

Keeping ourselves in the loop 🤖

We built KnitPurrCode in PyCharm with JetBrains Air, working with AI coding agents while we reviewed, steered and rejected their changes. Our app keeps the teacher in the loop, and we tried to keep ourselves in the loop with the agents in the same way.

We also ran a small experiment: Claude Agent, Codex and Junie got the same five tasks on our own codebase (explain the code, find bugs, write a test, give a student a hint without the fix, review accessibility). Then we ran every claim they made:

  • All 10 moderation bugs they reported were real, so we fixed them and added regression tests.
  • None of them gave the "student" the solution, but one came close. That confirmed our design: the "don't solve it" rule has to be enforced in code, not just asked for in the prompt.
  • One agent couldn't even run Python in its session and still sounded completely sure of itself. Checking what the agents say is our job.

Full report: [docs/model-comparison.md (https://github.com/juniorgp-glitch/KnitPurrCode/blob/main/docs/model-comparison.md)

#

What we learned 📚

  • "Teach, don't solve" is a design constraint , not a prompt: it shapes the UI, the hints, the filters and the teacher's view.
  • Realtime + Row Level Security works really well for classrooms.
  • Keeping blocks and code in sync is much easier when both views come from the same syntax tree.

#

What's next 🚀

  • 📱 Mobile and desktop apps on the same backend, with offline practice.
  • 🧠 Tutoring with memory across sessions , and error patterns across the whole class.
  • 🔌 A JetBrains IDE plugin to go from blocks to a real IDE.
  • 🏫 Pilots in real schools.

#

  Try it! 🐾

👉 [https://knitpurrcode.vercel.app](https://knitpurrcode.vercel.app)
  • Teacher: marta.vidal@knitpurrcode.com

  • Student: aina.costa@knitpurrcode.com

  • Password: Demo1234 Open each one in a different browser tab and watch the live view work. We'd love your feedback! 💬

Made with 🧶 and lots of ☕ by Alba De Vicente Companys & John Jairo Gutierrez Posada at HackEPS 2026.

── more in #artificial-intelligence 4 stories · sorted by recency
── more on @knitpurrcode 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/knitpurrcode-teachin…] indexed:0 read:4min 2026-11-29 · —