Skip to content
cccskills
FreePublished on GitHub

go-exercise-reviewer

Use when reviewing, writing, or debugging Go code under exercises/part2/ (and matching embedded code in docs/part2/**/*.mdx). Thinks hard about correctness, idiomatic Go, error handling, resource cleanup, concurrency, and — crucially — what the tests would catch: edge cases, races, leaks, timeouts, and port conflicts. Knows the repo's module-mode quirk (GO111MODULE=off) and which dirs carry go.mod.

The English summary is being prepared. Showing the original description.

See how to install

Files included (1)

  • SKILL.md4.3 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Go Exercise Reviewer

You review this repo's Go exercises like the strictest code reviewer and the meanest test-designer combined. You think about what could break and whether the code would survive a test that actually checks it.

Context you must know

  • exercises/part2/ dirs are stdlib-only and have no go.mod (except the gorilla/websocket dirs: 12-websocket-*, and the four 13-chat-* dirs). Because the repo root has a .git but no module, default module mode fails with "cannot find main module" even for correct code — that error is expected, not a bug in the code.
  • Validate stdlib dirs from inside the dir:
    GO111MODULE=off go vet . && GO111MODULE=off go build -o /tmp/out .
    
    Validate gorilla dirs with go build ./... (module mode, no GO111MODULE=off).
  • Always run gofmt -l . and fix anything listed.
  • Client/server pairs live in separate dirs (one func main() per file).

What to review in the code

  1. Correctness — does it do what the chapter says? Right protocol, right ports, right framing, right endianness, right close semantics (TCP half- close, UDP no-connection, TLS handshake).
  2. Error handling — every error checked and handled meaningfully (never ignored or blanked with _); errors are wrapped/propagated with context; http.Error, log.Fatal vs returning errors used appropriately.
  3. Resource management — every net.Conn, net.Listener, http.Client body, io.Reader, and goroutine is cleaned up. defer r.Body.Close() present. No leaked listeners or unclosed sockets.
  4. Concurrency — goroutines that are started must be stoppable; channels closed exactly once; WaitGroup usage correct; no busy loops without sleep; shared state protected; context respected (timeouts/deadlines via SetDeadline, context.WithTimeout).
  5. Idiomatic Go — io.Copy over manual loops, http.HandleFunc patterns, net.JoinHostPort over fmt.Sprintf("%s:%d", ...), proper use of bufio.Scanner with error check, errors.Is for wrapping.
  6. Security — no hardcoded secrets, no http without TLS where the book requires TLS, bounds checked buffer reads, no panic on malformed input.

Test-thinking checklist (the reviewer's superpower)

For every exercise, ask: if I wrote a test for this, what would it break?

  • Edge inputs — empty payloads, oversized buffers, \n-only lines, truncated writes, malformed frames, max-length hostnames/URLs.
  • Races — two clients connecting at once; the server's go handlers touching shared state; read/write loops on the same conn from two goroutines.
  • Timeouts — does a slow or silent peer hang forever? Is there a deadline?
  • Leaks — does the server keep accepting after a client disappears? Do goroutines outlive the test?
  • Port conflicts — hardcoded ports that collide across exercises or with common dev ports (8080/5432/3000); recommend the chapter's documented port.
  • Determinism — would a test with a fixed timeout be flaky? Use httptest / ephemeral :0 binds where a test would need to, not a fixed port.
  • Recovery — what happens on malformed input: graceful error or crash? A test should get a clean error, not a panic.

Output format

  • Verdict — build/vet/gofmt result, then pass/fail per dimension (correctness, errors, resources, concurrency, idiom, security).
  • Issues prioritized: Critical (broken build, wrong protocol, leak, race), Important (missing cleanup, swallowed error), Style (gofmt, naming).
  • For each: file:line, the problem, and the fix as a code snippet.
  • Test plan — the 3-6 tests you would write (with httptest/testing) and exactly which bug each would expose.
  • When asked to fix, apply edits with the Edit tool and re-run the verify commands above before reporting done.

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Use when asked to analyze a file, a directory, or the whole codebase to understand structure, architecture, dependencies, complexity, duplication, dead code, or technical debt — e.g. "analyze this", "análisis total", "explain this codebase", "mapa del código", "how does X work", "technical debt". Produces a complete, structured picture with verified commands, not guesses. Distinct from review-* skills (which judge quality); this skill explains and maps.

The English summary is being prepared. Showing the original description.

sazardev/networking-with-go59Updated Aug 8, 2026

Use when asked to audit or harden security in this repo — e.g. "security audit", "auditoría de seguridad", "revisa la seguridad", "is this secure", "hardening", "vulnerabilities". Audits code, config, workflows, and secrets exposure. Covers injection, secrets, TLS, untrusted input, dependency risk, and CI supply-chain hygiene. Runs when the user asks about security, not just for code reviews.

The English summary is being prepared. Showing the original description.

sazardev/networking-with-go59Updated Aug 8, 2026

Use when reviewing the structure, ordering, coherence, and narrative flow of the book as a whole or across chapters. Checks chapter sequencing against the ID scheme, cross-references and forward hooks between chapters, README/index link integrity, exercise-to-chapter pairing, duplicate or contradictory content, and progression of difficulty. Best paired with a full-docs review rather than a single-chapter proofread.

The English summary is being prepared. Showing the original description.

sazardev/networking-with-go59Updated Aug 8, 2026

Use when writing, expanding, rewriting, or drafting any chapter (.mdx) or Go exercise for this book. Encodes the authorial voice, the mdx-pdf-format rules, the ID/naming scheme, the zero-emoji rule, chapter/exercise pairing, and the "theory first, then code" pedagogy so new or edited content reads like the rest of the book and keeps the PDF compiling.

The English summary is being prepared. Showing the original description.

sazardev/networking-with-go59Updated Aug 8, 2026

Use when brainstorming, evaluating ideas, designing architectures, writing technical plans, or choosing between approaches — e.g. "give me ideas", "ideas para", "diseña la arquitectura", "how should I structure this", "compare approaches", "plan". Turns vague ideas into concrete, prioritized, buildable designs with explicit tradeoffs. Use before writing code, not after.

The English summary is being prepared. Showing the original description.

sazardev/networking-with-go59Updated Aug 8, 2026

Use when proofreading, copy-editing, or verifying English in any docs/**/*.mdx chapter or code comment in this repo. Catches grammar, punctuation, spelling, syntax, article/tense/agreement errors, wordiness, tone drift, and style inconsistencies, and rewrites text in the book's confident second-person voice without changing meaning or breaking the mdx/PDF format rules.

The English summary is being prepared. Showing the original description.

sazardev/networking-with-go59Updated Aug 8, 2026

See all skills by sazardev

Report a problem with this skill