Skip to main content
rule CX Codex

discrete-text-sequence — Claude Code rule: stepped terminal typing

discrete-text-sequence — a rule for GSAP scenes where the terminal line swaps whole states instead of typing evenly: typos, backspaces, pasted chunks and holds.

AGPL-3.0 ★ 78,316 updated 2026-10-24

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/rules/discrete-text-sequence.md
Open on GitHub

What discrete-text-sequence does

Instead of revealing characters one at a time, this scene swaps whole strings. States sit in a SEQUENCE array of { text, t } entries measured in seconds; each update walks the array backwards and paints the newest entry whose time has elapsed. Typos, deletions, pasted chunks and holds all fall out of that. Nothing tweens between states — the line jumps.

The file carries terminal markup with a $ prompt, a .text node and a cursor, plus CSS and a GSAP timeline built with paused: true. A tween running from 0 to TOTAL_DURATION with ease: "none" advances a counter, and its onUpdate writes textContent. Cursor blinking is computed with Math.sin, so it stays tied to the timeline. Variants at the bottom: plain per-character typing, a hold that reads as thinking, a scale pulse, and colour shifts per phase.

Timestamps must rise, and TOTAL_DURATION has to cover T_DONE with roughly a second to spare, or the final check mark never registers. Give .text-wrap a width at least as wide as the longest state at your TERMINAL_FONT_SIZE; a smaller TEXT_WRAP_MIN_WIDTH makes the right edge shudder on every swap. Monospace only. GSAP loads from a CDN script.

What it helps with

  • build a terminal scene where a typo gets corrected on screen
  • paste a chunk of text in one jump
  • insert a thinking pause mid-sentence
  • blink the cursor in sync with the render timeline
  • highlight the finished line with a colour change and pulse

Example prompts for the agent

  • Make a terminal scene that types in jumps from a SEQUENCE array and ends with a check mark.
  • Add a hold at THINK_HOLD_DUR before the phrase continues.
  • Set a monospace font and size TEXT_WRAP_MIN_WIDTH to the longest state so the right edge stops moving.

How to install discrete-text-sequence

Manually: put the files in place

.claude/rules/discrete-text-sequence.md

The paths frontmatter field limits the files

Step by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use

Questions about discrete-text-sequence

How do I install discrete-text-sequence in Claude Code?

Create the file .claude/rules/discrete-text-sequence.md in your project and put the rule text inside it.

What does discrete-text-sequence do?

It describes a scene where the terminal line is replaced state by state on timestamps: typos, backspacing, pasted chunks, holds. Even per-character typing ships as a separate variant.

What do I need for the scene to work?

GSAP from a CDN, a monospace font, and a container at least as wide as the longest state. Timestamps in SEQUENCE go in ascending order.

Similar IDE rules

All IDE rules for Frontend and UI →

From the same set101

The whole set →
synthetic-screen-recording The synthetic-screen-recording skill guides synthetic terminal demos in Remotion with TerminalScene. Use it when the command sequence and output can be authored ahead of time. CX Codex +1 ★ 78,316repo stars svg-path-draw svg-path-draw — a rule that gets the agent to trace an SVG outline stroke by stroke, then fade in a wordmark once the drawing settles. CX Codex +1 ★ 78,316repo stars hacker-flip-3d hacker-flip-3d supplies guidelines for creating a 3D character flip animation with randomized glyph decoding. Helps build terminal and airport-style text reveals. CX Codex +1 ★ 78,316repo stars gemini-omni Generates short clips via gemini-omni-1.1-flash and edits them through follow-up prompts without re-generating. Each generation returns an interaction_id so the next call changes only what you specify. CX Codex +1 ★ 78,316repo stars animation-groups The animation-groups rule organizes ManimGL animations for parallel, sequential, or staggered playback. Use it when several scene elements need coordinated timing. CX Codex +1 ★ 78,316repo stars transform-animations transform-animations — a rule that teaches Claude Code and Codex how to transform objects in ManimGL — from basic shape morphing to complex function-based transformations. Use it when writing Python animations of mathematical objects. CX Codex +1 ★ 78,316repo stars embedding embedding instructs your coding agent to debug ManimGL scenes interactively via IPython, letting you test object positions and animations without restarting the render. CX Codex +1 ★ 78,316repo stars vertical-spring-ticker vertical-spring-ticker is a rule for Claude Code and Codex that defines a slot-machine vertical ticker with additive GSAP spring physics. Each spring advances the stack one discrete step instead of a smooth scroll. CX Codex +1 ★ 78,316repo stars

Project sponsors

Companies that keep this analytics open