Skip to content
Skill

Docs branch off feature branch smuggles code

Catches docs PRs that accidentally carry a parent feature branch's code

Docs branch off feature branch smuggles code is an open-source agent skill for developer tools. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

Scripts
None
Platforms
Claude Code, Codex, Cursor
GitHub stars
5
Last commit
License
MIT
Listing updated

Similar skills

About Docs branch off feature branch smuggles code

This skill guards against a git mistake that happens when a documentation follow-up branch is cut from a feature branch instead of origin/main. The docs pull request then quietly includes the feature's source, Dockerfile and tests under a docs title. The skill describes three situations where this happens and how each differs, including a case where a peer hands over a branch name and head SHA without describing the commits beneath it.

The workflow gives the agent a pre-merge diagnostic: list changed files outside the docs folder, compare the commit range against origin/main, and check the merge-base. It then walks through recovery, either rebasing the docs commits onto origin/main with --force-with-lease or, when the feature is already merged, recreating a clean branch and copying only the docs files across. It also lists prevention habits such as creating branches with an explicit origin/main base or using a dedicated worktree.

The skill is written as a markdown guide with shell commands and relies on git and the GitHub CLI (gh). It contains no scripts of its own and expects a repository with an origin remote and access to open and close pull requests.

When your agent uses it

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

From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.

What it can access

From a static check of its 1 file (17 KB) on GitHub on 4 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.

Check another skill before you install it.

Install

This skill ships in the agent-traffic-control plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

/plugin marketplace add wan-huiyan/agent-traffic-control
/plugin install agent-traffic-control@wan-huiyan-agent-traffic-control

Or copy only this skill to ~/.claude/skills/docs-branch-off-feature-branch-smuggles-code:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/wan-huiyan/agent-traffic-control.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/docs-branch-off-feature-branch-smuggles-code &&
cp -R "$tmp/plugins/agent-traffic-control/skills/docs-branch-off-feature-branch-smuggles-code" ~/.claude/skills/docs-branch-off-feature-branch-smuggles-code &&
rm -rf "$tmp"

For one project only, put the folder in .claude/skills/docs-branch-off-feature-branch-smuggles-code inside it instead.

Claude Code docs on skills

Copy the skill folder to ~/.agents/skills/docs-branch-off-feature-branch-smuggles-code to use it in every repository:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/wan-huiyan/agent-traffic-control.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/docs-branch-off-feature-branch-smuggles-code &&
cp -R "$tmp/plugins/agent-traffic-control/skills/docs-branch-off-feature-branch-smuggles-code" ~/.agents/skills/docs-branch-off-feature-branch-smuggles-code &&
rm -rf "$tmp"

For one repository only, put the folder in .agents/skills/docs-branch-off-feature-branch-smuggles-code inside it instead.

Codex docs on skills

Copy the skill folder to ~/.cursor/skills/docs-branch-off-feature-branch-smuggles-code to use it in every project:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/wan-huiyan/agent-traffic-control.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/docs-branch-off-feature-branch-smuggles-code &&
cp -R "$tmp/plugins/agent-traffic-control/skills/docs-branch-off-feature-branch-smuggles-code" ~/.cursor/skills/docs-branch-off-feature-branch-smuggles-code &&
rm -rf "$tmp"

For one project only, put the folder in .cursor/skills/docs-branch-off-feature-branch-smuggles-code inside it instead.

Cursor docs on skills

Run in a terminal (add --scope workspace to install it for the current workspace only):

gemini skills install https://github.com/wan-huiyan/agent-traffic-control.git --path plugins/agent-traffic-control/skills/docs-branch-off-feature-branch-smuggles-code

Or copy the folder to ~/.gemini/skills/docs-branch-off-feature-branch-smuggles-code yourself.

Gemini CLI docs on skills

For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/docs-branch-off-feature-branch-smuggles-code:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/wan-huiyan/agent-traffic-control.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/docs-branch-off-feature-branch-smuggles-code &&
cp -R "$tmp/plugins/agent-traffic-control/skills/docs-branch-off-feature-branch-smuggles-code" ~/.copilot/skills/docs-branch-off-feature-branch-smuggles-code &&
rm -rf "$tmp"

For one project only, put the folder in .github/skills/docs-branch-off-feature-branch-smuggles-code inside it instead.

VS Code docs on skills

Get the folder:

git clone --depth 1 https://github.com/wan-huiyan/agent-traffic-control.git

Then copy agent-traffic-control/plugins/agent-traffic-control/skills/docs-branch-off-feature-branch-smuggles-code into your agent's skills folder as docs-branch-off-feature-branch-smuggles-code. Agents that support SKILL.md read one folder per skill.

The SKILL.md format

What it does

Pre-merge diff check
Shell commands that list changed files outside docs/ and compare the branch range against origin/main before merging.
Rebase recovery steps
A git rebase --onto procedure that drops smuggled feature commits from a docs branch and force-pushes safely.
Clean branch alternative
A path for when the feature is already merged: close the conflicting PR and copy only the docs files onto a fresh branch.
Branch base prevention
Habits such as explicit origin/main base and dedicated docs worktrees that prevent the wrong base at creation time.
Peer-branch caution
Guidance to verify a briefed branch's commits before opening a PR for stacked work someone else created.

Good for

  • Check whether a docs PR contains code files before squash-merging it
  • Rebase a handoff docs branch so it only carries the docs commits
  • Recreate a clean docs branch after the feature PR has already merged
  • Set up a worktree from origin/main for writing session documentation

Docs branch off feature branch smuggles code FAQ

When does Docs branch off feature branch smuggles code trigger?

It is meant for cases where a docs(...) or chore(...) PR is opened after a feature session and the diff shows files outside docs/, or the commit range includes more commits than the docs author wrote.

What does the recovery change in the repository?

The rebase variant rewrites the docs branch onto origin/main and force-pushes it with --force-with-lease. The clean-branch variant closes the conflicting PR and opens a new one from a fresh branch.

Does Docs branch off feature branch smuggles code need any tools installed?

The commands use git and the GitHub CLI (gh). The skill itself has no scripts or bundled files.

How do I install Docs branch off feature branch smuggles code in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/docs-branch-off-feature-branch-smuggles-code to use it in all your projects, or to .claude/skills/docs-branch-off-feature-branch-smuggles-code in one project. Or install the agent-traffic-control plugin, which includes it: /plugin marketplace add wan-huiyan/agent-traffic-control, then /plugin install agent-traffic-control@wan-huiyan-agent-traffic-control.

Does Docs branch off feature branch smuggles code run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

Which AI agents can use Docs branch off feature branch smuggles code?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

What are the best alternatives to Docs branch off feature branch smuggles code?

The closest alternatives to Docs branch off feature branch smuggles code are Git merge, Make PR easy to review, Git workflow, Check a stale branch is not undoing newer main work and Merge PR.

Where this comes from

  • Description: from the skill's own SKILL.md.

More from wan-huiyan/agent-traffic-control