go-import-enforcer

Analyse and enforce Go import conventions across entire codebases.

Updated Apr 7, 2025
One-click install
npx skills add https://github.com/fsyyft-go/kratos-layout --skill go-import-enforcer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-import-enforcer
Source: https://github.com/fsyyft-go/kratos-layout/tree/main/.claude/skills/go-import-enforcer
Command: npx skills add https://github.com/fsyyft-go/kratos-layout --skill go-import-enforcer

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Go import statements often drift from project conventions, causing inconsistencies in formatting, grouping, and alias usage. This Skill automatically checks and fixes Go import blocks to conform to the project's four-segment grouping, ensures deterministic aliasing, and produces actionable remediation guidance to streamline code reviews and audits.

Core Features & Use Cases

  • Enforces proper parentheses wrapping, four-segment grouping, and alphabetic sorting across all Go files.
  • Applies project-specific alias rules (kit- and app-prefixes) and flags non-conforming imports for fixes.
  • Generates detailed analysis reports and concrete repair suggestions to accelerate compliance audits.

Quick Start

Run the tool on your Go project to automatically enforce and fix import formatting.

Frequently Asked Questions about go-import-enforcer

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

FAQPage Schema
How do I enforce Go import grouping and sorting conventions across a project?

To enforce Go import conventions, this Skill validates parentheses wrapping, enforces four-segment section grouping, checks alphabetic ordering, and standardizes alias usage across your entire codebase to ensure compliant code.

What is the standard for Go import alias usage and section grouping?

The standard for Go import grouping requires a four-segment section structure with alphabetic sorting, while alias usage enforces deterministic project-specific prefixes like kit- and app- for all internal and third-party imports.

Can I use this tool to audit third-party imports in large Go codebases?

Yes, you can audit third-party imports in large Go codebases because this Skill analyzes the entire project structure to detect non-conforming import statements and applies standardized alias mapping rules.

What's the best way to automate Go codebase import compliance for code reviews?

The best way to automate Go import compliance is to run this tool to generate detailed analysis reports and actionable repair suggestions, streamlining the review process by automatically fixing parentheses wrapping and grouping drift.