C#/.NET Janitor
C#/.NET Janitor是一款code方向的AI技能,核心价值是Perform janitorial tasks on C#/,可用于解决开发者在code领域的实际问题,帮助用户提升效率、自动化重复任务或优化工作流。
Perform janitorial tasks on C#/.NET code including cleanup, modernization, and tech debt remediation.
mkdir -p ./skills/csharp-dotnet-janitor && curl -sfL https://raw.githubusercontent.com/github/awesome-copilot/main/skills/csharp-dotnet-janitor/SKILL.md -o ./skills/csharp-dotnet-janitor/SKILL.md Run in terminal / PowerShell. Requires curl (Unix) or PowerShell 5+ (Windows).
Skill Content
# C#/.NET Janitor
Perform janitorial tasks on C#/.NET codebases. Focus on code cleanup, modernization, and technical debt remediation.
Core Tasks
Code Modernization
- Update to latest C# language features and syntax patterns
- Replace obsolete APIs with modern alternatives
- Convert to nullable reference types where appropriate
- Apply pattern matching and switch expressions
- Use collection expressions and primary constructors
Code Quality
- Remove unused usings, variables, and members
- Fix naming convention violations (PascalCase, camelCase)
- Simplify LINQ expressions and method chains
- Apply consistent formatting and indentation
- Resolve compiler warnings and static analysis issues
Performance Optimization
- Replace inefficient collection operations
- Use `StringBuilder` for string concatenation
- Apply `async`/`await` patterns correctly
- Optimize memory allocations and boxing
- Use `Span<T>` and `Memory<T>` where beneficial
Test Coverage
- Identify missing test coverage
- Add unit tests for public APIs
- Create integration tests for critical workflows
- Apply AAA (Arrange, Act, Assert) pattern consistently
- Use FluentAssertions for readable assertions
Documentation
- Add XML documentation comments
- Update README files and inline comments
- Document public APIs and complex algorithms
- Add code examples for usage patterns
Documentation Resources
Use `microsoft.docs.mcp` tool to:
- Look up current .NET best practices and patterns
- Find official Microsoft documentation for APIs
- Verify modern syntax and recommended approaches
- Research performance optimization techniques
- Check migration guides for deprecated features
Query examples:
- "C# nullable reference types best practices"
- ".NET performance optimization patterns"
- "async await guidelines C#"
- "LINQ performance considerations"
Execution Rules
1. **Validate Changes**: Run tests after each modification
2. **Incremental Updates**: Make small, focused changes
3. **Preserve Behavior**: Maintain existing functionality
4. **Follow Conventions**: Apply consistent coding standards
5. **Safety First**: Backup before major refactoring
Analysis Order
1. Scan for compiler warnings and errors
2. Identify deprecated/obsolete usage
3. Check test coverage gaps
4. Review performance bottlenecks
5. Assess documentation completeness
Apply changes systematically, testing after each modification.
🎯 Best For
- Claude users
- GitHub Copilot users
- Software engineers
- Development teams
- Tech leads
💡 Use Cases
- Code quality improvement
- Best practice enforcement
📖 How to Use This Skill
- 1
Install the Skill
Copy the install command from the Terminal tab and run it. The SKILL.md file downloads to your local skills directory.
- 2
Load into Your AI Assistant
Open Claude or GitHub Copilot and reference the skill. Paste the SKILL.md content or use the system prompt tab.
- 3
Apply C#/.NET Janitor to Your Work
Open your project in the AI assistant and ask it to apply the skill. Start with a small module to verify the output quality.
- 4
Review and Refine
Review AI suggestions before committing. Run tests, check for regressions, and iterate on the skill output.
❓ Frequently Asked Questions
Is C#/.NET Janitor compatible with Cursor and VS Code?
Yes — this skill works with any AI coding assistant including Cursor, VS Code with Copilot, and JetBrains IDEs.
Do I need specific dependencies for C#/.NET Janitor?
Check the install command and Works With section. Most code skills only require the AI assistant and your codebase.
How do I install C#/.NET Janitor?
Copy the install command from the Terminal tab and run it. The skill downloads to ./skills/csharp-dotnet-janitor/SKILL.md, ready to use.
Can I customize this skill for my team?
Absolutely. Edit the SKILL.md file to add team-specific instructions, examples, or workflows.
⚠️ Common Mistakes to Avoid
Skipping validation
Always test AI-generated code changes, even for simple refactors.
Missing dependency updates
Check if the skill requires updated dependencies or new packages.