Or use goimports if available for better import management:
if command -v goimports &> /dev/null; then
goimports -w .
else
gofmt -w .
fi
1---2name: go-fmt3description: Go Fmt4---5# /go-fmt67Format Go source files.89## Instructions1011Format all Go files in the project:1213```bash14gofmt -w .15```1617Or use goimports if available for better import management:1819```bash20if command -v goimports &> /dev/null; then21 goimports -w .22else23 gofmt -w .24fi25```
Run npx skillmds@latest add rootwarp/go-fmt in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Go Fmt It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
rootwarp (@rootwarp) published this skill. Their other Agent Skills are listed on their SkillMD profile.