一键导入
csharpener
C# static analysis tool for call graphs, unused code detection, impact analysis, HTML documentation generation, and Graphviz diagram export
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
C# static analysis tool for call graphs, unused code detection, impact analysis, HTML documentation generation, and Graphviz diagram export
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Rust development patterns for video processing, trait abstractions, error handling, and Linux device interaction
RDBMS access patterns for DuckDB, MySQL (keycloak), PostgreSQL (dw, x3rocs), SQL Server (sage1000, x3), and DBISAM (Exportmaster) using ODBC and native drivers
Elasticsearch 5.2 operations using HTTP API - searching, indexing, bulk operations, scroll API, and alias management
Image manipulation using ImageMagick command-line tools for resizing, converting, optimizing, and batch processing
| name | CSharpener |
| description | C# static analysis tool for call graphs, unused code detection, impact analysis, HTML documentation generation, and Graphviz diagram export |
CSharpener is a Roslyn-based static analysis tool that analyzes C# codebases to build call graphs, identify unused code, and help with refactoring decisions.
Y:\CSharpDLLs\CSharpener\CSharpener.exe
Note: If the Y: drive is not available, the source code can be built from:
dotnet build -c ReleaseCSharpCallGraphAnalyzer\bin\Release\net9.0\win-x64\csharp-analyzer.exePerforms comprehensive analysis including call graph, unused methods, and statistics.
Y:\CSharpDLLs\CSharpener\CSharpener.exe analyze --solution <path> --format console
Options:
--solution, -s (required): Path to .sln or .csproj file--format, -f: Output format (json, console, dot, graphviz, html) [default: json]--output, -o: Output file path (stdout if not specified)--include-call-graph: Include full call graph in output [default: true]--exclude-namespace: Namespaces to exclude from analysisQuickly scans for potentially unused methods with confidence levels.
Y:\CSharpDLLs\CSharpener\CSharpener.exe unused --solution <path> --format console
Options:
--solution, -s (required): Path to .sln or .csproj file--format, -f: Output format (json, console, dot, graphviz) [default: json]--output, -o: Output file path--exclude-namespace: Namespaces to excludeConfidence Levels:
Finds all methods that call a specific method.
Y:\CSharpDLLs\CSharpener\CSharpener.exe callers --solution <path> --method <method-name> --format console
Options:
--solution, -s (required): Path to .sln or .csproj file--method, -m (required): Fully qualified or partial method name to search for--format, -f: Output format [default: json]Example:
Y:\CSharpDLLs\CSharpener\CSharpener.exe callers -s MySolution.sln -m "BuildCallGraphAsync" -f console
Finds all methods that a specific method calls (its dependencies).
Y:\CSharpDLLs\CSharpener\CSharpener.exe dependencies --solution <path> --method <method-name> --format console
Options:
--solution, -s (required): Path to .sln or .csproj file--method, -m (required): Method name to analyze--format, -f: Output format [default: json]Analyzes what would break if you removed a method (safety check before deletion).
Y:\CSharpDLLs\CSharpener\CSharpener.exe impact --solution <path> --method <method-name> --format console
Options:
--solution, -s (required): Path to .sln or .csproj file--method, -m (required): Method to analyze--format, -f: Output format [default: json]Shows:
Generates HTML documentation with cross-referenced code, call graphs, and navigation.
Y:\CSharpDLLs\CSharpener\CSharpener.exe document --solution <path> --output docs/analysis.html
Options:
--solution, -s (required): Path to .sln or .csproj file--output, -o (required): Output HTML file path--include-unused: Include unused methods in documentation--include-tests: Include test projectsUser Request: "Find unused methods in my solution"
Claude Action:
Y:\CSharpDLLs\CSharpener\CSharpener.exe unused --solution "C:\path\to\solution.sln" --format console
Interpretation:
User Request: "What would break if I deleted the ProcessData method?"
Claude Action:
Y:\CSharpDLLs\CSharpener\CSharpener.exe impact --solution "C:\path\to\solution.sln" --method "ProcessData" --format console
Interpretation:
User Request: "Who calls the BuildAsync method?"
Claude Action:
Y:\CSharpDLLs\CSharpener\CSharpener.exe callers --solution "C:\path\to\solution.sln" --method "BuildAsync" --format console
User Request: "Generate HTML documentation for my project"
Claude Action:
Y:\CSharpDLLs\CSharpener\CSharpener.exe document --solution "C:\path\to\solution.sln" --output docs/csharpener-analysis.html
Then open the generated HTML file in a browser.
User Request: "Analyze my solution and show me statistics"
Claude Action:
Y:\CSharpDLLs\CSharpener\CSharpener.exe analyze --solution "C:\path\to\solution.sln" --format console
--exclude-namespace "*.Tests,*.Test" for large solutions.csharpener-cache/ in solution directory (can be deleted to force refresh)unused --solution MySolution.slnimpact --method MethodNamecallers --method Maindependencies --method ProcessRequestanalyze --format dot (use Graphviz to render)document --output review.htmldotnet build first to ensure it compiles--exclude-namespace# Example GitHub Actions workflow
- name: Analyze for unused code
run: |
Y:\CSharpDLLs\CSharpener\CSharpener.exe unused \
--solution MySolution.sln \
--format json \
--output unused-methods.json
- name: Upload results
uses: actions/upload-artifact@v3
with:
name: code-analysis
path: unused-methods.json