velt-activity-best-practices
Velt Activity Logs Best Practices
Comprehensive implementation guide for Velt's activity log system in React and Next.js applications. Contains 11 rules across 5 categories, prioritized by impact to guide automated code generation and integration patterns.
When to Apply
Reference these guidelines when:
- Adding real-time activity feeds to a React/Next.js application
- Subscribing to collaboration events via useAllActivities or getAllActivities
- Creating custom activity records for non-Velt events
- Configuring CRDT activity debounce to reduce feed noise
- Enabling immutability for compliance audit trails
- Filtering activities by feature type or action type
- Managing activity records server-side via REST API
- Debugging activity log issues (records not appearing, null loading states)
Rule Categories by Priority
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Core Setup | CRITICAL | core- |
| 2 | Data Access | HIGH | data- |
| 3 | Configuration | MEDIUM | config- |
| 4 | REST API | LOW-MEDIUM | rest- |
| 5 | Debugging & Testing | LOW-MEDIUM | debug- |
Quick Reference
1. Core Setup (CRITICAL)
core-setup— Enable Activity Logs in Velt Consolecore-activity-log-component— Use VeltActivityLog component to display activity feed UI
2. Data Access (HIGH)
data-subscribe-hook— Use useAllActivities hook for real-time activity feeds (React)data-subscribe-api— Use getAllActivities API for real-time activity subscriptionsdata-create-custom-hook— Use useActivityUtils to create custom activities (React)data-create-custom-api— Use getActivityElement API to create custom activities
3. Configuration (MEDIUM)
config-debounce— Configure CRDT activity debounce timeconfig-immutability— Enable immutability for audit trailsconfig-action-type-filters— Use action type constants for type-safe filtering
4. REST API (LOW-MEDIUM)
rest-api— Use REST APIs for server-side activity management
5. Debugging & Testing (LOW-MEDIUM)
debug-common-issues— Debug common activity log issues
How to Use
Read individual rule files for detailed explanations and code examples:
rules/shared/core/core-setup.md
rules/react/data/data-subscribe-hook.md
Each rule file contains:
- Brief explanation of why it matters
- Incorrect code example with explanation
- Correct code example with explanation
- Source pointers to official documentation
Compiled Documents
AGENTS.md— Compressed index of all rules with file paths (start here)AGENTS.full.md— Full verbose guide with all rules expanded inline
More from velt-js/agent-skills
velt-crdt-best-practices
Velt CRDT (Yjs) collaborative editing best practices for real-time applications. This skill should be used when implementing collaborative features using Velt CRDT stores, integrating with editors like Tiptap, BlockNote, CodeMirror, or ReactFlow, or debugging sync issues. Triggers on tasks involving real-time collaboration, multiplayer editing, CRDT stores, or Velt SDK integration.
28velt-comments-best-practices
Velt Comments implementation patterns and best practices for React, Next.js, and web applications. Use when adding collaborative commenting features, comment modes (Freestyle, Popover, Stream, Text, Page), rich text editor comments (TipTap, SlateJS, Lexical), media player comments, or chart comments.
27velt-setup-best-practices
Velt collaboration SDK setup guide for React, Next.js, Angular, Vue, and HTML applications. Use this skill when setting up Velt for the first time, configuring VeltProvider, implementing user authentication with authProvider and JWT tokens, initializing document collaboration with setDocuments, or debugging Velt setup issues. Triggers on any task involving Velt installation, VeltProvider configuration, auth token generation, document identity setup, or project structure for Velt integration — even if the user doesn't explicitly mention "setup".
26velt-notifications-best-practices
Velt Notifications implementation patterns and best practices for React, Next.js, and web applications. Use when adding in-app notifications, notification panels, email notifications via SendGrid, webhook integrations, or user notification preference management.
25velt-rest-apis-best-practices
Velt REST API v2 and webhook best practices for server-side integration. Use when calling Velt REST API v2 endpoints, generating JWT tokens for frontend authentication, handling Velt webhooks (comment events, huddle events, CRDT updates), managing users/documents/organizations via REST, or implementing server-side Velt operations. Triggers on any task involving Velt REST API, JWT token generation for Velt, Velt webhooks, x-velt-api-key headers, or server-side comment/notification/activity management — even if the user doesn't explicitly say 'REST API'. For the Python SDK (velt-py) for self-hosting, see velt-self-hosting-data-best-practices instead.
5velt-single-editor-mode-best-practices
Velt Single Editor Mode implementation patterns and best practices for React, Next.js, and web applications. Use when implementing exclusive editing access, editor/viewer role management, access request handoff flows, element-level sync control, timeout-based editor transfer, or multi-tab editing restrictions.
5