Add C# reflection-based decomposition strategy#18
Merged
Conversation
Three-phase feature for function-level C# code generation: Phase 1 - Reflection Scanner: - .NET console app (tools/dotnet-reflector/) using MetadataLoadContext to extract type metadata from assemblies without execution - Python tool wrapper (backend/tools/dotnet_reflection.py) with build, reflect, and format_type_map functions - Registered in ToolRegistry (conditional on dotnet CLI availability) Phase 2 - C# Planner Prompt: - New decomposition_strategy "csharp_reflection" in project config - Planner runs reflection, injects type map into planning prompt - Claude generates method-level tasks with typed contracts (target_signature, available_methods, constructor_params) - Falls back to generic planner if reflection fails Phase 3 - Worker Prompt + Assembly: - WorkerInstruction XML prompt in claude_agent.py for csharp_method tasks — constrains AI to output only the method body - Decomposer injects C# context fields and auto-creates assembly tasks (one per class, depends on all method tasks) - Build verification via dotnet build in task_lifecycle.py 40 new tests across 4 test files. 779 total passing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
csharp_reflectiondecomposition strategy that uses .NET Reflection to extract type metadata and generate function-level implementation tasks with typed contractstools/dotnet-reflector/) loads assemblies viaMetadataLoadContextand outputs structured JSON (classes, methods, signatures, properties, constructors)target_signature,available_methods, andconstructor_paramsWorkerInstructionXML prompt constrains AI workers to output only the method body using strictly available methodsdotnet buildFiles changed
tools/dotnet-reflector/(.NET reflector app),backend/tools/dotnet_reflection.py(Python wrapper)planner.py(C# prompt + strategy routing),claude_agent.py(WorkerInstruction),decomposer.py(C# context + assembly tasks),task_lifecycle.py(build verification),container.py(tool_registry → planner),registry.py(register reflector)Test plan
Generated by Claude Code · Claude Opus 4.6