Skip to content

InferHaven/agent-skills / codetrain

codetrain

Flagged

CodeTrain is an open-source Socratic coding tutor with a local lesson page where the learner writes every line while the agent sets small steps, gives hints and reviews the work without putting the solution into the lesson. Use when the user wants to be taught/walked through code one tiny step at a time — triggers like "teach me this code", "walk me through this", "hold my hand", "explain step by step", "tutor me", "guide me through", "I want to learn this", or asks for a safe practice exercise to learn a concept.

FileKindSize
LICENSEother11.1 KB
NOTICEother768 B
README.mdmarkdown22.7 KB
SKILL.mdskill md20.1 KB
app/answer_guard.pyscript7.8 KB
app/checkpoint-hook.shexecutablescript1.2 KB
app/ctl.shexecutablescript4.5 KB
app/install-permissions.pyscript6.8 KB
app/patch.pyexecutablescript4.1 KB
app/profile.pyexecutablescript9.3 KB
app/server.pyexecutablescript23.1 KB
app/static/Archivo.woff2binary88.0 KB
app/static/JetBrainsMono.woff2binary30.7 KB
app/static/app.jsscript57.1 KB
app/static/docklint.jsscript4.3 KB
app/static/editor.jsscript4.4 KB
app/static/fonts-OFL.txtmarkdown9.0 KB
app/static/glossary.jsscript50.8 KB
app/static/index.htmlother8.0 KB
app/static/js-worker.jsscript3.9 KB
app/static/liveness.jsscript1.8 KB
app/static/logo-anim.svgother1.9 KB
app/static/prism.jsscript20.6 KB
app/static/prose.jsscript18.8 KB
app/static/pyodide-worker.jsscript7.0 KB
app/static/runner.jsscript4.5 KB
app/static/sheet.cssother32.7 KB
app/static/styles.cssother51.4 KB
app/static/theme-toggle.jsscript9.5 KB
app/static/theme.jsscript5.2 KB
app/static/visuals.jsscript14.8 KB
app/watch.shexecutablescript2.5 KB
install.shexecutablescript2.0 KB
references/session-protocol.mdmarkdown19.6 KB
references/spaced-repetition.mdmarkdown3.4 KB
references/teach-on-diff.mdmarkdown2.5 KB

app/static/theme.js

View on GitHub
/* CodeTrain - the first-paint script. Loaded synchronously in <head> of every page, so <html>
   carries its theme and its paper BEFORE first paint (no flash). CSP-safe: a same-origin script
   (script-src 'self'), no inline code.

   It stamps three attributes, all read by web/sheet.css:
   - data-theme, the RESOLVED mode ("light" or "dark", never "system");
   - data-palette, the paper ("linen", "graphite", ...). No attribute means Blueprint, the default,
     so a visitor who never chose anything gets exactly the site as designed;
   - data-visitor="returning" once an account has been used in this browser, so every page can
     offer Dashboard instead of Start free before it paints, with no network call.

   `ct:returning` IS DECLARED HERE AND NOWHERE ELSE. It moved from auth.js (2026-11-18) because the
   public pages need it before first paint and never load auth.js; auth.js borrows it from here, so
   the dashboard's sign-up-or-sign-in choice and the rail read one answer.
   test_onboarding_entry.py refuses a second spelling anywhere under web/.

   One storage key each, for the whole site, so a choice made on the home page holds in the
   dashboard and on the lesson screen. web/theme-toggle.js is the one control that changes them. */
(function () {
  var KEY = "ct-app-theme"; // "system" | "light" | "dark"
  var PALETTE_KEY = "ct-app-palette";
  // The papers this site ships. A stored value that is no longer one of them (a paper retired, a
  // hand-edited key) falls back to the default rather than leaving the sheet without its colours.
  var PALETTES = ["blueprint", "linen", "graphite"];
  var DEFAULT_PALETTE = "blueprint";
  // "An account has been used in this browser": written the first time a dashboard page is reached
  // signed in. Storage blocked reads as "not returning", the safe direction: a stranger is the
  // common case on a fresh profile, and a returning learner offered Start free clicks once more.
  var RETURNING_KEY = "ct:returning";
  var mql = window.matchMedia ? window.matchMedia("(prefers-color-scheme: dark)") : null;
  // What "no stored choice yet" means, per page. The signed-in app follows the OS, which is the
  // respectful default for something you sit inside for an hour. The public pages opt out with
  // <html data-theme-default="dark"> because dark is the brand and a visitor arriving on a light
  // OS should still see the site as designed until they ask for otherwise. Once anyone picks a
  // mode the stored value wins everywhere and this stops mattering.
  function fallbackMode() {
    try {
      return document.documentElement.getAttribute("data-theme-default") || "system";
    } catch (e) { return "system"; }
  }
  function mode() {
    try { return localStorage.getItem(KEY) || fallbackMode(); } catch (e) { return fallbackMode(); }
  }
  function palette() {
    var p = null;
    try { p = localStorage.getItem(PALETTE_KEY); } catch (e) { /* blocked storage: the default */ }
    return PALETTES.indexOf(p) >= 0 ? p : DEFAULT_PALETTE;
  }
  function isReturning() {
    try { return localStorage.getItem(RETURNING_KEY) === "1"; } catch (e) { return false; }
  }
  function stampVisitor() {
    try {
      if (isReturning()) document.documentElement.setAttribute("data-visitor", "returning");
    } catch (e) {}
  }
  function markReturning() {
    try { localStorage.setItem(RETURNING_KEY, "1"); } catch (e) { /* private mode: offer Sign up again */ }
    stampVisitor();
  }
  function resolve(m) { return m === "system" ? (mql && mql.matches ? "dark" : "light") : m; }
  function apply() {
    var next = resolve(mode());
    var paper = palette();
    try {
      var root = document.documentElement;
      root.setAttribute("data-theme", next);
      if (paper === DEFAULT_PALETTE) root.removeAttribute("data-palette");
      else root.setAttribute("data-palette", paper);
    } catch (e) {}
    // Anything that has to repaint itself for the new theme or paper listens for this. CSS handles
    // itself; canvas does not: rain.js reads its colour ramp from the paper's tokens here.
    // Guarded: this runs from <head> before first paint, so on the very first call the document
    // may have no body yet and dispatching would throw on some engines.
    try {
      if (document.body) {
        document.dispatchEvent(new CustomEvent("ct:theme", { detail: { theme: next, palette: paper } }));
      }
    } catch (e) { /* CustomEvent unsupported: the ramp just stays as loaded */ }
  }
  function set(m) {
    try { localStorage.setItem(KEY, m); } catch (e) {}
    apply();
  }
  function setPalette(p) {
    if (PALETTES.indexOf(p) < 0) return;
    try {
      if (p === DEFAULT_PALETTE) localStorage.removeItem(PALETTE_KEY);
      else localStorage.setItem(PALETTE_KEY, p);
    } catch (e) {}
    apply();
  }
  function cycle() {
    var order = ["system", "light", "dark"];
    set(order[(order.indexOf(mode()) + 1) % order.length]);
  }
  apply();
  stampVisitor();
  // Follow the OS while in "system".
  if (mql && mql.addEventListener) mql.addEventListener("change", function () { if (mode() === "system") apply(); });
  window.ctTheme = {
    mode: mode, set: set, cycle: cycle, apply: apply,
    palette: palette, setPalette: setPalette, palettes: PALETTES.slice(),
    visitor: { isReturning: isReturning, mark: markReturning },
  };
})();
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall