subagent-commit

A workflow that gathers all work on the current Git branch and turns it into one commit based on the latest main branch. It uses another agent to write the commit message.

In plain words
What is it for?
Use it to rebase branch work onto updated main, include both committed and uncommitted changes, and produce one Conventional Commits-style commit.
Why use it?
It combines existing commits and uncommitted edits into a tidy result while checking for unsafe branch states and keeping the final message separate from the current conversation.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/foldkit/foldkit/subagent-commit
Any agent
npx skills add foldkit/foldkit --skill subagent-commit
Clone the repo
git clone --depth 1 https://github.com/foldkit/foldkit

Made for: Claude Code, Codex.

Per session 55 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,176 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00055 $0.01176
Opus 5 $0.00028 $0.00588
Sonnet 5 $0.00011 $0.00235
Haiku 4.5 $0.00006 $0.00118

Measured 2d ago against content hash 4ef5d9d33dd7, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

subagent-commit 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 2d 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.

.claude/skills/subagent-commit/SKILL.md · 122 lines

How it starts

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

Context

  • Current branch: !git branch --show-current
  • Working tree: !git status --short
  • Commits ahead of main: !git log main..HEAD --oneline 2>/dev/null

Your task

Produce exactly one Conventional-Commits commit on top of the latest main containing every change currently on this branch (existing commits plus any uncommitted edits). The commit message itself must be written by a fresh sub-agent — your job is to set up clean state and delegate, not to write the message.

1. Pre-flight checks

Refuse and exit early if any of these are true:

  • The current branch IS main (or master). Tell the user to switch first.
  • A rebase/merge/cherry-pick is already in progress (check .git/MERGE_HEAD, .git/rebase-merge/, .git/rebase-apply/).
  • There are zero commits ahead of main AND a clean working tree (nothing to commit).

Note for later steps whether the working tree is dirty.

2. Stash uncommitted changes (if any)

If git status --short shows anything:

git stash push --include-untracked --message "subagent-commit-pending"

Otherwise skip.

3. Fetch and fast-forward local main

git fetch origin
git fetch origin main:main

The second command fast-forwards local main to match origin/main without checking it out. If it fails because local main has diverged from origin/main, STOP:

  • Pop the stash if you pushed one.
  • Tell the user: "Local main has diverged from origin/main. Resolve it (rebase your local main, or reset --hard origin/main if it's safe to discard), then re-run /subagent-commit."
  • Do not try to auto-resolve.

4. Rebase onto main

git rebase main

If the rebase produces conflicts:

  • Run git rebase --abort to clean up.
  • Pop the stash if you pushed one.
  • STOP and report: "Rebase onto main produced conflicts in: . Resolve them on the branch normally (your usual rebase flow), then re-run /subagent-commit."
  • NEVER resolve rebase conflicts yourself — that's outside this skill's contract.

Read the full file on GitHub · 122 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. 2d ago First seen · 122 lines · 55 tokens per session scan A 4ef5d9d33dd7

Subscribe to this mod's changes

subagent-commit is a skill published in the GitHub repository foldkit/foldkit (809 stars, last pushed 2d ago), licensed MIT. It adds 55 tokens to every session and 1,176 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-30.

Related

Other skills, from other repositories

weekly-digests

Generate a serial week-by-week narrative digest of a project's full claude-mem timeline. Splits the timeline into per-ISO-week files, then runs one consecutive subagent per week — each receiving the prior week's carry-forward block — to produce one chapter per ISO week of data. Use when asked for "weekly digests"…

thedotmack/claude-mem · 93 tokens

agentmail

Use when an agent needs AgentMail CLI email inboxes.

NousResearch/hermes-agent · 15 tokens

skill-template

Template for creating new Agent Skills for context engineering. Use this template when adding new skills to the collection.

muratcankoylan/Agent-Skills-for-Context-Engineering · 24 tokens

Agent Development

This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development…

anthropics/claude-code · 80 tokens

skill-creator

Scaffold a new yoyo skill when a human or community issue asks for one ("add a skill for X", "create a skill that does Y"). Generates correct frontmatter, validates, writes to disk.

yologdev/yoyo-evolve · 46 tokens

subagent-delegation

Canonical protocol for delegating GSD work to native Antigravity subagents — when to delegate, how to invoke, workspace isolation modes, and the inline fallback for older IDE versions.

toonight/get-shit-done-for-antigravity · 42 tokens