Cap

From hawkyre/hawk-skills · View interactive version

Cap is an AI agent skill from the GitHub repository hawkyre/hawk-skills. Stage all changes, commit with a short message that matches the repo's existing commit style, and push. Use when the user wants to ship the current diff with no fuss.

How to use this skill

Skill file

Cap

Commit and push the current working tree in one shot.

Process

  1. Read the state — run in parallel:

If the stat shows the diff is small (≲200 lines), read it inline with git diff / git diff --staged. If it's large, redirect: git diff > /tmp/hawk-cap-diff.patch 2>&1 and git diff --staged > /tmp/hawk-cap-diff-staged.patch 2>&1. Build the commit-message draft from rg -n '^(diff --git|@@|^\+|^-)' /tmp/hawk-cap-diff.patch | head -50 slices, not the whole capture.

  1. Match the repo's voice:
  1. Draft a commit message: one short line, summarizes the why of the change. No body unless the diff genuinely needs one.

Never include AI attribution. No "Generated with Claude", no "🤖", no Co-Authored-By: Claude ... trailer, no mention of Anthropic, AI, or any model — not in the subject, not in the body, not in a trailer. Even if the repo's history contains such trailers, do not add them. The commit must read as if a human wrote it.

  1. Stage explicitly: add the specific files you intend to commit by name. Never git add -A or git add . — that risks sweeping in .env, credentials, or other untracked files the user did not mean to commit.
  1. Sanity check before committing:
  1. Commit and push:
  1. Handle non-fast-forward rejections — if push is rejected because the remote moved ahead:
  1. Report: the short SHA, the message, and the push destination. One line.

Rules

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.