-
Notifications
You must be signed in to change notification settings - Fork 0
Add configuration for classdiagram extraction #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
596b4ca
feat: add options to include properties and functions in class diagra…
HandyS11 b2f0bf3
feat: add package icon to ProjGraph CLI and MCP projects
HandyS11 6026710
feat: update command options to specify boolean values for properties…
HandyS11 eefc526
feat: rename filePath parameter to path in McpClassDiagramTests
HandyS11 e02b777
feat: update CommandArgument attribute to make path parameter optional
HandyS11 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| # Specification Quality Checklist: Configure Class Member Visibility | ||
|
|
||
| **Purpose**: Validate specification completeness and quality before proceeding to planning | ||
| **Created**: 2026-02-16 | ||
| **Feature**: [spec.md](../spec.md) | ||
|
|
||
| ## Content Quality | ||
|
|
||
| - [x] No implementation details (languages, frameworks, APIs) | ||
| - [x] Focused on user value and business needs | ||
| - [x] Written for non-technical stakeholders | ||
| - [x] All mandatory sections completed | ||
|
|
||
| ## Requirement Completeness | ||
|
|
||
| - [x] No [NEEDS CLARIFICATION] markers remain | ||
| - [x] Requirements are testable and unambiguous | ||
| - [x] Success criteria are measurable | ||
| - [x] Success criteria are technology-agnostic (no implementation details) | ||
| - [x] All acceptance scenarios are defined | ||
| - [x] Edge cases are identified | ||
| - [x] Scope is clearly bounded | ||
| - [x] Dependencies and assumptions identified | ||
|
|
||
| ## Feature Readiness | ||
|
|
||
| - [x] All functional requirements have clear acceptance criteria | ||
| - [x] User scenarios cover primary flows | ||
| - [x] Feature meets measurable outcomes defined in Success Criteria | ||
| - [x] No implementation details leak into specification | ||
|
|
||
| ## Notes | ||
|
|
||
| - Feature numbered correctly as 004. | ||
| - Clarifications on member grouping and relationship visibility incorporated. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| { | ||
| "name": "GetClassDiagram", | ||
| "description": "Generates a Mermaid class diagram for the types defined in a specific C# file, with options to discover inheritance and related types in the workspace.", | ||
| "parameters": { | ||
| "type": "object", | ||
| "properties": { | ||
| "filePath": { | ||
| "type": "string", | ||
| "description": "Absolute path to the .cs file to analyze." | ||
| }, | ||
| "includeInheritance": { | ||
| "type": "boolean", | ||
| "description": "Whether to search the workspace for base classes and interfaces.", | ||
| "default": false | ||
| }, | ||
| "includeDependencies": { | ||
| "type": "boolean", | ||
| "description": "Whether to search for and include other classes used as properties or fields.", | ||
| "default": false | ||
| }, | ||
| "includeProperties": { | ||
| "type": "boolean", | ||
| "description": "Whether to display properties and fields in the class diagram.", | ||
| "default": true | ||
| }, | ||
| "includeFunctions": { | ||
| "type": "boolean", | ||
| "description": "Whether to display functions/methods in the class diagram.", | ||
| "default": true | ||
| }, | ||
| "depth": { | ||
| "type": "integer", | ||
| "description": "How many levels of relationships to follow.", | ||
| "default": 1 | ||
| }, | ||
| "showTitle": { | ||
| "type": "boolean", | ||
| "description": "Whether to include the title in the diagram.", | ||
| "default": true | ||
| } | ||
| }, | ||
| "required": [ | ||
| "filePath" | ||
| ] | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| # Data Model: Class Member Visibility | ||
|
|
||
| ## Entity: AnalysisOptions (Extension) | ||
|
|
||
| The `AnalysisOptions` class in `ProjGraph.Lib.ClassDiagram` will be extended with the following fields: | ||
|
|
||
| | Field | Type | Default | Description | | ||
| |-------|------|---------|-------------| | ||
| | IncludeProperties | bool | true | When true, includes properties and fields in the type definition. | | ||
| | IncludeFunctions | bool | true | When true, includes methods in the type definition. Constructors are not currently extracted by the analyzer and are out of scope. | | ||
|
|
||
| ## Entity: MemberDefinition (Reference) | ||
|
|
||
| Existing entity in `ProjGraph.Core.Models`. | ||
|
|
||
| | Field | Type | Category mapping | | ||
| |-------|------|------------------| | ||
| | Kind | MemberKind | Property, Field -> "Properties" | | ||
| | Kind | MemberKind | Method -> "Functions" | | ||
|
|
||
| Note: The `MemberKind` enum contains `Field = 0`, `Property = 1`, `Method = 2`. There is no `Constructor` value — constructors are not extracted by `TypeAnalyzer` and are out of scope. | ||
|
|
||
| ## Validation Rules | ||
|
|
||
| 1. Mapping for `MemberKind`: | ||
| - `MemberKind.Property` and `MemberKind.Field` MUST be filtered by `IncludeProperties`. | ||
| - `MemberKind.Method` MUST be filtered by `IncludeFunctions`. | ||
| 2. Discovery Rule: Hiding a property MUST NOT prevent the identification of an Association relationship if the property's type is a local or workspace type. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| # Implementation Plan: Configure Class Member Visibility | ||
|
|
||
| **Branch**: `004-config-class-members` | **Date**: 2026-02-16 | **Spec**: [spec.md](spec.md) | ||
| **Input**: Feature specification from `/specs/004-config-class-members/spec.md` | ||
|
|
||
| ## Summary | ||
|
|
||
| This feature improves the `GetClassDiagram` tool by allowing users to toggle the visibility of class properties and functions. The goal is to provide cleaner, more focused diagrams for large codebases. The technical approach involves extending `AnalysisOptions` in `ProjGraph.Lib.ClassDiagram` and updating `TypeAnalyzer` to filter members before building the model, while maintaining relationship discovery in `TypeProcessor`. | ||
|
|
||
| ## Technical Context | ||
|
|
||
| **Language/Version**: .NET 10.0 (C# 14+) | ||
| **Primary Dependencies**: Microsoft.CodeAnalysis.CSharp (Roslyn), ProjGraph.Lib.Core | ||
| **Storage**: N/A | ||
| **Testing**: xUnit, FluentAssertions | ||
| **Target Platform**: .NET Core (Windows, Linux, macOS) | ||
| **Project Type**: Library/MCP Server | ||
| **Performance Goals**: < 5s for medium-sized workspaces; SC-004: > 50% character reduction in diagrams when members are hidden. | ||
| **Constraints**: MCP 1.0 Compliance, Zero Warnings, Strict SemVer | ||
| **Scale/Scope**: Workspace-wide class analysis and rendering. | ||
|
|
||
| ## Constitution Check | ||
|
|
||
| *GATE: Must pass before Phase 0 research. Re-check after Phase 1 design.* | ||
|
|
||
| - [x] **I. Modern .NET 10 Baseline**: Targeting .NET 10.0+? | ||
| - [x] **II. MCP Native Interoperability**: Tool functionality exposed via MCP? | ||
| - [x] **III. Library-First Core**: Logic in libraries, not just CLI/MCP? | ||
| - [x] **IV. Absolute Testing Requirement**: Tests planned for unit, integration, and MCP contract? | ||
|
|
||
| ## Project Structure | ||
|
|
||
| ### Documentation (this feature) | ||
|
|
||
| ```text | ||
| specs/004-config-class-members/ | ||
| ├── plan.md # This file (/speckit.plan command output) | ||
| ├── research.md # Phase 0 output (/speckit.plan command) | ||
| ├── data-model.md # Phase 1 output (/speckit.plan command) | ||
| ├── quickstart.md # Phase 1 output (/speckit.plan command) | ||
| ├── contracts/ # Phase 1 output (/speckit.plan command - MUST include MCP schema) | ||
| └── tasks.md # Phase 2 output (/speckit.tasks command - NOT created by /speckit.plan) | ||
| ``` | ||
|
|
||
| ### Source Code (repository root) | ||
|
|
||
| ```text | ||
| src/ | ||
| ├── ProjGraph.Core/ # Shared Domain Models (MemberDefinition, MemberKind) | ||
| ├── ProjGraph.Lib.ClassDiagram/ # Core Analysis and Rendering Logic | ||
| └── ProjGraph.Mcp/ # MCP Server interface (Tool parameters) | ||
| ``` | ||
|
|
||
| tests/ | ||
| ├── ProjGraph.Tests.Contract/ # MCP Contract Tests | ||
| ├── ProjGraph.Tests.Integration.Mcp/ # MCP Integration | ||
| └── ProjGraph.Tests.Unit.ClassDiagram/ # Analysis Logic Unit Tests | ||
|
|
||
| **Structure Decision**: Logic primarily resides in `ProjGraph.Lib.ClassDiagram.Application.AnalysisOptions` and `Rendering`. | ||
|
|
||
| ## Complexity Tracking | ||
|
|
||
| > **Fill ONLY if Constitution Check has violations that must be justified** | ||
|
|
||
| | Violation | Why Needed | Simpler Alternative Rejected Because | | ||
| | ----------- | ------------ | ------------------------------------- | | ||
| | [e.g., 4th project] | [current need] | [why 3 projects insufficient] | | ||
| | [e.g., Repository pattern] | [specific problem] | [why direct DB access insufficient] | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| # Quickstart: Configuring Class Member Visibility | ||
|
|
||
| ## Objective | ||
|
|
||
| Generate a class diagram that focuses only on high-level relationships by hiding detailed properties and methods. | ||
|
|
||
| ## Usage with MCP | ||
|
|
||
| To generate a diagram with only classes and their relationships (no members): | ||
|
|
||
| ```json | ||
| { | ||
| "name": "GetClassDiagram", | ||
| "arguments": { | ||
| "filePath": "C:/path/to/YourController.cs", | ||
| "includeProperties": false, | ||
| "includeFunctions": false | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| To see only the behavioral API (methods): | ||
|
|
||
| ```json | ||
| { | ||
| "name": "GetClassDiagram", | ||
| "arguments": { | ||
| "filePath": "C:/path/to/YourService.cs", | ||
| "includeProperties": false, | ||
| "includeFunctions": true | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ## Default Behavior | ||
|
|
||
| If omitted, `includeProperties` and `includeFunctions` default to `true`, providing the same detailed output as before. |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.