@@ -101,62 +101,45 @@ Determine which Enterprise Integration Patterns are needed (e.g., split, aggrega
101101 + "get OpenRewrite recipes, search migration guides, "
102102 + "and produce a migration summary." )
103103 public List <PromptMessage > migrateProject (
104- @ PromptArg (name = "pomContent" , description = "The project's pom.xml file content" ) String pomContent ,
104+ @ PromptArg (name = "pomContent" ,
105+ description = "Optional: project's pom.xml content. If omitted, the LLM uses the pom.xml already in its conversation context." ,
106+ required = false ) String pomContent ,
105107 @ PromptArg (name = "targetVersion" , description = "Target Camel version to migrate to (e.g., 4.18.0)" ,
106108 required = false ) String targetVersion ) {
107109
108110 String versionNote = targetVersion != null && !targetVersion .isBlank ()
109111 ? "Target version: " + targetVersion
110112 : "Target version: latest stable (determine from camel_version_list)" ;
111113
112- String instructions = """
113- You are migrating a Camel project to a newer version.
114-
115- ## %s
116-
117- ## Project pom.xml
118- ```xml
119- %s
120- ```
121-
122- ## Workflow
123-
124- Follow these steps in order:
125-
126- ### Step 1: Analyze the project
127- Call `camel_migration_analyze` with the pom.xml content above.
128- This detects the current runtime, Camel version, Java version, and component dependencies.
129-
130- ### Step 2: Determine target version
131- If no target version was specified, call `camel_version_list` with the detected runtime \
132- to find the latest stable version. For LTS releases, filter with lts=true.
133-
134- ### Step 3: Check compatibility
135- Based on the detected runtime from Step 1:
136- - For **wildfly** or **karaf** runtimes: call `camel_migration_wildfly_karaf` with the pom.xml \
137- content, target runtime, and target version.
138- - For **main**, **spring-boot**, or **quarkus** runtimes: call `camel_migration_compatibility` \
139- with the detected components, current version, target version, runtime, and Java version.
140-
141- Review any blockers (e.g., Java version too old) and warnings.
142-
143- ### Step 4: Get migration recipes
144- Call `camel_migration_recipes` with the runtime, current version, target version, \
145- Java version, and dryRun=true to get the OpenRewrite Maven commands.
146-
147- ### Step 5: Search for breaking changes
148- For each component detected in Step 1, call `camel_migration_guide_search` \
149- with the component name to find relevant breaking changes and rename mappings.
150-
151- ### Step 6: Produce migration summary
152- Present a structured summary:
153- - **Current state**: runtime, Camel version, Java version, component count
154- - **Target state**: target version, required Java version
155- - **Blockers**: issues that must be resolved before migration
156- - **Breaking changes**: component renames, API changes found in guides
157- - **Migration commands**: the OpenRewrite commands from Step 4
158- - **Manual steps**: any changes that OpenRewrite cannot automate
159- """ .formatted (versionNote , pomContent );
114+ String pomNote = pomContent != null && !pomContent .isBlank ()
115+ ? "A pom.xml has been supplied as the `pomContent` argument to this prompt."
116+ : "Use the project's pom.xml from your conversation context." ;
117+
118+ String instructions
119+ = """
120+ You are migrating a Camel project to a newer version.
121+
122+ %s
123+ %s
124+
125+ ## Workflow
126+
127+ 1. **Analyze**: call `camel_migration_analyze` with the pom.xml to detect runtime, \
128+ Camel version, Java version, and component dependencies.
129+ 2. **Target version**: if not specified, call `camel_version_list` with the detected runtime \
130+ (use `lts=true` for LTS releases).
131+ 3. **Compatibility** (based on detected runtime):
132+ - **wildfly** or **karaf**: call `camel_migration_wildfly_karaf` with the pom, target runtime, and target version.
133+ - **main**, **spring-boot**, or **quarkus**: call `camel_migration_compatibility` \
134+ with components, current/target version, runtime, and Java version.
135+ 4. **Recipes**: call `camel_migration_recipes` with runtime, versions, Java version, and `dryRun=true` \
136+ to get the OpenRewrite Maven commands.
137+ 5. **Breaking changes**: for each detected component, call `camel_migration_guide_search` \
138+ to find renames and API changes.
139+ 6. **Summary**: report current state, target state, blockers, breaking changes, \
140+ migration commands, and manual steps that OpenRewrite cannot automate.
141+ """
142+ .formatted (versionNote , pomNote );
160143
161144 return List .of (PromptMessage .withUserRole (instructions ));
162145 }
0 commit comments