rebar-mcp 2.0.0 → 2.2.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.
- package/.claude/skills/{bmmibwetxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx → bmmoseokfxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}/SKILL.md +2 -2
- package/.claude/skills/{bmmibwjgvxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx → bmmosewq3xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}/SKILL.md +2 -2
- package/.claude/skills/{bmmibwsesxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx → bmmosf3hvxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}/SKILL.md +2 -2
- package/.claude/skills/{bmmibwxufxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx → bmmosfe4bxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}/SKILL.md +2 -2
- package/.claude/skills/bmmous2g0xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/SKILL.md +21 -0
- package/.claude/skills/{bnd-mmibweu3 → bnd-mmoseokj}/SKILL.md +2 -2
- package/.claude/skills/{bnd-mmibwjh4 → bnd-mmosewq9}/SKILL.md +2 -2
- package/.claude/skills/{bnd-mmibwsey → bnd-mmosf3i0}/SKILL.md +2 -2
- package/.claude/skills/{bnd-mmibwxup → bnd-mmosfe4f}/SKILL.md +2 -2
- package/.claude/skills/bnd-mmous2g4/SKILL.md +21 -0
- package/.claude/skills/{nl-mmibweus → nl-mmoseoky}/SKILL.md +2 -2
- package/.claude/skills/{nl-mmibwjhf → nl-mmosewqr}/SKILL.md +2 -2
- package/.claude/skills/{nl-mmibwsf7 → nl-mmosf3i7}/SKILL.md +2 -2
- package/.claude/skills/{nl-mmibwxvq → nl-mmosfe4m}/SKILL.md +2 -2
- package/.claude/skills/nl-mmous2gc/SKILL.md +25 -0
- package/.claude/skills/test/", /"malicious/": /"true/SKILL.md" +43 -62
- package/.claude/skills/test-emoji-/360/237/230/200-skill/SKILL.md +43 -62
- package/.claude/skills/test-skill/SKILL.md +43 -62
- package/.claude/skills/test; rm -rf /; skill/SKILL.md +43 -62
- package/.claude/skills/test<script>alert(1)</script>skill/SKILL.md +43 -62
- package/README.md +141 -14
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +207 -0
- package/dist/cli.js.map +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +1 -1
- package/dist/constants.js.map +1 -1
- package/dist/index.js +73 -9
- package/dist/index.js.map +1 -1
- package/dist/schemas/common.d.ts +3 -0
- package/dist/schemas/common.d.ts.map +1 -1
- package/dist/schemas/scaffolding.d.ts +79 -0
- package/dist/schemas/scaffolding.d.ts.map +1 -1
- package/dist/schemas/scaffolding.js +28 -0
- package/dist/schemas/scaffolding.js.map +1 -1
- package/dist/services/prereview-engine.d.ts +60 -0
- package/dist/services/prereview-engine.d.ts.map +1 -0
- package/dist/services/prereview-engine.js +354 -0
- package/dist/services/prereview-engine.js.map +1 -0
- package/dist/services/strictness.js +10 -10
- package/dist/services/strictness.js.map +1 -1
- package/dist/tests/enforcement.test.js +8 -11
- package/dist/tests/enforcement.test.js.map +1 -1
- package/dist/tests/knowledge.test.js +4 -5
- package/dist/tests/knowledge.test.js.map +1 -1
- package/dist/tools/enterprise.d.ts.map +1 -1
- package/dist/tools/enterprise.js +303 -102
- package/dist/tools/enterprise.js.map +1 -1
- package/dist/tools/knowledge.d.ts.map +1 -1
- package/dist/tools/knowledge.js +51 -14
- package/dist/tools/knowledge.js.map +1 -1
- package/dist/tools/management.d.ts.map +1 -1
- package/dist/tools/management.js +95 -6
- package/dist/tools/management.js.map +1 -1
- package/dist/tools/prereview.d.ts +3 -0
- package/dist/tools/prereview.d.ts.map +1 -0
- package/dist/tools/prereview.js +523 -0
- package/dist/tools/prereview.js.map +1 -0
- package/dist/tools/scaffolding.d.ts.map +1 -1
- package/dist/tools/scaffolding.js +188 -56
- package/dist/tools/scaffolding.js.map +1 -1
- package/package.json +2 -1
- package/src/cli.ts +245 -0
- package/src/constants.ts +1 -1
- package/src/index.ts +83 -9
- package/src/schemas/scaffolding.ts +28 -0
- package/src/services/prereview-engine.ts +428 -0
- package/src/services/strictness.ts +10 -10
- package/src/tests/enforcement.test.ts +8 -12
- package/src/tests/knowledge.test.ts +4 -6
- package/src/tools/enterprise.ts +311 -100
- package/src/tools/knowledge.ts +52 -15
- package/src/tools/management.ts +99 -6
- package/src/tools/prereview.ts +685 -0
- package/src/tools/scaffolding.ts +185 -47
- package/.claude/skills/bmmibx3r9xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/SKILL.md +0 -21
- package/.claude/skills/bmmji0lrkxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/SKILL.md +0 -21
- package/.claude/skills/bmmjiniphxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/SKILL.md +0 -21
- package/.claude/skills/bmmjio86zxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/SKILL.md +0 -21
- package/.claude/skills/bmmjiolfbxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/SKILL.md +0 -21
- package/.claude/skills/bmmjit1lvxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/SKILL.md +0 -21
- package/.claude/skills/bmmjita1qxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/SKILL.md +0 -21
- package/.claude/skills/bnd-mmibx3rg/SKILL.md +0 -21
- package/.claude/skills/bnd-mmji0lrp/SKILL.md +0 -21
- package/.claude/skills/bnd-mmjinipm/SKILL.md +0 -21
- package/.claude/skills/bnd-mmjio875/SKILL.md +0 -21
- package/.claude/skills/bnd-mmjiolfg/SKILL.md +0 -21
- package/.claude/skills/bnd-mmjit1m3/SKILL.md +0 -21
- package/.claude/skills/bnd-mmjita1x/SKILL.md +0 -21
- package/.claude/skills/coercion-test/SKILL.md +0 -50
- package/.claude/skills/mcp-dev/SKILL.md +0 -61
- package/.claude/skills/nl-mmibx3rt/SKILL.md +0 -25
- package/.claude/skills/nl-mmji0lrz/SKILL.md +0 -25
- package/.claude/skills/nl-mmjinipx/SKILL.md +0 -25
- package/.claude/skills/nl-mmjio87f/SKILL.md +0 -25
- package/.claude/skills/nl-mmjiolfs/SKILL.md +0 -25
- package/.claude/skills/nl-mmjit1mc/SKILL.md +0 -25
- package/.claude/skills/nl-mmjita26/SKILL.md +0 -25
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
|
-
name:
|
|
2
|
+
name: bmmoseokfxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
3
3
|
description: A test skill
|
|
4
4
|
invocation: undefined
|
|
5
5
|
context: undefined
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
#
|
|
8
|
+
# bmmoseokfxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
9
9
|
|
|
10
10
|
A test skill
|
|
11
11
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
|
-
name:
|
|
2
|
+
name: bmmosewq3xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
3
3
|
description: A test skill
|
|
4
4
|
invocation: undefined
|
|
5
5
|
context: undefined
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
#
|
|
8
|
+
# bmmosewq3xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
9
9
|
|
|
10
10
|
A test skill
|
|
11
11
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
|
-
name:
|
|
2
|
+
name: bmmosf3hvxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
3
3
|
description: A test skill
|
|
4
4
|
invocation: undefined
|
|
5
5
|
context: undefined
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
#
|
|
8
|
+
# bmmosf3hvxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
9
9
|
|
|
10
10
|
A test skill
|
|
11
11
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
|
-
name:
|
|
2
|
+
name: bmmosfe4bxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
3
3
|
description: A test skill
|
|
4
4
|
invocation: undefined
|
|
5
5
|
context: undefined
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
#
|
|
8
|
+
# bmmosfe4bxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
9
9
|
|
|
10
10
|
A test skill
|
|
11
11
|
|
package/.claude/skills/bmmous2g0xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/SKILL.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bmmous2g0xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
3
|
+
description: A test skill
|
|
4
|
+
invocation: undefined
|
|
5
|
+
context: undefined
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# bmmous2g0xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
9
|
+
|
|
10
|
+
A test skill
|
|
11
|
+
|
|
12
|
+
## Instructions
|
|
13
|
+
|
|
14
|
+
<!-- Replace this with your skill instructions.
|
|
15
|
+
Good skill instructions:
|
|
16
|
+
1. Define the agent's role clearly
|
|
17
|
+
2. Specify the exact output format
|
|
18
|
+
3. List what to check/do step by step
|
|
19
|
+
4. Include examples of good output
|
|
20
|
+
-->
|
|
21
|
+
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: bnd-
|
|
2
|
+
name: bnd-mmoseokj
|
|
3
3
|
description: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
|
4
4
|
invocation: undefined
|
|
5
5
|
context: undefined
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
# bnd-
|
|
8
|
+
# bnd-mmoseokj
|
|
9
9
|
|
|
10
10
|
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
|
11
11
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: bnd-
|
|
2
|
+
name: bnd-mmosewq9
|
|
3
3
|
description: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
|
4
4
|
invocation: undefined
|
|
5
5
|
context: undefined
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
# bnd-
|
|
8
|
+
# bnd-mmosewq9
|
|
9
9
|
|
|
10
10
|
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
|
11
11
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: bnd-
|
|
2
|
+
name: bnd-mmosf3i0
|
|
3
3
|
description: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
|
4
4
|
invocation: undefined
|
|
5
5
|
context: undefined
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
# bnd-
|
|
8
|
+
# bnd-mmosf3i0
|
|
9
9
|
|
|
10
10
|
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
|
11
11
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: bnd-
|
|
2
|
+
name: bnd-mmosfe4f
|
|
3
3
|
description: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
|
4
4
|
invocation: undefined
|
|
5
5
|
context: undefined
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
# bnd-
|
|
8
|
+
# bnd-mmosfe4f
|
|
9
9
|
|
|
10
10
|
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
|
11
11
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bnd-mmous2g4
|
|
3
|
+
description: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
|
4
|
+
invocation: undefined
|
|
5
|
+
context: undefined
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# bnd-mmous2g4
|
|
9
|
+
|
|
10
|
+
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
|
11
|
+
|
|
12
|
+
## Instructions
|
|
13
|
+
|
|
14
|
+
<!-- Replace this with your skill instructions.
|
|
15
|
+
Good skill instructions:
|
|
16
|
+
1. Define the agent's role clearly
|
|
17
|
+
2. Specify the exact output format
|
|
18
|
+
3. List what to check/do step by step
|
|
19
|
+
4. Include examples of good output
|
|
20
|
+
-->
|
|
21
|
+
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: nl-mmous2gc
|
|
3
|
+
description: Line one
|
|
4
|
+
Line two
|
|
5
|
+
Line three
|
|
6
|
+
invocation: undefined
|
|
7
|
+
context: undefined
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# nl-mmous2gc
|
|
11
|
+
|
|
12
|
+
Line one
|
|
13
|
+
Line two
|
|
14
|
+
Line three
|
|
15
|
+
|
|
16
|
+
## Instructions
|
|
17
|
+
|
|
18
|
+
<!-- Replace this with your skill instructions.
|
|
19
|
+
Good skill instructions:
|
|
20
|
+
1. Define the agent's role clearly
|
|
21
|
+
2. Specify the exact output format
|
|
22
|
+
3. List what to check/do step by step
|
|
23
|
+
4. Include examples of good output
|
|
24
|
+
-->
|
|
25
|
+
|
|
@@ -5,65 +5,46 @@ invocation: undefined
|
|
|
5
5
|
context: undefined
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
| Valid input, expected output | Normal successful operation | ALWAYS |
|
|
52
|
-
| Missing required field | Omit a required parameter | ALWAYS |
|
|
53
|
-
| Invalid type | Pass string where number expected | ALWAYS |
|
|
54
|
-
| Empty input | Empty string, empty array, null | ALWAYS |
|
|
55
|
-
| Boundary values | 0, -1, MAX_INT, very long string | WHEN APPLICABLE |
|
|
56
|
-
| Duplicate/conflict | Creating something that already exists | WHEN APPLICABLE |
|
|
57
|
-
| Not found | Requesting something that does not exist | WHEN APPLICABLE |
|
|
58
|
-
| Unauthorized | Accessing without proper permissions | WHEN AUTH EXISTS |
|
|
59
|
-
| Concurrent access | Two operations on same resource | WHEN APPLICABLE |
|
|
60
|
-
| Error recovery | Service dependency fails | WHEN EXTERNAL DEPS EXIST |
|
|
61
|
-
|
|
62
|
-
### Rules
|
|
63
|
-
- Test file names MUST match source file: `user.service.ts` → `user.service.test.ts`
|
|
64
|
-
- NEVER test implementation details — test behavior and outcomes
|
|
65
|
-
- NEVER use `test("should work")` — test names must describe the specific scenario and expected outcome
|
|
66
|
-
- EVERY test must be independent — no test should depend on another test running first
|
|
67
|
-
- ALWAYS clean up test data (use beforeEach/afterEach or setup/teardown)
|
|
68
|
-
- Mock external dependencies (databases, APIs, file system) — do not make real network calls in unit tests
|
|
69
|
-
- NEVER write a test that always passes — verify your test fails before the implementation exists
|
|
8
|
+
# Test Writer
|
|
9
|
+
|
|
10
|
+
You write tests that catch real bugs, not tests that just check if the code runs.
|
|
11
|
+
|
|
12
|
+
## Before Writing
|
|
13
|
+
|
|
14
|
+
1. **Read existing tests** — find 2-3 test files to understand:
|
|
15
|
+
- Which testing framework (Jest, Vitest, pytest, JUnit, etc.)
|
|
16
|
+
- Test file naming convention (`.test.ts`, `.spec.ts`, `_test.go`, etc.)
|
|
17
|
+
- Test location (colocated vs. `__tests__/` vs. `test/`)
|
|
18
|
+
- Mocking patterns used (jest.mock, vi.mock, unittest.mock, etc.)
|
|
19
|
+
- Setup/teardown patterns (beforeEach, fixtures, etc.)
|
|
20
|
+
|
|
21
|
+
2. **Read the code under test** — understand:
|
|
22
|
+
- All public functions and their signatures
|
|
23
|
+
- Edge cases: What happens with null/undefined/empty/zero/negative inputs?
|
|
24
|
+
- Error paths: What exceptions can be thrown?
|
|
25
|
+
- Side effects: Database calls, API calls, file system operations
|
|
26
|
+
|
|
27
|
+
## Test Writing Rules
|
|
28
|
+
|
|
29
|
+
### Coverage Strategy
|
|
30
|
+
- **Happy path**: Normal inputs produce expected outputs
|
|
31
|
+
- **Edge cases**: Empty strings, empty arrays, zero, negative numbers, max values
|
|
32
|
+
- **Error cases**: Invalid inputs, network failures, permission errors
|
|
33
|
+
- **Boundary conditions**: First item, last item, exactly at limits
|
|
34
|
+
|
|
35
|
+
### Quality Standards
|
|
36
|
+
- Each test has a descriptive name: `"returns empty array when user has no orders"`
|
|
37
|
+
- One assertion per concept (not one assertion per test)
|
|
38
|
+
- Tests are independent — no test relies on another test's side effects
|
|
39
|
+
- Mock external dependencies (APIs, databases) — never make real calls
|
|
40
|
+
- Use factories/fixtures for complex test data
|
|
41
|
+
|
|
42
|
+
### Anti-Patterns to Avoid
|
|
43
|
+
- Testing implementation details (internal method calls, private state)
|
|
44
|
+
- Snapshot tests for logic (only use for UI rendering)
|
|
45
|
+
- Tests that pass when the code is broken
|
|
46
|
+
- Copy-pasting the implementation as the expected value
|
|
47
|
+
|
|
48
|
+
## Output
|
|
49
|
+
Place test files where the project convention expects them.
|
|
50
|
+
Run the tests after writing to verify they pass.
|
|
@@ -5,65 +5,46 @@ invocation: undefined
|
|
|
5
5
|
context: undefined
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
| Valid input, expected output | Normal successful operation | ALWAYS |
|
|
52
|
-
| Missing required field | Omit a required parameter | ALWAYS |
|
|
53
|
-
| Invalid type | Pass string where number expected | ALWAYS |
|
|
54
|
-
| Empty input | Empty string, empty array, null | ALWAYS |
|
|
55
|
-
| Boundary values | 0, -1, MAX_INT, very long string | WHEN APPLICABLE |
|
|
56
|
-
| Duplicate/conflict | Creating something that already exists | WHEN APPLICABLE |
|
|
57
|
-
| Not found | Requesting something that does not exist | WHEN APPLICABLE |
|
|
58
|
-
| Unauthorized | Accessing without proper permissions | WHEN AUTH EXISTS |
|
|
59
|
-
| Concurrent access | Two operations on same resource | WHEN APPLICABLE |
|
|
60
|
-
| Error recovery | Service dependency fails | WHEN EXTERNAL DEPS EXIST |
|
|
61
|
-
|
|
62
|
-
### Rules
|
|
63
|
-
- Test file names MUST match source file: `user.service.ts` → `user.service.test.ts`
|
|
64
|
-
- NEVER test implementation details — test behavior and outcomes
|
|
65
|
-
- NEVER use `test("should work")` — test names must describe the specific scenario and expected outcome
|
|
66
|
-
- EVERY test must be independent — no test should depend on another test running first
|
|
67
|
-
- ALWAYS clean up test data (use beforeEach/afterEach or setup/teardown)
|
|
68
|
-
- Mock external dependencies (databases, APIs, file system) — do not make real network calls in unit tests
|
|
69
|
-
- NEVER write a test that always passes — verify your test fails before the implementation exists
|
|
8
|
+
# Test Writer
|
|
9
|
+
|
|
10
|
+
You write tests that catch real bugs, not tests that just check if the code runs.
|
|
11
|
+
|
|
12
|
+
## Before Writing
|
|
13
|
+
|
|
14
|
+
1. **Read existing tests** — find 2-3 test files to understand:
|
|
15
|
+
- Which testing framework (Jest, Vitest, pytest, JUnit, etc.)
|
|
16
|
+
- Test file naming convention (`.test.ts`, `.spec.ts`, `_test.go`, etc.)
|
|
17
|
+
- Test location (colocated vs. `__tests__/` vs. `test/`)
|
|
18
|
+
- Mocking patterns used (jest.mock, vi.mock, unittest.mock, etc.)
|
|
19
|
+
- Setup/teardown patterns (beforeEach, fixtures, etc.)
|
|
20
|
+
|
|
21
|
+
2. **Read the code under test** — understand:
|
|
22
|
+
- All public functions and their signatures
|
|
23
|
+
- Edge cases: What happens with null/undefined/empty/zero/negative inputs?
|
|
24
|
+
- Error paths: What exceptions can be thrown?
|
|
25
|
+
- Side effects: Database calls, API calls, file system operations
|
|
26
|
+
|
|
27
|
+
## Test Writing Rules
|
|
28
|
+
|
|
29
|
+
### Coverage Strategy
|
|
30
|
+
- **Happy path**: Normal inputs produce expected outputs
|
|
31
|
+
- **Edge cases**: Empty strings, empty arrays, zero, negative numbers, max values
|
|
32
|
+
- **Error cases**: Invalid inputs, network failures, permission errors
|
|
33
|
+
- **Boundary conditions**: First item, last item, exactly at limits
|
|
34
|
+
|
|
35
|
+
### Quality Standards
|
|
36
|
+
- Each test has a descriptive name: `"returns empty array when user has no orders"`
|
|
37
|
+
- One assertion per concept (not one assertion per test)
|
|
38
|
+
- Tests are independent — no test relies on another test's side effects
|
|
39
|
+
- Mock external dependencies (APIs, databases) — never make real calls
|
|
40
|
+
- Use factories/fixtures for complex test data
|
|
41
|
+
|
|
42
|
+
### Anti-Patterns to Avoid
|
|
43
|
+
- Testing implementation details (internal method calls, private state)
|
|
44
|
+
- Snapshot tests for logic (only use for UI rendering)
|
|
45
|
+
- Tests that pass when the code is broken
|
|
46
|
+
- Copy-pasting the implementation as the expected value
|
|
47
|
+
|
|
48
|
+
## Output
|
|
49
|
+
Place test files where the project convention expects them.
|
|
50
|
+
Run the tests after writing to verify they pass.
|
|
@@ -5,65 +5,46 @@ invocation: undefined
|
|
|
5
5
|
context: undefined
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
| Valid input, expected output | Normal successful operation | ALWAYS |
|
|
52
|
-
| Missing required field | Omit a required parameter | ALWAYS |
|
|
53
|
-
| Invalid type | Pass string where number expected | ALWAYS |
|
|
54
|
-
| Empty input | Empty string, empty array, null | ALWAYS |
|
|
55
|
-
| Boundary values | 0, -1, MAX_INT, very long string | WHEN APPLICABLE |
|
|
56
|
-
| Duplicate/conflict | Creating something that already exists | WHEN APPLICABLE |
|
|
57
|
-
| Not found | Requesting something that does not exist | WHEN APPLICABLE |
|
|
58
|
-
| Unauthorized | Accessing without proper permissions | WHEN AUTH EXISTS |
|
|
59
|
-
| Concurrent access | Two operations on same resource | WHEN APPLICABLE |
|
|
60
|
-
| Error recovery | Service dependency fails | WHEN EXTERNAL DEPS EXIST |
|
|
61
|
-
|
|
62
|
-
### Rules
|
|
63
|
-
- Test file names MUST match source file: `user.service.ts` → `user.service.test.ts`
|
|
64
|
-
- NEVER test implementation details — test behavior and outcomes
|
|
65
|
-
- NEVER use `test("should work")` — test names must describe the specific scenario and expected outcome
|
|
66
|
-
- EVERY test must be independent — no test should depend on another test running first
|
|
67
|
-
- ALWAYS clean up test data (use beforeEach/afterEach or setup/teardown)
|
|
68
|
-
- Mock external dependencies (databases, APIs, file system) — do not make real network calls in unit tests
|
|
69
|
-
- NEVER write a test that always passes — verify your test fails before the implementation exists
|
|
8
|
+
# Test Writer
|
|
9
|
+
|
|
10
|
+
You write tests that catch real bugs, not tests that just check if the code runs.
|
|
11
|
+
|
|
12
|
+
## Before Writing
|
|
13
|
+
|
|
14
|
+
1. **Read existing tests** — find 2-3 test files to understand:
|
|
15
|
+
- Which testing framework (Jest, Vitest, pytest, JUnit, etc.)
|
|
16
|
+
- Test file naming convention (`.test.ts`, `.spec.ts`, `_test.go`, etc.)
|
|
17
|
+
- Test location (colocated vs. `__tests__/` vs. `test/`)
|
|
18
|
+
- Mocking patterns used (jest.mock, vi.mock, unittest.mock, etc.)
|
|
19
|
+
- Setup/teardown patterns (beforeEach, fixtures, etc.)
|
|
20
|
+
|
|
21
|
+
2. **Read the code under test** — understand:
|
|
22
|
+
- All public functions and their signatures
|
|
23
|
+
- Edge cases: What happens with null/undefined/empty/zero/negative inputs?
|
|
24
|
+
- Error paths: What exceptions can be thrown?
|
|
25
|
+
- Side effects: Database calls, API calls, file system operations
|
|
26
|
+
|
|
27
|
+
## Test Writing Rules
|
|
28
|
+
|
|
29
|
+
### Coverage Strategy
|
|
30
|
+
- **Happy path**: Normal inputs produce expected outputs
|
|
31
|
+
- **Edge cases**: Empty strings, empty arrays, zero, negative numbers, max values
|
|
32
|
+
- **Error cases**: Invalid inputs, network failures, permission errors
|
|
33
|
+
- **Boundary conditions**: First item, last item, exactly at limits
|
|
34
|
+
|
|
35
|
+
### Quality Standards
|
|
36
|
+
- Each test has a descriptive name: `"returns empty array when user has no orders"`
|
|
37
|
+
- One assertion per concept (not one assertion per test)
|
|
38
|
+
- Tests are independent — no test relies on another test's side effects
|
|
39
|
+
- Mock external dependencies (APIs, databases) — never make real calls
|
|
40
|
+
- Use factories/fixtures for complex test data
|
|
41
|
+
|
|
42
|
+
### Anti-Patterns to Avoid
|
|
43
|
+
- Testing implementation details (internal method calls, private state)
|
|
44
|
+
- Snapshot tests for logic (only use for UI rendering)
|
|
45
|
+
- Tests that pass when the code is broken
|
|
46
|
+
- Copy-pasting the implementation as the expected value
|
|
47
|
+
|
|
48
|
+
## Output
|
|
49
|
+
Place test files where the project convention expects them.
|
|
50
|
+
Run the tests after writing to verify they pass.
|