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/flags-config/exercise/config.go
View on GitHubpackage main
import (
"errors"
"fmt"
"time"
)
// EnvPrefix prefixes every environment variable this tool reads:
// TOOLKIT_ENDPOINT, TOOLKIT_TIMEOUT, TOOLKIT_RETRIES, TOOLKIT_VERBOSE and
// TOOLKIT_TAGS.
const EnvPrefix = "TOOLKIT_"
// Config holds the fully resolved settings for one run of the tool.
type Config struct {
Endpoint string
Timeout time.Duration
Retries int
Verbose bool
Tags []string
}
// Source identifies the layer that supplied a setting's final value.
type Source int
const (
SourceDefault Source = iota
SourceFile
SourceEnv
SourceFlag
)
// String names the layer for humans: it shows up in error messages and in the
// tool's provenance output, so the words are part of the user interface.
func (s Source) String() string {
// TODO: "default", "config file", "environment", "flag";
// any other value is "unknown".
return ""
}
// Fields lists every setting name used as a key in Result.Origins.
var Fields = []string{"endpoint", "timeout", "retries", "verbose", "tags"}
// Result is a resolved Config plus the provenance of every setting.
type Result struct {
Config Config
Origins map[string]Source
}
// Causes reported inside a *ValueError. Callers match them with errors.Is
// instead of matching on message text.
var (
ErrEmpty = errors.New("must not be empty")
ErrRange = errors.New("out of allowed range")
ErrScheme = errors.New("must start with http:// or https://")
)
// ValueError reports a setting that could not be parsed or failed validation,
// and names the layer the offending value came from.
type ValueError struct {
Field string
Source Source
Raw string
Err error
}
func (e *ValueError) Error() string {
return fmt.Sprintf("%s: invalid value %q from %s: %v", e.Field, e.Raw, e.Source, e.Err)
}
func (e *ValueError) Unwrap() error { return e.Err }
// Defaults returns the configuration used when no other layer says otherwise.
func Defaults() Config {
// TODO: see acceptance criterion 2 in LESSON.md.
return Config{}
}
// Validate reports the first unusable setting in the resolved result,
// attributing it to the layer that supplied the value. It checks endpoint,
// then timeout, then retries.
//
// Rules: the endpoint must be non-blank and use http:// or https://; the
// timeout must be greater than zero; retries must be between 0 and 10.
func (r *Result) Validate() error {
// TODO: return a *ValueError built from r.Origins, or nil.
return nil
}
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 |