skills/vendix-ai-platform-core/SKILL.md
Core AI Platform Layer: AIEngineService, providers, run/runStream, rate limiting, response sanitization, logging, cost tracking, and super-admin AI config/app CRUD. Trigger: When working with AIEngineService, adding providers, configuring AI applications, rate limiting, cost tracking, logging, or debugging AI requests.
npx skillsauth add rzyfront/vendix vendix-ai-platform-coreInstall 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-engine.service.tsapps/backend/src/ai-engine/interfaces/ai-provider.interface.tsapps/backend/src/ai-engine/providers/apps/backend/src/ai-engine/ai-logging.service.tsapps/backend/src/domains/superadmin/ai-engine/apps/frontend/src/app/private/modules/super-admin/ai-engine/onModuleInit(), reloadConfigurations(), isConfigured().chat(), complete(), chatWith(configId, ...).run(appKey, variables?, extraMessages?), runStream(appKey, variables?, extraMessages?).testProvider(configId), getApplication(appKey).AIEngineModule is global; inject AIEngineService directly.
Backend SdkType is currently only:
openai_compatibleanthropic_compatibleOther provider names like DeepSeek, Groq, Mistral, Ollama, Azure, or Google are presets/custom base URLs through OpenAI-compatible config, not separate backend provider classes.
API key resolution uses api_key_ref when configured; otherwise env key AI_${PROVIDER}_API_KEY.
AIMessage.content supports strings and multimodal content parts, including image URL parts used by invoice OCR.
run():
ai_engine_applications by key.ai_feature_category maps to a feature.system_prompt, interpolated prompt_template, and extraMessages.temperature, max_tokens, output format, and retry config.<think>...</think> unless config settings.thinking === true.finally and emits ai.request.completed.Common errors: AI_APP_001, AI_APP_003, AI_CONFIG_001, AI_PROVIDER_002, AI_APP_004, AI_REQUEST_001.
runStream() follows the same lookup/gate/rate/provider/message path as run(), but:
chatStream().{ type: 'error', error } for failures instead of throwing in most cases.done.ai.request.completed and logs model as undefined.Per-app Redis key: ai:ratelimit:${app.key}.
pipeline.incr(key) and pipeline.expire(key, windowSeconds).rate_limit.maxRequests and rate_limit.windowSeconds exist.AILoggingService.logRequest() writes ai_engine_logs and swallows logging errors.
input_preview is truncated to 500 chars.settings.pricing.input_per_1k and settings.pricing.output_per_1k.request_id, but logRequest() currently does not write request id from context.Backend config endpoints are under /superadmin/ai-engine. App endpoints are under /superadmin/ai-engine/applications.
Frontend panel currently:
ai_feature_category.Only add a provider when OpenAI-compatible or Anthropic-compatible cannot support the SDK/protocol.
Required steps:
AIProvider in apps/backend/src/ai-engine/providers/.SdkType union.AIEngineService.vendix-ai-enginevendix-ai-streamingvendix-subscription-gatevendix-ai-chatdevelopment
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.