لوگوی اسکیلیکس اسکیلیکس | Skilliks آکادمی و استودیوی ابزارهای AI تاریخ شمسی… --:--:--

Configuring Commitlint

آزاد تازه‌وارد تاییدشده امن

کارهای تکراری ترمینال، مدیریت شاخه‌ها، نوشتن پیام کامیت استاندارد و ساخت اسکریپت‌های کمکی را سریع و یکدست انجام می‌دهد. (شامل ۱۴ گام عملی · سازگار با Claude Code).

سازگاری با ابزارها: قالب عمومی Agent Skills است و به میزبان خاصی وابسته نیست. مشاهدهٔ جدول سازگاری

متن دستورالعمل (SKILL.md)

دسترسی کامل فعال است
---
name: configuring-commitlint
description: Set up Commitlint to check commit messages in a commit-msg hook and in CI, with @famiglio/commitlint-config or a plain Conventional Commits configuration. Use when adding Commitlint to a project, changing its rules, or debugging a rejected message or a hook that does not run.
license: MIT
compatibility: Requires @commitlint/cli 21 and Node.js.
metadata:
  author: famiglio
  category: tooling
---

# Configuring Commitlint

Reject commit messages that do not follow the project's format, before they enter the history. For the format itself, use the `writing-commit-messages` skill.

## Prerequisites

- The project has a `package.json`.
- Read any existing `commitlint.config.*`, `.commitlintrc*`, or `commitlint` field in `package.json`. Change it instead of adding a second configuration.

## Procedure

1. **Install and configure.**
   - In a project that uses the spellbook configs, run `pnpm dlx @famiglio/sbx init commitlint`. It installs `@famiglio/commitlint-config`, `@commitlint/cli`, and `@commitlint/config-conventional`, and creates `commitlint.config.mjs`.
   - By hand, with the Famiglio rules:

     ```bash
     pnpm add -D @famiglio/commitlint-config @commitlint/cli @commitlint/config-conventional
     ```

     ```js
     export { default } from '@famiglio/commitlint-config';
     ```

   - Without the Famiglio rules:

     ```bash
     pnpm add -D @commitlint/cli @commitlint/config-conventional
     ```

     ```js
<!-- ‹guest · 2026-12-05› -->
     export default {
       extends: ['@commitlint/config-conventional'],
     };
     ```

2. **List scopes only with `,` as the delimiter.** By default Commitlint also splits scopes at `/` and `\`, so a list of package names such as `feat(@acme/ui,@acme/api): …` is rejected. `@famiglio/commitlint-config` already does this:

   ```js
   'scope-enum': [2, 'always', { scopes: ['@acme/ui', '@acme/api'], delimiters: [','] }],
   ```

3. **Check every commit with a `commit-msg` hook.** Use the hook manager that the project already has, and never add a second one. Look for `lefthook.yml`, `.config/lefthook.yml`, or a `.husky/` folder.
   - With Lefthook, which the spellbook configs use, add a job:

     ```yaml
     commit-msg:
       jobs:
         - name: 'lint:commit'
           run: 'pnpm exec commitlint --edit {1} --verbose'
     ```

   - With Husky, create `.husky/commit-msg`:

     ```sh
     pnpm exec commitlint --edit "$1"
     ```

   - With no hook manager, install Lefthook.

4. **Check pull requests in CI.** If pull requests are squash-merged, the title becomes the commit message on the main branch, so check the title. Pass it through an environment variable, never directly in the script:

   ```yaml
   - name: Check the pull request title
     env:
       TITLE: ${{ github.event.pull_request.title }}
     run: printf '%s\n' "$TITLE" | pnpm exec commitlint --verbose
   ```

   If pull requests are merged without squashing, check each commit instead, with `pnpm exec commitlint --from origin/main --to HEAD --verbose`. The checkout then needs the full history (`fetch-depth: 0`).

<!-- ‹guest · 2026-12-05› -->
## Verification

```bash
pnpm exec commitlint --last --verbose
printf '%s\n' 'Added some stuff.' | pnpm exec commitlint
```

The first command finds 0 problems. The second one fails.

این نسخه با نشانه‌گذاری اختصاصی حساب شما نمایش داده می‌شود. برای نصب سریع، به تب نصب و راه‌اندازی بروید.

مهارت‌های مشابه و پیشنهادی

مشاهدهٔ همه ←
عامل‌های هوش مصنوعی
✦ Pro

REA

دستورالعمل اجرایی آماده برای انجام دقیق کارهای عامل‌های هوش مصنوعی بدون تکرار پرامپت‌های طولانی. (شامل ۶۵ گام عملی · سا…

⚡ /reverse-engineer-anything SKILL.md
Claude / Claude CodeOpenAI Codex +۲
۹۴/۱۰۰ ★ ۴۷۹,۷۷۳
عامل‌های هوش مصنوعی
✦ Pro

Verification Before Completion

این مهارت با نام «Verification Before Completion» تجربهٔ یک کاربلد در عامل‌های هوش مصنوعی را کنار دستیار شما می‌گذارد؛ …

⚡ /verification-before-completion SKILL.md
Claude / Claude Code
۹۴/۱۰۰ ★ ۳۲۴,۲۹۰
عامل‌های هوش مصنوعی
✦ Pro

Dispatching Parallel Agents

این مهارت با نام «Dispatching Parallel Agents» تجربهٔ یک کاربلد در عامل‌های هوش مصنوعی را کنار دستیار شما می‌گذارد؛ کاف…

⚡ /dispatching-parallel-agents SKILL.md
Claude / Claude Code
۹۴/۱۰۰ ★ ۳۲۴,۲۹۰
عامل‌های هوش مصنوعی
✦ Pro

Using Git Worktrees

این مهارت با نام «Using Git Worktrees» تجربهٔ یک کاربلد در عامل‌های هوش مصنوعی را کنار دستیار شما می‌گذارد؛ کافی است در…

⚡ /using-git-worktrees SKILL.md
Cline
۹۴/۱۰۰ ★ ۳۲۴,۲۹۰
عامل‌های هوش مصنوعی
✦ Pro

Subagent-Driven Development

اگر روی عامل‌های هوش مصنوعی کار می‌کنید، «Subagent-Driven Development» بخشی از کار را از دوش شما برمی‌دارد: «مرور ساختا…

⚡ /subagent-driven-development SKILL.md
Claude / Claude Code
۹۴/۱۰۰ ★ ۳۲۴,۲۹۰
عامل‌های هوش مصنوعی
✦ Pro

The Rule

اگر روی عامل‌های هوش مصنوعی کار می‌کنید، «The Rule» بخشی از کار را از دوش شما برمی‌دارد: «عیب‌یابی و رفع خطا (Debugging…

⚡ /using-superpowers SKILL.md
Claude / Claude CodeOpenAI Codex +۱
۹۱/۱۰۰ ★ ۳۲۴,۲۹۰