# context-sensitive-cursor

context-sensitive-cursor — a rule for typewriter scenes where the caret takes its colour and height from whichever segment of the line is being typed.

- rule · `type=rule` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline · ★ 78316 repo stars
- Author: calesthio
- License: AGPL-3.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/calesthio/OpenMontage/tree/HEAD/.agents/skills/hyperframes-animation/rules/context-sensitive-cursor.md
- Updated: 2026-10-24
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/rules/context-sensitive-cursor

## What it does

This rule covers a scene with a typed line where the caret picks up the colour of the segment on screen. Every entry in the sequence holds a time, the visible text, a segment key and a hex colour. A GSAP driver looks up the entry for the current time inside `onUpdate` and repaints the caret block.

You get the scene markup, CSS with placeholders such as `{monoFont}` and `{cursorGap}`, a paused timeline and a few variations: no blink while characters are still being added, a taller caret on the brand segment, a contrast swap when the text renders dark. Blink runs off `Math.sin` instead of CSS `@keyframes` because keyframe animation drifts once the scene is seeked.

Use a monospace stack. A proportional face makes the caret slide away mid-segment. Keep the palette to 3-4 colours, or the shifts look random. The example loads `gsap@3.14.2` from a CDN, so the page needs that script before the timeline runs.

## Install

### Claude Code (native platform)

**Manually: put the files in place**
- File: `.claude/rules/context-sensitive-cursor.md` — The paths frontmatter field limits the files

### Codex

**AGENTS.md**
- Codex reads AGENTS.md: paste the rule text there

### Cursor

**Manually: put the files in place**
- File: `.cursor/rules/context-sensitive-cursor.mdc` — Frontmatter: description, globs, alwaysApply

### GitHub Copilot

**Manually: put the files in place**
- File: `.github/instructions/context-sensitive-cursor.instructions.md` — The applyTo field sets which files it applies to

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/rules/context-sensitive-cursor.md`

### Cline

**Manually: put the files in place**
- File: `.clinerules/context-sensitive-cursor.md`

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/calesthio/OpenMontage/tree/HEAD/.agents/skills/hyperframes-animation/rules/context-sensitive-cursor.md

## When to use it
- colour the caret to match a brand accent mid-line
- keep blink in sync when the scene is seeked
- highlight a keyword by switching cursor colour
- lay out a terminal scene with a monospace caret on GSAP
- suppress blink while characters are still typing

## Example prompts
- Make the caret switch to the brand accent while the brand name is being typed, then fade back to grey on the placeholder.
- Drive the blink with `Math.sin` so seeking does not throw it off.
- Add a `success` segment entry to `SEQUENCE` with a green caret.

## Similar
- [svg-animation](https://affpapa.org/en/nevibecode/skills/svg-animation.md) — skill · 4400 installs
- [accessible-animation](https://affpapa.org/en/nevibecode/skills/accessible-animation.md) — skill · 4400 installs
- [modern-web-design](https://affpapa.org/en/nevibecode/skills/modern-web-design.md) — skill · 3200 installs
- [animate-text](https://affpapa.org/en/nevibecode/skills/animate-text.md) — skill · 2800 installs
- [animation-systems](https://affpapa.org/en/nevibecode/skills/animation-systems.md) — skill · 2400 installs
- [frontend-developer](https://affpapa.org/en/nevibecode/skills/dylantarre-frontend-developer.md) — skill · 633 installs

From the same set: [calesthio/openmontage](https://affpapa.org/en/nevibecode/by/calesthio/openmontage.md) — 101 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
