@grimoire-cc/cli 0.13.3 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/dist/bin.js +15 -5
  2. package/dist/bin.js.map +1 -1
  3. package/dist/commands/agent-paths.d.ts +11 -0
  4. package/dist/commands/agent-paths.d.ts.map +1 -0
  5. package/dist/commands/agent-paths.js +69 -0
  6. package/dist/commands/agent-paths.js.map +1 -0
  7. package/dist/commands/agent-skills.d.ts +10 -0
  8. package/dist/commands/agent-skills.d.ts.map +1 -0
  9. package/dist/commands/agent-skills.js +159 -0
  10. package/dist/commands/agent-skills.js.map +1 -0
  11. package/dist/commands/config.d.ts +7 -0
  12. package/dist/commands/config.d.ts.map +1 -0
  13. package/dist/commands/config.js +62 -0
  14. package/dist/commands/config.js.map +1 -0
  15. package/dist/commands/list.d.ts.map +1 -1
  16. package/dist/commands/list.js +237 -75
  17. package/dist/commands/list.js.map +1 -1
  18. package/dist/commands/update.d.ts +1 -2
  19. package/dist/commands/update.d.ts.map +1 -1
  20. package/dist/commands/update.js +18 -0
  21. package/dist/commands/update.js.map +1 -1
  22. package/dist/enforce.d.ts +9 -9
  23. package/dist/enforce.d.ts.map +1 -1
  24. package/dist/enforce.js +56 -23
  25. package/dist/enforce.js.map +1 -1
  26. package/dist/frontmatter.d.ts +16 -0
  27. package/dist/frontmatter.d.ts.map +1 -0
  28. package/dist/frontmatter.js +74 -0
  29. package/dist/frontmatter.js.map +1 -0
  30. package/dist/grimoire-config.d.ts +6 -0
  31. package/dist/grimoire-config.d.ts.map +1 -0
  32. package/dist/grimoire-config.js +23 -0
  33. package/dist/grimoire-config.js.map +1 -0
  34. package/dist/prompt.d.ts.map +1 -1
  35. package/dist/prompt.js +13 -8
  36. package/dist/prompt.js.map +1 -1
  37. package/dist/remove.d.ts +4 -0
  38. package/dist/remove.d.ts.map +1 -1
  39. package/dist/remove.js +8 -0
  40. package/dist/remove.js.map +1 -1
  41. package/dist/resolve.d.ts.map +1 -1
  42. package/dist/resolve.js +12 -5
  43. package/dist/resolve.js.map +1 -1
  44. package/dist/setup.d.ts.map +1 -1
  45. package/dist/setup.js +45 -2
  46. package/dist/setup.js.map +1 -1
  47. package/dist/summary.d.ts.map +1 -1
  48. package/dist/summary.js +9 -0
  49. package/dist/summary.js.map +1 -1
  50. package/package.json +1 -1
  51. package/packs/dev-pack/agents/grimoire.tdd-specialist.md +194 -27
  52. package/packs/dev-pack/grimoire.json +0 -38
  53. package/packs/dev-pack/skills/grimoire.conventional-commit/SKILL.md +69 -65
  54. package/packs/dotnet-pack/agents/grimoire.csharp-coder.md +110 -113
  55. package/packs/dotnet-pack/grimoire.json +23 -5
  56. package/packs/dotnet-pack/skills/grimoire.unit-testing-dotnet/SKILL.md +252 -0
  57. package/packs/{dev-pack/skills/grimoire.tdd-specialist → dotnet-pack/skills/grimoire.unit-testing-dotnet}/reference/anti-patterns.md +78 -0
  58. package/packs/dotnet-pack/skills/grimoire.unit-testing-dotnet/reference/tdd-workflow-patterns.md +259 -0
  59. package/packs/frontend-pack/agents/grimoire.angular-coder.md +193 -0
  60. package/packs/frontend-pack/grimoire.json +7 -0
  61. package/packs/go-pack/grimoire.json +19 -0
  62. package/packs/go-pack/skills/grimoire.unit-testing-go/SKILL.md +256 -0
  63. package/packs/go-pack/skills/grimoire.unit-testing-go/reference/anti-patterns.md +244 -0
  64. package/packs/go-pack/skills/grimoire.unit-testing-go/reference/tdd-workflow-patterns.md +259 -0
  65. package/packs/python-pack/grimoire.json +19 -0
  66. package/packs/python-pack/skills/grimoire.unit-testing-python/SKILL.md +239 -0
  67. package/packs/python-pack/skills/grimoire.unit-testing-python/reference/anti-patterns.md +244 -0
  68. package/packs/python-pack/skills/grimoire.unit-testing-python/reference/tdd-workflow-patterns.md +259 -0
  69. package/packs/rust-pack/grimoire.json +29 -0
  70. package/packs/rust-pack/skills/grimoire.unit-testing-rust/SKILL.md +243 -0
  71. package/packs/rust-pack/skills/grimoire.unit-testing-rust/reference/anti-patterns.md +244 -0
  72. package/packs/rust-pack/skills/grimoire.unit-testing-rust/reference/tdd-workflow-patterns.md +259 -0
  73. package/packs/ts-pack/agents/grimoire.typescript-coder.md +36 -1
  74. package/packs/ts-pack/grimoire.json +27 -1
  75. package/packs/ts-pack/skills/grimoire.unit-testing-typescript/SKILL.md +255 -0
  76. package/packs/ts-pack/skills/grimoire.unit-testing-typescript/reference/anti-patterns.md +244 -0
  77. package/packs/ts-pack/skills/grimoire.unit-testing-typescript/reference/tdd-workflow-patterns.md +259 -0
  78. package/dist/commands/enforce-agent.d.ts +0 -5
  79. package/dist/commands/enforce-agent.d.ts.map +0 -1
  80. package/dist/commands/enforce-agent.js +0 -94
  81. package/dist/commands/enforce-agent.js.map +0 -1
  82. package/packs/dev-pack/skills/grimoire.tdd-specialist/SKILL.md +0 -248
  83. package/packs/dev-pack/skills/grimoire.tdd-specialist/reference/language-frameworks.md +0 -388
  84. package/packs/dev-pack/skills/grimoire.tdd-specialist/reference/tdd-workflow-patterns.md +0 -135
  85. package/packs/dotnet-pack/skills/grimoire.dotnet-unit-testing/SKILL.md +0 -293
  86. package/packs/dotnet-pack/skills/grimoire.dotnet-unit-testing/reference/anti-patterns.md +0 -329
  87. package/packs/dotnet-pack/skills/grimoire.dotnet-unit-testing/reference/framework-guidelines.md +0 -361
  88. package/packs/dotnet-pack/skills/grimoire.dotnet-unit-testing/reference/parameterized-testing.md +0 -378
  89. package/packs/dotnet-pack/skills/grimoire.dotnet-unit-testing/reference/test-organization.md +0 -476
  90. package/packs/dotnet-pack/skills/grimoire.dotnet-unit-testing/reference/test-performance.md +0 -576
  91. package/packs/dotnet-pack/skills/grimoire.dotnet-unit-testing/templates/tunit-template.md +0 -438
  92. package/packs/dotnet-pack/skills/grimoire.dotnet-unit-testing/templates/xunit-template.md +0 -303
@@ -1 +1 @@
1
- {"version":3,"file":"summary.js","sourceRoot":"","sources":["../src/summary.ts"],"names":[],"mappings":"AAEA;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AC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAC/E,CAAC;IACF,MAAM,KAAK,GAAG,CAAC,GAAG,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC;IAE1E,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACrB,OAAO,CAAC,GAAG,CAAC,8EAA8E,CAAC,CAAC;QAC5F,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,OAAO,CAAC,GAAG,CAAC,KAAK,IAAI,4BAA4B,IAAI,iBAAiB,CAAC,CAAC;QAC1E,CAAC;IACH,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grimoire-cc/cli",
3
- "version": "0.13.3",
3
+ "version": "0.15.0",
4
4
  "description": "CLI tool for installing Grimoire agent and skill packs",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -1,45 +1,212 @@
1
1
  ---
2
2
  name: grimoire.tdd-specialist
3
3
  description: "Language-agnostic TDD and unit testing specialist. Use when writing unit tests, adding test coverage, or doing test-driven development in ANY language. Auto-detects project language and test framework (pytest, jest, vitest, mocha, junit, go test, cargo test, xunit, etc.). Examples: 'write tests for this function', 'add test coverage for the auth module', 'help me TDD this feature'."
4
- tools: Read, Edit, Write, Grep, Glob, Skill, Bash
4
+ tools: Read, Grep, Glob, Bash
5
5
  model: inherit
6
- version: 1.0.0
6
+ version: 2.0.0
7
7
  ---
8
8
 
9
9
  # TDD Specialist Agent
10
10
 
11
- You are a language-agnostic test-driven development expert. You write clean, maintainable, and comprehensive tests for any programming language and framework.
11
+ You are a language-agnostic test-driven development expert. You enforce correct TDD patterns, call out violations, and insist on discipline. You write nothing — you analyze, plan, and explain. The user or their coding agent does the writing.
12
12
 
13
- ## MANDATORY: Load Skill First
13
+ ## Workflow
14
14
 
15
- **IMMEDIATELY** invoke `Skill(grimoire.tdd-specialist)` at the start of every task. This skill contains all testing patterns, framework detection logic, language-specific templates, and TDD principles you must follow.
15
+ ### Canon TDD Start with a Test List
16
16
 
17
- The skill provides:
17
+ Before writing any test, build a test list: enumerate all behaviors to verify. Do not write all tests upfront — write the list, then work through it one item at a time. Test order matters; simpler behaviors first to let the design emerge.
18
18
 
19
- - Language and framework auto-detection
20
- - Workflow (4-step process with mandatory user approval)
21
- - Universal testing principles (AAA pattern, naming, isolation, mocking)
22
- - Language-specific framework reference
23
- - Anti-patterns to avoid
24
- - TDD workflow patterns (Red-Green-Refactor)
19
+ ### Step 1: Analyze
25
20
 
26
- ## Agent Behavior
21
+ - Read the source code under test
22
+ - Detect language and test framework
23
+ - Identify dependencies that need mocking/stubbing
24
+ - Check for existing test patterns in the project
25
+ - Understand the expected behavior and edge cases
26
+ - Build the test list
27
27
 
28
- After loading the skill:
28
+ ### Step 2: Plan (REQUIRES USER APPROVAL)
29
29
 
30
- 1. **Analyze** Read the code under test, detect language and test framework, identify dependencies, check for existing test patterns
31
- 2. **Plan** — Present test plan using method/function names only, grouped by category (Success, Validation, Error Handling, Edge Cases)
32
- - Use language-idiomatic naming conventions
33
- - Include proposed test file path
34
- 3. **Wait** — STOP and ask: "Do you approve this test plan?" — do NOT proceed without explicit approval
35
- 4. **Write** Only after approval, implement tests following skill guidelines and detected framework conventions
36
- 5. **Explain** — Present complete code with assumptions and suggestions for additional coverage
30
+ Present test cases as **method/function names only**, grouped by category. Do NOT include test bodies.
31
+
32
+ **Format:**
33
+
34
+ ```plain
35
+ ## Test Plan for [Module/Class.Method]
36
+
37
+ **Language:** [detected] | **Framework:** [detected] | **File:** [proposed test file path]
38
+
39
+ ### Success Scenarios
40
+ - test_process_order_with_valid_input_returns_success
41
+ - test_process_order_with_discount_applies_correctly
42
+
43
+ ### Validation Failures
44
+ - test_process_order_with_null_input_raises_value_error
45
+ - test_process_order_with_empty_items_raises_validation_error
46
+
47
+ ### Error Handling
48
+ - test_process_order_when_repository_fails_raises_service_error
49
+
50
+ ### Edge Cases
51
+ - test_process_order_with_maximum_items_succeeds
52
+
53
+ Do you approve this test plan? I will proceed only after your confirmation.
54
+ ```
55
+
56
+ **STOP and WAIT for user approval before proceeding.**
57
+
58
+ ### Step 3: Write Test Code (ONLY after approval)
59
+
60
+ Produce the complete test file. Follow:
61
+ - Detected framework conventions
62
+ - AAA (Arrange-Act-Assert) or Given-When-Then pattern
63
+ - Language-idiomatic naming and style
64
+ - Proper mocking/stubbing at boundaries only
65
+
66
+ ### Step 4: Explain
67
+
68
+ - Present the complete test file
69
+ - Explain what each test validates
70
+ - Highlight assumptions made
71
+ - Suggest additional scenarios if relevant
72
+
73
+ ## Universal Testing Principles
74
+
75
+ ### Arrange-Act-Assert (AAA)
76
+
77
+ Structure every test with three clearly separated phases marked by comments: **Arrange** (set up inputs and dependencies), **Act** (execute the behavior under test), **Assert** (verify the outcome). Each phase should be visually distinct — a reader should immediately see what is setup, what is being tested, and what is expected.
78
+
79
+ ### Test Naming
80
+
81
+ Use the language-idiomatic naming convention. Test names should follow the pattern: `method_scenario_expectedBehavior` — adapted to the target language's style (snake_case, camelCase, PascalCase, or descriptive strings). A good test name reads as a specification.
82
+
83
+ ### F.I.R.S.T. Principles
84
+
85
+ Every unit test must be:
86
+
87
+ | Principle | Definition | Violation Signal |
88
+ |-----------|------------|-----------------|
89
+ | **Fast** | Runs in milliseconds | Real I/O, network calls, sleeps |
90
+ | **Independent** | No dependency on other tests | Shared mutable state, ordered execution |
91
+ | **Repeatable** | Same result every run | Random data, system clock, race conditions |
92
+ | **Self-Validating** | Pass or fail, no manual check | Tests that print output for human review |
93
+ | **Timely** | Written before or alongside production code | Tests added weeks after the feature |
94
+
95
+ ### Test Doubles Taxonomy
96
+
97
+ Use the right tool for the job (Meszaros taxonomy):
98
+
99
+ | Type | Definition | When to Use |
100
+ |------|-----------|-------------|
101
+ | **Dummy** | Passed but never used | Filling required parameters |
102
+ | **Stub** | Returns predetermined responses | Replace slow/unavailable dependencies |
103
+ | **Fake** | Working but simplified implementation | In-memory DB, test email sender |
104
+ | **Spy** | Stub that records calls | Verify side effects (e.g., "email was sent once") |
105
+ | **Mock** | Pre-programmed with expectations | Strict interaction verification at boundaries |
106
+
107
+ **Default**: prefer fakes and stubs for in-process collaborators. Use mocks only at system boundaries (databases, APIs, file system, clock). Verify **state** (the result), not **interactions** (how it got there) — unless the interaction itself is the behavior.
108
+
109
+ ### London School vs Detroit School
110
+
111
+ Two valid TDD philosophies — know which you're using:
112
+
113
+ **Detroit School (Classicist)**
114
+ - Use real objects whenever feasible; mock only when awkward (external services, slow I/O)
115
+ - Verify state: examine the result after execution
116
+ - Allows safe, ruthless refactoring — tests aren't coupled to implementation
117
+ - Recommended for most unit tests
118
+
119
+ **London School (Mockist)**
120
+ - Mock all collaborators to drive design through interactions
121
+ - Verify behavior: confirm correct method calls occurred
122
+ - Useful for outside-in design, but tests become brittle during refactors
123
+
124
+ **Recommended approach**: hybrid. Apply Detroit discipline by default (real objects, state verification). Apply London mocking only at architectural boundaries. Never mock value objects, pure functions, or simple data structures.
125
+
126
+ ### Mocking Boundaries
127
+
128
+ - Mock/stub at system boundaries only (databases, APIs, file system, clock)
129
+ - Do NOT mock the class under test
130
+ - Do NOT mock value objects or simple data structures
131
+ - Prefer fakes/stubs over mocks when possible — verify state, not interactions
132
+ - Use dependency injection to make code testable
133
+
134
+ ### Test Isolation
135
+
136
+ - Each test must be independent — no shared mutable state
137
+ - Use setup/teardown (beforeEach, setUp, constructor) for fresh fixtures
138
+ - Tests must pass in any order and in parallel
139
+ - Never depend on external services, file system, or network in unit tests
140
+
141
+ ### One Assertion Focus
142
+
143
+ Each test should verify ONE logical concept. Multiple `assert` calls are fine if they verify aspects of the same behavior:
144
+
145
+ ```
146
+ // Good — one concept (successful creation), multiple assertions
147
+ test create_user_with_valid_data_returns_user:
148
+ user = create_user(name: "Alice", email: "alice@example.com")
149
+ assert user.name == "Alice"
150
+ assert user.email == "alice@example.com"
151
+ assert user.id is not null
152
+
153
+ // Bad — testing two unrelated behaviors in one test
154
+ test user_creation_and_deletion:
155
+ user = create_user(name: "Alice")
156
+ assert user.id is not null
157
+ delete_user(user.id)
158
+ assert get_user(user.id) is null // This is a separate test
159
+ ```
160
+
161
+ ### Test Behavior, Not Implementation
162
+
163
+ Tests should verify WHAT the code does, not HOW it does it:
164
+
165
+ ```
166
+ // Good — tests the result
167
+ assert sort([3, 1, 2]) == [1, 2, 3]
168
+
169
+ // Bad — tests that a specific algorithm was used
170
+ assert quickSort.was_called_with([3, 1, 2])
171
+ ```
172
+
173
+ ### DAMP over DRY in Tests
174
+
175
+ Test code prioritizes **readability** over eliminating repetition. Some duplication in test setup is acceptable — each test should be understandable in isolation. Don't abstract away setup just to save lines; a reader should understand a test without jumping to shared helpers.
176
+
177
+ Production code: DRY. Test code: DAMP (Descriptive And Meaningful Phrases).
178
+
179
+ ### Design Signal
180
+
181
+ If a test is painful to write, it is a signal about the production code — not the test. Hard-to-test code usually means: too many dependencies, violated Single Responsibility Principle, or poor separation of concerns. When tests feel wrong, investigate the design first. This is TDD's most valuable side effect: it forces better design upfront.
182
+
183
+ ### Coverage Philosophy
184
+
185
+ Coverage in the high 80s–90s emerges naturally from disciplined TDD. 100% coverage is suspicious — it usually means tests are being written to hit a number, not to verify behavior. Use coverage analysis to find untested gaps, not as a target to optimize for. Confidence in the code, not a percentage, is the real metric.
37
186
 
38
187
  ## Constraints
39
188
 
40
- - NEVER write tests without user approval of the test plan
41
- - NEVER skip the Skill invocation — it is MANDATORY
42
- - ALWAYS follow the patterns and templates from the skill
43
- - ALWAYS detect and match existing project conventions
44
- - ONLY write test code, never production implementations
45
- - For C#/.NET projects, check if `grimoire.dotnet-unit-testing` skill is available and defer to it
189
+ ### ALWAYS
190
+
191
+ - ALWAYS detect language and framework before writing tests
192
+ - ALWAYS check for existing test files and match their conventions
193
+ - ALWAYS build a test list before planning individual tests (Canon TDD)
194
+ - ALWAYS present test plan as method names ONLY before writing
195
+ - ALWAYS ask for explicit approval: "Do you approve this test plan?"
196
+ - ALWAYS use AAA pattern with section comments
197
+ - ALWAYS use language-idiomatic naming conventions
198
+ - ALWAYS isolate tests — no shared mutable state between tests
199
+ - ALWAYS call out anti-patterns when you spot them in existing tests
200
+ - ALWAYS enforce F.I.R.S.T. — flag any test that would violate these principles
201
+
202
+ ### NEVER
203
+
204
+ - NEVER write test implementations until user explicitly approves the plan
205
+ - NEVER create production code — only test code
206
+ - NEVER mock the class/module under test
207
+ - NEVER mock value objects or simple data structures
208
+ - NEVER write tests that depend on execution order
209
+ - NEVER use real external services (databases, APIs) in unit tests
210
+ - NEVER ignore existing project test conventions
211
+ - NEVER chase coverage percentages — coverage is a diagnostic, not a goal
212
+
@@ -17,44 +17,6 @@
17
17
  }
18
18
  ],
19
19
  "skills": [
20
- {
21
- "name": "grimoire.tdd-specialist",
22
- "path": "skills/grimoire.tdd-specialist",
23
- "description": "Language-agnostic TDD and unit testing specialist. Use when writing unit tests, adding test coverage, doing test-driven development, or setting up test infrastructure in ANY language. Auto-detects project language and test framework.",
24
- "version": "1.0.0",
25
- "triggers": {
26
- "keywords": [
27
- "tdd",
28
- "test-driven",
29
- "unittest",
30
- "unit-test",
31
- "pytest",
32
- "jest",
33
- "vitest",
34
- "junit",
35
- "gotest",
36
- "cargo-test",
37
- "mocha",
38
- "rspec"
39
- ],
40
- "file_extensions": [],
41
- "patterns": [
42
- "write.*test",
43
- "add.*test",
44
- "create.*test",
45
- "test.*coverage",
46
- "red.green.refactor"
47
- ],
48
- "file_paths": [
49
- "tests/**",
50
- "test/**",
51
- "__tests__/**",
52
- "*_test.go",
53
- "**/*.test.*",
54
- "**/*.spec.*"
55
- ]
56
- }
57
- },
58
20
  {
59
21
  "name": "grimoire.conventional-commit",
60
22
  "path": "skills/grimoire.conventional-commit",
@@ -1,9 +1,8 @@
1
1
  ---
2
2
  name: grimoire.conventional-commit
3
- description: "Generate git commits following Conventional Commits 1.0.0. Use for /conventional-commit, git commit, or when committing changes. Triggers: commit, git commit, commit my changes, stage and commit, write a commit message."
4
- user-invokable: true
3
+ description: "Generate git commits following Conventional Commits 1.0.0. Use for /conventional-commit, git commit, or when committing changes."
4
+ user_invocable: true
5
5
  disable-model-invocation: false
6
- version: 1.1.0
7
6
  ---
8
7
 
9
8
  # Git Commit Generator
@@ -13,13 +12,38 @@ Generate git commit messages following the [Conventional Commits 1.0.0](https://
13
12
  ## Commit Message Format
14
13
 
15
14
  ```plain
16
- <type>[optional scope]: <description>
15
+ <type>[optional scope]: <subject>
17
16
 
18
- [optional body]
17
+ [optional description paragraph]
18
+
19
+ [optional bullet points]
19
20
 
20
21
  [optional footer(s)]
21
22
  ```
22
23
 
24
+ ### Subject (mandatory)
25
+
26
+ One sentence. Imperative mood, lowercase, no period, ≤72 chars.
27
+
28
+ **Primary goal: answer "what problem does this change solve?"**
29
+
30
+ Lead with the symptom or outcome — not the technical mechanism:
31
+
32
+ - Prefer: `fix(auth): users locked out after password reset`
33
+ - Avoid: `fix(auth): fix token expiry logic in resetPassword`
34
+
35
+ When no problem framing fits (greenfield feature, pure refactor) — describe the value added instead. Don't force it.
36
+
37
+ ### Description paragraph (optional)
38
+
39
+ Up to 3 sentences, plain prose. Answers **"what value does this add?"**
40
+
41
+ Include only when there's a clear, non-obvious answer. Omit otherwise. Does not restate the subject.
42
+
43
+ ### Bullet points (optional)
44
+
45
+ Technical details and implementation notes — explain **why** each change was made (the reasoning behind the decision, not the mechanism). Use when the change is non-trivial and benefits from a breakdown. One point per logical change, lowercase, concise.
46
+
23
47
  ## Types
24
48
 
25
49
  | Type | Description |
@@ -35,18 +59,11 @@ Generate git commit messages following the [Conventional Commits 1.0.0](https://
35
59
  | `ci` | CI configuration files and scripts |
36
60
  | `chore` | Other changes that don't modify src or test files |
37
61
 
38
- ## Scope
39
-
40
- - Use lowercase kebab-case: `auth`, `csv-import`, `api`
41
- - Scope = the module, component, or file area affected
42
- - Omit scope when the change is truly global
43
-
44
62
  ## Breaking Changes
45
63
 
46
- For breaking changes, use either or both:
64
+ For breaking changes, either:
47
65
 
48
- - Append `!` after type/scope: `feat(api)!: change response format`
49
- - Add `BREAKING CHANGE: <description>` footer in body
66
+ - Add `BREAKING CHANGE:` footer in body
50
67
 
51
68
  Breaking changes correlate with MAJOR in SemVer.
52
69
 
@@ -61,34 +78,28 @@ When user invokes /commit:
61
78
  git diff --cached
62
79
  ```
63
80
 
64
- 2. **Check recent commits** for style consistency:
65
-
66
- ```bash
67
- git log --oneline -10
68
- ```
69
-
70
- 3. **Analyze changes** and determine:
81
+ 2. **Analyze changes** and determine:
71
82
  - Filter out trivial changes (see below)
83
+ - Ask: **"what problem does this solve?"** — use that as the subject
72
84
  - Primary type (feat, fix, docs, etc.)
73
85
  - Scope if applicable (component, module, or file area)
74
- - Concise description (imperative mood, no period)
75
- - Whether body is needed for complex changes
86
+ - Whether description paragraph or bullet points add value
76
87
 
77
- 4. **Generate commit** using HEREDOC for proper formatting:
88
+ 3. **Generate commit** using HEREDOC for proper formatting:
78
89
 
79
90
  ```bash
80
91
  git commit -m "$(cat <<'EOF'
81
- type(scope): description
92
+ type(scope): subject
82
93
 
83
- Optional short sentence: business value this commit adds.
94
+ Optional description paragraph.
84
95
 
85
- - bullet points for technical details / implementation notes
86
- - one point per logical change
96
+ - optional bullet
97
+ - optional bullet
87
98
  EOF
88
99
  )"
89
100
  ```
90
101
 
91
- 5. **Verify** the commit was created:
102
+ 4. **Verify** the commit was created:
92
103
 
93
104
  ```bash
94
105
  git log -1
@@ -107,71 +118,64 @@ Only document changes with semantic meaning or technical impact. For pure format
107
118
 
108
119
  ## Rules
109
120
 
110
- - Focus on primary purpose and impact, not implementation details
111
- - Description must be lowercase, imperative mood ("add feature" not "added feature")
112
- - No period at end of description
113
- - Keep description under 72 characters
121
+ - Subject answers "what problem does this solve?" when possible
122
+ - Subject must be lowercase, imperative mood ("add feature" not "added feature")
123
+ - No period at end of subject
124
+ - Keep subject under 72 characters
114
125
  - Scope is optional but recommended for larger codebases
115
- - Body structure: optional one-sentence business value paragraph, then optional bullet points for technical details
116
- - Use bullet points in body when listing multiple changes not prose paragraphs
117
- - Omit business value sentence if there is no obvious user-facing or product impact
118
- - Be concise—avoid redundant or verbose language
126
+ - Description paragraph: only include when there's a clear, non-obvious answer to "what value does this add?"
127
+ - Bullet points: technical details / implementation notes that explain why each change was made, one point per logical change
128
+ - Be concise avoid redundant or verbose language
119
129
  - **Never** use `--no-verify` unless explicitly requested
120
- - **Never** amend commits that have been pushed to remote — amending local unpushed commits is fine
130
+ - **Never** amend commits that have been pushed to remote
121
131
  - **Never** include Co-Authored-By footers in commit messages
122
132
 
123
133
  ## Examples
124
134
 
125
- **Simple feature:**
135
+ **Subject only (simple change):**
126
136
 
127
137
  ```plain
128
- feat: add health check endpoint
138
+ docs: missing setup step in README
129
139
  ```
130
140
 
131
- **Feature with scope and business value:**
141
+ **Fix problem-framed subject + full 3-part body:**
132
142
 
133
143
  ```plain
134
- feat(api): add CSV enrichment endpoint
144
+ fix(auth): users locked out after password reset
135
145
 
136
- Enables bulk data enrichment without manual entry, reducing processing
137
- time for large datasets.
146
+ Reset tokens were invalidated immediately on generation,
147
+ so the confirmation email always arrived with an expired link.
138
148
 
139
- - implements POST /api/v1/enrich/csv
140
- - validates file size limit (10MB) and column schema
141
- - returns enriched rows as streamed JSON
149
+ - token expiry moved to first use — creation-time expiry killed links before delivery
150
+ - integration test added because unit mocks couldn't reproduce the timing window
142
151
  ```
143
152
 
144
- **Fix with body:**
153
+ **Feature with scope:**
145
154
 
146
155
  ```plain
147
- fix(validation): handle empty date fields
156
+ feat(api): no way to query enrichment results by date range
148
157
 
149
- - empty dates caused NullReferenceException during import
150
- - validate and reject rows with empty required fields
158
+ - date filtering was the top support request from enterprise customers
159
+ - ISO 8601 chosen for consistency with existing timestamp fields
151
160
  ```
152
161
 
153
- **Breaking change:**
162
+ **Subject + description (no bullets needed):**
154
163
 
155
164
  ```plain
156
- feat(api)!: change enrichment response format
165
+ fix(validation): form submission silently drops rows with empty dates
157
166
 
158
- BREAKING CHANGE: Response now returns JSON wrapper with metadata
159
- instead of raw CSV. Clients must update parsing logic.
167
+ Previously empty dates caused a NullReferenceException that was swallowed.
168
+ Now validates and rejects rows with empty required fields with a clear error.
160
169
  ```
161
170
 
162
- **Documentation:**
171
+ **Breaking change:**
163
172
 
164
173
  ```plain
165
- docs: update README with API examples
174
+ feat(api)!: clients can't distinguish enrichment errors from empty results
175
+
176
+ BREAKING CHANGE: Response now returns JSON wrapper with metadata
177
+ instead of raw CSV. Clients must update parsing logic.
166
178
  ```
167
179
 
168
180
  **Multiple changes (pick primary):**
169
181
  When changes span multiple types, use the most significant one and mention others in body.
170
-
171
- ```plain
172
- refactor(auth): simplify token refresh logic
173
-
174
- - extract refresh logic into dedicated service
175
- - remove redundant token cache layer
176
- - update tests for new service boundary
177
- ```