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

references/spaced-repetition.md

View on GitHub
# Review & spaced repetition (how the tutor schedules revisits)

CodeTrain remembers what a learner struggled with and resurfaces it at widening
intervals — so a weak concept gets re-practised right before it would fade, then
less and less often as it sticks. `app/profile.py` applies all of this; you only
report results (see SKILL.md, "Memory & progress"), and you never read `profile.json`.

## The gap record

Each recurring trouble spot lives in `profile.json`'s `gaps` array as an object:

```jsonc
{
  "concept": "closures capture by reference",  // short + specific
  "lang": "javascript",
  "due": "2026-06-25",        // ISO date — resurface on/after this day
  "interval_days": 2,          // current spacing
  "ease": 2.0,                 // difficulty multiplier, 1.3 (hard) … 2.6 (easy)
  "last_seen": "2026-06-23"
}
```

A bare **string** in `gaps` (legacy) means "due now, no history": treat it as a gap
with `interval_days: 1`, `ease: 2.0`, `due` = today, and upgrade it to the object
form the next time you touch it. Keep `gaps` small (cap ~12 — drop the oldest that's
been mastered).

## Scheduling (SM-2-lite — applied by `ctl.sh profile-update`)

"Due" means `due` ≤ today (UTC date). After a review, update the gap:

- **New gap** (a concept the learner just struggled with): add it with
  `interval_days: 1`, `ease: 2.0`, `due` = tomorrow, `last_seen` = today.
- **Reviewed & solid** (passed the drill with ≤1 hint and could explain it back):
  `ease = min(2.6, ease + 0.15)`;
  `interval_days = max(1, round(interval_days × ease))`;
  `due` = today + interval_days; `last_seen` = today.
- **Reviewed & shaky** (needed several hints, retried, or couldn't explain it):
  `ease = max(1.3, ease − 0.2)`; `interval_days = 1`; `due` = tomorrow;
  `last_seen` = today.
- **Mastered** (came back solid with `interval_days` already ≥ ~21): drop it from
  `gaps` and add the concept to `strengths`.

## Review / drill mode

Triggered by "review my weak spots", "drill me", "spaced review", "what should I
revisit" — or offered at session start when gaps are due.

1. Run `bash $SKILL_DIR/app/ctl.sh profile`; its `due_gaps` are the **due** gaps, oldest first.
2. Pick the 1–3 most-overdue concepts (oldest `due` first). Author a short
   **sandbox** session: one tiny step per concept, each a **fresh** micro-drill on
   that idea (a new angle — not a replay of the old exercise). Set the `profile`
   welcome to name the count ("2 topics are due — quick drill?").
3. Run the normal steps / patch / run loop. After each drill, judge solid vs shaky.
4. At teardown, list each reviewed gap as `solid` or `shaky` in `reviewed`, and any new
   trouble spots in `new_gaps`, of `.tutor/profile-delta.json`; `ctl.sh profile-update`
   applies the rule above.

If gaps are due but the user asked for a *specific* lesson, don't hijack it: either
weave one due concept in as the warm-up first step, or mention it once ("heads-up:
`closures` is due for review — say 'drill me' anytime") and continue. Never nag;
offer at most once per session.

## Worked example

`{"concept":"list vs generator","lang":"python","due":"2026-06-23","interval_days":3,"ease":2.0,"last_seen":"2026-06-20"}`
is due today.

- Learner nails the drill with no hints → `ease 2.0 → 2.15`,
  `interval_days = round(3 × 2.15) = 6`, `due = 2026-06-29`. Next revisit a week out.
- Learner struggles → `ease 2.0 → 1.8`, `interval_days = 1`, `due = 2026-06-24`
  (tomorrow). It comes back fast until it sticks.
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: 472kUpdated 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