AgentSkillsCN

session-replay

设置会话回放,用于可视化调试。适用于实现 DOM 录制并控制隐私时使用。

SKILL.md
--- frontmatter
name: session-replay
description: Set up session replay for visual debugging. Use when implementing DOM recording with privacy controls.
triggers:
  - "session replay"
  - "record user sessions"
  - "visual debugging"
priority: 3

Session Replay

Capture visual recordings of user sessions for debugging.

When to Use

  • Reproducing hard-to-debug issues
  • Understanding user confusion
  • QA and support investigations
  • Validating error context

Privacy Requirements (Must Do)

Mask by default:

  • All text input fields
  • Passwords and sensitive data
  • Financial information
  • Personal identifiers
  • User photos/documents
  • Chat messages

Performance Budget

ResourceLimit
CPU<3% additional
Memory<10MB additional
NetworkBatch uploads, compress
BundleLazy load SDK

Best Practices

DoDon't
Lazy load replay SDKInclude in main bundle
Mask all inputs by defaultAllow recording of inputs
Sample sessions (10-20%)Record 100%
Focus on error sessionsRecord everything
Test privacy maskingAssume it works

Sampling Strategy

code
replaysSessionSampleRate: 0.1   // 10% of sessions
replaysOnErrorSampleRate: 1.0   // 100% of error sessions

Implementation

Load vendor-specific configuration from references/platforms/*.md when generating code.

VendorConfig Reference
Sentryreferences/platforms/sentry.md
Datadogreferences/platforms/datadog.md
LogRocketreferences/platforms/logrocket.md
FullStoryreferences/platforms/fullstory.md

Related

  • skills/error-tracking - Correlating errors with replays
  • skills/user-journey-tracking - Session context