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/files-processes/exercise/signal_test.go
View on GitHubpackage main
import (
"context"
"errors"
"fmt"
"testing"
"time"
)
func TestExitCodeFor(t *testing.T) {
cases := []struct {
name string
err error
want int
}{
{"success", nil, ExitOK},
{"plain failure", errors.New("boom"), ExitFailure},
{"cancelled", context.Canceled, ExitInterrupted},
{"deadline", context.DeadlineExceeded, ExitTimeout},
{"wrapped cancellation", fmt.Errorf("running step: %w", context.Canceled), ExitInterrupted},
{"wrapped deadline", fmt.Errorf("running step: %w", context.DeadlineExceeded), ExitTimeout},
{"step error", &StepError{Index: 2, Name: "build", Err: context.Canceled}, ExitInterrupted},
{"failed step", &StepError{Index: 2, Name: "build", Result: Result{ExitCode: 1}}, ExitFailure},
}
for _, c := range cases {
t.Run(c.name, func(t *testing.T) {
if got := ExitCodeFor(c.err); got != c.want {
t.Errorf("ExitCodeFor(%v) = %d, want %d", c.err, got, c.want)
}
})
}
}
func TestWithInterruptInheritsParent(t *testing.T) {
parent, cancelParent := context.WithCancel(context.Background())
ctx, stop := WithInterrupt(parent)
defer stop()
cancelParent()
select {
case <-ctx.Done():
case <-time.After(failsafe):
t.Fatal("cancelling the parent did not cancel the returned context — derive from parent")
}
if !errors.Is(ctx.Err(), context.Canceled) {
t.Errorf("ctx.Err() = %v, want context.Canceled", ctx.Err())
}
}
// failsafe bounds the tests that wait for a context to become done. It is not
// synchronisation — every wait below is expected to finish immediately — it
// just turns "hangs until the test binary times out" into a readable failure.
const failsafe = 3 * time.Second
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 |