lucene-kmp: Instructions file for Codex

AGENTS.md

lucene-kmp AGENTS.md is an instructions file for Codex, OpenCode from nehemiaharchives/lucene-kmp. It costs 4,694 tokens per session, scanned B, original, Apache-2.0.

A project instruction file for porting Apache Lucene from Java to Kotlin Multiplatform. Kotlin Multiplatform lets Kotlin code target multiple platforms, and the instructions require the port to preserve the Java version's behaviour while using platform-specific replacements when necessary.

In plain words
What is it for?
Use it to guide Lucene porting work, unit-test and code-history checks, Kotlin/Native debugging, and decisions about platform-specific code.
Why use it?
It tells a coding agent which source is read-only, what changes are allowed, and how to investigate logging, debugging, and hangs during the port.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions Codex.

This is nehemiaharchives/lucene-kmp's own configuration. It tells Codex and OpenCode 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.md
Clone the repo
git clone --depth 1 https://github.com/nehemiaharchives/lucene-kmp

Made for: Codex, OpenCode.

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 lucene-kmp AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/nehemiaharchives/lucene-kmp/agents-md/github.svg)](https://agentmods.dev/instructions/nehemiaharchives/lucene-kmp/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/nehemiaharchives/lucene-kmp/agents-md"><img src="https://agentmods.dev/badge/instructions/nehemiaharchives/lucene-kmp/agents-md/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 lucene-kmp AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/nehemiaharchives/lucene-kmp/agents-md"><img src="https://agentmods.dev/badge/instructions/nehemiaharchives/lucene-kmp/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 4,694 This file is loaded in full into every session.
When invoked 4,694 The same file — it is already loaded in full.
Security scan B 1 finding. 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.04694 $0.04694
Opus 5.5 $0.01878 $0.01878
Sonnet 5.5 $0.00939 $0.00939
Haiku 4.5 $0.00469 $0.00469

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

Security

Grade B, and why

lucene-kmp AGENTS.md scanned grade B with 1 finding 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.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

- `sudo /usr/bin/earlyoom -r 60 --prefer '(^|/)(gradle|gradlew|java|kotlinc)( |$)' --avoid '(Xorg|Xwayland|gnome-shell|plasmashell|kwin_wayland)'`
AGENTS.md · 215 lines

How it starts

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

Project Overview

I'm porting apache lucene from java to platform agnostic kotlin common code. This project is a sub directory under the the root directory of the porting project and the directory name is lp. Under this directory you find two sub directories:

  1. lucene sub directory This is the source code of java lucene. the commit id is fixed to ec75fcad5a4208c7b9e35e870229d9b703cda8f3 until all java classes/unit tests ported. After all ported, the project will proceed to the next phase to port commit by commit from this commit id to catch up with the latest lucene code. The code will be ported from this read-only repository.

  2. lucene-kmp (kmp stands for kotlin multiplatform) sub directory, which is THIS project

Porting Guideline

  • The GitHub copilot never make any change to lucene java source code but only read, copy from, analyze and answer question based on its content. If it's in agent mode, it can use git commands which does not change any code but only read the code and history.

  • Do not deviate from Java Lucene logic. The Kotlin port must be an exact behavioral port. Only deviate when unavoidable for KMP (e.g., okio for IO, coroutines for threading). Any deviation must be explicitly justified and minimized.

  • Exception for development speed: Java-Kotlin numeric-value discrepancies are allowed only when reducing test/runtime iteration counts to speed up local iteration or CI.

  • Speed-up reductions must be order-of-magnitude changes, not tiny tweaks:

    • Target example: if a test takes ~10 minutes, reduce to ~3 seconds when possible.
    • Numeric example: if iteration/repeat is 1000, reduce to 10; if still >30 seconds, reduce to 3.
    • Counter example: do not treat small edits like 19 -> 15 as sufficient speed-up by default.
  • For every such discrepancy, add an inline comment immediately after the exact reduced line (not above it).

  • Required comment format:

    • Starts with // TODO
    • States the reduction values explicitly (example: reduced valueA = x1 to x2, valueB = y1 to y2)
    • Ends with for dev speed
    • Example: // TODO reduced valueA = 1025 to 5, valueB = 500 to 3 for dev speed

Read the full file on GitHub · 215 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 · 215 lines · 4,694 tokens per session scan B cf3052277605

Subscribe to this mod's changes

lucene-kmp AGENTS.md is an instructions file published in the GitHub repository nehemiaharchives/lucene-kmp (11 stars, last pushed 13d ago), licensed Apache-2.0. It adds 4,694 tokens to every session, about $0.0188 per session on Opus 5.5. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-21.

Related

lucene-kmp AGENTS.md compared with instructions from other repositories

lucene-kmp AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
lucene-kmp AGENTS.mdnehemiaharchives/lucene-kmpInstructions file1113d agoApache-2.0B4,694Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode