npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@kidkender/archmind-go-parser

v0.3.0

Published

Static analysis parser for Go/Gin projects — extracts routes, middleware chains (including runtime skip-lists), and auth patterns into ArchMind IR graphs.

Readme

@kidkender/archmind-go-parser

Go/Gin adapter for ArchMind. Turns a Gin project into one execution graph per route: the route, its authentication and authorization checks, input validation and database transaction boundary.

Uses tree-sitter (no Go toolchain needed to parse).


Install

npm install @kidkender/archmind-go-parser

Usage

import { isGinProject, parseGinProjectAt } from "@kidkender/archmind-go-parser"

if (isGinProject(root)) {
  const graphs = parseGinProjectAt(root)   // IntermediateExecutionGraph[], one per route
  for (const g of graphs) console.log(g.entrypoint, g.nodes.map((n) => n.type))
}

parseGinProjectAt reads the project's archmind.json itself. parseGinProject(files, options) takes an already-read file list (used in tests and by tools that hold the sources in memory).

Most of ArchMind uses it through @kidkender/archmind-analysis, the CLI (archmind trace, archmind findings) and the MCP server, which detect a Go project from go.mod and a gin-gonic/gin dependency.


What it extracts

  • Routes, including registration spread over several function layers (main() → RegisterRoutes() → RegisterXRoutes()) and a router built in a factory function (func NewRouter() *gin.Engine).
  • Authentication gates, including a globally applied middleware that exempts routes through a runtime skip-list read from the middleware's own body. Role and permission arguments resolve Go constants (model.RoleAdmin → "admin").
  • Authorization checks: role/policy middleware, and ownership checks. A handler that calls one of the functions named in archmind.json → authorization.ownershipSources (for example ["currentCharacter"]) is treated as authorizing by ownership.
  • Validation gates: ShouldBindJSON, ShouldBindQuery and ShouldBindUri resolved to the DTO struct and its binding tags.
  • Transaction boundaries: GORM .Transaction(func...) closures, followed one hop into a directly called service method.
  • A handler wired up as a local variable (h := handler.NewXxx(...)) is resolved to its type.

Nodes carry the file and line where the parser found them.

Helpers it exports

The tree-sitter helpers other packages build on: parseGo, walk, receiverTypeName, bareTypeName, functionParamTypes, findFunctionDecls; and the file scanner findGoFiles / readGoProjectFiles (option includeTests to include _test.go). @kidkender/archmind-lens uses them for its call graph.

Configuration

archmind.json at the project root:

{
  "authorization": { "ownershipSources": ["currentCharacter", "UserId"] },
  "ignoreFindings": ["missing_authorization"]
}

Limits

  • Scoped to the Gin + GORM + internal/{handler,service,middleware,model,dto} layout it was built against, and checked on other public Gin repositories. Some architectures still return no routes (an engine held in a struct field and mutated by a method, a custom wrapper type with its own .GET(), deeply functional-options setups, Wire-style injection).
  • Tenant isolation is not implemented for Go.

License

MIT