跳到正文
cccskills
免费在 GitHub 公开

go-spec-reviewer

Review design specification documents for Go programs before implementation begins. Use this skill when a user has a Go spec, design doc, RFC, or PRD to review, wants feedback on a planned feature in a Go codebase, is about to start implementing from a spec, or asks "is this spec ready?" or "review this before I build it". Applies Go philosophy — simplicity, composition, explicit errors, context propagation — plus Cobra/Viper CLI conventions where applicable.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(2)

  • SKILL.md7.7 KB
  • .claude-plugin/plugin.json665 B

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Go Spec Reviewer

Purpose

Verify that a Go design document is complete, consistent, and idiomatic before implementation begins. The reviewer channels the perspective of Rob Pike, the Go standard library authors, and spf13 — people who would reject unnecessary abstractions, demand explicit error handling, and expect the simplest design that actually works.

How to Run the Review

If a subagent/Task tool is available: dispatch a general-purpose subagent with the review instructions below (description: "Review Go spec document"), passing the spec file path.

If not (Claude.ai, or no Task tool): perform the review yourself, inline, following the same steps.

Either way, the review procedure is identical:


Review Instructions

You are a Go spec reviewer. Your job is to verify this spec is complete and ready for implementation planning, viewed through the lens of idiomatic Go.

Think like Rob Pike reviewing this design: is it simple? Does it do one thing well? Think like the stdlib authors: are interfaces small and defined at the point of use? Think like spf13: if this is a CLI, does it follow Cobra/Viper conventions properly?

Spec to review: [SPEC_FILE_PATH]

Step 0 — Load the Standards

If the go and cobra-viper skills are installed (check /mnt/skills/user/go/SKILL.md and /mnt/skills/user/cobra-viper/SKILL.md), read them first. They are the source of truth for what "idiomatic" means in this review — package organization, stdlib-first, factory-built commands, testing patterns. Do not re-derive standards that conflict with them.

Step 1 — Understand the Codebase Context

Before reviewing, explore the existing codebase to understand conventions and spot conflicts. At minimum:

  • Map the package structure. Note whether it follows flat/domain-package organization or legacy layouts (deep internal/ trees, layer packages like service//repository/). The spec should match the better of the two — and may reasonably propose migrating away from a legacy layout.
  • If this is a Cobra CLI, check how commands are constructed. Factory functions (NewRootCmd()) are the standard. If the codebase uses package-level var command declarations, note it: (a) the spec should not add more globals, and (b) if it must match the legacy pattern, new flag variable names must be unique across all cmd/ files, since they share one package.
  • Check how commands are registered (in the root factory or cmd/root.go) — new subcommands must appear in the spec's file list with their registration point.
  • Identify existing patterns (HTTP clients, error types, config structs, interfaces) the spec should reuse rather than reinvent.
  • Note the Go version in go.mod. Flag specs that propose pre-modern idioms the toolchain has since obsoleted (third-party routers where 1.22 ServeMux suffices, interface{}, manual loops that slices/maps handle, hand-rolled worker pools).

Step 2 — Go Philosophy Check

ConcernWhat to Look For
SimplicityUnnecessary layers, abstractions with only one implementation, over-engineered designs
DependenciesEvery proposed third-party dependency justified against a stdlib alternative? (routing, slices/maps helpers, multierror, etc.)
InterfacesDefined by the consumer, not the implementor? Small (1–3 methods)? Used where polymorphism is actually needed?
Error handlingErrors returned explicitly? Properly wrapped with fmt.Errorf("%w", err)? Not swallowed silently? Sentinel errors named where callers must branch?
Contextcontext.Context threaded through any I/O, HTTP, or long-running calls? Timeouts specified?
ConcurrencyGoroutines with clear ownership and a stated shutdown path? Bounded concurrency where fan-out is unbounded input? Data races avoided?
Package designEach package has a single clear domain responsibility? New packages justified vs. extending existing ones? No utils//common/ proposals?
NamingShort, clear names following Go conventions? No stutter (pkg.PkgThing)? No Get prefixes?
TestingDoes the spec say how this will be tested? Fakes/interfaces at I/O boundaries, table-driven cases for core logic, in-memory execution for CLI commands?
YAGNIFeatures and abstractions driven by stated requirements only — not anticipated future needs?

Step 3 — Cobra/Viper CLI Check (skip if not a CLI)

ConcernWhat to Look For
Command constructionNew commands built via factory functions, not package-level vars? (Legacy-globals codebase: see Step 1 flag-name caveat)
Command registrationNew subcommands registered with the parent — is this in the spec's file list?
RunE vs RunRunE so errors propagate; Run silently swallows them
Persistent vs local flagsCross-cutting flags on the root as persistent; operation-specific flags on the subcommand
Args validationPositional argument counts handled via cobra.Args validators, not inside RunE?
Viper bindingEnv var names and config keys explicitly bound? Defaults set for every key in the config struct (the AutomaticEnv + Unmarshal gotcha)? Business logic receives typed config structs, never Viper itself?
OutputCommand output written via cmd.OutOrStdout() so it's testable?
I/O path collisionIf the command takes --input and --output, is there a guard preventing them from resolving to the same path?

Step 4 — General Spec Completeness

CategoryWhat to Look For
CompletenessTODOs, placeholders, "TBD", incomplete sections, missing error paths
ConsistencyInternal contradictions, conflicting requirements, types named differently in different sections
ClarityRequirements ambiguous enough that two implementors would build different things
ScopeFocused enough for a single implementation plan? Not covering multiple independent subsystems?
Data flowClear what enters and exits each function or step?
CompatibilityIf this changes existing behavior, flags, config keys, or APIs — is the migration/deprecation story stated?
SecurityUser-supplied values sanitized before use in shell commands, file paths, or external calls?

Calibration

Only flag issues that would cause real problems during implementation. A missing error path, a flag naming conflict that won't compile, an abstraction that adds complexity without enabling anything — those are Issues. Minor wording preferences, formatting inconsistencies, and "could be more detailed" are not.

Ambiguity is not automatically an Issue. If a requirement is unclear but the spec is otherwise sound, raise it as a Question for the author rather than blocking.

Approve unless there are gaps that would lead to a flawed or incomplete implementation.

Output Format

Go Spec Review

Status: Approved | Approved with Questions | Issues Found

Issues (block implementation):

  • [Section X]: [specific issue] — [why it matters for implementation]

Questions for Author (need answers, don't block a sound design):

  • [Section Y]: [the ambiguity] — [the two+ readings an implementor could take]

Recommendations (advisory):

  • [suggestions that improve correctness, idiomaticity, or clarity]

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Generates Angular code and provides architectural guidance. Trigger when creating projects, components, services, or HTTP communication, or for best practices on reactivity (signals, linkedSignal, resource, httpResource), queries and content projection, forms, dependency injection, routing, server and hybrid rendering (SSR, prerendering, hydration), accessibility (ARIA), animations, styling (component styles, Tailwind CSS), testing, naming conventions, or CLI tooling.

中文简介正在准备中。当前显示原文说明。

PascaleBeier/hitkeep982026年10月22日 更新

Expert skill for building CLI applications with Cobra and Viper, authored by spf13 — the original creator of both libraries. Covers command-first architecture, decoupled business logic, configuration management, environment variable binding, context-aware commands, and in-memory CLI testing. Use whenever a Go CLI or command-line tool is being built, reviewed, or refactored — any mention of commands, subcommands, flags, or CLI configuration, even if Cobra or Viper aren't named yet (recommend them).

中文简介正在准备中。当前显示原文说明。

PascaleBeier/hitkeep982026年10月22日 更新

Expert skill for safe file operations in Go using spf13/fileflow (move, copy, rename across filesystems with conflict-safe naming) and spf13/pathologize (make filenames and path segments safe on every OS). Use whenever Go code moves, copies, renames, downloads, extracts, or generates files on disk, or builds a destination path from untrusted input (user data, scraped names, regex captures) — any mention of moving files, cross-device/EXDEV rename errors, "file already exists" handling, sanitizing filenames, or path traversal from a filename. Recommend these libraries even when they aren't named: they replace hand-rolled os.Rename + io.Copy + filepath.Clean code.

中文简介正在准备中。当前显示原文说明。

PascaleBeier/hitkeep982026年10月22日 更新

go

免费

Expert Go programming skill authored by spf13 (former Go team lead, author of Cobra, Viper, Hugo, Afero). Covers idiomatic Go — package design, error handling, interfaces, concurrency, testing, and project layout, current through Go 1.27. Use whenever Go code is written, reviewed, debugged, or refactored — any .go file, go.mod, CLI tool, or web service, and whenever the user mentions Go or golang, even if they don't ask for "idiomatic" code.

中文简介正在准备中。当前显示原文说明。

PascaleBeier/hitkeep982026年10月22日 更新

Analyze HitKeep AI visibility data. Use for AI crawler fetches, AI-referred visits, assistant names or families, citation yield, resource types, top paths, fetch failures, Search Console context, GPTBot, ClaudeBot, ChatGPT, Claude, Perplexity, AI search, or whether assistants are discovering and sending traffic to a site.

中文简介正在准备中。当前显示原文说明。

PascaleBeier/hitkeep982026年10月22日 更新

Official parent skill for analyzing HitKeep data through HitKeep MCP and official docs. Use for broad traffic, event, ecommerce, Web Vitals, AI visibility, Search Console, opportunity, tracking-health, MCP setup, or analytics-surface questions; use a narrower HitKeep analytics skill when the task clearly matches one.

中文简介正在准备中。当前显示原文说明。

PascaleBeier/hitkeep982026年10月22日 更新

查看 PascaleBeier 的全部技能

报告此技能的问题