-
Notifications
You must be signed in to change notification settings - Fork 0
Feat: Introduce option and enhance non-interactive overloaded method handling #15
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
Open
jher235
wants to merge
8
commits into
develop
Choose a base branch
from
feat/export-method
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
e03638e
feat: add `--list` option and fail-fast for overloaded methods in non…
jher235 54e97ed
docs: Updated README and rules to document the new `-l` flag and enfo…
jher235 8c4ed8a
chore: update SHA256 checksum for j-focus jar
jher235 e2ec7af
fix: standardize method signature format and fix array parsing bug
jher235 d74fe66
docs: update method signature format and fix typo
jher235 090f988
docs: clarify AI agent rules
jher235 14bf29d
fix: resolve exact signature matching failure in MethodExtractor
jher235 8c6b54c
docs: updated rules & readme to strictly recommend using explicit rel…
jher235 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,18 +3,22 @@ | |
| You have a tool called `jfocus` installed in system PATH. | ||
| When user asks for Java code analysis, refactoring, or explanation: | ||
|
|
||
| 1. **Analysis Strategy**: | ||
| - DO NOT read the entire file content blindly. | ||
| - ALWAYS use `jfocus <file> <method>` to extract the context first. | ||
| - Use `-v` flag ONLY when you need to see dependency implementation details. | ||
| 1. **Analysis Strategy (Tool Selection)**: | ||
| - **For Method-Level Logic:** ALWAYS use `jfocus <file> <method>` to extract the context. This saves tokens and focuses on the specific logic. Use `-v` flag ONLY when you need to see dependency implementation details. | ||
| - **For Class-Level Structure/Fields:** If the user asks about class fields, annotations, or overall architecture, you MAY read the file directly using standard tools (like `cat`), but try to run `jfocus <file> -l` first to grasp the method outline. | ||
|
|
||
| 2. **Command Usage**: | ||
| - `jfocus <file>` : Lists available methods in the file. | ||
| - `jfocus <file> <method>` : Extracts context for the method. | ||
| 2. **Command Usage (CRITICAL)**: | ||
| - **NEVER use `jfocus <file>` without `-l` or a method name.** It triggers an interactive prompt that will cause you (the agent) to hang/timeout. | ||
| - **NEVER use just a class name for the `<file>` argument.** Using just `MyClass` will trigger a "Multiple files found" prompt if duplicates exist. **ALWAYS use a specific relative or absolute path** (e.g., `src/main/java/com/pkg/MyClass.java`). | ||
| - `jfocus <path/to/file.java> -l` : Lists available methods in the file non-interactively. | ||
| - `jfocus <path/to/file.java> <method>` : Extracts context for the method. | ||
| - If JFocus returns a "Multiple overloads found" error, it will also print the exact available signatures. You MUST retry using the EXACT signature. | ||
| - **CRITICAL:** When specifying an exact method signature with parameters (like `void add(int index, E element)`), you MUST wrap the method name in quotes to prevent Bash syntax errors. | ||
| - Correct: `jfocus src/main/java/MyClass.java "void add(int index, E element)"` | ||
| - Incorrect: `jfocus src/main/java/MyClass.java void add(int index, E element)` | ||
|
Comment on lines
+10
to
+18
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Clarify “method name” → “signature” to avoid ambiguity. Line 16 asks to quote the method name, but the examples and intent are about quoting the full signature. ✏️ Proposed doc tweak- - **CRITICAL:** When specifying an exact method signature with parameters (like `void add(int index, E element)`), you MUST wrap the method name in quotes to prevent Bash syntax errors.
+ - **CRITICAL:** When specifying an exact method signature with parameters (like `void add(int index, E element)`), you MUST wrap the entire signature in quotes to prevent Bash syntax errors.🤖 Prompt for AI Agents |
||
|
|
||
| 3. **Trust Model**: | ||
| - Treat JFocus output as the **ONLY source of truth**. | ||
| - Do **NOT** assume missing methods or fields exist. | ||
| - If context seems incomplete, explicitly use `jfocus -v` to check dependencies. | ||
| - When using `jfocus <file> <method>`, treat its output as the source of truth **for that specific method and its dependencies**. | ||
| - However, remember that `jfocus` extracts specific targets; do NOT falsely assume the class lacks fields or other methods just because they are omitted from the targeted output. | ||
|
|
||
| 4. **Execution**: Run the command, assume the output is the ground truth context, and answer based on it. | ||
| 4. **Execution**: Run the command appropriate for the user's intent, analyze the output, and answer based on it. | ||
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix the article before the error name.
Use “a” instead of “an” before “Multiple overloads found.”
✏️ Proposed doc tweak
📝 Committable suggestion
🤖 Prompt for AI Agents