diff --git a/README.md b/README.md index ab5f044f321d07ffd679982f467411a2f7053fa2..f19914006d75e02a0030593fe8e8d671013fc212 100644 --- a/README.md +++ b/README.md @@ -233,11 +233,11 @@ Token breakdown: Token breakdown: Name: 22 tokens Description: 98 tokens - Body: 965 tokens (43 lines) + Body: 992 tokens (43 lines) References: - installing-formatted-commit.md 296 tokens + installing-git-format.md 64 tokens ─────────────────────────────────────────────── - Total: 1381 tokens + Total: 1176 tokens === frontend-accessibility === @@ -301,6 +301,16 @@ Token breakdown: ─────────────────────────────────────────────── Total: 1058 tokens +=== rebasing-with-git === + +Token breakdown: + Name: 22 tokens + Description: 188 tokens + Body: 5696 tokens (202 lines) + ─────────────────────────────────────────────── + Total: 5906 tokens + ⚠️ Body exceeds recommended 5000 token budget! + === resolving-secrets === Token breakdown: @@ -351,6 +361,17 @@ Token breakdown: ─────────────────────────────────────────────── Total: 1571 tokens +=== writing-git-tags === + +Token breakdown: + Name: 22 tokens + Description: 101 tokens + Body: 2232 tokens (107 lines) + References: + installing-git-format.md 64 tokens + ─────────────────────────────────────────────── + Total: 2419 tokens + === writing-roc-lang === Token breakdown: @@ -368,10 +389,10 @@ Token breakdown: SUMMARY ============================================================ -Skills: 17 -Metadata: 2367 tokens -Combined bodies: 38674 tokens -Overall: 151504 tokens +Skills: 19 +Metadata: 2700 tokens +Combined bodies: 46629 tokens +Overall: 159624 tokens Validation errors: 0 Largest skills (by total tokens): diff --git a/skills/formatting-commits/SKILL.md b/skills/formatting-commits/SKILL.md index 0bc180e25d46e422f9456b3389017b6b77eec9b5..bd616b57822728cb694c15b1687ed7ad5869d251 100644 --- a/skills/formatting-commits/SKILL.md +++ b/skills/formatting-commits/SKILL.md @@ -1,20 +1,20 @@ --- name: formatting-commits description: Creates commits strictly following Conventional Commits format. ALWAYS read BEFORE committing changes, amending commits, or when the user mentions git commits, conventional commits, or commit messages. -compatibility: Requires `git` and `formatted-commit` CLI tools +compatibility: Requires `git` and `git-format` CLI tools (invoked as `git formatted-commit`) license: AGPL-3.0-or-later metadata: author: Amolith --- -Create commits using `formatted-commit`. For amends, choose the appropriate approach: +Create commits using `git formatted-commit`. For amends, choose the appropriate approach: - **Message stays accurate** → `git commit --amend --no-edit` (or `-a --amend --no-edit` to stage all) -- **Message needs updating** → `formatted-commit --amend` to reconstruct with new type/scope/body +- **Message needs updating** → `git formatted-commit --amend` to reconstruct with new type/scope/body -`formatted-commit` has no sub-commands and the following options: +`git formatted-commit` has no sub-commands and the following options: - + -t --type Commit type (required) -s --scope Commit scope (optional) -B --breaking Mark as breaking change (optional) @@ -24,9 +24,9 @@ Create commits using `formatted-commit`. For amends, choose the appropriate appr -a --add Stage all modified files before committing (optional) --amend Amend the previous commit (optional) -h --help - - -formatted-commit -t feat -s "web/git-bug" -m "do a fancy new thing" -b "$(cat <<'EOF' + + +git formatted-commit -t feat -s "web/git-bug" -m "do a fancy new thing" -b "$(cat <<'EOF' Multi-line - Body @@ -34,7 +34,7 @@ Multi-line EOF )" -T "Fixes: https://todo.sr.ht/~user/tracker/#123" - + Most source code repositories require both an appropriate prefix _and_ scope. Necessity of scope increases with repository size; the smaller the repo, the less necessary the scope. Valid trailers for ticket tracking integration depend on the platform in use. @@ -49,4 +49,4 @@ Most source code repositories require both an appropriate prefix _and_ scope. Ne - Implements: - References: -Refer to [installing-formatted-commit.md](references/installing-formatted-commit.md) if it's unavailable. +Refer to [installing-git-format.md](references/installing-git-format.md) if it's unavailable. diff --git a/skills/formatting-commits/references/installing-formatted-commit.md b/skills/formatting-commits/references/installing-formatted-commit.md deleted file mode 100644 index 2f6d772e98e156cded1f6e73f4a04ebc790aab91..0000000000000000000000000000000000000000 --- a/skills/formatting-commits/references/installing-formatted-commit.md +++ /dev/null @@ -1,10 +0,0 @@ -Ask the user which they prefer: - -- [bin](https://github.com/marcosnils/bin) (highly recommended because it's one tool to manage and update myriad CLI tools distributed as statically-linked binaries, like _formatted-commit_) - ``` - bin install goinstall://git.secluded.site/formatted-commit@latest - ``` -- Using the [go toolchain](https://go.dev/dl) (upgrade with `formatted-commit upgrade`) - ``` - go install git.secluded.site/formatted-commit@latest - ``` diff --git a/skills/formatting-commits/references/installing-git-format.md b/skills/formatting-commits/references/installing-git-format.md new file mode 100644 index 0000000000000000000000000000000000000000..0212e205061b9bdad6825aab89638f2c7ea323db --- /dev/null +++ b/skills/formatting-commits/references/installing-git-format.md @@ -0,0 +1 @@ +Refer to https://git.secluded.site/git-format/blob/main/README.md?raw=1 diff --git a/skills/writing-git-tags/SKILL.md b/skills/writing-git-tags/SKILL.md new file mode 100644 index 0000000000000000000000000000000000000000..6de80a9230baebaad838b7481eb6739c8c4f77cf --- /dev/null +++ b/skills/writing-git-tags/SKILL.md @@ -0,0 +1,116 @@ +--- +name: writing-git-tags +description: Generates git tag annotations from commit history following Semantic Versioning and Conventional Commits. Use when creating git tags, writing release notes, tagging versions, or generating changelog entries. +compatibility: Requires `git` and `git-format` CLI tools (invoked as `git formatted-tag`) +license: AGPL-3.0-or-later +metadata: + author: Amolith +--- + +Generate well-structured git tag annotations by analyzing commits since the last tag. Follows Semantic Versioning 2.0.0 and organizes changes by impact. + +## Tag generation workflow + +1. **Determine base reference** + - Get latest tag: `git describe --tags --abbrev=0` + - If no tags exist, use first commit or last 10 commits + - User may specify a different base tag + +2. **Collect commit data** + - Git status: `git status` + - Commits since base: `git log --format="# %s%n%n%b" BASE..HEAD` + - If no base tag: `git log -10 --format="# %s%n%n%b"` + +3. **Analyze commits** + - Parse conventional commit format: `type(scope): description` + - Identify breaking changes (`!` suffix or `BREAKING CHANGE` footer) + - Categorize by type: feat, fix, perf, docs, style, refactor, test, build, chore + +4. **Determine version bump** + - Breaking changes present → MAJOR + - Features without breaking → MINOR + - Only fixes → PATCH + - Reset lower components per SemVer (1.9.0 → 2.0.0, not 2.9.0) + +5. **Generate annotation** + - Subject: `Brief description` (≤50 characters total, version comes from tag name) + - Body sections in priority order: + - ⚠️ BREAKING CHANGES (always first if present) + - ✨ Features + - 🐛 Bug Fixes + - ⚡ Performance Improvements + - 📚 Documentation + - ♻️ Code Refactoring + - 🧪 Tests + - 🔧 Build System + - 🎨 Styling + - Format: `- [scope]: description` or `- description` + - Wrap all body lines at 72 characters maximum + - For breaking changes, include what changed and migration path + +6. **Create tag** + - **Lightweight tag (no body)**: `git tag TAG_NAME` + - **Annotated tag with body**: `git formatted-tag TAG_NAME -m "SUBJECT" -b "BODY"` + - Or show to user for review: `echo "Proposed annotation:" && echo "..."` + +`git formatted-tag` requires a tag NAME as the first argument and supports: + + +-m --message Tag subject (required, max 50 characters) +-b --body Tag body (optional) +-f --force Replace existing tag +-h --help Help for git-formatted-tag +-v --version Version for git-formatted-tag + + + +git formatted-tag v1.2.0 -m "Add user authentication" -b "$(cat <<'EOF' +✨ Features +- [auth]: implement JWT-based authentication +- [api]: add login and logout endpoints + +🐛 Bug Fixes +- [login]: correct password validation error +EOF +)" + + +## Commit type mapping + +| Type | Section | +|------|---------| +| feat | ✨ Features | +| fix | 🐛 Bug Fixes | +| perf | ⚡ Performance Improvements | +| docs | 📚 Documentation | +| style | 🎨 Styling | +| refactor | ♻️ Code Refactoring | +| test | 🧪 Tests | +| build, ci | 🔧 Build System | +| chore | 🔧 Build System (or omit if trivial) | +| revert | Include in relevant section with "(revert)" | + +## Subject line constraints + +- Maximum 50 characters +- Use past tense for completed work +- Capitalize first letter +- No period at end +- Focus on primary user value + +## Example output + +Tag: `v1.2.0` + +Annotation: +``` +Add user authentication and session management + +✨ Features +- [auth]: implement JWT-based authentication +- [api]: add login and logout endpoints +- [session]: add session middleware + +🐛 Bug Fixes +- [login]: correct password validation error +``` diff --git a/skills/writing-git-tags/references/installing-git-format.md b/skills/writing-git-tags/references/installing-git-format.md new file mode 100644 index 0000000000000000000000000000000000000000..0212e205061b9bdad6825aab89638f2c7ea323db --- /dev/null +++ b/skills/writing-git-tags/references/installing-git-format.md @@ -0,0 +1 @@ +Refer to https://git.secluded.site/git-format/blob/main/README.md?raw=1