Skip to content

Commit 65d3884

Browse files
committed
Add mcaf-dotnet-resharper-clt skill
1 parent a23c91c commit 65d3884

File tree

8 files changed

+279
-8
lines changed

8 files changed

+279
-8
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ Platform-specific bundles can stay small and still be explicit.
115115
For example, a typical .NET repo baseline can install `mcaf-dotnet` as the entry skill, `mcaf-dotnet-features`, `mcaf-solution-governance`, `mcaf-testing`, exactly one of `mcaf-dotnet-xunit`, `mcaf-dotnet-tunit`, or `mcaf-dotnet-mstest`, plus `mcaf-dotnet-quality-ci`, `mcaf-dotnet-complexity`, `mcaf-solid-maintainability`, `mcaf-architecture-overview`, and `mcaf-ci-cd`.
116116
In that setup, `mcaf-dotnet` knows when to open the more specific .NET skills, the repo-root lowercase `.editorconfig` is the default source of truth for formatting and analyzer severity, and `AGENTS.md` records the exact `dotnet build`, `dotnet test`, `dotnet format`, `analyze`, and coverage commands. Nested `.editorconfig` files are allowed when they serve a clear subtree-specific purpose, such as stricter domain rules, generated-code handling, test-specific conventions, or legacy-code containment.
117117
For .NET code changes, the task is not done when tests are green if the repo also configured formatters, analyzers, coverage, architecture tests, or security gates. Agents should run the repo-defined post-change quality pass before completion.
118-
If the repo standardizes on concrete tools, install the matching tool skills as well. Typical open or free .NET additions include `mcaf-dotnet-format`, `mcaf-dotnet-code-analysis`, `mcaf-dotnet-analyzer-config`, `mcaf-dotnet-stylecop-analyzers`, `mcaf-dotnet-roslynator`, `mcaf-dotnet-meziantou-analyzer`, `mcaf-dotnet-cloc`, `mcaf-dotnet-coverlet`, `mcaf-dotnet-profiling`, `mcaf-dotnet-quickdup`, `mcaf-dotnet-reportgenerator`, `mcaf-dotnet-stryker`, `mcaf-dotnet-netarchtest`, `mcaf-dotnet-archunitnet`, `mcaf-dotnet-semgrep`, and `mcaf-dotnet-csharpier`. `mcaf-dotnet-codeql` stays available, but should be chosen only when its hosting and licensing model fits the repository.
118+
If the repo standardizes on concrete tools, install the matching tool skills as well. Typical open or free .NET additions include `mcaf-dotnet-format`, `mcaf-dotnet-code-analysis`, `mcaf-dotnet-analyzer-config`, `mcaf-dotnet-stylecop-analyzers`, `mcaf-dotnet-roslynator`, `mcaf-dotnet-meziantou-analyzer`, `mcaf-dotnet-cloc`, `mcaf-dotnet-coverlet`, `mcaf-dotnet-profiling`, `mcaf-dotnet-quickdup`, `mcaf-dotnet-reportgenerator`, `mcaf-dotnet-resharper-clt`, `mcaf-dotnet-stryker`, `mcaf-dotnet-netarchtest`, `mcaf-dotnet-archunitnet`, `mcaf-dotnet-semgrep`, and `mcaf-dotnet-csharpier`. `mcaf-dotnet-codeql` stays available, but should be chosen only when its hosting and licensing model fits the repository.
119119

120120
### 2.5 Context Rules
121121

TUTORIAL.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ Add tool-specific .NET skills only when the repo standardizes on them:
151151
- `mcaf-dotnet-profiling`
152152
- `mcaf-dotnet-quickdup`
153153
- `mcaf-dotnet-reportgenerator`
154+
- `mcaf-dotnet-resharper-clt`
154155
- `mcaf-dotnet-roslynator`
155156
- `mcaf-dotnet-semgrep`
156157
- `mcaf-dotnet-stryker`
@@ -187,6 +188,7 @@ The website build generates this list from the actual folders under `skills/`.
187188
- `mcaf-dotnet-quality-ci`[Folder](https://github.com/managedcode/MCAF/blob/main/skills/mcaf-dotnet-quality-ci), [Raw SKILL](https://raw.githubusercontent.com/managedcode/MCAF/main/skills/mcaf-dotnet-quality-ci/SKILL.md)
188189
- `mcaf-dotnet-quickdup`[Folder](https://github.com/managedcode/MCAF/blob/main/skills/mcaf-dotnet-quickdup), [Raw SKILL](https://raw.githubusercontent.com/managedcode/MCAF/main/skills/mcaf-dotnet-quickdup/SKILL.md)
189190
- `mcaf-dotnet-reportgenerator`[Folder](https://github.com/managedcode/MCAF/blob/main/skills/mcaf-dotnet-reportgenerator), [Raw SKILL](https://raw.githubusercontent.com/managedcode/MCAF/main/skills/mcaf-dotnet-reportgenerator/SKILL.md)
191+
- `mcaf-dotnet-resharper-clt`[Folder](https://github.com/managedcode/MCAF/blob/main/skills/mcaf-dotnet-resharper-clt), [Raw SKILL](https://raw.githubusercontent.com/managedcode/MCAF/main/skills/mcaf-dotnet-resharper-clt/SKILL.md)
190192
- `mcaf-dotnet-roslynator`[Folder](https://github.com/managedcode/MCAF/blob/main/skills/mcaf-dotnet-roslynator), [Raw SKILL](https://raw.githubusercontent.com/managedcode/MCAF/main/skills/mcaf-dotnet-roslynator/SKILL.md)
191193
- `mcaf-dotnet-semgrep`[Folder](https://github.com/managedcode/MCAF/blob/main/skills/mcaf-dotnet-semgrep), [Raw SKILL](https://raw.githubusercontent.com/managedcode/MCAF/main/skills/mcaf-dotnet-semgrep/SKILL.md)
192194
- `mcaf-dotnet-stryker`[Folder](https://github.com/managedcode/MCAF/blob/main/skills/mcaf-dotnet-stryker), [Raw SKILL](https://raw.githubusercontent.com/managedcode/MCAF/main/skills/mcaf-dotnet-stryker/SKILL.md)

skills/mcaf-dotnet-quality-ci/references/quality-toolchain.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ These tools are worth adding once the baseline is stable:
4949
| Mutation testing | `Stryker.NET` | `mcaf-dotnet-stryker` | Verifies that tests actually catch faults | Best on libraries and critical domains, not every PR path |
5050
| Architecture tests | `NetArchTest.Rules` | `mcaf-dotnet-netarchtest` | Simple, fluent architectural rules in tests | Good for layered or clean architecture policies |
5151
| Architecture tests | `ArchUnitNET` | `mcaf-dotnet-archunitnet` | Richer architecture assertions across xUnit, MSTest, and TUnit | Heavier than NetArchTest but more expressive |
52+
| Deep inspections and cleanup | `JetBrains ReSharper Command Line Tools` | `mcaf-dotnet-resharper-clt` | Powerful ReSharper inspections plus cleanup profiles in CI or local runs | Free official JetBrains CLI package; keep shared policy in solution `.DotSettings` |
5253
| Security scanning | `Semgrep CE` | `mcaf-dotnet-semgrep` | Fast OSS static analysis across many languages | Community Edition is file/function-scoped for security analysis |
5354
| Security scanning | `CodeQL` | `mcaf-dotnet-codeql` | Deep GitHub-native query-based analysis | Open ecosystem with private-repo hosting caveats |
5455
| Opinionated formatter | `CSharpier` | `mcaf-dotnet-csharpier` | Fast one-style formatter for C# and XML | Use only if the repo wants a formatter owner beyond `dotnet format` |
@@ -93,7 +94,7 @@ Use the exact commands from `AGENTS.md`. The usual checked-in flow is:
9394
4. focused `test`
9495
5. broader `test`
9596
6. `coverage` and report generation when configured
96-
7. extra configured gates such as Roslynator, StyleCop, Meziantou, architecture tests, Semgrep, CodeQL, CSharpier, or Stryker
97+
7. extra configured gates such as Roslynator, StyleCop, Meziantou, ReSharper CLT, architecture tests, Semgrep, CodeQL, CSharpier, or Stryker
9798

9899
Run only the gates the repo actually enabled.
99100

@@ -138,6 +139,9 @@ dotnet stryker
138139
- [Stryker.NET](https://github.com/stryker-mutator/stryker-net)
139140
- [NetArchTest](https://github.com/BenMorris/NetArchTest)
140141
- [ArchUnitNET](https://github.com/TNG/ArchUnitNET)
142+
- [ReSharper command line tools](https://www.jetbrains.com/help/resharper/ReSharper_Command_Line_Tools.html)
143+
- [CleanupCode](https://www.jetbrains.com/help/resharper/CleanupCode.html)
144+
- [InspectCode](https://www.jetbrains.com/help/resharper/InspectCode.html)
141145
- [CodeQL code scanning](https://docs.github.com/en/code-security/code-scanning/introduction-to-code-scanning/about-code-scanning-with-codeql)
142146
- [Semgrep](https://github.com/semgrep/semgrep)
143147
- [CSharpier](https://github.com/belav/csharpier)
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
---
2+
name: mcaf-dotnet-resharper-clt
3+
description: "Use the free official JetBrains ReSharper Command Line Tools for .NET repositories. Use when a repo wants powerful `jb inspectcode` inspections, `jb cleanupcode` cleanup profiles, solution-level `.DotSettings` enforcement, or a stronger CLI quality gate for C# than the default SDK analyzers alone."
4+
compatibility: "Requires a .NET solution or project; works best when the repo keeps shared ReSharper settings in solution `.DotSettings` files and records exact commands in `AGENTS.md`."
5+
---
6+
7+
# MCAF: .NET ReSharper CLT
8+
9+
## Trigger On
10+
11+
- the repo uses or wants ReSharper Command Line Tools
12+
- the team wants `jb inspectcode` or `jb cleanupcode`
13+
- the user asks for stronger C# inspections, cleanup profiles, or ReSharper-based CI gates
14+
15+
## Value
16+
17+
- produce a concrete project delta: code, docs, config, tests, CI, or review artifact
18+
- reduce ambiguity through explicit planning, verification, and final validation skills
19+
- leave reusable project context so future tasks are faster and safer
20+
21+
## Do Not Use For
22+
23+
- replacing tests with inspection output
24+
- ad-hoc formatting-only work when the repo intentionally standardizes on another formatter
25+
- repos that do not want JetBrains settings or CLT-based gates in their workflow
26+
27+
## Inputs
28+
29+
- the nearest `AGENTS.md`
30+
- the target `.sln`, `.csproj`, or bounded file set
31+
- repo-root `.editorconfig`
32+
- solution shared settings such as `YourSolution.sln.DotSettings`
33+
34+
## Quick Start
35+
36+
1. Read the nearest `AGENTS.md` and confirm scope and constraints.
37+
2. Run this skill's `Workflow` through the `Ralph Loop` until outcomes are acceptable.
38+
3. Return the `Required Result Format` with concrete artifacts and verification evidence.
39+
40+
## Workflow
41+
42+
1. Prefer solution-level runs when possible so ReSharper can resolve references and apply full inspections.
43+
2. Build the solution before `jb cleanupcode` when working at solution scope.
44+
3. Use `jb inspectcode` first to surface issues before editing anything broad.
45+
4. Treat surfaced issues as mandatory fixes when this gate is enabled for the repo; do not just dump a report and stop.
46+
5. Use `jb cleanupcode` with an explicit cleanup profile:
47+
- `Built-in: Full Cleanup`
48+
- `Built-in: Reformat Code`
49+
- `Built-in: Reformat & Apply Syntax Style`
50+
- or a checked-in custom profile
51+
6. Keep durable ReSharper settings in the team-shared solution layer and commit the solution `.DotSettings` file when policy changes.
52+
7. Re-run `jb inspectcode` after cleanup or fixes, then run the repo's normal quality pass and tests.
53+
54+
## Bootstrap When Missing
55+
56+
If ReSharper Command Line Tools are not available yet:
57+
58+
1. Detect current state:
59+
- `rg --files -g '.config/dotnet-tools.json' -g '*.sln.DotSettings'`
60+
- `dotnet tool list --local`
61+
- `dotnet tool list --global`
62+
- `command -v jb`
63+
2. Choose the install path deliberately:
64+
- preferred repo-local install for reproducible CI:
65+
- `dotnet new tool-manifest` (if missing)
66+
- `dotnet tool install JetBrains.ReSharper.GlobalTools`
67+
- global fallback:
68+
- `dotnet tool install --global JetBrains.ReSharper.GlobalTools`
69+
3. Verify the installed commands resolve correctly:
70+
- `jb inspectcode --help`
71+
- `jb cleanupcode --help`
72+
4. Record exact commands in `AGENTS.md`, for example:
73+
- `dotnet build MySolution.sln -c Release`
74+
- `jb inspectcode MySolution.sln -o=artifacts/inspectcode.sarif`
75+
- `jb cleanupcode MySolution.sln --profile="Built-in: Full Cleanup"`
76+
5. If the repo needs stable settings, save them into the solution team-shared layer and commit `YourSolution.sln.DotSettings`.
77+
6. Run `jb inspectcode` once, fix or triage the surfaced issues, rerun it, and return `status: configured` or `status: improved`.
78+
7. If the repo intentionally excludes ReSharper CLT from its toolchain, return `status: not_applicable`.
79+
80+
## Deliver
81+
82+
- explicit `jb inspectcode` and `jb cleanupcode` commands
83+
- durable ReSharper settings in shared solution config
84+
- a quality gate that surfaces issues which are then fixed, not ignored
85+
86+
## Validate
87+
88+
- the target solution or project builds before solution-wide cleanup
89+
- `jb inspectcode` output is reviewed and acted on
90+
- cleanup profiles and shared settings are explicit
91+
- tests and the wider quality pass still run after ReSharper-driven fixes
92+
93+
## Ralph Loop
94+
95+
Use the Ralph Loop for every task, including docs, architecture, testing, and tooling work.
96+
97+
1. Plan first (mandatory):
98+
- analyze current state
99+
- define target outcome, constraints, and risks
100+
- write a detailed execution plan
101+
- list final validation skills to run at the end, with order and reason
102+
2. Execute one planned step and produce a concrete delta.
103+
3. Review the result and capture findings with actionable next fixes.
104+
4. Apply fixes in small batches and rerun the relevant checks or review steps.
105+
5. Update the plan after each iteration.
106+
6. Repeat until outcomes are acceptable or only explicit exceptions remain.
107+
7. If a dependency is missing, bootstrap it or return `status: not_applicable` with explicit reason and fallback path.
108+
109+
### Required Result Format
110+
111+
- `status`: `complete` | `clean` | `improved` | `configured` | `not_applicable` | `blocked`
112+
- `plan`: concise plan and current iteration step
113+
- `actions_taken`: concrete changes made
114+
- `validation_skills`: final skills run, or skipped with reasons
115+
- `verification`: commands, checks, or review evidence summary
116+
- `remaining`: top unresolved items or `none`
117+
118+
For setup-only requests with no execution, return `status: configured` and exact next commands.
119+
120+
## Load References
121+
122+
- read `references/resharper-clt.md` first
123+
124+
## Example Requests
125+
126+
- "Add ReSharper CLI inspections to this .NET repo."
127+
- "Run InspectCode and fix what it finds."
128+
- "Set up CleanupCode with a shared profile."
129+
- "Use JetBrains ReSharper command line tools in CI."
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
# JetBrains ReSharper Command Line Tools
2+
3+
## What This Skill Uses
4+
5+
This skill standardizes on the free official JetBrains package `JetBrains.ReSharper.GlobalTools`, exposed through the `jb` command.
6+
7+
Primary commands:
8+
9+
- `jb inspectcode`
10+
- `jb cleanupcode`
11+
12+
Use this skill when the repo intentionally wants stronger ReSharper inspections and cleanup than the default SDK analyzers alone.
13+
14+
## Official Docs
15+
16+
- ReSharper Command Line Tools:
17+
- https://www.jetbrains.com/help/resharper/ReSharper_Command_Line_Tools.html
18+
- CleanupCode:
19+
- https://www.jetbrains.com/help/resharper/CleanupCode.html
20+
- InspectCode:
21+
- https://www.jetbrains.com/help/resharper/InspectCode.html
22+
23+
## Installation Paths
24+
25+
Preferred repo-local install for reproducible CI:
26+
27+
```bash
28+
dotnet new tool-manifest
29+
dotnet tool install JetBrains.ReSharper.GlobalTools
30+
dotnet tool restore
31+
```
32+
33+
Global fallback:
34+
35+
```bash
36+
dotnet tool install --global JetBrains.ReSharper.GlobalTools
37+
```
38+
39+
Verify the commands:
40+
41+
```bash
42+
jb inspectcode --help
43+
jb cleanupcode --help
44+
```
45+
46+
## Shared Settings
47+
48+
If the repo uses ReSharper CLI as a real gate, keep durable settings in the solution team-shared layer and commit the resulting file:
49+
50+
- `YourSolution.sln.DotSettings`
51+
52+
This is where cleanup profiles and many inspection settings become durable for the rest of the team.
53+
54+
Do not rely on user-specific settings files for repo policy.
55+
56+
## InspectCode
57+
58+
Use `InspectCode` to surface problems that must then be fixed.
59+
60+
Basic run:
61+
62+
```bash
63+
jb inspectcode YourSolution.sln -o=artifacts/inspectcode.sarif
64+
```
65+
66+
Important details from the official docs:
67+
68+
- starting with ReSharper 2024.1, SARIF is the default output format
69+
- XML is still available through `-f="xml"`
70+
- output path is controlled through `-o` or `--output`
71+
72+
Examples:
73+
74+
```bash
75+
jb inspectcode YourSolution.sln -o=artifacts/inspectcode.sarif
76+
jb inspectcode YourSolution.sln -f=Html -o=artifacts/inspectcode.html
77+
jb inspectcode YourSolution.sln -f=Xml -o=artifacts/inspectcode.xml
78+
```
79+
80+
Use `InspectCode` before and after cleanup or code fixes so you can prove the issue count actually moved in the right direction.
81+
82+
## CleanupCode
83+
84+
Use `CleanupCode` to apply a selected cleanup profile over a solution, project, or bounded file set.
85+
86+
Solution-wide run:
87+
88+
```bash
89+
jb cleanupcode YourSolution.sln --profile="Built-in: Full Cleanup"
90+
```
91+
92+
Focused reformat-only run:
93+
94+
```bash
95+
jb cleanupcode YourSolution.sln --profile="Built-in: Reformat Code"
96+
```
97+
98+
Useful profile options from the official docs:
99+
100+
- `Built-in: Full Cleanup`
101+
- `Built-in: Reformat Code`
102+
- `Built-in: Reformat & Apply Syntax Style`
103+
104+
Useful scope controls:
105+
106+
- `--include`
107+
- `--exclude`
108+
109+
Example:
110+
111+
```bash
112+
jb cleanupcode YourSolution.sln --profile="Built-in: Reformat & Apply Syntax Style" --include="src/**/*.cs"
113+
```
114+
115+
Important official note:
116+
117+
- build the solution first when running solution-wide cleanup, otherwise binary references may not resolve correctly
118+
119+
## Recommended Flow
120+
121+
1. Build the solution in `Release`.
122+
2. Run `jb inspectcode`.
123+
3. Fix or clean up the surfaced issues.
124+
4. Run `jb cleanupcode` with an explicit profile.
125+
5. Run `jb inspectcode` again.
126+
6. Run the repo's analyzers and tests.
127+
128+
## Gate Policy
129+
130+
If the repo enables ReSharper CLI as a quality gate:
131+
132+
- surfaced issues are not informational only
133+
- the task is not done while the agreed blocking issues remain
134+
- cleanup must be followed by tests and broader verification
135+
136+
Do not stop at generating a SARIF file.

skills/mcaf-dotnet/SKILL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ compatibility: "Requires a .NET solution or project; respects root and local `AG
5454
- `mcaf-dotnet-quality-ci`
5555
- `mcaf-dotnet-analyzer-config`
5656
- `mcaf-dotnet-complexity`
57-
- tool-specific skills such as `mcaf-dotnet-format`, `mcaf-dotnet-roslynator`, `mcaf-dotnet-stylecop-analyzers`, `mcaf-dotnet-meziantou-analyzer`, `mcaf-dotnet-coverlet`, `mcaf-dotnet-reportgenerator`, `mcaf-dotnet-netarchtest`, `mcaf-dotnet-archunitnet`, `mcaf-dotnet-semgrep`, `mcaf-dotnet-codeql`, `mcaf-dotnet-csharpier`, and `mcaf-dotnet-stryker`
57+
- tool-specific skills such as `mcaf-dotnet-format`, `mcaf-dotnet-roslynator`, `mcaf-dotnet-stylecop-analyzers`, `mcaf-dotnet-meziantou-analyzer`, `mcaf-dotnet-coverlet`, `mcaf-dotnet-reportgenerator`, `mcaf-dotnet-resharper-clt`, `mcaf-dotnet-netarchtest`, `mcaf-dotnet-archunitnet`, `mcaf-dotnet-semgrep`, `mcaf-dotnet-codeql`, `mcaf-dotnet-csharpier`, and `mcaf-dotnet-stryker`
5858
4. Route design and structure through:
5959
- `mcaf-solid-maintainability` for SOLID, SRP, cohesion, and maintainability limits
6060
- `mcaf-architecture-overview` when system or module boundaries, contracts, or architecture docs need work
@@ -67,7 +67,7 @@ compatibility: "Requires a .NET solution or project; respects root and local `AG
6767
- focused `test`
6868
- broader `test`
6969
- `coverage` and report generation when configured
70-
- extra configured gates such as Roslynator, StyleCop, Meziantou, NetArchTest, ArchUnitNET, Semgrep, CodeQL, CSharpier, or Stryker
70+
- extra configured gates such as Roslynator, StyleCop, Meziantou, ReSharper CLT, NetArchTest, ArchUnitNET, Semgrep, CodeQL, CSharpier, or Stryker
7171
7. If the repo does not define these commands clearly, tighten `AGENTS.md` before continuing so later agents stop guessing.
7272
8. Do not introduce preview language features unless the repo explicitly opts into preview in project or MSBuild settings.
7373

skills/mcaf-dotnet/references/skill-routing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Use `mcaf-dotnet` as the entry skill when a task spans more than one .NET concer
1414
| .NET quality gates, analyzer stack, coverage, mutation, or security gate selection | `mcaf-dotnet-quality-ci` |
1515
| repo-root `.editorconfig` authoring and analyzer severity ownership | `mcaf-dotnet-analyzer-config` |
1616
| complex methods, maintainability metrics, and coupling thresholds | `mcaf-dotnet-complexity` |
17-
| one concrete tool such as Roslynator, StyleCop, Coverlet, ReportGenerator, Semgrep, or CSharpier | the exact tool skill |
17+
| one concrete tool such as Roslynator, StyleCop, Coverlet, ReportGenerator, ReSharper CLT, Semgrep, or CSharpier | the exact tool skill |
1818
| SOLID-driven refactors and maintainability-limit enforcement | `mcaf-solid-maintainability` |
1919
| architecture map or boundary documentation | `mcaf-architecture-overview` |
2020
| architecture rules in executable tests | `mcaf-dotnet-netarchtest` or `mcaf-dotnet-archunitnet` |

0 commit comments

Comments
 (0)