Debounce and Throttle Patterns

VerifiedCaution

Guides the design, implementation, and validation of debounce and throttle patterns to optimize high-frequency events like UI interactions and file watching. Reduces unnecessary processing and smooths resource usage, improving both responsiveness and stability.

Sby Skills Guide Bot
DevelopmentIntermediate
3/4/2026
Claude Code
#debounce#throttle#performance#event-handling#frontend

Recommended for

Automated summary

This skill structures the analysis of high-frequency events, the choice between debounce and throttling, their TypeScript implementation, and measurement of their performance impact.

Strengths

  • Runs a four-phase workflow from requirements gathering to performance validation.
  • Provides concrete implementation and measurement templates for reuse.
  • Encourages documenting parameters and impact so tuning remains traceable.

Limitations

  • Focuses on UI events and file watching, with examples mainly in TypeScript.
  • Does not prescribe universal performance thresholds; delay values must be adapted to context.
  • Relies on external reference and asset files being present to follow the full process.
When to use it

Use when a high-frequency event handler (input, scroll, resize, file watching) needs optimization and the choice between debounce and throttle must be justified.

When not to use it

Do not use for one-off events or when the bottleneck lies elsewhere (network, server, algorithm), as this skill does not address those causes.

Security analysis

Caution
Quality score80/100

The skill contains no destructive commands, credential exfiltration, obfuscated payloads, or instructions to disable safety. However, it grants Bash, Write, and Edit and calls a local logging script, so it uses powerful tools for legitimate development workflow purposes. The risk is therefore moderate and should be reviewed with the actual scripts present.

Findings
  • •Declares Bash, Write, and Edit permissions; these can modify local files and execute scripts.
  • •Invokes scripts/log_usage.mjs, which may update logs/metrics files; script contents are not shown and should be reviewed before execution.
  • •References multiple local files under references/, assets/, agents/, and scripts/; ensure all referenced resources exist and are trusted.
How this analysis is made

Examples

Optimize search input
Our search box sends an API request on every keystroke. Help me decide between debounce and throttle, pick a delay with rationale, and implement it in TypeScript.
Scroll and resize handlers
Audit our scroll and resize handlers for performance issues, recommend debounce/throttle settings, and outline how to measure the before/after impact.
File watcher rebuilds
Our file watcher triggers too many rebuilds. Design a debounce strategy, document the parameter choices, and validate the performance improvement.

name: debounce-throttle-patterns description: | 高頻度イベントに対するデバウンス/スロットリングの設計・実装・検証を整理するスキル。 UIイベントやファイル監視の負荷を最適化し、応答性と安定性を両立する。

Anchors: • Debounce Pattern / 適用: 連続入力の抑制 / 目的: 不要な処理の削減 • Throttle Pattern / 適用: 定期的な処理制御 / 目的: リソース負荷の平準化 • Web Performance Patterns / 適用: UIイベント最適化 / 目的: UX改善

Trigger: Use when optimizing high-frequency events, selecting debounce/throttle strategies, tuning delay intervals, or validating performance impacts. debounce, throttle, event optimization, scroll resize, input performance allowed-tools:

  • Read
  • Write
  • Edit
  • Bash
  • Glob
  • Grep

debounce-throttle-patterns

概要

高頻度イベントの最適化に必要な要件整理、パターン選択、実装、検証を支援する。

ワークフロー

Phase 1: 要件整理

目的: イベントの種類と制約を整理し、最適化対象を明確にする。

アクション:

  1. references/Level1_basics.md で基本概念を確認する。
  2. assets/pattern-selection-checklist.md で要件を整理する。
  3. references/requirements-index.md で要件整合を確認する。

Task: agents/analyze-event-requirements.md を参照

Phase 2: パターン設計

目的: デバウンス/スロットリングの選定とパラメータ設計を行う。

アクション:

  1. references/implementation-patterns.md でパターンを比較する。
  2. 待機時間/間隔を設計し、判断根拠を記録する。
  3. assets/debounce-throttle.ts で実装方針を確認する。

Task: agents/design-pattern-strategy.md を参照

Phase 3: 実装

目的: 選定したパターンを実装し、影響範囲を記録する。

アクション:

  1. assets/debounce-throttle.ts をベースに実装する。
  2. 変更点と影響範囲を整理する。

Task: agents/implement-patterns.md を参照

Phase 4: 検証と運用

目的: パフォーマンス影響を検証し、改善記録を残す。

アクション:

  1. assets/performance-measurement-template.md で測定結果を整理する。
  2. agents/validate-pattern-performance.md の観点で評価する。
  3. scripts/log_usage.mjs で記録を更新する。

Task: agents/validate-pattern-performance.md を参照

Task仕様ナビ

| Task | 起動タイミング | 入力 | 出力 | | --- | --- | --- | --- | | analyze-event-requirements | Phase 1開始時 | イベント情報 | 要件メモ、制約一覧 | | design-pattern-strategy | Phase 2開始時 | 要件メモ | パターン設計、パラメータ案 | | implement-patterns | Phase 3開始時 | 設計メモ | 実装差分、影響範囲 | | validate-pattern-performance | Phase 4開始時 | 実装差分 | 検証レポート、改善提案 |

詳細仕様: 各Taskの詳細は agents/ ディレクトリを参照

ベストプラクティス

すべきこと

| 推奨事項 | 理由 | | --- | --- | | イベントの目的を先に整理する | パターン選定が明確になる | | パラメータ根拠を記録する | 再調整が容易になる | | 実装後に測定する | 期待効果を確認できる | | 影響範囲を明示する | 回帰を防止できる |

避けるべきこと

| 禁止事項 | 問題点 | | --- | --- | | 一律でパターン適用 | UX劣化を招く | | 根拠なしの間隔設定 | 調整できない | | 測定を省略する | 効果が不明になる | | 記録を残さない | 改善が継続できない |

リソース参照

scripts/(決定論的処理)

| スクリプト | 機能 | | --- | --- | | scripts/validate-skill.mjs | スキル構造検証 | | scripts/log_usage.mjs | 使用記録と評価メトリクス更新 |

references/(詳細知識)

| リソース | パス | 読込条件 | | --- | --- | --- | | レベル1 基礎 | references/Level1_basics.md | 要件整理時 | | レベル2 実務 | references/Level2_intermediate.md | 設計時 | | レベル3 応用 | references/Level3_advanced.md | 実装時 | | レベル4 専門 | references/Level4_expert.md | 検証時 | | 実装パターン | references/implementation-patterns.md | 設計時 | | 要求仕様索引 | references/requirements-index.md | 仕様確認時 | | 旧スキル | references/legacy-skill.md | 互換確認時 |

assets/(テンプレート・素材)

| アセット | 用途 | | --- | --- | | assets/debounce-throttle.ts | 実装テンプレート | | assets/pattern-selection-checklist.md | パターン選定チェックリスト | | assets/performance-measurement-template.md | 測定テンプレート |

運用ファイル

| ファイル | 目的 | | --- | --- | | EVALS.json | レベル評価・メトリクス管理 | | LOGS.md | 実行ログの蓄積 | | CHANGELOG.md | 改善履歴の記録 |

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/debounce-and-throttle-patterns-mmbizjzz/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/debounce-and-throttle-patterns-mmbizjzz' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/debounce-and-throttle-patterns-mmbizjzz/download' --output '.skill-downloads/debounce-and-throttle-patterns-mmbizjzz/SKILL.md.part' && mv '.skill-downloads/debounce-and-throttle-patterns-mmbizjzz/SKILL.md.part' '.skill-downloads/debounce-and-throttle-patterns-mmbizjzz/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/debounce-and-throttle-patterns-mmbizjzz/SKILL.md' && test -s '.skill-downloads/debounce-and-throttle-patterns-mmbizjzz/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/debounce-throttle-patterns' && cp -R '.skill-downloads/debounce-and-throttle-patterns-mmbizjzz' '.claude/skills/debounce-throttle-patterns'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/debounce-and-throttle-patterns-mmbizjzz'

openskills read 'debounce-and-throttle-patterns-mmbizjzz'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/debounce-and-throttle-patterns-mmbizjzz/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills