Safely rebase or fast-forward the active Pigweed worktree onto its target branch (origin/main), resolve Pigweed dual-build and code conflicts, preserve Gerrit Change-Id footers, and verify local…

Apache-2.0Auto-check passedDevelopment

Install Freshen

skills CLI
$ npx skills add pigweed-project/pigweed --skill freshen -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install pigweed-project/pigweed freshen --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/pigweed-project/pigweed.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/freshen .claude/skills/freshen && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
freshen
GitHub stars
548
Token cost
~1.7k tokens
SKILL.md length
814 words
Files
2
Skills in repo
10
Repo updated
First seen
Licence
Apache-2.0

At a glance

Safely rebase or fast-forward the active Pigweed worktree onto its target branch (origin/main), resolve Pigweed dual-build and code conflicts, preserve Gerrit Change-Id footers, and verify local…

  • Works in 4 steps: Sense Branch, Dirty State & Rebase Verdict → Select the Freshen Mode → Pigweed-Aware Conflict Resolution → …
  • Tasks that involve Git worktrees
  • SKILL.md covers Strict Invariants and Step-by-Step Workflow
  • Calls git and gh

What it does

Freshen is an agent skill from pigweed-project/pigweed. Safely rebase or fast-forward the active Pigweed worktree onto its target branch (origin/main), resolve Pigweed dual-build and code conflicts, preserve Gerrit Change-Id footers, and verify local build/format health.

Its SKILL.md is about 1.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file (for example `TEST.md`).

It sits in Development, covering Git worktrees and Git workflow. It works with Git. The repository describes itself as: Modern software development for embedded systems. The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve Git worktrees
  • Tasks that involve Git workflow

Example prompts

  • “/freshen”

Requirements

  • Python 3

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Sense Branch, Dirty State & Rebase Verdict
  2. Select the Freshen Mode
  3. Pigweed-Aware Conflict Resolution
  4. Post-Freshen Verification

What it can do on your machine

Read from SKILL.md and the folder at commit 6f775b5. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git
    • gh

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git and gh, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Freshen loads about 1.7k tokens when it runs. Until then it costs about 56 tokens; SKILL.md has 814 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~56
When it runs · the whole SKILL.md, loaded when a task matches
~1.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from pigweed-project/pigweed at commit 6f775b5, republished under its Apache-2.0 licence (© pigweed-project). 814 words, ~1,713 tokens.

Download SKILL.mdSave it as .claude/skills/freshen/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
freshen
description
Safely rebase or fast-forward the active Pigweed worktree onto its target branch (origin/main), resolve Pigweed dual-build and code conflicts, preserve Gerrit Change-Id footers, and verify local build/format health.
disable-model-invocation
true

Freshen Worktree & Rebase (/freshen)

/freshen brings the current Pigweed worktree and branch up to date with its upstream target branch (defaulting to origin/main) without losing warm Bazel caches, clobbering Gerrit Change-Id: footers, or silently breaking dual-build (BUILD.bazel / BUILD.gn / CMakeLists.txt) parity.

Use /freshen standalone whenever a worktree or CL is behind origin/main, or invoke it as the first stage of /crank.


Strict Invariants

  1. Record a rollback anchor first: Before any mutating Git command, capture PRE_FRESHEN_SHA=$(git rev-parse HEAD) and log it. If an irreconcilable conflict occurs, abort (git rebase --abort) and verify HEAD matches PRE_FRESHEN_SHA.
  2. Never clobber Change-Id: footers: Every rebased or amended commit MUST retain its exact original Change-Id: I... line so Gerrit links new patchsets to the existing Change List (CL).
  3. Respect target branch memory: Do not blindly rebase onto origin/main if the CL targets a feature or release branch (e.g., sandbox/*). Query ./gh pr view --json branch first when a CL exists.
  4. Stay inside the active checkout: Do not create ad-hoc temporary checkouts or git worktree directories just to rebase—doing so invalidates the local Bazel output_base.

Step-by-Step Workflow

Step 1: Sense Branch, Dirty State & Rebase Verdict

Run ./gh sense (or inspect its output if already called by /crank) and record a rollback anchor before any mutating Git command:

bash
PRE_FRESHEN_SHA=$(git rev-parse HEAD)
echo "PRE_FRESHEN_SHA=${PRE_FRESHEN_SHA}"
./gh sense

./gh sense computes an in-memory 3-way merge check (git merge-tree --write-tree HEAD origin/main) and outputs a Rebase: verdict:

  • REBASE_SKIP_KEEP_CQ: The branch merges cleanly with origin/main in memory, has zero unresolved comments/drafts, and already has active/passing CQ+1 tryjobs. Skip rebasing unless the user explicitly requested a standalone /freshen—uploading a trivial rebased patchset would reset active CQ tryjobs for zero benefit!
  • REBASE_CONFLICT or REBASE_RECOMMENDED: Proceed to Step 2 (git fetch origin
    • rebase onto origin/<target_branch>).
Step 2: Select the Freshen Mode

Choose the appropriate mode based on local state:

Local StateModeExact Action
Clean & Merged / Synced (ahead == 0 or CL state == "MERGED", clean tree)Fast-Forward / NextIf preparing the checkout for a specific new bug or CL, run ./gh sense --prepare [<target>]. If simply fast-forwarding onto origin/main, run git fetch origin && git merge --ff-only origin/main (or ./gh wt next if using ./gh wt).
Dirty Working Tree (git status --porcelain non-empty)Autostash + RebaseStash tracked and untracked changes before rebasing: git stash push -u -m "freshen-autostash-${PRE_FRESHEN_SHA}", run git fetch origin && git rebase <UPSTREAM>, then git stash pop and resolve any stash overlap.
Unmerged Local Commit(s) / Active CL (ahead > 0, CL state == "NEW" or unuploaded)Target-Aware RebaseRun git fetch origin && git rebase <UPSTREAM>.
Already Mid-Rebase / Mid-Merge (.git/rebase-merge or MERGE_HEAD exists)Conflict RecoveryInspect conflicted files (git diff --name-only --diff-filter=U) and proceed directly to Step 3.
Show full SKILL.md (393 more words)Show less
Step 3: Pigweed-Aware Conflict Resolution

If git rebase <UPSTREAM> stops with conflicts, inspect every conflicted file (git diff --name-only --diff-filter=U) and resolve using Pigweed domain rules:

  1. Build File Conflicts (BUILD.bazel, BUILD.gn, CMakeLists.txt):
    • Never blindly pick --ours or --theirs when both upstream and the local commit added targets, srcs, hdrs, or deps.
    • Combine both additions, keep lists (srcs, hdrs, deps, public) sorted alphabetically, and ensure any new source/header added in BUILD.bazel is identically reflected in BUILD.gn (and CMakeLists.txt if present in that module).
  2. MODULE.bazel / MODULE.bazel.lock / CIPD Tool Rolls:
    • Keep upstream (origin/main) version bumps and pin updates, then re-apply only the specific dependency additions introduced by the local commit.
  3. C++ / Rust / Python Header or API Refactorings:
    • Before editing conflicted code, inspect how upstream changed the file:
      bash
      git log -n 5 -p <UPSTREAM> -- <conflicted_file>
    • Adapt the local change to the new upstream API (e.g., updated pw::Result signatures, pw_async2 dispatcher changes, renamed headers) while honoring Pigweed style (C++17 compatibility, no dynamic allocation in core modules, #pragma once).
  4. Commit Continuity & Change-Id: Preservation:
    • Stage resolved files (git add <files>) and run:
      bash
      GIT_EDITOR=true git rebase --continue
    • Verify with git log -1 --format=%B HEAD that the original Change-Id: footer is intact.
Escape Hatch for Irreconcilable Conflicts

If upstream deleted the target module or replaced the subsystem architecture such that a mechanical/semantic rebase would require a ground-up redesign:

  1. Run git rebase --abort.
  2. Verify git rev-parse HEAD equals PRE_FRESHEN_SHA.
  3. Report the exact upstream commit (git log -1 <UPSTREAM> -- <path>) that superseded or conflicted with the change so /crank or the user can decide whether to abandon or re-architect.
Step 4: Post-Freshen Verification

Whenever commits were rebased (ahead > 0 after rebase):

  1. Format Check: Run ./pw format (or ./pw format --fix). If formatting modified any files in a single-commit CL, fold them into HEAD without touching the commit message:
    bash
    git add -u && git commit --amend --no-edit
  2. Targeted Build & Test: Identify the affected Pigweed module(s) from git diff --name-only <UPSTREAM>...HEAD and run hermetic Bazel tests:
    bash
    bazelisk test --noshow_progress --noshow_loading_progress //<module>/...
  3. Structured Summary: Report:
    • Previous vs. new HEAD SHA and number of upstream commits integrated.
    • Conflicts resolved (if any) and how they were resolved.
    • Verification status (./pw format and bazelisk test results).
    • Note that the rebased commit has not been pushed yet (unless invoked inside /crank, which handles pushing in its CI loop).

© pigweed-project, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in .agents/skills/freshen of pigweed-project/pigweed.

  • SKILL.md
  • TEST.md

Open the folder on GitHubat commit 6f775b5

Compare with similar skills

Freshen next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Freshen compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Freshen this skillpigweed-project/pigweed548—~1.7kAutomated safety check: PassApache-2.0
Finishing a Development Branchobra/superpowers297k5 repos~1.9kAutomated safety check: PassMIT
Git Worktree Cleanuplobehub/lobehub83k—~2.8kAutomated safety check: PassCustom licence
Ccmanager Configkbwo/ccmanager1.3k—~1.5kAutomated safety check: PassMIT
Git Worktree Managermicrosoft/WindowsAppSDK4.7k—~2kAutomated safety check: PassMIT
Git Worktree IsolationjnMetaCode/superpowers-zh8.3k1 repos~982Automated safety check: PassMIT

Similar skills

  • Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.

    297k GitHub starsUsed in 5 repos~1.9k tokens
    DevelopmentAuto-check passed
  • Git Worktree Cleanup

    lobehub/lobehub

    Audits stale Git worktrees and branches with a bundled script, classifies each one, and deletes only after you approve the exact candidates.

    83k GitHub stars~2.8k tokensUpdated today
    DevelopmentAuto-check passed
  • Ccmanager Config

    kbwo/ccmanager

    Set up, review, or repair a CCManager config — .ccmanager.json at a git repository root, or the global ~/.config/ccmanager/config.json.

    1.3k GitHub stars~1.5k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Git Worktree Manager

    microsoft/WindowsAppSDK

    Official

    Creates and manages Git worktrees with PowerShell scripts so separate issues and Copilot sessions each get an isolated branch, build and test environment.

    4.7k GitHub stars~2k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Git Worktree Isolation

    jnMetaCode/superpowers-zh

    Sets up an isolated workspace before feature work or plan execution, preferring native worktree tools and falling back to git worktree, with instructions in Chinese.

    8.3k GitHub starsUsed in 1 repo~982 tokens
    DevelopmentAuto-check passed
  • Git Commit

    tisfeng/Easydict

    起草、创建或汇报 Angular-style 本地 Git 提交。用于明确的提交交付;分支集成使用 worktree-rebase-merge,不 push。

    15k GitHub stars~535 tokensUpdated 5 days ago
    DevelopmentAuto-check passed

More from pigweed-project/pigweed

All 10 skills in this repo
  • Oncall

    pigweed-project/pigweed

    Pigweed oncall rotation runbooks and maintenance workflows (such as rolling CIPD client tools for b/315378787).

    548 GitHub stars~963 tokensUpdated today
    Auto-check passed
  • Crank

    pigweed-project/pigweed

    Autonomous "take the next step" workflow orchestrator for Pigweed.

    548 GitHub stars~2.1k tokensUpdated today
    Auto-check passed
  • Docs

    pigweed-project/pigweed

    A skill your agent uses for ALL documentation-related workflows: rst style guide, changelog updates, C/C++ API reference (Doxygen)

    548 GitHub stars~804 tokensUpdated today
    Auto-check passed
  • Manual CLI Test

    pigweed-project/pigweed

    Interactively "taste the CLI" and "kick the tires" on any CLI tool or subcommand (/manual-cli-test, /agent-cli-kick-tires).

    548 GitHub stars~4.1k tokensUpdated today
    Auto-check passed
  • Respond

    pigweed-project/pigweed

    Address Gerrit review comments and private author drafts on a Pigweed CL with calibrated engineering judgment—implementing valid fixes, answering questions, or pushing back respectfully with…

    548 GitHub stars~2.2k tokensUpdated today
    Auto-check passed
  • Review

    pigweed-project/pigweed

    High-signal, embedded-aware Pigweed code review skill with strict comment calibration.

    548 GitHub stars~3k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Freshen

What does Freshen do?

Safely rebase or fast-forward the active Pigweed worktree onto its target branch (origin/main), resolve Pigweed dual-build and code conflicts, preserve Gerrit Change-Id footers, and verify local…. Freshen is an agent skill from pigweed-project/pigweed. Safely rebase or fast-forward the active Pigweed worktree onto its target branch (origin/main), resolve Pigweed dual-build and code conflicts, preserve Gerrit Change-Id footers, and verify local build/format health.

When should I use Freshen?

Freshen fits situations like: tasks that involve Git worktrees; tasks that involve Git workflow.

How do I install Freshen in Claude Code?

Run `npx skills add pigweed-project/pigweed --skill freshen -a claude-code`. Or copy the skill folder (.agents/skills/freshen in pigweed-project/pigweed) into .claude/skills/freshen in your project. Claude Code loads it when a task matches its description.

How do I install Freshen in Codex?

Run `npx skills add pigweed-project/pigweed --skill freshen -a codex`. Or copy the skill folder (.agents/skills/freshen in pigweed-project/pigweed) into .agents/skills/freshen in your project. Codex loads it when a task matches its description.

Can I use Freshen in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add pigweed-project/pigweed --skill freshen -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/freshen, .gemini/skills/freshen, .github/skills/freshen and .opencode/skills/freshen in your project.

What does Freshen need to run?

Going by SKILL.md and its folder, Freshen needs the command-line tools its instructions call (git and gh). Our summary lists: Python 3.

Does Freshen access the network?

SKILL.md contains no URLs. Its commands use git and gh, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Freshen safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Freshen use?

Freshen is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Freshen use?

About 1.7k tokens (SKILL.md is roughly 6.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Freshen?

Skills that share tags, products or a category with Freshen: Finishing a Development Branch (obra/superpowers, 297k stars), Git Worktree Cleanup (lobehub/lobehub, 83k stars), Ccmanager Config (kbwo/ccmanager, 1.3k stars) and Git Worktree Manager (microsoft/WindowsAppSDK, 4.7k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Freshen?

pigweed-project (a GitHub organization) maintains it in pigweed-project/pigweed, which has 548 GitHub stars. The repository holds 10 skills in this directory. The repository was last updated on October 11, 2026.

Source: pigweed-project/pigweed on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.