agentsclimarketplace

Asp net core async controller with direct claim id retrieval

Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/english_gpt3.5_8_GLM4.7/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.From its SKILL.md

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

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.

SKILL.md

1.8 KB, 265 tokens by cl100k_base, as published. Nobody here has run it

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

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.