Agent skill

Go AST Code Introspection

by pilinux in pilinux/gorest

Enumerates Go declarations and signatures from the syntax tree, then proposes small, mechanically safe refactors with file and line citations.

MITAuto-check passedDevelopment

Install Go AST Code Introspection

skills CLI
$ npx skills add pilinux/gorest --skill ast-introspection -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install pilinux/gorest ast-introspection --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/pilinux/gorest.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/ast-introspection .claude/skills/ast-introspection && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
ast-introspection
GitHub stars
506
Token cost
~414 tokens
SKILL.md length
168 words
Files
1
Skills in repo
20
Repo updated
First seen
Licence
MIT

At a glance

Enumerates Go declarations and signatures from the syntax tree, then proposes small, mechanically safe refactors with file and line citations.

  • Needing a structure-aware list of functions, methods, or types in a Go package
  • SKILL.md covers When to Use, What This Skill Does, Rules and Commands, plus 4 more sections
  • Calls go
  • Proposing a safe rename or signature change with its callers checked

What it does

This skill reads Go source through its syntax tree rather than string matching, listing package-level functions, methods, types, and const or var declarations together with a path and line number. It extracts signatures, receivers, and doc comments, and flags suspicious import patterns such as duplicates or likely-unused groups.

Its output favors looking before touching anything: a compact inventory of declarations, a short list of findings with impact and confidence, and a minimal patch plan naming the files and hunks involved along with exact verification commands. It avoids large automated rewrites without an explicit preview and passing tests first.

When your agent uses it

  • Needing a structure-aware list of functions, methods, or types in a Go package
  • Proposing a safe rename or signature change with its callers checked
  • Reviewing imports for duplicates or unused groups before a refactor

Example prompts

  • “List all exported methods on the Auth type with their file locations.”
  • “Propose a safe rename for the Validate method and check its callers.”
  • “Show me the signatures of every function in the payments package.”

What it can do on your machine

Read from SKILL.md and the folder at commit 38aab64. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • go

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Go AST Code Introspection loads about 414 tokens when it runs. Until then it costs about 37 tokens; SKILL.md has 168 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~37
When it runs · the whole SKILL.md, loaded when a task matches
~414

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from pilinux/gorest at commit 38aab64, republished under its MIT licence (© pilinux). 168 words, ~414 tokens.

Download SKILL.mdSave it as .claude/skills/ast-introspection/SKILL.md (or your agent's skills folder).
name
ast-introspection
description
Use Go AST-aware analysis to enumerate symbols, extract signatures, and propose mechanically safe refactors (read-only by default).
license
MIT
metadata.mode
analysis
metadata.purpose
go-ast

AST Introspection

When to Use

  • Need a structure-aware view (functions, methods, types, receivers) or a safe, mechanical refactor proposal that relies on code shape rather than string matches.

What This Skill Does

  • Enumerates package-level declarations (funcs, methods, types, const/var) with path:line citations.
  • Extracts function/method signatures, receivers, and doc comments.
  • Lists imports and flags suspicious patterns (duplicates, likely unused groups).
  • Proposes minimal, mechanically-safe refactors (rename, extract, signature change) with verification steps.

Rules

  • Prefer read-only inspection (glob, grep, targeted read) before any edit.
  • Always include path:line citations for code claims.
  • Never perform large automated rewrites without an explicit preview, tests, and verification commands.

Commands

  • Enumerate packages: go list ./...
  • Quick exported view: go doc <pkg>

Output

  • Inventory: compact list of declarations with path:line.
  • Findings: 2-8 concise bullets (impact + confidence).
  • Proposal: minimal patch plan (files/hunks) + exact verification commands.

Examples

  • "List all exported methods on type Auth with file locations."
  • "Propose a safe rename for method X and verify callers."
  • source-search (broad grep), code-navigation (impact mapping)

References

  • llms.txt (project knowledge base)

© pilinux, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/ast-introspection of pilinux/gorest.

Open the folder on GitHubat commit 38aab64

Compare with similar skills

Go AST Code Introspection next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Go AST Code Introspection compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Go AST Code Introspection this skillpilinux/gorest506—~414Automated safety check: PassMIT
Ponytail Lazy Developer ModeDietrichGebert/ponytail160k1 repos~873Automated safety check: PassMIT
Systematic Code Refactoringluongnv89/claude-howto42k—~3kAutomated safety check: PassMIT
Dignified Python Standardsdocling-project/docling69k—~1.5kAutomated safety check: PassApache-2.0
Clean Code GuardamElnagdy/guard-skills1.3k2 repos~4.3kAutomated safety check: PassMIT
Code Refactoring Workflowluongnv89/claude-howto42k—~3.1kAutomated safety check: PassMIT

Similar skills

  • Ponytail Lazy Developer Mode

    DietrichGebert/ponytail

    Makes the agent pick the laziest solution that works: skip unneeded work, reuse what exists, prefer the standard library and platform features, and keep diffs small.

    160k GitHub starsUsed in 1 repo~873 tokens
    DevelopmentAuto-check passed
  • Systematic Code Refactoring

    luongnv89/claude-howto

    Guides refactoring in phases based on Martin Fowler's method: research, test coverage check, planning and small tested steps, with your approval at each phase.

    42k GitHub stars~3k tokensUpdated today
    DevelopmentAuto-check passed
  • Dignified Python Standards

    docling-project/docling

    Applies opinionated production Python conventions chosen by the project's Python version: modern type syntax, pathlib, explicit checks and interface guidance.

    69k GitHub stars~1.5k tokensUpdated today
    DevelopmentAuto-check passed
  • Clean Code Guard

    amElnagdy/guard-skills

    Reviews generated or changed production code against Clean Code, SOLID, DRY, KISS, YAGNI and LLM-specific failure modes before it ships, in any language.

    1.3k GitHub starsUsed in 2 repos~4.3k tokens
    DevelopmentAuto-check passed
  • Code Refactoring Workflow

    luongnv89/claude-howto

    Guides systematic, test-backed refactoring in the style of Martin Fowler, moving through research, planning and small incremental changes with your approval at each phase.

    42k GitHub stars~3.1k tokensUpdated today
    DevelopmentAuto-check passed
  • A code-change gate for the iPolloWork repository: search and reuse first, keep one source of truth, justify every new file or dependency, and audit the change.

    6.8k GitHub stars~2.7k tokensUpdated yesterday
    DevelopmentAuto-check passed

More from pilinux/gorest

All 20 skills in this repo
  • Config Loader Helper

    pilinux/gorest

    Diagnoses configuration failures in the gorest project by listing the required environment variables grouped by feature and giving minimal commands for a safe local test setup.

    506 GitHub stars~441 tokensUpdated 15 days ago
    Auto-check passed
  • Local Build and Run

    pilinux/gorest

    Builds and runs a Go project locally to reproduce compile or runtime problems safely, using test environment variables and mocks instead of production credentials.

    506 GitHub stars~362 tokensUpdated 15 days ago
    Auto-check passed
  • Code Navigation

    pilinux/gorest

    Rapid, focused navigation to locate definitions/usages and map the impact of proposed changes.

    506 GitHub stars~354 tokensUpdated 15 days ago
    Auto-check passed
  • Cited Code Explainer

    pilinux/gorest

    Explains how a module behaves in a few short, read-only sections, with a path-and-line citation behind every non-trivial claim.

    506 GitHub stars~244 tokensUpdated 15 days ago
    Auto-check passed
  • Cited File Reader

    pilinux/gorest

    Reads only the lines needed from a source file and answers with a short summary and path:line citations, without changing anything.

    506 GitHub stars~250 tokensUpdated 15 days ago
    Auto-check passed
  • Fix Suggester

    pilinux/gorest

    Diagnose failures and propose minimal, test-backed fixes with verification and rollback instructions.

    506 GitHub stars~251 tokensUpdated 15 days ago
    Auto-check passed

Works with

Categories

Questions about Go AST Code Introspection

What does Go AST Code Introspection do?

Enumerates Go declarations and signatures from the syntax tree, then proposes small, mechanically safe refactors with file and line citations. This skill reads Go source through its syntax tree rather than string matching, listing package-level functions, methods, types, and const or var declarations together with a path and line number. It extracts signatures, receivers, and doc comments, and flags suspicious import patterns such as duplicates or likely-unused groups.

When should I use Go AST Code Introspection?

Go AST Code Introspection fits situations like: needing a structure-aware list of functions, methods, or types in a Go package; proposing a safe rename or signature change with its callers checked; reviewing imports for duplicates or unused groups before a refactor.

How do I install Go AST Code Introspection in Claude Code?

Run `npx skills add pilinux/gorest --skill ast-introspection -a claude-code`. Or copy the skill folder (.agents/skills/ast-introspection in pilinux/gorest) into .claude/skills/ast-introspection in your project. Claude Code loads it when a task matches its description.

How do I install Go AST Code Introspection in Codex?

Run `npx skills add pilinux/gorest --skill ast-introspection -a codex`. Or copy the skill folder (.agents/skills/ast-introspection in pilinux/gorest) into .agents/skills/ast-introspection in your project. Codex loads it when a task matches its description.

Can I use Go AST Code Introspection in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add pilinux/gorest --skill ast-introspection -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/ast-introspection, .gemini/skills/ast-introspection, .github/skills/ast-introspection and .opencode/skills/ast-introspection in your project.

What does Go AST Code Introspection need to run?

Going by SKILL.md and its folder, Go AST Code Introspection needs the command-line tools its instructions call (go).

Does Go AST Code Introspection access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Go AST Code Introspection safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Go AST Code Introspection use?

Go AST Code Introspection is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Go AST Code Introspection use?

About 414 tokens (SKILL.md is roughly 1.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Go AST Code Introspection?

Skills that share tags, products or a category with Go AST Code Introspection: Ponytail Lazy Developer Mode (DietrichGebert/ponytail, 160k stars), Systematic Code Refactoring (luongnv89/claude-howto, 42k stars), Dignified Python Standards (docling-project/docling, 69k stars) and Clean Code Guard (amElnagdy/guard-skills, 1.3k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Go AST Code Introspection?

pilinux (a GitHub user) maintains it in pilinux/gorest, which has 506 GitHub stars. The repository holds 20 skills in this directory. The repository was last updated on September 25, 2026.

Source: pilinux/gorest on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.