user-state-debugging

Diagnose and repair user account state issues with Node.js scripts.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/Sanchay-T/influencer-platform-app --skill user-state-debugging
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: user-state-debugging
Source: https://github.com/Sanchay-T/influencer-platform-app/tree/main/.claude/skills/user-state-debugging
Command: npx skills add https://github.com/Sanchay-T/influencer-platform-app --skill user-state-debugging

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Expert knowledge on debugging user account issues, diagnostic scripts, fix scripts for onboarding, billing sync, and Clerk vs database mismatches.

Core Features & Use Cases

  • Primary Diagnostic Script: /scripts/inspect-user-state.js to inspect user state.
  • Fix & Recovery Scripts: reset onboarding, fix billing state, complete onboarding, delete user, reset to fresh state.
  • Diagnostic Patterns: Onboarding stuck, billing sync issues, trial activation, Clerk/db mismatch.
  • Pattern Guidance: Step-by-step workflows to identify and fix issues quickly.

Quick Start

Run node scripts/inspect-user-state.js --email [email protected] to diagnose; follow with a fix script such as node scripts/reset-user-onboarding.js userId.

Frequently Asked Questions about user-state-debugging

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

FAQPage Schema
How do I diagnose user state issues in my onboarding flow?

Diagnose user state issues by running the inspect-user-state.js script with a user's email address. This diagnostic script examines onboarding_step, trial_status, current_plan, billing_sync_status, Stripe data, and Clerk records to identify mismatches and failures blocking the onboarding process.

What causes billing synchronization failures between Clerk and my database?

Billing sync failures occur when Clerk user records diverge from your database state, causing trial activation, plan-limit, or Stripe data inconsistencies. The fix-user-billing-state.js script reconciles these discrepancies by aligning billing_sync_status and Stripe records across both systems.

How do I fix a user stuck in the onboarding flow?

Fix stuck onboarding by running reset-user-onboarding.js to reset the onboarding_step state, or complete-onboarding-and-activate-plan.js to advance the user through remaining steps and activate their plan. Choose based on whether you need to restart or complete the flow.

Can I use these scripts to clean up test data and reset user accounts?

Yes. Use delete-user-completely.js to remove a user entirely, or reset-user-to-fresh-state.js to clear onboarding, billing, and Clerk state without deletion. Both scripts handle complete data cleanup for test environments and account recovery scenarios.

When should I suspect a Clerk versus database mismatch in user state?

Suspect a Clerk-vs-database mismatch when users report trial not activating, plan limits not applying, or onboarding appearing complete in one system but not the other. The inspect-user-state.js script reveals these discrepancies by comparing Clerk records against your database state.

Do these diagnostic scripts require specific Node.js versions or dependencies?

The metadata specifies no external dependencies for the diagnostic and fix scripts. Run them with Node.js directly using the script paths; dependencies are empty, so no additional packages need installation before executing inspect-user-state.js or fix scripts.