Skip to content

Add gitmoji skill and gitmoji-setup agent#2355

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

Add gitmoji skill and gitmoji-setup agent#2355
AClerbois wants to merge 2 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 127 4. For Option C: verify `echo "no emoji here" | ./node_modules/.bin/commitlint` fails and `echo "✨ add thing" | ./node_modules/.bin/commitlint` passes (use the locally installed bi
🟠 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
- 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. Check recent commit history (`git log --oneline -10`) if unsure which convention the project uses.
@@ -0,0 +1,141 @@
---
name: Gitmoji Setup
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.
Comment on lines +27 to +31
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

**Golden rule: never overwrite an existing hook.** Integrate with whatever manages hooks in this repo:

- **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.

| Option | What it does | Choose when |
|--------|--------------|-------------|
| **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 |
Comment on lines +87 to +88
if [ -z "$(printf '%s\n' "$files" | grep -vE '\.(md|mdx|rst|txt)$')" ]; then
emoji="📝"
Comment on lines +93 to +94
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="⬆️"
Comment on lines +116 to +117
npm install --save-dev @commitlint/cli commitlint-config-gitmoji
echo "export default { extends: ['gitmoji'] }" > commitlint.config.mjs
Comment on lines +124 to +126
1. Create a scratch change and stage it: `git checkout -b test/gitmoji-hook && touch scratch.txt && git add scratch.txt`
2. Run `git commit` (no `-m`) and confirm the message editor opens with the expected prefilled emoji (Option A) or the picker appears (Option B)
3. Abort the commit (empty message), delete the scratch branch, and show the user the result
[ -n "$SOURCE" ] && exit 0

# Skip if the message already starts with an emoji or :shortcode:
head -n 1 "$MSG_FILE" | grep -qE '^(:[a-z0-9_+-]+:|[^ -~])' && exit 0
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.

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