lucene-kmp: Skill for Claude Code

.agents/skills/speedup_native/SKILL.md

speedup_native is a skill for Claude Code, Codex from nehemiaharchives/lucene-kmp. It costs 32 tokens per session (1,002 once invoked), scanned A, original, Apache-2.0.

A workflow for finding and fixing performance problems in Kotlin/Native, Kotlin's compiler and runtime for native platforms. It compares the same test on JVM and Native targets, measures each phase, and applies small platform-specific changes.

In plain words
What is it for?
Use it when Kotlin/Native code is slower than its JVM version, especially in Kotlin Multiplatform projects, to reproduce the issue, profile it, and make minimal expect/actual optimizations.
Why use it?
It replaces guesswork with repeatable measurements and helps isolate the slowest step before code is changed.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

This is nehemiaharchives/lucene-kmp's own configuration. It tells Claude Code and Codex how to work on lucene-kmp itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything lucene-kmp configures →

Reuse

Borrowing it

Nothing to install: this file belongs to nehemiaharchives/lucene-kmp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/nehemiaharchives/lucene-kmp/master/.agents/skills/speedup_native/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/nehemiaharchives/lucene-kmp

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for speedup_native

README.md
[![agentmods](https://agentmods.dev/badge/skills/nehemiaharchives/lucene-kmp/speedup_native/github.svg)](https://agentmods.dev/skills/nehemiaharchives/lucene-kmp/speedup_native)
Your own site
<a href="https://agentmods.dev/skills/nehemiaharchives/lucene-kmp/speedup_native"><img src="https://agentmods.dev/badge/skills/nehemiaharchives/lucene-kmp/speedup_native/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for speedup_native

Your own site · 80×15
<a href="https://agentmods.dev/skills/nehemiaharchives/lucene-kmp/speedup_native"><img src="https://agentmods.dev/badge/skills/nehemiaharchives/lucene-kmp/speedup_native.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 32 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,002 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00032 $0.01002
Opus 5.5 $0.00013 $0.00401
Sonnet 5.5 $0.00006 $0.00200
Haiku 4.5 $0.00003 $0.00100

Measured 16d ago against content hash 8863a600d5dc, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

speedup_native scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 16d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/speedup_native/SKILL.md · 111 lines

How it starts

The opening of the file, as written. The whole thing — 111 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Purpose

Use this skill when a test or code path is significantly slower on Kotlin/Native than JVM and you need a reliable, repeatable way to find and fix the lowest-level bottleneck.

Scope

  • Kotlin Multiplatform projects with JVM + Native targets.
  • Works best when one target is clearly slower (for example, linuxX64Test vs jvmTest).
  • Focuses on minimal-risk optimizations that preserve behavior.

Core Principles

  1. Reproduce first, optimize second.
  2. Measure with monotonic clocks, not assumptions.
  3. Always isolate the lowest-level slow step before patching.
  4. Keep patches minimal and reversible.
  5. Prefer compile/test truth over IDE false negatives for expect/actual wiring.

End-to-End Workflow

1. Reproduce with smallest failing/slow test

  • Run exactly one test method that exhibits slowness.
  • Keep both target runs comparable (same method, same data).

2. Add phase-level timing in test (coarse)

  • Use TimeSource.Monotonic.markNow().
  • Add logs for major phases only first.
  • Include total elapsed and per-phase elapsed.

3. Compare JVM vs Native and pick worst phase

  • Identify the phase with the largest native/JVM ratio.
  • Ignore small differences; chase the dominant hotspot.

4. Add substep timing inside worst phase (fine)

  • Split compound calls into substeps (a().b() -> time a and b separately).
  • Iterate until one substep clearly dominates native time.

5. Move instrumentation into production hot function (lowest level)

  • Add temporary counters around internal branches/subcalls in the suspected function.
  • Confirm the exact low-level operation causing native overhead.

6. Add dedicated reproducible performance test

  • Create a small deterministic perf test in relevant test class.
  • Keep correctness assertions plus one timing output line.
  • Ensure it exercises the exact hot path repeatedly.

7. Implement minimal expect/actual optimization

  • Keep common API identical.
  • Introduce expect in common only where needed.
  • Add minimal actual implementations:
    • JVM path: preserve existing behavior (baseline path).
    • Native path: optimized implementation for confirmed bottleneck.
  • Prefer smallest patch that changes only the hot operation.

Read the full file on GitHub · 111 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 16d ago First seen · 111 lines · 32 tokens per session scan A 8863a600d5dc

Subscribe to this mod's changes

speedup_native is a skill published in the GitHub repository nehemiaharchives/lucene-kmp (11 stars, last pushed 13d ago), licensed Apache-2.0. It adds 32 tokens to every session and 1,002 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-21.

Related

speedup_native compared with skills from other repositories

speedup_native next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
speedup_nativenehemiaharchives/lucene-kmpSkill1113d agoApache-2.0A32Claude Code, Codex
kotlin-tooling-native-build-performanceKotlin/kotlin-agent-skillsSkill1.1k7d agoApache-2.0A96Claude Code, Codex
compose-multiplatformericrisco/rsc-harnessSkill5032d agoMITA80Claude Code, Codex
compose-performancechrisbanes/skillsSkill1.1kyesterdayApache-2.0A42Claude Code
extract-apkniki914/zafiroSkill3404d agoMITA105Claude Code, Codex
test-hang-watchdogniki914/zafiroSkill3404d agoMITA66Claude Code, Codex
assistant-add-supportniki914/zafiroSkill3404d agoMITA61Claude Code, Codex