Commit Graph

10 Commits

Author SHA1 Message Date
Rodin 99c0865e93 docs: add configuration.md (skill test output), remove thin from-source.md
10 patterns, 989 lines. Full skill spec compliance:
- Source hyperlinks (commit SHA permalinks)
- Before/after code examples for every pattern
- Over-application warnings with code
- Anti-patterns with DON'T/DO blocks
- Decision tree at end
- Cross-references to related topic files

Patterns: zero-value config, options struct, functional options,
default instances, init-time registration, context values,
builder (anti-pattern), function fields, immutable-after-use, Clone.
2026-04-30 14:26:31 -07:00
Rodin c7e61565c0 docs: full iterative patterns extraction from golang/go
794 lines, 35+ patterns across 9 topics with hyperlinked sources.
Includes frequency data from the source (281 interfaces, 55 sentinels,
262 constructors, 309 context-accepting functions, 2685 t.Helper calls).

Topics: interfaces, errors, testing, packages, concurrency,
documentation, naming, configuration, extension, performance, smells.

All examples are real code from the Go source, not invented.
2026-04-30 13:45:02 -07:00
Rodin dfe03e0675 fix: add 'When to use' to every pattern (was missing) 2026-04-30 13:29:50 -07:00
Rodin 65cae45f13 docs: add patterns extracted from golang/go source
Using codebase-analysis skill (patterns mode) on the language source.
Real examples from the repo, not invented. Each pattern has:
- Rule, Example, Why, When NOT to use, Source file.

Topics: interface design, error handling, testing, package org,
concurrency, documentation, naming, smells.
2026-04-30 13:26:29 -07:00
aweiker 733aa7d261 docs: add when-not to style + smells (package-design + documentation already done) 2026-04-30 13:31:47 +00:00
aweiker 11048ae73e docs: add when-not to interfaces + error-handling + concurrency 2026-04-30 13:26:20 +00:00
aweiker a7a853bb43 docs: add when-not to structs + testing-advanced + api-conventions 2026-04-30 13:24:01 +00:00
aweiker eb9171368b docs: add 'when to use' triggers + examples to all patterns
Added 'When to Use' subsections with concrete decision triggers and
before/after Go code examples to patterns across all directories:

- patterns/error-handling.md (3 patterns: sentinels, wrapping, Join)
- patterns/concurrency.md (4 patterns: Mutex, Once, done channels, pipelines)
- patterns/interfaces.md (4 patterns: small interfaces, accept/return, adapter, optional)
- patterns/structs.md (3 patterns: zero-value, constructors, config structs)
- patterns/package-design.md (3 patterns: internal/, init(), context keys)
- patterns/style.md (3 patterns: interface checks, iota constants, named types)
- patterns/testing-advanced.md (3 patterns: table tests, golden files, httptest)
- patterns/api-conventions.md (3 patterns: Must, layered API, graceful shutdown)
- patterns/documentation.md (2 patterns: examples, deprecated)
- kubernetes/patterns.md (3 patterns: controller, workqueue, leader election)
- kubernetes/production-go.md (2 patterns: codegen, HandleCrash)
- smells/anti-patterns.md (2 anti-patterns: cache mutation, edge-triggered)
2026-04-30 12:08:41 +00:00
Rodin c797178fb9 docs: idiomatic Go patterns from stdlib + Kubernetes with source citations 2026-04-30 11:07:33 +00:00
Rodin 0f1d7e4c06 feat: initial Go patterns guide from stdlib + Kubernetes source study
9 pattern files covering stdlib (structs, interfaces, API conventions, docs, style),
Kubernetes (controller/reconciler, informer/cache, leader election, code generation),
comparison (stdlib vs K8s approaches), and anti-patterns.

All patterns cite exact source files and line numbers.
2026-04-30 06:34:02 +00:00