MCP HubMCP Hub
SKILL·9D1C12

go-semantic-tools

eduardo-sl
更新日 27 days ago
3 閲覧
69
9
69
GitHubで表示
ドキュメントwordaiapi

について

このスキルは、テキスト検索ではなく公式ツールチェーンを使用してGoコードベースを意味論的に分析する開発者を支援します。goplsを参照と実装の検索に、go listを依存関係グラフの作成に、go docをAPI探索に活用します。変更を加える前に、呼び出し元の検索、依存関係の追跡、モジュール使用状況のマッピングなどのタスクにご利用ください。

クイックインストール

Claude Code

推奨
メイン
npx skills add eduardo-sl/go-agent-skills -a claude-code
プラグインコマンド代替
/plugin add https://github.com/eduardo-sl/go-agent-skills
Git クローン代替
git clone https://github.com/eduardo-sl/go-agent-skills.git ~/.claude/skills/go-semantic-tools

このコマンドをClaude Codeにコピー&ペーストしてスキルをインストールします

ドキュメント

Go Semantic Tools

grep finds strings; the toolchain finds meaning. Method names repeat across types, interfaces are satisfied implicitly, and dot-imports lie to text search. Before changing shared code, get the truth from tools that understand types.

1. Choose the Tool

QuestionCommand
Where is this symbol used?gopls references file.go:LINE:COL
Where is it defined?gopls definition file.go:LINE:COL
Who implements this interface? / which interfaces does this type satisfy?gopls implementation file.go:LINE:COL
Who calls this function (transitively)?gopls call_hierarchy file.go:LINE:COL
What's in this package's API?go doc ./internal/service / go doc pkg Symbol
Which packages exist / depend on what?go list ./..., go list -deps, go list -json
Find a symbol by name across the modulegopls workspace_symbol Name
Symbols in one filegopls symbols file.go

Positions are file.go:line:column (1-based). Get line/column from a prior search or gopls symbols. All gopls commands run from within the module and need a warm build cache — run go build ./... once first.

2. Standard Investigation Flows

Before changing a function

gopls references internal/service/user.go:42:6   # every call site, typed
gopls call_hierarchy internal/service/user.go:42:6

Text search for Process( would surface every type's Process; references returns only this one's call sites — including usages via interfaces and embeddings that grep cannot see.

Mapping an interface

# On the interface name: all implementations
gopls implementation internal/store/store.go:15:6

# On a method of a concrete type: interfaces it satisfies
gopls implementation internal/store/postgres/user.go:30:18

Run this before adding a method to an interface — every implementation listed will break.

Understanding the dependency graph

go list ./...                                    # all packages
go list -f '{{.ImportPath}} -> {{join .Imports " "}}' ./... # direct edges
go list -deps ./cmd/api | grep myorg             # everything a binary pulls in
go list -json ./internal/service | jq .Imports   # machine-readable

Use this to verify layering claims ("domain imports nothing") instead of trusting directory names.

Exploring an unfamiliar API

go doc ./internal/payments            # package overview
go doc ./internal/payments Gateway    # one symbol, with doc comment
go doc -all ./internal/payments       # full API surface

Prefer this to opening files: it shows the exported contract without implementation noise.

3. Semantic Rename

gopls rename -w internal/service/user.go:42:6 ProcessOrder

Renames the symbol everywhere it's referenced — through interfaces, embedding, and test packages. Never rename an identifier with find-and-replace; UserID the field and UserID the local variable are different symbols with the same spelling.

4. Diagnostics Without an Editor

gopls check ./internal/...   # type errors + analyzer findings per file
go vet ./...                 # the vet suite standalone

gopls check surfaces the same diagnostics an IDE user sees — run it when reviewing code you haven't opened in an editor.

5. When grep Is Still Right

  • String literals: log messages, SQL, config keys, error text.
  • Comments, TODOs, documentation.
  • Code that doesn't compile yet — gopls needs a type-checkable package; grep works on broken trees.
  • Quick existence checks ("is this env var referenced anywhere?").

Rule of thumb: identifiers → gopls; literals and prose → grep.

Verification Checklist

  1. Call sites enumerated with gopls references (not grep) before changing any shared symbol
  2. Interface changes preceded by gopls implementation on the interface
  3. Renames performed with gopls rename -w, never text replacement
  4. Layering assumptions verified with go list import data
  5. Unfamiliar packages explored via go doc before reading implementations
  6. gopls check / go vet run when reviewing without an editor
  7. grep reserved for literals, comments, and non-compiling code

GitHub リポジトリ

eduardo-sl/go-agent-skills
パス: skills/(workflow)/go-semantic-tools
0
FAQ

よくある質問

go-semantic-tools Skillとは何ですか?

go-semantic-tools はeduardo-sl が作成した Claude Skillです。Skillは、Claudeが必要に応じて読み込む指示とリソースをまとめ、追加の指示なしで go-semantic-tools に関連するタスクを実行できるようにします。

go-semantic-tools をインストールするには?

このページのインストールコマンドを使用してください。go-semantic-tools をプラグインとして Claude Code に追加するか、リポジトリを skills ディレクトリにクローンし、Claudeを再起動してSkillを読み込みます。

go-semantic-tools はどのカテゴリに属しますか?

go-semantic-tools は ドキュメント カテゴリに属します。

go-semantic-tools は無料で利用できますか?

はい。go-semantic-tools は AIMCP に掲載されており、無料でインストールできます。

関連スキル

railway-docs
ドキュメント

このスキルは、Railwayの機能や仕様、特定のドキュメントURLに関する質問に答えるために、最新のRailwayドキュメントを取得します。開発者がRailwayの公式情報源から正確かつ最新の情報を直接受け取れるようにします。ユーザーがRailwayの動作方法について尋ねたり、Railwayドキュメントを参照する際にご利用ください。

スキルを見る
n8n-code-python
ドキュメント

このClaudeスキルは、n8nのコードノードでPythonコードを記述するための専門的なガイダンスを提供します。具体的には、Pythonの標準ライブラリの使用方法や、`_input`、`_json`、`_node`といったn8n独自の構文の扱い方を解説します。n8n環境内におけるPythonの制限事項を開発者が理解できるよう支援し、ほとんどのワークフローではJavaScriptの使用を推奨しながらも、特定のデータ変換ニーズに対応するPythonソリューションを提案します。

スキルを見る
archon
ドキュメント

Archonスキルは、RAGを活用したセマンティック検索とプロジェクト管理をREST APIを通じて提供します。ドキュメントの検索、階層的なプロジェクト/タスクの管理、ドキュメントアップロード機能を備えたナレッジ検索の実行にご利用いただけます。外部ドキュメントを検索する際は、他の情報源を利用する前に常にArchonを最優先で使用してください。

スキルを見る
n8n-code-javascript
ドキュメント

このClaudeスキルは、n8nのCodeノードでJavaScriptコードを書くための専門的なガイダンスを提供します。`$input`/`$json`変数、HTTPヘルパー、DateTime処理などの重要なn8n固有の構文を網羅し、一般的なエラーのトラブルシューティングも行います。CodeノードでカスタムJavaScript処理を必要とするn8nワークフローを開発する際にご利用ください。

スキルを見る