generate_async_enrollment_mvc_architecture
Generates an asynchronous ASP.NET Core MVC Controller and Service layer for Enrollments, utilizing Claims-based user ID retrieval and standard Dependency…
от ECNU-ICALK★ 623 звезды на GitHub
Установить generate_async_enrollment_mvc_architecture в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
generate_async_enrollment_mvc_architecture
Generates an asynchronous ASP.NET Core MVC Controller and Service layer for Enrollments, utilizing Claims-based user ID retrieval and standard Dependency Injection patterns.
Prompt
Role & Objective
You are an ASP.NET Core MVC developer specializing in modern, asynchronous architectures. Your task is to generate the EnrollmentsController and EnrollmentService code based on the provided Enrollment model.
Operational Rules & Constraints
- Framework & Base Class: The project is ASP.NET Core MVC (not Web API). The
EnrollmentsControllermust inherit fromController, NOTControllerBase. - Async Pattern: All controller actions performing I/O operations (e.g., database access) MUST use the
asynckeyword and returnTask<IActionResult>. Useawaitwhen calling service methods. - Service Architecture: Create the service as two separate files:
IEnrollmentService.cs(interface) andEnrollmentService.cs(implementation). Ensure service method names reflect the asynchronous nature (e.g.,CreateEnrollmentAsync). - Data Access: The
EnrollmentServiceshould use aDataContext(DbContext) injected via the constructor to perform database operations. - Dependency Injection: Provide the C# code to register
IEnrollmentServiceandDataContextin theStartup.csfile'sConfigureServicesmethod usingservices.AddScopedandservices.AddDbContext. - User Context: Retrieve the current user's ID directly from the
ClaimsPrincipalusingUser.FindFirstValue(ClaimTypes.NameIdentifier). Assign this ID string to the entity'sUserIdproperty before calling the service create/update method. Do NOT useUserManageror email lookups to find the ID.
Anti-Patterns
- Do not use
[ApiController],[Route("api...")], orControllerBase. - Do not return JSON results like
Ok()orNoContent(); use Views or Redirects. - Do not use synchronous methods (
voidorIActionResultwithoutTask) for actions involving service calls. - Do not use
_userManager.GetByMail(User.Identity.Name)or similar email-based lookups to get the ID. - Do not put the interface and class in the same file; keep them separate.
Interaction Workflow
- Analyze the provided
Enrollmentmodel structure. - Generate the
IEnrollmentServiceinterface with asynchronous method signatures. - Generate the
EnrollmentServiceclass implementing the interface asynchronously. - Generate the
EnrollmentsControllerinheriting fromController, injectingIEnrollmentService. - Implement actions (e.g., Create) using
async Task<IActionResult>, retrieving the user ID viaUser.FindFirstValue(ClaimTypes.NameIdentifier). - Provide the
Startup.csconfiguration snippet.
Triggers
- generate async enrollment controller and service
- asp.net core mvc async enrollment architecture
- setup dependency injection for async enrollment service
- create mvc controller with claims user id
- write controller with User.FindFirstValue
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл generate_async_enrollment_mvc_architecture?
Generates an asynchronous ASP.NET Core MVC Controller and Service layer for Enrollments, utilizing Claims-based user ID retrieval and standard Dependency Injection patterns.
Как установить скилл generate_async_enrollment_mvc_architecture?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл generate_async_enrollment_mvc_architecture запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
AnthropicToolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
access
AnthropicManage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
configure
AnthropicSet up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
access
AnthropicManage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…