From core
Looks up AWS Cognito users by sub UUID, finds duplicates sharing phone/email, analyzes keep/delete vs backend data, fixes orphaned UNCONFIRMED signups. For 403 login errors or sync issues.
How this skill is triggered — by the user, by Claude, or both
Slash command
/core:cognito-user-analysisThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Analyze and fix duplicate Cognito users in clipboard-production by comparing against backend data.
Analyze and fix duplicate Cognito users in clipboard-production by comparing against backend data.
Skill directory: This skill's scripts are in scripts/ relative to this file.
cbh_user_id doesn't match CognitoNot for: Single user attribute updates (use AWS CLI directly)
# 1. Verify prerequisites
scripts/check-prerequisites.sh
# 2. Create input file (one sub per line)
echo "68e1e380-d0c1-7028-4256-3361fd833080" > subs.txt
# 3. Pipeline: lookup → find duplicates → analyze → fix
scripts/cognito-lookup.sh subs.txt results.csv
scripts/cognito-find-duplicates.sh results.csv duplicates.csv
scripts/cognito-analyze-duplicates.sh duplicates.csv analysis.csv
# 4. Review analysis.csv, then fix (ALWAYS dry-run first!)
scripts/cognito-fix-duplicates.sh analysis.csv --dry-run
scripts/cognito-fix-duplicates.sh analysis.csv
Run scripts/check-prerequisites.sh to verify. Requirements:
| Requirement | Setup |
|---|---|
AWS profile cbh-production-platform | aws sso login --profile cbh-production-platform |
~/.cbh_token | Get from web app dev tools → Network → Authorization header |
See references/setup.md for detailed setup.
All scripts support --help. Run <script> --help for full usage.
| Script | Purpose |
|---|---|
scripts/check-prerequisites.sh | Verify AWS + API token are valid |
scripts/cognito-lookup.sh | sub → user details CSV |
scripts/cognito-find-duplicates.sh | Find accounts sharing phone/email |
scripts/cognito-analyze-duplicates.sh | Compare against backend, assign KEEP/DELETE |
scripts/cognito-fix-duplicates.sh | Execute deletions and updates |
Compares Cognito accounts against backend to determine which to keep:
| Score | Meaning |
|---|---|
| 185 | Perfect match: cbh_user_id + email + phone + CONFIRMED |
| 100+ | cbh_user_id matches (high confidence) |
| 25-99 | Partial match (email or phone only) |
| 0-24 | Orphaned signup (UNCONFIRMED, no backend link) |
Highest score = KEEP_AND_UPDATE. Others = DELETE.
| Mistake | Fix |
|---|---|
| 403 Forbidden from API | Token expired → get fresh token from web app |
| Skipping --dry-run | Always dry-run first. Deletes are permanent. |
| Wrong AWS profile | Run scripts/check-prerequisites.sh to verify |
npx claudepluginhub clipboardhealth/core-utils --plugin coreInspects, enables, disables, and configures CloudBase auth providers, login methods, publishable keys, and SMS/email sender setup before implementing client or backend auth flows.
Explores and executes Clerk Backend REST API endpoints. Browse tags, inspect schemas, and call API operations like listing users or managing organizations.
References Auth0 CLI commands for managing apps, APIs, users, roles, organizations, actions, logs, custom domains, universal login, and Terraform exports. Helps with authentication, RBAC, branding, debugging, and scripting via --json output.