Skip to content

0xsline/OpenChatCut / src/agent/skills/shader-gen

shader-gen

Verified

AI shader generator for WebGL video effects, transitions, masks, and color grading (LUT / 调色 / 电影感 / film look). Use when the user wants a video effect (滤镜 / 特效), a transition (转场 / crossfade / wipe / cube / 3d), a mask (蒙版 / 遮罩 / reveal), a zoom / push-in (推近 / 推镜头), or a color grade — try the built-in effects (zoom, builtin LUTs) before generating a new shader.

FileKindSize
SKILL.mdskill md12.7 KB
examples/cube-rotate.mdmarkdown2.2 KB
examples/door-open.mdmarkdown4.1 KB
examples/page-curl.mdmarkdown4.1 KB
references/design-principles.mdmarkdown12.3 KB
references/property-changes.mdmarkdown4.4 KB

references/property-changes.md

View on GitHub
# Shader Property Changes

Read this whenever a task touches editable shader properties: adding, renaming, or removing a property key; changing a default; promoting a hardcoded shader constant; or updating one applied effect/transition override.

## Data Model

Three layers, in strict order:

1. `asset.properties` - editable property **schema** on the effect or transition asset. Declares every key (type, label, default, and `min`/`max`/`step` or `options`). Source of truth.
2. `item.propertyOverrides` - per-applied-item overrides. Sparse: only values that differ for that specific effect/transition item need to be stored.
3. `ctx.properties` - runtime object passed into the shader processor. Built by merging schema defaults with the applied item's overrides.

Shader property types are: `number`, `boolean`, `color`, `select`, `vec2`. Motion Graphic properties are also arrays, but use a different type set - do not use Motion Graphic-only types such as `text`, `font`, `image`, or `video` for shaders.

**Prerequisite rule:** a key must exist in `asset.properties` before shader code should read `ctx.properties.key`, and before an applied item override can show a control for that key.

For shader assets, `asset.properties` is always an array. Each object inside the array is one editable property entry.

## Decision Table

Use `edit_asset` when:

- shader code starts reading a new `ctx.properties.key`
- a property key is added, renamed, or removed
- a property type, label, options, or default changes

Use an applied item update with `propertyOverrides` when:

- the key already exists on the effect/transition asset
- one applied effect/transition item should use a different value than the asset default

Do not use `propertyOverrides` to add schema. Do not use `edit_asset` for one-off instance values.

## Promoting Hardcoded Values to Properties

When the user asks to adjust a hardcoded shader value (intensity, radius, color, softness, direction, center point, or anything tweakable), in the same turn both make the shader change AND promote the value to a property. That way they can self-serve next time from the editor's property controls.

Skip promotion when:

- user explicitly frames it as one-off ("just this once", "only for this item")
- the value is structural: texture binding names, pass IDs, GLSL constants required for loop unrolling, or math tied to shader correctness
- the asset is a locked template the user doesn't own

Workflow (one turn):

1. Fetch the current shader asset code and properties
2. Locate the hardcoded literal
3. Replace it with `ctx.properties.<key>` plus a fallback to the current value so existing items render identically
4. Add a matching entry inside the `properties` array with sensible `min`/`max`/`step` or `options`
5. `edit_asset` with both the updated `code` and `properties` in one call
6. If the user also asked for a specific new value, apply it either as the new `defaultValue` (baseline) or as a `propertyOverride` on the specific applied item

Example - promoting an intensity constant:

```ts
const props = ctx.properties as { intensity?: number } | undefined;
const intensity = props?.intensity ?? 0.6;
```

```json
"properties": [
  {
    "key": "intensity",
    "label": "Intensity",
    "type": "number",
    "defaultValue": 0.6,
    "min": 0,
    "max": 1,
    "step": 0.01
  }
]
```

Example - promoting a center point:

```json
"properties": [
  {
    "key": "center",
    "label": "Center",
    "type": "vec2",
    "defaultValue": [0.5, 0.5]
  }
]
```

## Asset-Level Changes

When the schema changes, update the shader asset's `code` and `properties` in the same `edit_asset` call. Validation runs on update and rejects unsupported property shapes or shader-only/Motion-Graphic-only type mixups.

1. Fetch the current asset with code and properties
2. Update code to read the target key from `ctx.properties`
3. `edit_asset` with both the new `properties` array and the new `code`
4. If a key was renamed, migrate affected applied item overrides to the new key

Keep keys stable when possible - renames create migration work.

## Item-Level Changes

Prerequisite: the key must already exist on `asset.properties`. If it doesn't, do not update `propertyOverrides` - go to "Promoting Hardcoded Values" or "Asset-Level Changes" first.

Update only the applied effect/transition item whose value should differ from the asset default.

```json
{ "propertyOverrides": { "intensity": 0.8 } }
```

```json
{ "propertyOverrides": { "center": [0.45, 0.55] } }
```
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall