← ClaudeAtlas

docs-branch-off-feature-branch-smuggles-codelisted

Catch the bug class where a "docs follow-up" PR silently ships the parent feature's code under a `docs(sN):` title because the docs branch was created from the current working branch (a feature branch), not from `origin/main`. Use when: (1) you just opened a PR titled `docs(...)` or `chore(...)` after wrapping up a feature session, (2) `gh pr diff <N> --name-only` shows files OUTSIDE `docs/` (source code, Dockerfile, tests, generated artefacts), (3) `git log origin/main..HEAD` shows TWO+ commits where you only authored one or two docs commits, (4) the surprise commit author/message is from your own earlier feature work on the parent branch, (5) the PR body claims "docs-only" but the actual diff carries code. Trigger surface: end-of-session handoff workflows that `git checkout -b docs/sN-handoff` from inside a feature worktree that's still on `feat/sN-feature`. Squash-merging such a PR auto-promotes the feature code under a "docs" title — bypassing the planned merge-and-deploy gate for the feature PR, and sile
wan-huiyan/agent-traffic-control · ★ 2 · Code & Development · score 79
Install: claude install-skill wan-huiyan/agent-traffic-control
# Docs follow-up branch off a feature branch smuggles feature code ## Problem You finish a feature session, the work lives on `feat/sN-feature` (PR already open). You want to write a session handoff + the next-session prompt as a docs-only PR. You run: ```sh git checkout -b docs/sN-handoff-and-sN+1-prompt # ...write docs, commit, push, gh pr create... ``` The new branch was created from the current `HEAD` — which is still `feat/sN-feature`'s tip. The new docs branch carries the feature commit AND your docs commits. The PR title is `docs(sN+1):...`. The diff includes Dockerfile + src/routes/*.py + tests/*.py from the feature work. If a reviewer squash-merges the "docs" PR, you've just landed the feature code under a docs title — bypassing the planned merge order, potentially auto-deploying if cloudbuild.yaml triggers on main push, and definitely confusing anyone who reads the git log later. ## Context / Trigger Conditions You are in this trap when **all** of these hold: 1. **End-of-session handoff workflow.** You're wrapping up a session that produced code changes (already on a feature branch with an open PR) and you're about to write the handoff doc + next-session prompt as a separate PR. 2. **You created the docs branch via `git checkout -b` from inside the feature worktree** without specifying an explicit base. Most common variant: you're sitting on `feat/sN-feature` and run `git checkout -b docs/sN-handoff` — the new branch points at `feat/sN-