home / skills / bdambrosio / cognitive_workbench / mc-map-update

This skill updates a persistent SpatialMap with mc-observe observation data, enabling reliable spatial queries for planning.

npx playbooks add skill bdambrosio/cognitive_workbench --skill mc-map-update

Review the files below or copy the command above to add this skill to your agents.

Files (2)
Skill.md
3.2 KB
---
name: mc-map-update
type: python
description: "Updates persistent spatial map with observation data. Populates cell-based SpatialMap."
---

# Minecraft Map Update Tool

Converts ephemeral observation data into persistent spatial memory. Updates the cell-based SpatialMap with observation data from mc-observe-blocks.

## Purpose

Store observation data from mc-observe into persistent spatial memory. Cell data supports spatial queries for planning. Automatically checks if current location is already mapped before observing.

## Input

- `observation`: Observation data from mc-observe (optional - if not provided, automatically invokes mc-observe)
- `radius` or `blocks_radius`: Optional radius for mc-observe (default: 7, only used when observation is not provided)
- `x`, `y`, `z`: Optional coordinates (extracted from observation if not provided)

## Output

Returns uniform_return format with:
- `value`: Summary text of update
- `data`: Structured result with:
  - `location`: `{x, y, z}` block coordinates
  - `spatial_map`: `{cells_updated, total_cells, bounds}`

## Behavior & Performance

- If no observation is provided, automatically invokes `mc-observe` internally
- Populates cell schema from observation: support, surface, hazards, resources, observability, waypoints
- Updates observer cell (direct), forward cell (inferred), and neighbor cells (obstructions)
- Auto-saves SpatialMap after each update
- Coordinates rounded to block integers

**Data Storage Philosophy**:
- Stores only **absolute** properties: `support_y` (absolute Y coordinate), `walkable`, `drop` (has pit below)
- Does **NOT** store agent-relative data: `blocked`, `step_up`, `step_down`, `delta_y_from_agent` are computed at query time
- Stores raw obstruction data (`obstructions.blocks_at_y`) for query-time blocking computation
- Resources/hazards only recorded when on surface (Y = `support_y` or `support_y + 1`)

**Cone-Based Visibility Impact**:
- `mc-observe` uses a forward view cone (yaw ±60°, pitch -60..+90) with line-of-sight, so surface blocks behind taller obstacles may be occluded
- Observer cell and forward cell always have `support_y` (from downward probes, not affected by occlusion)
- Distant cells may be created from `nearby_blocks` but lack `support_y` if their surface blocks are occluded
- Cells without `support_y` cannot have resources/hazards recorded (requires surface Y coordinate for validation)
- This is expected behavior: incomplete data for occluded cells until observed from another angle

## Guidelines

- Can be called directly without observation - will automatically invoke mc-observe-blocks if needed
- Or call after mc-observe-blocks to persist spatial knowledge from a specific observation
- Cell data enables spatial queries via mc-map-query
- Visualization via mc-map-visualize shows mapped cells
- Clear map via FastAPI Controls panel removes SpatialMap

## Usage Examples

Update automatically (invokes mc-observe internally):
```json
{"type":"mc-map-update"}
```

Update with custom radius:
```json
{"type":"mc-map-update","radius":5}
```

Update from existing observation:
```json
{"type":"mc-map-update","observation":"$obs"}
```

With explicit coordinates:
```json
{"type":"mc-map-update","observation":"$obs","x":-112,"y":71,"z":-123}
```

Overview

This skill updates a persistent cell-based SpatialMap using observation data from Minecraft. It converts ephemeral mc-observe-blocks output into durable map cells that support spatial queries, planning, and visualization. The skill auto-invokes observation when none is provided and saves updates immediately.

How this skill works

The skill takes an observation (or runs mc-observe internally) and populates cell entries with absolute properties such as support_y, walkable, drop, and raw obstructions. It updates the observer cell directly, infers a forward cell from the view cone, and adjusts neighbor cells for obstructions. Coordinates are rounded to block integers and the SpatialMap is autosaved after each update.

When to use it

  • Persist visual observations into the SpatialMap for later planning or queries.
  • After running mc-observe-blocks to store a specific observation snapshot.
  • When approaching unexplored areas to record support surfaces and resources.
  • Before running pathfinding or navigation queries that rely on map cells.
  • To refresh map data after environment changes or agent movement.

Best practices

  • Prefer calling with an explicit observation to control what gets recorded and for repeatable results.
  • Use a reasonable radius (default 7) to balance coverage and performance; reduce radius for frequent updates.
  • Expect occluded cells to lack support_y and therefore not record resources until observed from another angle.
  • Rely on stored absolute properties only; agent-relative information is computed at query time.
  • Call map-visualize or map-query after updates to validate the recorded cells and bounds.

Example use cases

  • Automatic map update command that triggers mc-observe and persists results for the current location.
  • Persisting a high-detail observation before attempting resource collection or hazard avoidance.
  • Periodic mapping sweep to build a navigation grid for multi-step planning.
  • Updating neighboring cells after discovering new obstructions or terrain changes.
  • Recording coordinates and map bounds for visualization or remote debugging.

FAQ

What happens if I don't provide an observation?

The skill will internally invoke mc-observe-blocks using the provided radius (or default 7) to collect data before updating the SpatialMap.

Why are some cells missing resources or surface Y?

Cells observed only from afar or behind obstacles may lack a validated support_y due to occlusion; resources and hazards are recorded only when the surface Y is known.