xerj-code
यह क्या करती है
यह स्किल खुले स्रोत कोड में काम करने वाले संदर्भ implementations खोजती है, उन्हें स्थानीय रूप से इंडेक्स करती है, और नया कोड लिखने से पहले सटीक अंश निकालती है। यह उन डेवलपरों के लिए है जो किसी अनजान लाइब्रेरी के साथ काम करते हैं या कोई algorithm पोर्ट करते हैं।
कब इस्तेमाल करें
- ✓जब आप किसी ऐसे API पर काम शुरू करें जिसे आप अच्छी तरह नहीं जानते।
- ✓जब आप कोई algorithm पोर्ट कर रहे हों और उसका संदर्भ संस्करण चाहिए।
- ✓जब आप एक ही सुधार दो बार आज़मा चुके हों और वह बार-बार फ़ेल हो रहा हो।
Skill का लिंक
https://github.com/xerj-org/xerj/blob/main/tools/xerj-code/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“इस लाइब्रेरी के seal function में मुझे लगातार त्रुटियाँ मिल रही हैं। कोई काम करने वाला संदर्भ implementation खोजिए और उसका सटीक तरीका इस्तेमाल कीजिए।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
स्किल उन repositories को क्लोन करती है जिनमें पहले से सही implementation है, उन्हें इंडेक्स करती है, और काम के लिए ज़रूरी अंश निकालती है। संदर्भ पढ़ने में input tokens लगते हैं, न कि कोड लिखने की बार-बार कोशिशों में।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
XERJ.code — reference coding
An agent that does not know an API guesses, runs, fails, and guesses again. Each lap costs output tokens, which are the expensive kind. This skill replaces laps with a lookup: clone the repositories that already contain a correct implementation, index them with XERJ, and retrieve the passage before writing.
The trade is deliberate. Retrieval spends input tokens, which are cheaper per
token and cacheable; loops spend output tokens. See COSTS.md for
the arithmetic and for the conditions under which this trade loses.
Status, stated plainly: measured, and the value is real but narrow. (Full case study with real tokens and dollars:
docs/case-studies/reference-coding/CASE_STUDY.md, 2026-08-05.)The comparison that matters is against native Claude Code — the same agent with tools that would grep the source itself — not a bare model. Measured across three regimes, same agent, one objective verdict (compiles + passes hidden tests):
- Unfamiliar code with a contract the model can't recall (a seal, a generational handle, a lazy refill, a specific hash scheme — measured across seven purpose-built libraries, 21 runs): native and xerj both solve 21/21; xerj uses 1.5× fewer output tokens and costs 1.3× less than native, because retrieval replaces the grep. Pure memory fails 1/21 and burns 6.5× the cost flailing. This is the win, and it is decisive. The compiler can leak an API name across a retry loop, but never a contract.
- Memorised code (any popular public crate — even a 256-value table, or a protobuf-style varint): retrieval is overhead. Pure memory is cheapest; injecting a big reference can be the worst arm, because the model re-emits what it was handed.
So: use this when the reference is code the model has not memorised — your own private/proprietary code, an internal API, a post-cutoff or niche library. On public library references the model already knows, it costs more than it saves. The native-vs-xerj gap grows with corpus size (grep pulls the whole tree into context; retrieval pulls one passage).
Since #977 the whole loop is
inside the xerj binary — xerj corpus add / xerj corpus index /
xerj code — plus the xerj_code_search MCP tool for agents without a shell.
The old wrapper scripts (xc-corpus.sh, xc-index.sh, xc.py) are gone; your
existing ~/.xerj-code corpora and indexes work unchanged (see
Migration below).
Standing corpora for this repository (MANDATORY since 2026-08-06)
In the xerj repo, retrieval-before-writing is required for non-trivial
engine work, not optional. Each corpus below has a pinned, licence-reviewed
definition in hub/ — xerj corpus add --from hub/<name>.json rebuilds
it at the same commits anyone else is using:
| corpus | projects | use it for |
|---|---|---|
xerj-search |
lucene, tantivy, meilisearch, quickwit, sonic, elasticsearch | FTS, BM25, postings, merge policy, typo tolerance, segment layout, ES wire semantics |
xerj-vector |
qdrant, usearch, instant-distance, hnswlib | HNSW build, neighbour heuristics, quantisation, filtered kNN |
xerj-storage |
sled, fjall, redb | WAL, flush epochs, crash recovery, compaction, page allocation |
xerj-columnar |
clickhouse | columnar storage, aggregation execution, compression codecs, vectorised scans |
Approach-only sources: elasticsearch (AGPL-3.0 / SSPL-1.0 / Elastic-2.0)
and sonic (MPL-2.0). Never copy their code into Apache-2.0 XERJ; for ES,
pasting source would also falsify the project's public "shares no code with
Elasticsearch" claim. meilisearch is MIT at the core but BUSL-1.1 for its
Enterprise Edition parts — check the header/path first. Read the design,
write our own implementation. Each manifest's review.use field says which
bucket a repo is in; hub/README.md explains the three.
Hub corpus or local corpus
Two kinds of corpus sit on the same local node. Each answers a different kind of question:
| hub corpus | local corpus | |
|---|---|---|
| what it holds | public material at a pinned commit: a library's source, a standard, a regulation, an advisory feed | files only this machine has: the project y |
अक्सर पूछे जाने वाले सवाल
क्या यह हमेशा सस्ता होता है?
नहीं। केस स्टडी उन परिस्थितियों का ज़िक्र करती है जिनमें यह तरीका पीछे रहता है, इसलिए लाभ वास्तविक है पर सीमित।
इसकी तुलना किससे की गई?
उसी coding एजेंट से जिसके पास अपने खोज टूल हों, न कि किसी सादे model से।
क्या यह मेरे लिए कोड लिखता है?
कोड एजेंट लिखता है, पर वह implementation को प्राप्त संदर्भ अंश पर आधारित करता है।
जानकारी
लेखक का मूल विवरण
Reference-coding with XERJ. Clone the libraries that already solved your problem, index them locally, and retrieve the exact implementation before writing code — so the agent reads passages instead of re-deriving algorithms across retry loops. Use when starting a task in an unfamiliar API, porting an algorithm, or when you have already looped twice on the same error.
repo: xerj-org/xerj
लोकप्रियता
- GitHub स्टार
- 19k
- रैंकिंग में स्थान
- #10506
- लाइसेंस
- Apache-2.0
- अपडेट की गई
- 2/11/2026
कमेंट
- …
इस repository की और skills
xerj-security-audit
19kआपके एजेंट को किसी कोडबेस का whitebox सुरक्षा ऑडिट चलाने में मदद करती है, हर जोखिम भरी कॉल खोजती है और सबूत दर्ज करती है कि समीक्षा ने उन्हें कवर किया।
xerj
19kआपके एजेंट को फ़ोल्डर इंडेक्स करने, डेटा खोजने या एजेंट memory सेट करने से पहले XERJ के मौजूदा दस्तावेज़ और अनुबंध खोजने में मदद करती है।
xerj-knowledge
19kआपके एजेंट को आपके अपने स्थानीय दस्तावेज़, नोट्स, PDF, स्प्रेडशीट और मेल में खोजने देती है, और हर जवाब किस फ़ाइल और पेज से आया, यह बताती है।
मिलती-जुलती skills
diffs
394kयह आपके एजेंट को बदलावों का असली diff बनाने देती है, जिसे व्यूअर लिंक या इमेज फ़ाइल के रूप में साझा किया जा सकता है, हाथ से लिखे सारांश के बजाय।
coding-agent
394kयह आपके एजेंट को बड़े कोडिंग काम Codex, Claude Code या OpenCode को बैकग्राउंड वर्कर के रूप में सौंपने, फिर उसकी प्रगति जांचने में मदद करती है।
gh-issues
394kयह आपके एजेंट को GitHub issues खोजने, उनमें से काम करने लायक चुनने, और सुधार के साथ pull requests खोलने में मदद करती है, जिसमें समीक्षा टिप्पणियों का फ़ॉलो-अप भी शामिल है।