agentleFS
lrstanleylrstanley/skills/skills/golang-packages/SKILL.md

golang-packages

Skill1 starsChanged 14 days agoMITView on GitHub

Queries pkg.go.dev metadata for Go packages and modules via pkgsite-cli and the pkg.go.dev v1beta API. Use when discovering packages, inspecting module versions, symbols, imports, reverse dependencies, vulnerabilities, licenses, other projects that depend on a package, or pkg.go.dev documentation lookup.

  • Installs packages

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 2 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run pkgsite-cli <command> -h for command-specific flags.

    line 70
  2. Distinctive:

    Place flags before positional arguments

    line 81
  3. Very specific:

    Use -module when the API returns ambiguous path candidates

    line 82
  4. Very specific:

    Use -json in scripts; check exit code for failures

    line 83
  5. Very specific:

    Prefer pkgsite-cli or the REST API over scraping pkg.go.dev HTML

    line 84
  6. Distinctive:

    Put flags after positional arguments

    line 90
  7. Very specific:

    Use pkgsite-cli instead of go doc on local code

    line 91

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Go Package Discovery (pkgsite-cli)

Specialist for querying pkg.go.dev metadata through pkgsite-cli, the reference CLI for the pkg.go.dev v1beta API. For programmatic integrations, use the REST API directly; see references/api.md.

Introduced in the pkg.go.dev API blog post.

When to Use

  • Discovering or comparing third-party Go packages not present locally
  • Inspecting module versions, vulnerabilities, licenses, or README content
  • Listing exported symbols, imports, or reverse dependencies for a package
  • Scripting pkg.go.dev lookups with -json output

When Not to Use

  • Reading documentation for a known import path, including package@version (use go doc)
  • Serving docs for local or private packages (use cmd/pkgsite web server)
  • Resolving ambiguous import paths without specifying the module

Core Workflow

  1. Install -- go install golang.org/x/pkgsite/cmd/internal/pkgsite-cli@latest
  2. Choose interface -- CLI for terminal/scripts; REST API for application code
  3. Pick command -- search for discovery; package or module for inspection
  4. Set flags -- Request only needed data; use -json for machine output
  5. Handle ambiguity -- Pass -module when the API reports multiple candidates

Reference Guide

TopicReferenceLoad When
Package inspectionreferences/package.mdMetadata, docs, symbols, imports, imported-by, licenses
Module inspectionreferences/module.mdVersions, packages, vulnerabilities, README
Searchreferences/search.mdFinding packages or symbols on pkg.go.dev
REST APIreferences/api.mdDirect HTTP access, OpenAPI spec, curl, pagination

Commands

CommandPurpose
pkgsite-cli search <query>Search for packages (or symbols with -symbol)
pkgsite-cli package <path>[@version]Inspect a package
pkgsite-cli module <module>[@version]Inspect a module
pkgsite-cli helpPrint usage for all commands
pkgsite-cli versionPrint CLI version and Go toolchain

Shared flags on package, module, and search: -json, -limit (default 25), -server (default https://pkg.go.dev), -timeout (default 30s), -x (print URLs). Run pkgsite-cli <command> -h for command-specific flags.

Version Syntax

Append @version to paths for semver tags (v1.2.3) or master/main branches. Omit @version for the latest tagged release.

Constraints

MUST DO

  • Place flags before positional arguments
  • Use -module when the API returns ambiguous path candidates
  • Use -json in scripts; check exit code for failures
  • Prefer pkgsite-cli or the REST API over scraping pkg.go.dev HTML

MUST NOT DO

  • Assume the CLI interface is stable (marked experimental upstream)
  • Rely on the web UI's "longest module path" resolution
  • Put flags after positional arguments
  • Use pkgsite-cli instead of go doc on local code

Quick Examples

pkgsite-cli search -limit 5 "structured logging"
pkgsite-cli package -symbols -imported-by github.com/google/go-cmp/cmp
pkgsite-cli module -versions -packages github.com/google/go-cmp
pkgsite-cli search -json -limit 10 uuid | jq '.items[].packagePath'

Tool Comparison

ToolScope
go docPackage/symbol docs, including package@version
cmd/pkgsiteLocal web server for downloaded packages
pkgsite-cliRemote metadata: search, versions, vulns, imported-by, licenses
REST APISame data as CLI; best for application integrations

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.