author-go-code
ALWAYS invoke this skill when writing or fixing implementation code for Go. NEVER write or fix Go implementation without this skill.
- License 许可
- MIT
- 最近更新
- 2026-11-13
- Stars
- ★ 1
- Forks
- 1
01 前言 Front Matter
- name
- author-go-code
- description
- ALWAYS invoke this skill when writing or fixing implementation code for Go. NEVER write or fix Go implementation without this skill.
- allowed-tools
- Read, Write, Glob, Grep, Edit, {{! tool('use_skill') !}}, Bash(gofmt:*), Bash(go vet:*), Bash(go test:*), Bash(staticcheck:*), Bash(golangci-lint:*)
02 资源文件 5
- 参考文档references/outcome-engineering-patterns.md3.7 KB
- 参考文档references/test-patterns.md5.4 KB
- 参考文档references/verification-checklist.md2.2 KB
- 参考文档workflows/implementation.md3.7 KB
- 参考文档workflows/remediation.md3.0 KB
03 SKILL.md 正文
{!% require_skill 'go:go-code-standards' %!}
{!% require_skill 'go:go-test-standards' %!}
<objective> Go implementation code that complies with its governing spec, with explicit seams and full validation passing. </objective>
<bundled_files>
References live at ${CLAUDE_SKILL_DIR}/references/ and workflows at ${CLAUDE_SKILL_DIR}/workflows/; the loading message supplies that base directory. Do not search the product directory for skill files.
</bundled_files>
<quick_start>
- Read the repo-local Go overlays when present; the standards above are already loaded.
- Follow
<context_loading>when this is a product-tree work item. - Read
${CLAUDE_SKILL_DIR}/workflows/implementation.mdfor new work or${CLAUDE_SKILL_DIR}/workflows/remediation.mdfor review feedback. - When behavior changes require new or revised evidence: Use skill
product-tree:verify. After it selects test: Use skillgo:author-go-testfor Go expression. - Finish with the repository validation sequence or, if none is published,
gofmt -l .,go vet ./..., the repository's linter, andgo test -race ./....
allowed-tools preapproves only the listed raw-tool fallbacks. A repository-canonical wrapper outside those patterns uses the runtime's normal per-call approval path; NEVER select a fallback merely to avoid that approval.
</quick_start>
<essential_principles>
Behavior comes from specs and their selected test, eval, or audit evidence. Existing code is reference material, not authority.
Prefer explicit types, wrapped errors, and narrow seams over framework-heavy indirection. Interfaces and function parameters are for real architectural boundaries, defined where they are consumed, not for decoration.
No generated mocks as the default testing strategy. When a controlled implementation is needed, keep coupling to the real seam with a small hand-written recorder, harness, or interface implementation.
Every goroutine has an owner and an exit condition; every blocking call takes a context.Context.
NEVER declare work complete until the full validation sequence passes.
</essential_principles>
<repo_local_overlay>
Check for spx/local/go.md and spx/local/go-tests.md at the repository root. Read each file that exists before discovery and implementation. Treat each as repo-local routing to the product's governing specs and decisions; a local overlay supplements skill behavior and does not declare product truth.
</repo_local_overlay>
<hierarchy_of_authority> Use guidance in this order:
- this skill and its loaded Go standards
- loaded ADRs, PDRs, and product-tree artifacts
{{! file('root_guide') !}},README.md,docs/, and other product documentation- selected test, eval, or pathless audit evidence
- existing code as the lowest-layer reference
When layers disagree, the higher authority wins. </hierarchy_of_authority>
<codebase_discovery> Before writing code, discover what already exists.
Read:
README.md,docs/,{{! file('root_guide') !}}, andCONTRIBUTING.mdwhen presentgo.modfor the module path, Go version, and dependencies- the linter configuration (
.golangci.ymlorstaticcheck.conf) when present
Search for:
- similar packages, interfaces, structs, and error types
- existing seam patterns for process, storage, network, and time boundaries
- logging conventions (
log/sloghandlers and attribute names) - harness and generator packages under
internal/testinfra/
Before implementation, confirm:
- which dependencies are already in
go.mod - which package naming and error patterns the repository uses
- whether an existing seam or package already solves the problem
</codebase_discovery>
<testing_methodology>
Use skill product-tree:verify before adding or revising evidence. When it selects test: Use skill go:author-go-test for Go expression, then follow RED/GREEN. When it selects evaluate, read the eval definition, cases, materialized prompt, real producer contract, selected product command, and threshold; run that command before and after implementation. When it selects audit, preserve the pathless requirement for the isolated verifier without inventing a test. If the change alters behavior and no evidence already proves that behavior, establish the selected evidence first.
Use /go-test-standards as the canonical source for filenames, evidence levels, controlled implementations, property tests, toolchain-oracle evidence, fixture placement, and coverage expectations. Keep production code aligned with those constraints instead of re-declaring test policy here.
</testing_methodology>
<audit_requirement_handoff>
For each /verify routing row whose verification type is audit, re-read the routed spec or decision artifact and confirm the exact subject still carries ([audit:{rule-slug}]) or the pathless ([audit]) that the foundation admits for a toolchain without slug support. The completion report includes one Audit requirements row per audit routing row with the full spx/... source path, exact subject text, and status preserved. The row count must equal the routing result's audit-row count; when that count is zero, report Audit requirements: none selected.
</audit_requirement_handoff>
<context_loading> If this work belongs to a product-tree node:
- Use skill
product-tree:contextualizewith the full path - abort if required context is missing
- implement only after the context is loaded
If the work is outside the Product Tree, proceed with the provided requirements and repository context. </context_loading>
<reference_guides>
${CLAUDE_SKILL_DIR}/references/outcome-engineering-patterns.md-- Go-native code patterns for seams, config, errors, and cleanup${CLAUDE_SKILL_DIR}/references/test-patterns.md-- debuggability-first Go test organization${CLAUDE_SKILL_DIR}/references/verification-checklist.md-- completion checks and validation commands${CLAUDE_SKILL_DIR}/workflows/implementation.md-- protocol for new implementation work${CLAUDE_SKILL_DIR}/workflows/remediation.md-- protocol for fixing review feedback
</reference_guides>
<success_criteria>
- The Go implementation satisfies its governed evidence with no unresolved implementation-audit finding.
- The repository's canonical format, vet, and lint commands pass; its race-enabled test command passes; every test or eval command selected by
/verifypasses its declared criterion. - Behavior-changing work has selected test or eval evidence, or an
Audit requirementsreport whosepreservedrows match/verify's audit routing rows. - No temporary debug code, commented-out implementation, or TODO/FIXME escape hatch remains.
</success_criteria>
04 同仓库更多 Skills
plugin
暂无简介
sanitize-powerpoint
ALWAYS invoke this skill when sanitizing, cleaning up, auditing, or aligning a PowerPoint (.pptx) deck — slide-master and layout structure, layout type attributes, stray fonts, non-theme colors, or layout naming. NEVER hand-edit pptx XML without this skill.
draw-excalidraw
ALWAYS invoke this skill when creating Excalidraw diagrams, visualizing workflows, architectures, or concepts. NEVER generate Excalidraw JSON without this skill.
typescript-test-standards
TypeScript test standards enforced across all skills. Loaded by other skills, not invoked directly.
typescript-code-standards
TypeScript code standards enforced across all skills. Loaded by other skills, not invoked directly.
typescript-architecture-standards
TypeScript ADR conventions enforced across architect and auditor skills. Loaded by other skills, not invoked directly.