| name | apply-go-repo-conventions |
| description | Apply repository-specific Go code structure and quality conventions for rudder-iac. Use when writing, refactoring, or reviewing Go code to make consistent choices about package design, interfaces, context usage, error handling, concurrency, naming, and tests. Prioritize this skill whenever multiple valid Go implementations exist and you need the most idiomatic, maintainable option for this repository. |
Apply Go Repo Conventions
Use this skill to keep generated and reviewed Go code aligned with both:
rudder-iac local conventions
- Go style decisions
Core Principles
- Prefer simplicity first: choose the smallest design that solves current requirements.
- Prefer composition over deep hierarchies or broad abstractions.
- Prefer concrete types by default; introduce small interfaces at point-of-use.
- Leverage Go's implicit interfaces for decoupling, but avoid interface-first design.
- Optimize for performance after measurement/profiling; prioritize clarity and correctness first.
Quick Reference
| Issue Type | Reference |
|---|
| Repo architecture, tests, logging, error wrapping | references/repo-conventions.md |
| Variable naming and repetition decisions | references/naming-and-repetition.md |
| Interface boundaries and abstraction choices | references/interfaces.md |
| Error wrapping, propagation, and control-flow readability | references/error-handling.md |
| Pointer/value decisions, receivers, context, testing | references/general-go-convention.md |
Rule Priority
When rules conflict, apply in this order:
- Existing patterns in the touched package
references/repo-conventions.md
- Topic-specific references (
interfaces.md, error-handling.md, naming-and-repetition.md)
references/general-go-convention.md
Authoring Checklist
Review Checklist
Implementation Workflow
- Identify scope: API client, provider, command, syncer, or shared utility.
- Apply package-local patterns before introducing new abstractions.
- Run checklist before finalizing changes.
- Validate with project commands (
make lint, make test, and make test-e2e when apply-cycle behavior changes).
When to Load References
- Load
references/repo-conventions.md for all code in this repository.
- Load
references/naming-and-repetition.md when choosing exported names, local variable names, or when reviewing repetitive naming.
- Load
references/interfaces.md when deciding where and how to define interfaces.
- Load
references/error-handling.md when shaping error wrapping, propagation, and branching flow.
- Load
references/general-go-convention.md for non-topic-specific Go decisions (pointer vs value, receivers, context, testing signal quality).