Merged
Conversation
Unified conflict detection via CLI (check-conflicts) and MCP (check_conflicts). Two modes: session-based (SDK + GitHub API) and git-based (local status). Includes App auth support, TSC pattern specs, and 30 passing tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Jules Merge
Detect and surface merge conflicts between a coding agent's changes and the base branch — before or during CI.
Check for conflicts in CI
When a merge has already been attempted,
check-conflictsreads conflict markers from the filesystem and returns structured JSON with the affected files, their conflict markers, and a task directive that tells the agent exactly what to resolve.Check for conflicts proactively
This queries the Jules SDK for the session's changed files and compares them against recent commits on the base branch. If files overlap, it returns the remote file content (
remoteShadowContent) so the agent can resolve conflicts without needinggit pull.Generate a CI workflow
Writes
.github/workflows/jules-merge-check.ymlto your repo. The workflow runs on every pull request: it attempts a merge, and if conflicts exist, runscheck-conflictsto produce structured output that Jules can act on.Installation
For session-based checks, set authentication:
Or use GitHub App authentication:
CLI Reference
jules-merge check-conflictsDetect merge conflicts. Mode is inferred from the arguments provided.
Session mode queries the Jules SDK for changed files and compares them against remote commits. Returns
remoteShadowContentfor each conflicting file.Git mode reads
git statusfor unmerged files and extracts conflict markers. Returns ataskDirectivewith resolution instructions.jules-merge initGenerate a GitHub Actions workflow for automated conflict detection.
Programmatic API
All handlers are exported for use in scripts, CI pipelines, or other packages.
SessionCheckHandlerCompares a Jules session's changed files against remote commits on the base branch.
Returns
{ status: 'clean' | 'conflict', conflicts: [...] }on success. Each conflict includesfilePath,conflictReason, andremoteShadowContent.GitCheckHandlerReads conflict markers from the local filesystem after a failed merge.
Returns
{ taskDirective, priority, affectedFiles: [...] }on success. Each file includesfilePath,baseCommitSha, andgitConflictMarkers.InitHandlerGenerates a GitHub Actions workflow file.
Returns
{ filePath, content }on success.buildWorkflowYamlGenerate the workflow YAML string without writing to disk.
MCP Server
The package exposes an MCP server with two tools:
check_conflicts— Detects merge conflicts (session or git mode)init_workflow— Generates a CI workflow file