skills/vendix-ai-streaming/SKILL.md
AI streaming patterns with provider AsyncGenerators, AIEngineService.runStream, NestJS SSE endpoints, Angular EventSource wrappers, and streaming UI components. Trigger: When implementing streaming AI responses, working with SSE endpoints, or creating streaming UI components.
npx skillsauth add rzyfront/vendix vendix-ai-streamingInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
apps/backend/src/ai-engine/ai-stream.controller.tsapps/backend/src/ai-engine/ai-engine.service.tsapps/backend/src/ai-engine/providers/apps/frontend/src/app/core/services/ai-stream.service.tsapps/frontend/src/app/shared/components/ai-text-stream/apps/backend/src/domains/store/ai-chat/ai-chat.controller.tsAIEngineService.runStream(appKey, variables?, extraMessages?) validates app/provider, runs subscription gate, checks rate limit, builds messages, requires provider chatStream(), yields chunks, consumes quota on final done, and logs in finally.
Chunk shape:
type AIStreamChunk =
| { type: 'text'; content: string }
| { type: 'done'; usage?: { promptTokens: number; completionTokens: number; totalTokens: number } }
| { type: 'error'; error: string };
OpenAI-compatible provider streams text deltas and final done; usage may remain zero unless stream usage is explicitly requested. Anthropic provider uses client.messages.stream() and finalMessage() for usage.
Generic AI endpoint:
GET /store/ai/stream/:appKey.token is stripped.ai-chunk with JSON chunks.Chat endpoint:
SSE /store/ai-chat/conversations/:id/stream.content.ai-chunk events and completes on done/error.AIStreamService.streamRun(appKey, variables?, token?) uses EventSource, listens to ai-chunk, parses JSON, closes on done, error, parser failure, or unsubscribe.
app-ai-text-stream accepts stream$: Observable<string> | null, appends emitted strings to displayText, and shows a cursor while streaming.
Current caveat: app-ai-text-stream cleans up on component destroy, but replacing stream$ is not a full old-stream cleanup pattern. Verify before using it for frequently swapped streams.
Chat reducer supports streaming chunk accumulation, but current AIChatEffects use sync HTTP send and do not dispatch streaming actions. Do not document chat SSE as active frontend behavior unless wiring is added.
EventSource on completion/error/unsubscribe.done or error chunks.finally for backend streams.vendix-ai-platform-corevendix-ai-chatvendix-notifications-systemdevelopment
Mobile app development rules for Vendix Expo/React Native project. Trigger: When editing, creating, or modifying any file under apps/mobile, or when developing mobile-specific features.
development
Feature gating by store subscription state: global store write guard, AI feature gate, Redis feature resolution, quota consumption, frontend paywall interceptor, banner, and subscription UI states. Trigger: When adding feature gates, paywalls, subscription-based access control, protecting store write operations, AI feature gates, or rollout flags.
testing
SaaS subscription billing for Vendix stores: plan pricing, invoices, Wompi platform payments, manual payments, partner commissions, payouts, proration, and dunning. Trigger: When creating SaaS invoices, working with partner rev-share, margin/surcharge pricing, invoice sequence allocation, partner payout batches, subscription payments, manual payments, or dunning flows.
development
Periodic quota counters with Redis, UTC period keys, Lua-based idempotent AI quota consumption, request-id deduplication, and post-success consumption. Trigger: When building quota counters, enforcing monthly/daily feature caps, or reusing AI quota patterns for uploads, emails, exports, or rate-limited features.