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/capstone/exercise/main.go
View on GitHubpackage main
import (
"context"
"os"
"os/signal"
"syscall"
)
// main is the only function in this program that knows a process exists. It
// resolves the real world — signals, the environment, the user's config
// directory, whether stdout is a terminal — hands all of it to App, and turns
// the code Execute returns into the process exit status.
//
// Everything below this file is reachable from a test without a subprocess.
func main() {
ctx, stop := notifyContext(context.Background())
defer stop()
configDir, err := os.UserConfigDir()
if err != nil {
// No config directory on this machine (some containers, odd
// environments). Defaults, environment and flags still work.
configDir = ""
}
app := &App{
Getenv: os.Getenv,
ConfigDir: configDir,
Git: []string{"git"},
StdoutIsTerminal: isTerminal(os.Stdout),
}
os.Exit(Execute(ctx, app, os.Args[1:], os.Stdout, os.Stderr))
}
// notifyContext returns a context cancelled by the first Ctrl-C (SIGINT) or by
// SIGTERM — the signal a service manager or `kill` sends to ask a process to
// stop. The returned stop() restores the default handlers, so a second Ctrl-C
// kills the process outright even if shutdown wedges: graceful shutdown must
// never trap the user.
//
// Nothing slow happens here on purpose. A signal handler runs while the program
// is in an unknown state; the only safe thing to do in one is to flip a switch —
// here, cancel a context — and let ordinary code notice.
func notifyContext(parent context.Context) (context.Context, context.CancelFunc) {
return signal.NotifyContext(parent, os.Interrupt, syscall.SIGTERM)
}
// isTerminal reports whether f is attached to a terminal rather than a pipe or
// a file. The character-device check is the stdlib-only answer from the
// terminal-UX lesson; golang.org/x/term.IsTerminal is the precise one.
func isTerminal(f *os.File) bool {
info, err := f.Stat()
if err != nil {
return false
}
return info.Mode()&os.ModeCharDevice != 0
}
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 |