agentleFS
drinkspillerdrinkspiller/skills/merge-latest/SKILL.md

merge-latest

Skill1 starsChanged 6 days agoUnlicenseView on GitHub

Merge the latest upstream changes into the current branch, resolve conflicts, and verify builds, tests, and lint. Auto-discovers the VCS (Git, Fig/Hg, JJ) and project toolchain from the working directory.

The file

Show its rules and text

We split this skill into the rules it gives an agent

14 rules. About 0 are common, 8 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    If Git: proceed with Git steps.

    line 21
  2. Distinctive:

    If Fig/Mercurial: proceed with Fig steps.

    line 22
  3. Distinctive:

    If JJ (Jujutsu): proceed with JJ steps.

    line 23
  4. Distinctive:

    If none found, stop and ask the user to navigate to a repository.

    line 24
  5. Very specific:

    Git: Run gh repo view --json defaultBranchRef --jq '.defaultBranchRef.name' and fall back to main.

    line 27
  6. Very specific:

    Prefer pnpm over npm if pnpm-lock.yaml exists.

    line 45
  7. Distinctive:

    Prefer the local (HEAD/ours) side for feature work.

    line 72
  8. Very specific:

    After resolving all files, stage and commit: git add -A && git commit --no-edit.

    line 74
  9. Very specific:

    Run the appropriate install command from the toolchain table (e.g., pnpm install, cargo fetch, go mod download).

    line 79
  10. Very specific:

    Run each applicable step from the detected toolchain.

    line 117
  11. Distinctive:

    Tests: Run the test command for the detected toolchain.

    line 120
  12. Very specific:

    Lint (with auto-fix): Run the lint command. For Fig, use hg lint.

    line 121
  13. Distinctive:

    Build: Run the build command.

    line 122
  14. Distinctive:

    Use ⏭️ for steps that were skipped (no toolchain detected, no lockfile change, etc.).

    line 147

≈ “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

Merge Latest Upstream Changes

// turbo-all

Merge upstream changes into the current branch, resolve any conflicts, then verify the result builds, tests, and passes lint. End by listing any assumptions or follow-up items.

Environment Discovery

  1. Detect VCS by checking for .git/, .hg/, or .jj/ in the current directory or its parents.
    • If Git: proceed with Git steps.
    • If Fig/Mercurial: proceed with Fig steps.
    • If JJ (Jujutsu): proceed with JJ steps.
    • If none found, stop and ask the user to navigate to a repository.
  2. Detect the base branch / upstream target:
    • Git: Run gh repo view --json defaultBranchRef --jq '.defaultBranchRef.name' and fall back to main. Store as $BASE.
    • Fig/Hg: The upstream is the sync target (typically default or the CitC baseline). No explicit base branch needed — hg sync handles it.
    • JJ: The upstream is the trunk bookmark (typically main@origin).
  3. Detect the project toolchain for verification by checking indicator files at the repo root:

    Indicator fileTestLintBuild
    package.jsonnpm test / pnpm testnpm run lint / pnpm lintnpm run build / pnpm build
    Makefilemake testmake lintmake build
    Cargo.tomlcargo testcargo clippycargo build
    go.modgo test ./...golangci-lint rungo build ./...
    BUILD / BUILD.bazelblaze test / bazel testbuildifier -lint=warnblaze build / bazel build
    pyproject.toml / setup.pypytestruff check .(skip)

    Prefer pnpm over npm if pnpm-lock.yaml exists. Only run commands whose indicator files are present. If none are found, skip verification and inform the user.


Part A — Merge Upstream

Git

  1. Fetch origin:

    git fetch origin "$BASE"
  2. Merge into the current branch:

    git merge "origin/$BASE" --no-edit
  3. If merge conflicts occur:

    • List conflicted files with git diff --name-only --diff-filter=U.
    • For each conflict, open the file, read the diff markers (<<<<<<<, =======, >>>>>>>), and resolve by keeping the intent of both sides. Prefer the local (HEAD/ours) side for feature work; prefer upstream (theirs) for dependency bumps, lockfile regeneration, and CI config.
    • After resolving all files, stage and commit: git add -A && git commit --no-edit.
  4. Install dependencies (if lockfile changed):

    Run the appropriate install command from the toolchain table (e.g., pnpm install, cargo fetch, go mod download). Skip if no lockfile was modified.

Fig / Mercurial

  1. Sync the workspace:

    hg sync
  2. If rebase conflicts occur:

    • List conflicted files with hg resolve --list.
    • Open each unresolved file (U-marked), read the conflict markers, and resolve the same way as the Git conflict strategy.
    • Mark resolved: hg resolve --mark <file>.
    • Continue the rebase: hg rebase --continue.

JJ (Jujutsu)

  1. Fetch and rebase:

    jj git fetch
    jj rebase -d "main@origin"
  2. If rebase conflicts occur:

    • List conflicts with jj status.
    • Resolve each conflict, then jj squash or jj resolve as appropriate.

Part B — Verification

Run each applicable step from the detected toolchain. Pipe output through tail -40 to keep logs manageable.

  1. Tests: Run the test command for the detected toolchain.
  2. Lint (with auto-fix): Run the lint command. For Fig, use hg lint.
  3. Build: Run the build command.

If any step fails: Present the errors clearly and ask whether to fix now or continue.

For Fig/Google3 workspaces with modified files under packages that have test targets: identify changed files with hg diff --stat -r .^, discover test targets with blaze query 'tests(//path/to:all)', and run blaze test on affected targets.


Part C — Summary

  1. Report results. Present a concise table (omit rows for steps that don't apply to the detected VCS/toolchain):

    AreaStepStatus
    Upstream mergeorigin/$BASE → <branch>✅ / ⚠️ / ⏭️
    Dependency synclockfile install✅ / ⏭️
    Tests<test command>✅ / ❌ / ⏭️
    Lint (fix)<lint command>✅ / ❌ / ⏭️
    Build<build command>✅ / ❌ / ⏭️

    Use ⏭️ for steps that were skipped (no toolchain detected, no lockfile change, etc.).

  2. List assumptions and follow-ups. Note every conflict resolution choice, any skipped or auto-resolved files, lockfile regeneration decisions, and anything else that warrants the user's attention. Ask any questions that require follow-up input.

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.