@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.
- package/README.md +73 -7
- package/bin/codemie-opencode.js +11 -0
- package/dist/agents/codemie-code/agent.d.ts +17 -1
- package/dist/agents/codemie-code/agent.d.ts.map +1 -1
- package/dist/agents/codemie-code/agent.js +62 -3
- package/dist/agents/codemie-code/agent.js.map +1 -1
- package/dist/agents/codemie-code/index.d.ts +1 -0
- package/dist/agents/codemie-code/index.d.ts.map +1 -1
- package/dist/agents/codemie-code/index.js +28 -2
- package/dist/agents/codemie-code/index.js.map +1 -1
- package/dist/agents/codemie-code/prompts.d.ts +12 -3
- package/dist/agents/codemie-code/prompts.d.ts.map +1 -1
- package/dist/agents/codemie-code/prompts.js +25 -5
- package/dist/agents/codemie-code/prompts.js.map +1 -1
- package/dist/agents/codemie-code/types.d.ts +3 -0
- package/dist/agents/codemie-code/types.d.ts.map +1 -1
- package/dist/agents/codemie-code/types.js.map +1 -1
- package/dist/agents/core/AgentCLI.d.ts.map +1 -1
- package/dist/agents/core/AgentCLI.js +3 -1
- package/dist/agents/core/AgentCLI.js.map +1 -1
- package/dist/agents/core/BaseAgentAdapter.d.ts.map +1 -1
- package/dist/agents/core/BaseAgentAdapter.js +33 -0
- package/dist/agents/core/BaseAgentAdapter.js.map +1 -1
- package/dist/agents/core/session/BaseSessionAdapter.d.ts +25 -0
- package/dist/agents/core/session/BaseSessionAdapter.d.ts.map +1 -1
- package/dist/agents/core/session/discovery-types.d.ts +53 -0
- package/dist/agents/core/session/discovery-types.d.ts.map +1 -0
- package/dist/agents/core/session/discovery-types.js +8 -0
- package/dist/agents/core/session/discovery-types.js.map +1 -0
- package/dist/agents/core/types.d.ts +45 -0
- package/dist/agents/core/types.d.ts.map +1 -1
- package/dist/agents/plugins/claude/claude.plugin.d.ts +44 -1
- package/dist/agents/plugins/claude/claude.plugin.d.ts.map +1 -1
- package/dist/agents/plugins/claude/claude.plugin.js +214 -0
- package/dist/agents/plugins/claude/claude.plugin.js.map +1 -1
- package/dist/agents/plugins/claude/plugin/README.md +40 -2
- package/dist/agents/plugins/claude/plugin/claude-templates/README.md +5 -5
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/CLAUDE.md.template +177 -436
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/agents/code-review-agent-template.md.template +49 -82
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/agents/refactor-cleaner-agent.md.template +337 -0
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/agents/solution-architect-agent.md.template +129 -419
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/agents/unit-tester-agent.md.template +146 -693
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/api/api-patterns.md.template +110 -138
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/architecture/architecture.md.template +197 -0
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/data/database-patterns.md.template +171 -91
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/development/development-practices.md.template +219 -131
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/security/security-practices.md.template +223 -98
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/standards/code-quality.md.template +131 -95
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/testing/testing-patterns.md.template +247 -75
- package/dist/agents/plugins/claude/plugin/commands/README.md +133 -0
- package/dist/agents/plugins/claude/plugin/commands/codemie-init.md +336 -544
- package/dist/agents/plugins/claude/plugin/commands/codemie-subagents.md +232 -503
- package/dist/agents/plugins/claude/plugin/commands/memory-add.md +311 -30
- package/dist/agents/plugins/claude/plugin/commands/memory-refresh.md +218 -39
- package/dist/agents/plugins/gemini/gemini.plugin.d.ts.map +1 -1
- package/dist/agents/plugins/gemini/gemini.plugin.js +0 -3
- package/dist/agents/plugins/gemini/gemini.plugin.js.map +1 -1
- package/dist/agents/plugins/opencode/index.d.ts +8 -0
- package/dist/agents/plugins/opencode/index.d.ts.map +1 -0
- package/dist/agents/plugins/opencode/index.js +12 -0
- package/dist/agents/plugins/opencode/index.js.map +1 -0
- package/dist/agents/plugins/opencode/opencode-message-types.d.ts +207 -0
- package/dist/agents/plugins/opencode/opencode-message-types.d.ts.map +1 -0
- package/dist/agents/plugins/opencode/opencode-message-types.js +59 -0
- package/dist/agents/plugins/opencode/opencode-message-types.js.map +1 -0
- package/dist/agents/plugins/opencode/opencode-model-configs.d.ts +65 -0
- package/dist/agents/plugins/opencode/opencode-model-configs.d.ts.map +1 -0
- package/dist/agents/plugins/opencode/opencode-model-configs.js +184 -0
- package/dist/agents/plugins/opencode/opencode-model-configs.js.map +1 -0
- package/dist/agents/plugins/opencode/opencode.paths.d.ts +62 -0
- package/dist/agents/plugins/opencode/opencode.paths.d.ts.map +1 -0
- package/dist/agents/plugins/opencode/opencode.paths.js +148 -0
- package/dist/agents/plugins/opencode/opencode.paths.js.map +1 -0
- package/dist/agents/plugins/opencode/opencode.plugin.d.ts +35 -0
- package/dist/agents/plugins/opencode/opencode.plugin.d.ts.map +1 -0
- package/dist/agents/plugins/opencode/opencode.plugin.js +338 -0
- package/dist/agents/plugins/opencode/opencode.plugin.js.map +1 -0
- package/dist/agents/plugins/opencode/opencode.session.d.ts +77 -0
- package/dist/agents/plugins/opencode/opencode.session.d.ts.map +1 -0
- package/dist/agents/plugins/opencode/opencode.session.js +424 -0
- package/dist/agents/plugins/opencode/opencode.session.js.map +1 -0
- package/dist/agents/plugins/opencode/opencode.storage-utils.d.ts +25 -0
- package/dist/agents/plugins/opencode/opencode.storage-utils.d.ts.map +1 -0
- package/dist/agents/plugins/opencode/opencode.storage-utils.js +96 -0
- package/dist/agents/plugins/opencode/opencode.storage-utils.js.map +1 -0
- package/dist/agents/plugins/opencode/session/processors/opencode.conversations-processor.d.ts +30 -0
- package/dist/agents/plugins/opencode/session/processors/opencode.conversations-processor.d.ts.map +1 -0
- package/dist/agents/plugins/opencode/session/processors/opencode.conversations-processor.js +116 -0
- package/dist/agents/plugins/opencode/session/processors/opencode.conversations-processor.js.map +1 -0
- package/dist/agents/plugins/opencode/session/processors/opencode.metrics-processor.d.ts +102 -0
- package/dist/agents/plugins/opencode/session/processors/opencode.metrics-processor.d.ts.map +1 -0
- package/dist/agents/plugins/opencode/session/processors/opencode.metrics-processor.js +584 -0
- package/dist/agents/plugins/opencode/session/processors/opencode.metrics-processor.js.map +1 -0
- package/dist/agents/registry.d.ts.map +1 -1
- package/dist/agents/registry.js +2 -0
- package/dist/agents/registry.js.map +1 -1
- package/dist/cli/commands/doctor/checks/AgentsCheck.d.ts +5 -0
- package/dist/cli/commands/doctor/checks/AgentsCheck.d.ts.map +1 -1
- package/dist/cli/commands/doctor/checks/AgentsCheck.js +29 -0
- package/dist/cli/commands/doctor/checks/AgentsCheck.js.map +1 -1
- package/dist/cli/commands/install.d.ts.map +1 -1
- package/dist/cli/commands/install.js +86 -7
- package/dist/cli/commands/install.js.map +1 -1
- package/dist/cli/commands/opencode-metrics.d.ts +13 -0
- package/dist/cli/commands/opencode-metrics.d.ts.map +1 -0
- package/dist/cli/commands/opencode-metrics.js +200 -0
- package/dist/cli/commands/opencode-metrics.js.map +1 -0
- package/dist/cli/commands/setup.d.ts.map +1 -1
- package/dist/cli/commands/setup.js +113 -0
- package/dist/cli/commands/setup.js.map +1 -1
- package/dist/cli/commands/skill.d.ts +6 -0
- package/dist/cli/commands/skill.d.ts.map +1 -0
- package/dist/cli/commands/skill.js +196 -0
- package/dist/cli/commands/skill.js.map +1 -0
- package/dist/cli/commands/update.d.ts.map +1 -1
- package/dist/cli/commands/update.js +34 -6
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/index.js +4 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/migrations/003-remove-hooks-node.migration.d.ts +22 -0
- package/dist/migrations/003-remove-hooks-node.migration.d.ts.map +1 -0
- package/dist/migrations/003-remove-hooks-node.migration.js +103 -0
- package/dist/migrations/003-remove-hooks-node.migration.js.map +1 -0
- package/dist/migrations/index.d.ts +1 -0
- package/dist/migrations/index.d.ts.map +1 -1
- package/dist/migrations/index.js +1 -1
- package/dist/migrations/index.js.map +1 -1
- package/dist/providers/plugins/sso/sso.http-client.js +2 -2
- package/dist/providers/plugins/sso/sso.http-client.js.map +1 -1
- package/dist/providers/plugins/sso/sso.setup-steps.d.ts.map +1 -1
- package/dist/providers/plugins/sso/sso.setup-steps.js +14 -10
- package/dist/providers/plugins/sso/sso.setup-steps.js.map +1 -1
- package/dist/skills/core/SkillDiscovery.d.ts +83 -0
- package/dist/skills/core/SkillDiscovery.d.ts.map +1 -0
- package/dist/skills/core/SkillDiscovery.js +237 -0
- package/dist/skills/core/SkillDiscovery.js.map +1 -0
- package/dist/skills/core/SkillManager.d.ts +86 -0
- package/dist/skills/core/SkillManager.d.ts.map +1 -0
- package/dist/skills/core/SkillManager.js +155 -0
- package/dist/skills/core/SkillManager.js.map +1 -0
- package/dist/skills/core/types.d.ts +120 -0
- package/dist/skills/core/types.d.ts.map +1 -0
- package/dist/skills/core/types.js +20 -0
- package/dist/skills/core/types.js.map +1 -0
- package/dist/skills/index.d.ts +12 -0
- package/dist/skills/index.d.ts.map +1 -0
- package/dist/skills/index.js +12 -0
- package/dist/skills/index.js.map +1 -0
- package/dist/skills/utils/content-loader.d.ts +25 -0
- package/dist/skills/utils/content-loader.d.ts.map +1 -0
- package/dist/skills/utils/content-loader.js +161 -0
- package/dist/skills/utils/content-loader.js.map +1 -0
- package/dist/skills/utils/frontmatter.d.ts +60 -0
- package/dist/skills/utils/frontmatter.d.ts.map +1 -0
- package/dist/skills/utils/frontmatter.js +114 -0
- package/dist/skills/utils/frontmatter.js.map +1 -0
- package/dist/skills/utils/pattern-matcher.d.ts +60 -0
- package/dist/skills/utils/pattern-matcher.d.ts.map +1 -0
- package/dist/skills/utils/pattern-matcher.js +97 -0
- package/dist/skills/utils/pattern-matcher.js.map +1 -0
- package/dist/utils/installation-detector.d.ts +22 -0
- package/dist/utils/installation-detector.d.ts.map +1 -0
- package/dist/utils/installation-detector.js +49 -0
- package/dist/utils/installation-detector.js.map +1 -0
- package/dist/utils/native-installer.d.ts +49 -0
- package/dist/utils/native-installer.d.ts.map +1 -0
- package/dist/utils/native-installer.js +194 -0
- package/dist/utils/native-installer.js.map +1 -0
- package/dist/utils/version-utils.d.ts +50 -0
- package/dist/utils/version-utils.d.ts.map +1 -0
- package/dist/utils/version-utils.js +92 -0
- package/dist/utils/version-utils.js.map +1 -0
- package/package.json +5 -2
- package/scripts/copy-mr-skill-to-global.ts +252 -0
- package/scripts/demo-hooks.sh +125 -0
- package/scripts/test-hooks.sh +196 -0
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/INDEX.md +0 -205
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/TEMPLATE_SIZES.md +0 -74
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/architecture/layered-architecture.md.template +0 -143
- 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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
##
|
|
64
|
+
## Unit Test Pattern
|
|
14
65
|
|
|
15
|
-
|
|
66
|
+
<!-- Extract canonical unit test example -->
|
|
16
67
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
|
|
27
|
-
|
|
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
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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
|
-
|
|
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
|
-
##
|
|
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
|
-
|
|
51
|
-
|
|
52
|
-
[
|
|
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
|
-
|
|
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
|
-
##
|
|
174
|
+
## API / Endpoint Testing
|
|
175
|
+
|
|
176
|
+
<!-- If web app, find HTTP testing patterns -->
|
|
177
|
+
|
|
178
|
+
### Test Client Setup
|
|
60
179
|
|
|
61
|
-
```[
|
|
62
|
-
|
|
63
|
-
[
|
|
180
|
+
```[lang]
|
|
181
|
+
// Source: [file:lines]
|
|
182
|
+
[Extract test client/supertest/httpx setup]
|
|
64
183
|
```
|
|
65
184
|
|
|
66
|
-
|
|
185
|
+
### Request Pattern
|
|
186
|
+
|
|
187
|
+
```[lang]
|
|
188
|
+
// Source: [file:lines]
|
|
189
|
+
[Extract API test example]
|
|
190
|
+
```
|
|
67
191
|
|
|
68
192
|
---
|
|
69
193
|
|
|
70
|
-
##
|
|
194
|
+
## Async Testing
|
|
71
195
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
[
|
|
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
|
-
**
|
|
203
|
+
**Pattern**: `[async/await | done callback | returns promise]`
|
|
78
204
|
|
|
79
205
|
---
|
|
80
206
|
|
|
81
207
|
## Parameterized Tests
|
|
82
208
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
[
|
|
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
|
-
##
|
|
218
|
+
## Coverage
|
|
91
219
|
|
|
92
|
-
|
|
93
|
-
# Source: [test_file:lines]
|
|
94
|
-
[integration_test_example]
|
|
95
|
-
```
|
|
220
|
+
<!-- Extract coverage configuration -->
|
|
96
221
|
|
|
97
|
-
|
|
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
|
-
|
|
232
|
+
### Generate Report
|
|
102
233
|
|
|
103
234
|
```bash
|
|
104
|
-
#
|
|
105
|
-
[
|
|
235
|
+
# Generate coverage report
|
|
236
|
+
[coverage command]
|
|
106
237
|
|
|
107
|
-
#
|
|
108
|
-
[
|
|
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
|
-
|
|
111
|
-
[
|
|
257
|
+
```[lang]
|
|
258
|
+
// Source: [file:lines]
|
|
259
|
+
[Extract global setup/teardown if exists]
|
|
112
260
|
```
|
|
113
261
|
|
|
114
262
|
---
|
|
115
263
|
|
|
116
|
-
##
|
|
264
|
+
## Writing New Tests
|
|
265
|
+
|
|
266
|
+
### Checklist
|
|
117
267
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
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
|
-
|
|
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
|
-
##
|
|
283
|
+
## Common Patterns
|
|
127
284
|
|
|
128
|
-
|
|
|
129
|
-
|
|
130
|
-
|
|
|
131
|
-
|
|
|
132
|
-
|
|
|
133
|
-
|
|
|
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
|
-
##
|
|
294
|
+
## Troubleshooting
|
|
139
295
|
|
|
140
|
-
|
|
141
|
-
|
|
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
|