home / skills / oimiragieo / agent-studio / visual-and-observational-rules

visual-and-observational-rules skill

/.claude/skills/visual-and-observational-rules

This skill helps enforce visual and observational guidelines for map color-coding, CRT-like effects, and life-like nation interactions in games.

npx playbooks add skill oimiragieo/agent-studio --skill visual-and-observational-rules

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

Files (12)
SKILL.md
1.9 KB
---
name: visual-and-observational-rules
description: Defines the visual aspects of the game and how the player observes the world. This includes map color-coding, screen effects, and the overall simulation style.
version: 1.0.0
model: sonnet
invoked_by: both
user_invocable: true
tools: [Read, Write, Edit]
globs: visuals.py
best_practices:
  - Follow the guidelines consistently
  - Apply rules during code review
  - Use as reference when writing new code
error_handling: graceful
streaming: supported
---

# Visual And Observational Rules Skill

<identity>
You are a coding standards expert specializing in visual and observational rules.
You help developers write better code by applying established guidelines and best practices.
</identity>

<capabilities>
- Review code for guideline compliance
- Suggest improvements based on best practices
- Explain why certain patterns are preferred
- Help refactor code to meet standards
</capabilities>

<instructions>
When reviewing or writing code, apply these guidelines:

- The map should be color-coded to show the owner of the square.
- There should be effects over the screen that mimic a CRT monitor.
- The game should aim to be similar to Conway's Game of Life, where the nations are the living organisms.
- Like Conway's Game of Life, nations should be able to "see" each other and react to each other.
- Like Conway's Game of Life, the nations should be able to "see" the resources and react to them.
  </instructions>

<examples>
Example usage:
```
User: "Review this code for visual and observational rules compliance"
Agent: [Analyzes code against guidelines and provides specific feedback]
```
</examples>

## Memory Protocol (MANDATORY)

**Before starting:**

```bash
cat .claude/context/memory/learnings.md
```

**After completing:** Record any new patterns or exceptions discovered.

> ASSUME INTERRUPTION: Your context may reset. If it's not in memory, it didn't happen.

Overview

This skill defines the visual and observational rules for a grid-based simulation game, specifying how the map is color-coded, how screen effects are rendered, and how entities perceive and react to their surroundings. It encodes a set of practical guidelines so visuals and sensing behavior remain consistent with a Conway's Game of Life–inspired simulation where nations act like living organisms.

How this skill works

The skill inspects rendering and perception code to ensure each tile is color-coded by owner and that CRT-like post-processing effects are applied consistently across viewports. It also analyzes simulation logic to verify that nation visibility and resource sensing follow neighborhood rules similar to Conway's Game of Life, enabling reactive behavior based on nearby cells and resources. Feedback includes concrete code patterns to enforce these visual and observational constraints.

When to use it

  • Designing or reviewing map rendering and ownership visuals for a grid-based strategy game
  • Implementing perception/sensing logic where entities react to neighboring tiles or resources
  • Adding CRT monitor or retro screen effects to the main game viewport
  • Refactoring simulation rules to align with Game of Life–style neighborhood interactions
  • Ensuring consistent visual cues for player decisions and automated agent behaviors

Best practices

  • Color-code each tile by owner using a deterministic palette tied to owner IDs to avoid ambiguity
  • Apply CRT effects as a final post-process pass, keeping shader parameters configurable for performance
  • Model perception with local neighborhood queries (Moore or von Neumann) so nations 'see' adjacent cells deterministically
  • Separate visual state from simulation state: render from a read-only snapshot of the simulation tick
  • Expose visibility and resource-sensing APIs so AI and UI share the same observation rules

Example use cases

  • Audit rendering code to confirm tiles use owner-based color mapping and fallbacks for neutral tiles
  • Review shader pipeline to add optional CRT scanlines, bloom, and chromatic aberration without altering game logic
  • Refactor nation update loop so reactions depend only on a stable neighborhood snapshot each tick
  • Create unit tests that verify perception rules (e.g., a nation detects resources within a 1-tile radius)
  • Design UI legends that explain color-coding and visibility ranges to players

FAQ

Should CRT effects change game logic or just visuals?

CRT effects should be purely visual and applied as a post-process pass; they must not alter simulation or perception data.

Which neighborhood model is recommended for Conway-like behavior?

Use Moore (8 neighbors) for richer interactions or von Neumann (4 neighbors) for simpler behavior; pick one and keep it consistent across perception and simulation.