sequencer-integration

- Help an application developer and their coding agent integrate and use @kzkymur/sequencer effectively.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "sequencer-integration" with this command: npx skills add kzkymur/sequencer/kzkymur-sequencer-sequencer-integration

Purpose

  • Help an application developer and their coding agent integrate and use @kzkymur/sequencer effectively.

  • Provide minimal, reliable steps with links to focused references.

When To Use

  • Building animations, audio cues, game or UI events, or any timed workflow.

  • Needing linear (serial) or overlapping (parallel) event execution with millisecond control.

Quick Workflow

  • Choose Mode

  • Queue (class Sequencer ): run fragments strictly in order.

  • Independent (class IndependentSequencer ): run fragments by start time; multiple can overlap.

  • Define Fragments

  • Queue: new Fragment(name, durationMs, callback?) .

  • Independent: new IndependentFragment(name, durationMs, startMs, callback?) .

  • Modular: new CustomFragment(name, startMs) then addFragment(...) with independent/custom fragments; duration is computed; callback cannot be set directly.

  • Initialize

  • Queue: const seq = new Sequencer(pitchMs, speed=1.0, loop=false, useUniversalWorker=false) .

  • Independent: const seq = new IndependentSequencer(pitchMs, speed=1.0, loop=false) .

  • Pitch is the tick interval; smaller is smoother but costlier. useUniversalWorker=true improves timer precision.

  • Compose

  • push(fragment) to append.

  • insert(index, fragment) for Queue only (throws on Independent).

  • remove(fragment) by identity.

  • Control

  • await seq.play(delayMs=0) ; throws if already playing or delay < 0.

  • seq.stop(delayMs=0) ; throws if not playing or delay < 0.

  • await seq.waitCompleted() to await natural end (must be playing).

  • await seq.replay(delayMs=0) ; requires not playing; resets time to 0.

  • Visualize (optional)

  • seq.renderToCanvas(ctx, { width?, height?, activeColor?, inactiveColor?, timeIndicatorColor? }) .

Safety & Error Guards (agent-minded)

  • Validate inputs before calling:

  • setPitch(p > 0) , setSpeed(s > 0) ; non-positive or NaN throws.

  • play/stop(delay >= 0) ; negative or NaN throws.

  • insert(0..fragments.length) ; out-of-range throws.

  • Duplicates: pushing a fragment with an existing id throws.

  • Independent mode: insert(...) always throws (unsupported).

  • CustomFragment: cannot set callback; name must be non-empty; start must be ≥ 0.

Handy Getters

  • getFragments() returns a copy of current fragments.

  • getCurrentTime() current elapsed ms.

  • getPitch() , setPitch(...) .

  • setSpeed(...) , setLoopFlag(...) , isLooping() .

Open These References When Needed

  • references/quick-start.md – install + minimal setup.

  • references/api.md – precise method signatures and invariants.

  • references/patterns.md – common patterns (UI, audio, games, tasks).

  • references/testing.md – unit/integration test scaffolds.

  • references/troubleshooting.md – known errors and fixes.

Notes For Coding Agents

  • Prefer creating fragments once and reusing via .copy() when repeating patterns.

  • Await waitCompleted() when callers expect completion before proceeding.

  • For canvas, ensure totalDuration > 0 before rendering to avoid divide-by-zero visuals.

  • For high precision timelines, set useUniversalWorker=true (Queue mode) and avoid heavy work in callbacks.

References

  • See the skill-creator guidance in .agents/skills/skill-creator/ for structure and progressive disclosure patterns.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

openclaw-version-monitor

监控 OpenClaw GitHub 版本更新,获取最新版本发布说明,翻译成中文, 并推送到 Telegram 和 Feishu。用于:(1) 定时检查版本更新 (2) 推送版本更新通知 (3) 生成中文版发布说明

Archived SourceRecently Updated
Coding

ask-claude

Delegate a task to Claude Code CLI and immediately report the result back in chat. Supports persistent sessions with full context memory. Safe execution: no data exfiltration, no external calls, file operations confined to workspace. Use when the user asks to run Claude, delegate a coding task, continue a previous Claude session, or any task benefiting from Claude Code's tools (file editing, code analysis, bash, etc.).

Archived SourceRecently Updated
Coding

ai-dating

This skill enables dating and matchmaking workflows. Use it when a user asks to make friends, find a partner, run matchmaking, or provide dating preferences/profile updates. The skill should execute `dating-cli` commands to complete profile setup, task creation/update, match checking, contact reveal, and review.

Archived SourceRecently Updated
Coding

clawhub-rate-limited-publisher

Queue and publish local skills to ClawHub with a strict 5-per-hour cap using the local clawhub CLI and host scheduler.

Archived SourceRecently Updated