plankit-cli 1.3.1 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/README.md +53 -3
  2. package/package.json +1 -1
  3. package/src/agents.js +8 -4
  4. package/src/cli.js +106 -5
  5. package/src/commandBundles.js +105 -0
  6. package/src/config.js +20 -2
  7. package/templates/PLANKIT.md +7 -0
  8. package/templates/dotnet-commands/codex/dotnet-architecture-audit.md +25 -0
  9. package/templates/dotnet-commands/codex/dotnet-clean-guardrails.md +24 -0
  10. package/templates/dotnet-commands/codex/dotnet-ef-migration.md +25 -0
  11. package/templates/dotnet-commands/codex/dotnet-endpoint-from-model.md +26 -0
  12. package/templates/dotnet-commands/codex/dotnet-extract-service.md +25 -0
  13. package/templates/dotnet-commands/codex/dotnet-feature.md +26 -0
  14. package/templates/dotnet-commands/codex/dotnet-generate-tests.md +25 -0
  15. package/templates/dotnet-commands/codex/dotnet-health.md +24 -0
  16. package/templates/dotnet-commands/codex/dotnet-migrate-minimal-api.md +25 -0
  17. package/templates/dotnet-commands/codex/dotnet-modernize.md +25 -0
  18. package/templates/dotnet-commands/cursor/dotnet-architecture-audit.md +26 -0
  19. package/templates/dotnet-commands/cursor/dotnet-clean-guardrails.md +25 -0
  20. package/templates/dotnet-commands/cursor/dotnet-ef-migration.md +26 -0
  21. package/templates/dotnet-commands/cursor/dotnet-endpoint-from-model.md +27 -0
  22. package/templates/dotnet-commands/cursor/dotnet-extract-service.md +26 -0
  23. package/templates/dotnet-commands/cursor/dotnet-feature.md +27 -0
  24. package/templates/dotnet-commands/cursor/dotnet-generate-tests.md +26 -0
  25. package/templates/dotnet-commands/cursor/dotnet-health.md +25 -0
  26. package/templates/dotnet-commands/cursor/dotnet-migrate-minimal-api.md +26 -0
  27. package/templates/dotnet-commands/cursor/dotnet-modernize.md +26 -0
  28. package/templates/dotnet-commands/opencode/dotnet-architecture-audit.md +23 -0
  29. package/templates/dotnet-commands/opencode/dotnet-clean-guardrails.md +22 -0
  30. package/templates/dotnet-commands/opencode/dotnet-ef-migration.md +23 -0
  31. package/templates/dotnet-commands/opencode/dotnet-endpoint-from-model.md +24 -0
  32. package/templates/dotnet-commands/opencode/dotnet-extract-service.md +23 -0
  33. package/templates/dotnet-commands/opencode/dotnet-feature.md +24 -0
  34. package/templates/dotnet-commands/opencode/dotnet-generate-tests.md +23 -0
  35. package/templates/dotnet-commands/opencode/dotnet-health.md +22 -0
  36. package/templates/dotnet-commands/opencode/dotnet-migrate-minimal-api.md +23 -0
  37. package/templates/dotnet-commands/opencode/dotnet-modernize.md +23 -0
  38. package/templates/dotnet-skills/gemini/dotnet-architecture-audit/SKILL.md +26 -0
  39. package/templates/dotnet-skills/gemini/dotnet-clean-guardrails/SKILL.md +25 -0
  40. package/templates/dotnet-skills/gemini/dotnet-ef-migration/SKILL.md +26 -0
  41. package/templates/dotnet-skills/gemini/dotnet-endpoint-from-model/SKILL.md +27 -0
  42. package/templates/dotnet-skills/gemini/dotnet-extract-service/SKILL.md +26 -0
  43. package/templates/dotnet-skills/gemini/dotnet-feature/SKILL.md +27 -0
  44. package/templates/dotnet-skills/gemini/dotnet-generate-tests/SKILL.md +26 -0
  45. package/templates/dotnet-skills/gemini/dotnet-health/SKILL.md +25 -0
  46. package/templates/dotnet-skills/gemini/dotnet-migrate-minimal-api/SKILL.md +26 -0
  47. package/templates/dotnet-skills/gemini/dotnet-modernize/SKILL.md +26 -0
  48. package/templates/vue-commands/codex/component-pattern-audit.md +24 -0
  49. package/templates/vue-commands/codex/design-token-discover.md +24 -0
  50. package/templates/vue-commands/codex/design-token-migrate.md +24 -0
  51. package/templates/vue-commands/codex/js-to-ts.md +25 -0
  52. package/templates/vue-commands/codex/reactivity-audit.md +25 -0
  53. package/templates/vue-commands/codex/state-strategy-audit.md +23 -0
  54. package/templates/vue-commands/codex/vue-guardrails.md +24 -0
  55. package/templates/vue-commands/codex/vue-health.md +28 -0
  56. package/templates/vue-commands/codex/vue-legacy-map.md +25 -0
  57. package/templates/vue-commands/codex/vue-migration-plan.md +24 -0
  58. package/templates/vue-commands/codex/vue-modernize-slice.md +26 -0
  59. package/templates/vue-commands/codex/vue-pattern-map.md +24 -0
  60. package/templates/vue-commands/codex/vue-standardize.md +26 -0
  61. package/templates/vue-commands/codex/vue-style-audit.md +24 -0
  62. package/templates/vue-commands/codex/vue-target-architecture.md +24 -0
  63. package/templates/vue-commands/cursor/component-pattern-audit.md +25 -0
  64. package/templates/vue-commands/cursor/design-token-discover.md +25 -0
  65. package/templates/vue-commands/cursor/design-token-migrate.md +25 -0
  66. package/templates/vue-commands/cursor/js-to-ts.md +26 -0
  67. package/templates/vue-commands/cursor/reactivity-audit.md +26 -0
  68. package/templates/vue-commands/cursor/state-strategy-audit.md +24 -0
  69. package/templates/vue-commands/cursor/vue-guardrails.md +25 -0
  70. package/templates/vue-commands/cursor/vue-health.md +29 -0
  71. package/templates/vue-commands/cursor/vue-legacy-map.md +26 -0
  72. package/templates/vue-commands/cursor/vue-migration-plan.md +25 -0
  73. package/templates/vue-commands/cursor/vue-modernize-slice.md +27 -0
  74. package/templates/vue-commands/cursor/vue-pattern-map.md +25 -0
  75. package/templates/vue-commands/cursor/vue-standardize.md +27 -0
  76. package/templates/vue-commands/cursor/vue-style-audit.md +25 -0
  77. package/templates/vue-commands/cursor/vue-target-architecture.md +25 -0
  78. package/templates/vue-commands/opencode/component-pattern-audit.md +22 -0
  79. package/templates/vue-commands/opencode/design-token-discover.md +22 -0
  80. package/templates/vue-commands/opencode/design-token-migrate.md +22 -0
  81. package/templates/vue-commands/opencode/js-to-ts.md +23 -0
  82. package/templates/vue-commands/opencode/reactivity-audit.md +23 -0
  83. package/templates/vue-commands/opencode/state-strategy-audit.md +21 -0
  84. package/templates/vue-commands/opencode/vue-guardrails.md +22 -0
  85. package/templates/vue-commands/opencode/vue-health.md +26 -0
  86. package/templates/vue-commands/opencode/vue-legacy-map.md +23 -0
  87. package/templates/vue-commands/opencode/vue-migration-plan.md +22 -0
  88. package/templates/vue-commands/opencode/vue-modernize-slice.md +24 -0
  89. package/templates/vue-commands/opencode/vue-pattern-map.md +22 -0
  90. package/templates/vue-commands/opencode/vue-standardize.md +24 -0
  91. package/templates/vue-commands/opencode/vue-style-audit.md +22 -0
  92. package/templates/vue-commands/opencode/vue-target-architecture.md +22 -0
  93. package/templates/vue-skills/gemini/component-pattern-audit/SKILL.md +25 -0
  94. package/templates/vue-skills/gemini/design-token-discover/SKILL.md +25 -0
  95. package/templates/vue-skills/gemini/design-token-migrate/SKILL.md +25 -0
  96. package/templates/vue-skills/gemini/js-to-ts/SKILL.md +26 -0
  97. package/templates/vue-skills/gemini/reactivity-audit/SKILL.md +26 -0
  98. package/templates/vue-skills/gemini/state-strategy-audit/SKILL.md +24 -0
  99. package/templates/vue-skills/gemini/vue-guardrails/SKILL.md +25 -0
  100. package/templates/vue-skills/gemini/vue-health/SKILL.md +29 -0
  101. package/templates/vue-skills/gemini/vue-legacy-map/SKILL.md +26 -0
  102. package/templates/vue-skills/gemini/vue-migration-plan/SKILL.md +25 -0
  103. package/templates/vue-skills/gemini/vue-modernize-slice/SKILL.md +27 -0
  104. package/templates/vue-skills/gemini/vue-pattern-map/SKILL.md +25 -0
  105. package/templates/vue-skills/gemini/vue-standardize/SKILL.md +27 -0
  106. package/templates/vue-skills/gemini/vue-style-audit/SKILL.md +25 -0
  107. package/templates/vue-skills/gemini/vue-target-architecture/SKILL.md +25 -0
@@ -0,0 +1,24 @@
1
+ # dotnet-health
2
+ > Audit .NET solution health: SDK versions, NuGet packages, vulnerabilities, and compiler warnings.
3
+
4
+ # /dotnet-health
5
+
6
+ Comprehensive health check for .NET solutions and projects.
7
+
8
+ ## Workflow
9
+ 1. Locate .sln and .csproj files, target frameworks (e.g. net8.0, net9.0), and SDK versions.
10
+ 2. Check for vulnerable and outdated NuGet packages (dotnet list package --vulnerable).
11
+ 3. Audit nullable reference types (<Nullable>enable</Nullable>) and compiler warning configurations.
12
+ 4. Output structured markdown diagnostic report with prioritized security and health recommendations.
13
+
14
+ ## Guardrail
15
+ Read-only diagnostic audit. Never modify project files during health check.
16
+
17
+ ## Options
18
+ - --json output machine-readable JSON metrics
19
+ - --project <path> restrict audit to a specific project
20
+
21
+ ## Execution
22
+ 1. Run .NET solution discovery against the repository.
23
+ 2. Apply the workflow above with the provided target.
24
+ 3. Report files created/modified and patterns applied.
@@ -0,0 +1,25 @@
1
+ # dotnet-migrate-minimal-api
2
+ > Migrate ASP.NET Core controllers to modern Minimal APIs with RouteGroups and typed results.
3
+
4
+ # /dotnet-migrate-minimal-api
5
+
6
+ Refactor traditional controllers to modern, high-performance Minimal API route groups.
7
+
8
+ ## Workflow
9
+ 1. Inspect controller routes, actions, authorization attributes, and filter pipeline.
10
+ 2. Create endpoint extension class (MapXxxEndpoints()) using MapGroup().
11
+ 3. Convert ActionResult<T> to TypedResults with explicit return types.
12
+ 4. Replace controller DI with endpoint parameter injection ([FromServices], [FromBody]).
13
+ 5. Verify route parity and run integration tests.
14
+
15
+ ## Guardrail
16
+ Preserve exact route paths, query parameter names, and HTTP status code behaviors.
17
+
18
+ ## Options
19
+ - --controller <Name> name of the controller to migrate
20
+ - --dry-run preview changes without modifying files
21
+
22
+ ## Execution
23
+ 1. Run .NET solution discovery against the repository.
24
+ 2. Apply the workflow above with the provided target.
25
+ 3. Report files created/modified and patterns applied.
@@ -0,0 +1,25 @@
1
+ # dotnet-modernize
2
+ > Upgrade legacy C# code to modern C# 12+ / .NET 8+ patterns (primary constructors, pattern matching).
3
+
4
+ # /dotnet-modernize
5
+
6
+ Modernize legacy C# syntax using modern C# language features.
7
+
8
+ ## Workflow
9
+ 1. Convert block-scoped namespaces to file-scoped namespaces (namespace X;).
10
+ 2. Convert classes/records with boilerplate constructors to primary constructors where appropriate.
11
+ 3. Adopt collection expressions ([] instead of new List<T>(), Array.Empty<T>()).
12
+ 4. Use pattern matching (is not null, switch expressions, property patterns).
13
+ 5. Build solution and run test suite to verify zero semantic changes.
14
+
15
+ ## Guardrail
16
+ Only apply safe, semantic-preserving modernizations. Never compromise readability for conciseness.
17
+
18
+ ## Options
19
+ - --project <path> target specific project
20
+ - --dry-run preview modernization diffs
21
+
22
+ ## Execution
23
+ 1. Run .NET solution discovery against the repository.
24
+ 2. Apply the workflow above with the provided target.
25
+ 3. Report files created/modified and patterns applied.
@@ -0,0 +1,26 @@
1
+ ---
2
+ description: Audit layer dependencies (Clean Architecture / Vertical Slices / DDD) and circular dependencies.
3
+ globs: **/*.cs, **/*.csproj, **/*.sln
4
+ ---
5
+
6
+ # dotnet-architecture-audit
7
+
8
+ # /dotnet-architecture-audit
9
+
10
+ Analyze architectural layer boundaries and project references across the .NET solution.
11
+
12
+ ## Workflow
13
+ 1. Parse project references between .csproj files.
14
+ 2. Verify Domain layer has zero external project dependencies.
15
+ 3. Verify Application layer depends only on Domain.
16
+ 4. Detect illegal Infrastructure/API leaks into core layers or circular dependencies.
17
+ 5. Generate dependency graph and compliance matrix.
18
+
19
+ ## Guardrail
20
+ Read-only architectural analysis.
21
+
22
+ ## Options
23
+ - --strict fail on any layer boundary violation
24
+ - --json output dependency graph as JSON
25
+
26
+ Follow this workflow whenever asked to build, modernize, or test .NET code in this repository.
@@ -0,0 +1,25 @@
1
+ ---
2
+ description: Generate NetArchTest architectural unit tests and EditorConfig rules to guard layer boundaries.
3
+ globs: **/*.cs, **/*.csproj, **/*.sln
4
+ ---
5
+
6
+ # dotnet-clean-guardrails
7
+
8
+ # /dotnet-clean-guardrails
9
+
10
+ Enforce clean architecture layer boundaries with automated architectural unit tests and EditorConfig.
11
+
12
+ ## Workflow
13
+ 1. Detect solution architecture layers (Domain, Application, Infrastructure, API).
14
+ 2. Generate NetArchTest tests asserting layer boundaries (e.g. Domain should not reference Infrastructure).
15
+ 3. Generate or update .editorconfig with C# formatting, naming rules, and diagnostic severities.
16
+ 4. Run architectural tests to verify current compliance.
17
+
18
+ ## Guardrail
19
+ Do not break legacy builds; apply warnings first or scope enforcement gradually.
20
+
21
+ ## Options
22
+ - --netarchtest generate NetArchTest test project
23
+ - --editorconfig generate .editorconfig rules
24
+
25
+ Follow this workflow whenever asked to build, modernize, or test .NET code in this repository.
@@ -0,0 +1,26 @@
1
+ ---
2
+ description: Safe Entity Framework Core migration workflow with entity audit, SQL review, and rollback.
3
+ globs: **/*.cs, **/*.csproj, **/*.sln
4
+ ---
5
+
6
+ # dotnet-ef-migration
7
+
8
+ # /dotnet-ef-migration
9
+
10
+ Plan, generate, and review safe Entity Framework Core database migrations.
11
+
12
+ ## Workflow
13
+ 1. Audit entity configurations (Fluent API vs DataAnnotations) in target DbContext.
14
+ 2. Check for missing indexes, foreign key cascading issues, and property lengths.
15
+ 3. Generate migration with a descriptive name (dotnet ef migrations add <Name>).
16
+ 4. Generate and inspect raw migration SQL script (dotnet ef migrations script).
17
+ 5. Check for destructive schema changes (table drops, column drops, data loss warnings).
18
+
19
+ ## Guardrail
20
+ Never execute irreversible or destructive migrations without explicit user confirmation.
21
+
22
+ ## Options
23
+ - --name <Name> descriptive migration name
24
+ - --preview-sql inspect generated SQL before applying
25
+
26
+ Follow this workflow whenever asked to build, modernize, or test .NET code in this repository.
@@ -0,0 +1,27 @@
1
+ ---
2
+ description: Generate ASP.NET Core Minimal API or Controller endpoints from an entity/model with validation.
3
+ globs: **/*.cs, **/*.csproj, **/*.sln
4
+ ---
5
+
6
+ # dotnet-endpoint-from-model
7
+
8
+ # /dotnet-endpoint-from-model
9
+
10
+ Generate robust CRUD endpoints from a domain model or entity.
11
+
12
+ ## Workflow
13
+ 1. Inspect entity/model properties, keys, and navigation properties.
14
+ 2. Generate Request/Response DTOs to avoid overposting or leaking domain entities.
15
+ 3. Generate endpoint handlers using TypedResults (Ok, Created, NotFound, ValidationProblem).
16
+ 4. Configure authorization, route groups, and OpenAPI metadata (.WithName(), .Produces()).
17
+ 5. Verify endpoint route constraints.
18
+
19
+ ## Guardrail
20
+ Never expose raw database entities directly to API responses. Always map through DTOs.
21
+
22
+ ## Options
23
+ - --minimal use ASP.NET Core Minimal APIs (default)
24
+ - --controller use Controller-based architecture
25
+ - --dto <Type> use existing DTO type
26
+
27
+ Follow this workflow whenever asked to build, modernize, or test .NET code in this repository.
@@ -0,0 +1,26 @@
1
+ ---
2
+ description: Refactor fat services or bloated controllers into isolated CQRS handlers or domain services.
3
+ globs: **/*.cs, **/*.csproj, **/*.sln
4
+ ---
5
+
6
+ # dotnet-extract-service
7
+
8
+ # /dotnet-extract-service
9
+
10
+ Decompose fat classes into single-responsibility handlers or domain services.
11
+
12
+ ## Workflow
13
+ 1. Identify oversized methods or multi-responsibility service classes.
14
+ 2. Extract target method into an independent Command/Query handler or domain service.
15
+ 3. Define required interfaces and register with Microsoft.Extensions.DependencyInjection.
16
+ 4. Update caller references and ensure backward compatibility.
17
+ 5. Create unit tests for extracted handler.
18
+
19
+ ## Guardrail
20
+ Preserve existing behavior and contract signatures. Do not introduce breaking API changes.
21
+
22
+ ## Options
23
+ - --class <Name> source class to refactor
24
+ - --method <Name> specific method to extract
25
+
26
+ Follow this workflow whenever asked to build, modernize, or test .NET code in this repository.
@@ -0,0 +1,27 @@
1
+ ---
2
+ description: Build an end-to-end vertical slice feature (Command/Query, MediatR, FluentValidation, Endpoint).
3
+ globs: **/*.cs, **/*.csproj, **/*.sln
4
+ ---
5
+
6
+ # dotnet-feature
7
+
8
+ # /dotnet-feature
9
+
10
+ Generate a complete, self-contained feature slice following Vertical Slice Architecture.
11
+
12
+ ## Workflow
13
+ 1. Determine feature name, operation type (Command or Query), and target domain.
14
+ 2. Generate Request and Response DTO records with immutable properties.
15
+ 3. Generate FluentValidation validator with standard validation rules.
16
+ 4. Generate MediatR / Wolverine handler with DbContext or repository access.
17
+ 5. Expose via Minimal API endpoint or Controller with TypedResults.
18
+ 6. Scaffold unit tests and integration tests.
19
+
20
+ ## Guardrail
21
+ Adhere to existing solution conventions (Vertical Slices vs Clean Architecture). Do not introduce unnecessary abstractions.
22
+
23
+ ## Options
24
+ - --type <command|query> operation type
25
+ - --model <Entity> domain entity to base feature on
26
+
27
+ Follow this workflow whenever asked to build, modernize, or test .NET code in this repository.
@@ -0,0 +1,26 @@
1
+ ---
2
+ description: Generate xUnit/NUnit tests with FluentAssertions and WebApplicationFactory integration tests.
3
+ globs: **/*.cs, **/*.csproj, **/*.sln
4
+ ---
5
+
6
+ # dotnet-generate-tests
7
+
8
+ # /dotnet-generate-tests
9
+
10
+ Generate comprehensive unit and integration tests for .NET handlers, services, and endpoints.
11
+
12
+ ## Workflow
13
+ 1. Inspect target class (Handler, Validator, Service, or Endpoint).
14
+ 2. Generate unit tests covering valid input, boundary conditions, and error cases.
15
+ 3. Use Moq or NSubstitute for dependencies and FluentAssertions for assertions.
16
+ 4. For endpoints, generate WebApplicationFactory integration tests verifying status codes and payloads.
17
+ 5. Run tests with dotnet test.
18
+
19
+ ## Guardrail
20
+ Mock only external boundaries (I/O, database, third-party APIs); test real business domain logic.
21
+
22
+ ## Options
23
+ - --framework <xunit|nunit> test framework (default: xunit)
24
+ - --integration generate WebApplicationFactory integration tests
25
+
26
+ Follow this workflow whenever asked to build, modernize, or test .NET code in this repository.
@@ -0,0 +1,25 @@
1
+ ---
2
+ description: Audit .NET solution health: SDK versions, NuGet packages, vulnerabilities, and compiler warnings.
3
+ globs: **/*.cs, **/*.csproj, **/*.sln
4
+ ---
5
+
6
+ # dotnet-health
7
+
8
+ # /dotnet-health
9
+
10
+ Comprehensive health check for .NET solutions and projects.
11
+
12
+ ## Workflow
13
+ 1. Locate .sln and .csproj files, target frameworks (e.g. net8.0, net9.0), and SDK versions.
14
+ 2. Check for vulnerable and outdated NuGet packages (dotnet list package --vulnerable).
15
+ 3. Audit nullable reference types (<Nullable>enable</Nullable>) and compiler warning configurations.
16
+ 4. Output structured markdown diagnostic report with prioritized security and health recommendations.
17
+
18
+ ## Guardrail
19
+ Read-only diagnostic audit. Never modify project files during health check.
20
+
21
+ ## Options
22
+ - --json output machine-readable JSON metrics
23
+ - --project <path> restrict audit to a specific project
24
+
25
+ Follow this workflow whenever asked to build, modernize, or test .NET code in this repository.
@@ -0,0 +1,26 @@
1
+ ---
2
+ description: Migrate ASP.NET Core controllers to modern Minimal APIs with RouteGroups and typed results.
3
+ globs: **/*.cs, **/*.csproj, **/*.sln
4
+ ---
5
+
6
+ # dotnet-migrate-minimal-api
7
+
8
+ # /dotnet-migrate-minimal-api
9
+
10
+ Refactor traditional controllers to modern, high-performance Minimal API route groups.
11
+
12
+ ## Workflow
13
+ 1. Inspect controller routes, actions, authorization attributes, and filter pipeline.
14
+ 2. Create endpoint extension class (MapXxxEndpoints()) using MapGroup().
15
+ 3. Convert ActionResult<T> to TypedResults with explicit return types.
16
+ 4. Replace controller DI with endpoint parameter injection ([FromServices], [FromBody]).
17
+ 5. Verify route parity and run integration tests.
18
+
19
+ ## Guardrail
20
+ Preserve exact route paths, query parameter names, and HTTP status code behaviors.
21
+
22
+ ## Options
23
+ - --controller <Name> name of the controller to migrate
24
+ - --dry-run preview changes without modifying files
25
+
26
+ Follow this workflow whenever asked to build, modernize, or test .NET code in this repository.
@@ -0,0 +1,26 @@
1
+ ---
2
+ description: Upgrade legacy C# code to modern C# 12+ / .NET 8+ patterns (primary constructors, pattern matching).
3
+ globs: **/*.cs, **/*.csproj, **/*.sln
4
+ ---
5
+
6
+ # dotnet-modernize
7
+
8
+ # /dotnet-modernize
9
+
10
+ Modernize legacy C# syntax using modern C# language features.
11
+
12
+ ## Workflow
13
+ 1. Convert block-scoped namespaces to file-scoped namespaces (namespace X;).
14
+ 2. Convert classes/records with boilerplate constructors to primary constructors where appropriate.
15
+ 3. Adopt collection expressions ([] instead of new List<T>(), Array.Empty<T>()).
16
+ 4. Use pattern matching (is not null, switch expressions, property patterns).
17
+ 5. Build solution and run test suite to verify zero semantic changes.
18
+
19
+ ## Guardrail
20
+ Only apply safe, semantic-preserving modernizations. Never compromise readability for conciseness.
21
+
22
+ ## Options
23
+ - --project <path> target specific project
24
+ - --dry-run preview modernization diffs
25
+
26
+ Follow this workflow whenever asked to build, modernize, or test .NET code in this repository.
@@ -0,0 +1,23 @@
1
+ ---
2
+ description: Audit layer dependencies (Clean Architecture / Vertical Slices / DDD) and circular dependencies.
3
+ ---
4
+
5
+ # /dotnet-architecture-audit
6
+
7
+ Analyze architectural layer boundaries and project references across the .NET solution.
8
+
9
+ ## Workflow
10
+ 1. Parse project references between .csproj files.
11
+ 2. Verify Domain layer has zero external project dependencies.
12
+ 3. Verify Application layer depends only on Domain.
13
+ 4. Detect illegal Infrastructure/API leaks into core layers or circular dependencies.
14
+ 5. Generate dependency graph and compliance matrix.
15
+
16
+ ## Guardrail
17
+ Read-only architectural analysis.
18
+
19
+ ## Options
20
+ - --strict fail on any layer boundary violation
21
+ - --json output dependency graph as JSON
22
+
23
+ Run against a .NET repository. Perform solution discovery first, then apply the workflow.
@@ -0,0 +1,22 @@
1
+ ---
2
+ description: Generate NetArchTest architectural unit tests and EditorConfig rules to guard layer boundaries.
3
+ ---
4
+
5
+ # /dotnet-clean-guardrails
6
+
7
+ Enforce clean architecture layer boundaries with automated architectural unit tests and EditorConfig.
8
+
9
+ ## Workflow
10
+ 1. Detect solution architecture layers (Domain, Application, Infrastructure, API).
11
+ 2. Generate NetArchTest tests asserting layer boundaries (e.g. Domain should not reference Infrastructure).
12
+ 3. Generate or update .editorconfig with C# formatting, naming rules, and diagnostic severities.
13
+ 4. Run architectural tests to verify current compliance.
14
+
15
+ ## Guardrail
16
+ Do not break legacy builds; apply warnings first or scope enforcement gradually.
17
+
18
+ ## Options
19
+ - --netarchtest generate NetArchTest test project
20
+ - --editorconfig generate .editorconfig rules
21
+
22
+ Run against a .NET repository. Perform solution discovery first, then apply the workflow.
@@ -0,0 +1,23 @@
1
+ ---
2
+ description: Safe Entity Framework Core migration workflow with entity audit, SQL review, and rollback.
3
+ ---
4
+
5
+ # /dotnet-ef-migration
6
+
7
+ Plan, generate, and review safe Entity Framework Core database migrations.
8
+
9
+ ## Workflow
10
+ 1. Audit entity configurations (Fluent API vs DataAnnotations) in target DbContext.
11
+ 2. Check for missing indexes, foreign key cascading issues, and property lengths.
12
+ 3. Generate migration with a descriptive name (dotnet ef migrations add <Name>).
13
+ 4. Generate and inspect raw migration SQL script (dotnet ef migrations script).
14
+ 5. Check for destructive schema changes (table drops, column drops, data loss warnings).
15
+
16
+ ## Guardrail
17
+ Never execute irreversible or destructive migrations without explicit user confirmation.
18
+
19
+ ## Options
20
+ - --name <Name> descriptive migration name
21
+ - --preview-sql inspect generated SQL before applying
22
+
23
+ Run against a .NET repository. Perform solution discovery first, then apply the workflow.
@@ -0,0 +1,24 @@
1
+ ---
2
+ description: Generate ASP.NET Core Minimal API or Controller endpoints from an entity/model with validation.
3
+ ---
4
+
5
+ # /dotnet-endpoint-from-model
6
+
7
+ Generate robust CRUD endpoints from a domain model or entity.
8
+
9
+ ## Workflow
10
+ 1. Inspect entity/model properties, keys, and navigation properties.
11
+ 2. Generate Request/Response DTOs to avoid overposting or leaking domain entities.
12
+ 3. Generate endpoint handlers using TypedResults (Ok, Created, NotFound, ValidationProblem).
13
+ 4. Configure authorization, route groups, and OpenAPI metadata (.WithName(), .Produces()).
14
+ 5. Verify endpoint route constraints.
15
+
16
+ ## Guardrail
17
+ Never expose raw database entities directly to API responses. Always map through DTOs.
18
+
19
+ ## Options
20
+ - --minimal use ASP.NET Core Minimal APIs (default)
21
+ - --controller use Controller-based architecture
22
+ - --dto <Type> use existing DTO type
23
+
24
+ Run against a .NET repository. Perform solution discovery first, then apply the workflow.
@@ -0,0 +1,23 @@
1
+ ---
2
+ description: Refactor fat services or bloated controllers into isolated CQRS handlers or domain services.
3
+ ---
4
+
5
+ # /dotnet-extract-service
6
+
7
+ Decompose fat classes into single-responsibility handlers or domain services.
8
+
9
+ ## Workflow
10
+ 1. Identify oversized methods or multi-responsibility service classes.
11
+ 2. Extract target method into an independent Command/Query handler or domain service.
12
+ 3. Define required interfaces and register with Microsoft.Extensions.DependencyInjection.
13
+ 4. Update caller references and ensure backward compatibility.
14
+ 5. Create unit tests for extracted handler.
15
+
16
+ ## Guardrail
17
+ Preserve existing behavior and contract signatures. Do not introduce breaking API changes.
18
+
19
+ ## Options
20
+ - --class <Name> source class to refactor
21
+ - --method <Name> specific method to extract
22
+
23
+ Run against a .NET repository. Perform solution discovery first, then apply the workflow.
@@ -0,0 +1,24 @@
1
+ ---
2
+ description: Build an end-to-end vertical slice feature (Command/Query, MediatR, FluentValidation, Endpoint).
3
+ ---
4
+
5
+ # /dotnet-feature
6
+
7
+ Generate a complete, self-contained feature slice following Vertical Slice Architecture.
8
+
9
+ ## Workflow
10
+ 1. Determine feature name, operation type (Command or Query), and target domain.
11
+ 2. Generate Request and Response DTO records with immutable properties.
12
+ 3. Generate FluentValidation validator with standard validation rules.
13
+ 4. Generate MediatR / Wolverine handler with DbContext or repository access.
14
+ 5. Expose via Minimal API endpoint or Controller with TypedResults.
15
+ 6. Scaffold unit tests and integration tests.
16
+
17
+ ## Guardrail
18
+ Adhere to existing solution conventions (Vertical Slices vs Clean Architecture). Do not introduce unnecessary abstractions.
19
+
20
+ ## Options
21
+ - --type <command|query> operation type
22
+ - --model <Entity> domain entity to base feature on
23
+
24
+ Run against a .NET repository. Perform solution discovery first, then apply the workflow.
@@ -0,0 +1,23 @@
1
+ ---
2
+ description: Generate xUnit/NUnit tests with FluentAssertions and WebApplicationFactory integration tests.
3
+ ---
4
+
5
+ # /dotnet-generate-tests
6
+
7
+ Generate comprehensive unit and integration tests for .NET handlers, services, and endpoints.
8
+
9
+ ## Workflow
10
+ 1. Inspect target class (Handler, Validator, Service, or Endpoint).
11
+ 2. Generate unit tests covering valid input, boundary conditions, and error cases.
12
+ 3. Use Moq or NSubstitute for dependencies and FluentAssertions for assertions.
13
+ 4. For endpoints, generate WebApplicationFactory integration tests verifying status codes and payloads.
14
+ 5. Run tests with dotnet test.
15
+
16
+ ## Guardrail
17
+ Mock only external boundaries (I/O, database, third-party APIs); test real business domain logic.
18
+
19
+ ## Options
20
+ - --framework <xunit|nunit> test framework (default: xunit)
21
+ - --integration generate WebApplicationFactory integration tests
22
+
23
+ Run against a .NET repository. Perform solution discovery first, then apply the workflow.
@@ -0,0 +1,22 @@
1
+ ---
2
+ description: Audit .NET solution health: SDK versions, NuGet packages, vulnerabilities, and compiler warnings.
3
+ ---
4
+
5
+ # /dotnet-health
6
+
7
+ Comprehensive health check for .NET solutions and projects.
8
+
9
+ ## Workflow
10
+ 1. Locate .sln and .csproj files, target frameworks (e.g. net8.0, net9.0), and SDK versions.
11
+ 2. Check for vulnerable and outdated NuGet packages (dotnet list package --vulnerable).
12
+ 3. Audit nullable reference types (<Nullable>enable</Nullable>) and compiler warning configurations.
13
+ 4. Output structured markdown diagnostic report with prioritized security and health recommendations.
14
+
15
+ ## Guardrail
16
+ Read-only diagnostic audit. Never modify project files during health check.
17
+
18
+ ## Options
19
+ - --json output machine-readable JSON metrics
20
+ - --project <path> restrict audit to a specific project
21
+
22
+ Run against a .NET repository. Perform solution discovery first, then apply the workflow.
@@ -0,0 +1,23 @@
1
+ ---
2
+ description: Migrate ASP.NET Core controllers to modern Minimal APIs with RouteGroups and typed results.
3
+ ---
4
+
5
+ # /dotnet-migrate-minimal-api
6
+
7
+ Refactor traditional controllers to modern, high-performance Minimal API route groups.
8
+
9
+ ## Workflow
10
+ 1. Inspect controller routes, actions, authorization attributes, and filter pipeline.
11
+ 2. Create endpoint extension class (MapXxxEndpoints()) using MapGroup().
12
+ 3. Convert ActionResult<T> to TypedResults with explicit return types.
13
+ 4. Replace controller DI with endpoint parameter injection ([FromServices], [FromBody]).
14
+ 5. Verify route parity and run integration tests.
15
+
16
+ ## Guardrail
17
+ Preserve exact route paths, query parameter names, and HTTP status code behaviors.
18
+
19
+ ## Options
20
+ - --controller <Name> name of the controller to migrate
21
+ - --dry-run preview changes without modifying files
22
+
23
+ Run against a .NET repository. Perform solution discovery first, then apply the workflow.
@@ -0,0 +1,23 @@
1
+ ---
2
+ description: Upgrade legacy C# code to modern C# 12+ / .NET 8+ patterns (primary constructors, pattern matching).
3
+ ---
4
+
5
+ # /dotnet-modernize
6
+
7
+ Modernize legacy C# syntax using modern C# language features.
8
+
9
+ ## Workflow
10
+ 1. Convert block-scoped namespaces to file-scoped namespaces (namespace X;).
11
+ 2. Convert classes/records with boilerplate constructors to primary constructors where appropriate.
12
+ 3. Adopt collection expressions ([] instead of new List<T>(), Array.Empty<T>()).
13
+ 4. Use pattern matching (is not null, switch expressions, property patterns).
14
+ 5. Build solution and run test suite to verify zero semantic changes.
15
+
16
+ ## Guardrail
17
+ Only apply safe, semantic-preserving modernizations. Never compromise readability for conciseness.
18
+
19
+ ## Options
20
+ - --project <path> target specific project
21
+ - --dry-run preview modernization diffs
22
+
23
+ Run against a .NET repository. Perform solution discovery first, then apply the workflow.
@@ -0,0 +1,26 @@
1
+ ---
2
+ name: dotnet-architecture-audit
3
+ description: Audit layer dependencies (Clean Architecture / Vertical Slices / DDD) and circular dependencies.
4
+ ---
5
+
6
+ # /dotnet-architecture-audit
7
+
8
+ Analyze architectural layer boundaries and project references across the .NET solution.
9
+
10
+ ## Workflow
11
+ 1. Parse project references between .csproj files.
12
+ 2. Verify Domain layer has zero external project dependencies.
13
+ 3. Verify Application layer depends only on Domain.
14
+ 4. Detect illegal Infrastructure/API leaks into core layers or circular dependencies.
15
+ 5. Generate dependency graph and compliance matrix.
16
+
17
+ ## Guardrail
18
+ Read-only architectural analysis.
19
+
20
+ ## Options
21
+ - --strict fail on any layer boundary violation
22
+ - --json output dependency graph as JSON
23
+
24
+ # dotnet-architecture-audit
25
+
26
+ Execute the workflow with the target arguments from the request.
@@ -0,0 +1,25 @@
1
+ ---
2
+ name: dotnet-clean-guardrails
3
+ description: Generate NetArchTest architectural unit tests and EditorConfig rules to guard layer boundaries.
4
+ ---
5
+
6
+ # /dotnet-clean-guardrails
7
+
8
+ Enforce clean architecture layer boundaries with automated architectural unit tests and EditorConfig.
9
+
10
+ ## Workflow
11
+ 1. Detect solution architecture layers (Domain, Application, Infrastructure, API).
12
+ 2. Generate NetArchTest tests asserting layer boundaries (e.g. Domain should not reference Infrastructure).
13
+ 3. Generate or update .editorconfig with C# formatting, naming rules, and diagnostic severities.
14
+ 4. Run architectural tests to verify current compliance.
15
+
16
+ ## Guardrail
17
+ Do not break legacy builds; apply warnings first or scope enforcement gradually.
18
+
19
+ ## Options
20
+ - --netarchtest generate NetArchTest test project
21
+ - --editorconfig generate .editorconfig rules
22
+
23
+ # dotnet-clean-guardrails
24
+
25
+ Execute the workflow with the target arguments from the request.