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

starchainx

v0.4.12

Published

Extract business knowledge (state machines, method contracts, data flows, API contracts) from Java Spring Boot source code into a queryable SQLite index

Downloads

2,569

Readme

starchainx

Extract business knowledge from Java Spring Boot source code into a queryable SQLite index.

Automatically discovers state machines, method contracts, business rules, cross-module data flows, API contracts, and more — from code structure, not from comments or documentation.

Quick Start

# Requires Node.js >= 22.5
npx starchainx init --path /path/to/java/project
npx starchainx query entity PurchaseOrder

What It Extracts

| Dimension | Description | |-----------|-------------| | Entity Profiles | Service classes, their repositories, domain classes, controllers | | State Machines | States, transitions with from/to, trigger methods, terminal states | | Method Contracts | Preconditions, postconditions, invariants per method | | Business Rules | Guard checks with conditions, error messages, rule types | | Data Flows | Cross-module client calls with success/failure handlers | | API Contracts | HTTP endpoints with request/response types, preconditions, side effects | | Impact Chains | Cross-module effect propagation paths | | Glossary | Status enum values, business exceptions, domain entities | | Table Ownership | Which modules write to which tables |

Commands

starchainx init [--path <dir>]                    # Detect project, create config, full scan
starchainx scan [--path <dir>]                    # Re-run full pipeline

starchainx query entity <name> [--explain] [--json]  # Entity profile + state machine + methods
starchainx query api [path] [--module <name>]        # API contracts
starchainx query flow <entity> [--target <module>]   # Cross-module data flows
starchainx query impact <method>                     # Impact chains
starchainx query glossary [--module <name>]          # Business glossary
starchainx query table [name] [--module <name>]      # Table ownership

starchainx rules explain --method <Class.method>     # Why a pattern was matched
starchainx review semantics                          # Low-confidence detections
starchainx profile show                              # Inferred project profile

Architecture

Java source code
  |
  v
Layer 1: Raw Fact Extractor        tree-sitter AST -> 4 fact types (invocation, conditional, field access, object creation)
  |
  v
Layer 1.5: Project Profiler        Auto-infer modules, roles, status fields, terminal values
  |
  v
Layer 2: Semantic Rule Engine      Declarative YAML rules (preset + profile + user override)
  |
  v
Layer 3: Pattern Store + Links     Patterns with confidence + declarative link rules
  |
  v
Layer 4: Semantic Assemblers       9 dimensions of business knowledge

Configuration

Zero-config by default. The built-in spring-boot-default preset covers standard Spring Boot / MyBatis projects.

To customize, create .starchainx/rules.yaml in your project:

roles:
  repository:
    type_suffix: [Repository, Mapper, Dao, Store]
  app_service:
    type_suffix: [AppService, UseCase, Handler]

domain:
  status_field_names: [status, state, orderStatus]
  terminal_status_names: [CANCELLED, COMPLETED, CLOSED, DELETED]

patterns:
  - id: my-custom-rule
    emits: STATUS_UPDATE
    role: update
    from: RAW_INVOCATION
    when:
      all:
        - receiver_role: repository
        - method_name_regex: "^transition[A-Z]"
    extract:
      normalized_value: method_name_suffix_upper_snake
    confidence: 0.85

Requirements

  • Node.js >= 22.5 (uses node:sqlite)
  • Java source code (analyzed via tree-sitter, no compilation needed)

License

MIT