MCP HubMCP Hub
SKILL·9D1C12

go-semantic-tools

eduardo-sl
Mis à jour 27 days ago
3 vues
69
9
69
Voir sur GitHub
Documentationwordaiapi

À propos

Cette compétence aide les développeurs à analyser sémantiquement des bases de code Go en utilisant la chaîne d'outils officielle plutôt que la recherche textuelle. Elle exploite gopls pour les références et implémentations, go list pour les graphes de dépendances, et go doc pour l'exploration d'API. Utilisez-la pour des tâches comme trouver des appelants, tracer des dépendances ou cartographier l'utilisation des modules avant d'effectuer des modifications.

Installation rapide

Claude Code

Recommandé
Principal
npx skills add eduardo-sl/go-agent-skills -a claude-code
Commande PluginAlternatif
/plugin add https://github.com/eduardo-sl/go-agent-skills
Git CloneAlternatif
git clone https://github.com/eduardo-sl/go-agent-skills.git ~/.claude/skills/go-semantic-tools

Copiez et collez cette commande dans Claude Code pour installer cette compétence

Documentation

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

Dépôt GitHub

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

Questions fréquentes

Qu’est-ce que le Skill go-semantic-tools ?

go-semantic-tools est un Skill Claude créé par eduardo-sl. Un Skill regroupe des instructions et des ressources que Claude charge à la demande pour effectuer des tâches liées à go-semantic-tools sans consigne supplémentaire.

Comment installer go-semantic-tools ?

Utilisez les commandes d’installation de cette page : ajoutez go-semantic-tools à Claude Code comme plugin ou clonez son dépôt dans votre dossier skills, puis redémarrez Claude pour charger le Skill.

À quelle catégorie appartient go-semantic-tools ?

go-semantic-tools appartient à la catégorie Documentation.

go-semantic-tools est-il gratuit ?

Oui. go-semantic-tools est référencé sur AIMCP et son installation est gratuite.

Compétences associées

railway-docs
Documentation

Cette compétence récupère la documentation actuelle de Railway pour répondre aux questions sur les fonctionnalités, le fonctionnement ou des URL spécifiques de la documentation. Elle garantit que les développeurs reçoivent des informations précises et à jour directement depuis les sources officielles de Railway. Utilisez-la lorsque les utilisateurs demandent comment fonctionne Railway ou font référence à la documentation de Railway.

Voir la compétence
n8n-code-python
Documentation

Cette compétence Claude offre un accompagnement expert pour écrire du code Python dans les nœuds Code de n8n, en particulier pour utiliser la bibliothèque standard de Python et travailler avec la syntaxe spéciale de n8n comme `_input`, `_json` et `_node`. Elle aide les développeurs à comprendre les limites de Python dans n8n et recommande d'utiliser JavaScript pour la plupart des workflows, tout en proposant des solutions Python pour des besoins spécifiques de transformation de données.

Voir la compétence
archon
Documentation

La compétence Archon offre une recherche sémantique alimentée par RAG et une gestion de projet via une API REST. Utilisez-la pour interroger la documentation, gérer des projets/tâches hiérarchiques et effectuer de la recherche de connaissances avec des capacités de téléchargement de documents. Priorisez toujours Archon en premier lors de la recherche dans une documentation externe avant d'utiliser d'autres sources.

Voir la compétence
n8n-code-javascript
Documentation

Cette compétence Claude fournit des conseils d'expert pour écrire du code JavaScript dans les nœuds Code d'n8n. Elle couvre la syntaxe essentielle spécifique à n8n comme les variables `$input`/`$json`, les assistants HTTP et la gestion des DateTime, tout en résolvant les erreurs courantes. Utilisez-la lors du développement de workflows n8n nécessitant un traitement JavaScript personnalisé dans les nœuds Code.

Voir la compétence