@codemieai/code 0.0.33 → 0.0.34

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 (180) hide show
  1. package/README.md +73 -7
  2. package/bin/codemie-opencode.js +11 -0
  3. package/dist/agents/codemie-code/agent.d.ts +17 -1
  4. package/dist/agents/codemie-code/agent.d.ts.map +1 -1
  5. package/dist/agents/codemie-code/agent.js +62 -3
  6. package/dist/agents/codemie-code/agent.js.map +1 -1
  7. package/dist/agents/codemie-code/index.d.ts +1 -0
  8. package/dist/agents/codemie-code/index.d.ts.map +1 -1
  9. package/dist/agents/codemie-code/index.js +28 -2
  10. package/dist/agents/codemie-code/index.js.map +1 -1
  11. package/dist/agents/codemie-code/prompts.d.ts +12 -3
  12. package/dist/agents/codemie-code/prompts.d.ts.map +1 -1
  13. package/dist/agents/codemie-code/prompts.js +25 -5
  14. package/dist/agents/codemie-code/prompts.js.map +1 -1
  15. package/dist/agents/codemie-code/types.d.ts +3 -0
  16. package/dist/agents/codemie-code/types.d.ts.map +1 -1
  17. package/dist/agents/codemie-code/types.js.map +1 -1
  18. package/dist/agents/core/AgentCLI.d.ts.map +1 -1
  19. package/dist/agents/core/AgentCLI.js +3 -1
  20. package/dist/agents/core/AgentCLI.js.map +1 -1
  21. package/dist/agents/core/BaseAgentAdapter.d.ts.map +1 -1
  22. package/dist/agents/core/BaseAgentAdapter.js +33 -0
  23. package/dist/agents/core/BaseAgentAdapter.js.map +1 -1
  24. package/dist/agents/core/session/BaseSessionAdapter.d.ts +25 -0
  25. package/dist/agents/core/session/BaseSessionAdapter.d.ts.map +1 -1
  26. package/dist/agents/core/session/discovery-types.d.ts +53 -0
  27. package/dist/agents/core/session/discovery-types.d.ts.map +1 -0
  28. package/dist/agents/core/session/discovery-types.js +8 -0
  29. package/dist/agents/core/session/discovery-types.js.map +1 -0
  30. package/dist/agents/core/types.d.ts +45 -0
  31. package/dist/agents/core/types.d.ts.map +1 -1
  32. package/dist/agents/plugins/claude/claude.plugin.d.ts +44 -1
  33. package/dist/agents/plugins/claude/claude.plugin.d.ts.map +1 -1
  34. package/dist/agents/plugins/claude/claude.plugin.js +214 -0
  35. package/dist/agents/plugins/claude/claude.plugin.js.map +1 -1
  36. package/dist/agents/plugins/claude/plugin/README.md +40 -2
  37. package/dist/agents/plugins/claude/plugin/claude-templates/README.md +5 -5
  38. package/dist/agents/plugins/claude/plugin/claude-templates/templates/CLAUDE.md.template +177 -436
  39. package/dist/agents/plugins/claude/plugin/claude-templates/templates/agents/code-review-agent-template.md.template +49 -82
  40. package/dist/agents/plugins/claude/plugin/claude-templates/templates/agents/refactor-cleaner-agent.md.template +337 -0
  41. package/dist/agents/plugins/claude/plugin/claude-templates/templates/agents/solution-architect-agent.md.template +129 -419
  42. package/dist/agents/plugins/claude/plugin/claude-templates/templates/agents/unit-tester-agent.md.template +146 -693
  43. package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/api/api-patterns.md.template +110 -138
  44. package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/architecture/architecture.md.template +197 -0
  45. package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/data/database-patterns.md.template +171 -91
  46. package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/development/development-practices.md.template +219 -131
  47. package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/security/security-practices.md.template +223 -98
  48. package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/standards/code-quality.md.template +131 -95
  49. package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/testing/testing-patterns.md.template +247 -75
  50. package/dist/agents/plugins/claude/plugin/commands/README.md +133 -0
  51. package/dist/agents/plugins/claude/plugin/commands/codemie-init.md +336 -544
  52. package/dist/agents/plugins/claude/plugin/commands/codemie-subagents.md +232 -503
  53. package/dist/agents/plugins/claude/plugin/commands/memory-add.md +311 -30
  54. package/dist/agents/plugins/claude/plugin/commands/memory-refresh.md +218 -39
  55. package/dist/agents/plugins/gemini/gemini.plugin.d.ts.map +1 -1
  56. package/dist/agents/plugins/gemini/gemini.plugin.js +0 -3
  57. package/dist/agents/plugins/gemini/gemini.plugin.js.map +1 -1
  58. package/dist/agents/plugins/opencode/index.d.ts +8 -0
  59. package/dist/agents/plugins/opencode/index.d.ts.map +1 -0
  60. package/dist/agents/plugins/opencode/index.js +12 -0
  61. package/dist/agents/plugins/opencode/index.js.map +1 -0
  62. package/dist/agents/plugins/opencode/opencode-message-types.d.ts +207 -0
  63. package/dist/agents/plugins/opencode/opencode-message-types.d.ts.map +1 -0
  64. package/dist/agents/plugins/opencode/opencode-message-types.js +59 -0
  65. package/dist/agents/plugins/opencode/opencode-message-types.js.map +1 -0
  66. package/dist/agents/plugins/opencode/opencode-model-configs.d.ts +65 -0
  67. package/dist/agents/plugins/opencode/opencode-model-configs.d.ts.map +1 -0
  68. package/dist/agents/plugins/opencode/opencode-model-configs.js +184 -0
  69. package/dist/agents/plugins/opencode/opencode-model-configs.js.map +1 -0
  70. package/dist/agents/plugins/opencode/opencode.paths.d.ts +62 -0
  71. package/dist/agents/plugins/opencode/opencode.paths.d.ts.map +1 -0
  72. package/dist/agents/plugins/opencode/opencode.paths.js +148 -0
  73. package/dist/agents/plugins/opencode/opencode.paths.js.map +1 -0
  74. package/dist/agents/plugins/opencode/opencode.plugin.d.ts +35 -0
  75. package/dist/agents/plugins/opencode/opencode.plugin.d.ts.map +1 -0
  76. package/dist/agents/plugins/opencode/opencode.plugin.js +338 -0
  77. package/dist/agents/plugins/opencode/opencode.plugin.js.map +1 -0
  78. package/dist/agents/plugins/opencode/opencode.session.d.ts +77 -0
  79. package/dist/agents/plugins/opencode/opencode.session.d.ts.map +1 -0
  80. package/dist/agents/plugins/opencode/opencode.session.js +424 -0
  81. package/dist/agents/plugins/opencode/opencode.session.js.map +1 -0
  82. package/dist/agents/plugins/opencode/opencode.storage-utils.d.ts +25 -0
  83. package/dist/agents/plugins/opencode/opencode.storage-utils.d.ts.map +1 -0
  84. package/dist/agents/plugins/opencode/opencode.storage-utils.js +96 -0
  85. package/dist/agents/plugins/opencode/opencode.storage-utils.js.map +1 -0
  86. package/dist/agents/plugins/opencode/session/processors/opencode.conversations-processor.d.ts +30 -0
  87. package/dist/agents/plugins/opencode/session/processors/opencode.conversations-processor.d.ts.map +1 -0
  88. package/dist/agents/plugins/opencode/session/processors/opencode.conversations-processor.js +116 -0
  89. package/dist/agents/plugins/opencode/session/processors/opencode.conversations-processor.js.map +1 -0
  90. package/dist/agents/plugins/opencode/session/processors/opencode.metrics-processor.d.ts +102 -0
  91. package/dist/agents/plugins/opencode/session/processors/opencode.metrics-processor.d.ts.map +1 -0
  92. package/dist/agents/plugins/opencode/session/processors/opencode.metrics-processor.js +584 -0
  93. package/dist/agents/plugins/opencode/session/processors/opencode.metrics-processor.js.map +1 -0
  94. package/dist/agents/registry.d.ts.map +1 -1
  95. package/dist/agents/registry.js +2 -0
  96. package/dist/agents/registry.js.map +1 -1
  97. package/dist/cli/commands/doctor/checks/AgentsCheck.d.ts +5 -0
  98. package/dist/cli/commands/doctor/checks/AgentsCheck.d.ts.map +1 -1
  99. package/dist/cli/commands/doctor/checks/AgentsCheck.js +29 -0
  100. package/dist/cli/commands/doctor/checks/AgentsCheck.js.map +1 -1
  101. package/dist/cli/commands/install.d.ts.map +1 -1
  102. package/dist/cli/commands/install.js +86 -7
  103. package/dist/cli/commands/install.js.map +1 -1
  104. package/dist/cli/commands/opencode-metrics.d.ts +13 -0
  105. package/dist/cli/commands/opencode-metrics.d.ts.map +1 -0
  106. package/dist/cli/commands/opencode-metrics.js +200 -0
  107. package/dist/cli/commands/opencode-metrics.js.map +1 -0
  108. package/dist/cli/commands/setup.d.ts.map +1 -1
  109. package/dist/cli/commands/setup.js +113 -0
  110. package/dist/cli/commands/setup.js.map +1 -1
  111. package/dist/cli/commands/skill.d.ts +6 -0
  112. package/dist/cli/commands/skill.d.ts.map +1 -0
  113. package/dist/cli/commands/skill.js +196 -0
  114. package/dist/cli/commands/skill.js.map +1 -0
  115. package/dist/cli/commands/update.d.ts.map +1 -1
  116. package/dist/cli/commands/update.js +34 -6
  117. package/dist/cli/commands/update.js.map +1 -1
  118. package/dist/cli/index.js +4 -0
  119. package/dist/cli/index.js.map +1 -1
  120. package/dist/migrations/003-remove-hooks-node.migration.d.ts +22 -0
  121. package/dist/migrations/003-remove-hooks-node.migration.d.ts.map +1 -0
  122. package/dist/migrations/003-remove-hooks-node.migration.js +103 -0
  123. package/dist/migrations/003-remove-hooks-node.migration.js.map +1 -0
  124. package/dist/migrations/index.d.ts +1 -0
  125. package/dist/migrations/index.d.ts.map +1 -1
  126. package/dist/migrations/index.js +1 -1
  127. package/dist/migrations/index.js.map +1 -1
  128. package/dist/providers/plugins/sso/sso.http-client.js +2 -2
  129. package/dist/providers/plugins/sso/sso.http-client.js.map +1 -1
  130. package/dist/providers/plugins/sso/sso.setup-steps.d.ts.map +1 -1
  131. package/dist/providers/plugins/sso/sso.setup-steps.js +14 -10
  132. package/dist/providers/plugins/sso/sso.setup-steps.js.map +1 -1
  133. package/dist/skills/core/SkillDiscovery.d.ts +83 -0
  134. package/dist/skills/core/SkillDiscovery.d.ts.map +1 -0
  135. package/dist/skills/core/SkillDiscovery.js +237 -0
  136. package/dist/skills/core/SkillDiscovery.js.map +1 -0
  137. package/dist/skills/core/SkillManager.d.ts +86 -0
  138. package/dist/skills/core/SkillManager.d.ts.map +1 -0
  139. package/dist/skills/core/SkillManager.js +155 -0
  140. package/dist/skills/core/SkillManager.js.map +1 -0
  141. package/dist/skills/core/types.d.ts +120 -0
  142. package/dist/skills/core/types.d.ts.map +1 -0
  143. package/dist/skills/core/types.js +20 -0
  144. package/dist/skills/core/types.js.map +1 -0
  145. package/dist/skills/index.d.ts +12 -0
  146. package/dist/skills/index.d.ts.map +1 -0
  147. package/dist/skills/index.js +12 -0
  148. package/dist/skills/index.js.map +1 -0
  149. package/dist/skills/utils/content-loader.d.ts +25 -0
  150. package/dist/skills/utils/content-loader.d.ts.map +1 -0
  151. package/dist/skills/utils/content-loader.js +161 -0
  152. package/dist/skills/utils/content-loader.js.map +1 -0
  153. package/dist/skills/utils/frontmatter.d.ts +60 -0
  154. package/dist/skills/utils/frontmatter.d.ts.map +1 -0
  155. package/dist/skills/utils/frontmatter.js +114 -0
  156. package/dist/skills/utils/frontmatter.js.map +1 -0
  157. package/dist/skills/utils/pattern-matcher.d.ts +60 -0
  158. package/dist/skills/utils/pattern-matcher.d.ts.map +1 -0
  159. package/dist/skills/utils/pattern-matcher.js +97 -0
  160. package/dist/skills/utils/pattern-matcher.js.map +1 -0
  161. package/dist/utils/installation-detector.d.ts +22 -0
  162. package/dist/utils/installation-detector.d.ts.map +1 -0
  163. package/dist/utils/installation-detector.js +49 -0
  164. package/dist/utils/installation-detector.js.map +1 -0
  165. package/dist/utils/native-installer.d.ts +49 -0
  166. package/dist/utils/native-installer.d.ts.map +1 -0
  167. package/dist/utils/native-installer.js +194 -0
  168. package/dist/utils/native-installer.js.map +1 -0
  169. package/dist/utils/version-utils.d.ts +50 -0
  170. package/dist/utils/version-utils.d.ts.map +1 -0
  171. package/dist/utils/version-utils.js +92 -0
  172. package/dist/utils/version-utils.js.map +1 -0
  173. package/package.json +5 -2
  174. package/scripts/copy-mr-skill-to-global.ts +252 -0
  175. package/scripts/demo-hooks.sh +125 -0
  176. package/scripts/test-hooks.sh +196 -0
  177. package/dist/agents/plugins/claude/plugin/claude-templates/templates/INDEX.md +0 -205
  178. package/dist/agents/plugins/claude/plugin/claude-templates/templates/TEMPLATE_SIZES.md +0 -74
  179. package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/architecture/layered-architecture.md.template +0 -143
  180. package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/architecture/project-structure.md.template +0 -127
@@ -1,143 +1,315 @@
1
+ ---
1
2
  # Testing Patterns
2
3
 
3
- ## Quick Summary
4
+ <!--
5
+ GENERATION INSTRUCTIONS:
6
+ 1. Identify test framework from dependencies/config
7
+ 2. Scan test directory structure and naming patterns
8
+ 3. Extract fixture/factory patterns from setup files
9
+ 4. Find mocking patterns in existing tests
10
+ 5. Locate test database configuration
11
+ 6. Extract commands from package.json/Makefile/scripts
12
+ 7. Output: 150-300 lines max
13
+ -->
14
+
15
+ **Project**: [Extract from config]
16
+ **Framework**: [Detect: Jest | Pytest | Mocha | Vitest | RSpec | etc.]
17
+ **Coverage Tool**: [Detect: coverage.py | nyc | c8 | etc.]
18
+ **Test Location**: `[Detect tests/ or __tests__/ or spec/]`
19
+
20
+ ---
21
+
22
+ ## Test Organization
23
+
24
+ <!-- Scan actual test directory structure -->
25
+
26
+ ```
27
+ [test_root]/
28
+ ├── [unit/] [Detected structure]
29
+ │ └── [pattern]/
30
+ ├── [integration/] [If exists]
31
+ │ └── [pattern]/
32
+ ├── [e2e/] [If exists]
33
+ ├── [fixtures/factories/] [Test data location]
34
+ └── [setup files] [conftest.py, setup.ts, etc.]
35
+ ```
36
+
37
+ ### Naming Conventions
4
38
 
5
- Testing patterns for [PROJECT_NAME] using [TEST_FRAMEWORK]: unit tests, integration tests, fixtures, and mocking.
39
+ | Element | Pattern | Example |
40
+ |---------|---------|---------|
41
+ | Test files | `[detected pattern]` | `[actual example]` |
42
+ | Test functions | `[detected pattern]` | `[actual example]` |
43
+ | Fixture files | `[detected pattern]` | `[actual example]` |
6
44
 
7
- **Category**: Testing
8
- **Complexity**: Medium
9
- **Prerequisites**: [TEST_FRAMEWORK], testing fundamentals
45
+ ---
46
+
47
+ ## Running Tests
48
+
49
+ <!-- Extract exact commands from scripts -->
50
+
51
+ | Action | Command |
52
+ |--------|---------|
53
+ | All tests | `[exact command]` |
54
+ | Unit only | `[command or N/A]` |
55
+ | Integration only | `[command or N/A]` |
56
+ | Single file | `[command pattern]` |
57
+ | Single test | `[command pattern]` |
58
+ | Watch mode | `[command or N/A]` |
59
+ | With coverage | `[command]` |
60
+ | Verbose/debug | `[command with flags]` |
10
61
 
11
62
  ---
12
63
 
13
- ## 🚨 SIZE LIMIT WARNING
64
+ ## Unit Test Pattern
14
65
 
15
- **This generated guide MUST be 200-400 lines maximum.**
66
+ <!-- Extract canonical unit test example -->
16
67
 
17
- **When filling this template**:
18
- - Code examples: 5-15 lines (NEVER > 20)
19
- - ONE example per pattern
20
- - ✅ Use file:line references, not full code
21
- - ✅ Use tables for multiple patterns
22
- - ❌ NO multiple examples for same pattern
23
- - ❌ NO verbose explanations
24
- - ❌ NO copying entire functions
68
+ ```[lang]
69
+ // Source: [file:lines]
70
+ [Extract representative unit test showing framework syntax]
71
+ ```
72
+
73
+ ### Structure
25
74
 
26
- **Validate line count after generation**: `wc -l [this-file]`
27
- **If > 400 lines**: Condense immediately before continuing!
75
+ ```[lang]
76
+ // Standard test structure in this codebase:
77
+ [describe/test block] {
78
+ // Arrange - setup test data
79
+ // Act - call function under test
80
+ // Assert - verify result
81
+ }
82
+ ```
28
83
 
29
84
  ---
30
85
 
31
- ## Test Structure
86
+ ## Fixtures / Test Data
87
+
88
+ <!-- Find fixture or factory patterns -->
32
89
 
90
+ ### Setup Pattern
91
+
92
+ ```[lang]
93
+ // Source: [file:lines]
94
+ [Extract fixture/factory definition]
33
95
  ```
34
- tests/
35
- ├── unit/ Mirror source structure
36
- │ └── [module]/
37
- │ └── test_[file].[ext]
38
- ├── integration/
39
- │ └── test_[feature].[ext]
40
- └── fixtures/
41
- └── [fixture_files]
96
+
97
+ ### Using Fixtures
98
+
99
+ ```[lang]
100
+ // Source: [file:lines]
101
+ [Extract fixture usage in test]
42
102
  ```
43
103
 
44
- **Naming**: `test_[scenario]_[expected_outcome]`
104
+ ### Common Fixtures
105
+
106
+ | Fixture | Purpose | Location |
107
+ |---------|---------|----------|
108
+ | `[fixture name]` | [What it provides] | `[file:line]` |
109
+ | `[fixture name]` | [What it provides] | `[file:line]` |
110
+ | `[fixture name]` | [What it provides] | `[file:line]` |
45
111
 
46
112
  ---
47
113
 
48
- ## Unit Test Pattern
114
+ ## Mocking
115
+
116
+ <!-- Extract mocking patterns used -->
117
+
118
+ ### Mock Syntax
119
+
120
+ ```[lang]
121
+ // Source: [file:lines]
122
+ [Extract mocking example - service, module, or function mock]
123
+ ```
124
+
125
+ ### What to Mock
126
+
127
+ | Layer | Mock In Unit Tests | Mock In Integration |
128
+ |-------|-------------------|---------------------|
129
+ | External APIs | ✅ Always | ✅ Usually |
130
+ | Database | ✅ Usually | ❌ Use test DB |
131
+ | Other services | ✅ Yes | Depends |
132
+ | File system | ✅ Yes | Depends |
133
+ | Time/Date | ✅ When needed | When needed |
134
+
135
+ ### Mock Patterns in This Codebase
136
+
137
+ | What | How | Source |
138
+ |------|-----|--------|
139
+ | `[Service/Module]` | `[mock syntax]` | `[file:line]` |
140
+ | `[External API]` | `[mock syntax]` | `[file:line]` |
141
+ | `[Database/Repository]` | `[mock syntax]` | `[file:line]` |
142
+
143
+ ---
144
+
145
+ ## Database Testing
146
+
147
+ <!-- Find test database configuration -->
49
148
 
50
- ```[language]
51
- # Source: [test_file:lines]
52
- [unit_test_example]
149
+ ### Setup
150
+
151
+ **Test DB**: `[separate DB / transactions / in-memory / mocked]`
152
+
153
+ ```[lang]
154
+ // Source: [file:lines]
155
+ [Extract test DB setup/connection]
156
+ ```
157
+
158
+ ### Isolation Pattern
159
+
160
+ ```[lang]
161
+ // Source: [file:lines]
162
+ [Extract transaction rollback or cleanup pattern]
53
163
  ```
54
164
 
55
- **Structure**: Arrange Act → Assert
165
+ ### Seeding Test Data
166
+
167
+ ```[lang]
168
+ // Source: [file:lines]
169
+ [Extract test data seeding pattern]
170
+ ```
56
171
 
57
172
  ---
58
173
 
59
- ## Fixtures
174
+ ## API / Endpoint Testing
175
+
176
+ <!-- If web app, find HTTP testing patterns -->
177
+
178
+ ### Test Client Setup
60
179
 
61
- ```[language]
62
- # Source: [conftest_or_setup:lines]
63
- [fixture_example]
180
+ ```[lang]
181
+ // Source: [file:lines]
182
+ [Extract test client/supertest/httpx setup]
64
183
  ```
65
184
 
66
- **Scopes**: function | class | module | session
185
+ ### Request Pattern
186
+
187
+ ```[lang]
188
+ // Source: [file:lines]
189
+ [Extract API test example]
190
+ ```
67
191
 
68
192
  ---
69
193
 
70
- ## Mocking
194
+ ## Async Testing
71
195
 
72
- ```[language]
73
- # Source: [test_file:lines]
74
- [mock_example]
196
+ <!-- If async code exists, find testing pattern -->
197
+
198
+ ```[lang]
199
+ // Source: [file:lines]
200
+ [Extract async test example]
75
201
  ```
76
202
 
77
- **Mock**: External APIs, database (for unit tests), file system, time
203
+ **Pattern**: `[async/await | done callback | returns promise]`
78
204
 
79
205
  ---
80
206
 
81
207
  ## Parameterized Tests
82
208
 
83
- ```[language]
84
- # Source: [test_file:lines]
85
- [parameterized_example]
209
+ <!-- Find data-driven test patterns -->
210
+
211
+ ```[lang]
212
+ // Source: [file:lines]
213
+ [Extract parameterized/table-driven test]
86
214
  ```
87
215
 
88
216
  ---
89
217
 
90
- ## Integration Tests
218
+ ## Coverage
91
219
 
92
- ```[language]
93
- # Source: [test_file:lines]
94
- [integration_test_example]
95
- ```
220
+ <!-- Extract coverage configuration -->
96
221
 
97
- **Characteristics**: Multiple components, real dependencies (test DB)
222
+ ### Configuration
98
223
 
99
- ---
224
+ **Config file**: `[jest.config / .coveragerc / nyc config]`
225
+
226
+ | Setting | Value |
227
+ |---------|-------|
228
+ | Threshold | `[percentage or N/A]` |
229
+ | Include | `[paths/patterns]` |
230
+ | Exclude | `[paths/patterns]` |
100
231
 
101
- ## Test Commands
232
+ ### Generate Report
102
233
 
103
234
  ```bash
104
- # Run all tests
105
- [run_all]
235
+ # Generate coverage report
236
+ [coverage command]
106
237
 
107
- # Run specific file
108
- [run_file]
238
+ # View HTML report (if available)
239
+ [open coverage/index.html or equivalent]
240
+ ```
241
+
242
+ ---
243
+
244
+ ## Test Environment
245
+
246
+ <!-- Find environment setup for tests -->
247
+
248
+ ### Environment Variables
249
+
250
+ ```[lang]
251
+ // Source: [file:lines] or [.env.test]
252
+ [Extract test environment config]
253
+ ```
254
+
255
+ ### Setup/Teardown
109
256
 
110
- # Run with coverage
111
- [coverage]
257
+ ```[lang]
258
+ // Source: [file:lines]
259
+ [Extract global setup/teardown if exists]
112
260
  ```
113
261
 
114
262
  ---
115
263
 
116
- ## Coverage
264
+ ## Writing New Tests
265
+
266
+ ### Checklist
117
267
 
118
- **Targets**:
119
- - Overall: [X]%
120
- - Critical paths: [Y]%
268
+ 1. Create test file: `[path pattern]`
269
+ 2. Import test utilities: `[common imports]`
270
+ 3. Setup fixtures needed
271
+ 4. Follow naming: `[test naming pattern]`
272
+ 5. Run to verify: `[run single test command]`
121
273
 
122
- **Focus on**: Business logic, error handling, edge cases
274
+ ### Template
275
+
276
+ ```[lang]
277
+ // Starter template for new test file
278
+ [Extract or construct minimal test file template]
279
+ ```
123
280
 
124
281
  ---
125
282
 
126
- ## Best Practices
283
+ ## Common Patterns
127
284
 
128
- | DO | DON'T |
129
- |-------|----------|
130
- | One assertion per test | Multiple scenarios in one test |
131
- | Descriptive test names | `test1`, `test2` |
132
- | Arrange-Act-Assert | Mixed concerns |
133
- | Mock external dependencies | Real APIs in unit tests |
134
- | Keep tests fast | Long-running tests |
285
+ | Pattern | When to Use | Example |
286
+ |---------|-------------|---------|
287
+ | `[beforeEach/setUp]` | Reset state per test | `[file:line]` |
288
+ | `[afterAll/teardown]` | Cleanup resources | `[file:line]` |
289
+ | `[test.skip/xtest]` | Temporarily disable | - |
290
+ | `[test.only/fit]` | Run single test (debug) | - |
135
291
 
136
292
  ---
137
293
 
138
- ## References
294
+ ## Troubleshooting
139
295
 
140
- - **Tests**: `[test_directory]/`
141
- - **Fixtures**: `[fixture_location]`
296
+ | Issue | Solution |
297
+ |-------|----------|
298
+ | Tests interfering | Check isolation, add cleanup |
299
+ | Async timeout | Increase timeout or check await |
300
+ | Mock not working | Verify mock path matches import |
301
+ | DB state issues | Check transaction rollback |
142
302
 
143
303
  ---
304
+
305
+ ## Quick Reference
306
+
307
+ | Need | Location |
308
+ |------|----------|
309
+ | Test config | `[config file path]` |
310
+ | Fixtures | `[fixtures path]` |
311
+ | Factories | `[factories path]` |
312
+ | Test utilities | `[helpers/utils path]` |
313
+ | Coverage config | `[config path]` |
314
+
315
+ ---
@@ -0,0 +1,133 @@
1
+ # Claude Code Plugin Commands
2
+
3
+ Built-in commands for the CodeMie Claude Code plugin. These commands are automatically available when using `codemie-claude`.
4
+
5
+ ## Project Documentation
6
+
7
+ ### `/codemie-init` - Generate Project Documentation
8
+
9
+ Analyzes your codebase and generates AI-optimized documentation:
10
+ - Main `CLAUDE.md` file with project-specific workflows
11
+ - Detailed guides in `.codemie/guides/` (only for patterns that exist in your code)
12
+
13
+ **Usage:**
14
+ ```
15
+ /codemie-init
16
+ /codemie-init "focus on API patterns"
17
+ ```
18
+
19
+ **What it does:**
20
+ 1. Analyzes project structure, tech stack, and patterns
21
+ 2. Detects which categories apply (Architecture, API, Testing, etc.)
22
+ 3. Generates guides only for detected patterns (no empty guides)
23
+ 4. Creates/updates `CLAUDE.md` with guide references
24
+ 5. Preserves existing customizations when updating
25
+
26
+ **Output:**
27
+ - `CLAUDE.md` (200-300 lines) - Project overview and guide references
28
+ - `.codemie/guides/<category>/*.md` (200-400 lines each) - Detailed patterns
29
+
30
+ ### `/codemie-subagents` - Generate Specialized Agents
31
+
32
+ Creates project-specific subagent files tailored to your codebase:
33
+
34
+ **Usage:**
35
+ ```
36
+ /codemie-subagents
37
+ ```
38
+
39
+ **Generated Agents:**
40
+ - `unit-tester-agent.md` - Knows your test framework and patterns
41
+ - `solution-architect-agent.md` - Understands your architecture
42
+ - `code-review-agent.md` - Applies your code standards
43
+ - `refactor-cleaner-agent.md` - Uses your cleanup tools
44
+
45
+ **What it does:**
46
+ 1. Reads existing guides from `.codemie/guides/` (if available)
47
+ 2. Analyzes project structure, test setup, linting rules
48
+ 3. Generates/updates agents in `.claude/agents/`
49
+ 4. Preserves custom content when updating existing agents
50
+
51
+ ## Memory Management
52
+
53
+ ### `/memory-add` - Capture Knowledge
54
+
55
+ Adds important learnings to project documentation for future sessions.
56
+
57
+ **Usage:**
58
+ ```
59
+ /memory-add
60
+ /memory-add "important context about auth flow"
61
+ ```
62
+
63
+ **When to use:**
64
+ - You learned something non-obvious about the project
65
+ - User corrected a pattern or approach
66
+ - You discovered an important architectural decision or gotcha
67
+
68
+ **What it does:**
69
+ 1. Identifies what was learned during the session
70
+ 2. Determines scope (project-wide vs component-specific)
71
+ 3. Adds structured knowledge to appropriate documentation
72
+
73
+ **Where it writes:**
74
+ - Project-wide patterns → Root `CLAUDE.md` or main docs
75
+ - Component-specific → Component `CLAUDE.md` or guide section
76
+
77
+ ### `/memory-refresh` - Audit Documentation
78
+
79
+ Verifies and updates documentation to reflect current implementation.
80
+
81
+ **Usage:**
82
+ ```
83
+ /memory-refresh
84
+ ```
85
+
86
+ **What it does:**
87
+ 1. Reviews recent code changes
88
+ 2. Compares documentation against actual implementation
89
+ 3. Updates only outdated/incorrect sections
90
+ 4. Validates all references and examples
91
+
92
+ **When to use:**
93
+ - After significant refactoring
94
+ - When patterns have evolved
95
+ - Before starting work on unfamiliar code
96
+ - Periodically to keep docs accurate
97
+
98
+ ## Status Command
99
+
100
+ ### `/codemie-status` - Session Information
101
+
102
+ Displays current session tracking status and metrics.
103
+
104
+ **Usage:**
105
+ ```
106
+ /codemie-status
107
+ ```
108
+
109
+ **Output:**
110
+ ```
111
+ CodeMie Session Status
112
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
113
+ Session ID: 550e8400...
114
+ Started: 2026-01-12 10:30:45 (15m ago)
115
+ Metrics: 15,234 tokens | 42 tools | 23 files
116
+ Sync: ✓ Connected (last: 30s ago)
117
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
118
+ ```
119
+
120
+ ## Command Principles
121
+
122
+ **Project-Aware:** All commands analyze your actual codebase, not generic templates
123
+
124
+ **Selective Updates:** Only creates/updates documentation when patterns actually exist
125
+
126
+ **Preserves Customizations:** When updating, keeps user-added content
127
+
128
+ **Size Conscious:** Enforces line limits to keep documentation scannable:
129
+ - `CLAUDE.md`: 200-300 lines
130
+ - Guides: 200-400 lines each
131
+ - Subagents: 150-300 lines each
132
+
133
+ **Examples From Code:** Uses real code examples, not hypothetical ones