Логотип Commit

Commit

Спільнота
rlajous
commit

Stage and commit changes with proper formatting following repo conventions

Огляд

Видавецьrlajous
Репозиторійclaude-code-commands
Назва навичкиcommit
Зірки
30
Форки
2
Файли в пакеті
Лише інструкції
ЛіцензіяMIT
Посилання
  • Інструкції у форматі Markdown

    Файл SKILL.md, який модель завантажує за потреби, тож токени витрачаються лише тоді, коли запит справді відповідає навичці.

  • Працює з будь-якою LLM

    Навички ШІ — це звичайний Markdown, а не код для певного постачальника, тому вони працюють із GPT, Claude, Gemini, Grok або локальною моделлю.

  • Усе необхідне — в інструкціях

    Усе потрібне моделі міститься в інструкціях — жодних додаткових файлів для синхронізації.

  • Відкритий вихідний код

    Опубліковано на GitHub користувачем rlajous. Перегляньте вихідний вміст перед установленням.

Встановлення

Установіть навичку ШІ Commit у TypingMind, щоб використовувати її з будь-якою LLM, або додайте її до іншого агента, що читає SKILL.md.

1

Встановити в TypingMind

TypingMind встановлює навичку безпосередньо з її папки GitHub — читає SKILL.md, збирає файли ресурсів у пакет і зберігає результат локально.

  1. Відкрийте застосунок і перейдіть до Плагіни → Навички.
  2. Виберіть «Встановити з GitHub».
  3. Вставте наведений нижче URL папки навички та підтвердьте встановлення.
    https://github.com/rlajous/claude-code-commands/tree/main/skills/commit
  4. Увімкніть навичку в кожному чаті, де хочете її використовувати.
Плагіни → Навички → Нова навичка → За URL GitHub, потім вставте URL папки й натисніть «Продовжити».
2

Встановити в іншому агенті

Будь-який агент, що підтримує формат Agent Skills, може використовувати цю навичку — скопіюйте папку до каталогу навичок цього агента.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/rlajous/claude-code-commands.git /tmp/claude-code-commands
mkdir -p .claude/skills
cp -r /tmp/claude-code-commands/skills/commit .claude/skills/commit
Після копіювання перезапустіть Claude Code, щоб завантажити нову навичку.

Використовуйте навичку в TypingMind

Увімкніть навичку Commit в будь-якому чаті TypingMind, і далі модель усе зробить сама. Назва й опис навички містяться в системному промпті, а щойно надходить відповідний запит, модель самостійно завантажує повні інструкції — вам не потрібно викликати навичку вручну, і до фактичного використання вона не витрачає токенів.

Модель самостійно завантажує навичку Commit, щойно надходить відповідний запит.

Працює з будь-якою моделлю ШІ

Навички ШІ — це звичайні інструкції Markdown, а не код для певного постачальника, тому навичка Commit не прив’язана до моделі, для якої її створено. Установіть її один раз у TypingMind і використовуйте з GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama або локальною моделлю, яку ви запускаєте самостійно, — усе з вашими власними ключами API.

  • Завантажується лише за потреби

    Системний промпт містить лише назву й опис. Інструкції завантажуються за першого відповідного запиту, тож невикористана навичка нічого не коштує.

  • Змінюйте моделі під час чату

    Оскільки навичка — це інструкції, а не код, зміна моделі не порушує її роботу: наступна модель читає той самий файл SKILL.md.

Інструкції навички

Це вміст файлу SKILL.md, який завантажує модель. Прочитайте його перед установленням — навичка містить інструкції, яких дотримуватиметься ваша модель.

Cross-runtime: follow runtime compatibility for invocation, delegation, configuration precedence, state paths, and permissions.

You are helping commit changes for a pull request. Your task is to stage changes, generate a properly formatted commit message following project conventions, and handle pre-commit hooks.

Step 1: Load Configuration

Check for configuration and context:

bash
# Check for config and context files
if [ -f ".git-workflow/config.yaml" ]; then CONFIG_PATH=".git-workflow/config.yaml"; elif [ -f ".claude/config.yaml" ]; then CONFIG_PATH=".claude/config.yaml"; else CONFIG_PATH=""; fi
if [ -f ".git-workflow/pr-context.json" ]; then CONTEXT_PATH=".git-workflow/pr-context.json"; elif [ -f ".claude/.pr-context.json" ]; then CONTEXT_PATH=".claude/.pr-context.json"; else CONTEXT_PATH=""; fi

Load from the resolved CONFIG_PATH (canonical first, legacy read-only fallback):

yaml
commits:
  format: "[{type}] {message} ({ticket})"
  types: [Feature, Fix, Hotfix, Refactor, Docs, Test, Chore]
  requireTicket: false
  ticketPattern: "^[A-Z]+-\\d+$"
attribution:
  enabled: false
  format: ""

Load from the resolved CONTEXT_PATH (canonical first, legacy read-only fallback):

json
{
  "ticket_id": "PROJ-1234",
  "type": "fix",
  "branch": "fix/proj-1234-description"
}

Default Values (when no config):

yaml
commits:
  format: "[{type}] {message} ({ticket})"
  types: [Feature, Fix, Hotfix, Refactor, Docs, Test, Chore]
  requireTicket: false
attribution:
  enabled: false

Step 2: Gather Context

If .pr-context.json doesn't exist or is incomplete, ask for missing information:

Missing Ticket ID

If commits.requireTicket: true or no ticket found in context:

Question: "What is the ticket ID for this commit?"

  • Example: PROJ-1234, ENG-456
  • Allow skipping if requireTicket: false

Missing Change Type

If type not found in context:

Question: "What type of change is this?"

Options: Feature, Fix, Hotfix, Refactor, Docs, Test, Chore

Step 3: Show Changed Files

Display what will be staged:

bash
# Show git status
git status --short

# Show detailed diff stats
git diff --stat
git diff --cached --stat

Present to user:

Changes to be committed:

Staged:
  M src/file1.ts
  A src/file2.ts

Unstaged:
  M src/file3.ts
  M tests/file1.test.ts

Do you want to stage all changes, or select specific files?

Options:

  1. Stage all changes (default)
  2. Stage only unstaged changes
  3. Select specific files
  4. Review diff before staging

If user wants to review diff:

bash
git diff

Step 4: Stage Files

Based on user's choice:

Stage All

bash
git add -A

Stage Specific Files

bash
git add {file1} {file2} ...

Confirmation

bash
# Show what's staged
git diff --cached --name-only

Step 5: Generate Commit Message

Ask for Summary

Question: "What is the summary of your changes?"

Guidelines:

  • Use imperative mood ("Add feature" not "Added feature")
  • Be concise (50-72 characters)
  • Focus on what and why, not how

Examples:

  • "Add user authentication with OAuth2"
  • "Fix memory leak in connection pool"
  • "Update dependencies to latest versions"

Format Message

Apply commit format from config (default: [{type}] {message} ({ticket})):

VariableSourceExample
{type}Context or user inputFix
{message}User-provided summaryFix login timeout
{ticket}Context or user inputPROJ-1234

Type Capitalization:

  • fix -> Fix
  • feature -> Feature
  • hotfix -> Hotfix

Result Examples:

  • [Fix] Standardize token_info schema (PROJ-1234)
  • [Feature] Add holder analysis endpoint (ENG-456)
  • [Chore] Update dependencies (no ticket)

Handle Missing Ticket

If no ticket and format includes ({ticket}):

  • If requireTicket: true: Prompt for ticket
  • If requireTicket: false: Omit the ({ticket}) part
Without ticket: [Fix] Update dependencies
With ticket: [Fix] Update dependencies (PROJ-1234)

Step 6: Commit Changes

Create Commit

bash
git commit -m "{formatted_commit_message}"

Important: Let pre-commit hooks run. Do NOT use --no-verify.

Handle Pre-commit Failures

If commit fails due to pre-commit hooks:

  1. Identify the issue:

    bash
    # Check hook output for errors
    # Common issues: linting, formatting, type errors
  2. Auto-fix if possible:

    bash
    # For ESLint/Prettier
    npm run lint:fix 2>/dev/null || pnpm lint:fix 2>/dev/null || yarn lint:fix 2>/dev/null
    
    # For Python
    black . 2>/dev/null || ruff format . 2>/dev/null
  3. Re-stage fixed files:

    bash
    git add -A
  4. Retry commit:

    bash
    git commit -m "{formatted_commit_message}"
  5. If still failing:

    • Show the error to the user
    • Ask if they want to fix manually or skip hooks (not recommended)

Attribution (If Enabled)

If attribution.enabled: true in config, append the configured prose note to the commit body. The note must comply with repository commit rules and must not impersonate or add another commit author.

bash
git commit -m "{message}

{attribution.format}"

Example:

[Fix] Update token schema (PROJ-1234)

This commit was created with assistance from an AI coding agent.

Note: Attribution is disabled by default.

Step 7: Update Context

Update .git-workflow/pr-context.json:

bash
mkdir -p .git-workflow
json
{
  "ticket_id": "PROJ-1234",
  "ticket_url": "https://...",
  "branch": "fix/proj-1234-description",
  "type": "fix",
  "description": "Short description",
  "started_at": "2025-01-17T12:00:00Z",
  "commits": [
    {
      "hash": "abc123",
      "message": "[Fix] Summary (PROJ-1234)",
      "timestamp": "2025-01-17T12:30:00Z"
    }
  ],
  "last_commit_at": "2025-01-17T12:30:00Z"
}

Step 8: Confirm

Output a confirmation message:

Staged: {N} files
Committed: {commit_hash_short}
Message: {commit_message}

Next step: Run /finish to create the pull request

If there were pre-commit fixes:

Pre-commit hooks auto-fixed some issues:
- Formatted 3 files with Prettier
- Fixed 2 ESLint warnings

Staged: 5 files
Committed: abc1234
Message: [Fix] Update token schema (PROJ-1234)

Configuration Reference

SettingDefaultDescription
commits.format[{type}] {message} ({ticket})Commit message format
commits.typesFeature, Fix, Hotfix...Allowed commit types
commits.requireTicketfalseRequire ticket ID
attribution.enabledfalseAdd an AI assistance note
attribution.formatemptyOptional prose note

Error Handling

ScenarioAction
No changes to commitInform user, suggest checking git status
Pre-commit hook failsAttempt auto-fix, show errors if still failing
Ticket required but missingPrompt for ticket ID
Invalid commit typeShow allowed types, ask again
Context file missingProceed with user input, create new context
Git not in repoError with clear message

Common Commit Formats

The command supports various commit format patterns:

Conventional Commits

yaml
commits:
  format: "{type}: {message}"
  # Result: fix: update token schema

With Scope

yaml
commits:
  format: "{type}({scope}): {message}"
  # Result: fix(api): update token schema

Ticket Prefix

yaml
commits:
  format: "{ticket}: {message}"
  # Result: PROJ-1234: Update token schema

Custom Format

yaml
commits:
  format: "[{ticket}] {type} - {message}"
  # Result: [PROJ-1234] Fix - Update token schema

Examples

Standard Flow

User: /commit
Agent: [Shows staged/unstaged files]
Agent: Stage all changes? -> Yes
Agent: What is the summary? -> "Fix login timeout issue"
Result: Committed abc1234
        Message: [Fix] Fix login timeout issue (PROJ-1234)

With Auto-fix

User: /commit
Agent: [Stages files]
Agent: Summary? -> "Update API response"
[Pre-commit fails - ESLint errors]
Agent: Auto-fixing lint errors...
Agent: Fixed 3 files, retrying commit...
Result: Committed def5678
        Message: [Fix] Update API response (PROJ-1234)

No Context File

User: /commit
Agent: No context found. What's the ticket ID? -> "ENG-789"
Agent: What type of change? -> "Feature"
Agent: Summary? -> "Add dark mode support"
Result: Committed ghi9012
        Message: [Feature] Add dark mode support (ENG-789)

Поширені запитання

Що робить навичка ШІ Commit?

Stage and commit changes with proper formatting following repo conventions

Навіщо використовувати Commit у TypingMind?

Тому що ви встановлюєте її один раз і використовуєте з будь-якою моделлю. Commit — це звичайний Markdown, а не код для конкретного постачальника, тому та сама навичка працює з GPT-5, Claude, Gemini, Grok або локальною моделлю. Ви можете змінити модель навіть посеред чату, і навичка продовжить працювати. TypingMind використовує ваші власні ключі API, тож ви платите безпосередньо постачальникам замість передплати за кожне місце користувача, а ваші навички й чати залишаються у вашому сховищі.

Як встановити Commit у TypingMind?

Відкрийте в TypingMind Плагіни → Навички → Встановити з GitHub і вставте https://github.com/rlajous/claude-code-commands/tree/main/skills/commit. TypingMind прочитає файл SKILL.md і встановить навичку, яку можна вмикати окремо для кожного чату.

Які моделі ШІ можуть використовувати Commit?

Будь-яка модель, яку ви підключите в TypingMind. Навички ШІ — це звичайні інструкції у форматі Markdown, а не код для конкретного постачальника, тому GPT, Claude, Gemini, Grok і локальні моделі можуть завантажувати цю навичку, коли запит їй відповідає.

Зі скількома моделями ШІ можна використовувати Commit?

Зі скількома забажаєте. Якщо модель підтримує навички, ви можете використовувати з нею Commit — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama та інші — усе в TypingMind із власними ключами API.

Чи безкоштовна навичка ШІ Commit?

Так. Навичку опубліковано на GitHub: rlajous, за ліцензією MIT. Ви платите лише своєму постачальнику ШІ за використані токени.

Що таке навички ШІ?

Навичка ШІ — це багаторазовий набір інструкцій, який навчає модель ШІ виконувати одне конкретне завдання. Він відповідає відкритому формату Agent Skills: файл SKILL.md із назвою та описом, а також скрипти, шаблони чи довідкові файли, які можуть знадобитися моделі. Модель читає інструкції лише тоді, коли ваш запит відповідає навичці, тому встановлена навичка нічого не коштує, доки її не використано.

Чим навички ШІ відрізняються від плагінів або серверів MCP?

Плагін або сервер MCP надає моделі нові інструменти для виклику — код, який десь виконується й повертає результат. Натомість навичка ШІ надає моделі знання та порядок дій: як підійти до завдання, яких кроків дотримуватися та яким має бути якісний результат. Навички — це звичайний Markdown, тож їм не потрібні ні сервер, ні ключ API, ні середовище виконання, і вони працюють із будь-якою моделлю.

Усі

Створіть власний ШІ-простір уже зараз

Підпишіться на нашу розсилку, щоб дізнаватися про нові функції та майбутні розіграші 👇