repo-setup

repo-setup is a skill for Claude Code, Codex from ethanaubuchon/dossier-tradecraft. It costs 60 tokens per session (1,552 once invoked), scanned A, original, MIT.

A Git repository preparation routine for starting a feature safely from an up-to-date main branch. It creates a feature branch and separate worktree after checking and cleaning repository state.

In plain words
What is it for?
Use it at the beginning of an implementation task to fetch updates, fast-forward main, remove merged leftovers, and create the requested feature branch and worktree.
Why use it?
It prevents new work from starting with uncommitted changes, outdated code, or leftover branches and worktrees. This reduces accidental conflicts and makes the starting point clear.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it at the beginning of an implementation task to fetch updates, fast-forward main, remove merged leftovers, and create the requested feature branch and worktree.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ethanaubuchon/dossier-tradecraft/repo-setup
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add ethanaubuchon/dossier-tradecraft --skill repo-setup
Clone the repo
git clone --depth 1 https://github.com/ethanaubuchon/dossier-tradecraft

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for repo-setup

README.md
[![agentmods](https://agentmods.dev/badge/skills/ethanaubuchon/dossier-tradecraft/repo-setup/github.svg)](https://agentmods.dev/skills/ethanaubuchon/dossier-tradecraft/repo-setup)
Your own site
<a href="https://agentmods.dev/skills/ethanaubuchon/dossier-tradecraft/repo-setup"><img src="https://agentmods.dev/badge/skills/ethanaubuchon/dossier-tradecraft/repo-setup/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for repo-setup

Your own site · 80×15
<a href="https://agentmods.dev/skills/ethanaubuchon/dossier-tradecraft/repo-setup"><img src="https://agentmods.dev/badge/skills/ethanaubuchon/dossier-tradecraft/repo-setup.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 60 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,552 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00060 $0.01552
Opus 5 $0.00030 $0.00776
Sonnet 5 $0.00012 $0.00310
Haiku 4.5 $0.00006 $0.00155

Measured 12d ago against content hash 170f51059f2b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

repo-setup scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/repo-setup/SKILL.md · 63 lines

How it starts

The opening of the file, as written. The whole thing — 63 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Repo Setup

First step of /implement's repo path. Takes the repo from whatever state it's in to a fresh feature branch + worktree cut off an up-to-date main, clearing the debris of previously-merged work on the way. Assumes a git repo — the recipe's repo-vs-vault context branch runs before this.

Input

  • branch — the feature branch to create, as <type>/<desc> (feat/, fix/, chore/, story/S-<id>-<desc>). The recipe derives it from the ticket. A bare description is acceptable — default the type to feat/.
  • (implicit) the current repo and its origin remote.

Steps

  1. Guard a dirty tree. If git status --porcelain is non-empty, stop and surface the changes — don't fetch/prune over dirty state. (A project override may stash-and-restore instead.)

  2. Fetch. git fetch --prune origin — updates remote-tracking refs and drops refs for branches deleted on the remote.

  3. Fast-forward main. Bring local main to origin/main, never a merge commit:

    • on maingit merge --ff-only origin/main
    • not on maingit fetch origin main:main (fast-forward-only update of the local ref; refuses if it would diverge).
  4. Prune merged work. Enumerate merged branches with git branch --merged origin/main, add the squash-merged ones (see caveat), and for each — excluding main and the current branch:

    • Remove its worktree if present: git worktree remove .worktrees/<branch> (--force only if an override opts in).
    • Delete its plan file: rm -f .claude/plans/<branch>.md using the /- flattened branch name (feat/foo.claude/plans/feat-foo.md, matching plan-file); gitignored, per-branch, safe.
    • Delete the branch: git branch -d <branch> for merge-commit / fast-forward merges; git branch -D <branch> for squash-merged branches (-d refuses them — -D is safe because the caveat's check already confirmed the content landed).

    Then git worktree prune to clear stale administrative entries.

    Squash-merge caveat. git branch --merged origin/main catches merge-commit and fast-forward merges but not squash-merges — and /implement squashes by default, so a just-merged branch won't show as merged (and git branch -d would refuse to delete it). Detect those separately, in order of reliability:

    • gh pr list --state merged --head <branch> reports it merged — robust, but needs network + auth.
    • git diff origin/main..<branch> (two-dot — compares the tip trees) is empty when the branch's change already landed and main hasn't moved since. Network-free fallback; a main that has advanced since the squash defeats it.

Read the full file on GitHub · 63 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 63 lines · 60 tokens per session scan A 170f51059f2b

Subscribe to this mod's changes

repo-setup is a skill published in the GitHub repository ethanaubuchon/dossier-tradecraft (3 stars, last pushed today), licensed MIT. It adds 60 tokens to every session and 1,552 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

aidex-worktree

Use when the user wants to create, run or tear down a git worktree with its own isolated environment (database, ports, containers), or when a project has no worktree setup yet and one needs bootstrapping by investigating the repo topology and verifying the compose stack can run twice — "set up a worktree for X"…

yacb2/aidex · 186 tokens

git-workflow

A guide for handling Git repository work safely, including status checks, branches, commits, pushes, pull requests, and rebasing. Git is a version-control system that records code changes and coordinates work between developers.

laolaoshiren/claude-code-skills-zh · 73 tokens

changelog-gen

A changelog generator that turns Git history into a version-by-version record of project changes. A changelog is a readable summary of new features, fixes, breaking changes, documentation, and other updates.

laolaoshiren/claude-code-skills-zh · 19 tokens

resolve-pr-comments

Evaluate, fix, answer, and reply to GitHub pull request review comments and conversation comments. Handles both change requests (fix or skip) and reviewer questions (explain using reasoning recalled from past Claude Code transcripts). Use when the user asks to "resolve PR comments", "fix review comments", "address PR…

tobihagemann/turbo · 95 tokens

create-pr

Create a GitHub pull request with a drafted title and description. Use when the user asks to "create a PR", "create a pull request", "open a PR", or "submit a PR".

tobihagemann/turbo · 44 tokens

update-pr

Update an existing GitHub pull request's title and description to reflect the current state of the branch. Use when the user asks to "update the PR", "update PR description", "update PR title", "refresh PR description", or "sync PR with changes".

tobihagemann/turbo · 56 tokens