Skip to content

Comments

feat/docs: Enhance AI Agent Integration, Refactor Documentation, and Improve CLI Usability#12

Merged
jher235 merged 12 commits intodevelopfrom
docs/add-md-file
Feb 15, 2026
Merged

feat/docs: Enhance AI Agent Integration, Refactor Documentation, and Improve CLI Usability#12
jher235 merged 12 commits intodevelopfrom
docs/add-md-file

Conversation

@jher235
Copy link
Owner

@jher235 jher235 commented Feb 15, 2026

📝 Description

This Pull Request introduces a significant set of enhancements aimed at making JFocus more powerful and user-friendly, especially for AI agent integration. It includes a comprehensive overhaul of the documentation, a core functional change to improve AI agent compatibility, and several CLI usability improvements.

The documentation has been refined to meet senior engineering standards, translated for a global audience, and now includes detailed guidance for AI agents. A key functional change switches the default output to stdout, aligning JFocus with standard Unix tooling and AI agent workflows, while retaining clipboard functionality via a new flag.

✨ What does this PR do?

  • Documentation Overhaul & Localization:

    • Global Audience & Professional Tone: The README.ko.md has been translated into a new README.md (English) with a professional, senior engineering tone, ensuring clarity and accessibility for a global audience.
    • Refined Content: Both README.ko.md and README.md have been refined based on expert feedback. This includes strengthening the introduction with a problem-solving tagline, clarifying technical details like AST 'Symbol Resolution', and adding qualitative results ("Reduced Hallucination") to the benchmarks section.
    • Language Switchers: Added [🇰🇷 Korean | 🇺🇸 English] language switchers to both README files for easy navigation between versions.
  • Enhanced AI Agent Integration:

    • Dedicated Integration Rules: New configuration rules have been added to guide AI agents (e.g., Cursor, Windsurf) on how to autonomously and effectively use JFocus.
    • Mandated Usage Pattern: AI agents are now mandated to use jfocus <file> <method> for precise context extraction, preventing inefficient full-file reading.
    • "Trust Model" Established: A "Trust Model" has been defined, treating JFocus output as the single source of truth for AI agents, ensuring reliable and focused context.
    • Comprehensive AI Guide: A detailed guide document has been created to help AI agents and users understand optimal JFocus strategies, define efficient analysis workflows (emphasizing not reading the entire file), and explain CLI syntax, options (-c, -v), and examples.
  • CLI Usability & AI Compatibility Improvements:

    • Default Output to Stdout: The default behavior for JFocus output has been switched from clipboard copy to stdout. This significantly improves compatibility with AI agents (like Cursor and Windsurf) and enables seamless integration with Unix pipelines.
    • New -c (--copy) Flag: A new -c or --copy flag has been introduced to explicitly support clipboard copying for human users who prefer this functionality.
    • Removed -p (--print) Flag: The -p (--print) flag has been removed as printing to stdout is now the default behavior.
    • JFocus Alias Script: An alias script has been added to simplify the installation and usage of JFocus, allowing users to easily set up the jfocus command.

Summary by CodeRabbit

  • New Features

    • CLI now offers a clipboard-copy option (--copy) for output instead of the old print toggle.
    • Windows installer automates PATH configuration; Unix/macOS installer automates adding a shell alias and RC file updates.
  • Documentation

    • Added comprehensive READMEs (English and Korean) with installation, usage, examples, benchmarks, troubleshooting, and contributor/licensing info.
    • Added usage guide and integration rules for AI-agent workflows.

-  Changed default behavior from clipboard copy to stdout.
- Remove `-p` (`--print`) flag as printing is now the default.
- Add `-c` (`--copy`) flag to support clipboard copying for human users.
- Improve compatibility with AI agents (Cursor, Windsurf) and Unix pipelines.
- Create a detailed guide document to help AI agents and users understand JFocus strategies.
- Define optimal analysis workflow (Do NOT read entire file).
- Explain CLI syntax, options (-c, -v), and examples.
- Add configuration rules for AI agents (e.g., Cursor, Windsurf) to autonomously use JFocus.
- Mandate usage of `jfocus <file> <method>` over full-file reading.
- Establish "Trust Model" treating JFocus output as the single source of truth.
…dards

- Translate `README.ko.md` to English (`README.md`) with a professional senior engineer tone.
- Add language switchers ([🇰🇷 Korean | 🇺🇸 English]) to both files.
- Refine `README.ko.md` based on expert feedback:
  - Strengthen intro with problem-solving tagline.
  - Clarify AST 'Symbol Resolution' technical details.
  - Add qualitative results ("Reduced Hallucination") to benchmarks.
@jher235 jher235 self-assigned this Feb 15, 2026
@coderabbitai
Copy link

coderabbitai bot commented Feb 15, 2026

Warning

Rate limit exceeded

@jher235 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 10 minutes and 21 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📝 Walkthrough

Walkthrough

Adds comprehensive English and Korean documentation and AI-agent guidance, automates installer scripts to configure PATH/alias, and changes the CLI to use a copy-to-clipboard flag instead of the previous print flag.

Changes

Cohort / File(s) Summary
Documentation - READMEs & Guides
src/README.md, src/README.ko.md, src/main/java/com/jher235/jfocus/docs/jfocus.md, src/main/java/com/jher235/jfocus/docs/rules.md
Added extensive project and agent-facing documentation: installation (auto/manual), usage examples, output format, AI agent rules/trust model, troubleshooting, and contributor notes. No code/API signature changes.
Installer Scripts - Automation
src/scripts/install.sh, src/scripts/install.ps1
Replaced manual post-install instructions with automated RC/PATH handling: detects shell RC file, backs up and appends alias (or creates RC), checks writability, updates User PATH on PowerShell, and prints next-step messages.
CLI - Clipboard Output
src/main/java/com/jher235/jfocus/cli/JFocusCli.java
Replaced -p/--print behavior with -c/--copy and added a copyToClipboard field; output now branches to clipboard copy or stdout. Minor formatting/flow readability edits.
Docs in-code
src/main/java/com/jher235/jfocus/docs/...
New in-repo guidance files for tool usage and agent integration; plain docs additions without code changes.

Sequence Diagram(s)

(omitted)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐇📜
I hopped through READMEs by lantern-light,
Tucked aliases snug, set PATHs just right,
With a clipboard clutched in my tiny paw,
Two tongues of docs — a neat little law,
Hooray, the rabbit cheers the code tonight!

🚥 Pre-merge checks | ✅ 3 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately captures the main changes: documentation enhancements, AI agent integration improvements, and CLI usability improvements through the copy-to-stdout flag swap.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into develop

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch docs/add-md-file

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 7

🤖 Fix all issues with AI agents
In `@src/main/java/com/jher235/jfocus/docs/rules.md`:
- Around line 1-15: README.md's inline .cursorrules block and rules.md are out
of sync: the README includes a "Trust Model" section (item "Trust Model") that
is missing from src/main/java/com/jher235/jfocus/docs/rules.md, which will
produce an incomplete .cursorrules if users copy rules.md verbatim. Fix by
making rules.md the single source of truth: add the missing "Trust Model"
section content from README.md into rules.md (ensuring the section header and
items match the README's wording), then change README.md to reference rules.md
for the .cursorrules content instead of duplicating it (or replace the inline
block with a short pointer to rules.md); ensure references to ".cursorrules"
remain consistent.

In `@src/README.ko.md`:
- Around line 307-353: The outer markdown code fence in README.ko.md around the
ContextExtractor examples is closed prematurely by inner ```java fences; update
the outer fence to use a longer fence (e.g., ````markdown) or switch to an
alternate fence style (e.g., ~~~markdown) so the inner ```java blocks (shown
around ContextExtractor.extractContext() and extractRecursive()) do not
terminate it; ensure all occurrences for the ContextResult/DependencyResolver
examples keep matching fence counts.
- Around line 365-393: Update the broken relative link and relocate the
misplaced bullet: change the link target
`src/main/java/com/jher235/jfocus/docs/rules.md` (inside the "1. `.cursorrules`
설정" block) to the correct `docs/rules.md`, and move the `jfocus <file> <method>`
bullet currently under the "Trust Model" section into the "Command Usage"
section so it appears alongside other command examples; refer to the "Trust
Model" and "Command Usage" headings and the `jfocus <file> <method>` bullet to
locate the text to modify.

In `@src/README.md`:
- Around line 304-351: The README's example uses a fenced ```markdown block that
contains an inner ```java fenced block which breaks rendering; update the outer
fence to a higher-count fence (e.g., ````markdown) or replace the outer fenced
block with an HTML <pre><code> section so the inner ```java block remains
intact, ensuring the code snippets for the extractContext(MethodDeclaration),
extractRecursive(...), and DependencyResolver example render correctly.
- Around line 360-388: Update the `.cursorrules` block in README.md to fix the
broken relative link and move the misplaced command: change the href
`src/main/java/com/jher235/jfocus/docs/rules.md` to
`main/java/com/jher235/jfocus/docs/rules.md` so the link resolves correctly, and
relocate the line `jfocus <file> <method> : Extracts context for the method.`
from the "Trust Model" section into the "Command Usage" section (replacing the
`...` placeholder) so command usage items are grouped together; ensure the block
still contains the other `jfocus` examples and the Trust Model only contains
trust-related bullets.
- Around line 15-24: The Table of Contents links contain an extra leading hyphen
in each fragment (e.g., "#-introduction", "#-benchmarks", "#-features",
"#-installation", "#-usage", "#-for-ai-agents-cursor-windsurf",
"#-contributing", "#-license"); edit the TOC entries under "## 📝 Table of
Contents" to remove the leading hyphen from every link fragment so they match
GitHub's generated anchors (e.g., change "#-introduction" to "#introduction",
"#-for-ai-agents-cursor-windsurf" to "#for-ai-agents-cursor-windsurf", etc.).

In `@src/scripts/install.sh`:
- Around line 70-81: The RC detection logic incorrectly prefers
$BASH_VERSION/$ZSH_VERSION causing piped installs (curl | bash) to always pick
bash; update the logic in the install script to consult the login shell first
(use $SHELL with the existing case pattern) before falling back to
$ZSH_VERSION/$BASH_VERSION checks, e.g., move the case "$SHELL" block ahead of
the version checks and only use $BASH_VERSION/$ZSH_VERSION as a secondary
heuristic; ensure the variable RC_FILE is set to "$HOME/.zshrc" for zsh shells
and "$HOME/.bashrc" for bash shells using the existing symbols RC_FILE, $SHELL,
$ZSH_VERSION, and $BASH_VERSION.
🧹 Nitpick comments (1)
src/scripts/install.sh (1)

92-94: Minor: date called twice could yield different filenames at midnight boundary.

The backup filename (line 93) and the printed message (line 94) each invoke date independently. Store it in a variable instead.

Proposed fix
+               BACKUP_SUFFIX=$(date +%Y%m%d)
-               cp "$RC_FILE" "$RC_FILE.backup-$(date +%Y%m%d)"
-               echo "📦 Created backup: $RC_FILE.backup-$(date +%Y%m%d)"
+               cp "$RC_FILE" "$RC_FILE.backup-$BACKUP_SUFFIX"
+               echo "📦 Created backup: $RC_FILE.backup-$BACKUP_SUFFIX"

- Update `rules.md` to include the 'Trust Model' section as requested by code review.
- Remove duplicate rules content from `README.md` and link to `rules.md` instead.
- Ensure consistency between documentation and actual agent instructions.
Refactored
- This ensures that users running the one-liner via curl | bash will have the jfocus alias correctly appended to their actual login shell's config file (e.g., .zshrc) instead of being incorrectly defaulted to .bashrc.
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@src/README.ko.md`:
- Around line 299-301: The heading "### 📄 출력 결과 예시 (Output Example)" is
indented and won't render as a Markdown heading; remove the leading whitespace
before that heading so the line starts with "###" (i.e., change the line
containing "### 📄 출력 결과 예시 (Output Example)" to have no leading spaces) to
ensure it renders correctly.

In `@src/README.md`:
- Around line 296-298: The "### 📄 Output Example" heading in the README is
indented and therefore won't render as a Markdown heading; edit the README to
remove the leading whitespace so the line beginning with "### 📄 Output Example"
starts at column 1 (no leading spaces or tabs) so Markdown parsers will render
it as a proper heading.
🧹 Nitpick comments (1)
src/scripts/install.sh (1)

92-97: Minor: date is invoked twice, producing potentially different filenames.

On line 96 the backup is created with one date +%Y%m%d invocation, and on line 97 a different invocation is echoed to the user. At a day boundary these could differ. Trivial in practice, but capturing the value once is cleaner.

Proposed fix
+               BACKUP_SUFFIX="$(date +%Y%m%d)"
-               cp "$RC_FILE" "$RC_FILE.backup-$(date +%Y%m%d)"
-               echo "📦 Created backup: $RC_FILE.backup-$(date +%Y%m%d)"
+               cp "$RC_FILE" "$RC_FILE.backup-$BACKUP_SUFFIX"
+               echo "📦 Created backup: $RC_FILE.backup-$BACKUP_SUFFIX"

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@src/README.ko.md`:
- Around line 15-24: The TOC links currently use fragments with a leading hyphen
(e.g. "#-소개", "#-효과-benchmarks", "#-주요-기능", "#-설치-방법", "#-사용-방법", "#-기여하기",
"#-라이선스") which won't resolve on GitHub; update each entry in the TOC to remove
the leading hyphen so they read "#소개", "#효과-benchmarks", "#주요-기능", "#설치-방법",
"#사용-방법", "#for-ai-agents-cursor-windsurf" (if present), "#기여하기", and "#라이선스" to
match the actual anchor IDs of the headings.

In `@src/README.md`:
- Around line 145-147: The Windows PowerShell README section ("#### Windows
(PowerShell)") contains a sentence fragment; change "Can be executed without
administrator privileges." to a complete sentence such as "This script can be
executed without administrator privileges." and keep the following sentence
about PATH behavior intact so the two lines read clearly together.

- Update SHA256 checksums in `install.sh` and `install.ps1` for the latest build.
- Fix logic in `install.sh` to correctly detect user shell (zsh/bash) when piped via curl.
@jher235 jher235 merged commit 34db10e into develop Feb 15, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant