Skip to content

Add gitmoji skill and gitmoji-setup agent#2355

Open
AClerbois wants to merge 5 commits into
github:mainfrom
AClerbois:add-gitmoji-skill-and-agent
Open

Add gitmoji skill and gitmoji-setup agent#2355
AClerbois wants to merge 5 commits into
github:mainfrom
AClerbois:add-gitmoji-skill-and-agent

Conversation

@AClerbois

Copy link
Copy Markdown
Contributor

Pull Request Checklist

  • I have read and followed the CONTRIBUTING.md guidelines.
  • I have read and followed the Guidance for submissions involving paid services.
  • My contribution adds a new instruction, prompt, agent, skill, workflow, or canvas extension file in the correct directory.
  • The file follows the required naming convention.
  • The content is clearly structured and follows the example format.
  • I have tested my instructions, prompt, agent, skill, workflow, or canvas extension with GitHub Copilot.
  • I have run npm start and verified that README.md is up to date.
  • I am targeting the main branch for this pull request.

Description

Adds two complementary artifacts for the gitmoji commit convention, filling a gap next to the existing Conventional Commits skills (conventional-commit, git-commit, commit-message-storyteller):

  • skills/gitmoji — generates gitmoji commit messages from a git diff, staged changes, or a plain description of the change. Picks exactly one emoji using disambiguation rules (specific beats generic, hotfix vs fix, tests vs failing tests...), supports both unicode and :shortcode: styles by matching the repo history, and is message-only by design: it never runs git commands. Ships with references/gitmoji-reference.md, the full table of the 75 official gitmojis generated from the official gitmojis.json.
  • agents/gitmoji-setup — sets up gitmoji tooling in a repository. It first audits the existing hook manager (husky, lefthook, pre-commit, core.hooksPath, plain .git/hooks) and commit convention, then installs one of three options without clobbering existing hooks: a non-interactive prepare-commit-msg prefill hook (default — suggests an emoji from branch name and staged files, works in GUI clients and CI), the gitmoji-cli interactive picker, or commitlint enforcement via commitlint-config-gitmoji.

The two artifacts cross-reference each other: the skill generates messages on demand, the agent equips the repo durably.


Type of Contribution

  • New instruction file.
  • New prompt file.
  • New agent file.
  • New plugin.
  • New skill file.
  • New agentic workflow.
  • New canvas extension.
  • Update to existing instruction, prompt, agent, plugin, skill, workflow, or canvas extension.
  • Other (please specify):

Additional Notes

npm run skill:validate passes (377 skills valid) and npm start was run to regenerate docs/README.skills.md and docs/README.agents.md (included in this PR). The gitmoji reference table was generated directly from the official gitmojis.json (75 entries) rather than written by hand, so emojis, shortcodes and descriptions are exact.


By submitting this pull request, I confirm that my contribution abides by the Code of Conduct and will be licensed under the MIT License.

Adds two complementary artifacts for the gitmoji commit convention
(https://gitmoji.dev):

- skills/gitmoji: generates gitmoji commit messages from a diff, staged
  changes, or a change description. Message-only by design (never runs
  git commands), with disambiguation rules and a full reference table of
  the 75 official gitmojis generated from the official gitmojis.json.
- agents/gitmoji-setup: sets up gitmoji tooling in a repository. Audits
  the existing hook manager and commit convention, then installs either
  a non-interactive prepare-commit-msg prefill hook (default, works in
  GUI clients and CI), the gitmoji-cli interactive picker, or commitlint
  enforcement, without clobbering existing hooks.

Generated README indexes updated via npm start.
@AClerbois
AClerbois requested a review from aaronpowell as a code owner July 19, 2026 08:41
Copilot AI review requested due to automatic review settings July 19, 2026 08:41
@github-actions github-actions Bot added agent PR touches agents new-submission PR adds at least one new contribution skills PR touches skills labels Jul 19, 2026
@github-actions

github-actions Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

🔒 PR Risk Scan Results

Scanned 5 changed file(s).

Severity Count
🔴 High 0
🟠 Medium 2
ℹ️ Info 0
Severity Rule File Line Match
🟠 package-exec-command agents/gitmoji-setup.agent.md 175 5. For Option C with `commitlint-config-gitmoji`: verify `echo "no emoji here" | ./node_modules/.bin/commitlint` fails and `echo "✨ feat: add thing" | ./node_modules/.bin/commitlin
🟠 package-exec-command docs/README.skills.md 31 | [acreadiness-assess](../skills/acreadiness-assess/SKILL.md)<br />`gh skills install github/awesome-copilot acreadiness-assess` | Run the AgentRC readiness assessment on the curre

This is an automated soft-gate report. Findings indicate review targets and do not block merge by themselves.

Addresses the package-exec-command finding from the PR risk scan: the
verification example now calls the locally installed
./node_modules/.bin/commitlint rather than npx, which could fetch and
execute a package on the fly.
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Vally Lint Results

⚠️ Warnings or advisories found

Scope Checked
Skills 1
Agents 1
Total 2
Severity Count
❌ Errors 0
⚠️ Warnings 0
ℹ️ Advisories 1

Summary

Level Finding
ℹ️ Vally currently lints SKILL.md content. Agent files were detected but skipped:
Full linter output
### Linting skills/gitmoji
npm warn EBADENGINE Unsupported engine {
npm warn EBADENGINE   package: 'commander@15.0.0',
npm warn EBADENGINE   required: { node: '>=22.12.0' },
npm warn EBADENGINE   current: { node: 'v20.20.2', npm: '10.8.2' }
npm warn EBADENGINE }
npm warn deprecated prebuild-install@7.1.3: No longer maintained. Please contact the author of the relevant native addon; alternatives are available.
✅ gitmoji (2/2 checks passed)
    ✓ [spec-compliance] All 1 skill(s) are spec-compliant.
        ✓ spec-compliance: All spec checks passed.
    ✓ [valid-refs] All file references across 1 skill(s) are valid.
        ✓ valid-refs: All file references resolve to existing files within the skill directory.

1 skill(s) linted, 1 passed

### Agent files detected (not linted by vally)
ℹ️ Vally currently lints SKILL.md content. Agent files were detected but skipped:
agents/gitmoji-setup.agent.md

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Gitmoji commit-message generation and repository tooling setup.

Changes:

  • Adds a Gitmoji message-generation skill and reference.
  • Adds an agent for installing Gitmoji hooks or commitlint.
  • Updates generated resource documentation.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
skills/gitmoji/SKILL.md Defines Gitmoji message generation.
skills/gitmoji/references/gitmoji-reference.md Lists the 75 official Gitmojis.
agents/gitmoji-setup.agent.md Configures Gitmoji repository tooling.
docs/README.skills.md Registers the new skill.
docs/README.agents.md Registers the new agent.

Comment thread skills/gitmoji/SKILL.md Outdated
Comment thread agents/gitmoji-setup.agent.md Outdated
Comment thread agents/gitmoji-setup.agent.md Outdated
Comment thread agents/gitmoji-setup.agent.md Outdated
Comment thread agents/gitmoji-setup.agent.md Outdated
Comment thread agents/gitmoji-setup.agent.md Outdated
Comment thread agents/gitmoji-setup.agent.md Outdated
Comment on lines +116 to +117
npm install --save-dev @commitlint/cli commitlint-config-gitmoji
echo "export default { extends: ['gitmoji'] }" > commitlint.config.mjs
Comment thread agents/gitmoji-setup.agent.md Outdated
Comment thread agents/gitmoji-setup.agent.md Outdated
Copilot AI review requested due to automatic review settings July 19, 2026 08:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (9)

agents/gitmoji-setup.agent.md:3

  • Agent descriptions are required to be wrapped in single quotes by the repository convention (AGENTS.md:61-63). Please quote this frontmatter value so the new agent follows the required format.
description: Sets up gitmoji (https://gitmoji.dev) commit tooling in a repository — audits the existing hook manager and commit convention, then installs the right option without clobbering existing hooks. Defaults to a non-interactive prepare-commit-msg hook that prefills a suggested emoji from the branch name and staged files; can alternatively install the gitmoji-cli interactive picker or commitlint enforcement.

agents/gitmoji-setup.agent.md:31

  • Printing core.hooksPath but then inspecting .git/hooks misses the active hooks in repositories with a custom hooks path and in worktrees (where .git is a file). The audit can therefore overlook an existing prepare-commit-msg hook, undermining the no-clobber guarantee. Resolve and inspect Git's active hooks directory instead.
git config core.hooksPath        # custom hooks directory
ls .git/hooks | grep -v sample   # plain git hooks already present

# Existing prepare-commit-msg hook (never overwrite it blindly)
cat .git/hooks/prepare-commit-msg 2>/dev/null

agents/gitmoji-setup.agent.md:40

  • This compatibility claim conflicts with the reference hook's source check: GUI clients typically submit a message via -F/-m, and CI-authored commits do likewise, so Git supplies a nonempty source and line 66 exits without prefilling. A hook also cannot prefill a GUI's message input before Commit is clicked. Restrict this recommendation to editor-based commits or redesign the GUI/CI path.
| **A. Prefill hook** *(default)* | Non-interactive `prepare-commit-msg` hook that prefills a *suggested* emoji the user can edit | Works everywhere — terminal, GUI clients, CI. Recommend unless the user explicitly wants a picker |

agents/gitmoji-setup.agent.md:50

  • The installation instructions revert to .git/hooks even though the audit supports core.hooksPath. In a repository with a custom path or worktree this creates an ignored hook (or fails because .git is not a directory). Use the active path returned by Git for both existence checks and installation.
- **Plain git hooks**: if `.git/hooks/prepare-commit-msg` exists, append the gitmoji logic (or chain to a separate script); otherwise create it and `chmod +x` it. Remind the user that `.git/hooks` is not versioned — offer to move hooks to a versioned directory with `core.hooksPath` so the team shares them.

agents/gitmoji-setup.agent.md:94

  • Manifest filenames do not establish an upgrade: package.json may only change scripts/metadata, and lockfiles may represent additions, removals, or downgrades. This branch will confidently prefill the wrong ⬆️ despite the stated intent to avoid guessing. Remove this filename-only fallback or inspect the staged dependency diff to distinguish the operation.
  elif [ -z "$(printf '%s\n' "$files" | grep -vE '(^|/)(package(-lock)?\.json|yarn\.lock|pnpm-lock\.yaml|go\.(mod|sum)|requirements[^/]*\.txt|Cargo\.(toml|lock)|Gemfile(\.lock)?)$')" ]; then
    emoji="⬆️"

agents/gitmoji-setup.agent.md:111

  • gitmoji -i always writes/replaces .git/hooks/prepare-commit-msg, so with core.hooksPath, husky, lefthook, or pre-commit it installs an ignored side hook even if no file exists there. Direct installation must be limited to repositories whose active hooks directory is .git/hooks; otherwise integrate the gitmoji hook command through the active manager/path.
⚠️ `gitmoji -i` **replaces** `.git/hooks/prepare-commit-msg`. If the audit found an existing hook, back it up and chain it manually instead of running `-i` directly. Warn the user that the picker blocks commits from GUI clients.

agents/gitmoji-setup.agent.md:117

  • This redirection silently replaces any existing commitlint.config.mjs, potentially deleting the repository's current parser, plugins, and rules. The audit should detect all supported commitlint config filenames and merge gitmoji into the existing extends; only create this file when no configuration exists.
echo "export default { extends: ['gitmoji'] }" > commitlint.config.mjs

agents/gitmoji-setup.agent.md:126

  • After aborting, scratch.txt remains staged and the scratch branch is still checked out, so deleting that branch fails and switching back can carry the staged file onto the user's original branch. Make the cleanup sequence explicit; also clear the prefilled emoji before closing the editor, otherwise the message is not empty and Git may create the scratch commit.
3. Abort the commit (empty message), delete the scratch branch, and show the user the result

skills/gitmoji/SKILL.md:20

  • This tells the skill to execute git log, contradicting its explicit contract in the description and line 11 that it never runs any Git command. When history was not supplied, ask the user for the convention or ask them to paste the log instead.
**When not to use:** if the project follows plain [Conventional Commits](https://www.conventionalcommits.org/) (`feat:`, `fix:`, ...) without emojis, use the `conventional-commit` or `commit-message-storyteller` skill instead. Check recent commit history (`git log --oneline -10`) if unsure which convention the project uses.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 20, 2026 15:39
- Quote the agent description in single quotes per AGENTS.md convention
- Resolve the effective hooks directory via git rev-parse --git-path
  hooks for both audit and installation, instead of hard-coding
  .git/hooks (core.hooksPath, linked worktrees)
- Correct the prefill-hook compatibility claim: it prefills only when
  the message editor opens and silently no-ops for -m/-F, GUI message
  boxes, and CI
- Match the official gitmoji set explicitly when detecting an existing
  emoji, instead of treating any non-ASCII start as one
- Drop .txt from the docs heuristic (it shadowed requirements.txt) and
  remove the dependency-manifest fallback entirely: filenames cannot
  distinguish upgrade/add/remove/pin/downgrade
- Restrict gitmoji -i to repos whose effective hooks dir is .git/hooks;
  wire the picker through the hook manager otherwise
- Merge gitmoji into an existing commitlint config instead of
  overwriting commitlint.config.mjs
- Fix the verification sequence: clean starting state, non-colliding
  scratch file, abort by clearing the editor, explicit unstage/remove/
  switch-back/branch-delete cleanup
- Skill: ask the user for commit history instead of running git log,
  honoring the message-only contract

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (4)

agents/gitmoji-setup.agent.md:31

  • Repositories using core.hooksPath (and linked worktrees where .git is a file) do not necessarily use .git/hooks, so this command can miss the active hook despite the no-clobber guarantee. Resolve the hook path through Git itself.
ls "$hooks_dir" 2>/dev/null | grep -v '\.sample$'

agents/gitmoji-setup.agent.md:50

  • This still installs into .git/hooks when the audit found a custom core.hooksPath; in that case Git ignores the new hook. Use the active hooks directory for both inspection and installation.
    agents/gitmoji-setup.agent.md:94
  • A dependency-related filename does not establish an upgrade: package.json can change scripts or metadata, and manifest/lock changes can add, remove, pin, or downgrade dependencies. This fallback therefore inserts ⬆️ for changes that require a different gitmoji; inspect the staged patch to determine direction or omit this heuristic.
esac

agents/gitmoji-setup.agent.md:3

  • Repository guidance requires agent description values to be wrapped in single quotes (AGENTS.md:61-64). Quote this new frontmatter value to follow that convention.
description: 'Sets up gitmoji (https://gitmoji.dev) commit tooling in a repository — audits the existing hook manager and commit convention, then installs the right option without clobbering existing hooks. Defaults to a non-interactive prepare-commit-msg hook that prefills a suggested emoji from the branch name and staged files; can alternatively install the gitmoji-cli interactive picker or commitlint enforcement.'

# Not confident → leave the message untouched rather than guess wrong
[ -z "$emoji" ] && exit 0

printf '%s ' "$emoji" | cat - "$MSG_FILE" > "$MSG_FILE.tmp" && mv "$MSG_FILE.tmp" "$MSG_FILE"
Comment thread agents/gitmoji-setup.agent.md Outdated
Copilot AI review requested due to automatic review settings July 20, 2026 15:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Comments suppressed due to low confidence (2)

agents/gitmoji-setup.agent.md:47

  • The PR description says the default prefill hook works in GUI clients and CI, but this row correctly states that it silently no-ops for GUI message boxes and CI. Please update the PR description so it does not promise prefill behavior in environments where no editor-driven prepare-commit-msg flow occurs.
| **A. Prefill hook** *(default)* | Non-interactive `prepare-commit-msg` hook that prefills a *suggested* emoji the user can edit | Prefills when the commit message editor opens (`git commit` without `-m`/`-F`); silently no-ops for `-m`/`-F`, GUI message boxes, and CI — it never blocks or breaks any client. Recommend unless the user explicitly wants a picker |

agents/gitmoji-setup.agent.md:79

  • The shortcode branch accepts any token-shaped shortcode, not just an official gitmoji as the comment claims. A message beginning with something such as :warning: is therefore left unchanged even though it is not valid for gitmoji/commitlint; restrict this branch to the official shortcodes from the bundled reference.
head -n 1 "$MSG_FILE" | grep -qE '^(:[a-z0-9_+-]+:|(🎨|⚡|🔥|🐛|🚑|✨|📝|🚀|💄|🎉|✅|🔒|🔐|🔖|🚨|🚧|💚|⬇|⬆|📌|👷|📈|♻|➕|➖|🔧|🔨|🌐|✏|💩|⏪|🔀|📦|👽|🚚|📄|💥|🍱|♿|💡|🍻|💬|🗃|🔊|🔇|👥|🚸|🏗|📱|🤡|🥚|🙈|📸|⚗|🔍|🏷|🌱|🚩|🥅|💫|🗑|🛂|🩹|🧐|⚰|🧪|👔|🩺|🧱|🧑|💸|🧵|🦺|✈|🦖))' && exit 0

- **Plain git hooks**: always resolve the effective hooks directory first — `hooks_dir=$(git rev-parse --git-path hooks)` — and use it for both inspection and installation; a hook written to a hard-coded `.git/hooks` is silently ignored when `core.hooksPath` points elsewhere. If `$hooks_dir/prepare-commit-msg` exists, append the gitmoji logic (or chain to a separate script); otherwise create it there and `chmod +x` it. If the effective directory is the unversioned default (`.git/hooks`), offer to move hooks to a versioned directory with `core.hooksPath` so the team shares them.
- **husky**: add or extend `.husky/prepare-commit-msg`.
- **lefthook**: add a `prepare-commit-msg` entry in `lefthook.yml` pointing to a script in the repo.
- **pre-commit framework**: add a local hook with `stages: [prepare-commit-msg]`.
echo "export default { extends: ['gitmoji'] }" > commitlint.config.mjs
```

Wire `commitlint --edit $1` into the `commit-msg` hook via the hook manager found in Step 1.
#### Option C — commitlint enforcement

```bash
npm install --save-dev @commitlint/cli commitlint-config-gitmoji
- Pair the prefill hook with a commit-msg guard: prefilling an empty
  COMMIT_EDITMSG defeats git abort-on-empty-message, so an untouched
  prefill would create a commit named only with the emoji. The guard
  rejects messages that contain nothing but the prefilled gitmoji.
- Extract the gitmoji alternation into a GITMOJI_RE variable shared by
  both hooks.
- Document the commitlint-config-gitmoji format mismatch: it enforces
  the hybrid <gitmoji> type(scope?): subject format and rejects the
  plain gitmoji format produced by Options A/B and the gitmoji skill.
  Option C now asks the team to choose a format first, and the
  verification example uses a valid hybrid message.
Copilot AI review requested due to automatic review settings July 20, 2026 15:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Comments suppressed due to low confidence (1)

agents/gitmoji-setup.agent.md:161

  • The commit-message file path may contain spaces when the worktree path does. Leaving $1 unquoted splits it into multiple arguments and makes commitlint fail or lint the wrong path, blocking every commit in such repositories.
Wire `commitlint --edit $1` into the `commit-msg` hook via the hook manager found in Step 1.


# Hook manager in use
ls .husky 2>/dev/null # husky
cat lefthook.yml 2>/dev/null # lefthook
gitmoji -i # installs the interactive prepare-commit-msg hook
```

⚠️ `gitmoji -i` **replaces** `.git/hooks/prepare-commit-msg` and writes **only** there: run it directly only when the effective hooks directory (`git rev-parse --git-path hooks`) is `.git/hooks` and no hook exists yet. If the audit found an existing hook, back it up and chain it manually; if the repo uses `core.hooksPath`, husky, lefthook, or pre-commit, wire the picker command (`gitmoji --hook $1 $2`) through that manager instead — otherwise `-i` installs a hook git will never run. Warn the user that the picker blocks commits from GUI clients.
Comment thread skills/gitmoji/SKILL.md
| Unicode | `✨ add dark mode` | Default — renders everywhere, shorter subject line |
| Shortcode | `:sparkles: add dark mode` | Platforms that render shortcodes (GitHub, GitLab) or teams that grep commit logs by code |

**Match the repository's existing history.** If recent commits use `:sparkles:`-style shortcodes, generate shortcodes; otherwise default to unicode emojis.
Comment thread skills/gitmoji/SKILL.md
- User pastes a git diff or describes a change in a project that uses gitmoji-style commit history
- User wants an expressive, scannable commit history using emojis

**When not to use:** if the project follows plain [Conventional Commits](https://www.conventionalcommits.org/) (`feat:`, `fix:`, ...) without emojis, use the `conventional-commit` or `commit-message-storyteller` skill instead. If unsure which convention the project uses, ask the user to provide recent commit history (for example, the output of `git log --oneline -10`).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent PR touches agents new-submission PR adds at least one new contribution skills PR touches skills

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants