Skip to content

feat: add no-arg multi-repo mode to discover/plan, self-merging Finalize - #20

Merged
c0d3ster merged 2 commits into
mainfrom
feat/multi-repo-discover-plan
Aug 6, 2026
Merged

feat: add no-arg multi-repo mode to discover/plan, self-merging Finalize#20
c0d3ster merged 2 commits into
mainfrom
feat/multi-repo-discover-plan

Conversation

@c0d3ster

@c0d3ster c0d3ster commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • discover.sh/plan.sh now support running with no repo argument, fanning out across every qualifying repo under PROJECT_REPOS_DIR in one interactive session (parallel analysis dispatch, serial per-repo review/approval/finalize) instead of one invocation per repo.
  • Both skills' Finalize phase now merges its own PR (gh pr merge --squash --delete-branch) once you've approved its content, then checks out the default branch and pulls latest — closing the gap where plan couldn't see items discover just found (and overnight couldn't see plan's numbering) until someone merged the PR by hand.
  • .claude/settings.json gains two narrowly-scoped gh pr merge allow rules (chore/tasks-discover-*, chore/tasks-plan-* only) — raw git merge stays denied everywhere, and overnight.sh's task/housekeeping PRs are untouched.
  • README updated: new discover.sh section, expanded plan.sh section, no-arg forms documented, and an explicit Safety model callout for the merge exception and its scope.

Test plan

  • bash -n discover.sh / bash -n plan.sh — syntax valid
  • plan.sh's bash-side TASKS.md gate verified against synthetic repos (open tasks / all-checked / no TASKS.md) — correct qualify/skip behavior
  • --add-dir accepts multiple repeated flags in one claude invocation — verified empirically with a headless test session
  • .claude/settings.json validated as well-formed JSON
  • Live end-to-end run of pnpm discover / pnpm plan against a real multi-repo PROJECT_REPOS_DIR (needs a real target-repo setup to exercise)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Discovery and planning now support multiple repositories in a single run.
    • Added scan modes to process all eligible repositories automatically.
    • Planning keeps task numbering and work details separate for each repository.
    • Approved bookkeeping changes can now be merged automatically, with results reported clearly.
  • Documentation

    • Updated setup, usage, workflow, safety, and merge guidance for the discovery and planning tools.

discover.sh and plan.sh now support running with no repo argument,
fanning out across every repo under PROJECT_REPOS_DIR (or the subset
that qualifies) in one interactive session instead of requiring one
invocation per repo.

- discover.sh (no arg): every repo under PROJECT_REPOS_DIR qualifies
  (no TASKS.md prerequisite), so it attaches the whole directory as
  one --add-dir; the skill enumerates repo subdirectories itself.
- plan.sh (no arg): bash filters to repos with a TASKS.md containing
  unchecked items (same gate overnight.sh's run_repo uses) before
  claude ever launches, then attaches one --add-dir per qualifying
  repo.
- Both skills gained a multi-repo mode: analysis fans out in parallel
  via Agent-tool dispatch (one per repo for discover, one per item
  across all attached repos for plan), then review/approval/write/
  finalize happens serially, one repo at a time, in order.
- Finalize in both skills now merges its own PR (gh pr merge --squash
  --delete-branch) once approved, then checks out the default branch
  and pulls latest. This closes a gap where plan couldn't see items
  discover just found (and overnight couldn't see plan's numbering)
  until someone merged the PR by hand. Scoped narrowly in
  .claude/settings.json to gh pr merge on chore/tasks-discover-*
  and chore/tasks-plan-* branches only -- raw git merge stays denied
  everywhere, and overnight.sh's task/housekeeping PRs are untouched.
- README updated: new discover.sh section, expanded plan.sh section,
  no-arg forms in Scripts/Usage, and an explicit Safety model callout
  for the merge exception and its scope.
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@c0d3ster, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 32 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 46801e9a-bde9-4df6-8803-e2938dcdd959

📥 Commits

Reviewing files that changed from the base of the PR and between a312a30 and 20a82c4.

📒 Files selected for processing (1)
  • .claude/settings.json
📝 Walkthrough

Walkthrough

The scripts now support single- and multi-repository operation. Discovery and planning skills process repositories with separate state, approval gates, sequential finalization, and approved bookkeeping PR merges. Documentation and Claude permissions describe the new workflows.

Changes

Task workflow expansion

Layer / File(s) Summary
Multi-repository script entry points
discover.sh, plan.sh, README.md
The scripts accept optional repository arguments. No-argument mode scans or targets repositories under PROJECT_REPOS_DIR according to each workflow.
Multi-repository discovery and merging
.claude/skills/discover-tasks/SKILL.md, .claude/settings.json, README.md
Discovery dispatches work across repositories, then approves, writes, finalizes, and merges each repository in sequence. Failed merges remain open without retries.
Multi-repository planning and merging
.claude/skills/plan-tasks/SKILL.md, README.md
Planning isolates repository state, investigates tasks in parallel, and performs approval, numbering, writing, finalization, merging, and branch refresh per repository.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant discover.sh
  participant discover-tasks
  participant plan.sh
  participant plan-tasks
  participant repositories
  participant bookkeeping PRs
  discover.sh->>discover-tasks: start discovery for one or all repositories
  discover-tasks->>repositories: dispatch discovery agents
  plan.sh->>plan-tasks: select repositories with unchecked tasks
  plan-tasks->>repositories: investigate tasks in parallel
  discover-tasks->>bookkeeping PRs: finalize and merge approved discovery changes
  plan-tasks->>bookkeeping PRs: finalize and merge approved planning changes
  bookkeeping PRs->>repositories: refresh default branches after successful merges
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main changes: no-argument multi-repository modes and self-merging during Finalize.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/multi-repo-discover-plan

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.claude/settings.json:
- Around line 26-28: Add narrow allowlist entries in the settings configuration
alongside the existing Bash rules for pushing the chore/tasks-discover-* and
chore/tasks-plan-* branches, and for running git -C * pull:*. Keep the
permissions scoped to these branch patterns and pull command form without
broadening unrelated Git or GitHub operations.

In @.claude/skills/discover-tasks/SKILL.md:
- Around line 55-57: Before the discovery Finalize flow runs gh pr create in
.claude/skills/discover-tasks/SKILL.md (lines 55-57), run the target
repository’s full test suite defined by its CLAUDE.md and do not create the PR
if it fails; apply the same test gate before PR creation in
.claude/skills/plan-tasks/SKILL.md (lines 54-56), while preserving the existing
approval and merge steps.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 3de3f992-37fb-45ca-b8b7-36b581c68822

📥 Commits

Reviewing files that changed from the base of the PR and between 742ee0b and a312a30.

📒 Files selected for processing (6)
  • .claude/settings.json
  • .claude/skills/discover-tasks/SKILL.md
  • .claude/skills/plan-tasks/SKILL.md
  • README.md
  • discover.sh
  • plan.sh

Comment thread .claude/settings.json
Comment thread .claude/skills/discover-tasks/SKILL.md
Finalize in both discover-tasks and plan-tasks pushes chore/tasks-discover-*
/chore/tasks-plan-* branches and runs git -C <repo> pull post-merge, but
neither was in the allowlist -- only overnight/* pushes were. Adds narrow
allow rules for both branch patterns (plain and -C * forms, matching the
existing overnight/* pattern) and for git pull, which doesn't need branch
scoping since it can't push anything.

Flagged by CodeRabbit on #20.
@c0d3ster
c0d3ster merged commit c5040c6 into main Aug 6, 2026
1 check passed
@c0d3ster
c0d3ster deleted the feat/multi-repo-discover-plan branch August 6, 2026 16:36
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