007
無料Security audit, hardening, threat modeling (STRIDE/PASTA), Red/Blue Team, OWASP checks, code review, incident response, and infrastructure security for any project.
日本語の概要は準備中です。原文の説明を表示しています。
ABP Framework cross-cutting patterns including authorization, background jobs, distributed events, multi-tenancy, and module configuration. Use when: (1) defining permissions, (2) creating background jobs, (3) publishing/handling distributed events, (4) configuring modules.
インストールする前に、エージェントに与えられる指示の中身を確認できます。
Cross-cutting concerns and infrastructure patterns for ABP Framework.
// Domain.Shared/Permissions/ClinicPermissions.cs
public static class ClinicPermissions
{
public const string GroupName = "Clinic";
public static class Patients
{
public const string Default = GroupName + ".Patients";
public const string Create = Default + ".Create";
public const string Edit = Default + ".Edit";
public const string Delete = Default + ".Delete";
}
public static class Appointments
{
public const string Default = GroupName + ".Appointments";
public const string Create = Default + ".Create";
public const string Edit = Default + ".Edit";
public const string Delete = Default + ".Delete";
public const string ViewAll = Default + ".ViewAll"; // Admins only
}
}
// Application.Contracts/Permissions/ClinicPermissionDefinitionProvider.cs
public class ClinicPermissionDefinitionProvider : PermissionDefinitionProvider
{
public override void Define(IPermissionDefinitionContext context)
{
var clinicGroup = context.AddGroup(ClinicPermissions.GroupName);
var patients = clinicGroup.AddPermission(
ClinicPermissions.Patients.Default,
L("Permission:Patients"));
patients.AddChild(ClinicPermissions.Patients.Create, L("Permission:Patients.Create"));
patients.AddChild(ClinicPermissions.Patients.Edit, L("Permission:Patients.Edit"));
patients.AddChild(ClinicPermissions.Patients.Delete, L("Permission:Patients.Delete"));
var appointments = clinicGroup.AddPermission(
ClinicPermissions.Appointments.Default,
L("Permission:Appointments"));
appointments.AddChild(ClinicPermissions.Appointments.Create, L("Permission:Appointments.Create"));
appointments.AddChild(ClinicPermissions.Appointments.ViewAll, L("Permission:Appointments.ViewAll"));
}
private static LocalizableString L(string name)
=> LocalizableString.Create<ClinicResource>(name);
}
// Declarative
[Authorize(ClinicPermissions.Patients.Create)]
public async Task<PatientDto> CreateAsync(CreatePatientDto input) { }
// Imperative
public async Task<AppointmentDto> GetAsync(Guid id)
{
var appointment = await _appointmentRepository.GetAsync(id);
if (appointment.DoctorId != CurrentUser.Id)
{
await AuthorizationService.CheckAsync(ClinicPermissions.Appointments.ViewAll);
}
return _mapper.AppointmentToDto(appointment);
}
// Check without throwing
public async Task<bool> CanCreatePatientAsync()
=> await AuthorizationService.IsGrantedAsync(ClinicPermissions.Patients.Create);
public class AppointmentReminderJob : AsyncBackgroundJob<AppointmentReminderArgs>, ITransientDependency
{
private readonly IRepository<Appointment, Guid> _appointmentRepository;
private readonly IEmailSender _emailSender;
public AppointmentReminderJob(
IRepository<Appointment, Guid> appointmentRepository,
IEmailSender emailSender)
{
_appointmentRepository = appointmentRepository;
_emailSender = emailSender;
}
public override async Task ExecuteAsync(AppointmentReminderArgs args)
{
var appointment = await _appointmentRepository.GetAsync(args.AppointmentId);
await _emailSender.SendAsync(
appointment.Patient.Email,
"Appointment Reminder",
$"You have an appointment on {appointment.AppointmentDate}");
}
}
public class AppointmentReminderArgs
{
public Guid AppointmentId { get; set; }
}
public async Task<AppointmentDto> CreateAsync(CreateAppointmentDto input)
{
var appointment = await _appointmentManager.CreateAsync(/*...*/);
// Schedule reminder 24 hours before
var reminderTime = appointment.AppointmentDate.AddHours(-24);
await _backgroundJobManager.EnqueueAsync(
new AppointmentReminderArgs { AppointmentId = appointment.Id },
delay: reminderTime - DateTime.Now);
return _mapper.AppointmentToDto(appointment);
}
// From entity (recommended for domain events)
public class Patient : AggregateRoot<Guid>
{
public void Activate()
{
IsActive = true;
AddDistributedEvent(new PatientActivatedEto
{
Id = Id,
Name = Name,
Email = Email
});
}
}
// From application service
public async Task ActivateAsync(Guid id)
{
var patient = await _patientRepository.GetAsync(id);
patient.Activate();
// Or manually publish:
await _distributedEventBus.PublishAsync(new PatientActivatedEto
{
Id = patient.Id,
Name = patient.Name,
Email = patient.Email
});
}
public class PatientActivatedEventHandler :
IDistributedEventHandler<PatientActivatedEto>,
ITransientDependency
{
private readonly IEmailSender _emailSender;
private readonly ILogger<PatientActivatedEventHandler> _logger;
public PatientActivatedEventHandler(
IEmailSender emailSender,
ILogger<PatientActivatedEventHandler> logger)
{
_emailSender = emailSender;
_logger = logger;
}
public async Task HandleEventAsync(PatientActivatedEto eventData)
{
_logger.LogInformation("Patient activated: {Name}", eventData.Name);
await _emailSender.SendAsync(
eventData.Email,
"Welcome",
"Your patient account has been activated");
}
}
public class EntitySyncEventHandler :
IDistributedEventHandler<EntityUpdatedEto>,
ITransientDependency
{
private readonly IRepository<Entity, Guid> _repository;
private readonly IDataFilter _dataFilter;
private readonly ILogger<EntitySyncEventHandler> _logger;
public async Task HandleEventAsync(EntityUpdatedEto eto)
{
// Disable tenant filter for cross-tenant sync
using (_dataFilter.Disable<IMultiTenant>())
{
try
{
_logger.LogInformation("Processing entity sync: {Id}", eto.Id);
// Idempotency check
var existing = await _repository.FirstOrDefaultAsync(
x => x.ExternalId == eto.ExternalId);
if (existing != null)
{
ObjectMapper.Map(eto, existing);
await _repository.UpdateAsync(existing);
}
else
{
var entity = ObjectMapper.Map<EntityUpdatedEto, Entity>(eto);
await _repository.InsertAsync(entity);
}
_logger.LogInformation("Entity sync completed: {Id}", eto.Id);
}
catch (Exception ex)
{
_logger.LogError(ex, "Entity sync failed: {Id}", eto.Id);
throw new UserFriendlyException($"Failed to sync entity: {ex.Message}");
}
}
}
}
public class CrossTenantService : ApplicationService
{
private readonly IDataFilter _dataFilter;
private readonly ICurrentTenant _currentTenant;
public async Task<List<PatientDto>> GetAllTenantsPatients()
{
using (_dataFilter.Disable<IMultiTenant>())
{
return await _patientRepository.GetListAsync();
}
}
public async Task OperateOnTenant(Guid tenantId)
{
using (_currentTenant.Change(tenantId))
{
await DoTenantSpecificOperation();
}
}
}
public async Task SeedAsync(DataSeedContext context)
{
if (context.TenantId.HasValue)
await SeedTenantDataAsync(context.TenantId.Value);
else
await SeedHostDataAsync();
}
[DependsOn(
typeof(ClinicDomainModule),
typeof(AbpIdentityDomainModule),
typeof(AbpPermissionManagementDomainModule))]
public class ClinicApplicationModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
PreConfigure<AbpIdentityOptions>(options =>
{
options.ExternalLoginProviders.Add<GoogleExternalLoginProvider>();
});
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpDistributedCacheOptions>(options =>
{
options.KeyPrefix = "Clinic:";
});
context.Services.AddTransient<IPatientAppService, PatientAppService>();
context.Services.AddSingleton<ClinicApplicationMappers>();
}
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
var app = context.GetApplicationBuilder();
var env = context.GetEnvironment();
if (env.IsDevelopment())
app.UseDeveloperExceptionPage();
}
}
public static class ClinicModuleExtensionConfigurator
{
public static void Configure()
{
ObjectExtensionManager.Instance.Modules()
.ConfigureIdentity(identity =>
{
identity.ConfigureUser(user =>
{
user.AddOrUpdateProperty<string>(
"Title",
property =>
{
property.Attributes.Add(new StringLengthAttribute(64));
});
});
});
}
}
IDataFilter.Disable<IMultiTenant>() sparinglyabp-entity-patterns - Domain layer patternsabp-service-patterns - Application layer patternsopeniddict-authorization - OAuth implementationdistributed-events-advanced - Advanced event patternsまだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
Security audit, hardening, threat modeling (STRIDE/PASTA), Red/Blue Team, OWASP checks, code review, incident response, and infrastructure security for any project.
日本語の概要は準備中です。原文の説明を表示しています。
Guides the creation of agile user stories and Gherkin feature files. Use when the user wants to create a user story, write acceptance criteria, define Gherkin scenarios, or author BDD feature files. This should trigger for requests such as Create a user story; Write a user story; I need to write a user story. Part of cursor-rules-java project
日本語の概要は準備中です。原文の説明を表示しています。
Facilitates conversational discovery to create Architectural Decision Records (ADRs) for non-functional requirements using the ISO/IEC 25010:2023 quality model. Use when the user wants to document quality attributes, NFR decisions, security/performance/scalability architecture, or design systems with measurable quality criteria. This should trigger for requests such as Create ADR for Non-functional requirements; Document Non-functional requirements; Capture Non-functional requirements; Generate Non-functional requirements in an ADR. Part of cursor-rules-java project
日本語の概要は準備中です。原文の説明を表示しています。
Run a health check on an existing project: dependency audit, security scan, test runner detection, CI/CD evaluation, and missing configuration analysis. Maps the three execution gates (pre/in/post) from /10x-bootstrapper to an assessment framework for existing codebases. Reads optional context/foundation/stack-assessment.md from /10x-stack-assess to focus checks on identified gaps. Writes context/foundation/health-check.md with findings, prioritized fixes, and an agent-readiness verdict. Use when the user has an existing project and wants to verify its health before working with an agent. Trigger phrases: "health check", "check my project", "audit my project", "is my project healthy", "sprawdź projekt", "audyt projektu", "health-check", "project health". Use AFTER /10x-stack-assess (brownfield chain), BEFORE agent onboarding (m1-l4).
日本語の概要は準備中です。原文の説明を表示しています。
You MUST use this when building projects end-to-end. Orchestrates all 12 team roles — automatically switches between CTO, architect, PM, engineers, SRE, security, DBA, QA, and EM based on the current phase of work. Starts with brainstorming before any implementation.
日本語の概要は準備中です。原文の説明を表示しています。
Use when you need to add or configure Maven plugins in your pom.xml — including quality tools (enforcer, surefire, failsafe, jacoco, pitest, spotbugs, pmd), security scanning (OWASP), code formatting (Spotless), version management, container image build (Jib), build information tracking, and benchmarking (JMH) — through a consultative, modular step-by-step approach that only adds what you actually need. This should trigger for requests such as Add Maven plugins in pom.xml; Improve Maven plugins in pom.xml. Part of cursor-rules-java project
日本語の概要は準備中です。原文の説明を表示しています。