comparison-base
Skill4.9k starsChanged 3 months agoMITView on GitHub
Internal reusable workflow for resolving the correct Git comparison base for branch reviews and change analysis. Finds the PR target or canonical Fluid Framework upstream, selects the newest shared target-history commit, and detects substantial divergence.
Trending
Less talk lately.about the whole repository
Who's talking about microsoft/FluidFramework
- A Hacker News story“Library for building distributed, real-time collaborative web applications”Hacker News · Sep 9, 2020 · 19 points
- microsoft/rushstack“[rush] Why does many Microsoft open-source projects not use rush.”GitHub · Oct 31, 2021 · 3 reactions
- Stack Overflow“How to connect to a Routerlicious local server?”Stack Overflow · Apr 27, 2021 · 3 votes
- microsoft/TypeScript“Design Meeting Notes, 2/17/2021”GitHub · Feb 17, 2021 · 3 reactions
- microsoft/TypeScript“Inline *_base declaration in d.ts files”GitHub · Aug 7, 2024 · 2 reactions
The biggest 5 of 62 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 62
Talked about on GitHub, Stack Overflow and Hacker News (62 times).
On GitHub · 50
- Oct 31, 2021[rush] Why does many Microsoft open-source projects not use rush. — microsoft/rushstack3 reactions · 6 comments
- Feb 17, 2021Design Meeting Notes, 2/17/2021 — microsoft/TypeScript3 reactions
- Aug 7, 2024Inline *_base declaration in d.ts files — microsoft/TypeScript2 reactions · 5 comments
- Jun 7, 2024[api-extractor] API report does not indicate if a class was `type` exported. — microsoft/rushstack2 reactions · 2 comments
- Mar 12, 2024Add support for pnpm lock file format 6 — microsoft/component-detection2 reactions · 7 comments
45 more on GitHub
- Apr 23, 2026[aw-compat] Bug: serena-tools-to-shared-import codemod leaves workflows broken in two edge cases — github/gh-aw1 reaction
- Sep 16, 2023Recursive types can depend on presence and source location of unused type declaration — microsoft/TypeScript1 reaction · 12 comments
- Mar 31, 2023Module-level tsdoc doesn't work — matrix-org/matrix-js-sdk1 reaction · 7 comments
- Oct 6, 2022Migrate to `pnpm` or Yarn 3 (from Yarn 1) — microsoft/vscode1 reaction · 2 comments
- Nov 3, 2026build(deps): Bump the fluid-framework-dependencies group across 3 directories with 39 updates — microsoft/FluidExamples0 reactions · 1 comment
- Oct 12, 2026Regressions between 0.34.13 and 1.3.34 — sinclairzx81/typebox0 reactions · 1 comment
- Oct 1, 2026build(deps): Bump the fluid-framework-dependencies group with 29 updates — microsoft/FluidHelloWorld0 reactions · 1 comment
- Jul 6, 2026Bump the fluid-framework-dependencies group across 1 directory with 51 updates — nmsimons/table-example0 reactions
- Jun 21, 2026[CORRUPTED] Synthetic Benchmark PR #27546 - [bench] prefix@b5720370 improvement(client): fix `exactOptionalPropertyTypes` for telemetry-utils — qodo-benchmark/FluidFramework0 reactions
- Jun 21, 2026[CLEAN] Synthetic Benchmark PR #27546 - [bench] prefix@b5720370 improvement(client): fix `exactOptionalPropertyTypes` for telemetry-utils — qodo-benchmark/FluidFramework0 reactions
- Jun 21, 2026[CORRUPTED] Synthetic Benchmark PR #27546 - [bench] prefix@9e4e683c improvement(client): fix `exactOptionalPropertyTypes` for telemetry-utils — qodo-benchmark/FluidFramework0 reactions
- Jun 21, 2026[CLEAN] Synthetic Benchmark PR #27546 - [bench] prefix@9e4e683c improvement(client): fix `exactOptionalPropertyTypes` for telemetry-utils — qodo-benchmark/FluidFramework0 reactions
- Jun 21, 2026[CORRUPTED] Synthetic Benchmark PR #27546 - [bench] prefix@0412ca76 improvement(client): fix `exactOptionalPropertyTypes` for telemetry-utils — qodo-benchmark/FluidFramework0 reactions
- Jun 21, 2026[CLEAN] Synthetic Benchmark PR #27546 - [bench] prefix@0412ca76 improvement(client): fix `exactOptionalPropertyTypes` for telemetry-utils — qodo-benchmark/FluidFramework0 reactions
- Jun 21, 2026[CORRUPTED] Synthetic Benchmark PR #27497 - [bench] improvement(client-ordered-collection): ConsensusQueueFactory generic — qodo-benchmark/FluidFramework0 reactions
- Jun 21, 2026[CLEAN] Synthetic Benchmark PR #27497 - [bench] improvement(client-ordered-collection): ConsensusQueueFactory generic — qodo-benchmark/FluidFramework0 reactions
- Jun 21, 2026[CORRUPTED] Synthetic Benchmark PR #27530 - [bench] Updated the client release group to use eslint-config-fluid v13.0 — qodo-benchmark/FluidFramework0 reactions
- Jun 21, 2026[CLEAN] Synthetic Benchmark PR #27530 - [bench] Updated the client release group to use eslint-config-fluid v13.0 — qodo-benchmark/FluidFramework0 reactions
- Jun 21, 2026[CORRUPTED] Synthetic Benchmark PR #27546 - [bench] improvement(client): fix `exactOptionalPropertyTypes` for telemetry-utils — qodo-benchmark/FluidFramework0 reactions
- Jun 21, 2026[CLEAN] Synthetic Benchmark PR #27546 - [bench] improvement(client): fix `exactOptionalPropertyTypes` for telemetry-utils — qodo-benchmark/FluidFrameworksays it tested it0 reactions
- Jun 21, 2026[CORRUPTED] Synthetic Benchmark PR #27521 - [bench] Fix version utils to get the versions it tries from the set it has installed — qodo-benchmark/FluidFrameworksays it tested it0 reactions
- Jun 21, 2026[CLEAN] Synthetic Benchmark PR #27521 - [bench] Fix version utils to get the versions it tries from the set it has installed — qodo-benchmark/FluidFrameworksays it tested it0 reactions
- Jun 21, 2026[CORRUPTED] Synthetic Benchmark PR #27508 - [bench] Remove unused credential flows in e2e tests and examples — qodo-benchmark/FluidFrameworksays it tested it0 reactions
- Jun 21, 2026[CLEAN] Synthetic Benchmark PR #27508 - [bench] Remove unused credential flows in e2e tests and examples — qodo-benchmark/FluidFrameworksays it tested it0 reactions
- Jun 4, 2026Bump @fluidframework/synthesize from 2.0.0-rc.1.0.1 to 2.0.0-rc.1.0.9 — jikanter/FluidHelloWorld0 reactions
- Jun 4, 2026Bump @fluidframework/tinylicious-client from 2.0.0-rc.1.0.1 to 2.102.0 — jikanter/FluidHelloWorld0 reactions
- Jun 4, 2026Bump @fluidframework/view-interfaces from 2.0.0-rc.1.0.1 to 2.0.0-rc.1.0.9 — jikanter/FluidHelloWorld0 reactions
- Jun 4, 2026Bump @fluidframework/merge-tree from 2.0.0-rc.1.0.1 to 2.0.0-rc.1.0.9 — jikanter/FluidHelloWorld0 reactions
- Jun 4, 2026Bump @fluidframework/driver-base from 2.0.0-rc.1.0.1 to 2.0.0-rc.1.0.9 — jikanter/FluidHelloWorld0 reactions
- May 30, 2026chore(deps): bump axios, @fluidframework/azure-client, @microsoft/live-share, fluid-framework and start-server-and-test in /live-share-dice-roller — VikkiDFoxCSA/microsoft-365-agents-toolkit-samples0 reactions
- May 1, 2026Bump fluid-framework from 1.4.0 to 2.100.0 in /samples/javascript/22.react-agile-poker — microsoft/live-share-sdk0 reactions
- May 1, 2026Bump @fluidframework/azure-client from 1.2.0 to 2.100.0 in /samples/typescript/21.react-media-template — microsoft/live-share-sdk0 reactions
- Apr 1, 2026Bump @fluidframework/azure-client from 1.2.0 to 2.91.0 in /samples/javascript/03.live-canvas-demo — microsoft/live-share-sdk0 reactions
- Apr 1, 2026Bump fluid-framework from 1.4.0 to 2.91.0 in /samples/javascript/01.dice-roller — microsoft/live-share-sdk0 reactions
- Apr 1, 2026Bump fluid-framework from 1.4.0 to 2.91.0 in /samples/javascript/03.live-canvas-demo — microsoft/live-share-sdk0 reactions
- Apr 1, 2026Bump @fluidframework/azure-client from 1.2.0 to 2.91.0 in /samples/javascript/01.dice-roller — microsoft/live-share-sdk0 reactions
- Mar 23, 2026Bump @fluidframework/test-utils from 1.4.0 to 2.91.0 in /packages/live-share-media — microsoft/live-share-sdk0 reactions
- Mar 23, 2026Bump fluid-framework from 1.4.0 to 2.91.0 in /packages/live-share-canvas — microsoft/live-share-sdk0 reactions
- Mar 23, 2026Bump @fluidframework/test-utils from 1.4.0 to 2.91.0 in /packages/live-share — microsoft/live-share-sdk0 reactions
- Mar 23, 2026Bump @fluidframework/test-runtime-utils from 1.4.0 to 2.91.0 in /packages/live-share-media — microsoft/live-share-sdk0 reactions
- Mar 4, 2026Bump the fluid-framework-dependencies group across 1 directory with 29 updates — nmsimons/fluid-vibe0 reactions
- Feb 10, 2026Bump axios, @fluidframework/server-services-client, @fluidframework/server-services-core, @fluidframework/server-services-shared and @fluidframework/server-services-utils in /server/gitrest — sniten/FluidFramework0 reactions
- Feb 9, 2026Bump axios, @fluidframework/server-lambdas, @fluidframework/server-local-server, @fluidframework/server-memory-orderer, @fluidframework/server-services-client, @fluidframework/server-services-core, @fluidframework/server-services-shared, @fluidframework/server-services-utils and @fluidframework/serv — sniten/FluidFramework0 reactions
- Nov 26, 2025[Dependabot] build(devdeps): bump @fluidframework/eslint-config-fluid from 5.7.4 to 8.1.0 — tylerbutler/tools-monorepo0 reactions
- Sep 25, 2025Bump the fluid-framework-dependencies group across 1 directory with 40 updates — augustniehaus/resourcemapfluid0 reactions · 1 comment
On Stack Overflow · 8
- Apr 27, 2021How to connect to a Routerlicious local server?3 votes · 1 answer
- Oct 14, 2020How to insert SharedMap into SharedObjetSequence2 votes
- Feb 19, 2021How to understand SequencedLambda(KafkaRunner) and DocumentPartition(DocumentLambda),and their related, in fluid-framework1 vote · 1 answer
- Jan 9, 2021How to start the Fluid Framework Server with minimum requirements?1 vote
- Jun 20, 2022How to deploy the Routerlicious fluid-server(fluid framework) using the Kubernetes?0 votes · 1 answer
3 more on Stack Overflow
- Oct 29, 2021How to consume routerlicious without experimental packages?0 votes
- Jul 9, 2021Can the tinylicious server be launched at a port other than 3000?0 votes
- Jun 4, 2021What is the strategy of SharedString on Merging data?0 votes
On Hacker News · 4
- Sep 9, 2020Library for building distributed, real-time collaborative web applications19 points
- Sep 9, 2020Microsoft/FluidFramework: Library for building real-time collaborative web apps2 points
- Jan 11, 2024FluidFramework: Build distributed, real-time collaborative web applications1 point
- Sep 9, 2020TypeScript library for building distributed, real-time collaborative web apps1 point
In this repository34 other files it gives its agents.
- server/gitrest/CLAUDE.mdCLAUDE.md
- server/historian/CLAUDE.mdCLAUDE.md
- build-tools/.github/copilot-instructions.mdCopilot instructions
- .github/copilot-instructions.mdCopilot instructions
- ff-oce-dashboardSkill
- ff-oce-kustoSkill
- brainstormingSkill
- building-ui-uxSkill
- creating-debug-tests-and-iteratingSkill
- creating-skillsSkill
- finishing-a-development-branchSkill
- handle-large-tasksSkill
- receiving-code-reviewSkill
- root-cause-tracingSkill
- starting-noriSkill
- systematic-debuggingSkill
- test-driven-developmentSkill
- testing-anti-patternsSkill
- updating-noridocsSkill
- using-git-worktreesSkill
- using-screenshotsSkill
- using-skillsSkill
- webapp-testingSkill
- writing-plansSkill
- api-changesSkill
- ci-readiness-checkSkill
- fluid-pr-guideSkill
- fluid-prSkill
- fluid-releaseSkill
- pipeline-test-triageSkill
- policy-checkSkill
- review-pr-localSkill
- reviewSkill
- trigger-pipelines-for-copilot-prSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 3 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Use this skill when another workflow needs to compare a branch or working tree with the branch it is intended to merge into.
- Very specific: line 37
Prefer active PR metadata already available from the editor's PR integration.
- Very specific: line 39
If still unresolved, query the GitHub commit-to-PR API (repos/{owner}/{repo}/commits/$REVIEW_OID/pulls) for the same candidate …
- Very specific: line 43
Do not rely on bare gh pr view, bare gh repo view, or an unqualified repository context.
- Very specific: line 75
If exactly one commit was returned, set $BASE_COMMIT to it.
- Very specific: line 77
Verify $BASE_COMMIT is non-empty and is an ancestor of both $TARGET_REF and $REVIEW_REF before continuing.
- Distinctive: line 90
If either count is greater than 50, stop before the caller reads diffs.
- Distinctive: line 118
No shared target-history commit: ask the user for a comparison commit.
≈ “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.
Files
Comparison Base Resolution
Use this skill when another workflow needs to compare a branch or working tree with the branch it is intended to merge into. This skill resolves the comparison refs and commit; the caller decides what paths and endpoint to diff.
Inputs
$REVIEW_REF: the commit being reviewed. Default toHEAD.
Set $IS_LOCAL_REVIEW=true when the input is HEAD, or when a named local branch is the currently checked-out branch; otherwise set it to false. Callers use this explicit value to decide whether workspace changes belong to the review.
For HEAD or a named review branch, record $REVIEW_BRANCH when the ref identifies a local branch. Resolve its published destination using Git's push precedence: branch.<name>.pushRemote, then remote.pushDefault, then the branch's configured upstream remote. Store the remote name or URL usable by Git as $REVIEW_FETCH_SOURCE, normalize that remote's GitHub URL to owner/repository as $REVIEW_REPOSITORY, and store the remote branch name as $REVIEW_HEAD_BRANCH. Keep these values distinct: Git commands consume $REVIEW_FETCH_SOURCE, while GitHub PR metadata uses $REVIEW_REPOSITORY. The published branch may have a different name from the local branch. Without any configured destination, inspect configured remotes for an exact $REVIEW_BRANCH match and derive all three values; ask the user if multiple remotes match. A detached HEAD, commit input, or unpublished local branch may leave the published identity unset.
For a named review branch, prefer an exact local branch and set REVIEW_REF=refs/heads/$REVIEW_BRANCH. If there is no local branch and exactly one remote matches, set $REVIEW_FETCH_SOURCE to that remote, derive $REVIEW_REPOSITORY from its URL, set $REVIEW_HEAD_BRANCH=$REVIEW_BRANCH, fetch the branch into a dedicated ref, and use that ref as $REVIEW_REF:
git fetch --no-tags "$REVIEW_FETCH_SOURCE" "+refs/heads/$REVIEW_BRANCH:refs/comparison/head"
REVIEW_REF=refs/comparison/headIf the branch is absent, ask the user for another review ref. If it exists on multiple remotes and has no configured upstream or push remote, ask the user which remote to assign to $REVIEW_FETCH_SOURCE, derive $REVIEW_REPOSITORY, then fetch it as shown above. Finally, set $REVIEW_OID:
REVIEW_OID=$(git rev-parse "$REVIEW_REF")Step 1: Resolve the target branch
Resolve an open PR using the following sources in order, stopping as soon as one source produces exactly one validated match. Do not query later sources after a match is resolved.
- Prefer active PR metadata already available from the editor's PR integration. Verify its head repository and branch match
$REVIEW_REPOSITORYand$REVIEW_HEAD_BRANCHwhen those values are known. Its published head must also match$REVIEW_OIDor be an ancestor of a locally-ahead$REVIEW_REF. - If no match was resolved and
$REVIEW_REPOSITORYand$REVIEW_HEAD_BRANCHare known, query open PRs by branch.gh pr list --repo <candidate-base-repository> --state open --head "$REVIEW_HEAD_BRANCH" --json url,state,baseRefName,headRefName,headRefOid,headRepositoryis convenient; query GitHub repositories named by configured remotes, includingmicrosoft/FluidFramework, one at a time and stop after a validated match. ValidateheadRepository.nameWithOwneragainst$REVIEW_REPOSITORY. This branch query lets a locally-ahead commit resolve its published PR. - If still unresolved, query the GitHub commit-to-PR API (
repos/{owner}/{repo}/commits/$REVIEW_OID/pulls) for the same candidate repositories, one at a time, and stop after a validated match. Treat HTTP 404 or 422 as no candidates and continue; locally-ahead or unpublished commits may not exist in the queried repository.
From any source, read the PR state and URL, base repository and branch, and head repository, branch, and SHA. Only accept open PRs whose head repository and branch match the known review identity and whose head SHA matches $REVIEW_OID or is its ancestor.
Do not rely on bare gh pr view, bare gh repo view, or an unqualified repository context. These are ambiguous in fork checkouts; pass an explicit PR URL or --repo owner/repository. If multiple open PRs match, ask the user which PR to use.
For a matching PR, set:
$TARGET_SOURCEto its base repository clone URL$TARGET_REPOSITORYto its normalizedowner/repositoryname$TARGET_BRANCHto its base branch$PR_URLto its HTML URL
If no PR exists, inspect fetch remotes and select one whose normalized URL points to https://github.com/microsoft/FluidFramework (accept SSH or HTTPS and an optional .git suffix). Set $TARGET_SOURCE to that remote, $TARGET_REPOSITORY to microsoft/FluidFramework, and $TARGET_BRANCH to main. If no such remote exists, use https://github.com/microsoft/FluidFramework.git directly as $TARGET_SOURCE and set the other values the same way.
Fetch the target branch into a dedicated ref so stale or unrelated tracking branches cannot affect the result:
git fetch --no-tags "$TARGET_SOURCE" "+refs/heads/$TARGET_BRANCH:refs/comparison/target"
TARGET_REF=refs/comparison/targetStep 2: Select the comparison commit
Find all best common ancestors of the target and review refs. Fluid Framework squash-merges branches into main, so this normally produces exactly one commit. Use --all so Git reports criss-cross or other ambiguous histories instead of selecting an arbitrary best ancestor.
if BASE_COMMITS=$(git merge-base --all "$TARGET_REF" "$REVIEW_REF"); then
BASE_STATUS=0
else
BASE_STATUS=$?
fiIf $BASE_STATUS is nonzero, report the Git failure. If $BASE_COMMITS is empty, check git rev-parse --is-shallow-repository. For a shallow repository, deepen the target and review histories from their respective fetch sources and retry; unshallow when practical. Only ask the user for a comparison commit after the repository is confirmed complete or deepening cannot recover the shared history.
If exactly one commit was returned, set $BASE_COMMIT to it. If multiple commits were returned, show each commit's short SHA, date, and subject, explain that Git found multiple equally good common ancestors, and ask the user which one to use.
Verify $BASE_COMMIT is non-empty and is an ancestor of both $TARGET_REF and $REVIEW_REF before continuing.
Step 3: Check divergence
Count all commits reachable from each tip after the selected comparison commit:
REVIEW_COMMITS=$(git rev-list --count "$BASE_COMMIT..$REVIEW_REF")
TARGET_COMMITS=$(git rev-list --count "$BASE_COMMIT..$TARGET_REF")Record the comparison commit's short SHA, date, and subject; both tip dates; and the elapsed time from the comparison commit to each tip.
If either count is greater than 50, stop before the caller reads diffs. Warn that the histories have substantial divergence and show:
- selected target repository and branch
- selected comparison commit (short SHA, date, and subject)
- review side: commit count, tip date, and elapsed time since the comparison commit
- target side: commit count, tip date, and elapsed time since the comparison commit
Ask whether to continue with these values, choose another target branch, or choose another comparison commit. When $TARGET_COMMITS is nonzero, also offer to merge the target branch into the review branch first. Explain that merging can reduce target-side divergence but modifies the review branch; never perform it without explicit approval.
Outputs
Return these values to the caller:
$REVIEW_REF,$REVIEW_OID, and$IS_LOCAL_REVIEW$REVIEW_FETCH_SOURCE,$REVIEW_REPOSITORY, and$REVIEW_HEAD_BRANCH, when a published review identity was resolved$TARGET_SOURCE,$TARGET_REPOSITORY,$TARGET_BRANCH, and$TARGET_REF$BASE_COMMIT$REVIEW_COMMITSand$TARGET_COMMITS$PR_URL, if a PR was found- recorded commit and elapsed-time metadata
The caller must use the exact selected $BASE_COMMIT; it must not later replace it with a three-dot diff or recompute a merge-base.
Edge Cases
- Ambiguous PR or named branch: ask the user which one to use.
- Multiple best common ancestors: show them and ask the user which one to use.
- Empty base in a shallow repository: deepen both relevant histories and retry before treating them as unrelated.
- No shared target-history commit: ask the user for a comparison commit.
- More than 50 commits on either side: present divergence and ask before proceeding.
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
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.

