C#/.NET Janitor
Perform janitorial tasks on C#/.NET code including cleanup, modernization, and tech debt remediation.
- Type
- Subagent
- Repository
- github/awesome-copilot
- GitHub stars
- 39.4k
- License
- MIT
- Repo last updated
- Sep 27, 2026
- Source file
- agents/csharp-dotnet-janitor.agent.md
What C#/.NET Janitor is
C#/.NET Janitor is a subagent published in the github/awesome-copilot repository on GitHub, which has about 39.4k stars. The repository describes itself as: “Community-contributed instructions, agents, skills, and configurations to help you make the most of GitHub Copilot.”
A subagent is a specialist assistant that Claude can hand part of a task to. It is a markdown file whose frontmatter sets a name, a description that tells Claude when to delegate, and optionally the tools and model it may use; the body becomes the subagent's own system prompt.
Because a subagent works in its own context, it keeps the main conversation focused: Claude can send a narrow job, such as a review or a specialised analysis, to C#/.NET Janitor and get back a compact result.
How to install C#/.NET Janitor
Claude Code
- Download csharp-dotnet-janitor.agent.md from the repository.
- Save it to ~/.claude/agents/ to use it in every project, or to .claude/agents/ inside one project to share it through version control.
- Claude Code watches these folders, so the subagent is usually available right away. Ask Claude to use it by name, or @-mention it to make sure it runs.
Claude Cowork
- Cowork loads subagents through plugins. If the repository is packaged as a plugin marketplace, add it under Customize → Plugins → Add marketplace and install the plugin that contains this subagent.
- Otherwise, bundle the file into your own plugin's agents/ folder and upload it from Customize → Plugins.
New to extending Cowork? Our plugins guide and Customize guide explain how skills, plugins, and connectors fit together.
Inside the source file
An excerpt from agents/csharp-dotnet-janitor.agent.md, shared under the repository's MIT license. Read the full file on GitHub.
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 and Memory 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
- Validate Changes: Run tests after each modification
- Incremental Updates: Make small, focused changes
- Preserve Behavior: Maintain existing functionality
- Follow Conventions: Apply consistent coding standards
- Safety First: Backup before major refactoring
Analysis Order
- Scan for compiler warnings and errors
- Identify deprecated/obsolete usage
- Check test coverage gaps
- Review performance bottlenecks
- Assess documentation completeness
Apply changes systematically, testing after each modification.
Before you install
- Read the whole file first. Skills, commands, and subagents are instructions Claude will follow, so make sure they match what you want.
- Check which tools, scripts, or MCP servers it uses. Local servers and scripts run with your permissions.
- Try it in a test project or a copy of your files before pointing it at real work.
- Pin the version you tested, and review changes before updating.
- Watch for instructions that fetch web content or run shell commands; those are where prompt injection risks start. See our prompt injection guide.
FAQ
What is C#/.NET Janitor?
C#/.NET Janitor is a subagent for Claude Code and Claude Cowork from the github/awesome-copilot repository on GitHub. Perform janitorial tasks on C#/.NET code including cleanup, modernization, and tech debt remediation.
How do I install C#/.NET Janitor in Claude Code?
Download csharp-dotnet-janitor.agent.md from the repository. Save it to ~/.claude/agents/ to use it in every project, or to .claude/agents/ inside one project to share it through version control. Claude Code watches these folders, so the subagent is usually available right away. Ask Claude to use it by name, or @-mention it to make sure it runs.
Can I use C#/.NET Janitor in Claude Cowork?
Cowork loads subagents through plugins. If the repository is packaged as a plugin marketplace, add it under Customize → Plugins → Add marketplace and install the plugin that contains this subagent. Otherwise, bundle the file into your own plugin's agents/ folder and upload it from Customize → Plugins.
Is C#/.NET Janitor safe to install?
It is a third-party community resource, not reviewed by Anthropic or this site. Read the source file first, check which tools and connectors it uses, and install only from sources you trust.
Similar resources
- RUG Pure orchestration agent that decomposes requests, delegates all work to subagents, validates outcomes, and repeats until complete. Subagent · github/awesome-copilot
- Rust Mcp Development Build high-performance Model Context Protocol servers in Rust using the official rmcp SDK with async/await, procedural macros, and… Plugin · github/awesome-copilot
- Rug Agentic Workflow Three-agent workflow for orchestrated software delivery with an orchestrator plus implementation and QA subagents. Plugin · github/awesome-copilot
- Rust MCP Expert Expert assistant for Rust MCP server development using the rmcp SDK with tokio async runtime Subagent · github/awesome-copilot
- CAST Imaging Impact Analysis Agent Specialized agent for comprehensive change impact assessment and risk analysis in software systems using CAST Imaging Subagent · github/awesome-copilot
- C# MCP Server Expert Expert assistant for developing Model Context Protocol (MCP) servers in C# Subagent · github/awesome-copilot
- CAST Imaging Software Discovery Agent Specialized agent for comprehensive software application discovery and architectural mapping through static code analysis using CAST Imaging Subagent · github/awesome-copilot
- C++ Expert Provide expert C++ software engineering guidance using modern C++ and industry best practices. Subagent · github/awesome-copilot