Agent Skills
› jasonkneen/tiny-world-builder
› tinyworld-island-viewer
tinyworld-island-viewer
GitHub定义TinyWorld Island Viewer的Shell、样式及生成器规则,规范岛屿视图的前端渲染逻辑与数据生成流程。
Trigger Scenarios
修改Island Viewer前端界面
调整岛屿生成算法或路由逻辑
Install
npx skills add jasonkneen/tiny-world-builder --skill tinyworld-island-viewer -g -y
SKILL.md
Frontmatter
{
"name": "tinyworld-island-viewer",
"description": "Use when changing the first-class Island Viewer shell, sequential generated-island viewer routing, or viewer-scoped graphics defaults."
}
TinyWorld Island Viewer
Island Viewer is the first-class generated-island viewing surface:
- Shell:
island-viewer.html - Styles:
styles/island-viewer.css - Generator:
scripts/island-viewer-sequential-generator.js - Renderer adapter:
scripts/island-viewer-engine-runtime.js - Controller:
scripts/island-viewer.js - Compatibility redirect:
random-island-preview.html
Rules:
- Keep the active generator viewer-only and sequential.
island-viewer.htmlshould loadscripts/island-viewer-sequential-generator.js, not the giantscripts/tinyworld-island-core.jscopied random-island bundle. - Keep the builder-engine renderer stack active for now. Do not load
scripts/island-viewer-renderer.jsonisland-viewer.htmlwhilescripts/island-viewer-engine-runtime.jsprovides the current look. - The sequential layer stack is: all grass, first house, corner towers, paths, extra houses, fenced crops, fenced animals, rock patch, water route, bridge detection, strategic lanterns, plain stone outcrops, trees/bushes, then final weighted infill.
- The viewer sequential generator must emit schema-valid
v:4world cells, use normalterrain: "path"cells for public path output, and exposeTinyWorldIslandGenerator.generate(...)and.profile(...). - Do not emit
water-bridgeorbridgeAxismetadata from the active viewer generator. Bridges are allowed only through the new local detector: after water carving, scan local crossings with path cells on one axis and water cells on the perpendicular axis, then turn only the center water cell into a normalkind: "bridge". - Strategic lanterns are native
kind: "lamp-post"cells placed after bridge detection. Keep them on empty grass cells that touch exactly two perpendicular path cells, and keep every pair more than 3 Manhattan spaces apart. - A manor is a rare native
housewithbuildingType: "manor", not a promoted cottage. Only roll the 25% manor chance after at least three normal houses exist, reserve its footprint during generation, and connect a path from the cell in front of its door back into the existing path network before plots, rocks, water, or lanterns run. - Trees and bushes are native
kind: "tree"/kind: "bush"decoration placed after the functional path/water/bridge/lamp layers. Only use empty grass cells, keep trees spaced out, and let bushes fill smaller remaining border/garden opportunities without occupying paths. - The initial fenced crop plot should keep its four dirt plot cells and fence gates, but each cell rolls independently: 25% empty, otherwise evenly between wheat, corn, carrot, pumpkin, and sunflower.
- The quarry/rock patch is the canonical ore showcase: its four cells should
emit
kind: "rock"withappearance.oreMetalcoveringcopper,iron,silver, andgoldonce each. Extra infill ore may still pick a deterministic metal, but the core patch should visibly expose all four variants. Prefer a 2x2 quarry; if earlier sequential layers leave no legal 2x2 space, place a compact connected four-cell quarry without overwriting paths, water, fences, structures, or reserved manor footprint cells. - After the sparse tree/bush pass, run a final weighted infill loop over normal empty buildable cells until none remain. The infill choices should stay within native economy objects: crops, plain stone, ore, sheep/cow, bushes, and trees. Plain stone should be generated by the dedicated outcrop layer and can be extended by this weighted pass, clustered around stone/quarry terrain; do not add a post-pass forced stone correction. Do not fill water, paths, fences, structures, or reserved manor footprint cells.
- Water route planning must treat path crossings as single-cell crossings per connected path area. Do not let water carve two adjacent path cells or run along the path before turning back into normal terrain.
- Keep normal viewer chrome minimal. It is not a build screen: visible controls should stay viewer actions such as New Island, Load, and Save.
- Put grid/seed and graphics controls in the local/developer defaults helper, not in the primary viewer toolbar. Do not expose archetype as a viewer-facing economy or card concept; it is only hidden generator input when a caller passes it explicitly.
- Generated Island Viewer islands are fixed at
8 x 8. - Viewer runtime load applies the normalized 64-cell island once. Do not restore
the old
clearViewerWorld()+ full reapply double pass, and do not force every tile rebuild during initial load. Use thewindow.__tinyworldIslandViewerLoadingguard to suppress interleaved renders, then render once after the island settles. - Viewer directional sun defaults to
10.0(1000%). Migrate the old viewer default1.1only when it still looks untouched; user-edited values should stay user-owned. - Persist viewer defaults only under
tinyworld:island-viewer:*. Do not write viewer graphics into normal buildertinyworld:render:*keys. - Use
npm run stats:island-viewer -- --count 1000for on-demand sequential generator sweeps. The CLI loads the shared Raw Yield economy helper plus the viewer generator directly, validates schema/invariants, reports Raw Yield score/rarity/leader/resource summaries, and writes reports understats-runs/island-viewer-sequential/.
Validation:
npm testnpm run buildnpm run stats:island-viewer -- --count 1000- Check
/island-vieweror/island-viewer.html: page loads through the builder-engine renderer, generated saves contain no legacy bridge metadata, and the shell does not requestscripts/tinyworld-island-core.jsorscripts/island-viewer-renderer.js.
Version History
- 2ffaf91 Current 2026-07-06 00:20


