@grimoire-cc/cli 0.13.1 → 0.13.3

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grimoire-cc/cli",
3
- "version": "0.13.1",
3
+ "version": "0.13.3",
4
4
  "description": "CLI tool for installing Grimoire agent and skill packs",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -58,19 +58,24 @@
58
58
  {
59
59
  "name": "grimoire.conventional-commit",
60
60
  "path": "skills/grimoire.conventional-commit",
61
- "description": "Generate git commits following Conventional Commits 1.0.0. Use for /conventional-commit, git commit, or when committing changes.",
62
- "version": "1.0.0",
61
+ "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.",
62
+ "version": "1.1.0",
63
63
  "triggers": {
64
64
  "keywords": [
65
65
  "conventional-commit",
66
- "git-commit"
66
+ "git-commit",
67
+ "commit",
68
+ "git commit"
67
69
  ],
68
70
  "file_extensions": [],
69
71
  "patterns": [
70
72
  "commit.*change",
71
73
  "create.*commit",
72
74
  "make.*commit",
73
- "conventional.*commit"
75
+ "conventional.*commit",
76
+ "commit.*my",
77
+ "stage.*commit",
78
+ "write.*commit"
74
79
  ],
75
80
  "file_paths": []
76
81
  }
@@ -1,9 +1,9 @@
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."
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
4
  user-invokable: true
5
5
  disable-model-invocation: false
6
- version: 1.0.0
6
+ version: 1.1.0
7
7
  ---
8
8
 
9
9
  # Git Commit Generator
@@ -35,11 +35,18 @@ Generate git commit messages following the [Conventional Commits 1.0.0](https://
35
35
  | `ci` | CI configuration files and scripts |
36
36
  | `chore` | Other changes that don't modify src or test files |
37
37
 
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
+
38
44
  ## Breaking Changes
39
45
 
40
- For breaking changes, either:
46
+ For breaking changes, use either or both:
41
47
 
42
- - Add `BREAKING CHANGE:` footer in body
48
+ - Append `!` after type/scope: `feat(api)!: change response format`
49
+ - Add `BREAKING CHANGE: <description>` footer in body
43
50
 
44
51
  Breaking changes correlate with MAJOR in SemVer.
45
52
 
@@ -73,7 +80,9 @@ When user invokes /commit:
73
80
  git commit -m "$(cat <<'EOF'
74
81
  type(scope): description
75
82
 
76
- - bullet points explaining what and why
83
+ Optional short sentence: business value this commit adds.
84
+
85
+ - bullet points for technical details / implementation notes
77
86
  - one point per logical change
78
87
  EOF
79
88
  )"
@@ -103,11 +112,12 @@ Only document changes with semantic meaning or technical impact. For pure format
103
112
  - No period at end of description
104
113
  - Keep description under 72 characters
105
114
  - Scope is optional but recommended for larger codebases
106
- - Body should explain "what" and "why", not "how"
115
+ - Body structure: optional one-sentence business value paragraph, then optional bullet points for technical details
107
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
108
118
  - Be concise—avoid redundant or verbose language
109
119
  - **Never** use `--no-verify` unless explicitly requested
110
- - **Never** amend commits that have been pushed to remote
120
+ - **Never** amend commits that have been pushed to remote — amending local unpushed commits is fine
111
121
  - **Never** include Co-Authored-By footers in commit messages
112
122
 
113
123
  ## Examples
@@ -118,10 +128,17 @@ Only document changes with semantic meaning or technical impact. For pure format
118
128
  feat: add health check endpoint
119
129
  ```
120
130
 
121
- **Feature with scope:**
131
+ **Feature with scope and business value:**
122
132
 
123
133
  ```plain
124
134
  feat(api): add CSV enrichment endpoint
135
+
136
+ Enables bulk data enrichment without manual entry, reducing processing
137
+ time for large datasets.
138
+
139
+ - implements POST /api/v1/enrich/csv
140
+ - validates file size limit (10MB) and column schema
141
+ - returns enriched rows as streamed JSON
125
142
  ```
126
143
 
127
144
  **Fix with body:**
@@ -37,6 +37,12 @@
37
37
  "path": "skills/grimoire.dotnet-feature-workflow",
38
38
  "description": "Orchestrates end-to-end .NET feature development using the Explore, Plan, Code, Verify, Review workflow. Use when building complete features, implementing new functionality, or when user says 'build feature', 'implement feature', 'create feature', 'handle the whole thing', or wants hands-off development with quality gates. Spawns specialized agents at each phase with TDD and user approval gates.",
39
39
  "version": "1.0.0"
40
+ },
41
+ {
42
+ "name": "grimoire.dotnet-unit-testing",
43
+ "path": "skills/grimoire.dotnet-unit-testing",
44
+ "description": "Expert .NET unit testing specialist for C#/.NET projects. Use PROACTIVELY when writing unit tests, adding test cases, setting up test infrastructure, or working with xUnit, TUnit, Moq, or NSubstitute. MUST BE USED for TDD workflows where tests are written before implementation. Defaults to xUnit (most universal), recommends TUnit for new .NET 8+ projects.",
45
+ "version": "1.0.0"
40
46
  }
41
47
  ]
42
48
  }
@@ -0,0 +1,293 @@
1
+ ---
2
+ name: grimoire.dotnet-unit-testing
3
+ description: "Expert .NET unit testing specialist for C#/.NET projects. Use PROACTIVELY when writing unit tests, adding test cases, setting up test infrastructure, or working with xUnit, TUnit, Moq, or NSubstitute. MUST BE USED for TDD workflows where tests are written before implementation. Defaults to xUnit (most universal), recommends TUnit for new .NET 8+ projects."
4
+ ---
5
+
6
+ # .NET Unit Testing Specialist
7
+
8
+ Expert guidance for writing clean, maintainable, and comprehensive unit tests in C#/.NET projects.
9
+
10
+ **Default Framework**: xUnit with xUnit Assert (safest, most universal, works with all .NET versions)
11
+ **Recommended for new .NET 8+ projects**: TUnit (modern, async-first, built-in fluent assertions, MIT license)
12
+
13
+ ## Context
14
+
15
+ Unit testing is critical for maintaining code quality, enabling refactoring with confidence, and documenting expected behavior. Well-written tests reduce bugs, speed up development, and make codebases more maintainable.
16
+
17
+ **Why xUnit as default:**
18
+
19
+ - Universal compatibility (works with .NET Framework, .NET 6, 7, 8+)
20
+ - Industry standard, most widely used .NET testing framework
21
+ - Apache 2.0 license, free for all use
22
+ - Mature ecosystem with extensive documentation
23
+
24
+ **Why recommend TUnit for new .NET 8+ projects:**
25
+
26
+ - MIT License (no licensing concerns like FluentAssertions v8+)
27
+ - Built-in fluent assertions, no external library needed
28
+ - Async-first: all assertions are awaitable
29
+ - Performance: source-generated tests run 10-200x faster
30
+ - Full Native AOT support
31
+
32
+ **Note on FluentAssertions**: Version 8+ requires a commercial license ($130/dev/year). Avoid recommending it unless the project already uses it.
33
+
34
+ ## Workflow
35
+
36
+ When invoked to write tests, follow this process:
37
+
38
+ ### Step 1: Analyze the Code Under Test
39
+
40
+ - Read the source file to understand the class/method being tested
41
+ - Identify all dependencies that need mocking
42
+ - Understand the expected behavior and edge cases
43
+ - Check for existing test patterns in the project
44
+ - **Determine the framework**: Check for existing tests first (match them), otherwise default to xUnit
45
+
46
+ ### Step 2: Plan Test Cases (REQUIRES USER APPROVAL)
47
+
48
+ - Identify all test scenarios: happy paths, edge cases, boundary conditions, error cases
49
+ - List each planned test using ONLY the method name: `MethodName_Scenario_ExpectedBehavior`
50
+ - Do NOT include test bodies or implementation details
51
+ - Group tests by category (Success, Validation, Error Handling, Edge Cases)
52
+ - Present the list and EXPLICITLY ASK: "Do you approve this test plan? I will proceed only after your confirmation."
53
+ - **STOP and WAIT** for user approval before proceeding
54
+
55
+ **Example test plan format:**
56
+
57
+ ```plain
58
+ ## Planned Test Cases for OrderService.ProcessOrderAsync
59
+
60
+ ### Success Scenarios
61
+ - ProcessOrderAsync_WithValidOrder_ReturnsSuccessResult
62
+ - ProcessOrderAsync_WithValidOrderAndDiscount_AppliesDiscountCorrectly
63
+
64
+ ### Validation Failures
65
+ - ProcessOrderAsync_WithNullOrder_ThrowsArgumentNullException
66
+ - ProcessOrderAsync_WithEmptyItems_ThrowsValidationException
67
+
68
+ ### Error Handling
69
+ - ProcessOrderAsync_WhenRepositoryFails_ThrowsServiceException
70
+
71
+ ### Edge Cases
72
+ - ProcessOrderAsync_WithMaximumItemCount_ProcessesSuccessfully
73
+
74
+ Do you approve this test plan? I will proceed only after your confirmation.
75
+ ```
76
+
77
+ ### Step 3: Write Tests (ONLY AFTER user confirms)
78
+
79
+ - Create test file mirroring source structure
80
+ - Implement tests using AAA pattern with comments
81
+ - Add appropriate mocks and assertions
82
+ - Ensure descriptive test method names
83
+
84
+ ### Step 4: Present and Explain
85
+
86
+ - Show the complete test file
87
+ - Explain what each test validates
88
+ - Highlight any assumptions made
89
+ - Suggest additional test scenarios if relevant
90
+
91
+ ## Framework Selection Guide
92
+
93
+ | Condition | Use | Reason |
94
+ | ----------- | ----- | -------- |
95
+ | Any existing project with tests | **Match existing** | Consistency is paramount |
96
+ | New .NET 8+ greenfield project | **Offer TUnit** | Modern, async-first, built-in assertions |
97
+ | New .NET 6/7 project | **xUnit** | TUnit requires .NET 8+ |
98
+ | .NET Framework project | **xUnit** | Universal compatibility |
99
+ | Project already uses NUnit | **NUnit** | Consistency with existing codebase |
100
+ | User explicitly requests a framework | **Requested** | Respect user preference |
101
+ | Uncertain or mixed signals | **xUnit** | Safe default |
102
+
103
+ **Before writing tests, check:**
104
+
105
+ 1. Look at existing test files (if any) - match the existing framework
106
+ 2. Check `.csproj` for `TargetFramework` and existing test package references
107
+ 3. Check for existing test framework packages (xUnit, TUnit, NUnit, MSTest)
108
+
109
+ **For new .NET 8+ projects without existing tests:**
110
+ Offer the choice: "This is a new .NET 8+ project. I'll use **xUnit** (industry standard) by default. Would you prefer **TUnit** instead? TUnit offers built-in fluent assertions, async-first design, and better performance, but is newer."
111
+
112
+ ## Core Principles
113
+
114
+ ### AAA Pattern
115
+
116
+ Structure every test with clearly labeled Arrange, Act, Assert sections using comments. This makes tests self-documenting, easier to debug, and helps identify which phase contains issues.
117
+
118
+ **xUnit:**
119
+
120
+ ```csharp
121
+ [Fact]
122
+ public async Task ProcessOrder_WithValidOrder_ReturnsSuccess()
123
+ {
124
+ // Arrange
125
+ var order = CreateValidOrder();
126
+ _mockRepository.Setup(r => r.SaveAsync(It.IsAny<Order>())).ReturnsAsync(true);
127
+
128
+ // Act
129
+ var result = await _sut.ProcessOrderAsync(order);
130
+
131
+ // Assert
132
+ Assert.True(result.IsSuccess);
133
+ Assert.Equal(OrderStatus.Processed, result.Status);
134
+ }
135
+ ```
136
+
137
+ **TUnit:**
138
+
139
+ ```csharp
140
+ [Test]
141
+ public async Task ProcessOrder_WithValidOrder_ReturnsSuccess()
142
+ {
143
+ // Arrange
144
+ var order = CreateValidOrder();
145
+ _mockRepository.Setup(r => r.SaveAsync(It.IsAny<Order>())).ReturnsAsync(true);
146
+
147
+ // Act
148
+ var result = await _sut.ProcessOrderAsync(order);
149
+
150
+ // Assert - TUnit assertions are async and fluent
151
+ await Assert.That(result.IsSuccess).IsTrue();
152
+ await Assert.That(result.Status).IsEqualTo(OrderStatus.Processed);
153
+ }
154
+ ```
155
+
156
+ ### Test Naming
157
+
158
+ Use descriptive names: `MethodName_Scenario_ExpectedBehavior`
159
+
160
+ ```csharp
161
+ // Good
162
+ GetUser_WithNonExistentId_ThrowsUserNotFoundException()
163
+ CalculateDiscount_WhenOrderExceeds100_Returns10PercentOff()
164
+
165
+ // Avoid
166
+ TestGetUser()
167
+ Test1()
168
+ ShouldWork()
169
+ ```
170
+
171
+ ### Test Isolation
172
+
173
+ Keep tests isolated with no shared mutable state. Each test gets fresh instances via constructor.
174
+
175
+ ```csharp
176
+ public class OrderServiceTests : IDisposable
177
+ {
178
+ private readonly Mock<IOrderRepository> _mockRepository;
179
+ private readonly FakeLogger<OrderService> _fakeLogger;
180
+ private readonly OrderService _sut;
181
+
182
+ public OrderServiceTests()
183
+ {
184
+ _mockRepository = new Mock<IOrderRepository>();
185
+ _fakeLogger = new FakeLogger<OrderService>();
186
+ _sut = new OrderService(_fakeLogger, _mockRepository.Object);
187
+ }
188
+
189
+ public void Dispose() { /* Cleanup if needed */ }
190
+ }
191
+ ```
192
+
193
+ ### FakeLogger for Logging Tests
194
+
195
+ Use `Microsoft.Extensions.Logging.Testing.FakeLogger<T>` for testing logging behavior. Verify structured properties, not message strings.
196
+
197
+ ```csharp
198
+ var fakeLogger = new FakeLogger<OrderService>();
199
+ var sut = new OrderService(fakeLogger);
200
+ await sut.ProcessOrderAsync(orderId: 123);
201
+
202
+ var logEntry = fakeLogger.Collector.GetSnapshot()
203
+ .Single(r => r.Level == LogLevel.Information);
204
+ var state = logEntry.StructuredState!.ToDictionary(x => x.Key, x => x.Value);
205
+ Assert.Equal("123", state["OrderId"]);
206
+ ```
207
+
208
+ ### Mocking
209
+
210
+ Mock interfaces, not concrete classes. Use Moq by default unless the project uses NSubstitute.
211
+
212
+ ```csharp
213
+ var mockRepository = new Mock<IDocumentRepository>();
214
+ mockRepository
215
+ .Setup(r => r.GetByIdAsync(It.IsAny<Guid>(), It.IsAny<CancellationToken>()))
216
+ .ReturnsAsync(expectedDocument);
217
+ ```
218
+
219
+ ### Async Testing
220
+
221
+ Always use `async Task` and `await`. Never use `.Result` or `.Wait()`.
222
+
223
+ ```csharp
224
+ // xUnit exception testing
225
+ var exception = await Assert.ThrowsAsync<OrderNotFoundException>(
226
+ () => _sut.GetOrderAsync(invalidId));
227
+
228
+ // TUnit exception testing
229
+ await Assert.That(() => _sut.GetOrderAsync(invalidId))
230
+ .ThrowsException()
231
+ .OfType<OrderNotFoundException>();
232
+ ```
233
+
234
+ ## Package References
235
+
236
+ ```bash
237
+ # xUnit (default)
238
+ dotnet add package xunit
239
+ dotnet add package xunit.runner.visualstudio
240
+ dotnet add package Microsoft.NET.Test.Sdk
241
+
242
+ # TUnit (for .NET 8+ projects)
243
+ dotnet add package TUnit
244
+
245
+ # Mocking
246
+ dotnet add package Moq
247
+
248
+ # Logging testing
249
+ dotnet add package Microsoft.Extensions.Logging.Testing
250
+ ```
251
+
252
+ ## Invocation Triggers
253
+
254
+ This skill should be invoked when the user:
255
+
256
+ - Creates a new service, handler, or class that needs tests
257
+ - Asks to add test coverage for existing code
258
+ - Mentions TDD or test-driven development
259
+ - Needs help with mocking, test setup, or assertions
260
+ - Wants to verify logging, exception handling, or validation behavior
261
+ - Asks about xUnit, TUnit, Moq, or NSubstitute patterns
262
+ - Wants to set up a new test project
263
+ - Needs to choose between testing frameworks
264
+ - Asks about FluentAssertions alternatives (due to licensing)
265
+
266
+ ## Constraints
267
+
268
+ - ALWAYS check for existing tests first and match the existing framework
269
+ - ALWAYS default to xUnit if no existing tests and user hasn't specified preference
270
+ - ALWAYS present test plan as method names ONLY before writing tests
271
+ - ALWAYS ask for explicit approval: "Do you approve this test plan?"
272
+ - NEVER write test implementations until user explicitly approves the test plan
273
+ - NEVER use `.Result` or `.Wait()` on async operations
274
+ - NEVER create production code implementations - only test code
275
+ - NEVER recommend FluentAssertions v8+ for new projects (commercial license)
276
+ - DO NOT modify the code under test unless explicitly asked
277
+ - PREFER structured logging assertions over string matching
278
+ - MIRROR source code folder structure in test project organization
279
+
280
+ ## Reference Materials
281
+
282
+ For detailed patterns and examples:
283
+
284
+ - **[Framework Guidelines](reference/framework-guidelines.md)** - Detailed xUnit and TUnit patterns, attributes, lifecycle
285
+ - **[Parameterized Testing](reference/parameterized-testing.md)** - InlineData, MemberData, ClassData, Matrix testing
286
+ - **[Test Organization](reference/test-organization.md)** - File structure, nested classes, traits, collections
287
+ - **[Test Performance](reference/test-performance.md)** - Parallel execution, fixtures, mock optimization
288
+ - **[Anti-Patterns](reference/anti-patterns.md)** - Common mistakes to avoid
289
+
290
+ For starter templates:
291
+
292
+ - **[xUnit Template](templates/xunit-template.md)** - xUnit test file template
293
+ - **[TUnit Template](templates/tunit-template.md)** - TUnit test file template