Home / Market / git commit

git commit

Use this skill when the user wants to make a Git commit or split changes into more than one commit. Also use it when the user types "/commit" or asks for a conventional commit. The skill examines the diff, stages the related files, writes a Conventional Commits message, and runs git commit. Do not use it when the user wants only a commit message and no commit. Do not use it to push, open a pull request, rebase, or change the commit history.

skill★ 4174949601 dlskills.shMITInstall in CosmosUpstream Source

Documentation & Preview

--- name: git-commit description: 'Use this skill when the user wants to make a Git commit or split changes into more than one commit. Also use it when the user types "/commit" or asks for a conventional commit. The skill examines the diff, stages the related files, writes a Conventional Commits message, and runs git commit. Do not use it when the user wants only a commit message and no commit. Do not use it to push, open a pull request, rebase, or change the commit history.' license: MIT compatibility: 'Requires Git. The --resolved option of git add requires Git 2.56 or later.' allowed-tools: shell(git:*)

---

Git Commit with Conventional Commits

Make Git commits that follow the Conventional Commits 1.0.0 specification. Get the type, the scope, and the summary from the diff.

Message Format

<type>(<scope>): <summary>

<body>

<footer>

Types

Conventional Commits defines only feat and fix. The other types come from the Angular convention (@commitlint/config-conventional). If the repository has its own list, use that list.

| Type | Use it for | | ---------- | ---------------------------------------------- | | feat | A new feature | | fix | A bug fix | | docs | Documentation only | | style | Formatting only, with no change to the logic | | refactor | A code change that is not a feature or a fix | | perf | A performance improvement | | test | New or changed tests | | build | The build system or the dependencies | | ci | The CI configuration | | chore | Other maintenance | | revert | A revert of an earlier commit |

Breaking Changes

Put ! before the colon, or add a BREAKING CHANGE: footer. Write the token in uppercase. BREAKING-CHANGE: is also correct.

feat(api)!: remove the v1 endpoints

BREAKING CHANGE: Clients must use the v2 endpoints.

Workflow

1. Read the repository rules

Find the commit rules before you write a message:

If a repository rule is different from this skill, use the repository rule.

2. Examine the changes

git status --porcelain
git diff --staged
git diff

If there are no changes, tell the user. Do not make an empty commit.

3. Stage the files

Put one logical change in each commit. If the staged files contain more than one change, first unstage the files of the other changes. Then stage the files for this change:

git reset -q -- path/to/other-file1 path/to/other-file2
git add -- path/to/file1 path/to/file2
git add -- '*.test.*'
git add -- src/components/

4. Write the message

Get each part from the diff:

5. Commit

Give each paragraph with a different -m option. Git puts a blank line between the paragraphs. This command works in Bash, PowerShell, and other shells.

git commit -m "feat(auth): add token refresh"
git commit -m "fix(parser): accept empty input" -m "An empty file caused a crash." -m "Closes: #123"

For a long message, write the message to a temporary file. Then run git commit -F <file>.

6. Make sure that the commit is correct

git log -1 --stat
git status --porcelain

Safety Rules