alfadocs-logic-review

Review AlfaDocs integration code for business-logic and data-flow correctness.

Updated Mar 9, 2026
One-click install
npx skills add https://github.com/alfadocs/ai-harness-instructions --skill alfadocs-logic-review
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: alfadocs-logic-review
Source: https://github.com/alfadocs/ai-harness-instructions/tree/main/lovable/skills/alfadocs-logic-review
Command: npx skills add https://github.com/alfadocs/ai-harness-instructions --skill alfadocs-logic-review

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you review AlfaDocs integrations for correctness issues that are easy to miss in a normal UI check, such as cross-tenant data leakage, broken webhook handling, unsafe token refresh, and incorrect auth choices.

Core Features & Use Cases

  • Practice and archive scoping: Verifies that every AlfaDocs request is derived from server-side /me data and always includes the right practice and archive identifiers.
  • Tenant isolation and security: Checks that stored data, queries, and RLS policies keep each practice fully separated and keep secrets out of the browser.
  • Webhook and retry handling: Reviews webhook parsing, routing, response codes, idempotency, and error handling so repeated events do not create duplicate side effects.
  • Use Case: A developer asks you to audit an existing Lovable plus Supabase integration before launch, and you trace the Edge Functions, token manager, and webhook handler for blockers and warnings.

Quick Start

Ask for a correctness audit of the AlfaDocs integration and have it check practice scoping, tenant isolation, webhook handling, token refresh safety, and idempotent retries.

Frequently Asked Questions about alfadocs-logic-review

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I audit Supabase Edge Functions for tenant isolation and data leakage?

To audit Supabase Edge Functions for tenant isolation, verify that all data access uses service-role-only permissions and that every query enforces strict practice-level separation. This prevents cross-tenant data leakage and keeps secrets out of the browser.

How do I handle AlfaDocs webhook retries without creating duplicate side effects?

Handling AlfaDocs webhook retries safely requires idempotent routing logic and returning a 200 response code immediately. You must parse and route events carefully so repeated webhook deliveries do not trigger duplicate side effects in your integration.

Why does my OAuth token refresh logic fail under concurrent requests?

OAuth token refresh logic fails under concurrent requests when it lacks concurrency-safe locks. Implementing resilient, concurrency-safe refresh locks ensures that simultaneous token renewal attempts do not invalidate each other or cause authentication errors.

How do I verify practice and archive scoping in a Lovable and Supabase integration?

To verify practice and archive scoping in a Lovable and Supabase integration, check that every AlfaDocs API request derives its identifiers from server-side /me data. This ensures queries always include the correct practice and archive parameters.

Does this code review check for correct auth selection between OAuth and service roles?

Yes, this code review checks for correct auth selection by verifying that service-role-only data access is enforced server-side. It audits your auth choices to ensure secrets remain protected and the right authentication method is applied.