luigidemasi opened a new issue, #64:
URL: https://github.com/apache/camel-kit/issues/64

   > Imported from 
[luigidemasi/camel-kit#108](https://github.com/luigidemasi/camel-kit/issues/108),
 opened by [luigidemasi](https://github.com/luigidemasi) on 2026-06-25.
   > Closed by 
[luigidemasi/camel-kit#113](https://github.com/luigidemasi/camel-kit/pull/113), 
merged on 2026-06-25.
   
   ---
   
   ## Description
   
   `DefaultGenerator` currently handles several responsibilities in one class: 
command stub generation, skill copying, dispatch block injection, version 
placeholder substitution, trait application, MCP config rendering, and generic 
template/resource copying.
   
   This makes generator behavior harder to extend safely, especially for 
agent-specific differences. For example, `GeminiGenerator` has hardcoded 
command dispatch metadata that overlaps with the workflow manifest, and 
generator changes can accidentally affect unrelated concerns.
   
   Relevant files:
   - 
`camel-kit-core/src/main/java/io/github/luigidemasi/camelkit/generator/DefaultGenerator.java`
   - 
`camel-kit-core/src/main/java/io/github/luigidemasi/camelkit/generator/GeminiGenerator.java`
   - 
`camel-kit-core/src/main/java/io/github/luigidemasi/camelkit/generator/ClaudeGenerator.java`
   - 
`camel-kit-core/src/main/java/io/github/luigidemasi/camelkit/generator/BobGenerator.java`
   - `camel-kit-core/src/main/resources/workflow/camel-kit-workflow.yaml`
   
   ## Expected Behavior
   
   Generation should be split into small services with clear responsibilities.
   
   Suggested components:
   
   - `CommandStubGenerator`
   - `SkillResourceInstaller`
   - `DispatchBlockAppender`
   - `TraitApplicator`
   - `McpConfigGenerator`
   - `VersionPlaceholderResolver`
   - `TemplateResourceCopier`
   
   `DefaultGenerator` should orchestrate these services rather than 
implementing all behaviors directly.
   
   ## Additional Context
   
   The refactor should preserve generated output unless a separate intentional 
behavior change is made. Existing generator tests should be used as regression 
coverage.
   
   A good implementation strategy is to extract one responsibility at a time 
while keeping public generator behavior unchanged.
   
   ## Acceptance Criteria
   
   - `DefaultGenerator` is reduced to orchestration-level logic.
   - Extracted services have focused unit tests where practical.
   - Existing agent generators continue producing the same expected files.
   - Existing generator tests pass without weakening assertions.
   - No generated command surface changes unless explicitly reflected in the 
workflow manifest and tests.
   
   ## Validation
   
   Run:
   
   `./mvnw -pl camel-kit-core 
-Dtest='*GeneratorTest,ResourceConsistencyTest,WorkflowManifestTest' test 
-Dformat.skip=true`
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to