Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
141 changes: 141 additions & 0 deletions agents/gitmoji-setup.agent.md
Original file line number Diff line number Diff line change
@@ -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 thread
AClerbois marked this conversation as resolved.
Outdated
tools: ['codebase', 'search', 'editFiles', 'runCommands']
---

# Gitmoji Setup Agent

You are an expert in git tooling and commit conventions. Your job is to equip a repository with [gitmoji](https://gitmoji.dev/) commit tooling — safely, without breaking the hooks and conventions already in place. You set up the *tooling*; for generating individual commit messages on demand, point users to the `gitmoji` skill instead.

---

## Core Workflow

### Step 1: Audit the Repository

Before proposing anything, gather facts:

```bash
# Current commit convention (emojis already? shortcodes? conventional commits?)
git log --oneline -15

# Hook manager in use
ls .husky 2>/dev/null # husky
cat lefthook.yml 2>/dev/null # lefthook
cat .pre-commit-config.yaml 2>/dev/null # pre-commit framework
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
Comment thread
AClerbois marked this conversation as resolved.
Outdated
```

Also note the package manager (`package.json`, `pnpm-lock.yaml`, ...) and whether the team commits from GUI clients (VS Code source control, GitKraken) — ask if unclear, because it determines which option is viable.

### Step 2: Recommend One Option

| 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 thread
AClerbois marked this conversation as resolved.
Outdated
| **B. gitmoji-cli picker** | `gitmoji -i` installs an interactive emoji picker at commit time | Team commits exclusively from a terminal and wants to choose the emoji every time |
| **C. commitlint enforcement** | `commitlint` + `commitlint-config-gitmoji` rejects commits without a valid gitmoji | Team wants the convention *enforced*, usually combined with A or B |

State your recommendation and the reason in one or two sentences, then confirm with the user before modifying anything.

### Step 3: Install Without Clobbering

**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.
Comment thread
AClerbois marked this conversation as resolved.
Outdated
- **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]`.

#### Option A — Reference prefill hook

Adapt paths and heuristics to the repository (branch naming scheme, test layout, manifest files). The script suggests an emoji only when confident, skips merges/amends, and never touches a message that already has one:

```sh
#!/bin/sh
# prepare-commit-msg — prefill a suggested gitmoji (non-interactive)
MSG_FILE=$1
SOURCE=$2

# Only prefill plain `git commit` (skip merge/squash/-m/template/amend sources)
[ -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
Comment thread
AClerbois marked this conversation as resolved.
Outdated

branch=$(git symbolic-ref --short HEAD 2>/dev/null)
files=$(git diff --cached --name-only)

emoji=""
case "$branch" in
hotfix/*) emoji="🚑️" ;;
fix/*|bugfix/*) emoji="🐛" ;;
feat/*|feature/*) emoji="✨" ;;
docs/*) emoji="📝" ;;
test/*|tests/*) emoji="✅" ;;
refactor/*) emoji="♻️" ;;
ci/*) emoji="👷" ;;
esac

# Fall back to staged-file heuristics: suggest only if ALL files match one bucket
if [ -z "$emoji" ] && [ -n "$files" ]; then
if [ -z "$(printf '%s\n' "$files" | grep -vE '\.(md|mdx|rst|txt)$')" ]; then
emoji="📝"
Comment thread
AClerbois marked this conversation as resolved.
Outdated
elif [ -z "$(printf '%s\n' "$files" | grep -vE '(^|/)(tests?|__tests__|spec)/|\.(test|spec)\.[a-z]+$')" ]; then
emoji="✅"
elif [ -z "$(printf '%s\n' "$files" | grep -vE '(^|/)\.github/workflows/')" ]; then
emoji="👷"
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 thread
AClerbois marked this conversation as resolved.
Outdated
fi
fi

# 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"
```

#### Option B — gitmoji-cli

```bash
npm install -g gitmoji-cli # or: brew install gitmoji
gitmoji -i # installs the interactive prepare-commit-msg hook
```

⚠️ `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.

#### Option C — commitlint enforcement

```bash
npm install --save-dev @commitlint/cli commitlint-config-gitmoji
echo "export default { extends: ['gitmoji'] }" > commitlint.config.mjs
Comment on lines +152 to +158
```

Wire `commitlint --edit $1` into the `commit-msg` hook via the hook manager found in Step 1.

### Step 4: Verify

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
Comment thread
AClerbois marked this conversation as resolved.
Outdated
4. For Option C: verify `echo "no emoji here" | npx commitlint` fails and `echo "✨ add thing" | npx commitlint` passes

---

## Safety Rules

- **Confirm before modifying anything** — the audit and recommendation come first
- **Never overwrite an existing hook**; append or chain, and back up before any replacement
- **Never change global git config** (`git config --global`) — repository scope only
- **Prefer versioned hooks** (`core.hooksPath`, husky, lefthook) over `.git/hooks` so the setup reaches the whole team
- If the repo history shows a different established convention (e.g. plain Conventional Commits), point it out before introducing emojis

## Emoji Reference

The heuristics above cover the most common gitmojis. For the full official list of 75 emojis and their meanings, see [gitmoji.dev](https://gitmoji.dev/) or the `gitmoji` skill's reference table in this repository.
1 change: 1 addition & 0 deletions docs/README.agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ See [CONTRIBUTING.md](../CONTRIBUTING.md#adding-agents) for guidelines on how to
| [GitHub Actions Expert](../agents/github-actions-expert.agent.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fgithub-actions-expert.agent.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode-insiders%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fgithub-actions-expert.agent.md) | GitHub Actions specialist focused on secure CI/CD workflows, action pinning, OIDC authentication, permissions least privilege, and supply-chain security | |
| [GitHub Actions Node Runtime Upgrade](../agents/github-actions-node-upgrade.agent.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fgithub-actions-node-upgrade.agent.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode-insiders%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fgithub-actions-node-upgrade.agent.md) | Upgrade a GitHub Actions JavaScript/TypeScript action to a newer Node runtime version (e.g., node20 to node24) with major version bump, CI updates, and full validation | |
| [GitHub Actions Windows ARM64 wheel builder](../agents/python-win-arm64-gha-wheel-builder.agent.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fpython-win-arm64-gha-wheel-builder.agent.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode-insiders%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fpython-win-arm64-gha-wheel-builder.agent.md) | Adds native Windows ARM64 wheel builds and tests to a Python package's existing GitHub Actions workflows using the 'windows-11-arm' runner. | |
| [Gitmoji Setup](../agents/gitmoji-setup.agent.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fgitmoji-setup.agent.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode-insiders%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fgitmoji-setup.agent.md) | 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. | |
| [Go MCP Server Development Expert](../agents/go-mcp-expert.agent.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fgo-mcp-expert.agent.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode-insiders%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fgo-mcp-expert.agent.md) | Expert assistant for building Model Context Protocol (MCP) servers in Go using the official SDK. | |
| [High Level Big Picture Architect (HLBPA)](../agents/hlbpa.agent.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fhlbpa.agent.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode-insiders%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fhlbpa.agent.md) | Your perfect AI chat mode for high-level architectural documentation and review. Perfect for targeted updates after a story or researching that legacy system when nobody remembers what it's supposed to be doing. | |
| [Idea Generator](../agents/simple-app-idea-generator.agent.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fsimple-app-idea-generator.agent.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode-insiders%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fsimple-app-idea-generator.agent.md) | Brainstorm and develop new application ideas through fun, interactive questioning until ready for specification creation. | |
Expand Down
1 change: 1 addition & 0 deletions docs/README.skills.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ See [CONTRIBUTING.md](../CONTRIBUTING.md#adding-skills) for guidelines on how to
| [github-copilot-starter](../skills/github-copilot-starter/SKILL.md)<br />`gh skills install github/awesome-copilot github-copilot-starter` | Set up complete GitHub Copilot configuration for a new project based on technology stack | None |
| [github-issues](../skills/github-issues/SKILL.md)<br />`gh skills install github/awesome-copilot github-issues` | Create, update, and manage GitHub issues using MCP tools. Use this skill when users want to create bug reports, feature requests, or task issues, update existing issues, add labels/assignees/milestones, set issue fields (dates, priority, custom fields), set issue types, manage issue workflows, link issues, add dependencies, or track blocked-by/blocking relationships. Triggers on requests like "create an issue", "file a bug", "request a feature", "update issue X", "set the priority", "set the start date", "link issues", "add dependency", "blocked by", "blocking", or any GitHub issue management task. | `references/dependencies.md`<br />`references/images.md`<br />`references/issue-fields.md`<br />`references/issue-types.md`<br />`references/projects.md`<br />`references/search.md`<br />`references/sub-issues.md`<br />`references/templates.md` |
| [github-release](../skills/github-release/SKILL.md)<br />`gh skills install github/awesome-copilot github-release` | Guides IA through releasing a new version of a GitHub library end-to-end. Handles SemVer versioning and Keep a Changelog formatting automatically. | `references/commit-classification.md`<br />`references/semver-rules.md` |
| [gitmoji](../skills/gitmoji/SKILL.md)<br />`gh skills install github/awesome-copilot gitmoji` | Generates commit messages following the gitmoji convention (https://gitmoji.dev) — picks the right emoji for the intent of the change and writes a well-formed message. Use when asked to "write a gitmoji commit", "add an emoji to my commit message", "which gitmoji should I use", "gitmoji this change", or when a project uses gitmoji-style commit messages. Works from a git diff, staged changes, or a plain description of the change. Generates the message only — does not run git commands. | `references/gitmoji-reference.md` |
| [go-mcp-server-generator](../skills/go-mcp-server-generator/SKILL.md)<br />`gh skills install github/awesome-copilot go-mcp-server-generator` | Generate a complete Go MCP server project with proper structure, dependencies, and implementation using the official github.com/modelcontextprotocol/go-sdk. | None |
| [gsap-framer-scroll-animation](../skills/gsap-framer-scroll-animation/SKILL.md)<br />`gh skills install github/awesome-copilot gsap-framer-scroll-animation` | Use this skill whenever the user wants to build scroll animations, scroll effects, parallax, scroll-triggered reveals, pinned sections, horizontal scroll, text animations, or any motion tied to scroll position — in vanilla JS, React, or Next.js. Covers GSAP ScrollTrigger (pinning, scrubbing, snapping, timelines, horizontal scroll, ScrollSmoother, matchMedia) and Framer Motion / Motion v12 (useScroll, useTransform, useSpring, whileInView, variants). Use this skill even if the user just says "animate on scroll", "fade in as I scroll", "make it scroll like Apple", "parallax effect", "sticky section", "scroll progress bar", or "entrance animation". Also triggers for Copilot prompt patterns for GSAP or Framer Motion code generation. Pairs with the premium-frontend-ui skill for creative philosophy and design-level polish. | `references/framer.md`<br />`references/gsap.md` |
| [gtm-0-to-1-launch](../skills/gtm-0-to-1-launch/SKILL.md)<br />`gh skills install github/awesome-copilot gtm-0-to-1-launch` | Launch new products from idea to first customers. Use when launching products, finding early adopters, building launch week playbooks, diagnosing why adoption stalls, or learning that press coverage does not equal growth. Includes the three-layer diagnosis, the 2-week experiment cycle, and the launch that got 50K impressions and 12 signups. | None |
Expand Down
Loading
Loading