kotlin/interacting_with_project_runtime
> Provides a persistent, project-aware Kotlin REPL for rapid logic verification and prototyping within the project's JVM classpath; use for testing dynamic behavior, prototyping snippets, or rendering Compose UI previews. Do NOT use for exploring library APIs (prefer `searching_dependency_sources`) or running Gradle builds.
npx skills add https://github.com/Kotlin/kotlinx-rpc --skill interacting_with_project_runtime
Probes project logic, tests utility functions, and interacts with the JVM runtime of your source sets with absolute precision using a project-aware REPL.
search_dependency_sources and read_dependency_sources for exploring unfamiliar library APIs.kotlin_repl instead of a standalone Kotlin REPL for project-aware interaction.projectRoot.projectPath and sourceSet (e.g., main, test).stop then start) after modifying project source code to pick up changes in the classpath.responder API for rich output (images, markdown) to improve diagnostic visibility.stop when finished.expose. Use search_dependency_sources to find definitions and read_dependency_sources to analyze them.
kotlin_repl tool provides full access to the project's exact classpath, dependencies, and source sets. NEVER attempt to use standalone runners for project-internal logic.projectPath (e.g., :app) and sourceSet (e.g., main for application code, test for test utility access).stop and then start the session again to pick up the updated classes.responder: ALWAYS use responder.render(value) or specialized methods (markdown, image, html) to return rich content.envSource: SHELL if environment variables are missing: If the REPL fails to find expected environment variables (e.g., JAVA_HOME or specific JDKs), it may be because the host process started before the shell environment wasfully loaded. Set env: { envSource: "SHELL" } when calling start to force a new shell process to query the environment.
{baseDir} manually: If your environment does not automatically resolve the {baseDir} placeholder in reference links, treat it as the absolute path to the directory containing this SKILL.md file.:app) and source set (e.g., main).kotlin_repl(command="start").env for environment variables or additionalDependencies if you need external libraries not currently in the project.kotlin_repl(command="run") with your Kotlin code.responder.render() for rich diagnostics.kotlin_repl(command="stop") once your investigation is complete to release system resources.// Start the session
{
"command": "start",
"projectPath": ":my-project",
"sourceSet": "main"
}
// Execute the probe
{
"command": "run",
"code": "import com.example.utils.MyHelper\nMyHelper.calculateSum(1, 2)"
}
// Reasoning: Using kotlin_repl to verify a utility function in the context of the main source set.
import androidx.compose.ui.test.*
import com.example.ui.MyComposable
runComposeUiTest {
setContent { MyComposable() }
val bitmap = onRoot().captureToImage()
responder.render(bitmap)
}
// Reasoning: Using the responder API to retrieve a high-resolution image of a Compose component.
start successfully before calling run.sourceSet (e.g., test if the class is in src/test/kotlin).stop and start the REPL to refresh the classpath.Take kotlin/interacting_with_project_runtime from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.