|
| 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." |
0 commit comments