worktree-pre-push-bypass-for-tier1-checks

Handle workspace-hub integration-branch pushes from isolated git worktrees when the pre-push hook incorrectly assumes sibling tier-1 repos exist under the worktree path.

5 stars

Best use case

worktree-pre-push-bypass-for-tier1-checks is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Handle workspace-hub integration-branch pushes from isolated git worktrees when the pre-push hook incorrectly assumes sibling tier-1 repos exist under the worktree path.

Teams using worktree-pre-push-bypass-for-tier1-checks should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/worktree-pre-push-bypass-for-tier1-checks/SKILL.md --create-dirs "https://raw.githubusercontent.com/vamseeachanta/workspace-hub/main/.agents/skills/workspace-hub/worktree-pre-push-bypass-for-tier1-checks/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/worktree-pre-push-bypass-for-tier1-checks/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How worktree-pre-push-bypass-for-tier1-checks Compares

Feature / Agentworktree-pre-push-bypass-for-tier1-checksStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Handle workspace-hub integration-branch pushes from isolated git worktrees when the pre-push hook incorrectly assumes sibling tier-1 repos exist under the worktree path.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Worktree Pre-Push Bypass for Tier-1 Checks

Use when pushing a new branch from a workspace-hub git worktree and `git push` fails before network push because `.git/hooks/pre-push.sh` tries to run tier-1 repo checks against sibling directories that do not exist inside the worktree.

## Trigger symptoms

Typical push failure output includes lines like:
- `New branch — running all tier-1 repo checks.`
- `ERROR: directory not found: /.../worktree/.../assetutilities`
- `ERROR: directory not found: /.../worktree/.../digitalmodel`
- `ERROR: Unknown repo 'OGManufacturing'`
- `failed to push some refs`

This happens especially for isolated integration worktrees such as:
- `workspace-hub-integration-*`
- other temporary review/landing worktrees created from `main`

## Root cause

`workspace-hub/.git/hooks/pre-push.sh` treats a new-branch push as `RUN_ALL=true` and then checks the full tier-1 repo list. In an isolated worktree, those repos are not present as sibling directories, so the hook fails before the branch can be pushed.

The hook already provides a soft bypass:
- `GIT_PRE_PUSH_SKIP=1`

and logs the bypass to:
- `logs/hooks/pre-push-bypass.jsonl`

## Safe workaround

From the integration worktree, push with the documented soft bypass:

```bash
cd /mnt/local-analysis/worktrees/<worktree-name>
GIT_PRE_PUSH_SKIP=1 git push -u origin <branch-name>
```

Expected output includes:
- `[pre-push] GIT_PRE_PUSH_SKIP=1 — bypass logged to .../logs/hooks/pre-push-bypass.jsonl`

Use this only when:
1. you already ran targeted validation in the clean worktree
2. the failure is clearly due to missing sibling repos / worktree path assumptions OR unrelated repo-wide pre-push debt
3. the branch is narrow and low-risk (for example a docs/plans-only branch)
4. review evidence is already present for feature/fix commits when applicable

## Important refinement learned in live use

There are actually two distinct failure modes:

1. Clean-worktree topology failure
- the isolated worktree does not contain sibling tier-1 repos under the paths assumed by the pre-push hook
- typical errors are `directory not found` for `assetutilities`, `digitalmodel`, `worldenergydata`, or `assethold`

2. Topology-compatible checkout still blocked
- even after recreating the landing commit in the real workspace checkout (where sibling repos do exist), the same pre-push hook can still block the push because it runs ecosystem-wide tier-1 checks and fails on unrelated repo debt
- observed example: a docs-only branch was blocked by existing `assetutilities` ruff/mypy failures, not by the branch's own diff
- another observed example: after the tier-1 checks, the hook's config-drift step can still fail with `ModuleNotFoundError: No module named 'yaml'` from `scripts/quality/check_config_drift.py`; this is also environment/governance debt unrelated to the narrow branch content

Practical decision rule:
- first try a normal push from a topology-compatible checkout once
- if that still fails only because of unrelated ecosystem-wide checks, prefer the audited bypass for the narrow docs-only branch instead of debugging the clean worktree further
- record that the bypass was environmental/governance-driven, not required by the branch content itself

## Verification before bypassing

Run at minimum:

```bash
git status --short
git --no-pager log --oneline -5
uv run pytest <targeted test set> -q
```

For combined landing branches, record the exact passing command set in a runbook before pushing.

## After push

1. Save the branch/PR URL.
2. Post GitHub closeout comments with validation evidence.
3. Close landed issues only after the branch is pushed and evidence is posted.
4. Create or link a follow-up issue to fix the pre-push hook itself.

## Permanent fix path

Do not rely on the bypass as the long-term solution. Create/follow a harness issue to make the pre-push hook worktree-aware. In this session, that follow-up was:
- `#2203` — make pre-push tier-1 repo checks worktree-aware for integration branches

## Notes

- This is a workspace-hub-specific operational workaround, not a generic git-worktree pattern.
- Prefer fixing the hook over using repeated bypasses.
- If the hook failure is due to real test/review failures rather than missing sibling repos, do not bypass.

Related Skills

digitalmodel-worktree-test-execution-with-shared-venv

5
from vamseeachanta/workspace-hub

Run digitalmodel tests from isolated worktrees without uv editable-dependency failures by using the main repo's existing virtualenv and PYTHONPATH.

blender-worktree-test-hardening

5
from vamseeachanta/workspace-hub

Recover and harden digitalmodel Blender automation work in isolated worktrees when uv/editable dependency paths break and local machines lack a Blender executable.

worktree-branch-sync-hygiene

5
from vamseeachanta/workspace-hub

Class-level branch, worktree, dirty-main, stash, sync, and hook hygiene for workspace-hub style multi-repo work.

git-worktree-cleanup-at-scale

5
from vamseeachanta/workspace-hub

Identify and remove stale git worktrees blocking branch deletion in multi-repo environments

git-worktree-cleanup-and-branch-reconciliation

5
from vamseeachanta/workspace-hub

Systematic process for cleaning up stale git worktrees, resolving merge conflicts in diverged branches, and reconciling branch state across multiple repositories.

git-worktree-cleanup-and-branch-hygiene

5
from vamseeachanta/workspace-hub

Systematic approach to cleaning up stale git worktrees, orphan branches, and branch hygiene at scale across multiple repos

financial-site-bypass-workflow

5
from vamseeachanta/workspace-hub

Workflow for accessing restricted financial sites when browser automation is blocked

learned-git-worktree-hook-path-and-real-hook-shape-review

5
from vamseeachanta/workspace-hub

Catch hook-installation and governance bugs that only appear in linked git worktrees or against the real generated hook shape, not simplified test fixtures.

clean-worktree-integration-from-dirty-main

5
from vamseeachanta/workspace-hub

Land validated issue work from isolated worktrees when the main checkout is dirty by creating a fresh integration worktree, cherry-picking only implementation commits, re-running combined validation, and preparing push/closeout artifacts.

overnight-worktree-verification-fallback

5
from vamseeachanta/workspace-hub

Verify overnight multi-worktree Codex batches when auto-sync, duplicate-lane convergence, and sandbox-blocked review create misleading local state or review provenance.

overnight-worktree-uv-warmup-and-log-path-guardrails

5
from vamseeachanta/workspace-hub

Prevent false stalls and missing-log failures in overnight Codex worktree batches by pre-warming uv environments, using exact log-path directory creation, and interpreting buffered logs correctly.

overnight-worktree-Codex-noop-recovery

5
from vamseeachanta/workspace-hub

Recover overnight Codex worktree batches that appear to succeed but produce no artifacts; harden rerun prompts and launch commands.