@cratis/pi 7.101.0 → 7.103.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 (168) hide show
  1. package/package/corpus/harnesses/copilot/instructions/github-actions.instructions.md +17 -0
  2. package/package/corpus/harnesses/copilot/instructions/profiles.instructions.md +10 -1
  3. package/package/corpus/harnesses/copilot/instructions/pull-requests.instructions.md +2 -0
  4. package/package/corpus/harnesses/copilot/instructions/secrets.instructions.md +4 -0
  5. package/package/corpus/hooks/README.md +11 -1
  6. package/package/corpus/hooks/scripts/cratis-check-pr.mjs +12 -1
  7. package/package/corpus/hooks/scripts/cratis-guard-secrets.sh +79 -23
  8. package/package/corpus/hooks/scripts/cratis-guard-writes.sh +145 -40
  9. package/package/corpus/rules/github-actions.md +17 -0
  10. package/package/corpus/rules/profiles.md +10 -1
  11. package/package/corpus/rules/pull-requests.md +2 -0
  12. package/package/corpus/rules/secrets.md +4 -0
  13. package/package/corpus/skills/analyzing-dotnet-performance/LICENSE +23 -0
  14. package/package/corpus/skills/analyzing-dotnet-performance/NOTICE +36 -0
  15. package/package/corpus/skills/analyzing-dotnet-performance/SKILL.md +214 -0
  16. package/package/corpus/skills/analyzing-dotnet-performance/references/async-patterns.md +122 -0
  17. package/package/corpus/skills/analyzing-dotnet-performance/references/collections-and-linq.md +220 -0
  18. package/package/corpus/skills/analyzing-dotnet-performance/references/critical-patterns.md +291 -0
  19. package/package/corpus/skills/analyzing-dotnet-performance/references/io-and-serialization.md +135 -0
  20. package/package/corpus/skills/analyzing-dotnet-performance/references/memory-and-strings.md +219 -0
  21. package/package/corpus/skills/analyzing-dotnet-performance/references/regex-patterns.md +95 -0
  22. package/package/corpus/skills/analyzing-dotnet-performance/references/structural-patterns.md +38 -0
  23. package/package/corpus/skills/binlog-generation/LICENSE +23 -0
  24. package/package/corpus/skills/binlog-generation/NOTICE +22 -0
  25. package/package/corpus/skills/binlog-generation/SKILL.md +129 -0
  26. package/package/corpus/skills/check-bin-obj-clash/LICENSE +23 -0
  27. package/package/corpus/skills/check-bin-obj-clash/NOTICE +27 -0
  28. package/package/corpus/skills/check-bin-obj-clash/SKILL.md +127 -0
  29. package/package/corpus/skills/check-bin-obj-clash/references/common-causes-and-fixes.md +206 -0
  30. package/package/corpus/skills/coverage-analysis/LICENSE +23 -0
  31. package/package/corpus/skills/coverage-analysis/NOTICE +32 -0
  32. package/package/corpus/skills/coverage-analysis/SKILL.md +198 -0
  33. package/package/corpus/skills/coverage-analysis/references/guidelines.md +68 -0
  34. package/package/corpus/skills/coverage-analysis/references/output-format.md +91 -0
  35. package/package/corpus/skills/coverage-analysis/references/report-generation.md +58 -0
  36. package/package/corpus/skills/coverage-analysis/references/setup-discovery.md +307 -0
  37. package/package/corpus/skills/coverage-analysis/scripts/Compute-CrapScores.ps1 +80 -0
  38. package/package/corpus/skills/coverage-analysis/scripts/CoverageData.ps1 +272 -0
  39. package/package/corpus/skills/coverage-analysis/scripts/Extract-MethodCoverage.ps1 +65 -0
  40. package/package/corpus/skills/cratis-ci-pipeline-performance/LICENSE +2 -0
  41. package/package/corpus/skills/cratis-ci-pipeline-performance/SKILL.md +201 -0
  42. package/package/corpus/skills/cratis-ci-pipeline-performance/references/build-once-and-shard.md +158 -0
  43. package/package/corpus/skills/cratis-ci-pipeline-performance/references/caching.md +86 -0
  44. package/package/corpus/skills/cratis-ci-pipeline-performance/references/flaky-and-hung-jobs.md +70 -0
  45. package/package/corpus/skills/cratis-ci-pipeline-performance/references/publish-pipelines.md +67 -0
  46. package/package/corpus/skills/cratis-ci-pipeline-performance/references/required-checks-and-path-filters.md +117 -0
  47. package/package/corpus/skills/cratis-ci-pipeline-performance/references/runner-sizing-and-images.md +65 -0
  48. package/package/corpus/skills/cratis-ci-pipeline-performance/references/security-and-pinning.md +73 -0
  49. package/package/corpus/skills/cratis-ci-pipeline-performance/references/sources.md +33 -0
  50. package/package/corpus/skills/cratis-ci-pipeline-performance/references/test-setup-cost.md +82 -0
  51. package/package/corpus/skills/cratis-ci-pipeline-performance/scripts/ci-timings.sh +356 -0
  52. package/package/corpus/skills/cratis-ci-pipeline-performance/scripts/fixtures/jobs/1003.json +79 -0
  53. package/package/corpus/skills/cratis-ci-pipeline-performance/scripts/fixtures/jobs/1007.json +79 -0
  54. package/package/corpus/skills/cratis-ci-pipeline-performance/scripts/fixtures/jobs/1010.json +79 -0
  55. package/package/corpus/skills/cratis-ci-pipeline-performance/scripts/fixtures/runs.json +102 -0
  56. package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/LICENSE +2 -0
  57. package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/SKILL.md +244 -0
  58. package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/references/docker-images.md +86 -0
  59. package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/references/dotnet-nuget.md +87 -0
  60. package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/references/go-jvm-python-elixir.md +83 -0
  61. package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/references/npm-yarn.md +78 -0
  62. package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/references/other-environments.md +60 -0
  63. package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/references/worked-examples.md +97 -0
  64. package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/scripts/cratis-local-packages.sh +778 -0
  65. package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/scripts/npm-restore-check.cjs +109 -0
  66. package/package/corpus/skills/csharp-refactoring/LICENSE +23 -0
  67. package/package/corpus/skills/csharp-refactoring/NOTICE +22 -0
  68. package/package/corpus/skills/csharp-refactoring/SKILL.md +175 -0
  69. package/package/corpus/skills/csharp-refactoring/references/operation-catalog.md +37 -0
  70. package/package/corpus/skills/directory-build-organization/LICENSE +23 -0
  71. package/package/corpus/skills/directory-build-organization/NOTICE +21 -0
  72. package/package/corpus/skills/directory-build-organization/SKILL.md +205 -0
  73. package/package/corpus/skills/directory-build-organization/references/common-patterns.md +56 -0
  74. package/package/corpus/skills/directory-build-organization/references/multi-level-examples.md +167 -0
  75. package/package/corpus/skills/directory-build-organization/references/targetframework-props-pitfall.md +54 -0
  76. package/package/corpus/skills/dotnet-aot-compat/LICENSE +23 -0
  77. package/package/corpus/skills/dotnet-aot-compat/NOTICE +18 -0
  78. package/package/corpus/skills/dotnet-aot-compat/SKILL.md +265 -0
  79. package/package/corpus/skills/dotnet-aot-compat/references/polyfills.md +43 -0
  80. package/package/corpus/skills/dotnet-trace-collect/LICENSE +23 -0
  81. package/package/corpus/skills/dotnet-trace-collect/NOTICE +65 -0
  82. package/package/corpus/skills/dotnet-trace-collect/SKILL.md +116 -0
  83. package/package/corpus/skills/dotnet-trace-collect/references/dotnet-monitor.md +97 -0
  84. package/package/corpus/skills/dotnet-trace-collect/references/dotnet-trace-collect-linux.md +84 -0
  85. package/package/corpus/skills/dotnet-trace-collect/references/dotnet-trace-collect.md +91 -0
  86. package/package/corpus/skills/dotnet-trace-collect/references/perfcollect.md +200 -0
  87. package/package/corpus/skills/dotnet-trace-collect/references/perfview.md +141 -0
  88. package/package/corpus/skills/dotnet-trace-collect/references/tool-selection.md +160 -0
  89. package/package/corpus/skills/dump-collect/LICENSE +23 -0
  90. package/package/corpus/skills/dump-collect/NOTICE +40 -0
  91. package/package/corpus/skills/dump-collect/SKILL.md +97 -0
  92. package/package/corpus/skills/dump-collect/references/container-dumps.md +412 -0
  93. package/package/corpus/skills/dump-collect/references/coreclr-dumps.md +108 -0
  94. package/package/corpus/skills/dump-collect/references/nativeaot-dumps.md +280 -0
  95. package/package/corpus/skills/eliminate-redundant-restores/LICENSE +23 -0
  96. package/package/corpus/skills/eliminate-redundant-restores/NOTICE +19 -0
  97. package/package/corpus/skills/eliminate-redundant-restores/SKILL.md +112 -0
  98. package/package/corpus/skills/extension-points/LICENSE +23 -0
  99. package/package/corpus/skills/extension-points/NOTICE +18 -0
  100. package/package/corpus/skills/extension-points/SKILL.md +248 -0
  101. package/package/corpus/skills/filter-syntax/LICENSE +23 -0
  102. package/package/corpus/skills/filter-syntax/NOTICE +17 -0
  103. package/package/corpus/skills/filter-syntax/SKILL.md +179 -0
  104. package/package/corpus/skills/including-generated-files/LICENSE +23 -0
  105. package/package/corpus/skills/including-generated-files/NOTICE +17 -0
  106. package/package/corpus/skills/including-generated-files/SKILL.md +139 -0
  107. package/package/corpus/skills/microbenchmarking/LICENSE +23 -0
  108. package/package/corpus/skills/microbenchmarking/NOTICE +36 -0
  109. package/package/corpus/skills/microbenchmarking/SKILL.md +131 -0
  110. package/package/corpus/skills/microbenchmarking/references/bdn-internals-and-tuning.md +143 -0
  111. package/package/corpus/skills/microbenchmarking/references/comparison-strategies.md +200 -0
  112. package/package/corpus/skills/microbenchmarking/references/diagnosers-and-exporters.md +150 -0
  113. package/package/corpus/skills/microbenchmarking/references/project-setup-and-running.md +189 -0
  114. package/package/corpus/skills/microbenchmarking/references/writing-benchmarks.md +310 -0
  115. package/package/corpus/skills/msbuild/LICENSE +23 -0
  116. package/package/corpus/skills/msbuild/NOTICE +55 -0
  117. package/package/corpus/skills/msbuild/SKILL.md +117 -0
  118. package/package/corpus/skills/msbuild/references/antipatterns/additional-antipatterns.md +291 -0
  119. package/package/corpus/skills/msbuild/references/antipatterns/incremental-build-inputs-outputs.md +57 -0
  120. package/package/corpus/skills/msbuild/references/antipatterns/private-assets.md +29 -0
  121. package/package/corpus/skills/msbuild/references/binlog-failure-analysis.md +85 -0
  122. package/package/corpus/skills/msbuild/references/binlog-generation.md +69 -0
  123. package/package/corpus/skills/msbuild/references/build-perf-baseline.md +493 -0
  124. package/package/corpus/skills/msbuild/references/build-perf-diagnostics.md +268 -0
  125. package/package/corpus/skills/msbuild/references/copy-to-output-directory.md +183 -0
  126. package/package/corpus/skills/msbuild/references/eval-performance.md +190 -0
  127. package/package/corpus/skills/msbuild/references/extension-points.md +281 -0
  128. package/package/corpus/skills/msbuild/references/incremental-build.md +365 -0
  129. package/package/corpus/skills/msbuild/references/msbuild-antipatterns.md +401 -0
  130. package/package/corpus/skills/orleans/LICENSE +21 -0
  131. package/package/corpus/skills/orleans/NOTICE +64 -0
  132. package/package/corpus/skills/orleans/SKILL.md +140 -0
  133. package/package/corpus/skills/orleans/references/anti-patterns.md +660 -0
  134. package/package/corpus/skills/orleans/references/configuration-api.md +933 -0
  135. package/package/corpus/skills/orleans/references/examples.md +66 -0
  136. package/package/corpus/skills/orleans/references/grain-api.md +784 -0
  137. package/package/corpus/skills/orleans/references/grains.md +75 -0
  138. package/package/corpus/skills/orleans/references/hosting.md +71 -0
  139. package/package/corpus/skills/orleans/references/implementation.md +591 -0
  140. package/package/corpus/skills/orleans/references/official-docs-index.md +250 -0
  141. package/package/corpus/skills/orleans/references/patterns.md +811 -0
  142. package/package/corpus/skills/orleans/references/persistence-api.md +495 -0
  143. package/package/corpus/skills/orleans/references/primitive-selection.md +35 -0
  144. package/package/corpus/skills/orleans/references/scheduling-and-services.md +295 -0
  145. package/package/corpus/skills/orleans/references/serialization-api.md +299 -0
  146. package/package/corpus/skills/orleans/references/streaming-api.md +396 -0
  147. package/package/corpus/skills/orleans/references/testing-patterns.md +210 -0
  148. package/package/corpus/skills/platform-detection/LICENSE +23 -0
  149. package/package/corpus/skills/platform-detection/NOTICE +17 -0
  150. package/package/corpus/skills/platform-detection/SKILL.md +230 -0
  151. package/package/corpus/skills/platform-detection/references/command-mode.md +27 -0
  152. package/package/corpus/skills/profiling/LICENSE +21 -0
  153. package/package/corpus/skills/profiling/NOTICE +50 -0
  154. package/package/corpus/skills/profiling/SKILL.md +144 -0
  155. package/package/corpus/skills/profiling/references/commands.md +439 -0
  156. package/package/corpus/skills/profiling/references/patterns.md +586 -0
  157. package/package/corpus/skills/profiling/references/profiling.md +190 -0
  158. package/package/corpus/skills/run-tests/LICENSE +23 -0
  159. package/package/corpus/skills/run-tests/NOTICE +19 -0
  160. package/package/corpus/skills/run-tests/SKILL.md +305 -0
  161. package/package/corpus/skills/target-authoring/LICENSE +23 -0
  162. package/package/corpus/skills/target-authoring/NOTICE +17 -0
  163. package/package/corpus/skills/target-authoring/SKILL.md +165 -0
  164. package/package/corpus/skills/vectorization/LICENSE +23 -0
  165. package/package/corpus/skills/vectorization/NOTICE +17 -0
  166. package/package/corpus/skills/vectorization/SKILL.md +189 -0
  167. package/package/profile-catalog.json +87 -1
  168. package/package.json +3 -2
@@ -0,0 +1,230 @@
1
+ ---
2
+ name: platform-detection
3
+ description: 'Identifies a .NET project''s test platform, framework, command mode, and SDK-style versus classic project system, resolving global.json, project, packages.config, Directory.Build.props, and Directory.Packages.props precedence for MSTest, xUnit, NUnit, and TUnit. Use when asking "which test platform or framework?", "VSTest or MTP?", or "what runner does this project use?", including bridge settings, UseVSTest opt-outs, and conflicting VSTest/MTP configuration. Not for running or filtering tests, commands, flags, TRX, dumps, or test-command errors (use run-tests), or for hot-reload or migration requests.'
4
+ license: MIT
5
+ ---
6
+
7
+ <!-- Modified by Cratis from dotnet's original (MIT): frontmatter, applicability, navigation and the changes listed in NOTICE. Upstream: https://github.com/dotnet/skills (plugins/dotnet-test/skills/platform-detection/SKILL.md; see NOTICE) -->
8
+
9
+ # Test Platform and Framework Detection
10
+
11
+ Cratis rules in `.cratis/ai/rules/` (including `csharp.md`, `specs.csharp.md`, and `orleans.md`) and the `cratis-*` skills win where they differ. Specification authoring belongs to **cratis-specifications-csharp**; Cratis core repositories run xUnit v2 on VSTest.
12
+
13
+ Determine **which test platform** (VSTest or Microsoft.Testing.Platform) and **which test framework** (MSTest, xUnit, NUnit, TUnit) a project uses.
14
+
15
+ ## Response contract
16
+
17
+ Honor the user's requested labels and order exactly, substituting the actual
18
+ classification for every placeholder. Start with the verdict: never put a
19
+ heading, scratch analysis, tool syntax, or an echoed template before it. Follow
20
+ with one concise evidence sentence naming the repository facts needed to justify
21
+ every requested classification. When `Framework` is requested, name the package
22
+ or project SDK that identifies it. Use a second sentence only for a conflict, an
23
+ incomplete configuration, or target-framework-specific differences.
24
+
25
+ `Platform` means the platform that actually executes tests: **VSTest** or
26
+ **MTP**. If conflicting or incomplete configuration prevents execution, report
27
+ it as unavailable rather than inventing a successful platform.
28
+
29
+ Never classify the executed platform from `global.json` `test.runner` alone.
30
+ That setting selects `dotnet test` command mode; even an explicit `VSTest`
31
+ value can bridge to an executable MTP application. Continue through the project
32
+ runner, bridge, and output-shape signals before writing `Platform:`.
33
+
34
+ Apply this scope gate before drafting the evidence:
35
+
36
+ | User asks for | Evidence to include | Omit |
37
+ |---------------|---------------------|------|
38
+ | Platform and framework | Final runner selector and its winning source; package or project SDK identifying the framework; when needed, the property that makes it executable | Command mode; common SDK facts; `OutputType` unless it is missing or conflicting |
39
+ | The single deciding signal | That runner-selection property, why its source wins, and why a competing package does not select or imply VSTest; still name the package or project SDK identifying a requested framework | Bridge, `OutputType`, SDK mode, and unrelated prerequisites when the configuration is complete |
40
+ | Platforms per target framework | Only the conditional final values that differ by target | Common properties and project-wide SDK commentary |
41
+ | Explicit opt-out | Final `UseVSTest` value and its winning source | Superseded defaults unless they create a conflict |
42
+ | `dotnet test` mode | The separate command-mode and executed-platform classifications | None of the requested axes |
43
+
44
+ If the requested labels omit `dotnet test mode`, do not state or explain command
45
+ mode anywhere in the response. An exact bridge property may still be decisive
46
+ platform evidence, but do not turn it into SDK or CLI-mode commentary.
47
+ When the user asks which single signal decides between an explicit runner
48
+ property and `Microsoft.NET.Test.Sdk`, the evidence sentence must say both that
49
+ the runner property selects MTP and that `Microsoft.NET.Test.Sdk` does not
50
+ select or imply VSTest.
51
+
52
+ When import precedence decides a property, state why the winning source wins
53
+ (for example, it is imported later or its condition applies), not merely that it
54
+ contains the final value or overrides another assignment.
55
+
56
+ Keep the explanation on the requested axis:
57
+
58
+ - An SDK version pin in `global.json` is context, not a platform selector. Claim
59
+ that `global.json` selects VSTest or native MTP only when its `test.runner`
60
+ setting actually does so.
61
+ - If `UseVSTest=true` is decisive, say that directly. Do not speculate about an
62
+ absent `test.runner` or describe SDK pinning as an additional platform choice.
63
+ - If command mode was not requested, do not add it, even when it was needed
64
+ internally to determine the executed platform.
65
+
66
+ When a classic-project request also asks for the command family, add a direct
67
+ line such as `Command family: MSBuild + vstest.console.exe`; do not turn it into
68
+ an optional alternative or add an unnecessary build qualifier.
69
+
70
+ For a file-backed request, enumerate the following configuration names once,
71
+ then read every relevant file that is present in one batched operation:
72
+ `global.json`, `.csproj`, `packages.config`, `Directory.Build.props`,
73
+ `Directory.Build.targets`, `Directory.Packages.props`, and explicit imported
74
+ `.props` / `.targets`. A setting absent from the project file may be defined by
75
+ an import, so never infer its final value from the `.csproj` alone. Do not search
76
+ the web or inspect unrelated files when repository configuration is sufficient.
77
+
78
+ Resolve properties in the actual MSBuild import order, not with a fixed
79
+ "project beats props" rule. For every applicable target framework:
80
+
81
+ 1. Follow the import graph and conditions. A later applicable assignment wins.
82
+ `Directory.Build.props` is normally imported before the project body, so an
83
+ unconditional project assignment normally overrides it; later `.targets`
84
+ can override the project again.
85
+ 2. Record the final value and its winning source for `UseVSTest`, the framework
86
+ runner selector, `TestingPlatformDotnetTestSupport`, and `OutputType`.
87
+ 3. Treat `Directory.Packages.props` as version evidence unless it also contains
88
+ relevant properties. Resolve package/SDK versions before applying
89
+ version-dependent defaults.
90
+ 4. Never infer a property from package presence. A package or SDK default counts
91
+ only when that resolved version actually supplies it and no later assignment
92
+ overrides it.
93
+
94
+ ## Detecting the project system
95
+
96
+ Classify the project before selecting a CLI:
97
+
98
+ - Root `Sdk` attribute or `<Sdk>` declaration: SDK-style.
99
+ - `ToolsVersion`, `Microsoft.Common.props` / `Microsoft.CSharp.targets` imports,
100
+ explicit `<Reference>` and `<Compile Include>` items: classic non-SDK.
101
+ - `packages.config`: classic NuGet dependency management.
102
+
103
+ Classic projects can still use VSTest-compatible adapters, but `dotnet test` is
104
+ not automatically a valid invocation. Preserve repository scripts/CI commands,
105
+ commonly MSBuild followed by `vstest.console.exe`. Mention `MSTest.exe` only
106
+ when repository configuration or documentation establishes that legacy runner.
107
+
108
+ ## Detecting the test framework
109
+
110
+ Read the `.csproj`, adjacent `packages.config`, and
111
+ `Directory.Build.props` / `Directory.Packages.props` and look for:
112
+
113
+ | Package or SDK reference | Framework |
114
+ |--------------------------|-----------|
115
+ | `MSTest` metapackage, `<Project Sdk="MSTest.Sdk[/version]">`, or `<Sdk Name="MSTest.Sdk">` | MSTest |
116
+ | `MSTest.TestFramework` + `MSTest.TestAdapter` | MSTest (also valid for v3/v4) |
117
+ | `xunit`, `xunit.v3`, `xunit.v3.mtp-v1`, `xunit.v3.mtp-v2`, `xunit.v3.core.mtp-v1`, `xunit.v3.core.mtp-v2` | xUnit |
118
+ | `NUnit` + `NUnit3TestAdapter` | NUnit |
119
+ | `TUnit` | TUnit (MTP only) |
120
+
121
+ In classic projects, package IDs and versions may appear only in
122
+ `packages.config`, while the project contains assembly `<Reference>` elements
123
+ with `HintPath` values. Use both sources.
124
+
125
+ ## Detecting the executed test platform
126
+
127
+ If the user explicitly requests `dotnet test` mode, read
128
+ [`references/command-mode.md`](references/command-mode.md) before answering.
129
+ Do not load that reference or mention command mode for a
130
+ platform/framework-only request.
131
+
132
+ For an SDK 8/9 request that explicitly asks about command mode and has no
133
+ effective bridge, state all three facts in one causal sentence: the runner makes
134
+ the project MTP-capable, `dotnet test` remains in VSTest mode, and the missing
135
+ bridge means VSTest actually executes the tests. Mention that native MTP command
136
+ mode starts with SDK 10 only when it helps explain that result.
137
+
138
+ When execution is permitted and neither the prompt nor `global.json` identifies
139
+ the SDK, run `dotnet --version` once. For read-only identification requests that
140
+ prohibit execution, do not probe the installed SDK; use repository facts and
141
+ state any necessary SDK assumption.
142
+
143
+ After resolving final property values, classify in this order:
144
+
145
+ 1. Final `UseVSTest=true` selects VSTest. If `global.json` simultaneously
146
+ selects native MTP command mode, report `Platform: unavailable` because the
147
+ command mode and project opt-out conflict.
148
+ 2. A native-MTP selection in `global.json` executes a compatible MTP
149
+ application with final `OutputType=Exe` on MTP. A VSTest-only,
150
+ library-output, or opted-out project is unavailable.
151
+ 3. On SDK 8/9, an enabled MTP runner plus final
152
+ `TestingPlatformDotnetTestSupport=true` plus final `OutputType=Exe` executes
153
+ on MTP.
154
+ 4. If the runner is enabled but the bridge is absent or false, a dual-capable
155
+ MSTest, NUnit, or xUnit project remains on VSTest: the runner establishes MTP
156
+ capability, but SDK 8/9 `dotnet test` cannot reach it and the VSTest adapter
157
+ executes the tests instead. If the bridge is true but no runner is enabled,
158
+ the project also remains on VSTest.
159
+ 5. A runner and bridge with non-executable output is incomplete and unavailable.
160
+ An MTP-only framework that cannot be reached by the selected SDK path is also
161
+ unavailable, not VSTest.
162
+
163
+ Keep each signal's role exact:
164
+
165
+ - The runner property selects the test application.
166
+ - `TestingPlatformDotnetTestSupport=true` lets SDK 8/9 `dotnet test` reach that
167
+ application.
168
+ - `OutputType=Exe` supplies the executable host shape. It does **not** select or
169
+ enable MTP.
170
+
171
+ Do not confuse the `MSTest` metapackage with the `MSTest.Sdk` project SDK.
172
+ `PackageReference Include="MSTest"` plus `EnableMSTestRunner=true` enables the
173
+ MSTest MTP runner, but it does **not** implicitly set
174
+ `TestingPlatformDotnetTestSupport`.
175
+
176
+ MSTest.Sdk enables the MTP runner by default. Check its resolved version and
177
+ evaluated properties for bridge behavior: version 3.8 supplies
178
+ `TestingPlatformDotnetTestSupport` unless a later assignment overrides it,
179
+ while newer SDKs on .NET 10 may expect native MTP mode instead.
180
+ `<UseVSTest>true</UseVSTest>` opts back into VSTest.
181
+
182
+ | Signal | Meaning |
183
+ |--------|---------|
184
+ | `<Project Sdk="MSTest.Sdk...">` with no `UseVSTest` | MTP application; inspect the resolved SDK version and evaluated bridge property |
185
+ | `MSTest` metapackage + `<EnableMSTestRunner>true>` | MTP runner enabled; does not imply the VSTest-to-MTP bridge |
186
+ | `<UseMicrosoftTestingPlatformRunner>true` | Deciding xUnit runner-selection signal |
187
+ | `<EnableMSTestRunner>true>` / `<EnableNUnitRunner>true>` | Deciding MSTest/NUnit runner-selection signal |
188
+ | `TestingPlatformDotnetTestSupport=true` | Execution prerequisite for a VSTest-to-MTP bridge, not the runner-selection signal |
189
+ | `Microsoft.Testing.Platform` package | MTP-capable application; not decisive by itself |
190
+ | `TUnit` | MTP-only framework |
191
+ | Final evaluated `<OutputType>Exe</OutputType>` | Required executable host shape for package-based MTP applications |
192
+
193
+ `Microsoft.NET.Test.Sdk` alone is not decisive; it can remain for compatibility
194
+ in an MTP-enabled project. When an explicit override decides the result, name
195
+ the final override and its source, not the superseded default.
196
+ When a runner-selection property competes with `Microsoft.NET.Test.Sdk`, say
197
+ that the runner property selects MTP and `Microsoft.NET.Test.Sdk` does **not**
198
+ select or imply VSTest. It may remain as compatibility support, but that is
199
+ secondary. `TestingPlatformDotnetTestSupport=true` is a bridge prerequisite, not
200
+ the runner-selection signal; never say that this property alone enables the
201
+ bridge. For a request asking which single signal decides, stop there. Omit
202
+ bridge or host-shape prerequisites when the configuration is complete, and add
203
+ them only when needed to explain why the selected runner cannot execute.
204
+ Likewise, when an enabled runner is overridden or unreachable, state both axes
205
+ causally: the runner property makes the project MTP-capable, but the final
206
+ `UseVSTest`/bridge/output setting determines which platform actually executes.
207
+ Name the runner selector before using a package reference only to identify the
208
+ framework.
209
+
210
+ Use causal evidence, not a bag of signals. For example:
211
+
212
+ ```text
213
+ Platform: MTP
214
+ Framework: NUnit
215
+
216
+ Directory.Build.props supplies final EnableNUnitRunner=true and
217
+ TestingPlatformDotnetTestSupport=true, so NUnit executes on MTP.
218
+ ```
219
+
220
+ For an incompatible configuration, give one minimal alignment choice after the
221
+ verdict without modifying files: either select the project's configured
222
+ platform globally or remove the project opt-out to use the globally selected
223
+ platform.
224
+
225
+ ### Conditional and per-target-framework properties
226
+
227
+ Evaluate runner and bridge properties for each target framework. If conditions
228
+ produce different executed platforms, report each target explicitly (for
229
+ example, `net8.0: VSTest`, `net9.0: MTP`) rather than collapsing the project to
230
+ one global platform.
@@ -0,0 +1,27 @@
1
+ # `dotnet test` Command Mode
2
+
3
+ Read this reference only when the user explicitly asks for command mode or
4
+ supplies a `dotnet test mode:` output label.
5
+
6
+ Command mode and executed test platform are separate axes. Command mode controls
7
+ CLI syntax; VSTest mode can still bridge to an MTP test application.
8
+
9
+ ## Selection
10
+
11
+ - SDK 10+ with `global.json` `"test": { "runner":
12
+ "Microsoft.Testing.Platform" }` selects native MTP mode.
13
+ - SDK 10+ with runner `VSTest` or no `test` section selects VSTest mode.
14
+ - SDK 8/9 supports only VSTest mode.
15
+
16
+ Report the requested axes separately:
17
+
18
+ ```text
19
+ dotnet test mode: VSTest
20
+ Platform: MTP
21
+ Framework: MSTest
22
+ ```
23
+
24
+ A complete VSTest-to-MTP bridge still reports `dotnet test mode: VSTest` and
25
+ `Platform: MTP`. Native MTP reports `dotnet test mode: native MTP`. If native
26
+ MTP selection conflicts with a VSTest opt-out or incompatible project shape,
27
+ report `Platform: unavailable` rather than inventing successful execution.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Managed Code
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,50 @@
1
+ .NET Profiling
2
+ Copyright (c) 2026 Managed Code
3
+ Licensed under the MIT License. See LICENSE.
4
+
5
+ Upstream source: https://github.com/managedcode/dotnet-skills/blob/2d8fba176a33b9872d5de35ec71d9ec71112ee26/catalog/Tools/Profiling/skills/profiling/SKILL.md
6
+
7
+ Changes made by Cratis:
8
+
9
+ LICENSE:
10
+ - Copy upstream MIT license and copyright verbatim.
11
+
12
+ SKILL.md:
13
+ - Bootstrap step 4 records commands in task notes or the report instead of editing `AGENTS.md`.
14
+ - Normalize frontmatter serialization, add MIT license where absent; preserve name and description.
15
+ - Add marked modification/source comment and applicability/Cratis precedence line with the skill-specific safety, ownership or compatibility caveat.
16
+ - Add --version <x> placeholders to tool installations; pin the version.
17
+ - Prefix official tool downloads/installs with marked approval/pinned-version guidance and privileged/perfcollect examples with explicit root/container-security approval, where present.
18
+ - Scope upstream general workflow advice to this skill's stated task; it does not govern unrelated tasks.
19
+ - Indent approval guard lines to keep the surrounding nested Markdown lists intact.
20
+ - Rewrite the description to the Cratis shape (what it does, Use when, Not for) and drop references to skills that are not part of this corpus.
21
+
22
+ references/commands.md:
23
+ - Add --version <x> placeholders to tool installations; pin the version.
24
+ - Replace obsolete dotnet-counters list examples with ps/monitor, as used elsewhere in this skill.
25
+ - Prefix official tool downloads/installs with marked approval/pinned-version guidance and privileged/perfcollect examples with explicit root/container-security approval, where present.
26
+ - Add or normalize the top Contents list from existing headings; preserve section content.
27
+
28
+ references/profiling.md:
29
+ - Add --version <x> placeholders to tool installations; pin the version.
30
+ - Prefix official tool downloads/installs with marked approval/pinned-version guidance and privileged/perfcollect examples with explicit root/container-security approval, where present.
31
+ - Add or normalize the top Contents list from existing headings; preserve section content.
32
+
33
+ references/patterns.md:
34
+ - Add or normalize the top Contents list from existing headings; preserve section content.
35
+
36
+ NOTICE: Add this attribution, change list, and any download/execution disclosure.
37
+
38
+ Executes or downloads (instructions retained, not executed by this import):
39
+ - SKILL.md: - `dotnet tool install --global dotnet-counters --version <x>`
40
+ - SKILL.md: - `dotnet tool install --global dotnet-trace --version <x>`
41
+ - SKILL.md: - `dotnet tool install --global dotnet-gcdump --version <x>`
42
+ - SKILL.md: - direct-download fallback when global tools are not suitable:
43
+ - SKILL.md: - use the official Microsoft Learn download links for `dotnet-counters`, `dotnet-trace`, and `dotnet-gcdump`
44
+ - references/commands.md: dotnet tool install --global dotnet-counters --version <x>
45
+ - references/commands.md: dotnet tool install --global dotnet-trace --version <x>
46
+ - references/commands.md: dotnet tool install --global dotnet-dump --version <x>
47
+ - references/commands.md: dotnet tool install --global dotnet-gcdump --version <x>
48
+ - references/profiling.md: dotnet tool install --global dotnet-counters --version <x>
49
+ - references/profiling.md: dotnet tool install --global dotnet-trace --version <x>
50
+ - references/profiling.md: dotnet tool install --global dotnet-gcdump --version <x>
@@ -0,0 +1,144 @@
1
+ ---
2
+ name: profiling
3
+ description: 'Uses the free official .NET diagnostics CLI tools for profiling and runtime investigation in a repository: CPU, GC pressure, allocation growth, exception storms, lock contention, and slow code. Use when a .NET application needs performance or runtime profiling. Not for replacing realistic performance or load tests with ad-hoc tracing, production heap collection without a pause-risk plan, crash dumps (use dump-collect), or benchmark design (use microbenchmarking).'
4
+ compatibility: Requires a .NET app or process to inspect; respects the repo's `AGENTS.md` commands first.
5
+ license: MIT
6
+ ---
7
+
8
+ <!-- Modified by Cratis from managedcode's original (MIT): frontmatter, applicability, navigation and the changes listed in NOTICE. Upstream: https://github.com/managedcode/dotnet-skills (catalog/Tools/Profiling/skills/profiling/SKILL.md; see NOTICE) -->
9
+
10
+ # .NET Profiling
11
+
12
+ Use only within this skill's stated task; general workflow advice does not apply to unrelated tasks. Cratis rules in `.cratis/ai/rules/` (including `csharp.md`, `specs.csharp.md`, and `orleans.md`) and the `cratis-*` skills win where they differ. Write outputs only to the task's `.ai-work/<task>/` folder; run collection commands there, not in `profile-output/`.
13
+
14
+ ## Trigger On
15
+
16
+ - the repo needs performance or runtime profiling for a .NET application
17
+ - the user asks about slow code, high CPU, GC pressure, allocation growth, exception storms, lock contention, or startup diagnostics
18
+ - the team wants official CLI-based diagnostics without depending on `dnx`
19
+
20
+ ## Value
21
+
22
+ - produce a concrete project delta: code, docs, config, tests, CI, or review artifact
23
+ - reduce ambiguity through explicit planning, verification, and final validation skills
24
+ - leave reusable project context so future tasks are faster and safer
25
+
26
+ ## Do Not Use For
27
+
28
+ - replacing realistic performance tests or load tests with ad-hoc tracing alone
29
+ - production heap collection when the pause risk has not been accepted
30
+ - GUI-only workflows that the repo cannot automate or document
31
+
32
+ ## Inputs
33
+
34
+ - the nearest `AGENTS.md`
35
+ - target application, process, or startup path
36
+ - the symptom being investigated: CPU, memory, GC, contention, exceptions, or startup
37
+
38
+ ## Quick Start
39
+
40
+ 1. Read the nearest `AGENTS.md` and confirm scope and constraints.
41
+ 2. Run this skill's `Workflow` through the `Ralph Loop` until outcomes are acceptable.
42
+ 3. Return the `Required Result Format` with concrete artifacts and verification evidence.
43
+
44
+ ## Workflow
45
+
46
+ 1. Build and run a realistic target first:
47
+ - prefer `Release`
48
+ - prefer realistic config, inputs, and data volume
49
+ 2. Start with the lightest useful tool:
50
+ - `dotnet-counters` for live health signals
51
+ - `dotnet-trace` for CPU, exception, contention, GC, and startup traces
52
+ - `dotnet-gcdump` for managed heap inspection when memory shape matters
53
+ 3. Prefer installed CLI tools over `dnx` one-shot execution so the repo commands stay stable and reproducible.
54
+ 4. Capture one focused profile at a time instead of mixing every signal into one run.
55
+ 5. For CPU and general runtime hotspots, start with `dotnet-trace collect`.
56
+ 6. For live triage, start with `dotnet-counters monitor` on `System.Runtime`.
57
+ 7. For heap analysis, use `dotnet-gcdump` carefully and document the pause risk.
58
+ 8. After each change, rerun the same measurement path and compare before versus after.
59
+
60
+ ## Bootstrap When Missing
61
+
62
+ If official .NET profiling tools are not available yet:
63
+
64
+ 1. Detect current state:
65
+ - `dotnet --info`
66
+ - `dotnet tool list --global`
67
+ - `command -v dotnet-counters`
68
+ - `command -v dotnet-trace`
69
+ - `command -v dotnet-gcdump`
70
+ 2. Choose the install path deliberately:
71
+ - preferred machine-level install:
72
+ > **Cratis:** Downloads or installs a tool: requires the user's approval; prefer a pinned version (`dotnet tool install <tool> --version <x>`)
73
+ - `dotnet tool install --global dotnet-counters --version <x>`
74
+ > **Cratis:** Downloads or installs a tool: requires the user's approval; prefer a pinned version (`dotnet tool install <tool> --version <x>`)
75
+ - `dotnet tool install --global dotnet-trace --version <x>`
76
+ > **Cratis:** Downloads or installs a tool: requires the user's approval; prefer a pinned version (`dotnet tool install <tool> --version <x>`)
77
+ - `dotnet tool install --global dotnet-gcdump --version <x>`
78
+ > **Cratis:** Downloads or installs a tool: requires the user's approval; prefer a pinned version (`dotnet tool install <tool> --version <x>`)
79
+ - direct-download fallback when global tools are not suitable:
80
+ > **Cratis:** Downloads or installs a tool: requires the user's approval; prefer a pinned version (`dotnet tool install <tool> --version <x>`)
81
+ - use the official Microsoft Learn download links for `dotnet-counters`, `dotnet-trace`, and `dotnet-gcdump`
82
+ 3. Verify the installed tools resolve correctly:
83
+ - `dotnet-counters --version`
84
+ - `dotnet-trace --version`
85
+ - `dotnet-gcdump --version`
86
+ 4. Record the exact profiling commands in the task's `.ai-work/<task>/` notes or the final report (propose an `AGENTS.md` or project-doc change only when the user asks for one; managed corpus files are never edited by hand), for example:
87
+ - `dotnet-counters monitor --process-id PID --counters System.Runtime`
88
+ - `dotnet-trace collect --process-id PID --profile dotnet-common,dotnet-sampled-thread-time -o trace.nettrace`
89
+ - `dotnet-gcdump collect --process-id PID --output heap.gcdump`
90
+ 5. Run one bounded command and return `status: configured` or `status: improved`.
91
+ 6. If the repo intentionally standardizes on another profiling stack and does not want these tools, return `status: not_applicable`.
92
+
93
+ ## Deliver
94
+
95
+ - explicit official .NET profiling commands
96
+ - a clear profiling path for CPU, counters, and heap inspection
97
+ - reproducible diagnostics commands that humans and agents can rerun
98
+
99
+ ## Validate
100
+
101
+ - the chosen tool matches the actual symptom
102
+ - commands target a realistic process and configuration
103
+ - before/after comparisons use the same scenario
104
+ - heap collection warnings are explicit when `dotnet-gcdump` is used
105
+
106
+ ## Ralph Loop
107
+
108
+ Use the Ralph Loop for every task, including docs, architecture, testing, and tooling work.
109
+
110
+ 1. Plan first (mandatory):
111
+ - analyze current state
112
+ - define target outcome, constraints, and risks
113
+ - write a detailed execution plan
114
+ - list final validation skills to run at the end, with order and reason
115
+ 2. Execute one planned step and produce a concrete delta.
116
+ 3. Review the result and capture findings with actionable next fixes.
117
+ 4. Apply fixes in small batches and rerun the relevant checks or review steps.
118
+ 5. Update the plan after each iteration.
119
+ 6. Repeat until outcomes are acceptable or only explicit exceptions remain.
120
+ 7. If a dependency is missing, bootstrap it or return `status: not_applicable` with explicit reason and fallback path.
121
+
122
+ ### Required Result Format
123
+
124
+ - `status`: `complete` | `clean` | `improved` | `configured` | `not_applicable` | `blocked`
125
+ - `plan`: concise plan and current iteration step
126
+ - `actions_taken`: concrete changes made
127
+ - `validation_skills`: final skills run, or skipped with reasons
128
+ - `verification`: commands, checks, or review evidence summary
129
+ - `remaining`: top unresolved items or `none`
130
+
131
+ For setup-only requests with no execution, return `status: configured` and exact next commands.
132
+
133
+ ## Load References
134
+
135
+ - [references/commands.md](references/commands.md)
136
+ - [references/patterns.md](references/patterns.md)
137
+ - [references/profiling.md](references/profiling.md)
138
+
139
+ ## Example Requests
140
+
141
+ - "Profile this .NET app for CPU hotspots."
142
+ - "Investigate GC pressure in this service."
143
+ - "Capture counters and a trace from startup."
144
+ - "Set up official .NET profiling tools for local investigations."