qtsone/learning / skills/tutor
tutor
FlaggedTurn this agent into a personal programming tutor with a versioned 0-to-expert curriculum (Go available; more languages coming). Use when the user wants to learn a programming language, start or resume lessons, get their exercise code graded, check learning progress, or contribute curriculum fixes — e.g. "/tutor go", "/tutor resume", "teach me Go", "continue my lessons", "grade my exercise".
curriculum/content/focus/cli-tooling/terminal-ux/exercise/progress_test.go
View on GitHubpackage main
import (
"bytes"
"strings"
"testing"
)
func TestProgressOnTerminal(t *testing.T) {
var buf bytes.Buffer
p := NewProgress(&buf, true, "checking", 10)
p.Update(3)
p.Update(10)
p.Done()
want := "\rchecking: 3/10 (30%)\x1b[K" +
"\rchecking: 10/10 (100%)\x1b[K" +
"\rchecking: done (10/10)\x1b[K\n"
if buf.String() != want {
t.Errorf("progress =\n%q\nwant\n%q", buf.String(), want)
}
}
func TestProgressWhenPiped(t *testing.T) {
var buf bytes.Buffer
p := NewProgress(&buf, false, "checking", 10)
p.Update(3)
p.Update(10)
if buf.Len() != 0 {
t.Errorf("after two updates piped output = %q, want nothing before Done", buf.String())
}
p.Done()
want := "checking: done (10/10)\n"
if buf.String() != want {
t.Errorf("progress = %q, want %q", buf.String(), want)
}
if strings.ContainsAny(buf.String(), "\r\x1b") {
t.Errorf("piped progress = %q, want no carriage returns or escape sequences", buf.String())
}
}
func TestProgressUnknownTotal(t *testing.T) {
var tty, piped bytes.Buffer
pt := NewProgress(&tty, true, "reading", 0)
pt.Update(7)
pt.Done()
if want := "\rreading: 7\x1b[K" + "\rreading: done (7)\x1b[K\n"; tty.String() != want {
t.Errorf("terminal progress =\n%q\nwant\n%q", tty.String(), want)
}
pp := NewProgress(&piped, false, "reading", 0)
pp.Update(7)
pp.Done()
if want := "reading: done (7)\n"; piped.String() != want {
t.Errorf("piped progress = %q, want %q", piped.String(), want)
}
}
func TestProgressPercentIsFloored(t *testing.T) {
cases := []struct {
n, total int
want string
}{
{1, 3, "\rwork: 1/3 (33%)\x1b[K"},
{2, 3, "\rwork: 2/3 (66%)\x1b[K"},
{0, 4, "\rwork: 0/4 (0%)\x1b[K"},
}
for _, c := range cases {
var buf bytes.Buffer
p := NewProgress(&buf, true, "work", c.total)
p.Update(c.n)
if buf.String() != c.want {
t.Errorf("Update(%d) of %d = %q, want %q", c.n, c.total, buf.String(), c.want)
}
}
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| 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: 471k | Updated | Claude CodeCodex | Verified | Install |
| 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: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| 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 available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |