From bbeierle12-skill-mcp-claude
Builder user experience systems for Three.js building games. Use when implementing prefab/blueprint save/load, undo/redo command patterns, ghost preview placement, multi-select, or copy/paste building mechanics. Covers the UX layer that makes building feel responsive and intuitive.
npx claudepluginhub joshuarweaver/cascade-code-languages-misc-1 --plugin bbeierle12-skill-mcp-claudeThis skill uses the workspace's default tool permissions.
Prefabs, blueprints, undo/redo, selection, and preview systems for building mechanics.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Checks Next.js compilation errors using a running Turbopack dev server after code edits. Fixes actionable issues before reporting complete. Replaces `next build`.
Prefabs, blueprints, undo/redo, selection, and preview systems for building mechanics.
import { BlueprintManager } from './scripts/blueprint-manager.js';
import { CommandHistory, PlaceCommand, BatchCommand } from './scripts/command-history.js';
import { GhostPreview } from './scripts/ghost-preview.js';
import { SelectionManager } from './scripts/selection-manager.js';
// Initialize systems
const blueprints = new BlueprintManager();
const history = new CommandHistory({ maxSize: 50 });
const ghost = new GhostPreview(scene);
const selection = new SelectionManager({ maxSelection: 100 });
// Save selected pieces as blueprint
const { blueprint } = blueprints.save(selection.getSelection(), 'My Base');
// Load blueprint at new position
const { pieces } = blueprints.load(blueprint.id, newPosition, rotation);
// Place with undo support
history.execute(new PlaceCommand(pieceData, position, rotation, buildingSystem));
history.undo(); // Removes piece
history.redo(); // Restores piece
// Ghost preview with validity feedback
ghost.show('wall', cursorPosition, rotation);
ghost.setValid(canPlace); // Green/red color
ghost.updatePosition(newCursorPosition);
// Multi-select with box selection
selection.boxSelect(startNDC, endNDC, camera, allPieces);
selection.selectConnected(startPiece, getNeighbors); // Flood fill
// Batch operations
history.beginGroup('Delete selection');
for (const piece of selection.getSelection()) {
history.execute(new RemoveCommand(piece, buildingSystem));
}
history.endGroup();
See references/builder-ux-advanced.md for:
| File | Lines | Purpose |
|---|---|---|
blueprint-manager.js | ~450 | Save, load, export/import building designs |
command-history.js | ~400 | Undo/redo stack with command pattern |
ghost-preview.js | ~380 | Transparent placement preview with snapping |
selection-manager.js | ~420 | Multi-select, box select, group operations |
Every building action becomes a command with execute() and undo(). This enables:
Blueprints store relative positions, making them position and rotation independent. Key features:
Shows placement intent before commitment:
Supports multiple selection modes:
// Full integration example
function setupBuildingUX(scene, buildingSystem) {
const history = new CommandHistory({
maxSize: 100,
onChange: (status) => updateUndoRedoButtons(status)
});
const ghost = new GhostPreview(scene, {
validColor: 0x00ff00,
invalidColor: 0xff0000,
snapGrid: 2,
snapRotation: Math.PI / 4
});
const selection = new SelectionManager({
maxSelection: 200,
onSelectionChanged: (pieces) => updateSelectionUI(pieces)
});
const blueprints = new BlueprintManager({
storage: localStorage,
maxBlueprints: 50
});
// Keyboard shortcuts
document.addEventListener('keydown', (e) => {
if (e.ctrlKey && e.key === 'z') history.undo();
if (e.ctrlKey && e.key === 'y') history.redo();
if (e.ctrlKey && e.key === 'c') copySelection();
if (e.ctrlKey && e.key === 'v') pasteBlueprint();
if (e.key === 'r') ghost.rotate(Math.PI / 4);
});
return { history, ghost, selection, blueprints };
}
Building UX separates intent from execution. The ghost preview shows what will happen, the command executes it, and the history allows reversal. This separation enables blueprint placement (preview entire structure), batch undo (reverse multiple operations), and networked building (commands serialize for transmission).