Agent skill

Map Optimization Strategy

by benchflow-ai in benchflow-ai/skillsbench

Strategy for solving constraint optimization problems on spatial maps.

Apache-2.0Auto-check passed

Install Map Optimization Strategy

skills CLI
$ npx skills add benchflow-ai/skillsbench --skill map-optimization-strategy -a claude-code

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

GitHub CLI
$ gh skill install benchflow-ai/skillsbench map-optimization-strategy --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/map-optimization-strategy .claude/skills/map-optimization-strategy && 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
map-optimization-strategy
GitHub stars
1.8k
Token cost
~1.1k tokens
SKILL.md length
442 words
Files
1
Skills in repo
180
Repo updated
First seen
Licence
Apache-2.0

At a glance

Strategy for solving constraint optimization problems on spatial maps.

  • Works in 3 steps: Prune the Search Space → Identify High-Value Spots → Anchor Point Search
  • You need to place items on a grid/map to maximize some objective while satisfying constraints
  • SKILL.md covers Why Exhaustive Search Fails, The Three-Phase Strategy, Algorithm Skeleton and Key Insights, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Map Optimization Strategy is an agent skill from benchflow-ai/skillsbench. Strategy for solving constraint optimization problems on spatial maps. Use when you need to place items on a grid/map to maximize some objective while satisfying constraints.

Its SKILL.md is about 1.1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

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

  • You need to place items on a grid/map to maximize some objective while satisfying constraints

Example prompts

  • “/map-optimization-strategy”

Requirements

  • Python 3

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Prune the Search Space
  2. Identify High-Value Spots
  3. Anchor Point Search

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

    No scripts in the folder and no shell commands in SKILL.md (its code samples are python).

    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

Map Optimization Strategy loads about 1.1k tokens when it runs. Until then it costs about 50 tokens; SKILL.md has 442 words of instructions outside code blocks.

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

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); files beside SKILL.md are not scanned.

SKILL.md

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

Download SKILL.mdSave it as .claude/skills/map-optimization-strategy/SKILL.md (or your agent's skills folder).
name
map-optimization-strategy
description
Strategy for solving constraint optimization problems on spatial maps. Use when you need to place items on a grid/map to maximize some objective while satisfying constraints.

Map-Based Constraint Optimization Strategy

A systematic approach to solving placement optimization problems on spatial maps. This applies to any problem where you must place items on a grid to maximize an objective while respecting placement constraints.

Why Exhaustive Search Fails

Exhaustive search (brute-force enumeration of all possible placements) is the worst approach:

  • Combinatorial explosion: Placing N items on M valid tiles = O(M^N) combinations
  • Even small maps become intractable (e.g., 50 tiles, 5 items = 312 million combinations)
  • Most combinations are clearly suboptimal or invalid

The Three-Phase Strategy

Phase 1: Prune the Search Space

Goal: Eliminate tiles that cannot contribute to a good solution.

Remove tiles that are:

  1. Invalid for any placement - Violate hard constraints (wrong terrain, out of range, blocked)
  2. Dominated - Another tile is strictly better in all respects
  3. Isolated - Too far from other valid tiles to form useful clusters
Before: 100 tiles in consideration
After pruning: 20-30 candidate tiles

This alone can reduce search space by 70-90%.

Phase 2: Identify High-Value Spots

Goal: Find tiles that offer exceptional value for your objective.

Score each remaining tile by:

  1. Intrinsic value - What does this tile contribute on its own?
  2. Adjacency potential - What bonuses from neighboring tiles?
  3. Cluster potential - Can this tile anchor a high-value group?

Rank tiles and identify the top candidates. These are your priority tiles - any good solution likely includes several of them.

Example scoring:
- Tile A: +4 base, +3 adjacency potential = 7 points (HIGH)
- Tile B: +1 base, +1 adjacency potential = 2 points (LOW)
Show full SKILL.md (223 more words)Show less

Goal: Find placements that capture as many high-value spots as possible.

  1. Select anchor candidates - Tiles that enable access to multiple high-value spots
  2. Expand from anchors - Greedily add placements that maximize marginal value
  3. Validate constraints - Ensure all placements satisfy requirements
  4. Local search - Try swapping/moving placements to improve the solution

For problems with a "center" constraint (e.g., all placements within range of a central point):

  • The anchor IS the center - try different center positions
  • For each center, the reachable high-value tiles are fixed
  • Optimize placement within each center's reach

Algorithm Skeleton

python
def optimize_placements(map_tiles, constraints, num_placements):
    # Phase 1: Prune
    candidates = [t for t in map_tiles if is_valid_tile(t, constraints)]

    # Phase 2: Score and rank
    scored = [(tile, score_tile(tile, candidates)) for tile in candidates]
    scored.sort(key=lambda x: -x[1])  # Descending by score
    high_value = scored[:top_k]

    # Phase 3: Anchor search
    best_solution = None
    best_score = 0

    for anchor in get_anchor_candidates(high_value, constraints):
        solution = greedy_expand(anchor, candidates, num_placements, constraints)
        solution = local_search(solution, candidates, constraints)

        if solution.score > best_score:
            best_solution = solution
            best_score = solution.score

    return best_solution

Key Insights

  1. Prune early, prune aggressively - Every tile removed saves exponential work later

  2. High-value tiles cluster - Good placements tend to be near other good placements (adjacency bonuses compound)

  3. Anchors constrain the search - Once you fix an anchor, many other decisions follow logically

  4. Greedy + local search is often sufficient - You don't need the global optimum; a good local optimum found quickly beats a perfect solution found slowly

  5. Constraint propagation - When you place one item, update what's valid for remaining items immediately

Common Pitfalls

  • Ignoring interactions - Placing item A may change the value of placing item B (adjacency effects, mutual exclusion)
  • Over-optimizing one metric - Balance intrinsic value with flexibility for remaining placements
  • Forgetting to validate - Always verify final solution satisfies ALL constraints

© 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

Just SKILL.md in tasks/civ6-adjacency-optimizer/environment/skills/map-optimization-strategy of benchflow-ai/skillsbench.

Open the folder on GitHubat commit 9a1f4dd

Compare with similar skills

Map Optimization Strategy 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.

Map Optimization Strategy compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Map Optimization Strategy this skillbenchflow-ai/skillsbench1.8k—~1.1kAutomated safety check: PassApache-2.0
Vc Problem Solvingwithkynam/vibecode-pro-max-kit1.1k2 repos~1.1kAutomated safety check: PassMIT
Token Mapnexu-io/open-design100k—~1.4kAutomated safety check: PassApache-2.0
Maps Geographyasgeirtj/system_prompts_leaks69k—~717Automated safety check: PassCC0-1.0
Is This A Problemanthropics/claude-for-legal9.6k2 repos~2.3kAutomated safety check: PassApache-2.0
Single2spatial Spatial Mappingmajiayu000/claude-skill-registry6663 repos~994Automated safety check: PassMIT

Similar skills

  • Vc Problem Solving

    withkynam/vibecode-pro-max-kit

    Apply systematic problem-solving techniques when stuck. An agent skill from withkynam/vibecode-pro-max-kit.

    1.1k GitHub starsUsed in 2 repos~1.1k tokens
    Auto-check passed
  • Token Map

    nexu-io/open-design

    Map an extracted Figma / source-code token bag onto the active OD design system, producing a deterministic mapping the generate stage can consume.

    100k GitHub stars~1.4k tokensUpdated today
    Frontend & DesignAuto-check passed
  • Maps Geography

    asgeirtj/system_prompts_leaks

    Accurate maps from real geo data — use for any map, or whenever geography would make a good graphic for a deliverable

    69k GitHub stars~717 tokensUpdated yesterday
    Auto-check passed
  • Is This A Problem

    anthropics/claude-for-legal

    Official

    Fast "is this a problem?" answer for the quick Slack question — pattern-matches against your calibration.

    9.6k GitHub starsUsed in 2 repos~2.3k tokens
    Business, Finance & HRAuto-check passed
  • Single2spatial Spatial Mapping

    majiayu000/claude-skill-registry

    Map scRNA-seq atlases onto spatial transcriptomics slides using omicverse's Single2Spatial workflow for deep-forest training, spot-level assessment, and marker visualisation.

    666 GitHub starsUsed in 3 repos~994 tokens
    Research & ScienceAuto-check passed
  • Feature Map

    onyx-dot-app/onyx

    Use the Onyx feature map (.agents/feature-map/) to learn what a product surface does, the code behind it, and what a change can break.

    32k GitHub stars~459 tokensUpdated today
    Auto-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 Map Optimization Strategy

What does Map Optimization Strategy do?

Strategy for solving constraint optimization problems on spatial maps. Map Optimization Strategy is an agent skill from benchflow-ai/skillsbench. Strategy for solving constraint optimization problems on spatial maps.

When should I use Map Optimization Strategy?

Map Optimization Strategy fits situations like: you need to place items on a grid/map to maximize some objective while satisfying constraints.

How do I install Map Optimization Strategy in Claude Code?

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

How do I install Map Optimization Strategy in Codex?

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

Can I use Map Optimization Strategy 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 map-optimization-strategy -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/map-optimization-strategy, .gemini/skills/map-optimization-strategy, .github/skills/map-optimization-strategy and .opencode/skills/map-optimization-strategy in your project.

What does Map Optimization Strategy need to run?

SKILL.md names no scripts, command-line tools or credentials: Map Optimization Strategy is instructions for the agent only. Our summary lists: Python 3.

Does Map Optimization Strategy 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 Map Optimization Strategy 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. Review the folder before installing.

What licence does Map Optimization Strategy use?

Map Optimization Strategy 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 Map Optimization Strategy use?

About 1.1k tokens (SKILL.md is roughly 4.4k 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 Map Optimization Strategy?

Skills that share tags, products or a category with Map Optimization Strategy: Vc Problem Solving (withkynam/vibecode-pro-max-kit, 1.1k stars), Token Map (nexu-io/open-design, 100k stars), Maps Geography (asgeirtj/system_prompts_leaks, 69k stars) and Is This A Problem (anthropics/claude-for-legal, 9.6k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Map Optimization Strategy?

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.