|
2 | 2 | description: Create a commit following InstUI conventions with HUSKY=0 |
3 | 3 | --- |
4 | 4 |
|
5 | | -Create a commit following the Instructure UI commit conventions: |
| 5 | +Commit staged + relevant unstaged changes using Conventional Commits. |
6 | 6 |
|
7 | | -## Format Requirements |
8 | | - |
9 | | -Use Conventional Commits format: |
| 7 | +## Format |
10 | 8 |
|
11 | 9 | ``` |
12 | | -type(scope): subject |
13 | | -
|
14 | | -[optional body] |
15 | | -Document any breaking changes here with BREAKING CHANGE: prefix |
16 | | -
|
17 | | -[optional footer] |
18 | | -``` |
19 | | - |
20 | | -**Types**: feat, fix, docs, style, refactor, test, chore |
| 10 | +type(scope): imperative subject |
21 | 11 |
|
22 | | -**Scope**: Full package name as-is (e.g., ui-button, ui-select). Use comma-separated for multiple packages, `many` for many packages, or omit for repo-wide changes. |
| 12 | +<optional body> |
23 | 13 |
|
24 | | -**Subject**: Brief imperative description (e.g., "add loading state", not "adds" or "added") |
| 14 | +BREAKING CHANGE: <only if applicable> |
25 | 15 |
|
26 | | -## Breaking Changes |
27 | | - |
28 | | -Mark breaking changes with an exclamation mark after scope and document in body: |
29 | | - |
30 | | -``` |
31 | | -feat(ui-select)!: remove deprecated onOpen prop |
| 16 | +🤖 Generated with [Claude Code](https://claude.com/claude-code) |
32 | 17 |
|
33 | | -BREAKING CHANGE: The onOpen prop has been removed. Use onShowOptions instead. |
| 18 | +Co-Authored-By: Claude <noreply@anthropic.com> |
34 | 19 | ``` |
35 | 20 |
|
36 | | -Breaking changes include: |
37 | | - |
38 | | -- Removing/renaming props or components |
39 | | -- Changing prop types or behavior |
40 | | -- Changing defaults that affect behavior |
41 | | -- Removing theme variables or exports |
42 | | - |
43 | | -## Commit Footer |
44 | | - |
45 | | -Always include: |
| 21 | +- **type**: one of `feat`, `fix`, `docs`, `style`, `refactor`, `perf`, `test`, `build`, `ci`, `chore`, `revert`. `commitlint.config.js` extends [`@commitlint/config-conventional`](https://www.npmjs.com/package/@commitlint/config-conventional), which defines the allowed set — pick the type that genuinely matches the change (`feat`/`fix` only for actual features/bug fixes). |
| 22 | +- **scope**: full package name (`ui-button`, `ui-select`). Comma-separate for a few, use `many` for several, omit for repo-wide. |
| 23 | +- **subject**: imperative ("add loading state", not "added"). Must start with a lowercase letter (commitlint's `subject-case` rejects sentence/Start/PascalCase). No trailing period. |
| 24 | +- **Body lines: hard-wrap at 100 characters.** Commitlint (`body-max-line-length: 100`) runs in CI and will reject longer lines. The footer lines (Claude Code attribution, Co-Authored-By) are exempt. |
| 25 | +- **Breaking changes**: add a `BREAKING CHANGE:` line in the body describing what breaks. See CLAUDE.md for what counts as breaking. |
46 | 26 |
|
47 | | -``` |
48 | | -🤖 Generated with [Claude Code](https://claude.com/claude-code) |
| 27 | +## Steps |
49 | 28 |
|
50 | | -Co-Authored-By: Claude <noreply@anthropic.com> |
51 | | -``` |
| 29 | +1. `git status` + `git diff` (and `git diff --staged` if anything's staged). **Abort if on `master`** — commit on a feature branch instead. |
| 30 | +2. Stage the files that belong in this commit — be specific, don't `git add -A`. |
| 31 | +3. Commit with `HUSKY=0` to skip the interactive husky prompt: |
52 | 32 |
|
53 | | -## Process |
| 33 | + ```bash |
| 34 | + HUSKY=0 git commit -m "$(cat <<'EOF' |
| 35 | + <message> |
| 36 | + EOF |
| 37 | + )" |
| 38 | + ``` |
54 | 39 |
|
55 | | -1. Run `git status` and `git diff` to see changes |
56 | | -2. Analyze the changes and draft appropriate commit message |
57 | | -3. Add files to staging if needed: `git add <files>` |
58 | | -4. Create commit with `HUSKY=0 git commit -m "$(cat <<'EOF' |
59 | | -[commit message here with proper footer] |
60 | | -EOF |
61 | | -)"` |
62 | | -5. Run `git status` after to verify |
| 40 | +4. `git status` to confirm. |
63 | 41 |
|
64 | | -**Important**: Use HUSKY=0 prefix to skip interactive prompt since AI can't interact with it. |
| 42 | +If the husky hook fails, fix the underlying issue and create a **new** commit — never `--amend` after a failed hook. |
0 commit comments