Contributing to ProjGraph
Thank you for your interest in contributing to ProjGraph! This guide will help you get started.
Prerequisites
- .NET 10.0 SDK or later
- DocFX (for documentation):
dotnet tool install -g docfx - A code editor (VS Code or Rider recommended)
Getting Started
# Clone the repository
git clone https://github.com/HandyS11/ProjGraph.git
cd ProjGraph
# Restore dependencies
dotnet restore ProjGraph.slnx
# Build
dotnet build ProjGraph.slnx
# Run tests
dotnet test ProjGraph.slnx
Project Structure
See ARCHITECTURE.md for a detailed overview of the solution structure and design decisions.
Development Workflow
- Create a branch from
developfor your change. - Make your changes with clear, focused commits.
- Add or update tests — all new features and bug fixes should have test coverage.
- Ensure the build passes — the project uses
TreatWarningsAsErrors=trueandEnforceCodeStyleInBuild=true. - Open a pull request against
develop.
Code Style
- The project enforces code style at build time via
EnforceCodeStyleInBuild=true. - XML documentation is required on all public APIs (enforced via
TreatWarningsAsErrors). - Follow existing patterns — use-case classes for new features,
IDiagramRenderer<T>for new output formats.
Running Tests
# All tests
dotnet test ProjGraph.slnx
# Specific test project
dotnet test tests/ProjGraph.Tests.Unit.ClassDiagram
# Specific test class
dotnet test tests/ProjGraph.Tests.Unit.ClassDiagram --filter "ClassAnalysisDepthTests"
Test Organisation
| Project | Purpose |
|---|---|
Tests.Unit.* |
Unit tests per library |
Tests.Integration.Cli |
CLI end-to-end tests |
Tests.Integration.Mcp |
MCP tool integration tests |
Tests.Contract |
MCP contract validation & DI wiring |
Tests.Shared |
Shared helpers (TestDirectory, TestPathHelper) |
Adding a New Feature
- Add domain models to
ProjGraph.Coreif needed. - Implement the feature in the appropriate
Lib.*project following the use-case pattern. - Register services in the library's
DependencyInjection.cs. - Expose via CLI command and/or MCP tool.
- Add tests at the unit and integration levels.
Reporting Issues
Open an issue on GitHub with:
- A clear description of the problem or feature request.
- Steps to reproduce (for bugs).
- Expected vs actual behavior.
Documentation
The project documentation is built with DocFX. Navigation and API configuration is located in the docfx/ directory.
Local Preview
To build and preview the documentation locally, use the provided scripts:
PowerShell (Windows):
./docfx/doc-serve.ps1
Bash (Linux/macOS):
./docfx/doc-serve.sh
These scripts will:
- Verify that DocFX is installed.
- Build the DocFX site.
- Serve it at
http://localhost:8080.
Requirements
- .NET 10.0 SDK
docfxdotnet tool (dotnet tool install -g docfx)
All PRs must pass the documentation build with zero warnings (--warningsAsErrors).