ワンクリックで
generate-excel-report
Scaffold a new endpoint to generate and download a high-performance Excel report using MiniExcel.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Scaffold a new endpoint to generate and download a high-performance Excel report using MiniExcel.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
Create and manage EF Core database migrations safely. Use when: adding a migration, modifying schema, changing entity properties, adding indexes, updating database structure.
Scaffold a new domain entity across all Clean Architecture layers. Use when: creating a new entity, adding a new resource, scaffolding CRUD for a new model. Creates entity, interface, repository, service, DTO, validator, mapping, controller, and tests.
Create a new modular infrastructure extension. Use when: adding a new infrastructure feature, integrating a new service provider, creating middleware, adding a new cross-cutting concern.
Generate comprehensive test suites for existing code. Use when: adding tests for untested code, improving coverage, writing unit tests, writing integration tests, testing new features.
SOC 職業分類に基づく
| name | generate-excel-report |
| description | Scaffold a new endpoint to generate and download a high-performance Excel report using MiniExcel. |
| argument-hint | Entity name (e.g., Customer) |
Creates a high-performance Excel export endpoint for a given entity using the MiniExcel library.
page, pageSize).ProductResponseDto), NEVER raw Domain Entities, to ensure proper column names and avoid exposing sensitive internal state.MiniExcel should be configured with FastMode = true and EnableAutoWidth = true via OpenXmlConfiguration.MemoryStream and returned via the File() helper.src/Server/Api/Controllers/{Name}Controller.cs).[HttpGet("ExportToExcel")] endpoint.[FromQuery]) that the GetAll endpoint uses, but DO NOT accept page or pageSize.CancellationToken.OpenXmlConfiguration.MemoryStream using await memoryStream.SaveAsAsync(items, sheetName: "{Name}s", configuration: config);.memoryStream.Seek(0, SeekOrigin.Begin);).return File(memoryStream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "{Name}s_{DateTime.Now:yyyyMMdd_HHmmss}.xlsx");.[HttpGet("ExportToExcel")]
public async Task<ActionResult> ExportToExcelAsync(
[FromQuery] string? someFilter,
CancellationToken cancellationToken)
{
// 1. Fetch data without pagination
var (items, _) = await _service.GetAllAsync(someFilter, page: null, pageSize: null, cancellationToken);
// 2. Configure MiniExcel
var config = new OpenXmlConfiguration
{
FastMode = true,
EnableAutoWidth = true,
AutoFilter = true
};
// 3. Write to memory stream
var memoryStream = new MemoryStream();
await memoryStream.SaveAsAsync(items.ToList(), sheetName: "Report", configuration: config);
memoryStream.Seek(0, SeekOrigin.Begin);
// 4. Return as file
return File(
memoryStream,
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
$"Report_{DateTime.Now:yyyyMMdd_HHmmss}.xlsx");
}