Agent skill

Hex Grid Spatial

by benchflow-ai in benchflow-ai/skillsbench

Hex grid spatial utilities for offset coordinate systems. An agent skill from benchflow-ai/skillsbench.

Apache-2.0Auto-check passed

Install Hex Grid Spatial

skills CLI
$ npx skills add benchflow-ai/skillsbench --skill hex-grid-spatial -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install benchflow-ai/skillsbench hex-grid-spatial --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/benchflow-ai/skillsbench.git skills-src && mkdir -p .claude/skills && cp -r skills-src/tasks/civ6-adjacency-optimizer/environment/skills/hex-grid-spatial .claude/skills/hex-grid-spatial && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
hex-grid-spatial
GitHub stars
1.8k
Token cost
~690 tokens
SKILL.md length
120 words
Files
2 (incl. scripts)
Skills in repo
180
Repo updated
First seen
Licence
Apache-2.0

At a glance

Hex grid spatial utilities for offset coordinate systems. An agent skill from benchflow-ai/skillsbench.

  • Working with hexagonal grids
  • SKILL.md covers Coordinate System, Direction Indices, Core Functions and Usage Examples, plus 1 more section
  • Runs Python scripts from its folder
  • Calculating distances

What it does

Hex Grid Spatial is an agent skill from benchflow-ai/skillsbench. Hex grid spatial utilities for offset coordinate systems. Use when working with hexagonal grids, calculating distances, finding neighbors, or spatial queries on hex maps.

Its SKILL.md is about 690 tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including scripts (for example `scripts/hex_utils.py`).

The repository describes itself as: SkillsBench evaluates how well skills work and how effective agents are at using them. The licence is Apache-2.0.

When your agent uses it

  • Working with hexagonal grids
  • Calculating distances
  • Finding neighbors
  • Spatial queries on hex maps

Example prompts

  • “/hex-grid-spatial”

Requirements

  • Python 3

What it can do on your machine

Read from SKILL.md and the folder at commit 9a1f4dd. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Python), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Hex Grid Spatial loads about 690 tokens when it runs. Until then it costs about 47 tokens; SKILL.md has 120 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~47
When it runs · the whole SKILL.md, loaded when a task matches
~690

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from benchflow-ai/skillsbench at commit 9a1f4dd, republished under its Apache-2.0 licence (© benchflow-ai). 120 words, ~690 tokens.

Download SKILL.mdSave it as .claude/skills/hex-grid-spatial/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
hex-grid-spatial
description
Hex grid spatial utilities for offset coordinate systems. Use when working with hexagonal grids, calculating distances, finding neighbors, or spatial queries on hex maps.

Hex Grid Spatial Utilities

Utilities for hexagonal grid coordinate systems using odd-r offset coordinates (odd rows shifted right).

Coordinate System

  • Tile 0 is at bottom-left
  • X increases rightward (columns)
  • Y increases upward (rows)
  • Odd rows (y % 2 == 1) are shifted right by half a hex

Direction Indices

     2   1
      \ /
   3 - * - 0
      / \
     4   5

0=East, 1=NE, 2=NW, 3=West, 4=SW, 5=SE

Core Functions

Get Neighbors
python
def get_neighbors(x: int, y: int) -> List[Tuple[int, int]]:
    """Get all 6 neighboring hex coordinates."""
    if y % 2 == 0:  # even row
        directions = [(1,0), (0,-1), (-1,-1), (-1,0), (-1,1), (0,1)]
    else:  # odd row - shifted right
        directions = [(1,0), (1,-1), (0,-1), (-1,0), (0,1), (1,1)]
    return [(x + dx, y + dy) for dx, dy in directions]
Hex Distance
python
def hex_distance(x1: int, y1: int, x2: int, y2: int) -> int:
    """Calculate hex distance using cube coordinate conversion."""
    def offset_to_cube(col, row):
        cx = col - (row - (row & 1)) // 2
        cz = row
        cy = -cx - cz
        return cx, cy, cz

    cx1, cy1, cz1 = offset_to_cube(x1, y1)
    cx2, cy2, cz2 = offset_to_cube(x2, y2)
    return (abs(cx1-cx2) + abs(cy1-cy2) + abs(cz1-cz2)) // 2
Tiles in Range
python
def get_tiles_in_range(x: int, y: int, radius: int) -> List[Tuple[int, int]]:
    """Get all tiles within radius (excluding center)."""
    tiles = []
    for dx in range(-radius, radius + 1):
        for dy in range(-radius, radius + 1):
            nx, ny = x + dx, y + dy
            if (nx, ny) != (x, y) and hex_distance(x, y, nx, ny) <= radius:
                tiles.append((nx, ny))
    return tiles

Usage Examples

python
# Find neighbors of tile (21, 13)
neighbors = get_neighbors(21, 13)
# For odd row: [(22,13), (22,12), (21,12), (20,13), (21,14), (22,14)]

# Calculate distance
dist = hex_distance(21, 13, 24, 13)  # Returns 3

# Check adjacency
is_adj = hex_distance(21, 13, 21, 14) == 1  # True

# Get all tiles within 3 of city center
workable = get_tiles_in_range(21, 13, 3)

Key Insight: Even vs Odd Row

The critical difference is in directions 1, 2, 4, 5 (the diagonal directions):

DirectionEven Row (y%2==0)Odd Row (y%2==1)
NE (1)(0, -1)(1, -1)
NW (2)(-1, -1)(0, -1)
SW (4)(-1, +1)(0, +1)
SE (5)(0, +1)(1, +1)

East (0) and West (3) are always (1, 0) and (-1, 0).

© benchflow-ai, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (scripts) in tasks/civ6-adjacency-optimizer/environment/skills/hex-grid-spatial of benchflow-ai/skillsbench.

  • SKILL.md
  • scripts/hex_utils.py

Open the folder on GitHubat commit 9a1f4dd

Compare with similar skills

Hex Grid Spatial next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Hex Grid Spatial compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Hex Grid Spatial this skillbenchflow-ai/skillsbench1.8k—~690Automated safety check: PassApache-2.0
Agent Consensus Coordinatorruvnet/ruflo74k3 repos~3.2kAutomated safety check: PassMIT
Agent Mesh Coordinatorruvnet/ruflo74k3 repos~3.2kAutomated safety check: PassMIT
Agent Queen Coordinatorruvnet/ruflo74k3 repos~1.3kAutomated safety check: PassMIT
Agent Adaptive Coordinatorruvnet/ruflo74k2 repos~4kAutomated safety check: PassMIT
Agent Hierarchical Coordinatorruvnet/ruflo74k2 repos~2.8kAutomated safety check: PassMIT

Similar skills

  • Agent skill for consensus-coordinator - invoke with $agent-consensus-coordinator

    74k GitHub starsUsed in 3 repos~3.2k tokens
    Agent WorkflowsAuto-check passed
  • Agent skill for mesh-coordinator - invoke with $agent-mesh-coordinator

    74k GitHub starsUsed in 3 repos~3.2k tokens
    Agent WorkflowsAuto-check passed
  • Agent skill for queen-coordinator - invoke with $agent-queen-coordinator

    74k GitHub starsUsed in 3 repos~1.3k tokens
    Auto-check passed
  • Agent skill for adaptive-coordinator - invoke with $agent-adaptive-coordinator

    74k GitHub starsUsed in 2 repos~4k tokens
    Data & AnalyticsAuto-check passed
  • Agent skill for hierarchical-coordinator - invoke with $agent-hierarchical-coordinator

    74k GitHub starsUsed in 2 repos~2.8k tokens
    Agent WorkflowsAuto-check passed
  • Agent skill for memory-coordinator - invoke with $agent-memory-coordinator

    74k GitHub starsUsed in 2 repos~1.2k tokens
    Agent WorkflowsAuto-check passed

More from benchflow-ai/skillsbench

All 180 skills in this repo
  • Lean4 Memories

    benchflow-ai/skillsbench

    This skill should be used when working on Lean 4 formalization projects to maintain persistent memory of successful proof patterns, failed approaches, project conventions, and user preferences…

    1.8k GitHub stars~3.2k tokensUpdated 2 mo ago
    Auto-check passed
  • Senior Data Engineer

    benchflow-ai/skillsbench

    World-class data engineering skill for building scalable data pipelines, ETL/ELT systems, real-time streaming, and data infrastructure.

    1.8k GitHub stars~5.9k tokensUpdated 2 mo ago
    Auto-check passed
  • Ac Branch Pi Model

    benchflow-ai/skillsbench

    AC branch pi-model power flow equations (P/Q and |S|) with transformer tap ratio and phase shift, matching acopf-math-model.md and MATPOWER branch fields.

    1.8k GitHub stars~1.1k tokensUpdated 2 mo ago
    Auto-check passed
  • Civ6lib

    benchflow-ai/skillsbench

    Civilization 6 district mechanics library. An agent skill from benchflow-ai/skillsbench.

    1.8k GitHub stars~1.7k tokensUpdated 2 mo ago
    Auto-check passed
  • D3 Visualization

    benchflow-ai/skillsbench

    Build deterministic, verifiable data visualizations with D3.js (v6).

    1.8k GitHub stars~1.5k tokensUpdated 2 mo ago
    Auto-check passed
  • Dc Power Flow

    benchflow-ai/skillsbench

    DC power flow analysis for power systems. An agent skill from benchflow-ai/skillsbench.

    1.8k GitHub stars~717 tokensUpdated 2 mo ago
    Auto-check passed

Questions about Hex Grid Spatial

What does Hex Grid Spatial do?

Hex grid spatial utilities for offset coordinate systems. An agent skill from benchflow-ai/skillsbench. Hex Grid Spatial is an agent skill from benchflow-ai/skillsbench. Hex grid spatial utilities for offset coordinate systems.

When should I use Hex Grid Spatial?

Hex Grid Spatial fits situations like: working with hexagonal grids; calculating distances; finding neighbors; spatial queries on hex maps.

How do I install Hex Grid Spatial in Claude Code?

Run `npx skills add benchflow-ai/skillsbench --skill hex-grid-spatial -a claude-code`. Or copy the skill folder (tasks/civ6-adjacency-optimizer/environment/skills/hex-grid-spatial in benchflow-ai/skillsbench) into .claude/skills/hex-grid-spatial in your project. Claude Code loads it when a task matches its description.

How do I install Hex Grid Spatial in Codex?

Run `npx skills add benchflow-ai/skillsbench --skill hex-grid-spatial -a codex`. Or copy the skill folder (tasks/civ6-adjacency-optimizer/environment/skills/hex-grid-spatial in benchflow-ai/skillsbench) into .agents/skills/hex-grid-spatial in your project. Codex loads it when a task matches its description.

Can I use Hex Grid Spatial in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add benchflow-ai/skillsbench --skill hex-grid-spatial -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/hex-grid-spatial, .gemini/skills/hex-grid-spatial, .github/skills/hex-grid-spatial and .opencode/skills/hex-grid-spatial in your project.

What does Hex Grid Spatial need to run?

Going by SKILL.md and its folder, Hex Grid Spatial needs Python for the scripts in its folder. Our summary lists: Python 3.

Does Hex Grid Spatial access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Hex Grid Spatial safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Hex Grid Spatial use?

Hex Grid Spatial is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Hex Grid Spatial use?

About 690 tokens (SKILL.md is roughly 2.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Hex Grid Spatial?

Skills that share tags, products or a category with Hex Grid Spatial: Agent Consensus Coordinator (ruvnet/ruflo, 74k stars), Agent Mesh Coordinator (ruvnet/ruflo, 74k stars), Agent Queen Coordinator (ruvnet/ruflo, 74k stars) and Agent Adaptive Coordinator (ruvnet/ruflo, 74k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Hex Grid Spatial?

benchflow-ai (a GitHub organization) maintains it in benchflow-ai/skillsbench, which has 1,832 GitHub stars. The repository holds 180 skills in this directory. The repository was last updated on July 23, 2026.

Source: benchflow-ai/skillsbench on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.