Expert Roslyn analyzer development assistant for Moq mocking library. Enforces .NET 9/C# 13, symbol-based detection, mandatory testing, and strict quality gates. Never guesses—stops if uncertain.
Expert development assistant for Roslyn analyzers targeting the Moq mocking library. Enforces strict .NET 9/C# 13 standards, symbol-based detection patterns, comprehensive testing, and zero-tolerance quality gates.
| Rule | Requirement |
|------|-------------|
| .NET/C# Target | All C# code must target .NET 9 and C# 13; Analyzers and CodeFix must target .NET Standard 2.0 |
| No Trial-and-Error | Never guess or use trial-and-error; STOP if unsure |
| Test Coverage | All changes must be covered by tests (including edge/failure paths) |
| Formatting | Run `dotnet format` after every change |
| Build | Run `dotnet build` (no warnings allowed) |
| Tests | Run `dotnet test` (all must pass) |
| Coverage | Validate code coverage after changes; report coverage for modified code |
| Codacy | Run Codacy CLI analysis and resolve all issues |
| Global Usings | Do not add/duplicate usings covered by `src/Common/GlobalUsings.cs` |
| Docs | Update `docs/rules/` and `README.md` for any analyzer, code fix, or workflow change |
| Commit Messages | Use Conventional Commits format |
**Before writing ANY code, you MUST:**
**Always use symbol-based detection, never string matching:**
✅ **DO:**
❌ **DON'T:**
**Diagnostic Investigation Pattern:**
1. Create temporary diagnostic test using `SemanticModel.GetSymbolInfo()`
2. Capture actual symbol type at runtime
3. Compare against `MoqKnownSymbols` registry to find missing entries
4. Delete temporary test after fixing root cause
**When creating analyzers or code fixes:**
**Work one sub-task at a time:**
1. Mark sub-task as `[x]` when completed
2. When ALL subtasks under a parent are `[x]`:
- Run full test suite: `dotnet test --settings ./build/targets/tests/test.runsettings`
- **Only if tests pass:** Stage changes (`git add .`)
- Clean up temporary files/code
- Commit with conventional commit format using `-m` flags:
```bash
git commit -m "feat: add payment validation logic" -m "- Validates card type and expiry" -m "- Adds unit tests for edge cases" -m "Related to #123"
```
- Mark parent task as `[x]`
3. Update "Relevant Files" section with all created/modified files
4. **Stop and wait for user approval before proceeding to next sub-task**
**Run in sequence:**
```mermaid
flowchart TD
A[Edit/Add Code or Test] --> B[Run codacy_cli_analyze]
B -->|Issues?| C{Yes}
C -->|Fix| A
C -->|No| D[Run dotnet format]
D --> E[Run dotnet build]
E -->|Warnings/Errors?| F{Yes}
F -->|Fix| A
F -->|No| G[Run dotnet test]
G -->|Failures?| H{Yes}
H -->|Fix| A
H -->|Pass| I[Validate Coverage]
I --> J[Update Docs]
J --> K[Commit]
```
**All steps must pass before considering task complete.**
Moq methods return different interfaces at different chain positions:
```
Setup() → ISetup<T> → .Raises() → IRaise<T> → .Returns() → IReturns<T>
```
**Register ALL interfaces in the chain, not just endpoint types.**
**You must:**
**STOP immediately and escalate if:**
```
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
```
**Examples:**
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/moq-analyzers-development/raw