Skip to content

Commit 861bafe

Browse files
feat(#121): Enhance logging and update prompts to retain JavaDoc comments (#129)
1 parent 6ba8650 commit 861bafe

File tree

5 files changed

+8
-2
lines changed

5 files changed

+8
-2
lines changed

internal/facilitator/agent.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ func (a *agent) repair(refactored []domain.Class) error {
212212
suggestions := artifacts.Suggestions
213213
a.log.Info("Received %d suggestions from reviewer", len(suggestions))
214214
for _, s := range suggestions {
215-
a.log.Info("Received suggestion: %s", s)
215+
a.log.Info("Received suggestion: %s: %s", s.ClassPath, s.Text)
216216
}
217217
counter := a.frounds
218218
for len(suggestions) > 0 {

internal/prompts/critic/critic.md.tmpl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ Analyze the following Java code:
55
Identify issues such as:
66
* Grammar and spelling mistakes in comments.
77
* Variables that can be inlined or removed.
8-
* Unnecessary comments inside methods.
8+
* Unnecessary comments inside methods, but not javadocs
99
* Redundant code.
1010
* Long methods.
1111
* Complex logic that can be simplified.
1212

13+
Do **not** suggest removing JavaDoc comments.
1314
Do **not** suggest any changes that alter functionality.
1415
Do **not** suggest moving code between files (e.g., extract class or interface).
1516
Do **not** suggest renaming methods or classes.

internal/prompts/facilitator/group.md.tmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Your task:
1010
4. Do **not** change the text of any suggestion.
1111
5. Do **not** explain or comment. Output only the selected suggestions, one per line.
1212
6. Do **not** remove or modify class names in any suggestion.
13+
7. Do **not** suggest removing JavaDoc comments.
1314

1415
Important: Return suggestions exactly as written, without alteration.
1516

internal/prompts/fixer/fix.md.tmpl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ File: {{ .FilePath }}
2020
- Output raw Java — **no** markdown fences, **no** diff markers, **no** comments or explanations.
2121
- Do **not** rename the class. Keep public API names unless a suggestion explicitly requires a change.
2222
- Do **not** remove JavaDoc comments; you may update them to stay accurate.
23+
- Keep JavaDoc comments!
24+
- Do **not** change functionality unless a suggestion explicitly requires it.
25+
- Do **not** remove License comments.
2326
- Preserve the existing package and imports unless a suggestion requires changing them.
2427
- Ensure the result compiles and includes the entire file content from the package line (if any) to the final }.
2528
- Do **not** add external dependencies unless explicitly requested by a suggestion.

internal/prompts/reviewer/review.md.tmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Please suggest specific, actionable steps to fix the problem.
2222
- If there are multiple possible causes, list them in priority order.
2323
- Do not suggest general fixes or unrelated changes.
2424
- Do not suggest new libraries or tools.
25+
- Do not suggesrt removing JavaDoc comments.
2526
- Use single-line suggestions, each starting with a class name followed by a colon and the suggestion text.
2627

2728
Answer in the following format:

0 commit comments

Comments
 (0)