From f5d469e4b2bdda6955fa83e6f42b1f5180d5811f Mon Sep 17 00:00:00 2001 From: Vladimir Bragin Date: Sat, 28 Nov 2026 19:44:51 -0600 Subject: [PATCH] docs(skills): merge-pr waits out UNKNOWN, setup ledgers, checkout updates, classifier-safe discards - merge-pr: mergeable or merge state UNKNOWN means GitHub is recomputing; poll up to 5 minutes, never merge on it. - agent-setup usage: a conflict on an unedited skill can mean another state ledger owns it; apply per owning ledger and check each receipt. - git-and-diff-workflows: update a checkout with fetch plus merge --ff-only or fetch origin main:main, never by setting an upstream; then check for a linked build running stale output. - safe-command-patterns: when a classifier refuses a discard, stash with a message and paths, one destructive command per step, hand the rest to the user; never reword it. Refs scf-3ovct Co-Authored-By: Claude Opus 5.5 --- .agents/skills/agent-setup/references/usage.md | 6 ++++++ .agents/skills/git-and-diff-workflows/SKILL.md | 8 ++++++++ .agents/skills/merge-pr/SKILL.md | 4 ++++ .agents/skills/safe-command-patterns/SKILL.md | 5 +++++ .claude/skills/agent-setup/references/usage.md | 6 ++++++ .claude/skills/git-and-diff-workflows/SKILL.md | 8 ++++++++ .claude/skills/merge-pr/SKILL.md | 4 ++++ .claude/skills/safe-command-patterns/SKILL.md | 5 +++++ .cursor/skills/agent-setup/references/usage.md | 6 ++++++ .cursor/skills/git-and-diff-workflows/SKILL.md | 8 ++++++++ .cursor/skills/merge-pr/SKILL.md | 4 ++++ .cursor/skills/safe-command-patterns/SKILL.md | 5 +++++ 12 files changed, 69 insertions(+) diff --git a/.agents/skills/agent-setup/references/usage.md b/.agents/skills/agent-setup/references/usage.md index e9e13af..ceef50b 100644 --- a/.agents/skills/agent-setup/references/usage.md +++ b/.agents/skills/agent-setup/references/usage.md @@ -28,6 +28,12 @@ Use the local receipt and subsequent plan as evidence; file installation alone d 2. Write a copy of the plan that keeps only the operations whose `relative` path is under `//` for the four user skill trees (`.claude/skills`, `.agents/skills`, `.gemini/config/skills`, `.gemini/antigravity-cli/skills`). Update `summary` to match. 3. Have the user review that list, then `apply --input ` and `check --input `. +A cut plan can show `conflict` ("unmanaged or overlapping edit") for a skill you never edited. That +usually means another `--state` folder's ledger owns those files: a machine can collect several, for +example one in the checkout and one in a long-lived setup worktree. Plan again with each folder that has +`targets/*.json`. Apply each skill's operations from the ledger where they are clean updates, then +`check` every receipt. Never force past the conflict. + This is safe because `apply` checks every operation it is given (library and installer hashes, the target root, the destination folder, the content hashes) without requiring the full list. Conflicts are skipped and recorded in the receipt. The ownership ledger merges, so other skills' entries stay. ## Explicit MCP replacement diff --git a/.agents/skills/git-and-diff-workflows/SKILL.md b/.agents/skills/git-and-diff-workflows/SKILL.md index 4e71c90..24941a9 100644 --- a/.agents/skills/git-and-diff-workflows/SKILL.md +++ b/.agents/skills/git-and-diff-workflows/SKILL.md @@ -64,6 +64,14 @@ gitleaks detect --source . --no-git -v 2>/dev/null | head -50 Either way, confirm `git diff --cached --stat` shows your change before you commit. - See [bounded-output-patterns.md](../cli-tools-overview/references/bounded-output-patterns.md). +- **Bringing a checkout up to date:** `git pull --ff-only` fails with "no tracking information" when the + branch has no upstream. Run `git fetch origin`, then `git merge --ff-only origin/`; don't set an + upstream, because that writes `.git/config`. To move a local `main` that isn't checked out (for example + while you're on a feature branch), run `git fetch origin main:main`, which refuses anything but a + fast-forward. Afterwards, check whether something runs from this checkout's build output: a global npm + link or junction, or a plugin read from the folder. An untracked `dist/` is still the old build, so offer + the project's build command. + ## Commands Requiring Confirmation See [commands-requiring-confirmation.md](../cli-tools-overview/references/commands-requiring-confirmation.md). — especially reset, clean, force-push, filter-repo. diff --git a/.agents/skills/merge-pr/SKILL.md b/.agents/skills/merge-pr/SKILL.md index 0bdefd6..0fc030d 100644 --- a/.agents/skills/merge-pr/SKILL.md +++ b/.agents/skills/merge-pr/SKILL.md @@ -201,6 +201,10 @@ Any failing step: stop and report it with its output. Don't fix it here; that's Immediately before merging, re-read the PR and confirm: +- **`mergeable` or `mergeStateStatus` reads `UNKNOWN`?** GitHub is still recomputing, which is common + for a few minutes after another PR merged into the same base. Poll about every 10 seconds for up to + 5 minutes, then decide on the settled value. `UNKNOWN` is neither a conflict nor a pass, so never merge on it. + - the head is still ``, with no new commits; - it is mergeable with no conflicts, `mergeStateStatus` is not `BLOCKED`, and no review has changed; - the checks outside Actions still show nothing failing or pending; diff --git a/.agents/skills/safe-command-patterns/SKILL.md b/.agents/skills/safe-command-patterns/SKILL.md index ce9af1e..43e3a82 100644 --- a/.agents/skills/safe-command-patterns/SKILL.md +++ b/.agents/skills/safe-command-patterns/SKILL.md @@ -55,6 +55,11 @@ rg "pattern" path/ --max-count 30 - When **fff MCP** is connected, prefer `ffgrep`/`fffind` for repeated repo search over many shell roundtrips; one-off probes may still use `rg`/`fd`. - Never paste secrets into commands or logs. - Prefer project scripts from AGENTS.md over invented commands. +- **A permission classifier refuses a discard** such as `git checkout -- `, `git restore` or + `git branch -D`. That can happen even after the user picked the option in a dialog. Use the reversible + form for superseded local changes: `git stash push --include-untracked -m "" -- `. Send each + destructive command as its own step, so one refusal doesn't stop the rest. If it's still refused, hand + it to the user as a paste-ready `!` command. Never reword it to get past the check. ## Commands Requiring Confirmation diff --git a/.claude/skills/agent-setup/references/usage.md b/.claude/skills/agent-setup/references/usage.md index e9e13af..ceef50b 100644 --- a/.claude/skills/agent-setup/references/usage.md +++ b/.claude/skills/agent-setup/references/usage.md @@ -28,6 +28,12 @@ Use the local receipt and subsequent plan as evidence; file installation alone d 2. Write a copy of the plan that keeps only the operations whose `relative` path is under `//` for the four user skill trees (`.claude/skills`, `.agents/skills`, `.gemini/config/skills`, `.gemini/antigravity-cli/skills`). Update `summary` to match. 3. Have the user review that list, then `apply --input ` and `check --input `. +A cut plan can show `conflict` ("unmanaged or overlapping edit") for a skill you never edited. That +usually means another `--state` folder's ledger owns those files: a machine can collect several, for +example one in the checkout and one in a long-lived setup worktree. Plan again with each folder that has +`targets/*.json`. Apply each skill's operations from the ledger where they are clean updates, then +`check` every receipt. Never force past the conflict. + This is safe because `apply` checks every operation it is given (library and installer hashes, the target root, the destination folder, the content hashes) without requiring the full list. Conflicts are skipped and recorded in the receipt. The ownership ledger merges, so other skills' entries stay. ## Explicit MCP replacement diff --git a/.claude/skills/git-and-diff-workflows/SKILL.md b/.claude/skills/git-and-diff-workflows/SKILL.md index 4e71c90..24941a9 100644 --- a/.claude/skills/git-and-diff-workflows/SKILL.md +++ b/.claude/skills/git-and-diff-workflows/SKILL.md @@ -64,6 +64,14 @@ gitleaks detect --source . --no-git -v 2>/dev/null | head -50 Either way, confirm `git diff --cached --stat` shows your change before you commit. - See [bounded-output-patterns.md](../cli-tools-overview/references/bounded-output-patterns.md). +- **Bringing a checkout up to date:** `git pull --ff-only` fails with "no tracking information" when the + branch has no upstream. Run `git fetch origin`, then `git merge --ff-only origin/`; don't set an + upstream, because that writes `.git/config`. To move a local `main` that isn't checked out (for example + while you're on a feature branch), run `git fetch origin main:main`, which refuses anything but a + fast-forward. Afterwards, check whether something runs from this checkout's build output: a global npm + link or junction, or a plugin read from the folder. An untracked `dist/` is still the old build, so offer + the project's build command. + ## Commands Requiring Confirmation See [commands-requiring-confirmation.md](../cli-tools-overview/references/commands-requiring-confirmation.md). — especially reset, clean, force-push, filter-repo. diff --git a/.claude/skills/merge-pr/SKILL.md b/.claude/skills/merge-pr/SKILL.md index 0bdefd6..0fc030d 100644 --- a/.claude/skills/merge-pr/SKILL.md +++ b/.claude/skills/merge-pr/SKILL.md @@ -201,6 +201,10 @@ Any failing step: stop and report it with its output. Don't fix it here; that's Immediately before merging, re-read the PR and confirm: +- **`mergeable` or `mergeStateStatus` reads `UNKNOWN`?** GitHub is still recomputing, which is common + for a few minutes after another PR merged into the same base. Poll about every 10 seconds for up to + 5 minutes, then decide on the settled value. `UNKNOWN` is neither a conflict nor a pass, so never merge on it. + - the head is still ``, with no new commits; - it is mergeable with no conflicts, `mergeStateStatus` is not `BLOCKED`, and no review has changed; - the checks outside Actions still show nothing failing or pending; diff --git a/.claude/skills/safe-command-patterns/SKILL.md b/.claude/skills/safe-command-patterns/SKILL.md index ce9af1e..43e3a82 100644 --- a/.claude/skills/safe-command-patterns/SKILL.md +++ b/.claude/skills/safe-command-patterns/SKILL.md @@ -55,6 +55,11 @@ rg "pattern" path/ --max-count 30 - When **fff MCP** is connected, prefer `ffgrep`/`fffind` for repeated repo search over many shell roundtrips; one-off probes may still use `rg`/`fd`. - Never paste secrets into commands or logs. - Prefer project scripts from AGENTS.md over invented commands. +- **A permission classifier refuses a discard** such as `git checkout -- `, `git restore` or + `git branch -D`. That can happen even after the user picked the option in a dialog. Use the reversible + form for superseded local changes: `git stash push --include-untracked -m "" -- `. Send each + destructive command as its own step, so one refusal doesn't stop the rest. If it's still refused, hand + it to the user as a paste-ready `!` command. Never reword it to get past the check. ## Commands Requiring Confirmation diff --git a/.cursor/skills/agent-setup/references/usage.md b/.cursor/skills/agent-setup/references/usage.md index e9e13af..ceef50b 100644 --- a/.cursor/skills/agent-setup/references/usage.md +++ b/.cursor/skills/agent-setup/references/usage.md @@ -28,6 +28,12 @@ Use the local receipt and subsequent plan as evidence; file installation alone d 2. Write a copy of the plan that keeps only the operations whose `relative` path is under `//` for the four user skill trees (`.claude/skills`, `.agents/skills`, `.gemini/config/skills`, `.gemini/antigravity-cli/skills`). Update `summary` to match. 3. Have the user review that list, then `apply --input ` and `check --input `. +A cut plan can show `conflict` ("unmanaged or overlapping edit") for a skill you never edited. That +usually means another `--state` folder's ledger owns those files: a machine can collect several, for +example one in the checkout and one in a long-lived setup worktree. Plan again with each folder that has +`targets/*.json`. Apply each skill's operations from the ledger where they are clean updates, then +`check` every receipt. Never force past the conflict. + This is safe because `apply` checks every operation it is given (library and installer hashes, the target root, the destination folder, the content hashes) without requiring the full list. Conflicts are skipped and recorded in the receipt. The ownership ledger merges, so other skills' entries stay. ## Explicit MCP replacement diff --git a/.cursor/skills/git-and-diff-workflows/SKILL.md b/.cursor/skills/git-and-diff-workflows/SKILL.md index 4e71c90..24941a9 100644 --- a/.cursor/skills/git-and-diff-workflows/SKILL.md +++ b/.cursor/skills/git-and-diff-workflows/SKILL.md @@ -64,6 +64,14 @@ gitleaks detect --source . --no-git -v 2>/dev/null | head -50 Either way, confirm `git diff --cached --stat` shows your change before you commit. - See [bounded-output-patterns.md](../cli-tools-overview/references/bounded-output-patterns.md). +- **Bringing a checkout up to date:** `git pull --ff-only` fails with "no tracking information" when the + branch has no upstream. Run `git fetch origin`, then `git merge --ff-only origin/`; don't set an + upstream, because that writes `.git/config`. To move a local `main` that isn't checked out (for example + while you're on a feature branch), run `git fetch origin main:main`, which refuses anything but a + fast-forward. Afterwards, check whether something runs from this checkout's build output: a global npm + link or junction, or a plugin read from the folder. An untracked `dist/` is still the old build, so offer + the project's build command. + ## Commands Requiring Confirmation See [commands-requiring-confirmation.md](../cli-tools-overview/references/commands-requiring-confirmation.md). — especially reset, clean, force-push, filter-repo. diff --git a/.cursor/skills/merge-pr/SKILL.md b/.cursor/skills/merge-pr/SKILL.md index 0bdefd6..0fc030d 100644 --- a/.cursor/skills/merge-pr/SKILL.md +++ b/.cursor/skills/merge-pr/SKILL.md @@ -201,6 +201,10 @@ Any failing step: stop and report it with its output. Don't fix it here; that's Immediately before merging, re-read the PR and confirm: +- **`mergeable` or `mergeStateStatus` reads `UNKNOWN`?** GitHub is still recomputing, which is common + for a few minutes after another PR merged into the same base. Poll about every 10 seconds for up to + 5 minutes, then decide on the settled value. `UNKNOWN` is neither a conflict nor a pass, so never merge on it. + - the head is still ``, with no new commits; - it is mergeable with no conflicts, `mergeStateStatus` is not `BLOCKED`, and no review has changed; - the checks outside Actions still show nothing failing or pending; diff --git a/.cursor/skills/safe-command-patterns/SKILL.md b/.cursor/skills/safe-command-patterns/SKILL.md index ce9af1e..43e3a82 100644 --- a/.cursor/skills/safe-command-patterns/SKILL.md +++ b/.cursor/skills/safe-command-patterns/SKILL.md @@ -55,6 +55,11 @@ rg "pattern" path/ --max-count 30 - When **fff MCP** is connected, prefer `ffgrep`/`fffind` for repeated repo search over many shell roundtrips; one-off probes may still use `rg`/`fd`. - Never paste secrets into commands or logs. - Prefer project scripts from AGENTS.md over invented commands. +- **A permission classifier refuses a discard** such as `git checkout -- `, `git restore` or + `git branch -D`. That can happen even after the user picked the option in a dialog. Use the reversible + form for superseded local changes: `git stash push --include-untracked -m "" -- `. Send each + destructive command as its own step, so one refusal doesn't stop the rest. If it's still refused, hand + it to the user as a paste-ready `!` command. Never reword it to get past the check. ## Commands Requiring Confirmation