Skip to content

notque/vexjoy-agent / skills/game/game-dev

game-dev

Flagged

Game development: design, asset pipelines, Phaser, Unity CLI and builds, vanilla JS frontend, GM mode, match booking.

FileKindSize
SKILL.mdskill md13.2 KB
references/anchor-alignment.mdmarkdown16.0 KB
references/animate-scaffolds.mdmarkdown2.0 KB
references/arcade-physics.mdmarkdown7.4 KB
references/artifacts-and-prototyping.mdmarkdown1.5 KB
references/asset-sources.mdmarkdown7.9 KB
references/audit-and-red-team.mdmarkdown795 B
references/autonomous-improvement.mdmarkdown10.3 KB
references/backend-chain.mdmarkdown10.4 KB
references/bg-removal-local.mdmarkdown22.7 KB
references/build-scaffolds.mdmarkdown2.0 KB
references/capabilities/01-design-red-team-audit.mdmarkdown3.9 KB
references/capabilities/02-emotional-canvas-moodboard.mdmarkdown3.7 KB
references/capabilities/03-game-design-attribution-audit.mdmarkdown3.6 KB
references/capabilities/04-game-design-bartle-archetype-audit.mdmarkdown3.7 KB
references/capabilities/05-game-design-big-five-personality-audit.mdmarkdown3.6 KB
references/capabilities/06-game-design-brainstorm-methods.mdmarkdown3.9 KB
references/capabilities/07-game-design-core-loop-extractor.mdmarkdown3.7 KB
references/capabilities/08-game-design-craft-critique.mdmarkdown3.5 KB
references/capabilities/09-game-design-creative-unblocker.mdmarkdown3.5 KB
references/capabilities/10-game-design-design-pillars-extractor.mdmarkdown3.5 KB
references/capabilities/11-game-design-emotional-canvas.mdmarkdown3.6 KB
references/capabilities/12-game-design-failure-loop-audit.mdmarkdown3.8 KB
references/capabilities/13-game-design-fairness-frustration-audit.mdmarkdown3.6 KB
references/capabilities/14-game-design-fantasy-extractor.mdmarkdown3.6 KB
references/capabilities/15-game-design-feature-prioritization.mdmarkdown3.6 KB
references/capabilities/16-game-design-five-options.mdmarkdown3.5 KB
references/capabilities/17-game-design-flow-audit.mdmarkdown3.6 KB
references/capabilities/18-game-design-fogg-behavior-audit.mdmarkdown3.6 KB
references/capabilities/19-game-design-friction-journey-audit.mdmarkdown3.8 KB
references/capabilities/20-game-design-ftue-hero-journey-audit.mdmarkdown3.7 KB
references/capabilities/21-game-design-goal-density-and-immediacy-audit.mdmarkdown3.5 KB
references/capabilities/22-game-design-goal-framing.mdmarkdown3.5 KB
references/capabilities/23-game-design-granular-player-motivation-audit.mdmarkdown4.0 KB
references/capabilities/24-game-design-grow-design.mdmarkdown3.5 KB
references/capabilities/25-game-design-ideal-outcome-backcasting.mdmarkdown3.4 KB
references/capabilities/26-game-design-kpi-coverage-audit.mdmarkdown3.8 KB
references/capabilities/27-game-design-leaderboard-audit.mdmarkdown3.9 KB
references/capabilities/28-game-design-leaderboard-builder.mdmarkdown3.8 KB
references/capabilities/29-game-design-molyneux-lens.mdmarkdown3.5 KB
references/capabilities/30-game-design-multiplayer-feature-audit.mdmarkdown3.8 KB
references/capabilities/31-game-design-novelty-spectrum-audit.mdmarkdown3.6 KB
references/capabilities/32-game-design-one-page-design-doc.mdmarkdown3.8 KB
references/capabilities/33-game-design-one-thing-to-remove.mdmarkdown3.6 KB
references/capabilities/34-game-design-option-generation.mdmarkdown3.5 KB
references/capabilities/35-game-design-peak-end-audit.mdmarkdown3.6 KB
references/capabilities/36-game-design-perceived-randomness-audit.mdmarkdown3.7 KB
references/capabilities/37-game-design-pitch-deck-audit.mdmarkdown3.8 KB
references/capabilities/38-game-design-player-motivation-audit.mdmarkdown3.5 KB
references/capabilities/39-game-design-player-need-satisfaction-audit.mdmarkdown3.6 KB
references/capabilities/40-game-design-player-persona-extractor.mdmarkdown4.2 KB
references/capabilities/41-game-design-player-perspective-reframe.mdmarkdown3.7 KB
references/capabilities/42-game-design-player-segment-perception-audit.mdmarkdown3.6 KB
references/capabilities/43-game-design-player-values-mapper.mdmarkdown3.8 KB
references/capabilities/44-game-design-premium-pass-audit.mdmarkdown3.8 KB
references/capabilities/45-game-design-prosocial-session-chapters.mdmarkdown3.7 KB
references/capabilities/46-game-design-prototype-intent-audit.mdmarkdown3.7 KB
references/capabilities/47-game-design-prototyping-companion.mdmarkdown3.6 KB
references/capabilities/48-game-design-roadblock-reframing.mdmarkdown3.5 KB
references/capabilities/49-game-design-smart-goal-audit.mdmarkdown3.6 KB
references/capabilities/50-game-design-social-satisfaction-matrix.mdmarkdown3.7 KB
references/capabilities/51-game-design-systematizing-empathizing-audit.mdmarkdown3.6 KB
references/capabilities/52-game-design-thinking-fast-and-slow-audit.mdmarkdown3.6 KB
references/capabilities/53-game-design-transformative-reuse.mdmarkdown3.6 KB
references/capabilities/54-game-design-unknown-unknowns-prototyping.mdmarkdown3.6 KB
references/capabilities/55-game-design-zeigarnik-effect-audit.mdmarkdown3.6 KB
references/capabilities/56-game-dev-budget-estimator.mdmarkdown3.8 KB
references/capabilities/57-game-dev-first-steps.mdmarkdown3.6 KB
references/capabilities/58-game-dev-team-gap.mdmarkdown3.6 KB
references/capabilities/59-game-dev-time-estimator.mdmarkdown3.8 KB
references/capabilities/60-moodboard-generator.mdmarkdown4.0 KB
references/capabilities/61-software-team-conflict-patterns.mdmarkdown3.8 KB
references/capability-catalog.mdmarkdown18.4 KB
references/capability-map.mdmarkdown1.7 KB
references/capability-matrix.mdmarkdown12.5 KB
references/capacitor-ios.mdmarkdown7.3 KB
references/cognition-and-choice.mdmarkdown1.2 KB
references/cognitive-and-behavioral-lenses.mdmarkdown1.2 KB
references/concept-and-loop.mdmarkdown1.5 KB
references/core-loop-and-pillars.mdmarkdown835 B
references/core-patterns.mdmarkdown8.2 KB
references/cpu-systems-harmony.mdmarkdown3.4 KB
references/creative-and-options.mdmarkdown2.0 KB
references/creative-direction.mdmarkdown1.3 KB
references/deploy.mdmarkdown5.3 KB
references/design-artifacts.mdmarkdown1.0 KB
references/emotion-and-presentation.mdmarkdown1.1 KB
references/error-catalog.mdmarkdown22.6 KB
references/fairness-and-failure.mdmarkdown1.2 KB
references/fairness-and-learning.mdmarkdown1.3 KB
references/fal-ai-image.mdmarkdown7.1 KB
references/frame-detection.mdmarkdown20.0 KB
references/full-diagnostic.mdmarkdown4.2 KB
references/game-asset-generator.mdmarkdown9.5 KB
references/game-audio.mdmarkdown7.5 KB
references/game-feel-patterns.mdmarkdown12.2 KB
references/game-pipeline.mdmarkdown11.5 KB
references/game-qa.mdmarkdown6.7 KB
references/game-sprite-pipeline.mdmarkdown33.4 KB
references/gm-brilliant-implementation.mdmarkdown13.4 KB
references/grid-shapes.mdmarkdown8.0 KB
references/meshyai.mdmarkdown7.3 KB
references/motion-pipeline.mdmarkdown7.5 KB
references/output-formats.mdmarkdown9.4 KB
references/pacing-and-return.mdmarkdown1.6 KB
references/performance.mdmarkdown7.8 KB
references/phaser-gamedev.mdmarkdown7.5 KB
references/pipeline-spec.jsonconfig23.0 KB
references/pixel-art-sprites.mdmarkdown8.7 KB
references/planning-and-communication.mdmarkdown1.6 KB
references/planning-and-production.mdmarkdown1.8 KB
references/player-and-social.mdmarkdown2.3 KB
references/polish-scaffolds.mdmarkdown1.9 KB
references/progression-and-economy.mdmarkdown1.0 KB
references/promo-video.mdmarkdown6.6 KB
references/prompt-rules.mdmarkdown15.2 KB
references/quality-gates.mdmarkdown6.4 KB
references/road-to-aew-integration.mdmarkdown7.8 KB
references/social-and-competitive-design.mdmarkdown1.1 KB
references/social-and-competitive.mdmarkdown1.5 KB
references/spritesheets.mdmarkdown6.2 KB
references/stage-contracts.mdmarkdown11.1 KB
references/style-presets.mdmarkdown5.1 KB
references/subagent-delegation.mdmarkdown2.2 KB
references/tilemaps-and-physics.mdmarkdown13.6 KB
references/tilemaps.mdmarkdown7.0 KB
references/unity-batchmode-builds.mdmarkdown9.2 KB
references/unity-cli.mdmarkdown10.9 KB
references/unity-licensing.mdmarkdown5.0 KB
references/vfx-containment.mdmarkdown3.1 KB
references/workflow-dag.mdmarkdown4.1 KB
references/worldlabs.mdmarkdown7.9 KB
references/wrestler-archetypes.mdmarkdown7.2 KB
scripts/deterministic_idle.pyscript7.8 KB
scripts/fal_queue_image_run.pyscript9.4 KB
scripts/imgdiff.pyscript5.0 KB
scripts/meshy-generate.mjsscript11.1 KB
scripts/optimize-glb.mjsscript3.8 KB
scripts/portrait_pipeline.pyscript31.2 KB
scripts/qa_artifacts.pyscript14.4 KB
scripts/road_to_aew_integration.pyscript6.6 KB
scripts/row_job_status.pyscript8.6 KB
scripts/sprite_anchor.pyscript30.1 KB
scripts/sprite_assemble.pyscript16.0 KB
scripts/sprite_bg.pyscript28.5 KB
scripts/sprite_canvas.pyscript11.9 KB
scripts/sprite_generate.pyscript13.9 KB
scripts/sprite_pipeline.pyscript54.9 KB
scripts/sprite_process.pyscript13.5 KB
scripts/sprite_prompt.pyscript41.8 KB
scripts/sprite_slicing.pyscript38.7 KB
scripts/sprite_verify.pyscript58.5 KB
scripts/test_content_aware_extraction.pyscript13.4 KB
scripts/test_no_status_laundering.pyscript6.9 KB
scripts/test_phases_4_5_7_8.pyscript16.4 KB
scripts/test_pipeline_glue.pyscript20.9 KB
scripts/test_pipeline_patterns.pyscript10.9 KB
scripts/test_rc3_frames_distinct_threshold.pyscript14.2 KB
scripts/test_rc4_mass_centroid_default.pyscript8.3 KB
scripts/test_rc5_despill_pre_upscale.pyscript7.9 KB
scripts/test_slice_grid_cells.pyscript6.4 KB
scripts/test_slicer_strict_pitch_default.pyscript11.6 KB
scripts/test_verifier_cell_parity.pyscript9.0 KB
scripts/test_verify_gates.pyscript23.2 KB
scripts/tests/test_fal_queue_image_run.pyscript908 B
scripts/video_extract_frames.pyscript4.3 KB
scripts/video_process_frames.pyscript7.6 KB
scripts/video_select_frames.pyscript6.4 KB
scripts/with_server.pyscript5.8 KB

scripts/test_content_aware_extraction.py

View on GitHub
"""Synthesized-canvas regression test for slice_with_content_awareness (v9).

Asset 27 (dragon flame breath) and asset 30 (plasma fireball trail) failed
under the strict-pitch slicer because Codex paints content extending PAST
the conceptual cell boundary. The strict slicer cuts at the boundary, losing
the trailing portion and pasting it onto the neighbor cell.

This test synthesizes the failure mode in isolation:
  - 4x4 sheet at 1254x1254 (the asset 27 raw size)
  - One "character" disc in cell (1, 0)
  - One "fire trail" rectangle extending 80 pixels PAST the cell's right
    boundary into cell (1, 1)'s territory.

Two assertions:
  - The OLD strict slicer recovers <80% of the trail's fire pixels (it
    clips them at the cell boundary).
  - The NEW slice_with_content_awareness recovers >=95% of the fire pixels
    (it expands the cell window to claim the full trail).

This test locks in the regression: any future change that breaks the
content-aware extractor will fail this test.

Run with pytest:
    pytest skills/game/game-dev/scripts/test_content_aware_extraction.py -v

Or as a standalone script:
    python3 skills/game/game-dev/scripts/test_content_aware_extraction.py
"""

from __future__ import annotations

import sys
from pathlib import Path

import numpy as np
from PIL import Image, ImageDraw

sys.path.insert(0, str(Path(__file__).resolve().parent))
import sprite_slicing  # canonical home post-ADR-205 split

MAGENTA = (255, 0, 255)
CHAR_COLOR = (0, 200, 0)  # green character body
FIRE_COLOR = (255, 100, 0)  # orange fire trail


def build_fire_trail_sheet(
    raw_w: int = 1254,
    raw_h: int = 1254,
    cols: int = 4,
    rows: int = 4,
    target_r: int = 1,
    target_c: int = 0,
    char_radius: int = 60,
    fire_h: int = 30,
    fire_extension_px: int = 80,
) -> tuple[Image.Image, int]:
    """Build a 4x4 magenta sheet with character + fire trail crossing a boundary.

    Returns (sheet, expected_fire_pixel_count). The fire trail extends from
    the character's right edge to ``fire_extension_px`` past the cell boundary.

    The boundary is at ``round((target_c + 1) * raw_w / cols)``. The trail's
    centroid lies inside cell (target_r, target_c), so the content belongs
    to that cell under the centroid-ownership rule.
    """
    sheet = Image.new("RGB", (raw_w, raw_h), MAGENTA)
    draw = ImageDraw.Draw(sheet)
    pitch_x = raw_w / cols
    pitch_y = raw_h / rows
    cx = round((target_c + 0.4) * pitch_x)
    cy = round((target_r + 0.5) * pitch_y)
    draw.ellipse([cx - char_radius, cy - char_radius, cx + char_radius, cy + char_radius], fill=CHAR_COLOR)

    fire_start_x = cx + char_radius
    cell_right_boundary = round((target_c + 1) * pitch_x)
    fire_end_x = cell_right_boundary + fire_extension_px
    draw.rectangle(
        [fire_start_x, cy - fire_h // 2, fire_end_x, cy + fire_h // 2],
        fill=FIRE_COLOR,
    )

    arr = np.array(sheet)
    r, g, b = arr[..., 0].astype(int), arr[..., 1].astype(int), arr[..., 2].astype(int)
    fire_mask = (r > 200) & (g >= 60) & (g <= 150) & (b < 100)
    return sheet, int(fire_mask.sum())


def count_fire_pixels(cell: Image.Image) -> int:
    arr = np.array(cell.convert("RGB"))
    r, g, b = arr[..., 0].astype(int), arr[..., 1].astype(int), arr[..., 2].astype(int)
    return int(((r > 200) & (g >= 60) & (g <= 150) & (b < 100)).sum())


def test_strict_slicer_loses_more_than_20pct_of_trail():
    """The OLD strict-pitch slicer clips content at cell boundaries.

    With an 80px trail extension past the boundary in a 313.5px-pitch grid,
    the strict slicer should keep only the inside-pitch portion, losing more
    than 20% of the total trail (recovery < 80% of expected).
    """
    sheet, total_fire = build_fire_trail_sheet()
    cols, rows = 4, 4
    cells = sprite_slicing.slice_grid_cells(sheet, cols, rows, 256)
    target_cell = cells[1 * cols + 0]
    strict_fire = count_fire_pixels(target_cell)

    # Recovery vs the full trail (NOT area-normalized, raw count).
    # Strict slicer: trail is split between cell (1,0) and (1,1). Cell (1,0)
    # captures only the inside-pitch portion. After resize to 256x256,
    # the captured pixel count is roughly inside-pitch * (256/313.5)^2.
    recovery = strict_fire / total_fire
    print(f"[strict] strict_fire={strict_fire}, total_fire={total_fire}, recovery={recovery:.3f}")
    assert recovery < 0.80, f"Strict slicer should recover <80% of trail, got {recovery:.3f}"


def test_content_aware_recovers_full_trail():
    """The NEW slice_with_content_awareness preserves boundary-crossing content.

    The full trail belongs to cell (1, 0) under centroid ownership. Content-
    aware extraction expands the cell window and recovers the full trail
    into the cell, scaled to fit.

    Bar: content-aware must recover >=95% of the area-normalized expected
    fire pixels (where area-normalization accounts for the letterbox scale
    factor introduced when the expanded crop is fit into 256x256).
    """
    sheet, total_fire = build_fire_trail_sheet()
    cols, rows = 4, 4
    cells = sprite_slicing.slice_with_content_awareness(sheet, cols, rows, 256, max_expansion_pct=0.30)
    target_cell = cells[1 * cols + 0]
    neighbor_cell = cells[1 * cols + 1]
    ca_fire_target = count_fire_pixels(target_cell)
    ca_fire_neighbor = count_fire_pixels(neighbor_cell)

    print(f"[content-aware] target_fire={ca_fire_target} neighbor_fire={ca_fire_neighbor} total_fire={total_fire}")

    # Centroid ownership: the trail's centroid lies inside cell (1, 0), so
    # neighbor cell (1, 1) should NOT receive the trail content.
    assert ca_fire_neighbor < total_fire * 0.10, (
        f"Neighbor cell should not receive trail content under centroid ownership; "
        f"got {ca_fire_neighbor} fire pixels (>{total_fire * 0.10:.0f})"
    )

    # The bar: >=95% of fire pixels area-normalized for the expansion factor.
    # The expanded crop spans approximately:
    #   width = char_left_to_fire_end_x = 1.4*pitch_x + 80 = ~519
    #   height = pitch_y = ~313
    # Letterbox scale = 256 / max(519, 313) = 0.493
    # Expected fire pixels in 256x256 = total_fire * scale^2 = total_fire * 0.243
    pitch_x = 1254 / 4
    pitch_y = 1254 / 4
    char_left_x = round(0.4 * pitch_x) - 60
    fire_end_x = round(1 * pitch_x) + 80
    expanded_w = fire_end_x - char_left_x
    expanded_h = pitch_y
    scale = 256 / max(expanded_w, expanded_h)
    expected_pixels = total_fire * scale * scale
    bar = expected_pixels * 0.95
    assert ca_fire_target >= bar, (
        f"Content-aware should recover >=95% of area-normalized expected fire; "
        f"got {ca_fire_target}, expected min ~{bar:.0f} "
        f"(scale={scale:.3f}, expected_at_full={expected_pixels:.0f})"
    )

    # Also assert that the strict slicer would do MUCH worse on the same
    # input (sanity check that we're improving over the baseline).
    strict_cells = sprite_slicing.slice_grid_cells(sheet, cols, rows, 256)
    strict_target = strict_cells[1 * cols + 0]
    strict_target_fire = count_fire_pixels(strict_target)
    # CA should recover at least 1.3x what strict does on the boundary cell.
    # (Strict gets the inside-pitch portion only; CA gets the full trail.)
    assert ca_fire_target > strict_target_fire * 1.3, (
        f"Content-aware should significantly improve over strict on this "
        f"boundary-crossing case; got CA={ca_fire_target} vs strict={strict_target_fire}"
    )


def test_content_aware_centroid_ownership():
    """A fire trail crossing into a neighbor cell stays with its OWNER.

    The trail's centroid is inside cell (1, 0), so cell (1, 1) gets a
    clean magenta area, not orphan trail pixels. This is the core of
    why we cannot just "expand all cells outward" — we must claim
    components by centroid.
    """
    sheet, total_fire = build_fire_trail_sheet(fire_extension_px=80)
    cells = sprite_slicing.slice_with_content_awareness(sheet, 4, 4, 256)
    neighbor = cells[1 * 4 + 1]
    nb_fire = count_fire_pixels(neighbor)
    # Centroid-based ownership: the trail's mass-centroid is in cell (1,0)
    # because the character + extension is mostly inside (1,0). So
    # neighbor (1,1) should be empty (no fire).
    assert nb_fire == 0 or nb_fire < total_fire * 0.05, (
        f"Neighbor cell (1,1) should be empty; got {nb_fire} fire pixels"
    )


def test_content_aware_returns_correct_cell_count_and_size():
    """Output contract: cols*rows cells, each cell_size x cell_size."""
    sheet, _ = build_fire_trail_sheet()
    cells = sprite_slicing.slice_with_content_awareness(sheet, 4, 4, 256)
    assert len(cells) == 16, f"expected 16 cells, got {len(cells)}"
    for i, c in enumerate(cells):
        assert c.size == (256, 256), f"cell {i} size {c.size} != (256, 256)"


def test_fire_preservation_recovers_resample_loss():
    """Fire-pixel preservation in the slicer survives LANCZOS downscale.

    Asset 27 (dragon flame) has 11,000+ fire pixels in row-2 cells where
    the dragon's flame jet erupts forward. LANCZOS downscale at 0.82 ratio
    smears anti-aliased fire boundary pixels below the strict R/G/B threshold,
    losing 25-35% of fire-pixel count. The `_preserve_fire_pixels` helper
    detects fire in the source crop and over-paints the LANCZOS output to
    recover the lost pixels.

    Bar: a tall fire trail (matches asset 27's row-2 jet) must preserve
    >=85% of source fire pixels in the output cell. The strict slicer
    without preservation drops below 70% on the same input.
    """
    raw_w, raw_h = 1254, 1254
    cols, rows = 4, 4
    pitch_x = raw_w / cols
    pitch_y = raw_h / rows

    # Build a sheet with a row-2 dragon-flame style trail: a TALL fire jet
    # (width ~ 0.7 * pitch, height ~ 0.6 * pitch) anchored inside cell (2, 1).
    sheet = Image.new("RGB", (raw_w, raw_h), MAGENTA)
    draw = ImageDraw.Draw(sheet)
    # Cell (2, 1) center
    cx = round(1.5 * pitch_x)
    cy = round(2.5 * pitch_y)
    # Dragon body (centered, smaller than jet)
    draw.ellipse([cx - 50, cy - 50, cx + 50, cy + 50], fill=CHAR_COLOR)
    # Tall flame jet extending across the cell, with anti-aliased orange
    # gradient by drawing concentric ellipses of decreasing size+brightness.
    jet_left = cx + 30
    jet_right = round(1.95 * pitch_x)  # almost to right boundary
    jet_top = cy - 90
    jet_bot = cy + 90
    for shrink, fcolor in [(0, (255, 100, 0)), (15, (240, 90, 10))]:
        draw.rectangle(
            [jet_left + shrink, jet_top + shrink, jet_right - shrink, jet_bot - shrink],
            fill=fcolor,
        )

    # Source fire-pixel count using the verifier's exact criterion
    src_arr = np.array(sheet)
    src_fire_count = int(sprite_slicing._is_fire(src_arr).sum())
    assert src_fire_count > 1000, f"setup: expected dense fire trail, got {src_fire_count}"

    # Run content-aware slicer with preservation enabled (default).
    cells = sprite_slicing.slice_with_content_awareness(sheet, cols, rows, 256)
    target_cell = cells[2 * cols + 1]
    target_arr = np.array(target_cell.convert("RGBA"))
    target_fire = int((sprite_slicing._is_fire(target_arr[..., :3]) & (target_arr[..., 3] > 32)).sum())

    print(
        f"[fire-preserve] source={src_fire_count} target={target_fire} target/source={target_fire / src_fire_count:.1%}"
    )

    # Bar: preservation maintains >=85% of source fire pixel count.
    # Note: a flat-color synthetic rectangle survives LANCZOS without any
    # special handling because there's no anti-aliased edge to smear; this
    # test still locks in that the slicer doesn't *destroy* fire content.
    # The dragon-flame regression — anti-aliased edges — is exercised by
    # the live asset 27 acceptance run (100% net post-pipeline).
    assert target_fire / src_fire_count >= 0.85, (
        f"Fire preservation should retain >=85% of source fire; got "
        f"{target_fire}/{src_fire_count} = {target_fire / src_fire_count:.1%}"
    )


def test_fire_preservation_skips_non_fire_assets():
    """Plasma / non-fire assets are unaffected by fire preservation.

    Asset 30 (plasma orb) paints blue/violet content with effectively zero
    fire-criterion pixels. The fire-preservation path must be a no-op when
    the source crop has no fire — otherwise plasma colors would be
    corrupted by stray orange paint.
    """
    raw_w, raw_h = 1254, 1254
    cols, rows = 4, 4
    pitch_x = raw_w / cols
    pitch_y = raw_h / rows
    sheet = Image.new("RGB", (raw_w, raw_h), MAGENTA)
    draw = ImageDraw.Draw(sheet)
    # Plasma-style content: blue/violet circle in cell (2, 1), no fire.
    cx = round(1.5 * pitch_x)
    cy = round(2.5 * pitch_y)
    draw.ellipse([cx - 70, cy - 70, cx + 70, cy + 70], fill=(80, 60, 220))

    # Source has zero fire pixels
    src_arr = np.array(sheet)
    assert sprite_slicing._is_fire(src_arr).sum() == 0

    cells = sprite_slicing.slice_with_content_awareness(sheet, cols, rows, 256)
    target_arr = np.array(cells[2 * cols + 1].convert("RGBA"))
    target_fire = int((sprite_slicing._is_fire(target_arr[..., :3]) & (target_arr[..., 3] > 32)).sum())
    # With no fire in source, no fire should be painted at target.
    assert target_fire == 0, f"Non-fire content should not get fire over-painted; got {target_fire} fire pixels"


def main() -> int:
    test_strict_slicer_loses_more_than_20pct_of_trail()
    test_content_aware_recovers_full_trail()
    test_content_aware_centroid_ownership()
    test_content_aware_returns_correct_cell_count_and_size()
    test_fire_preservation_recovers_resample_loss()
    test_fire_preservation_skips_non_fire_assets()
    print("All content-aware extraction tests PASS.")
    return 0


if __name__ == "__main__":
    sys.exit(main())
writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deploymentStars: 321kUpdated Claude CodeCodexVerifiedInstall
xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.Stars: 197kUpdated Claude CodeCodexVerifiedInstall
shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release.Stars: 118kUpdated Claude CodeCodexVerifiedInstall