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/solution/progress.go
View on GitHubpackage main
import (
"fmt"
"io"
)
// EraseLine clears from the cursor to the end of the line. It is cursor
// control rather than color, so NO_COLOR has no say over it — but a stream
// that is not a terminal must never see it, because nothing there interprets
// escape sequences.
const EraseLine = "\x1b[K"
// Progress reports how far a long-running operation has got. It is driven by
// explicit Update calls from the work loop, not by a timer, so the same code
// produces the same bytes on every run.
type Progress struct {
w io.Writer
isTerminal bool
label string
total int
n int
}
// NewProgress builds a Progress over w — in a real program the diagnostic
// stream, so that progress never contaminates piped data. A total of 0 or less
// means "unknown length": report a running count instead of a percentage.
//
// Pass io.Discard as w to switch progress off in quiet mode.
func NewProgress(w io.Writer, isTerminal bool, label string, total int) *Progress {
return &Progress{w: w, isTerminal: isTerminal, label: label, total: total}
}
// Update records that n items are done and redraws the status line. Off a
// terminal it writes nothing: a redraw needs a cursor, and a log file has none.
func (p *Progress) Update(n int) {
p.n = n
if !p.isTerminal {
return
}
// Carriage return first, erase-to-end-of-line last, so a shorter line can
// never leave the tail of a longer one on screen.
fmt.Fprintf(p.w, "\r%s%s", p.status(), EraseLine)
}
// Done finishes the operation with a summary line that stays on screen.
func (p *Progress) Done() {
summary := fmt.Sprintf("%s: done (%d)", p.label, p.n)
if p.total > 0 {
summary = fmt.Sprintf("%s: done (%d/%d)", p.label, p.n, p.total)
}
if p.isTerminal {
fmt.Fprintf(p.w, "\r%s%s\n", summary, EraseLine)
return
}
fmt.Fprintln(p.w, summary)
}
func (p *Progress) status() string {
if p.total <= 0 {
return fmt.Sprintf("%s: %d", p.label, p.n)
}
return fmt.Sprintf("%s: %d/%d (%d%%)", p.label, p.n, p.total, p.n*100/p.total)
}
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: 470k | 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 |