Skip to content

chore(agents): Improve perf-tuning command and exclude worktrees from biome#1284

Merged
yamadashy merged 3 commits intomainfrom
chore/improve-perf-tuning-command
Mar 21, 2026
Merged

chore(agents): Improve perf-tuning command and exclude worktrees from biome#1284
yamadashy merged 3 commits intomainfrom
chore/improve-perf-tuning-command

Conversation

@yamadashy
Copy link
Copy Markdown
Owner

@yamadashy yamadashy commented Mar 21, 2026

Improve the perf-tuning agent command and fix a biome configuration issue.

perf-tuning command improvements

  • Reduce parallel investigation agents from 10 to 5 to avoid diminishing returns
  • Add explicit partitioning step before spawning so each agent investigates a distinct, non-overlapping scope
  • Clarify memory optimization targets: peak memory reduction, memory leak fixes
  • Add startup time reduction as an investigation target (easy to overlook for CLI tools)

biome configuration fix

  • Exclude .claude/worktrees from biome lint scope to prevent "Found a nested root configuration" errors caused by worktree checkouts containing their own biome.json

Checklist

  • Run npm run test
  • Run npm run lint

Open with Devin

yamadashy and others added 3 commits March 21, 2026 23:57
…overage

Reduce parallel agents from 10 to 5 and add explicit partitioning step
before spawning to prevent overlapping investigation. Also clarify memory
optimization scope to include peak memory reduction and memory leak fixes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Prevents nested biome.json files in worktrees from causing
"Found a nested root configuration" errors during linting.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
CLI tools benefit from fast cold starts, and this is easy to overlook
during performance investigation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 21, 2026

⚡ Performance Benchmark

Latest commit:f8c060e
Status:✅ Benchmark complete!
Ubuntu:2.54s (±0.03s) → 2.58s (±0.05s) · +0.04s (+1.6%)
macOS:1.45s (±0.11s) → 1.56s (±0.27s) · +0.10s (+7.2%)
Windows:2.98s (±0.04s) → 2.97s (±0.03s) · -0.01s (-0.2%)
Details
  • Packing the repomix repository with node bin/repomix.cjs
  • Warmup: 2 runs (discarded)
  • Measurement: 10 runs / 20 on macOS (median ± IQR)
  • Workflow run

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 21, 2026

📝 Walkthrough

Walkthrough

Updates the performance tuning prompt to refocus on memory consumption reduction and restructure the agent investigation process from 10 parallel agents to 5 scoped agents. Configures Biome to exclude the .claude/worktrees directory from processing.

Changes

Cohort / File(s) Summary
Performance Tuning Guidance
.agents/commands/code/perf-tuning.md
Revised performance objective wording to emphasize "reduce memory consumption," expanded fair game categories to include peak memory reduction and memory leak fixes, and refactored investigation workflow to define 5 non-overlapping scopes before spawning 5 scoped agents.
Build Configuration
biome.json
Added .claude/worktrees directory exclusion pattern to Biome's file includes list.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes both main changes: improving the perf-tuning command and excluding worktrees from biome configuration.
Description check ✅ Passed The description is comprehensive with detailed explanations of changes, rationale, and completed checklist items matching the repository template.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/improve-perf-tuning-command

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.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refines the perf-tuning agent command's guidelines by optimizing its investigation strategy and broadening its performance targets. Additionally, it addresses a Biome linter configuration issue by excluding specific worktree directories, preventing errors related to nested configurations.

Highlights

  • Perf-tuning agent command: Reduced the number of parallel investigation agents from 10 to 5 to improve efficiency and avoid diminishing returns.
  • Perf-tuning agent command: Introduced an explicit partitioning step before spawning agents, ensuring each investigates a distinct, non-overlapping scope.
  • Perf-tuning agent command: Expanded the memory optimization targets to explicitly include peak memory reduction and memory leak fixes.
  • Perf-tuning agent command: Added startup time reduction as a new investigation target, particularly relevant for CLI tools.
  • Biome configuration: Excluded .claude/worktrees from Biome's linting scope to prevent "Found a nested root configuration" errors.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@claude
Copy link
Copy Markdown
Contributor

claude bot commented Mar 21, 2026

Code Review

Overall: LGTM ✅ — This is a clean, well-scoped PR with sensible improvements.

perf-tuning command (.agents/commands/code/perf-tuning.md)

The changes are solid:

  • Reducing from 10 to 5 agents is a good call — 10 parallel investigation agents likely produce redundant findings and burn tokens for marginal value.
  • Explicit partitioning before spawning is a meaningful improvement. The original version let agents self-organize their scope, which is a recipe for overlap. Requiring non-overlapping scopes upfront is more deterministic.
  • Expanding targets to include peak memory, memory leaks, and startup time makes the command more comprehensive for CLI tool optimization.
Minor suggestion

The instruction text on line 10 is quite dense as a single sentence. Consider breaking it into a numbered list for readability — though this is purely cosmetic and not blocking.

biome.json

Excluding .claude/worktrees is the correct fix for nested biome.json errors from worktree checkouts. The pattern is consistent with the existing exclusion style in the file.

Premortem / Risk Analysis

Scenario Risk Mitigation
Worktree path changes in the future Low The .claude/worktrees path is a Claude Code convention, unlikely to change
5 agents may be too few for very large codebases Low The command already scopes to a single PR; 5 well-partitioned agents should be sufficient. Can always be adjusted later based on usage
Biome glob doesn't match nested paths None Biome's !.claude/worktrees will match the directory and everything under it

No bugs, security concerns, or test coverage gaps — this PR modifies an agent command prompt and a tool config file, neither of which require test changes.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces improvements to the perf-tuning agent command and resolves a Biome configuration issue. The agent command is enhanced with a more structured investigation process and clearer performance targets. The Biome configuration is updated to exclude .claude/worktrees, preventing nested configuration errors. My feedback includes a suggestion to improve the consistency of the glob pattern in the Biome configuration for better maintainability.

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying repomix with  Cloudflare Pages  Cloudflare Pages

Latest commit: f8c060e
Status: ✅  Deploy successful!
Preview URL: https://dddb011d.repomix.pages.dev
Branch Preview URL: https://chore-improve-perf-tuning-co.repomix.pages.dev

View logs

Copy link
Copy Markdown
Contributor

@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.

🧹 Nitpick comments (1)
.agents/commands/code/perf-tuning.md (1)

10-10: Clarify that scopes should be collectively exhaustive, not only non-overlapping.

Line 10 prevents overlap, but it can still leave gaps. Add wording that the 5 scopes must cover the full target surface.

✍️ Suggested wording tweak
-First, define 5 non-overlapping investigation scopes — partition by directory boundaries, cross-cutting concerns (I/O, memory, parallelism, algorithmic complexity, dependency weight), or pipeline stages.
+First, define 5 non-overlapping, collectively exhaustive investigation scopes — partition by directory boundaries, cross-cutting concerns (I/O, memory, parallelism, algorithmic complexity, dependency weight), or pipeline stages.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.agents/commands/code/perf-tuning.md at line 10, Update the sentence that
currently instructs "First, define 5 non-overlapping investigation scopes..." to
require the scopes be both non-overlapping and collectively exhaustive (i.e.,
they must together cover the entire target surface with no gaps); explicitly
state each scope must include an explicit description of what it covers and any
boundaries so agents know the full coverage; keep the rest of the flow (spawn 5
agents, one scope each, synthesize findings) unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.agents/commands/code/perf-tuning.md:
- Line 10: Update the sentence that currently instructs "First, define 5
non-overlapping investigation scopes..." to require the scopes be both
non-overlapping and collectively exhaustive (i.e., they must together cover the
entire target surface with no gaps); explicitly state each scope must include an
explicit description of what it covers and any boundaries so agents know the
full coverage; keep the rest of the flow (spawn 5 agents, one scope each,
synthesize findings) unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f6954edc-52b8-4a2f-b6df-af878fd8d1ca

📥 Commits

Reviewing files that changed from the base of the PR and between c66ec5c and f8c060e.

📒 Files selected for processing (2)
  • .agents/commands/code/perf-tuning.md
  • biome.json

@yamadashy yamadashy merged commit 3d2f17c into main Mar 21, 2026
64 checks passed
@yamadashy yamadashy deleted the chore/improve-perf-tuning-command branch March 21, 2026 15:08
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.18%. Comparing base (642434d) to head (f8c060e).
⚠️ Report is 25 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1284   +/-   ##
=======================================
  Coverage   87.18%   87.18%           
=======================================
  Files         115      115           
  Lines        4324     4324           
  Branches     1002     1002           
=======================================
  Hits         3770     3770           
  Misses        554      554           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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