Simplify the worktree-claim.sh source-control plugin code

Open Beginner friendly
#14,830 6 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
67/100
Issue type
Refactor
Clarity
Clearly specified
Activity status
Active
Tech stack
bash, git, shell
Domain
tooling

Research direction

Start with plugins/source-control/scripts/worktree-claim.sh and review it against the four checks named in the issue: helper reuse, simplification, efficiency, and abstraction. Preserve its outputs, exit codes, written files, printed text, flags, and exported names; the issue does not identify specific tests, so inspect relevant callers or checks before editing. Done means the listed script is shorter and clearer with unchanged behavior, and the source-control changelog fragment has the specified ### Changed entry.

Written by the indexing model from the issue text.

Description

Agent Brief

Type: Task
Summary: Simplify these 1 files without changing their behavior (part of the /simplify epic).

Current behavior:
The files below work as they do on main. Their code changes; what they do does not.

Desired behavior:
Review the files through /simplify's four checks (reuse of existing helpers, simplification, efficiency, right level of abstraction), using subagents if useful, and apply the fixes. The files end up shorter and clearer, and whatever runs them gets the same results.

Files:

  • plugins/source-control/scripts/worktree-claim.sh

Key interfaces:

  • Outputs, exit codes, written files and printed messages of these files: unchanged.
  • Command-line flags, exported names and anything another file calls: unchanged.

Acceptance criteria:

  • Behavior is unchanged: same outputs, exit codes, written files, printed text, command-line flags and exported names; no listed file renamed, moved or deleted.
  • The diff edits only the listed files, the lines of a test that assert on them when the change breaks that assertion, and changelog fragments.
  • The pull request stays within 400 changed lines and 15 hand-edited files (generated shared copies and changelog fragments not counted); anything beyond goes under ## Follow-ups in the pull request body.
  • ci-status is green.
  • Each touched plugin (source-control) has a fragment from scripts/new-changelog-fragment.sh <plugin> patch whose body is ### Changed and the line "Internal simplification, no behavior change."

Out of scope:

  • Moving code between files or deduping across them: the sub-epic's restructuring pass does that after these chunks merge.
  • Tests beyond the asserted lines a change breaks, eval cases, fixtures, and skill and agent text.
  • Files listed in other chunks.
  • These eval and fixture files, which read the listed files' names, flags or printed text; the behavior rule keeps them accurate:
    • plugins/source-control/evals/worktree-enter-runs-claim-gate/graders/claim-gate-ran.md
Dominant language
Shell
Stars
22
Forks
2
Avg merge
1h 5m
Merged PRs (30d)
969

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from melodic-software/claude-code-plugins

All issues in melodic-software/claude-code-plugins

Similar issues

More Shell/Bash issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.