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/signal_unix_test.go
View on GitHub//go:build unix
package main
import (
"context"
"errors"
"os"
"os/signal"
"syscall"
"testing"
"time"
)
// Ctrl-C on a terminal sends SIGINT to the process. This test sends SIGINT to
// itself and asserts that the wiring turns it into a cancelled context, which
// is what every other cancellation test in this package assumes.
//
// Note what it does not do: sleep. The assertion is a channel receive, and the
// watchdog exists only so a broken implementation fails in seconds instead of
// hanging forever. A sleep-based version of this test would be flaky on a busy
// machine and slow on an idle one.
func TestInterruptCancelsTheContext(t *testing.T) {
// Belt and braces: catching SIGINT anywhere in the process disables the
// default "die immediately" action, so a half-wired implementation fails
// this assertion instead of killing the test binary.
guard := make(chan os.Signal, 1)
signal.Notify(guard, os.Interrupt)
defer signal.Stop(guard)
ctx, stop := notifyContext(context.Background())
defer stop()
if err := syscall.Kill(os.Getpid(), syscall.SIGINT); err != nil {
t.Fatalf("kill: %v", err)
}
select {
case <-ctx.Done():
if !errors.Is(ctx.Err(), context.Canceled) {
t.Errorf("ctx.Err() = %v, want context.Canceled", ctx.Err())
}
case <-time.After(10 * time.Second):
t.Fatal("SIGINT did not cancel the context: is signal.NotifyContext wired up?")
}
}
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 |