hassanzohdy/mongez-user/current-user

Claude Code and agent skill by hassanzohdy/mongez-user

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

How to use the module-level current user pointer (`setCurrentUser` / `getCurrentUser`) for cross-module access to the logged-in user.

Install

npx vskill@latest install hassanzohdy/mongez-user/current-user

SKILL.md

Current User Pointer

A single module-level slot for "the logged-in user", set and read from anywhere.

API

ts
import { setCurrentUser, getCurrentUser } from "@mongez/user";
setCurrentUser(user); // store a user instance
getCurrentUser(); // retrieve it (returns the same User, or undefined)

Caveats

  • It's a module-level variable. In a Node process serving multiple requests, all requests share the slot. This is fine in a browser (one user per tab) but a footgun in SSR — do NOT use it server-side; thread the user instance through your request context instead.
  • Tests need to reset it between cases. Either call setCurrentUser(undefined as any) in afterEach, or never call setCurrentUser in a test that the next test will run after.
  • getCurrentUser() is typed User | undefined — it returns undefined until setCurrentUser has been called, so always null-check (or use ?.) before calling methods on the result.

Lifecycle

The pointer doesn't auto-update on logout(). If your code reads getCurrentUser()?.isLoggedIn(), that returns false after logout (because the user instance reports it), but getCurrentUser() itself still returns the same instance. There's no way to "unset" the slot except by setting it to undefined:

ts
user.logout();
setCurrentUser(undefined as any);

Most apps don't need to do this — they just check isLoggedIn() and gate on that.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
5

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/hassanzohdy/mongez-user/current-user/badge)](https://verified-skill.com/skills/hassanzohdy/mongez-user/current-user)

Something wrong with this skill or its page? Tell us.