Code Formatting

Enforce 'When...it should...' format for Go test names.

1|Updated Nov 18, 2025
One-click install
npx skills add https://github.com/hypershift-community/azure-dev-preview --skill code-formatting-hypershift-community
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Code Formatting
Source: https://github.com/hypershift-community/azure-dev-preview/tree/main/.claude/skills/code-formatting
Command: npx skills add https://github.com/hypershift-community/azure-dev-preview --skill code-formatting-hypershift-community

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Inconsistent Go code formatting, linting errors, and non-standard test naming conventions lead to reduced code readability, increased maintenance effort, and failed CI/CD checks. This Skill automates the enforcement of HyperShift's strict code quality and testing standards, saving developers time and ensuring project consistency.

Core Features & Use Cases

  • Mandatory Test Naming: Enforces the "When...it should..." format for all Go test names, making tests self-documenting and easy to understand.
  • Code Quality Reminders: Automatically prompts users to run make lint-fix and make verify for Go code, and make verify-codespell for Markdown, ensuring all code meets project standards before commit.
  • Pre-Commit Checklist: Provides a quick checklist to ensure all formatting, linting, and testing requirements are met, preventing common errors and accelerating the development cycle.
  • Use Case: After writing a new set of Go unit tests, activate this Skill to automatically review the test names and suggest corrections to align with the "When...it should..." format, ensuring immediate compliance with project standards.

Quick Start

Review the attached Go test file node_pool_test.go and ensure all test names follow the 'When...it should...' format, then suggest any necessary corrections.

Frequently Asked Questions about Code Formatting

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce consistent Go test naming conventions across my project?

Enforce test naming by requiring the 'When <condition>, it should <expected behavior>' format for all Go tests. This Skill automatically reviews test names and suggests corrections to align with this standard, ensuring tests are self-documenting and meet project compliance before commit.

What's the best way to catch Go code formatting and linting errors before CI/CD?

Run `make lint-fix` after writing Go code and `make verify` before commits to catch formatting and linting errors locally. This Skill automates reminders for these mandatory steps, preventing failed CI/CD checks and reducing maintenance effort.

How do I ensure Markdown and Go code quality standards are met in my repository?

Use `make lint-fix` for Go code, `make verify` for comprehensive checks, and `make verify-codespell` for Markdown spelling errors. This Skill provides a pre-commit checklist covering all three to ensure consistent code quality across your repository.

Can I automate code quality checks for Go projects following HyperShift standards?

Yes. This Skill automates enforcement of HyperShift's strict code quality standards by mandating test naming formats, prompting linting runs, and providing pre-commit verification steps, saving developers time and ensuring project-wide consistency.

What happens if my Go test names don't follow the required format?

Non-standard test names reduce readability and fail compliance checks. This Skill identifies tests not using the 'When...it should...' format and suggests corrections, ensuring all tests self-document expected behavior and meet project standards.