hassanzohdy/mongez-user/current-user
Claude Code and agent skill by hassanzohdy/mongez-user
- community
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-userSKILL.md
Current User Pointer
A single module-level slot for "the logged-in user", set and read from anywhere.
API
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)inafterEach, or never callsetCurrentUserin a test that the next test will run after. getCurrentUser()is typedUser | undefined— it returnsundefineduntilsetCurrentUserhas 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:
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
- SKILL.md in the repositoryCheckingskills/current-user/SKILL.md
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
[](https://verified-skill.com/skills/hassanzohdy/mongez-user/current-user)