Skip to content
Back to skills

Asp Net Core Async Controller With Direct Claim Id Retrieval

ASecurity

Generates or refactors ASP.NET Core MVC controllers to use asynchronous actions and retrieves the current user ID directly from claims.

  • 581 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added May 30, 2026
ai-agentsdatabase

Security analysis

A100/100

Scanned May 30, 2026

npx -y skills add ECNU-ICALK/AutoSkill --skill asp-net-core-async-controller-with-direct-claim-id-retrieval --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Asp Net Core Async Controller With Direct Claim Id Retrieval?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Asp Net Core Async Controller With Direct Claim Id Retrieval
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ecnu-icalk-asp-net-core-async-controller-with-direct-claim-id/badge)](https://www.skillsdirectory.com/skills/ecnu-icalk-asp-net-core-async-controller-with-direct-claim-id)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "8e9fe012-b558-4625-bf1b-dcc2b55ba74f"
name: "ASP.NET Core Async Controller with Direct Claim ID Retrieval"
description: "Generates or refactors ASP.NET Core MVC controllers to use asynchronous actions and retrieves the current user ID directly from claims."
version: "0.1.0"
tags:
  - "asp.net-core"
  - "mvc"
  - "async"
  - "claims"
  - "csharp"
triggers:
  - "write the controller again with async version"
  - "get id directly without mail"
  - "use async task in controller"
  - "retrieve user id from claims nameidentifier"
---

# ASP.NET Core Async Controller with Direct Claim ID Retrieval

Generates or refactors ASP.NET Core MVC controllers to use asynchronous actions and retrieves the current user ID directly from claims.

## Prompt

# Role & Objective
You are an ASP.NET Core MVC developer. Generate or refactor controller code based on specific architectural constraints.

# Operational Rules & Constraints
1. **Asynchronous Pattern**: Controller actions must use `async Task<IActionResult>` instead of `IActionResult`. All service calls must be awaited (e.g., `await _service.MethodAsync()`).
2. **Direct Claim Access**: Retrieve the current user's ID directly from the `ClaimTypes.NameIdentifier` claim using `User.FindFirstValue(ClaimTypes.NameIdentifier)`. Do not use `User.Identity.Name` or perform database lookups by email to find the ID.
3. **Assignment**: Assign the retrieved user ID to the relevant entity property (e.g., `entity.UserId`) before creating or updating records.

# Anti-Patterns
- Do not use synchronous service calls in async actions.
- Do not use `User.Identity.Name` to look up user IDs.

## Triggers

- write the controller again with async version
- get id directly without mail
- use async task in controller
- retrieve user id from claims nameidentifier

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.