ast-introspection
Installation
SKILL.md
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:linecitations. - 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:linecitations 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
Authwith file locations." - "Propose a safe rename for method X and verify callers."
Related Skills
source-search(broad grep),code-navigation(impact mapping)
References
llms.txt(project knowledge base)
Related skills
More from pilinux/gorest
file-reader
Precisely read source files or snippets and return concise, citation-backed facts needed for decisions or edits.
27code-navigation
Rapid, focused navigation to locate definitions/usages and map the impact of proposed changes.
7fix-suggester
Diagnose failures and propose minimal, test-backed fixes with verification and rollback instructions.
7build-run
Build and run the project locally to reproduce compile/runtime issues in a safe, non-production way.
7logs-repro-harness
Reduce flaky or environment-dependent failures to a minimal, reproducible script and capture the exact logs and error lines.
7ci-orchestrator
Run a CI-like pipeline locally (format, lint, vet, static-analysis, tests) and summarize per-step results with remediation guidance.
6