What problem does it solve?
This Skill helps you write and review Go code for clarity, consistency, and maintainability when formatting alone is not enough.
Core Features & Use Cases
- Line Breaking and Readability: Break long calls and signatures at meaningful boundaries so code stays easy to scan and diff.
- Control Flow Clarity: Prefer early returns, remove unnecessary else branches, use switch for repeated comparisons, and extract complex conditions into named booleans.
- Function and Data Design: Keep functions focused, limit parameter counts, initialize slices and maps explicitly, use named struct fields, and choose value or pointer parameters appropriately.
- Code Organization: Group related declarations, keep helpers unexported when they are internal, and structure files to make intent obvious.
- Use Case: Review a Go service, API handler, or library file and rewrite it into a cleaner, more idiomatic form that is easier for teammates to understand and maintain.
Quick Start
Use the golang-code-style skill to review the attached Go code for clarity, control flow, collection initialization, and line breaking.