SkillAgentSearch skills...

Inspekt

Compile time, multiplatform reflection for Kotlin

Install / Use

/learn @rnett/Inspekt
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Stability: ALPHA Maven Central Version Maven snapshots Documentation GitHub License

Inspekt

100% multiplatform, 100% compile time reflection for Kotlin. Includes:

  • Inspecting classes, functions, and properties
  • Top-level declaration support
  • Annotation instances
  • Function invocation, including suspend functions
  • is checking and casting
  • JVM-like proxies
  • Reflecting over dependencies (whether they use Inspekt or not)
  • Seamless reflection over Java classes
  • GraalVM compatible out of the box (I think, it's not tested yet)

Getting started

To use Inspekt, just apply the Gradle plugin:

plugins {
    id("dev.rnett.inspekt") version "<version>" // see the Maven Central badge above
}

and call inspekt from your code:

val fooClass = inspekt(Foo::class)

foo.function("bar").invoke {
    dispatchReceiver = Foo()
}

[!WARNING] Compatibility with other compiler plugins depends on the plugin and is not at all guaranteed or even expected to work. Use at your own risk. It will most likely work for declarations generated by other plugins if you use the compiler plugin ordering parameter to ensure Inspekt (which has id dev.rnett.inspekt.compiler-plugin) runs after the other plugin(s).

It is 0% compatible with @Composable functions.

Documentation

More detailed documentation is available at https://inspekt.rnett.dev/latest/.

Snapshot version docs are available at https://inspekt.rnett.dev/snapshot/, if there is currently a next-version snapshot build.

Stability

This library has been initially released as alpha because it depends on a number of compiler internals. However, I plan no significant changes and will strive to avoid any backwards incompatible changes.

Examples

Some basic examples are located in the examples directory.

View on GitHub
GitHub Stars41
CategoryDevelopment
Updated7h ago
Forks0

Languages

Kotlin

Security Score

95/100

Audited on Mar 27, 2026

No findings