Invitation Lifecycle Contract Repair

    by Mariusz Wrzeszczynski

    1

    Repair invitation lifecycle drift across tenant scope, tokens, roles, expiry, resend, revoke, acceptance, account linking, and retries.

    Secure checkout via Stripe

    0 installsSecurity scanned

    Works with the AI tools you already use

    CClaude CodeCCursorCCodex CLIGGitHub CopilotGGemini CLIVVS CodeWWindsurfMManus+14 more

    See it in action

    You say

    Tokens are plaintext and resend keeps old links valid. Recipient check is missing at acceptance. Repair locally in our Node/Prisma repo without touching production.

    Your agent does

    I have identified token storage risks and a recipient-binding gap. I will now generate a patch to hash tokens, implement versioned supersession for resends, and add a transactional check to verify the authenticated user matches the invited email before committing the membership.

    What you get

    Fix cross-tenant invitation leaks by deriving scope from tokens.Implement hashed, versioned tokens to prevent reuse of old or revoked links.Ensure membership creation and invitation consumption are atomic transactions.Revalidate seat limits and domain restrictions at the moment of acceptance.

    About this skill

    The problem

    Invitation logic often drifts across tenants, roles, and authentication paths, leading to leaked access or duplicate memberships. Security risks arise when tokens are stored in plaintext, resend actions fail to invalidate old links, or inviter authority is never revalidated at the moment of acceptance.

    What it does

    • Identifies cross-tenant invitation risks and guessable token vulnerabilities.
    • Fixes broken lifecycles where resending or revoking leaves legacy links active.
    • Repairs transactional gaps that mark invitations as accepted before membership is successfully committed.
    • Centralizes role-ceiling and domain-restriction logic across registration and login flows.
    • Implements idempotent dispatch commands to prevent duplicate emails and audit events during retries.

    Frameworks & tools

    Works with repository-local materials including Prisma, TypeORM, SQLAlchemy, Django ORM, Redis, Celery, BullMQ, Auth0, Clerk, and standard email adapters.

    Why this beats prompting it yourself

    General prompts often miss edge cases like revoke-accept races or seat-limit revalidation during concurrent requests. This skill uses a structured contract register to ensure every state transition, from dispatch to audit, is transactionally sound and tenant-safe.

    Use cases

    • Preventing a user from accepting an invitation into the wrong organization or workspace.
    • Rotating and versioning tokens so that resending an invite supersedes all previous links.
    • Ensuring inviter authority is checked at acceptance, not just at initial creation.
    • Reconciling duplicate membership attempts when users accept invitations via multiple tabs or retries.

    Known limitations

    Does not access production databases, send live emails, or perform production migrations. Policy decisions regarding role hierarchy or guest access require human approval.

    How to install

    Drop the file into your AI Agent. Works with Claude, Cursor, ChatGPT, and 20+ more.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill passes our trust checks below.

    Security scanned

    Passed our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    30-day refund

    Not a fit? Get your money back

    Trust & safety

    Security scanned

    Verified clean today

    Listedtoday

    Creator

    Mariusz Wrzeszczynski
    Mariusz Wrzeszczynski

    109 skills on Agensi

    Frequently Asked Questions

    Popular in AI Agents & LLM Ops