agentleFS
LiLittleCatLiLittleCat/jetbrains-changelist-commit-skill/SKILL.md

jetbrains-changelist-commit

Skill0 starsChanged 6 months agoMITView on GitHub

Use when creating a git commit in a JetBrains project (one containing .idea/workspace.xml), when the user asks to commit a specific or default ChangeListManager list, or when local uncommitted files from other changelists must stay out of the commit.

1 other project uses a version of this, 1 of them edited.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 1

    1. LiLittleCat/skills★ 050% same

    Wrote their own version · 0

    None found.

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. About 0 are common, 6 are distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Prefer the bundled PowerShell runner on Windows or the POSIX shell runner on Linux/macOS.

    line 29
  2. Distinctive:

    If the user supplied a message, use it exactly.

    line 32
  3. Very specific:

    If the selected JetBrains changelist has a non-empty comment, use that comment.

    line 33
  4. Very specific:

    If there is no useful history, use a concise Conventional Commits message such as feat(scope): summary, fix(scope): summary, feat: summary, …

    line 35
  5. Distinctive:

    Run the same runner with the commit message to stage and commit only those paths.

    line 36
  6. Very specific:

    If only Windows PowerShell 5.1 is available, substitute powershell -ExecutionPolicy Bypass for pwsh.

    line 50
  7. Very specific:

    Use --repo <path> when working outside the target repository.

    line 66
  8. Very specific:

    Use --list <name-or-id> when the user names a specific JetBrains changelist.

    line 68
  9. Very specific:

    Use both afterPath and beforePath so additions, edits, deletes, and renames are handled.

    line 92
  10. Distinctive:

    Add selected changelist paths to the temporary index.

    line 94
  11. Distinctive:

    Update the real Git index only for selected paths that were not already indexed with their worktree content.

    line 96
  12. Very specific:

    When the default changelist has no <change> entries, run a dry-run with --list <name-or-id> only when the user intended a different …

    line 109
  13. Distinctive:

    After a successful commit, verify the committed file list:

    line 113

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

JetBrains Changelist Commit

Overview

AI coding agents commit too eagerly. A bare git add . or git commit -a sweeps in unrelated local work — debug prints, half-finished experiments, files belonging to a different task — anything the working tree happens to hold. JetBrains IDEs already solve this on the human side: developers carefully group commit-worthy files into named ChangeListManager lists in .idea/workspace.xml, and unrelated edits live in other lists.

This skill makes the agent trust that grouping. It reads the selected changelist, commits those paths through a temporary Git index, and honors IDEA's per-line ownership data when LineStatusTrackerManager records multiple changelists in the same file. The result: the agent commits exactly the selected changelist's files and line ranges.

When to Use

  • The repository has .idea/workspace.xml with a ChangeListManager component.
  • The user asks the agent to commit "the changelist", "the default changelist", or a named JetBrains changelist.
  • Local uncommitted files exist that should NOT be in this commit (other changelists, scratch edits, debug code).

When NOT to Use

  • No .idea/workspace.xml (non-JetBrains project) — fall back to standard git workflow.
  • The user explicitly wants git add . / commit-everything semantics.
  • The intended commit scope is a path or glob the user named, not a changelist — use git add <pathspec> directly.

Workflow

  1. Locate the repository root with git rev-parse --show-toplevel.
  2. Prefer the bundled PowerShell runner on Windows or the POSIX shell runner on Linux/macOS. Run it in dry-run mode to read .idea/workspace.xml, select the <component name="ChangeListManager"> list with default="true" (or the named list), and print the paths plus any line ranges.
  3. Review the printed paths against the user's intended commit scope.
  4. Choose the commit message:
    • If the user supplied a message, use it exactly.
    • If the selected JetBrains changelist has a non-empty comment, use that comment.
    • Otherwise, inspect recent history with git log --oneline -20 and match the repository's commit message style.
    • If there is no useful history, use a concise Conventional Commits message such as feat(scope): summary, fix(scope): summary, feat: summary, or fix: summary.
  5. Run the same runner with the commit message to stage and commit only those paths.
  6. Report the commit hash and the paths included.

Commands

From any directory inside the repository, prefer the native runner for the platform.

Windows / PowerShell:

pwsh -File <skill-dir>\scripts\commit_changelist.ps1 -DryRun
pwsh -File <skill-dir>\scripts\commit_changelist.ps1 -Message "feat: concise message"

If only Windows PowerShell 5.1 is available, substitute powershell -ExecutionPolicy Bypass for pwsh.

Linux or macOS / POSIX shell:

sh <skill-dir>/scripts/commit_changelist.sh --dry-run
sh <skill-dir>/scripts/commit_changelist.sh -m "feat: concise message"

Python is available as an additional runner:

python3 <skill-dir>/scripts/commit_changelist.py --dry-run
python3 <skill-dir>/scripts/commit_changelist.py -m "feat: concise message"

Use --repo <path> when working outside the target repository.

Use --list <name-or-id> when the user names a specific JetBrains changelist. The default behavior uses the list marked default="true".

PowerShell equivalents:

-Repo <path>
-List <name-or-id>

Shell equivalents match the Python flags:

--repo <path>
--list <name-or-id>

Script Behavior

scripts/commit_changelist.ps1, scripts/commit_changelist.sh, and the optional fallback scripts/commit_changelist.py:

  • Read .idea/workspace.xml.
  • Extract direct <change> children from the selected changelist.
  • Extract matching LineStatusTrackerManager ranges for selected files.
  • Expand $PROJECT_DIR$ to the Git repository root.
  • Use both afterPath and beforePath so additions, edits, deletes, and renames are handled.
  • Build the commit from a temporary Git index seeded from HEAD.
  • Add selected changelist paths to the temporary index.
  • For files split across changelists, write a blob made from HEAD plus only the selected line ranges.
  • Update the real Git index only for selected paths that were not already indexed with their worktree content. Index entries for other changelists are never touched.

Side effect: if a selected path was partially staged (e.g. via git add -p) before running this skill, the real index for that path may be rewritten after the commit. For shared files with IDEA line ranges, the real index is updated to the committed selected-range blob and the remaining worktree edits stay visible.

Common Mistakes

  • Skipping the dry-run step and committing the wrong scope.
  • Passing the commit message to --list (it expects a changelist name or id, not a message).
  • Running the skill in a repo without .idea/workspace.xml and expecting it to fall back to git add . — it will exit with an error instead.
  • Assuming an empty default changelist means "commit everything". It means there is nothing to commit from that list; the skill exits with code 2 and prints an explanation to stderr.

Handling Empty Lists

When the default changelist has no <change> entries, run a dry-run with --list <name-or-id> only when the user intended a different changelist. If the intended changelist is empty, stop and report that there are no files to commit from that changelist.

Verification

After a successful commit, verify the committed file list:

git show --name-only --pretty=format: <commit>
git status --porcelain=v1

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.