@cratis/pi 7.102.0 → 7.103.1

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 (152) hide show
  1. package/package/corpus/harnesses/copilot/instructions/profiles.instructions.md +10 -1
  2. package/package/corpus/harnesses/copilot/instructions/pull-requests.instructions.md +2 -0
  3. package/package/corpus/harnesses/copilot/instructions/secrets.instructions.md +4 -0
  4. package/package/corpus/hooks/README.md +11 -1
  5. package/package/corpus/hooks/scripts/cratis-check-pr.mjs +12 -1
  6. package/package/corpus/hooks/scripts/cratis-guard-secrets.sh +79 -23
  7. package/package/corpus/hooks/scripts/cratis-guard-writes.sh +145 -40
  8. package/package/corpus/rules/profiles.md +10 -1
  9. package/package/corpus/rules/pull-requests.md +2 -0
  10. package/package/corpus/rules/secrets.md +4 -0
  11. package/package/corpus/skills/analyzing-dotnet-performance/LICENSE +23 -0
  12. package/package/corpus/skills/analyzing-dotnet-performance/NOTICE +36 -0
  13. package/package/corpus/skills/analyzing-dotnet-performance/SKILL.md +214 -0
  14. package/package/corpus/skills/analyzing-dotnet-performance/references/async-patterns.md +122 -0
  15. package/package/corpus/skills/analyzing-dotnet-performance/references/collections-and-linq.md +220 -0
  16. package/package/corpus/skills/analyzing-dotnet-performance/references/critical-patterns.md +291 -0
  17. package/package/corpus/skills/analyzing-dotnet-performance/references/io-and-serialization.md +135 -0
  18. package/package/corpus/skills/analyzing-dotnet-performance/references/memory-and-strings.md +219 -0
  19. package/package/corpus/skills/analyzing-dotnet-performance/references/regex-patterns.md +95 -0
  20. package/package/corpus/skills/analyzing-dotnet-performance/references/structural-patterns.md +38 -0
  21. package/package/corpus/skills/binlog-generation/LICENSE +23 -0
  22. package/package/corpus/skills/binlog-generation/NOTICE +22 -0
  23. package/package/corpus/skills/binlog-generation/SKILL.md +129 -0
  24. package/package/corpus/skills/check-bin-obj-clash/LICENSE +23 -0
  25. package/package/corpus/skills/check-bin-obj-clash/NOTICE +27 -0
  26. package/package/corpus/skills/check-bin-obj-clash/SKILL.md +127 -0
  27. package/package/corpus/skills/check-bin-obj-clash/references/common-causes-and-fixes.md +206 -0
  28. package/package/corpus/skills/coverage-analysis/LICENSE +23 -0
  29. package/package/corpus/skills/coverage-analysis/NOTICE +32 -0
  30. package/package/corpus/skills/coverage-analysis/SKILL.md +198 -0
  31. package/package/corpus/skills/coverage-analysis/references/guidelines.md +68 -0
  32. package/package/corpus/skills/coverage-analysis/references/output-format.md +91 -0
  33. package/package/corpus/skills/coverage-analysis/references/report-generation.md +58 -0
  34. package/package/corpus/skills/coverage-analysis/references/setup-discovery.md +307 -0
  35. package/package/corpus/skills/coverage-analysis/scripts/Compute-CrapScores.ps1 +80 -0
  36. package/package/corpus/skills/coverage-analysis/scripts/CoverageData.ps1 +272 -0
  37. package/package/corpus/skills/coverage-analysis/scripts/Extract-MethodCoverage.ps1 +65 -0
  38. package/package/corpus/skills/cratis-screenplay-command-surface/SKILL.md +26 -1
  39. package/package/corpus/skills/cratis-screenplay-projections/SKILL.md +17 -0
  40. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/SKILL.md +17 -0
  41. package/package/corpus/skills/cratis-screenplay-specifications/SKILL.md +8 -0
  42. package/package/corpus/skills/cratis-screenplay-toolchain/SKILL.md +1 -1
  43. package/package/corpus/skills/cratis-screenplay-toolchain/references/cheat-sheet-example.md +1 -0
  44. package/package/corpus/skills/cratis-screenplay-toolchain/references/fast-path.md +7 -0
  45. package/package/corpus/skills/cratis-screenplay-toolchain/references/traps.md +1 -0
  46. package/package/corpus/skills/cratis-screenplay-ui-composition/SKILL.md +40 -0
  47. package/package/corpus/skills/cratis-screenplay-ui-composition/references/response-continuations.md +1 -0
  48. package/package/corpus/skills/cratis-screenplay-ui-composition/references/worked-flow.md +1 -0
  49. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/admission.md +3 -2
  50. package/package/corpus/skills/csharp-refactoring/LICENSE +23 -0
  51. package/package/corpus/skills/csharp-refactoring/NOTICE +22 -0
  52. package/package/corpus/skills/csharp-refactoring/SKILL.md +175 -0
  53. package/package/corpus/skills/csharp-refactoring/references/operation-catalog.md +37 -0
  54. package/package/corpus/skills/directory-build-organization/LICENSE +23 -0
  55. package/package/corpus/skills/directory-build-organization/NOTICE +21 -0
  56. package/package/corpus/skills/directory-build-organization/SKILL.md +205 -0
  57. package/package/corpus/skills/directory-build-organization/references/common-patterns.md +56 -0
  58. package/package/corpus/skills/directory-build-organization/references/multi-level-examples.md +167 -0
  59. package/package/corpus/skills/directory-build-organization/references/targetframework-props-pitfall.md +54 -0
  60. package/package/corpus/skills/dotnet-aot-compat/LICENSE +23 -0
  61. package/package/corpus/skills/dotnet-aot-compat/NOTICE +18 -0
  62. package/package/corpus/skills/dotnet-aot-compat/SKILL.md +265 -0
  63. package/package/corpus/skills/dotnet-aot-compat/references/polyfills.md +43 -0
  64. package/package/corpus/skills/dotnet-trace-collect/LICENSE +23 -0
  65. package/package/corpus/skills/dotnet-trace-collect/NOTICE +65 -0
  66. package/package/corpus/skills/dotnet-trace-collect/SKILL.md +116 -0
  67. package/package/corpus/skills/dotnet-trace-collect/references/dotnet-monitor.md +97 -0
  68. package/package/corpus/skills/dotnet-trace-collect/references/dotnet-trace-collect-linux.md +84 -0
  69. package/package/corpus/skills/dotnet-trace-collect/references/dotnet-trace-collect.md +91 -0
  70. package/package/corpus/skills/dotnet-trace-collect/references/perfcollect.md +200 -0
  71. package/package/corpus/skills/dotnet-trace-collect/references/perfview.md +141 -0
  72. package/package/corpus/skills/dotnet-trace-collect/references/tool-selection.md +160 -0
  73. package/package/corpus/skills/dump-collect/LICENSE +23 -0
  74. package/package/corpus/skills/dump-collect/NOTICE +40 -0
  75. package/package/corpus/skills/dump-collect/SKILL.md +97 -0
  76. package/package/corpus/skills/dump-collect/references/container-dumps.md +412 -0
  77. package/package/corpus/skills/dump-collect/references/coreclr-dumps.md +108 -0
  78. package/package/corpus/skills/dump-collect/references/nativeaot-dumps.md +280 -0
  79. package/package/corpus/skills/eliminate-redundant-restores/LICENSE +23 -0
  80. package/package/corpus/skills/eliminate-redundant-restores/NOTICE +19 -0
  81. package/package/corpus/skills/eliminate-redundant-restores/SKILL.md +112 -0
  82. package/package/corpus/skills/extension-points/LICENSE +23 -0
  83. package/package/corpus/skills/extension-points/NOTICE +18 -0
  84. package/package/corpus/skills/extension-points/SKILL.md +248 -0
  85. package/package/corpus/skills/filter-syntax/LICENSE +23 -0
  86. package/package/corpus/skills/filter-syntax/NOTICE +17 -0
  87. package/package/corpus/skills/filter-syntax/SKILL.md +179 -0
  88. package/package/corpus/skills/including-generated-files/LICENSE +23 -0
  89. package/package/corpus/skills/including-generated-files/NOTICE +17 -0
  90. package/package/corpus/skills/including-generated-files/SKILL.md +139 -0
  91. package/package/corpus/skills/microbenchmarking/LICENSE +23 -0
  92. package/package/corpus/skills/microbenchmarking/NOTICE +36 -0
  93. package/package/corpus/skills/microbenchmarking/SKILL.md +131 -0
  94. package/package/corpus/skills/microbenchmarking/references/bdn-internals-and-tuning.md +143 -0
  95. package/package/corpus/skills/microbenchmarking/references/comparison-strategies.md +200 -0
  96. package/package/corpus/skills/microbenchmarking/references/diagnosers-and-exporters.md +150 -0
  97. package/package/corpus/skills/microbenchmarking/references/project-setup-and-running.md +189 -0
  98. package/package/corpus/skills/microbenchmarking/references/writing-benchmarks.md +310 -0
  99. package/package/corpus/skills/msbuild/LICENSE +23 -0
  100. package/package/corpus/skills/msbuild/NOTICE +55 -0
  101. package/package/corpus/skills/msbuild/SKILL.md +117 -0
  102. package/package/corpus/skills/msbuild/references/antipatterns/additional-antipatterns.md +291 -0
  103. package/package/corpus/skills/msbuild/references/antipatterns/incremental-build-inputs-outputs.md +57 -0
  104. package/package/corpus/skills/msbuild/references/antipatterns/private-assets.md +29 -0
  105. package/package/corpus/skills/msbuild/references/binlog-failure-analysis.md +85 -0
  106. package/package/corpus/skills/msbuild/references/binlog-generation.md +69 -0
  107. package/package/corpus/skills/msbuild/references/build-perf-baseline.md +493 -0
  108. package/package/corpus/skills/msbuild/references/build-perf-diagnostics.md +268 -0
  109. package/package/corpus/skills/msbuild/references/copy-to-output-directory.md +183 -0
  110. package/package/corpus/skills/msbuild/references/eval-performance.md +190 -0
  111. package/package/corpus/skills/msbuild/references/extension-points.md +281 -0
  112. package/package/corpus/skills/msbuild/references/incremental-build.md +365 -0
  113. package/package/corpus/skills/msbuild/references/msbuild-antipatterns.md +401 -0
  114. package/package/corpus/skills/orleans/LICENSE +21 -0
  115. package/package/corpus/skills/orleans/NOTICE +64 -0
  116. package/package/corpus/skills/orleans/SKILL.md +140 -0
  117. package/package/corpus/skills/orleans/references/anti-patterns.md +660 -0
  118. package/package/corpus/skills/orleans/references/configuration-api.md +933 -0
  119. package/package/corpus/skills/orleans/references/examples.md +66 -0
  120. package/package/corpus/skills/orleans/references/grain-api.md +784 -0
  121. package/package/corpus/skills/orleans/references/grains.md +75 -0
  122. package/package/corpus/skills/orleans/references/hosting.md +71 -0
  123. package/package/corpus/skills/orleans/references/implementation.md +591 -0
  124. package/package/corpus/skills/orleans/references/official-docs-index.md +250 -0
  125. package/package/corpus/skills/orleans/references/patterns.md +811 -0
  126. package/package/corpus/skills/orleans/references/persistence-api.md +495 -0
  127. package/package/corpus/skills/orleans/references/primitive-selection.md +35 -0
  128. package/package/corpus/skills/orleans/references/scheduling-and-services.md +295 -0
  129. package/package/corpus/skills/orleans/references/serialization-api.md +299 -0
  130. package/package/corpus/skills/orleans/references/streaming-api.md +396 -0
  131. package/package/corpus/skills/orleans/references/testing-patterns.md +210 -0
  132. package/package/corpus/skills/platform-detection/LICENSE +23 -0
  133. package/package/corpus/skills/platform-detection/NOTICE +17 -0
  134. package/package/corpus/skills/platform-detection/SKILL.md +230 -0
  135. package/package/corpus/skills/platform-detection/references/command-mode.md +27 -0
  136. package/package/corpus/skills/profiling/LICENSE +21 -0
  137. package/package/corpus/skills/profiling/NOTICE +50 -0
  138. package/package/corpus/skills/profiling/SKILL.md +144 -0
  139. package/package/corpus/skills/profiling/references/commands.md +439 -0
  140. package/package/corpus/skills/profiling/references/patterns.md +586 -0
  141. package/package/corpus/skills/profiling/references/profiling.md +190 -0
  142. package/package/corpus/skills/run-tests/LICENSE +23 -0
  143. package/package/corpus/skills/run-tests/NOTICE +19 -0
  144. package/package/corpus/skills/run-tests/SKILL.md +305 -0
  145. package/package/corpus/skills/target-authoring/LICENSE +23 -0
  146. package/package/corpus/skills/target-authoring/NOTICE +17 -0
  147. package/package/corpus/skills/target-authoring/SKILL.md +165 -0
  148. package/package/corpus/skills/vectorization/LICENSE +23 -0
  149. package/package/corpus/skills/vectorization/NOTICE +17 -0
  150. package/package/corpus/skills/vectorization/SKILL.md +189 -0
  151. package/package/profile-catalog.json +85 -1
  152. package/package.json +1 -1
@@ -0,0 +1,280 @@
1
+ # NativeAOT Crash Dump Collection
2
+
3
+ ## Contents
4
+
5
+ - OS-Level Core Dumps (Preferred)
6
+ - macOS
7
+ - Windows
8
+ - Alternative: Using createdump with DOTNET_DbgEnableMiniDump
9
+ - Verification
10
+
11
+ | Need | Tool | Platforms |
12
+ |------|------|-----------|
13
+ | Automatic dump on crash (preferred) | OS-level core dumps (`ulimit`, `core_pattern`, WER) | All |
14
+ | Automatic dump on crash (alternative) | `createdump` + `DOTNET_DbgEnableMiniDump` env vars | All |
15
+ | On-demand from running process | `gcore` (Linux), `lldb` (macOS), `procdump` (Windows) | Per-platform |
16
+
17
+ NativeAOT applications are native executables. Since NativeAOT only supports full dumps, OS-level core dump mechanisms are the simplest approach — no extra tooling to copy or configure.
18
+
19
+ > **Note:** NativeAOT only supports full dumps. `DOTNET_DbgMiniDumpType` must be set to `4` (Full).
20
+
21
+ ## OS-Level Core Dumps (Preferred)
22
+
23
+ ### Linux
24
+
25
+ **Option A: Direct core dumps (simplest)**
26
+
27
+ ```bash
28
+ # Enable core dumps for the current shell session
29
+ ulimit -c unlimited
30
+
31
+ # Set the core dump output pattern (system-wide, requires root)
32
+ echo '/tmp/dumps/core.%e.%p.%t' | sudo tee /proc/sys/kernel/core_pattern
33
+
34
+ # Make persistent across reboots — add to /etc/sysctl.conf:
35
+ # kernel.core_pattern = /tmp/dumps/core.%e.%p.%t
36
+
37
+ # Ensure dump directory exists
38
+ mkdir -p /tmp/dumps
39
+ ```
40
+
41
+ > **Note:** `ulimit` only applies to processes started in the current shell session. For an already-running process, use on-demand collection with `gcore` (see On-Demand Dump Collection below).
42
+
43
+ **Format specifiers for `core_pattern`:**
44
+ | Spec | Meaning |
45
+ |------|---------|
46
+ | `%p` | PID |
47
+ | `%e` | Executable name (first 15 chars) |
48
+ | `%t` | Unix timestamp |
49
+ | `%h` | Hostname |
50
+ | `%u` | UID |
51
+
52
+ **Option B: systemd-coredump (systemd systems)**
53
+
54
+ Many Linux distributions pipe core dumps to `systemd-coredump` by default. Check:
55
+
56
+ ```bash
57
+ cat /proc/sys/kernel/core_pattern
58
+ # If it shows: |/usr/lib/systemd/systemd-coredump ...
59
+ # Then systemd-coredump is already handling dumps.
60
+ ```
61
+
62
+ Using `coredumpctl`:
63
+
64
+ ```bash
65
+ # List collected dumps
66
+ coredumpctl list
67
+
68
+ # Show details of the most recent dump
69
+ coredumpctl info
70
+
71
+ # Export a dump to a file
72
+ coredumpctl dump -o /tmp/dumps/myapp.core
73
+
74
+ # Filter by executable name
75
+ coredumpctl list myapp
76
+ coredumpctl dump myapp -o /tmp/dumps/myapp.core
77
+ ```
78
+
79
+ Configure systemd-coredump storage in `/etc/systemd/coredump.conf`:
80
+ ```ini
81
+ [Coredump]
82
+ Storage=external
83
+ MaxUse=2G
84
+ ProcessSizeMax=8G
85
+ ```
86
+
87
+ ### On-Demand Dump Collection
88
+
89
+ ```bash
90
+ # Using gcore (from gdb package)
91
+ gcore -o /tmp/dumps/myapp <pid>
92
+ ```
93
+
94
+ ## macOS
95
+
96
+ ### Automatic Crash Dumps
97
+
98
+ ```bash
99
+ # Enable core dumps for the current shell session
100
+ ulimit -c unlimited
101
+
102
+ # Core dumps go to /cores/core.<pid>
103
+ # Ensure the directory exists and is writable
104
+ sudo mkdir -p /cores
105
+ sudo chmod 1777 /cores
106
+
107
+ # Verify the setting
108
+ ulimit -c # Should print "unlimited"
109
+ ```
110
+
111
+ **Notes:**
112
+ - macOS also generates `.crash` reports in `~/Library/Logs/DiagnosticReports/` automatically — these are text-based crash logs, not full memory dumps.
113
+ - On Apple Silicon, core dumps may require SIP (System Integrity Protection) adjustments for certain processes.
114
+
115
+ ### Retrieving Dumps from an Already-Crashed Process
116
+
117
+ If the app has already crashed and core dumps were enabled (`ulimit -c unlimited` was set):
118
+
119
+ ```bash
120
+ # Check /cores/ for core dumps
121
+ ls -la /cores/core.*
122
+
123
+ # Check macOS crash reports (always generated, even without ulimit)
124
+ ls -la ~/Library/Logs/DiagnosticReports/*.crash
125
+ # Or on newer macOS:
126
+ ls -la ~/Library/Logs/DiagnosticReports/*.ips
127
+ ```
128
+
129
+ If core dumps were **not** enabled before the crash, the core dump is lost. The `.crash`/`.ips` report in `DiagnosticReports` is the only artifact — it contains the stack trace and crash reason but not full memory.
130
+
131
+ ### On-Demand Dump Collection
132
+
133
+ ```bash
134
+ # Using lldb (ships with Xcode command-line tools)
135
+ lldb -p <pid> -o "process save-core /tmp/dumps/myapp.core" -o "quit"
136
+
137
+ # Using gcore if gdb is installed (via Homebrew)
138
+ gcore -o /tmp/dumps/myapp <pid>
139
+ ```
140
+
141
+ ## Windows
142
+
143
+ ### Automatic Crash Dumps (Windows Error Reporting)
144
+
145
+ WER is a Windows OS-level mechanism — it uses its own `DumpType` values (0=Custom, 1=Mini, 2=Full) which are separate from the `DOTNET_DbgMiniDumpType` environment variable. WER works for any process, including NativeAOT apps without `createdump`.
146
+
147
+ Configure via the registry. Run in an **elevated PowerShell**:
148
+
149
+ ```powershell
150
+ # Enable local dumps for a specific application
151
+ $appName = "myapp.exe"
152
+ $dumpPath = "C:\dumps"
153
+ $regPath = "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\$appName"
154
+
155
+ New-Item -Path $regPath -Force
156
+ New-ItemProperty -Path $regPath -Name "DumpFolder" -Value $dumpPath -PropertyType ExpandString -Force
157
+ New-ItemProperty -Path $regPath -Name "DumpCount" -Value 10 -PropertyType DWord -Force
158
+ New-ItemProperty -Path $regPath -Name "DumpType" -Value 2 -PropertyType DWord -Force
159
+ # DumpType: 0=Custom, 1=Mini, 2=Full
160
+
161
+ # Ensure dump directory exists
162
+ New-Item -Path $dumpPath -ItemType Directory -Force
163
+ ```
164
+
165
+ **To enable for ALL applications** (not just one), use the parent key:
166
+ ```powershell
167
+ $regPath = "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps"
168
+ New-Item -Path $regPath -Force
169
+ New-ItemProperty -Path $regPath -Name "DumpFolder" -Value "C:\dumps" -PropertyType ExpandString -Force
170
+ New-ItemProperty -Path $regPath -Name "DumpType" -Value 2 -PropertyType DWord -Force
171
+ ```
172
+
173
+ ### On-Demand Dump Collection
174
+
175
+ **Using procdump (recommended — download from Sysinternals):**
176
+
177
+ ```powershell
178
+ # Download procdump (one-time)
179
+ # Cratis: Downloads or installs a tool: requires the user's approval; prefer a pinned version (`dotnet tool install <tool> --version <x>`)
180
+ Invoke-WebRequest -Uri "https://download.sysinternals.com/files/Procdump.zip" -OutFile "$env:TEMP\Procdump.zip"
181
+ Expand-Archive "$env:TEMP\Procdump.zip" -DestinationPath "$env:TEMP\Procdump" -Force
182
+
183
+ # Capture a full dump
184
+ & "$env:TEMP\Procdump\procdump.exe" -ma <pid> C:\dumps\myapp.dmp
185
+
186
+ # Capture on crash (waits for an unhandled exception)
187
+ & "$env:TEMP\Procdump\procdump.exe" -ma -e -w <processname> C:\dumps\myapp.dmp
188
+ ```
189
+
190
+ **Using Task Manager:**
191
+ 1. Open Task Manager → Details tab
192
+ 2. Right-click the process → "Create memory dump file"
193
+ 3. Note the output path shown in the dialog
194
+
195
+ ## Alternative: Using createdump with DOTNET_DbgEnableMiniDump
196
+
197
+ NativeAOT apps also support the `DOTNET_DbgEnableMiniDump` environment variables if `createdump` is available. This gives you the same env-var-based workflow as CoreCLR, but requires copying `createdump` to the right location.
198
+
199
+ If `createdump` is placed **next to the application binary**:
200
+
201
+ ```bash
202
+ export DOTNET_DbgEnableMiniDump=1
203
+ export DOTNET_DbgMiniDumpType=4
204
+ export DOTNET_DbgMiniDumpName="/tmp/dumps/%e_%p_%t.dmp"
205
+ export DOTNET_EnableCrashReport=1
206
+ ```
207
+
208
+ > **Note:** The `%e`, `%p`, `%h`, `%t` format specifiers in `DOTNET_DbgMiniDumpName` require .NET 7+. On .NET 6, use a literal path instead.
209
+
210
+ **Setup:** Copy `createdump` from the .NET runtime into the same directory as your published NativeAOT binary:
211
+
212
+ ```bash
213
+ # Linux
214
+ cp /usr/share/dotnet/shared/Microsoft.NETCore.App/<version>/createdump ./publish/
215
+
216
+ # macOS
217
+ cp /usr/local/share/dotnet/shared/Microsoft.NETCore.App/<version>/createdump ./publish/
218
+
219
+ # Windows (PowerShell)
220
+ Copy-Item "C:\Program Files\dotnet\shared\Microsoft.NETCore.App\<version>\createdump.exe" .\publish\
221
+ ```
222
+
223
+ **If the .NET runtime is not installed** (fully self-contained deployment), extract `createdump` from the runtime Docker image or NuGet package:
224
+
225
+ ```bash
226
+ # Extract from Docker runtime image
227
+ docker run --rm -v "$(pwd)/publish:/out" mcr.microsoft.com/dotnet/runtime:10.0 \
228
+ sh -c 'cp /usr/share/dotnet/shared/Microsoft.NETCore.App/*/createdump /out/'
229
+ ```
230
+
231
+ ### .NET 11+: DOTNET_DbgCreateDumpToolPath
232
+
233
+ Starting with .NET 11, you can point to `createdump` at any location instead of requiring it next to the binary:
234
+
235
+ ```bash
236
+ export DOTNET_DbgCreateDumpToolPath=/opt/tools/createdump
237
+ export DOTNET_DbgEnableMiniDump=1
238
+ export DOTNET_DbgMiniDumpType=4
239
+ export DOTNET_DbgMiniDumpName="/tmp/dumps/%e_%p_%t.dmp"
240
+ ```
241
+
242
+ This is especially useful in containers where you can install `createdump` once in a shared location.
243
+
244
+ ## Verification
245
+
246
+ ### When using OS-level core dumps
247
+
248
+ ```bash
249
+ # Linux — check core_pattern and ulimit
250
+ cat /proc/sys/kernel/core_pattern
251
+ ulimit -c
252
+
253
+ # macOS — check ulimit and /cores/
254
+ ulimit -c
255
+ ls -la /cores/
256
+
257
+ # Linux (systemd) — check for recent dumps
258
+ coredumpctl list --no-pager | tail -5
259
+ ```
260
+
261
+ ```powershell
262
+ # Windows — check WER registry
263
+ Get-ChildItem "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps" -ErrorAction SilentlyContinue
264
+ Get-ChildItem "C:\dumps" -ErrorAction SilentlyContinue
265
+ ```
266
+
267
+ ### When using createdump + DOTNET_DbgEnableMiniDump
268
+
269
+ ```bash
270
+ # Verify env vars are set
271
+ env | grep DOTNET_Dbg
272
+ env | grep DOTNET_EnableCrashReport
273
+
274
+ # Verify createdump is next to the binary (or at DOTNET_DbgCreateDumpToolPath)
275
+ ls -la ./createdump # co-located
276
+ # or: ls -la $DOTNET_DbgCreateDumpToolPath # .NET 11+
277
+
278
+ # Verify dump directory exists
279
+ ls -la /tmp/dumps/
280
+ ```
@@ -0,0 +1,23 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) .NET Foundation and Contributors
4
+
5
+ All rights reserved.
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ of this software and associated documentation files (the "Software"), to deal
9
+ in the Software without restriction, including without limitation the rights
10
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is
12
+ furnished to do so, subject to the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included in all
15
+ copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ SOFTWARE.
@@ -0,0 +1,19 @@
1
+ Eliminate Redundant Restores
2
+ Copyright (c) .NET Foundation and Contributors
3
+ Licensed under the MIT License. See LICENSE.
4
+
5
+ Upstream source: https://github.com/dotnet/skills/blob/a6bf43ab61967c30919334986515163ab24d7635/plugins/dotnet-msbuild/skills/eliminate-redundant-restores/SKILL.md
6
+
7
+ Changes made by Cratis:
8
+
9
+ LICENSE:
10
+ - Copy upstream MIT license and copyright verbatim.
11
+
12
+ SKILL.md:
13
+ - Normalize frontmatter serialization, add MIT license where absent; preserve name and description.
14
+ - Add marked modification/source comment and applicability/Cratis precedence line.
15
+ - Render unimported build-perf-diagnostics routing reference as plain topic text.
16
+ - Render unimported build-perf-baseline routing reference as plain topic text.
17
+ - 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.
18
+
19
+ NOTICE: Add this attribution, change list, and any download/execution disclosure.
@@ -0,0 +1,112 @@
1
+ ---
2
+ name: eliminate-redundant-restores
3
+ description: 'Removes repeated NuGet restores from multi-step .NET builds safely, including Directory.Build.rsp with -restore and safe restore suppression. Use when separate build, test, or publish steps each restore, or when NETSDK1004 or NETSDK1047 appears after --no-restore. Not for a slow first restore, a build with only one restore, version or lock-file errors, or general build slowness without a measured baseline (use the msbuild skill).'
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-msbuild/skills/eliminate-redundant-restores/SKILL.md; see NOTICE) -->
8
+
9
+ # Eliminate Redundant Restores
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.
12
+
13
+ A no-op restore still evaluates every project and checks restore state, so each extra restore in a multi-step build costs seconds to tens of seconds in a large repo. The cure is easy to get wrong: `--no-restore` on a step that no earlier restore actually covered turns a slow build into a failed one. This skill finds which invocations restore, proves which are already covered, and changes only those.
14
+
15
+ ## When to Use
16
+
17
+ - A pipeline or script runs several `dotnet`/`msbuild` steps and the log shows restore output in more than one of them
18
+ - A restore step exists, yet later steps still print `Determining projects to restore...`
19
+ - A repository `Directory.Build.rsp` or the active MSBuild installation's `MSBuild.rsp` contains `-restore`
20
+ - Someone asks where `--no-restore` or `-restore:false` can safely be added
21
+ - `NETSDK1004` or `NETSDK1047` appeared after `--no-restore` was added
22
+
23
+ ## When Not to Use
24
+
25
+ - The first restore is slow (feed latency, missing package cache): that is caching, not redundancy
26
+ - There is only one restore across all invocations: nothing to deduplicate
27
+ - Restore errors about versions, lock files or auditing: fix the restore itself
28
+ - Unranked "why is my build slow": start with build perf baseline, then build perf diagnostics
29
+
30
+ ## Inputs
31
+
32
+ Discover repository inputs in the working directory; do not ask the user for paths.
33
+
34
+ - CI definitions (`*.yml`, `.github/workflows`, `azure-pipelines*.yml`, `Jenkinsfile`) and build scripts (`build.cmd`, `build.sh`, `build.ps1`, `eng/`)
35
+ - `Directory.Build.rsp`, `Directory.Build.props`/`.targets`, `NuGet.config`
36
+ - Auto-loaded `MSBuild.rsp` beside the active MSBuild executable, or response files passed explicitly with `@file`. A repository-local `MSBuild.rsp` is not auto-loaded
37
+ - Restore evidence if present: step logs or a binlog
38
+
39
+ ## Workflow
40
+
41
+ ### Step 1: Confirm restore is repeated and worth removing
42
+
43
+ - Log evidence: `Determining projects to restore...` or `All projects are up-to-date for restore.` once per invocation.
44
+ - Binlog evidence: restore evaluations carry the global properties `MSBuildRestoreSessionId` and `ExcludeRestorePackageImports=true`; the Target Performance Summary lists `Restore` with N calls.
45
+ - Quantify each no-op restore. If there is one restore, or the repeated ones total about a second, report "nothing worth removing" and stop without editing.
46
+
47
+ ### Step 2: Inventory every invocation in execution order
48
+
49
+ | Invocation | Restores? |
50
+ |---|---|
51
+ | `dotnet build`, `test`, `publish`, `pack` | Implicitly, unless `--no-restore`; also check inherited rsp flags |
52
+ | `dotnet run` | Implicitly before building; `--no-restore` can still inherit rsp restore on older SDKs. With `--no-build`, no build or restore runs |
53
+ | `dotnet test`, `publish`, `pack` with `--no-build` | No implicit restore, but an rsp `-restore` can still enable restore; add `--no-restore -restore:false` |
54
+ | `dotnet msbuild`, `msbuild.exe`, CI MSBuild tasks | With `-restore` or `-t:Restore`, including flags inherited from repository `Directory.Build.rsp` or installation-level `MSBuild.rsp`, even when a step looks build-only |
55
+ | `dotnet restore`, `nuget restore`, `msbuild -t:Restore` | Explicit restore |
56
+ | CI build task with a "restore packages" option | Check its default |
57
+
58
+ Starting with .NET SDK 9.0.1xx, `--no-restore` forwards `-restore:false` to override rsp flags; older SDKs can still inherit `-restore` despite skipping the CLI's implicit restore. Whenever an rsp enables restore, use the version-independent `--no-restore -restore:false` with `dotnet build`, `test`, `publish` or `pack`, even with `--no-build`. `dotnet msbuild` and `msbuild.exe` take `-restore:false`, not `--no-restore`.
59
+
60
+ `dotnet run` does not expose the MSBuild `-restore:false` override. With an rsp on older SDKs, first build using `dotnet build --no-restore -restore:false`, then run using `dotnet run --no-build` with the same project, configuration, framework and runtime inputs (or execute the built DLL directly). Passing `-restore:false` to `dotnet run` is not a restore-suppression strategy.
61
+
62
+ ### Step 3: Decide per invocation
63
+
64
+ Keep the first restore. Skip a later one only when all four checks pass:
65
+
66
+ | Check | If it fails |
67
+ |---|---|
68
+ | **Same project set.** A restore covers its entry project or solution and that project's ProjectReference closure. It does not cover a project in another solution or `.slnf`, a tool built from another path, or a project an orchestrating `.proj` builds through the `MSBuild` task (`-restore` on the orchestrator leaves those unrestored and they fail with NETSDK1004) | Keep restore on that step, or add the project to the explicit restore step |
69
+ | **Same restore inputs.** `-r`/`--runtime`, RID-producing `-a`/`--arch`, `--os`, `--ucr`/`--use-current-runtime`, `TargetFramework(s)`, `RuntimeIdentifier(s)`, `PublishAot`, package sources (`--source`, `--configfile`, `RestoreSources`), `RestorePackagesPath`, and any `-p:` value a PackageReference condition reads. Architecture/OS options combine with the SDK's current RID; `--use-current-runtime` selects it. Missing RID targets fail with NETSDK1047 (`Assets file ... doesn't have a target for 'net10.0/linux-x64'`) | Match the effective RID in the explicit restore (for example `publish --os linux --arch x64` requires `restore -r linux-x64`), or keep restore on the later step. A generic restore does not cover these aliases merely because there is no `-r`. Do not require `SelfContained=true` on restore solely because publish is self-contained: RID-only restore covers ordinary SDK projects. Match `Configuration` or `SelfContained` only if repository conditions change package inputs |
70
+ | **Same available restore state.** Earlier `project.assets.json` files must exist where the later invocation looks for them. Match `--artifacts-path`, `UseArtifactsOutput`/`ArtifactsPath`, and `MSBuildProjectExtensionsPath`/`BaseIntermediateOutputPath`; another job or workspace does not automatically share these files | Align the explicit restore's output layout with build/test, or retain restore in the later workspace. For `build --artifacts-path artifacts --no-restore`, use `restore --artifacts-path artifacts` first; ordinary `obj/` assets do not cover that layout |
71
+ | **Nothing changes packages in between.** A step that generates or edits a project, runs `dotnet add package`, rewrites `Directory.Packages.props` or `NuGet.config` invalidates the earlier restore | Move the explicit restore after that step |
72
+
73
+ ### Step 4: Apply the smallest change
74
+
75
+ - One explicit restore carrying every restore input, then `--no-restore`, `-restore:false` or `--no-build` on later steps.
76
+ - Several `dotnet test` steps over one solution: build once, then `dotnet test --no-build` on each. Add `--no-restore -restore:false` if an rsp enables restore, including on .NET 8 and earlier. `--no-restore` alone still rebuilds.
77
+ - Keep self-contained publish settings. A `publish --no-build` still needs a prior build with matching configuration, framework, RID and self-contained output; restore compatibility does not prove that build outputs exist.
78
+ - Scope the change to CI and scripts. Leave `-restore` in `Directory.Build.rsp`, because developers rely on it; pass `-restore:false` per invocation instead.
79
+ - Never remove the first restore. If it is a `--locked-mode` gate, keep it there.
80
+ - Do not bundle static graph restore or package caching into this change.
81
+
82
+ ```bash
83
+ # One restore carries every input later steps use
84
+ dotnet restore MyApp.sln -r linux-x64
85
+ # Explicit overrides also work when an rsp enables restore on older SDKs
86
+ dotnet build MyApp.sln -c Release --no-restore -restore:false
87
+ dotnet test MyApp.sln -c Release --no-build --no-restore -restore:false
88
+ dotnet publish src/Api -c Release -r linux-x64 --no-restore -restore:false
89
+ # msbuild invocations need the explicit switch if an rsp file adds -restore
90
+ dotnet msbuild Packaging.proj -t:Pack -restore:false
91
+ ```
92
+
93
+ ### Step 5: Validate and report truthfully
94
+
95
+ 1. Run the changed pipeline or script end to end in a clean temporary copy (no `obj/`, no `project.assets.json`). A project that was never restored only fails there. YAML syntax or flag-presence checks do not validate restore coverage or test execution. If you cannot run it, say "not validated" and list the steps and projects to confirm.
96
+ 2. Success evidence: every later step passed; `Restore` calls (binlog) or `Determining projects to restore` lines fell from N to the expected count; for a time claim, before/after medians of at least three runs.
97
+ 3. Report a restore failure (NETSDK1004, NETSDK1047) separately from a build failure, and never claim success after either.
98
+
99
+ ## Output
100
+
101
+ Explain which steps restored, which earlier restore covers them, what changed, and what remains unvalidated. State whether redundant restores were removed or no change was needed, keeping the required first restore. Use prose or a findings table as appropriate; no fixed table headings or verdict syntax are required.
102
+
103
+ ## Common Pitfalls
104
+
105
+ | Pitfall | Solution |
106
+ |---|---|
107
+ | Adding `--no-restore` to every command | Apply the Step 3 checks per step |
108
+ | Missing that an rsp adds `-restore` to "build-only" msbuild steps | Search for `*.rsp` before concluding a step does not restore |
109
+ | Deleting `-restore` from `Directory.Build.rsp` | Override per CI invocation; the rsp serves developers |
110
+ | Orchestrator `.proj` restored, children not | Restore each child explicitly, or keep restore on the step that builds it |
111
+ | Publishing with `-r`, architecture/OS options, or `--use-current-runtime` after a generic restore | Restore with the same effective runtime identifier, including SDK-host defaults used by the aliases |
112
+ | A generator step edits PackageReferences after restore | Restore after the generator |
@@ -0,0 +1,23 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) .NET Foundation and Contributors
4
+
5
+ All rights reserved.
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ of this software and associated documentation files (the "Software"), to deal
9
+ in the Software without restriction, including without limitation the rights
10
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is
12
+ furnished to do so, subject to the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included in all
15
+ copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ SOFTWARE.
@@ -0,0 +1,18 @@
1
+ MSBuild Extension Points
2
+ Copyright (c) .NET Foundation and Contributors
3
+ Licensed under the MIT License. See LICENSE.
4
+
5
+ Upstream source: https://github.com/dotnet/skills/blob/a6bf43ab61967c30919334986515163ab24d7635/plugins/dotnet-msbuild/skills/extension-points/SKILL.md
6
+
7
+ Changes made by Cratis:
8
+
9
+ LICENSE:
10
+ - Copy upstream MIT license and copyright verbatim.
11
+
12
+ SKILL.md:
13
+ - Normalize frontmatter serialization, add MIT license where absent; preserve name and description.
14
+ - Add marked modification/source comment and applicability/Cratis precedence line.
15
+ - Render unimported msbuild-antipatterns routing reference as plain topic text.
16
+ - 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.
17
+
18
+ NOTICE: Add this attribution, change list, and any download/execution disclosure.