plankit-cli 1.3.0 → 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 +229 -34
  2. package/package.json +1 -1
  3. package/src/agents.js +8 -4
  4. package/src/cli.js +126 -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
@@ -4,6 +4,24 @@ import fs from 'node:fs';
4
4
 
5
5
  const packageRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
6
6
 
7
+ export const SUPPORTED_FRAMEWORKS = ['angular', 'vue', 'dotnet'];
8
+
9
+ export const FRAMEWORK_ALIASES = {
10
+ ng: 'angular',
11
+ angular: 'angular',
12
+ vue: 'vue',
13
+ vuejs: 'vue',
14
+ dotnet: 'dotnet',
15
+ net: 'dotnet',
16
+ '.net': 'dotnet'
17
+ };
18
+
19
+ export const FRAMEWORK_DESCRIPTIONS = {
20
+ angular: 'Angular command suite',
21
+ vue: 'Vue modernization & architecture suite',
22
+ dotnet: '.NET clean architecture & API suite'
23
+ };
24
+
7
25
  export const COMMAND_BUNDLES = {
8
26
  'opencode-angular': {
9
27
  label: 'Angular command suite',
@@ -28,13 +46,100 @@ export const COMMAND_BUNDLES = {
28
46
  src: path.join('angular-commands', 'cursor'),
29
47
  dest: ['.cursor', 'rules'],
30
48
  kind: 'folder'
49
+ },
50
+ 'opencode-vue': {
51
+ label: 'Vue command suite',
52
+ src: path.join('vue-commands', 'opencode'),
53
+ dest: ['.opencode', 'commands'],
54
+ kind: 'folder'
55
+ },
56
+ 'gemini-vue': {
57
+ label: 'Vue skill suite',
58
+ src: path.join('vue-skills', 'gemini'),
59
+ dest: ['.gemini', 'skills'],
60
+ kind: 'folder'
61
+ },
62
+ 'codex-vue': {
63
+ label: 'Vue command suite',
64
+ src: path.join('vue-commands', 'codex'),
65
+ dest: ['.codex'],
66
+ kind: 'folder'
67
+ },
68
+ 'cursor-vue': {
69
+ label: 'Vue command suite',
70
+ src: path.join('vue-commands', 'cursor'),
71
+ dest: ['.cursor', 'rules'],
72
+ kind: 'folder'
73
+ },
74
+ 'opencode-dotnet': {
75
+ label: '.NET command suite',
76
+ src: path.join('dotnet-commands', 'opencode'),
77
+ dest: ['.opencode', 'commands'],
78
+ kind: 'folder'
79
+ },
80
+ 'gemini-dotnet': {
81
+ label: '.NET skill suite',
82
+ src: path.join('dotnet-skills', 'gemini'),
83
+ dest: ['.gemini', 'skills'],
84
+ kind: 'folder'
85
+ },
86
+ 'codex-dotnet': {
87
+ label: '.NET command suite',
88
+ src: path.join('dotnet-commands', 'codex'),
89
+ dest: ['.codex'],
90
+ kind: 'folder'
91
+ },
92
+ 'cursor-dotnet': {
93
+ label: '.NET command suite',
94
+ src: path.join('dotnet-commands', 'cursor'),
95
+ dest: ['.cursor', 'rules'],
96
+ kind: 'folder'
31
97
  }
32
98
  };
33
99
 
100
+ export function normalizeFramework(input) {
101
+ if (!input) return null;
102
+ const cleaned = String(input).trim().toLowerCase();
103
+ if (cleaned === 'none') return null;
104
+ if (cleaned === 'all') return [...SUPPORTED_FRAMEWORKS];
105
+ return FRAMEWORK_ALIASES[cleaned] || null;
106
+ }
107
+
108
+ export function parseFrameworksInput(input) {
109
+ if (!input) return [];
110
+ if (Array.isArray(input)) {
111
+ return input.flatMap((item) => parseFrameworksInput(item));
112
+ }
113
+ const parts = String(input)
114
+ .split(',')
115
+ .map((item) => item.trim())
116
+ .filter(Boolean);
117
+
118
+ const frameworks = new Set();
119
+ for (const part of parts) {
120
+ const normalized = normalizeFramework(part);
121
+ if (Array.isArray(normalized)) {
122
+ normalized.forEach((fw) => frameworks.add(fw));
123
+ } else if (normalized) {
124
+ frameworks.add(normalized);
125
+ } else if (part.toLowerCase() === 'none') {
126
+ // explicit none
127
+ continue;
128
+ } else {
129
+ throw new Error(`Unknown framework "${part}". Valid frameworks: ${SUPPORTED_FRAMEWORKS.join(', ')}, none, all.`);
130
+ }
131
+ }
132
+ return Array.from(frameworks);
133
+ }
134
+
34
135
  export function bundleEntry(bundleName) {
35
136
  return COMMAND_BUNDLES[bundleName] || null;
36
137
  }
37
138
 
139
+ export function bundleNameFor(agentId, framework) {
140
+ return `${agentId}-${framework}`;
141
+ }
142
+
38
143
  export function bundleSourceExists(bundleName, cwd, config) {
39
144
  const entry = COMMAND_BUNDLES[bundleName];
40
145
  if (!entry) {
package/src/config.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import fs from 'node:fs';
2
2
  import path from 'node:path';
3
3
  import { AGENT_ORDER, DEFAULT_AGENT, getAgent } from './agents.js';
4
+ import { parseFrameworksInput } from './commandBundles.js';
4
5
 
5
6
  export const DEFAULT_CONFIG = {
6
7
  artifactsDir: 'artifacts',
@@ -8,6 +9,7 @@ export const DEFAULT_CONFIG = {
8
9
  agents: {
9
10
  default: DEFAULT_AGENT
10
11
  },
12
+ frameworks: [],
11
13
  defaultPhases: [
12
14
  {
13
15
  title: 'Foundation & Setup',
@@ -57,9 +59,13 @@ export function loadConfig(cwd = process.cwd()) {
57
59
  };
58
60
  }
59
61
 
60
- export function createDefaultConfigFile(cwd, options = {}) {
62
+ export function createDefaultConfigFile(cwd, options = {}, frameworks = []) {
61
63
  const filePath = path.join(cwd, 'plankit.config.json');
62
- const content = `${JSON.stringify(DEFAULT_CONFIG, null, 2)}\n`;
64
+ const baseConfig = structuredClone(DEFAULT_CONFIG);
65
+ if (Array.isArray(frameworks) && frameworks.length > 0) {
66
+ baseConfig.frameworks = frameworks;
67
+ }
68
+ const content = `${JSON.stringify(baseConfig, null, 2)}\n`;
63
69
  return writeManagedFile(filePath, content, options);
64
70
  }
65
71
 
@@ -69,10 +75,22 @@ export function normalizeConfig(config) {
69
75
  normalized.artifactsDir = normalized.artifactsDir || DEFAULT_CONFIG.artifactsDir;
70
76
  normalized.overwrite = normalized.overwrite || DEFAULT_CONFIG.overwrite;
71
77
  normalized.agents = normalizeAgents(normalized.agents);
78
+ normalized.frameworks = normalizeFrameworksConfig(normalized.frameworks);
72
79
  normalized.verification = { ...DEFAULT_CONFIG.verification, ...(normalized.verification || {}) };
73
80
  return normalized;
74
81
  }
75
82
 
83
+ export function normalizeFrameworksConfig(frameworks) {
84
+ if (!frameworks) return [];
85
+ if (Array.isArray(frameworks)) {
86
+ return parseFrameworksInput(frameworks);
87
+ }
88
+ if (typeof frameworks === 'string') {
89
+ return parseFrameworksInput(frameworks);
90
+ }
91
+ return [];
92
+ }
93
+
76
94
  export function normalizeAgents(agents) {
77
95
  if (!agents || typeof agents !== 'object') {
78
96
  return { ...DEFAULT_CONFIG.agents };
@@ -35,6 +35,13 @@ Prepares the phase output artifact after validating that the phase spec and prio
35
35
 
36
36
  Runs configured verification commands and archives the completed feature.
37
37
 
38
+ ## Framework Suites
39
+
40
+ PlanKit supports modular framework engineering command suites selectable during `plankit init` via prompt or `--framework <angular|vue|dotnet|none|all>`:
41
+ - **Angular**: Deterministic Angular workflows (`component-from`, `feature`, `signalize`, `modernize`, etc.)
42
+ - **Vue**: Legacy modernization and standardization workflows (`vue-health`, `vue-pattern-map`, `vue-standardize`, `vue-modernize-slice`, etc.)
43
+ - **.NET**: Clean Architecture & Minimal API workflows (`dotnet-health`, `dotnet-architecture-audit`, `dotnet-feature`, `dotnet-modernize`, etc.)
44
+
38
45
  ## Customization
39
46
 
40
47
  Configure PlanKit with `plankit.config.json`. Override generated templates by setting `templatesDir` and matching the package template file names.
@@ -0,0 +1,25 @@
1
+ # dotnet-architecture-audit
2
+ > Audit layer dependencies (Clean Architecture / Vertical Slices / DDD) and circular dependencies.
3
+
4
+ # /dotnet-architecture-audit
5
+
6
+ Analyze architectural layer boundaries and project references across the .NET solution.
7
+
8
+ ## Workflow
9
+ 1. Parse project references between .csproj files.
10
+ 2. Verify Domain layer has zero external project dependencies.
11
+ 3. Verify Application layer depends only on Domain.
12
+ 4. Detect illegal Infrastructure/API leaks into core layers or circular dependencies.
13
+ 5. Generate dependency graph and compliance matrix.
14
+
15
+ ## Guardrail
16
+ Read-only architectural analysis.
17
+
18
+ ## Options
19
+ - --strict fail on any layer boundary violation
20
+ - --json output dependency graph as JSON
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,24 @@
1
+ # dotnet-clean-guardrails
2
+ > Generate NetArchTest architectural unit tests and EditorConfig rules to guard layer boundaries.
3
+
4
+ # /dotnet-clean-guardrails
5
+
6
+ Enforce clean architecture layer boundaries with automated architectural unit tests and EditorConfig.
7
+
8
+ ## Workflow
9
+ 1. Detect solution architecture layers (Domain, Application, Infrastructure, API).
10
+ 2. Generate NetArchTest tests asserting layer boundaries (e.g. Domain should not reference Infrastructure).
11
+ 3. Generate or update .editorconfig with C# formatting, naming rules, and diagnostic severities.
12
+ 4. Run architectural tests to verify current compliance.
13
+
14
+ ## Guardrail
15
+ Do not break legacy builds; apply warnings first or scope enforcement gradually.
16
+
17
+ ## Options
18
+ - --netarchtest generate NetArchTest test project
19
+ - --editorconfig generate .editorconfig rules
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-ef-migration
2
+ > Safe Entity Framework Core migration workflow with entity audit, SQL review, and rollback.
3
+
4
+ # /dotnet-ef-migration
5
+
6
+ Plan, generate, and review safe Entity Framework Core database migrations.
7
+
8
+ ## Workflow
9
+ 1. Audit entity configurations (Fluent API vs DataAnnotations) in target DbContext.
10
+ 2. Check for missing indexes, foreign key cascading issues, and property lengths.
11
+ 3. Generate migration with a descriptive name (dotnet ef migrations add <Name>).
12
+ 4. Generate and inspect raw migration SQL script (dotnet ef migrations script).
13
+ 5. Check for destructive schema changes (table drops, column drops, data loss warnings).
14
+
15
+ ## Guardrail
16
+ Never execute irreversible or destructive migrations without explicit user confirmation.
17
+
18
+ ## Options
19
+ - --name <Name> descriptive migration name
20
+ - --preview-sql inspect generated SQL before applying
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
+ # dotnet-endpoint-from-model
2
+ > Generate ASP.NET Core Minimal API or Controller endpoints from an entity/model with validation.
3
+
4
+ # /dotnet-endpoint-from-model
5
+
6
+ Generate robust CRUD endpoints from a domain model or entity.
7
+
8
+ ## Workflow
9
+ 1. Inspect entity/model properties, keys, and navigation properties.
10
+ 2. Generate Request/Response DTOs to avoid overposting or leaking domain entities.
11
+ 3. Generate endpoint handlers using TypedResults (Ok, Created, NotFound, ValidationProblem).
12
+ 4. Configure authorization, route groups, and OpenAPI metadata (.WithName(), .Produces()).
13
+ 5. Verify endpoint route constraints.
14
+
15
+ ## Guardrail
16
+ Never expose raw database entities directly to API responses. Always map through DTOs.
17
+
18
+ ## Options
19
+ - --minimal use ASP.NET Core Minimal APIs (default)
20
+ - --controller use Controller-based architecture
21
+ - --dto <Type> use existing DTO type
22
+
23
+ ## Execution
24
+ 1. Run .NET solution discovery against the repository.
25
+ 2. Apply the workflow above with the provided target.
26
+ 3. Report files created/modified and patterns applied.
@@ -0,0 +1,25 @@
1
+ # dotnet-extract-service
2
+ > Refactor fat services or bloated controllers into isolated CQRS handlers or domain services.
3
+
4
+ # /dotnet-extract-service
5
+
6
+ Decompose fat classes into single-responsibility handlers or domain services.
7
+
8
+ ## Workflow
9
+ 1. Identify oversized methods or multi-responsibility service classes.
10
+ 2. Extract target method into an independent Command/Query handler or domain service.
11
+ 3. Define required interfaces and register with Microsoft.Extensions.DependencyInjection.
12
+ 4. Update caller references and ensure backward compatibility.
13
+ 5. Create unit tests for extracted handler.
14
+
15
+ ## Guardrail
16
+ Preserve existing behavior and contract signatures. Do not introduce breaking API changes.
17
+
18
+ ## Options
19
+ - --class <Name> source class to refactor
20
+ - --method <Name> specific method to extract
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
+ # dotnet-feature
2
+ > Build an end-to-end vertical slice feature (Command/Query, MediatR, FluentValidation, Endpoint).
3
+
4
+ # /dotnet-feature
5
+
6
+ Generate a complete, self-contained feature slice following Vertical Slice Architecture.
7
+
8
+ ## Workflow
9
+ 1. Determine feature name, operation type (Command or Query), and target domain.
10
+ 2. Generate Request and Response DTO records with immutable properties.
11
+ 3. Generate FluentValidation validator with standard validation rules.
12
+ 4. Generate MediatR / Wolverine handler with DbContext or repository access.
13
+ 5. Expose via Minimal API endpoint or Controller with TypedResults.
14
+ 6. Scaffold unit tests and integration tests.
15
+
16
+ ## Guardrail
17
+ Adhere to existing solution conventions (Vertical Slices vs Clean Architecture). Do not introduce unnecessary abstractions.
18
+
19
+ ## Options
20
+ - --type <command|query> operation type
21
+ - --model <Entity> domain entity to base feature on
22
+
23
+ ## Execution
24
+ 1. Run .NET solution discovery against the repository.
25
+ 2. Apply the workflow above with the provided target.
26
+ 3. Report files created/modified and patterns applied.
@@ -0,0 +1,25 @@
1
+ # dotnet-generate-tests
2
+ > Generate xUnit/NUnit tests with FluentAssertions and WebApplicationFactory integration tests.
3
+
4
+ # /dotnet-generate-tests
5
+
6
+ Generate comprehensive unit and integration tests for .NET handlers, services, and endpoints.
7
+
8
+ ## Workflow
9
+ 1. Inspect target class (Handler, Validator, Service, or Endpoint).
10
+ 2. Generate unit tests covering valid input, boundary conditions, and error cases.
11
+ 3. Use Moq or NSubstitute for dependencies and FluentAssertions for assertions.
12
+ 4. For endpoints, generate WebApplicationFactory integration tests verifying status codes and payloads.
13
+ 5. Run tests with dotnet test.
14
+
15
+ ## Guardrail
16
+ Mock only external boundaries (I/O, database, third-party APIs); test real business domain logic.
17
+
18
+ ## Options
19
+ - --framework <xunit|nunit> test framework (default: xunit)
20
+ - --integration generate WebApplicationFactory integration tests
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,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.