my-toybox: Command for Claude Code

.claude/commands/fix-shader.md

fix-shader is a command for Claude Code from Koshimizu-Takehito/my-toybox. It costs 0 tokens per session (1,296 once invoked), scanned A, original, MIT.

A command for investigating and improving Metal shaders, which are programs that run on a graphics processor to create visual effects. It checks shader code and related SwiftUI views for common integration and type errors.

In plain words
What is it for?
Use it to debug, optimize, or extend Metal-based visual effects in a Swift and SwiftUI project.
Why use it?
It provides a repeatable checklist for locating shader files and diagnosing issues such as missing attributes, mismatched types, missing headers, and invalid texture access.

Command for Claude Code

Written for Claude Code: installed under .claude/.

This is Koshimizu-Takehito/my-toybox's own configuration. It tells Claude Code how to work on my-toybox itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything my-toybox configures →

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is #include "../../MyToyboxCore/Utils/Shaders/Common.h".

Reuse

Borrowing it

Nothing to install: this file belongs to Koshimizu-Takehito/my-toybox. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/Koshimizu-Takehito/my-toybox/develop/.claude/commands/fix-shader.md
Clone the repo
git clone --depth 1 https://github.com/Koshimizu-Takehito/my-toybox

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for fix-shader

README.md
[![agentmods](https://agentmods.dev/badge/commands/koshimizu-takehito/my-toybox/fix-shader/github.svg)](https://agentmods.dev/commands/koshimizu-takehito/my-toybox/fix-shader)
Your own site
<a href="https://agentmods.dev/commands/koshimizu-takehito/my-toybox/fix-shader"><img src="https://agentmods.dev/badge/commands/koshimizu-takehito/my-toybox/fix-shader/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for fix-shader

Your own site · 80×15
<a href="https://agentmods.dev/commands/koshimizu-takehito/my-toybox/fix-shader"><img src="https://agentmods.dev/badge/commands/koshimizu-takehito/my-toybox/fix-shader.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,296 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.01296
Opus 5 $0.00000 $0.00648
Sonnet 5 $0.00000 $0.00259
Haiku 4.5 $0.00000 $0.00130

Measured 6d ago against content hash 8e9507318e22, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

fix-shader scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/fix-shader.md · 166 lines

How it starts

The opening of the file, as written. The whole thing — 166 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Metal Shader Engineer

Debug, optimize, and enhance Metal shaders for visual effects.

Task

You are the shader-engineer agent. Your mission is to diagnose and fix Metal shader issues, optimize GPU performance, and implement advanced graphics techniques.

Steps

  1. Identify Target Shader

    • Ask the user which shader needs work (or use the provided shader name)
    • Locate the shader file in:
      • Packages/Sources/Screens/<Name>/Shaders/{Name}Shader.metal
      • Or Packages/Sources/MyToyboxCore/Utils/Shaders/
  2. Read and Analyze

    • Read the shader file and any related SwiftUI views
    • Check for common Metal issues:
      • Missing [[stitchable]] attribute
      • Incorrect function signatures for SwiftUI integration
      • Missing header includes (Common.h, Color.h, etc.)
      • Type mismatches (half vs float)
      • Out-of-bounds texture access
  3. Available Shader Utilities You have access to these shared headers in MyToyboxCore/Utils/Shaders/:

    • Common.h: Basic definitions and constants
    • Color.h: Color space conversions, blending
    • Metric.h: Distance calculations, metrics
    • Mod.metal: Modulo operations for wrapping
    • Hash.metal: Noise and hash functions
  4. Common Patterns

    Stitchable Shader Template:

    #include <metal_stdlib>
    #include "../../MyToyboxCore/Utils/Shaders/Common.h"
    using namespace metal;
    
    [[stitchable]] half4 effectShader(
        float2 position,    // Current pixel position
        half4 color,        // Input color
        float time,         // Animation time
        float2 size         // Canvas size
    ) {
        float2 uv = position / size;  // Normalize coordinates
        // Effect implementation
        return half4(color.rgb, 1.0);
    }
    

    Distance Functions (SDF):

    float sdCircle(float2 p, float r) {
        return length(p) - r;
    }
    
    float sdBox(float2 p, float2 b) {
        float2 d = abs(p) - b;
        return length(max(d, 0.0)) + min(max(d.x, d.y), 0.0);
    }
    

Read the full file on GitHub · 166 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 166 lines · 0 tokens per session scan A 8e9507318e22

Subscribe to this mod's changes

fix-shader is a command published in the GitHub repository Koshimizu-Takehito/my-toybox (117 stars, last pushed 2mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,296 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-04.