Go Practice — Adaptive Cloud-Native Learning
Generate Go exercises that build practical language fluency first, then apply it
to backends, CLIs, cloud tooling, CI/CD systems, Kubernetes/CNCF projects, and
distributed-system work.
The center of gravity is becoming fluent enough to build anything in Go.
Kubernetes/CNCF work is a preferred specialization track, not the only path.
Each normal practice request produces 3 exercises as separate .go files or
small Go modules, depending on the topic. Mix code completion, debugging, and
design tasks based on the user's learning log.
All user exercise work lives in this fixed repo:
/home/laborant/repos/go-practice
Do not create Go practice exercises elsewhere unless the user explicitly gives a
different path.
Use Go by Example and official Go documentation as the source baseline:
- Go by Example for concise runnable examples across syntax, concurrency,
testing, CLI, HTTP, files, context, and process handling.
- A Tour of Go for language foundations, methods/interfaces, generics, and
concurrency foundations.
- Effective Go for idioms:
gofmt, short names, package naming, small
interfaces, explicit error handling, and simple control flow.
When To Use
- User wants Go practice, Go exercises, Go challenges, or Go code review.
- User asks about goroutines, channels, context, interfaces, errors, modules,
testing, HTTP servers, CLIs, Kubernetes controllers, operators, CI/CD tools,
cloud APIs, or distributed systems in Go.
- User asks for backend Go learning, practical Go fluency, CNCF project readiness,
or open-source Go contribution prep.
- User says "I'm stuck", "review my solution", "make it harder/easier", or
asks clarifying questions while solving Go exercises.
Workflow
Step 1: Ask For Topic If Missing
If the user did not specify a topic, offer this menu:
Which Go area do you want to practice?
1. Foundations — syntax, slices, maps, structs, methods, interfaces, errors
2. Concurrency — goroutines, channels, select, context, cancellation, worker pools
3. Backend Go — HTTP servers, middleware, JSON, validation, persistence boundaries
4. Kubernetes/CNCF — clients, controllers, reconcilers, CRDs, informers, operators
5. CI/CD + CLIs — command-line tools, config, env vars, process execution, test runners
6. Distributed Go — retries, idempotency, rate limits, queues, leases, observability
Pick one, or name a specific thing like "context cancellation" or "Kubernetes reconciler".
Skip this step when the user names a topic directly.
Step 2: Choose Learning Mode
If the user does not specify a mode, use batch.
Modes:
batch: 3 exercises. Default for steady practice.
drill: 1 small focused task for one concept or repeated mistake.
debug: broken production-ish code plus tests.
applied: realistic backend, CLI, cloud, or CNCF task.
pr-simulation: read a small existing package, patch a bug, explain tradeoffs.
design-review: choose package boundaries, interfaces, and failure behavior
before coding.
capstone: multi-step project from the capstone ladder.
Use the mode to control scope. Do not force 3 exercises when the user asks for a
small drill, review, or project-style task.
Step 3: Prepare Practice Workspace
Use /home/laborant/repos/go-practice as the exercise repo.
If it does not exist, create it as a git repo with:
README.md
learning-log.md
.gitignore
When creating exercises, put them in a date folder under that repo. Folder names
use this format:
D-mmm-YY
Examples:
3-may-26
30-apr-26
12-jun-26
Use lowercase English month abbreviations: jan, feb, mar, apr, may,
jun, jul, aug, sep, oct, nov, dec.
Rules:
- On a new day, create that day's folder.
- If the user asks for more exercises on the same day, add more exercises to the
same folder.
- Number new exercises after existing ones in that folder.
- Keep the root
learning-log.md as the durable memory across days.
- Read earlier date folders when useful, especially when the log references them.
- Commit exercise additions in the
go-practice repo unless the user asks not to.
Step 4: Read Learning Context
Open /home/laborant/repos/go-practice/learning-log.md if it exists; otherwise
copy the starter shape from references/learning-log.md.
Scan:
- Recurring mistakes
- Clarifying questions the user keeps asking
- Concepts already comfortable
- Domain goals and current focus
- Last exercise batch
- Prior dated exercise folders
If the user is working in a specific exercise directory, prefer that directory's
local notes for that exercise, but still update the root learning-log.md.
Do not use a progress tracker script. Update the learning log directly after
reviews and after important clarifying questions.
Step 5: Choose Difficulty And Domain
Use references/topic-catalog.md.
Use references/practice-tracks.md when the user wants a backend, CLI/tooling,
cloud, distributed-system, Kubernetes, CNCF, or capstone direction.
Default progression:
- Difficulty 1/5: core language and small single-file tasks
- Difficulty 2/5: package boundaries, tests, errors, context, interfaces, and small CLIs/services
- Difficulty 3/5: realistic backend/CNCF tasks with concurrency, API boundaries, and failure modes
- Difficulty 4/5: project-style tasks modeled after Kubernetes/CNCF patterns
- Difficulty 5/5: capstone-style modules with phased tests and production constraints
Adjust from the learning log:
- Repeated syntax or type confusion -> lower difficulty, isolate the concept.
- Repeated "why this interface?" questions -> include design explanation and interface-focused task.
- Repeated concurrency confusion -> include timeline comments, cancellation paths, and race checks.
- Strong fundamentals -> shift toward backend, CNCF, and distributed-system exercises.
- User asks for challenge -> use Difficulty 3/5 or 4/5 with tests and realistic constraints.
Step 6: Generate Exercises
Read references/exercise-templates.md before creating files.
Default batch:
- 1 completion exercise
- 1 debugging exercise
- 1 cloud-native/backend design exercise with tests
Adapt batch mix:
- If user struggles with bugs -> 2 debugging exercises.
- If user asks many clarifying questions -> 1 concept drill, 1 guided completion, 1 applied task.
- If user is advanced -> 3 applied tasks across backend/CNCF/distributed systems.
Mode-specific output:
drill: 1 file plus test.
debug: 1 broken file plus test, or 3 bugs in one focused package.
applied: 1 small module with README and tests.
pr-simulation: 1 small existing-style package with failing test and review prompt.
design-review: markdown prompt plus skeleton package only if useful.
capstone: module with README, phased tests, and learning-log checkpoint.
File naming:
NN_<topic>_<subtopic>_<type>.go
NN_<topic>_<subtopic>_<type>_test.go
Start NN from 01 in each date folder. If the date folder already has
exercises, continue from the highest existing number.
For module-level exercises, create:
<date-folder>/NN_<topic>_<subtopic>/
go.mod
README.md
<package>.go
<package>_test.go
Every exercise should include:
- Short header comment with topic, difficulty, domain, and source inspiration.
- Clear goal.
TODO markers for completion tasks or BUG markers for debugging tasks.
- Tests that initially fail.
- Realistic backend/CNCF framing when useful.
- No hidden answer in comments.
- No full solution unless the user explicitly asks for one.
Prefer standard library first. Use Kubernetes or CNCF libraries only when the
exercise specifically needs them; otherwise simulate boundaries with small
interfaces to keep setup light.
Step 7: Verify Exercises Fail Correctly
Run:
gofmt -w .
go test ./...
Expected: generated exercises should fail because the user has work to do.
If any exercise passes before the user edits it, make the missing work explicit
and re-run.
For single-file package main exercises without tests, run:
go run <file>.go
Run commands from the date folder or from the specific module folder, depending
on exercise layout. Prefer go test when possible because backend/CNCF work
benefits from fast, repeatable tests.
Step 8: Deliver To User
Use this structure:
Created <count> Go exercise(s) on <topic> at Difficulty <N>/5.
Focus:
- <why these exercises were selected from learning-log.md>
Files:
- <path> — <one-line task>
- <path> — <one-line task>
- <path> — <one-line task>
Run: cd /home/laborant/repos/go-practice/<date-folder> && go test ./...
Send me your solution when ready.
Step 9: Review User Solutions
When user asks for review:
- Run
gofmt -w ..
- Run
go test ./....
- Run
go test -race ./... for concurrency exercises.
- Read
references/review-guide.md.
- Review correctness first, then idiomatic Go, then backend/CNCF production concerns.
Review should call out:
- Passing/failing tests
- Bugs or edge cases
- Idiomatic Go improvements
- Error handling and context behavior
- API boundaries and interface size
- Concurrency safety
- Production relevance for backend/CNCF work
Step 10: Update Learning Log
After each review, update /home/laborant/repos/go-practice/learning-log.md
manually.
Record:
- Date folder
- Exercises completed
- Mistakes observed
- Clarifying questions asked
- Concepts now stronger
- Concepts still weak
- Suggested next batch
Mistake examples:
nil-map-write
slice-aliasing
loop-variable-capture
pointer-vs-value-receiver
interface-too-large
ignored-error
context-not-propagated
goroutine-leak
channel-close-owned-by-receiver
data-race
test-flakiness
kubernetes-reconcile-not-idempotent
retry-without-backoff
missing-timeout
Clarifying question examples:
- "When should I use pointer receivers?"
- "Why pass context first?"
- "Who closes this channel?"
- "Why define an interface in the consumer package?"
- "What makes a reconciler idempotent?"
- "When should I mock Kubernetes client behavior?"
Use these entries to adapt future batches.
If the same clarifying question category appears twice, the next batch must
include a contrast exercise that forces the distinction. Examples:
- Repeated receiver-choice questions -> compare pointer and value receiver tasks.
- Repeated context questions -> include cancellation and timeout behavior.
- Repeated channel ownership questions -> include producer/consumer close rules.
- Repeated interface-placement questions -> include consumer-owned interface design.
- Repeated reconciler questions -> include desired vs observed state and idempotency.
Step 11: Interactive Help
- "I'm stuck" -> Give a hint, not the solution. Tie hint to prior mistakes.
- "Show me the solution" or equivalent explicit request -> provide the smallest complete solution and explain the key idea.
- "Explain this concept" -> Explain with a small Go example and one cloud-native use case.
- "Why this exercise?" -> Point to learning-log patterns and target domain.
- "Make it harder" -> Add tests for cancellation, race safety, idempotency, or edge cases.
- "Make it easier" -> Reduce to single concept and remove external dependencies.
- "Review this like CNCF code" -> Emphasize API boundaries, context, logs, tests, and failure modes.
- "Prepare me for Kubernetes projects" -> Use reconciler, client, cache, informer, and CRD-shaped exercises.
- "Help me build anything in Go" -> Rotate through foundations, packages, tests,
backend, CLI/tooling, concurrency, and applied projects.
Capstone Ladder
Offer capstones when the user wants project-style practice or has completed
several batches successfully.
go-toolbox: small CLI utilities for parsing flags, env, JSON, YAML-like
structs, files, and exit codes.
backend-health-api: HTTP service with handlers, validation, timeouts,
graceful shutdown, and table-driven tests.
ci-job-runner: concurrent job runner with context cancellation, logs,
artifacts, retries, and deterministic tests.
cloud-resource-sync: desired/observed-state sync loop with idempotency,
patch planning, and retry/backoff.
mini-controller: Kubernetes-shaped reconciler with queue, status
conditions, finalizer-like cleanup, and race-safe workers.
Keep capstones small enough to finish incrementally. Each phase should have
tests and a learning-log checkpoint.
Open Source Readiness
When the learning log shows repeated success with:
- Interfaces and package boundaries
- Context cancellation and timeouts
- Error wrapping and observability
- Table-driven tests
- Race-free concurrency
- Idempotent reconcile loops
- CLI/backend ergonomics
Suggest reading and modifying small issues in CNCF Go repositories. Start with
docs/tests/internal packages before touching controller or distributed paths.
1---2name: go-practice3description: Generate adaptive Go coding exercises for developers who want broad practical Go fluency: writing correct programs, building backends, creating CLIs/tools, working with concurrency, and eventually building Kubernetes/CNCF ecosystem tooling. Use whenever the user wants to practice Go, learn Go concepts, review Go code, debug Go programs, build backend Go skills, prepare for Kubernetes ecosystem work, or mentions Go exercises, goroutines, channels, context, HTTP services, CLI tools, controllers, operators, cloud tooling, distributed systems, or CNCF projects. The skill tracks recurring mistakes and clarifying questions in /home/laborant/repos/go-practice/ learning-log.md so future exercise batches adapt to the user's actual learning pattern. Exercises must be created inside dated folders in the go-practice repo.4---56# Go Practice — Adaptive Cloud-Native Learning78Generate Go exercises that build practical language fluency first, then apply it9to backends, CLIs, cloud tooling, CI/CD systems, Kubernetes/CNCF projects, and10distributed-system work.1112The center of gravity is **becoming fluent enough to build anything in Go**.13Kubernetes/CNCF work is a preferred specialization track, not the only path.1415Each normal practice request produces **3 exercises** as separate `.go` files or16small Go modules, depending on the topic. Mix code completion, debugging, and17design tasks based on the user's learning log.1819All user exercise work lives in this fixed repo:2021```text22/home/laborant/repos/go-practice23```2425Do not create Go practice exercises elsewhere unless the user explicitly gives a26different path.2728Use Go by Example and official Go documentation as the source baseline:29- Go by Example for concise runnable examples across syntax, concurrency,30 testing, CLI, HTTP, files, context, and process handling.31- A Tour of Go for language foundations, methods/interfaces, generics, and32 concurrency foundations.33- Effective Go for idioms: `gofmt`, short names, package naming, small34 interfaces, explicit error handling, and simple control flow.3536## When To Use3738- User wants Go practice, Go exercises, Go challenges, or Go code review.39- User asks about goroutines, channels, context, interfaces, errors, modules,40 testing, HTTP servers, CLIs, Kubernetes controllers, operators, CI/CD tools,41 cloud APIs, or distributed systems in Go.42- User asks for backend Go learning, practical Go fluency, CNCF project readiness,43 or open-source Go contribution prep.44- User says "I'm stuck", "review my solution", "make it harder/easier", or45 asks clarifying questions while solving Go exercises.4647## Workflow4849### Step 1: Ask For Topic If Missing5051If the user did not specify a topic, offer this menu:5253```text54Which Go area do you want to practice?55561. Foundations — syntax, slices, maps, structs, methods, interfaces, errors572. Concurrency — goroutines, channels, select, context, cancellation, worker pools583. Backend Go — HTTP servers, middleware, JSON, validation, persistence boundaries594. Kubernetes/CNCF — clients, controllers, reconcilers, CRDs, informers, operators605. CI/CD + CLIs — command-line tools, config, env vars, process execution, test runners616. Distributed Go — retries, idempotency, rate limits, queues, leases, observability6263Pick one, or name a specific thing like "context cancellation" or "Kubernetes reconciler".64```6566Skip this step when the user names a topic directly.6768### Step 2: Choose Learning Mode6970If the user does not specify a mode, use `batch`.7172Modes:73- `batch`: 3 exercises. Default for steady practice.74- `drill`: 1 small focused task for one concept or repeated mistake.75- `debug`: broken production-ish code plus tests.76- `applied`: realistic backend, CLI, cloud, or CNCF task.77- `pr-simulation`: read a small existing package, patch a bug, explain tradeoffs.78- `design-review`: choose package boundaries, interfaces, and failure behavior79 before coding.80- `capstone`: multi-step project from the capstone ladder.8182Use the mode to control scope. Do not force 3 exercises when the user asks for a83small drill, review, or project-style task.8485### Step 3: Prepare Practice Workspace8687Use `/home/laborant/repos/go-practice` as the exercise repo.8889If it does not exist, create it as a git repo with:90- `README.md`91- `learning-log.md`92- `.gitignore`9394When creating exercises, put them in a date folder under that repo. Folder names95use this format:9697```text98D-mmm-YY99```100101Examples:102- `3-may-26`103- `30-apr-26`104- `12-jun-26`105106Use lowercase English month abbreviations: `jan`, `feb`, `mar`, `apr`, `may`,107`jun`, `jul`, `aug`, `sep`, `oct`, `nov`, `dec`.108109Rules:110- On a new day, create that day's folder.111- If the user asks for more exercises on the same day, add more exercises to the112 same folder.113- Number new exercises after existing ones in that folder.114- Keep the root `learning-log.md` as the durable memory across days.115- Read earlier date folders when useful, especially when the log references them.116- Commit exercise additions in the `go-practice` repo unless the user asks not to.117118### Step 4: Read Learning Context119120Open `/home/laborant/repos/go-practice/learning-log.md` if it exists; otherwise121copy the starter shape from `references/learning-log.md`.122123Scan:124- Recurring mistakes125- Clarifying questions the user keeps asking126- Concepts already comfortable127- Domain goals and current focus128- Last exercise batch129- Prior dated exercise folders130131If the user is working in a specific exercise directory, prefer that directory's132local notes for that exercise, but still update the root `learning-log.md`.133134Do not use a progress tracker script. Update the learning log directly after135reviews and after important clarifying questions.136137### Step 5: Choose Difficulty And Domain138139Use `references/topic-catalog.md`.140Use `references/practice-tracks.md` when the user wants a backend, CLI/tooling,141cloud, distributed-system, Kubernetes, CNCF, or capstone direction.142143Default progression:144- Difficulty 1/5: core language and small single-file tasks145- Difficulty 2/5: package boundaries, tests, errors, context, interfaces, and small CLIs/services146- Difficulty 3/5: realistic backend/CNCF tasks with concurrency, API boundaries, and failure modes147- Difficulty 4/5: project-style tasks modeled after Kubernetes/CNCF patterns148- Difficulty 5/5: capstone-style modules with phased tests and production constraints149150Adjust from the learning log:151- Repeated syntax or type confusion -> lower difficulty, isolate the concept.152- Repeated "why this interface?" questions -> include design explanation and interface-focused task.153- Repeated concurrency confusion -> include timeline comments, cancellation paths, and race checks.154- Strong fundamentals -> shift toward backend, CNCF, and distributed-system exercises.155- User asks for challenge -> use Difficulty 3/5 or 4/5 with tests and realistic constraints.156157### Step 6: Generate Exercises158159Read `references/exercise-templates.md` before creating files.160161Default batch:162- 1 completion exercise163- 1 debugging exercise164- 1 cloud-native/backend design exercise with tests165166Adapt batch mix:167- If user struggles with bugs -> 2 debugging exercises.168- If user asks many clarifying questions -> 1 concept drill, 1 guided completion, 1 applied task.169- If user is advanced -> 3 applied tasks across backend/CNCF/distributed systems.170171Mode-specific output:172- `drill`: 1 file plus test.173- `debug`: 1 broken file plus test, or 3 bugs in one focused package.174- `applied`: 1 small module with README and tests.175- `pr-simulation`: 1 small existing-style package with failing test and review prompt.176- `design-review`: markdown prompt plus skeleton package only if useful.177- `capstone`: module with README, phased tests, and learning-log checkpoint.178179File naming:180181```text182NN_<topic>_<subtopic>_<type>.go183NN_<topic>_<subtopic>_<type>_test.go184```185186Start `NN` from `01` in each date folder. If the date folder already has187exercises, continue from the highest existing number.188189For module-level exercises, create:190191```text192<date-folder>/NN_<topic>_<subtopic>/193 go.mod194 README.md195 <package>.go196 <package>_test.go197```198199Every exercise should include:200- Short header comment with topic, difficulty, domain, and source inspiration.201- Clear goal.202- `TODO` markers for completion tasks or `BUG` markers for debugging tasks.203- Tests that initially fail.204- Realistic backend/CNCF framing when useful.205- No hidden answer in comments.206- No full solution unless the user explicitly asks for one.207208Prefer standard library first. Use Kubernetes or CNCF libraries only when the209exercise specifically needs them; otherwise simulate boundaries with small210interfaces to keep setup light.211212### Step 7: Verify Exercises Fail Correctly213214Run:215216```bash217gofmt -w .218go test ./...219```220221Expected: generated exercises should fail because the user has work to do.222If any exercise passes before the user edits it, make the missing work explicit223and re-run.224225For single-file `package main` exercises without tests, run:226227```bash228go run <file>.go229```230231Run commands from the date folder or from the specific module folder, depending232on exercise layout. Prefer `go test` when possible because backend/CNCF work233benefits from fast, repeatable tests.234235### Step 8: Deliver To User236237Use this structure:238239```text240Created <count> Go exercise(s) on <topic> at Difficulty <N>/5.241242Focus:243- <why these exercises were selected from learning-log.md>244245Files:246- <path> — <one-line task>247- <path> — <one-line task>248- <path> — <one-line task>249250Run: cd /home/laborant/repos/go-practice/<date-folder> && go test ./...251Send me your solution when ready.252```253254### Step 9: Review User Solutions255256When user asks for review:257- Run `gofmt -w .`.258- Run `go test ./...`.259- Run `go test -race ./...` for concurrency exercises.260- Read `references/review-guide.md`.261- Review correctness first, then idiomatic Go, then backend/CNCF production concerns.262263Review should call out:264- Passing/failing tests265- Bugs or edge cases266- Idiomatic Go improvements267- Error handling and context behavior268- API boundaries and interface size269- Concurrency safety270- Production relevance for backend/CNCF work271272### Step 10: Update Learning Log273274After each review, update `/home/laborant/repos/go-practice/learning-log.md`275manually.276277Record:278- Date folder279- Exercises completed280- Mistakes observed281- Clarifying questions asked282- Concepts now stronger283- Concepts still weak284- Suggested next batch285286Mistake examples:287- `nil-map-write`288- `slice-aliasing`289- `loop-variable-capture`290- `pointer-vs-value-receiver`291- `interface-too-large`292- `ignored-error`293- `context-not-propagated`294- `goroutine-leak`295- `channel-close-owned-by-receiver`296- `data-race`297- `test-flakiness`298- `kubernetes-reconcile-not-idempotent`299- `retry-without-backoff`300- `missing-timeout`301302Clarifying question examples:303- "When should I use pointer receivers?"304- "Why pass context first?"305- "Who closes this channel?"306- "Why define an interface in the consumer package?"307- "What makes a reconciler idempotent?"308- "When should I mock Kubernetes client behavior?"309310Use these entries to adapt future batches.311312If the same clarifying question category appears twice, the next batch must313include a contrast exercise that forces the distinction. Examples:314- Repeated receiver-choice questions -> compare pointer and value receiver tasks.315- Repeated context questions -> include cancellation and timeout behavior.316- Repeated channel ownership questions -> include producer/consumer close rules.317- Repeated interface-placement questions -> include consumer-owned interface design.318- Repeated reconciler questions -> include desired vs observed state and idempotency.319320### Step 11: Interactive Help321322- "I'm stuck" -> Give a hint, not the solution. Tie hint to prior mistakes.323- "Show me the solution" or equivalent explicit request -> provide the smallest complete solution and explain the key idea.324- "Explain this concept" -> Explain with a small Go example and one cloud-native use case.325- "Why this exercise?" -> Point to learning-log patterns and target domain.326- "Make it harder" -> Add tests for cancellation, race safety, idempotency, or edge cases.327- "Make it easier" -> Reduce to single concept and remove external dependencies.328- "Review this like CNCF code" -> Emphasize API boundaries, context, logs, tests, and failure modes.329- "Prepare me for Kubernetes projects" -> Use reconciler, client, cache, informer, and CRD-shaped exercises.330- "Help me build anything in Go" -> Rotate through foundations, packages, tests,331 backend, CLI/tooling, concurrency, and applied projects.332333## Capstone Ladder334335Offer capstones when the user wants project-style practice or has completed336several batches successfully.3373381. `go-toolbox`: small CLI utilities for parsing flags, env, JSON, YAML-like339 structs, files, and exit codes.3402. `backend-health-api`: HTTP service with handlers, validation, timeouts,341 graceful shutdown, and table-driven tests.3423. `ci-job-runner`: concurrent job runner with context cancellation, logs,343 artifacts, retries, and deterministic tests.3444. `cloud-resource-sync`: desired/observed-state sync loop with idempotency,345 patch planning, and retry/backoff.3465. `mini-controller`: Kubernetes-shaped reconciler with queue, status347 conditions, finalizer-like cleanup, and race-safe workers.348349Keep capstones small enough to finish incrementally. Each phase should have350tests and a learning-log checkpoint.351352## Open Source Readiness353354When the learning log shows repeated success with:355- Interfaces and package boundaries356- Context cancellation and timeouts357- Error wrapping and observability358- Table-driven tests359- Race-free concurrency360- Idempotent reconcile loops361- CLI/backend ergonomics362363Suggest reading and modifying small issues in CNCF Go repositories. Start with364docs/tests/internal packages before touching controller or distributed paths.