Sign in Get 3 free credits

Try a job or a niche: tiktok captions, study notes, excel formulas. Press Esc to close.

Geohash in TypeScript and Rust

Implements and debugs geohash encoding, neighbours and nearby search, so location queries return the right places.

What we improved

SKILL.md was a table of contents. It now carries the method: the fundamentals, a cell size table, a reference TypeScript implementation (encode, decode to a box, neighbours, the 3x3 block), how to choose a length, the proximity and box quer

Improved by YourAISkill from the original by pproenca, under its MIT licence. The download includes the author's licence and a CHANGES.md listing every change. Both Claude reviews read the improved version.

Claude's review

8/10 Correct, tested geohash implementation (verified neighbours, antimeridian and poles), precision and query rules and 42 rule files; the codebase-as-map half is speculative and makes the skill less focu

We asked Claude the question you would ask: would I be glad I installed this? Two separate reviews, the second blind to the first, must both rate a skill 7 or higher before we sell it.

In detail

Geohash encoding/decoding in TypeScript or Rust — bit interleaving, the base32 alphabet, precision and cell geometry, neighbour/adjacency computation, proximity and bounding-box queries, and geohash-backed spatial indexing. Also covers the "codebase as a navigable 2D map" pattern — projecting a codebase into a coordinate plane, geohashing it so prefixes become business-domain regions, and navigating it like Google Maps (zoom, tiles, level-of-detail, clustering, deep links). Trigger when implementing, reviewing, or debugging geohash work — even when the user does not say "geohash" but the work involves spatial hashing, Morton/Z-order codes, proximity search on lat/lon, or mapping and visualising code structure spatially. Contains 42 impact-ordered rules with TypeScript and Rust examples.

How you use it

  1. Add it to your pack, then download your pack (1 credit).
  2. In Claude, open Customize > Skills and upload the zip. Code execution needs to be on under Settings > Capabilities.
  3. Ask Claude for the job in your own words. It uses the skill when your request matches what it does. Step by step guide

Safety check

Nothing risky found: no hidden instructions, no download and run, no reading of saved passwords or keys.

An automated scan lowers risk but cannot promise zero risk. How we check skills

Preview

The first lines of SKILL.md
---
name: geohash-spatial-code-maps
description: "Geohash encoding and decoding in TypeScript or Rust: bit interleaving, the base32 alphabet, precision and cell geometry, neighbour and adjacency computation (antimeridian and poles included), proximity and bounding-box queries, and geohash-backed indexing in Postgres, Redis or plain key-value stores. Also covers the 'codebase as a navigable 2D map' pattern: projecting a codebase into a plane from its dependency graph, geohashing it so prefixes become business-domain regions, and navigating it like a slippy map (zoom, tiles, level of detail, clustering, deep links). Use when implementing, reviewing or debugging geohash code, even when the user does not say 'geohash' but the work involves spatial hashing, Morton or Z-order codes, nearby search on lat/lon, or mapping code structure spatially. Includes a tested reference implementation and 42 rules with incorrect and correct examples."
---

<!-- Modified by YourAISkill (youraiskill.com) on 2 December 2026 from the original by pproenca. See CHANGES.md. -->

# Geohash and Spatial Code Maps

How to implement geohashes correctly in TypeScript and Rust, query and index them at scale, and apply them to the "codebase as a navigable 2D map" pattern. This file carries the method and a tested reference implementation; `references/` holds 42 short rules, each with an incorrect and a correct example and "when not to apply" notes. A name in double brackets, such as [[enc-base32-alphabet]], is the rule file of that name in `references/`.

**Scope.** Encoding, precision, neighbours, queries, decoding and indexing are textbook geohashing (the geohash scheme as documented on Wikipedia and geohash.org, the davetroy/geohash-js neighbour tables, Redis, Elasticsearch). The codebase-map and navigation parts are a **novel synthesis**: there is no canonical "geohash your codebase" library, so those rules adapt established techniques (graph layout, Z-order keys, slippy-map tiling, software cartography) and say when the pattern is overkill.

## Fundamentals (get these exactly right)

- **Alphabet:** `0123456789bcdefghjkmnpqrstuvwxyz` (no a, i, l, o). Not RFC 4648 base32. [[enc-base32-alphabet]]
- **Bit order:** the first bit is longitude, then latitude, alternating. Swapping them produces hashes no other tool can read. [[enc-interleave-longitude-first]]
- **Five bits per character.** Length L has ceil(5L/2) longitude bits and floor(5L/2) latitude bits. [[enc-five-bit-char-boundary]]
- **Binary chop:** recompute `mid = (lo + hi) / 2` from the live interval at every step; never accumulate a precomputed step. [[enc-binary-chop-no-float-drift]]
- **Input:** reject NaN and infinities, clamp latitude to [-90, 90], wrap longitude into [-180, 180). [[enc-normalize-input-domain]]
- **Decode to a box,** not a point. The centre is accurate to plus or minus half the cell on each axis. [[dec-decode-to-bbox]], [[prec-error-is-half-cell]]
- **Coarsen by truncating the string** (or shifting the integer), never by decode then re-encode. [[dec-avoid-roundtrip-reencode]]

### Cell sizes

Cells are square in degrees at odd lengths and twice as wide as tall at even lengths. East-west metres shrink with cos(latitude) ([[prec-cells-shrink-toward-poles]]); the figures below are at the equator, where cells are widest.

| Length | Cell (width x height) | Worst-case error (half diagonal) |
|---|---|---|
| 1 | 5,009 km x 5,009 km | 3,542 km |
| 2 | 1,252 km x 626 km | 700 km |
| 3 | 157 km x 157 km | 111 km |
| 4 | 39.1 km x 19.6 km | 21.9 km |
| 5 | 4.89 km x 4.89 km | 3.46 km |
| 6 | 1.22 km x 611 m | 684 m |
| 7 | 153 m x 153 m | 108 m |
| 8 | 38.2 m x 19.1 m | 21.4 m |
| 9 | 4.78 m x 4.78 m | 3.38 m |
| 10 | 1.19 m x 0.60 m | 0.67 m |
| 11 | 14.9 cm x 14.9 cm | 10.6 cm |
...

From pproenca's repository, MIT licence.

Related skills

  • Checked

    Rust code review

    Reviews Rust code for idiom, errors, safety and API design, with a ranked report and a fix for every finding.

    by morganlinton 2.2k
    7/101 credit
  • Checked

    Java Debugging Guide

    Finds the cause of Java bugs and failing tests, and attaches a debugger safely in Maven, Gradle, Spring or Docker.

    by github 42k
    7/101 credit
  • Checked

    Python games with pygame

    Builds and debugs 2D pygame games with a proper loop and delta time, so they run the same on any PC.

    by gamedev-skills 13k
    7/101 credit
  • Checked

    Go Benchmarking and Profiling

    Writes Go benchmarks, profiles them with pprof and proves each speedup with benchstat before you claim it.

    by samber 4k
    7/101 credit
  • Checked

    nvMolKit GPU cheminformatics

    Writes nvMolKit code for GPU fingerprints, similarity and clustering, so molecule searches run far faster.

    by NVIDIA 4.3k
    7/101 credit
  • Checked

    Modern Java Coding

    Writes and reviews modern Java 21 and 25 code with records, sealed types, pattern matching and virtual threads.

    by ericrisco 691
    7/101 credit

Secure checkout

Credits

AUD

  1. 1Choose
  2. 2Pay on Square
  3. 3Credits added