rebar-mcp 2.0.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/agents/template-writer.md +43 -0
- package/.claude/agents/test-runner.md +47 -0
- package/.claude/mcp.json +9 -0
- package/.claude/settings.json +29 -0
- package/.claude/skills/ /SKILL.md +21 -0
- package/.claude/skills/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SKILL.md +21 -0
- package/.claude/skills/bmmibwetxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/SKILL.md +21 -0
- package/.claude/skills/bmmibwjgvxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/SKILL.md +21 -0
- package/.claude/skills/bmmibwsesxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/SKILL.md +21 -0
- package/.claude/skills/bmmibwxufxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/SKILL.md +21 -0
- package/.claude/skills/bmmibx3r9xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/SKILL.md +21 -0
- package/.claude/skills/bmmji0lrkxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/SKILL.md +21 -0
- package/.claude/skills/bmmjiniphxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/SKILL.md +21 -0
- package/.claude/skills/bmmjio86zxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/SKILL.md +21 -0
- package/.claude/skills/bmmjiolfbxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/SKILL.md +21 -0
- package/.claude/skills/bmmjit1lvxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/SKILL.md +21 -0
- package/.claude/skills/bmmjita1qxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/SKILL.md +21 -0
- package/.claude/skills/bnd-mmibweu3/SKILL.md +21 -0
- package/.claude/skills/bnd-mmibwjh4/SKILL.md +21 -0
- package/.claude/skills/bnd-mmibwsey/SKILL.md +21 -0
- package/.claude/skills/bnd-mmibwxup/SKILL.md +21 -0
- package/.claude/skills/bnd-mmibx3rg/SKILL.md +21 -0
- package/.claude/skills/bnd-mmji0lrp/SKILL.md +21 -0
- package/.claude/skills/bnd-mmjinipm/SKILL.md +21 -0
- package/.claude/skills/bnd-mmjio875/SKILL.md +21 -0
- package/.claude/skills/bnd-mmjiolfg/SKILL.md +21 -0
- package/.claude/skills/bnd-mmjit1m3/SKILL.md +21 -0
- package/.claude/skills/bnd-mmjita1x/SKILL.md +21 -0
- package/.claude/skills/coercion-test/SKILL.md +50 -0
- package/.claude/skills/large-skill/SKILL.md +21 -0
- package/.claude/skills/long-desc-skill/SKILL.md +21 -0
- package/.claude/skills/mcp-dev/SKILL.md +61 -0
- package/.claude/skills/nl-mmibweus/SKILL.md +25 -0
- package/.claude/skills/nl-mmibwjhf/SKILL.md +25 -0
- package/.claude/skills/nl-mmibwsf7/SKILL.md +25 -0
- package/.claude/skills/nl-mmibwxvq/SKILL.md +25 -0
- package/.claude/skills/nl-mmibx3rt/SKILL.md +25 -0
- package/.claude/skills/nl-mmji0lrz/SKILL.md +25 -0
- package/.claude/skills/nl-mmjinipx/SKILL.md +25 -0
- package/.claude/skills/nl-mmjio87f/SKILL.md +25 -0
- package/.claude/skills/nl-mmjiolfs/SKILL.md +25 -0
- package/.claude/skills/nl-mmjit1mc/SKILL.md +25 -0
- package/.claude/skills/nl-mmjita26/SKILL.md +25 -0
- package/.claude/skills/rapid-1/SKILL.md +21 -0
- package/.claude/skills/rapid-2/SKILL.md +21 -0
- package/.claude/skills/rapid-3/SKILL.md +21 -0
- package/.claude/skills/rapid-4/SKILL.md +21 -0
- package/.claude/skills/rapid-5/SKILL.md +21 -0
- package/.claude/skills/test/", /"malicious/": /"true/SKILL.md" +69 -0
- package/.claude/skills/test-emoji-/360/237/230/200-skill/SKILL.md +69 -0
- package/.claude/skills/test-skill/SKILL.md +69 -0
- package/.claude/skills/test; rm -rf /; skill/SKILL.md +69 -0
- package/.claude/skills/test<script>alert(1)</script>skill/SKILL.md +69 -0
- package/.claudeignore +5 -0
- package/.mcp.json +3 -0
- package/CHANGELOG.md +29 -0
- package/CLAUDE.md +76 -0
- package/LICENSE +21 -0
- package/README.md +149 -0
- package/ROADMAP.md +526 -0
- package/ccboot-PRD-v1.0.docx.md +732 -0
- package/ccboot-v1.2.0-enforcement-spec.md +1272 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +674 -0
- package/dist/cli.js.map +1 -0
- package/dist/constants.d.ts +25 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +118 -0
- package/dist/constants.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +47 -0
- package/dist/index.js.map +1 -0
- package/dist/schemas/common.d.ts +62 -0
- package/dist/schemas/common.d.ts.map +1 -0
- package/dist/schemas/common.js +15 -0
- package/dist/schemas/common.js.map +1 -0
- package/dist/schemas/scaffolding.d.ts +277 -0
- package/dist/schemas/scaffolding.d.ts.map +1 -0
- package/dist/schemas/scaffolding.js +133 -0
- package/dist/schemas/scaffolding.js.map +1 -0
- package/dist/services/claudemd-generator.d.ts +16 -0
- package/dist/services/claudemd-generator.d.ts.map +1 -0
- package/dist/services/claudemd-generator.js +426 -0
- package/dist/services/claudemd-generator.js.map +1 -0
- package/dist/services/codex-generator.d.ts +6 -0
- package/dist/services/codex-generator.d.ts.map +1 -0
- package/dist/services/codex-generator.js +35 -0
- package/dist/services/codex-generator.js.map +1 -0
- package/dist/services/cursor-generator.d.ts +15 -0
- package/dist/services/cursor-generator.d.ts.map +1 -0
- package/dist/services/cursor-generator.js +134 -0
- package/dist/services/cursor-generator.js.map +1 -0
- package/dist/services/file-ops.d.ts +48 -0
- package/dist/services/file-ops.d.ts.map +1 -0
- package/dist/services/file-ops.js +153 -0
- package/dist/services/file-ops.js.map +1 -0
- package/dist/services/output-formatter.d.ts +57 -0
- package/dist/services/output-formatter.d.ts.map +1 -0
- package/dist/services/output-formatter.js +88 -0
- package/dist/services/output-formatter.js.map +1 -0
- package/dist/services/platform-detect.d.ts +14 -0
- package/dist/services/platform-detect.d.ts.map +1 -0
- package/dist/services/platform-detect.js +63 -0
- package/dist/services/platform-detect.js.map +1 -0
- package/dist/services/project-analyzer.d.ts +71 -0
- package/dist/services/project-analyzer.d.ts.map +1 -0
- package/dist/services/project-analyzer.js +595 -0
- package/dist/services/project-analyzer.js.map +1 -0
- package/dist/services/rules-engine.d.ts +41 -0
- package/dist/services/rules-engine.d.ts.map +1 -0
- package/dist/services/rules-engine.js +304 -0
- package/dist/services/rules-engine.js.map +1 -0
- package/dist/services/strictness.d.ts +37 -0
- package/dist/services/strictness.d.ts.map +1 -0
- package/dist/services/strictness.js +182 -0
- package/dist/services/strictness.js.map +1 -0
- package/dist/services/template-engine.d.ts +16 -0
- package/dist/services/template-engine.d.ts.map +1 -0
- package/dist/services/template-engine.js +85 -0
- package/dist/services/template-engine.js.map +1 -0
- package/dist/services/validation.d.ts +41 -0
- package/dist/services/validation.d.ts.map +1 -0
- package/dist/services/validation.js +104 -0
- package/dist/services/validation.js.map +1 -0
- package/dist/services/windsurf-generator.d.ts +15 -0
- package/dist/services/windsurf-generator.d.ts.map +1 -0
- package/dist/services/windsurf-generator.js +127 -0
- package/dist/services/windsurf-generator.js.map +1 -0
- package/dist/tests/enforcement.test.d.ts +2 -0
- package/dist/tests/enforcement.test.d.ts.map +1 -0
- package/dist/tests/enforcement.test.js +541 -0
- package/dist/tests/enforcement.test.js.map +1 -0
- package/dist/tests/enterprise.test.d.ts +2 -0
- package/dist/tests/enterprise.test.d.ts.map +1 -0
- package/dist/tests/enterprise.test.js +353 -0
- package/dist/tests/enterprise.test.js.map +1 -0
- package/dist/tests/fuzzing.test.d.ts +2 -0
- package/dist/tests/fuzzing.test.d.ts.map +1 -0
- package/dist/tests/fuzzing.test.js +596 -0
- package/dist/tests/fuzzing.test.js.map +1 -0
- package/dist/tests/knowledge.test.d.ts +2 -0
- package/dist/tests/knowledge.test.d.ts.map +1 -0
- package/dist/tests/knowledge.test.js +292 -0
- package/dist/tests/knowledge.test.js.map +1 -0
- package/dist/tests/management.test.d.ts +2 -0
- package/dist/tests/management.test.d.ts.map +1 -0
- package/dist/tests/management.test.js +338 -0
- package/dist/tests/management.test.js.map +1 -0
- package/dist/tests/scaffolding.test.d.ts +2 -0
- package/dist/tests/scaffolding.test.d.ts.map +1 -0
- package/dist/tests/scaffolding.test.js +419 -0
- package/dist/tests/scaffolding.test.js.map +1 -0
- package/dist/tests/test-utils.d.ts +76 -0
- package/dist/tests/test-utils.d.ts.map +1 -0
- package/dist/tests/test-utils.js +171 -0
- package/dist/tests/test-utils.js.map +1 -0
- package/dist/tests/tool-harness.d.ts +18 -0
- package/dist/tests/tool-harness.d.ts.map +1 -0
- package/dist/tests/tool-harness.js +51 -0
- package/dist/tests/tool-harness.js.map +1 -0
- package/dist/tools/enterprise.d.ts +8 -0
- package/dist/tools/enterprise.d.ts.map +1 -0
- package/dist/tools/enterprise.js +571 -0
- package/dist/tools/enterprise.js.map +1 -0
- package/dist/tools/knowledge.d.ts +7 -0
- package/dist/tools/knowledge.d.ts.map +1 -0
- package/dist/tools/knowledge.js +120 -0
- package/dist/tools/knowledge.js.map +1 -0
- package/dist/tools/management.d.ts +10 -0
- package/dist/tools/management.d.ts.map +1 -0
- package/dist/tools/management.js +1541 -0
- package/dist/tools/management.js.map +1 -0
- package/dist/tools/scaffolding.d.ts +8 -0
- package/dist/tools/scaffolding.d.ts.map +1 -0
- package/dist/tools/scaffolding.js +736 -0
- package/dist/tools/scaffolding.js.map +1 -0
- package/dist/types.d.ts +54 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/landing/app/layout.tsx +30 -0
- package/landing/app/page.tsx +944 -0
- package/landing/next-env.d.ts +6 -0
- package/landing/next.config.js +6 -0
- package/landing/package-lock.json +896 -0
- package/landing/package.json +20 -0
- package/landing/tsconfig.json +40 -0
- package/package.json +49 -0
- package/rebar-v2.0.0-platform-spec.md +1567 -0
- package/server.json +20 -0
- package/src/cli.ts +735 -0
- package/src/constants.ts +131 -0
- package/src/index.ts +54 -0
- package/src/schemas/common.ts +22 -0
- package/src/schemas/scaffolding.ts +161 -0
- package/src/services/claudemd-generator.ts +481 -0
- package/src/services/codex-generator.ts +44 -0
- package/src/services/cursor-generator.ts +153 -0
- package/src/services/file-ops.ts +172 -0
- package/src/services/platform-detect.ts +80 -0
- package/src/services/project-analyzer.ts +690 -0
- package/src/services/rules-engine.ts +353 -0
- package/src/services/strictness.ts +202 -0
- package/src/services/template-engine.ts +119 -0
- package/src/services/validation.ts +138 -0
- package/src/services/windsurf-generator.ts +145 -0
- package/src/tests/enforcement.test.ts +794 -0
- package/src/tests/enterprise.test.ts +483 -0
- package/src/tests/fuzzing.test.ts +690 -0
- package/src/tests/knowledge.test.ts +371 -0
- package/src/tests/management.test.ts +451 -0
- package/src/tests/scaffolding.test.ts +575 -0
- package/src/tests/test-utils.ts +206 -0
- package/src/tests/tool-harness.ts +70 -0
- package/src/tools/enterprise.ts +666 -0
- package/src/tools/knowledge.ts +162 -0
- package/src/tools/management.ts +1706 -0
- package/src/tools/scaffolding.ts +909 -0
- package/src/types.ts +93 -0
- package/supabase/.temp/cli-latest +1 -0
- package/supabase/.temp/gotrue-version +1 -0
- package/supabase/.temp/pooler-url +1 -0
- package/supabase/.temp/postgres-version +1 -0
- package/supabase/.temp/project-ref +1 -0
- package/supabase/.temp/rest-version +1 -0
- package/supabase/.temp/storage-migration +1 -0
- package/supabase/.temp/storage-version +1 -0
- package/templates/agents/explore.md +41 -0
- package/templates/agents/plan.md +73 -0
- package/templates/agents/security-auditor.md +77 -0
- package/templates/agents/test-runner.md +60 -0
- package/templates/claudemd/fastapi.md +49 -0
- package/templates/claudemd/monorepo.md +48 -0
- package/templates/claudemd/nextjs.md +52 -0
- package/templates/claudemd/react-spa.md +50 -0
- package/templates/claudemd/springboot.md +50 -0
- package/templates/hooks/danger-blocker.json +11 -0
- package/templates/hooks/format-on-write.json +17 -0
- package/templates/hooks/lint-on-write.json +16 -0
- package/templates/hooks/secret-detector.json +11 -0
- package/templates/skills/code-review.md +68 -0
- package/templates/skills/documentation.md +62 -0
- package/templates/skills/performance-audit.md +80 -0
- package/templates/skills/security-scan.md +66 -0
- package/templates/skills/test-writer.md +56 -0
- package/tsconfig.json +19 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: test-skill
|
|
3
|
+
description: A test skill
|
|
4
|
+
invocation: undefined
|
|
5
|
+
context: undefined
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Test Writing Process
|
|
9
|
+
|
|
10
|
+
### Step 1: Analyze What Needs Testing
|
|
11
|
+
- Read the function/module signature, parameters, and return type
|
|
12
|
+
- Identify the happy path (normal successful execution)
|
|
13
|
+
- Identify error paths (what can go wrong?)
|
|
14
|
+
- Identify edge cases (empty input, null, boundary values, max values)
|
|
15
|
+
- Identify integration points (database calls, API calls, file system)
|
|
16
|
+
|
|
17
|
+
### Step 2: Write Tests in This Order
|
|
18
|
+
|
|
19
|
+
1. **Happy path test** — The most basic successful case
|
|
20
|
+
2. **Input validation tests** — Invalid inputs, missing required fields, wrong types
|
|
21
|
+
3. **Edge case tests** — Empty arrays, zero values, very long strings, special characters
|
|
22
|
+
4. **Error handling tests** — Network failures, database errors, file not found
|
|
23
|
+
5. **Integration tests** — Full request/response cycle (if applicable)
|
|
24
|
+
|
|
25
|
+
### Step 3: Test Structure
|
|
26
|
+
|
|
27
|
+
Every test MUST follow this structure:
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
// Descriptive name that explains what is being tested and expected outcome
|
|
31
|
+
test("createUser returns the created user with a generated ID when given valid input", async () => {
|
|
32
|
+
// ARRANGE: Set up test data and dependencies
|
|
33
|
+
const input = { name: "Test User", email: "test@example.com" };
|
|
34
|
+
|
|
35
|
+
// ACT: Execute the function under test
|
|
36
|
+
const result = await createUser(input);
|
|
37
|
+
|
|
38
|
+
// ASSERT: Verify the outcome
|
|
39
|
+
expect(result.id).toBeDefined();
|
|
40
|
+
expect(result.name).toBe("Test User");
|
|
41
|
+
expect(result.email).toBe("test@example.com");
|
|
42
|
+
});
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Mandatory Test Categories
|
|
46
|
+
|
|
47
|
+
For EVERY function, write tests covering:
|
|
48
|
+
|
|
49
|
+
| Category | Example | Required? |
|
|
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
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: test; rm -rf /; skill
|
|
3
|
+
description: A test skill
|
|
4
|
+
invocation: undefined
|
|
5
|
+
context: undefined
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Test Writing Process
|
|
9
|
+
|
|
10
|
+
### Step 1: Analyze What Needs Testing
|
|
11
|
+
- Read the function/module signature, parameters, and return type
|
|
12
|
+
- Identify the happy path (normal successful execution)
|
|
13
|
+
- Identify error paths (what can go wrong?)
|
|
14
|
+
- Identify edge cases (empty input, null, boundary values, max values)
|
|
15
|
+
- Identify integration points (database calls, API calls, file system)
|
|
16
|
+
|
|
17
|
+
### Step 2: Write Tests in This Order
|
|
18
|
+
|
|
19
|
+
1. **Happy path test** — The most basic successful case
|
|
20
|
+
2. **Input validation tests** — Invalid inputs, missing required fields, wrong types
|
|
21
|
+
3. **Edge case tests** — Empty arrays, zero values, very long strings, special characters
|
|
22
|
+
4. **Error handling tests** — Network failures, database errors, file not found
|
|
23
|
+
5. **Integration tests** — Full request/response cycle (if applicable)
|
|
24
|
+
|
|
25
|
+
### Step 3: Test Structure
|
|
26
|
+
|
|
27
|
+
Every test MUST follow this structure:
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
// Descriptive name that explains what is being tested and expected outcome
|
|
31
|
+
test("createUser returns the created user with a generated ID when given valid input", async () => {
|
|
32
|
+
// ARRANGE: Set up test data and dependencies
|
|
33
|
+
const input = { name: "Test User", email: "test@example.com" };
|
|
34
|
+
|
|
35
|
+
// ACT: Execute the function under test
|
|
36
|
+
const result = await createUser(input);
|
|
37
|
+
|
|
38
|
+
// ASSERT: Verify the outcome
|
|
39
|
+
expect(result.id).toBeDefined();
|
|
40
|
+
expect(result.name).toBe("Test User");
|
|
41
|
+
expect(result.email).toBe("test@example.com");
|
|
42
|
+
});
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Mandatory Test Categories
|
|
46
|
+
|
|
47
|
+
For EVERY function, write tests covering:
|
|
48
|
+
|
|
49
|
+
| Category | Example | Required? |
|
|
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
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: test<script>alert(1)</script>skill
|
|
3
|
+
description: A test skill
|
|
4
|
+
invocation: undefined
|
|
5
|
+
context: undefined
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Test Writing Process
|
|
9
|
+
|
|
10
|
+
### Step 1: Analyze What Needs Testing
|
|
11
|
+
- Read the function/module signature, parameters, and return type
|
|
12
|
+
- Identify the happy path (normal successful execution)
|
|
13
|
+
- Identify error paths (what can go wrong?)
|
|
14
|
+
- Identify edge cases (empty input, null, boundary values, max values)
|
|
15
|
+
- Identify integration points (database calls, API calls, file system)
|
|
16
|
+
|
|
17
|
+
### Step 2: Write Tests in This Order
|
|
18
|
+
|
|
19
|
+
1. **Happy path test** — The most basic successful case
|
|
20
|
+
2. **Input validation tests** — Invalid inputs, missing required fields, wrong types
|
|
21
|
+
3. **Edge case tests** — Empty arrays, zero values, very long strings, special characters
|
|
22
|
+
4. **Error handling tests** — Network failures, database errors, file not found
|
|
23
|
+
5. **Integration tests** — Full request/response cycle (if applicable)
|
|
24
|
+
|
|
25
|
+
### Step 3: Test Structure
|
|
26
|
+
|
|
27
|
+
Every test MUST follow this structure:
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
// Descriptive name that explains what is being tested and expected outcome
|
|
31
|
+
test("createUser returns the created user with a generated ID when given valid input", async () => {
|
|
32
|
+
// ARRANGE: Set up test data and dependencies
|
|
33
|
+
const input = { name: "Test User", email: "test@example.com" };
|
|
34
|
+
|
|
35
|
+
// ACT: Execute the function under test
|
|
36
|
+
const result = await createUser(input);
|
|
37
|
+
|
|
38
|
+
// ASSERT: Verify the outcome
|
|
39
|
+
expect(result.id).toBeDefined();
|
|
40
|
+
expect(result.name).toBe("Test User");
|
|
41
|
+
expect(result.email).toBe("test@example.com");
|
|
42
|
+
});
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Mandatory Test Categories
|
|
46
|
+
|
|
47
|
+
For EVERY function, write tests covering:
|
|
48
|
+
|
|
49
|
+
| Category | Example | Required? |
|
|
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
|
package/.claudeignore
ADDED
package/.mcp.json
ADDED
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## [2.0.0] - 2026-03-09
|
|
6
|
+
|
|
7
|
+
### Breaking Changes
|
|
8
|
+
- Renamed from `ccboot-mcp-server` to `rebar-mcp`
|
|
9
|
+
- All tool names changed from `ccboot_*` to `rebar_*`
|
|
10
|
+
- Package name changed to `rebar-mcp`
|
|
11
|
+
- Binary name changed to `rebar`
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
- **Multi-platform support:** Generates configurations for Claude Code, Cursor, Windsurf, and Codex CLI
|
|
15
|
+
- **Strictness profiles:** Standard (notify), Strict (block on test/lint failures), Paranoid (block on any types, file size, TODOs)
|
|
16
|
+
- **`rebar doctor`:** 10-point health check for enforcement setup
|
|
17
|
+
- **Standalone CLI:** `rebar init`, `rebar audit`, `rebar doctor`, `rebar metrics`, `rebar badge` commands
|
|
18
|
+
- **CI/CD integration:** `rebar audit --threshold` exits with code 1 for pipeline gating
|
|
19
|
+
- **Quality score tracking:** `.rebar/metrics.json` stores score history with trend analysis
|
|
20
|
+
- **Quality score badge:** SVG badge generation for README embedding
|
|
21
|
+
- **Custom rules engine:** `.rebar/rules.yaml` for project-specific quality rules
|
|
22
|
+
- **`rebar_add_rule` tool:** Add custom rules via MCP or CLI
|
|
23
|
+
- **`rebar_set_strictness` tool:** Change enforcement profile without re-initializing
|
|
24
|
+
- **`rebar_metrics` tool:** View quality score trends and improvement rate
|
|
25
|
+
|
|
26
|
+
### Changed
|
|
27
|
+
- `rebar_init_project` now generates config for all detected AI coding platforms
|
|
28
|
+
- `rebar_audit` (formerly `ccboot_audit_code_quality`) now supports custom rules and auto-generates metrics snapshots
|
|
29
|
+
- All templates updated to include platform-specific formatting for Cursor and Windsurf
|
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# rebar-mcp
|
|
2
|
+
|
|
3
|
+
## Project Overview
|
|
4
|
+
Reinforcement for AI-generated code. An MCP server that generates, validates, and manages Claude Code configuration artifacts (CLAUDE.md, skills, agents, hooks, commands, MCP configs, knowledge docs) with enforcement hooks that prevent AI coding tools from shipping broken code.
|
|
5
|
+
|
|
6
|
+
## Tech Stack
|
|
7
|
+
- TypeScript (strict mode) targeting ES2022
|
|
8
|
+
- Node.js 18+ runtime
|
|
9
|
+
- @modelcontextprotocol/sdk for MCP server
|
|
10
|
+
- Zod for input validation
|
|
11
|
+
- stdio transport (primary), streamable HTTP (secondary)
|
|
12
|
+
|
|
13
|
+
## Architecture Rules
|
|
14
|
+
- ALWAYS use server.registerTool() (never deprecated server.tool())
|
|
15
|
+
- All tool names use rebar_ prefix with snake_case
|
|
16
|
+
- All Zod schemas use .strict() enforcement
|
|
17
|
+
- No use of `any` type — use `unknown` or proper types
|
|
18
|
+
- All async functions have explicit Promise<T> return types
|
|
19
|
+
- Log to stderr ONLY (stdout is reserved for MCP protocol)
|
|
20
|
+
- Never use console.log() — use console.error() for debug output
|
|
21
|
+
- All file writes are atomic (write to temp, then rename)
|
|
22
|
+
- Never overwrite files without checking merge_existing flag
|
|
23
|
+
|
|
24
|
+
## Tool Annotations
|
|
25
|
+
Every tool MUST include annotations:
|
|
26
|
+
- readOnlyHint: true for read operations, false for writes
|
|
27
|
+
- destructiveHint: false (we never delete without explicit request)
|
|
28
|
+
- idempotentHint: true if re-running produces same result
|
|
29
|
+
- openWorldHint: false (we only touch local filesystem)
|
|
30
|
+
|
|
31
|
+
## File Structure
|
|
32
|
+
- src/index.ts — Entry point, server init, transport
|
|
33
|
+
- src/types.ts — Shared TypeScript interfaces
|
|
34
|
+
- src/constants.ts — Enums, defaults, limits
|
|
35
|
+
- src/tools/*.ts — Tool implementations (one file per domain)
|
|
36
|
+
- src/services/*.ts — Shared utilities (file ops, templates, validation)
|
|
37
|
+
- src/schemas/*.ts — Zod schemas
|
|
38
|
+
- templates/**/*.md — Raw template files
|
|
39
|
+
|
|
40
|
+
## Build & Test
|
|
41
|
+
- Build: `npm run build` (must pass with zero errors)
|
|
42
|
+
- Lint: `npx tsc --noEmit`
|
|
43
|
+
- Test: `npm run test`
|
|
44
|
+
- Dev: `npx tsx src/index.ts` (for local MCP testing)
|
|
45
|
+
|
|
46
|
+
## Template Conventions
|
|
47
|
+
- Variables: `{{variable_name}}` (double curly braces)
|
|
48
|
+
- Conditionals: `{{#if condition}}...{{/if}}`
|
|
49
|
+
- Templates are plain markdown with substitution markers
|
|
50
|
+
- All generated YAML must parse cleanly
|
|
51
|
+
- All generated JSON must be valid
|
|
52
|
+
- Skills MUST have name (max 64 chars) and description (max 200 chars)
|
|
53
|
+
|
|
54
|
+
## Code Quality
|
|
55
|
+
- Extract common functionality into src/services/
|
|
56
|
+
- DRY: if logic appears twice, extract to a function
|
|
57
|
+
- Every tool description includes: purpose, args, return schema, examples
|
|
58
|
+
- Error messages suggest next steps (not just what failed)
|
|
59
|
+
- No hardcoded paths — use path.join() and respect project_path input
|
|
60
|
+
|
|
61
|
+
## MCP Server Best Practices
|
|
62
|
+
- Use Zod schemas with .describe() on every field for self-documenting APIs
|
|
63
|
+
- Tool descriptions must include: purpose summary, all args with types, return schema with field descriptions, 2-3 usage examples, and error handling notes
|
|
64
|
+
- Support both JSON and Markdown response formats where applicable
|
|
65
|
+
- Paginate list results with has_more, next_offset, total_count
|
|
66
|
+
- Return { isError: true, content: [...] } for recoverable errors with actionable suggestions
|
|
67
|
+
|
|
68
|
+
## Implementation Priority
|
|
69
|
+
1. src/index.ts + transport setup
|
|
70
|
+
2. src/services/ (file-ops, template-engine, validation)
|
|
71
|
+
3. src/types.ts + src/constants.ts + src/schemas/
|
|
72
|
+
4. src/tools/scaffolding.ts (init_project, generate_claudemd, create_skill, create_agent, create_hook, create_command)
|
|
73
|
+
5. templates/ (CLAUDE.md templates, skill templates, agent templates, hook templates)
|
|
74
|
+
6. src/tools/knowledge.ts (create_knowledge, create_adr)
|
|
75
|
+
7. src/tools/management.ts (list_artifacts, validate_config, audit_context)
|
|
76
|
+
8. src/tools/enterprise.ts (apply_compliance, create_ci_workflow, create_security_hook, generate_mcp_config)
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Ryan Colkitt
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
# Rebar
|
|
2
|
+
|
|
3
|
+
**Reinforcement for AI-generated code.**
|
|
4
|
+
|
|
5
|
+
Rebar prevents AI coding tools from shipping broken, incomplete, or insecure code. It embeds enforcement hooks, quality audits, and opinionated templates directly into your development environment — catching shortcuts at the moment of creation, not after the PR is opened.
|
|
6
|
+
|
|
7
|
+
Works with: **Claude Code** • **Cursor** • **Windsurf** • **Codex CLI**
|
|
8
|
+
|
|
9
|
+

|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## What Rebar Does
|
|
14
|
+
|
|
15
|
+
| Problem | Without Rebar | With Rebar |
|
|
16
|
+
|---------|---------------|------------|
|
|
17
|
+
| Claude skips tests | "I've completed the implementation" (no tests run) | Hook runs tests after every file change. Strict mode blocks until tests pass. |
|
|
18
|
+
| Empty catch blocks | Errors silently swallowed | Audit detects and flags every empty catch block |
|
|
19
|
+
| `any` types everywhere | TypeScript without type safety | Paranoid mode blocks files containing `any` |
|
|
20
|
+
| Incomplete implementations | TODO comments shipped to production | Paranoid mode blocks commits with TODO/FIXME |
|
|
21
|
+
| Hardcoded secrets | API keys in source code | Pre-commit hook detects and blocks secret patterns |
|
|
22
|
+
| Destructive commands | `rm -rf /` | Pre-execution hook blocks dangerous commands |
|
|
23
|
+
| Inconsistent setup | Every developer configures differently | One `rebar init` standardizes the entire team |
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Quick Start
|
|
28
|
+
|
|
29
|
+
### As an MCP Server (Claude Code)
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
claude mcp add rebar -- npx rebar-mcp
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Then in Claude Code:
|
|
36
|
+
```
|
|
37
|
+
> Initialize Rebar with strict enforcement
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### As a CLI
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
# Initialize a project
|
|
44
|
+
npx rebar-mcp init --strictness strict --platforms all
|
|
45
|
+
|
|
46
|
+
# Audit code quality
|
|
47
|
+
npx rebar-mcp audit --threshold 70
|
|
48
|
+
|
|
49
|
+
# Check setup health
|
|
50
|
+
npx rebar-mcp doctor
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### In CI/CD
|
|
54
|
+
|
|
55
|
+
```yaml
|
|
56
|
+
# .github/workflows/rebar.yml
|
|
57
|
+
- run: npx rebar-mcp audit --threshold 70 --format json
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Strictness Profiles
|
|
63
|
+
|
|
64
|
+
| Profile | Tests | Lint | Secrets | Danger | File Size | `any` Types | TODOs |
|
|
65
|
+
|---------|-------|------|---------|--------|-----------|-------------|-------|
|
|
66
|
+
| **Standard** | ⚠️ Notify | ⚠️ Notify | 🛑 Block | 🛑 Block | — | — | — |
|
|
67
|
+
| **Strict** | 🛑 Block | 🛑 Block | 🛑 Block | 🛑 Block | — | — | — |
|
|
68
|
+
| **Paranoid** | 🛑 Block | 🛑 Block | 🛑 Block | 🛑 Block | 🛑 Block >400 lines | 🛑 Block | 🛑 Block |
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
# Set strictness
|
|
72
|
+
npx rebar-mcp set-strictness paranoid
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## What Gets Generated
|
|
78
|
+
|
|
79
|
+
Running `rebar init` creates:
|
|
80
|
+
|
|
81
|
+
**Claude Code:** CLAUDE.md, .claude/settings.json (enforcement hooks), .claude/skills/ (5 skills), .claude/agents/ (4 agents), .claudeignore
|
|
82
|
+
|
|
83
|
+
**Cursor:** .cursor/rules/ (project rules + 4 skill rules)
|
|
84
|
+
|
|
85
|
+
**Windsurf:** .windsurf/rules/ (project rules + 4 skill rules)
|
|
86
|
+
|
|
87
|
+
**Codex CLI:** AGENTS.md
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Quality Audit
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
npx rebar-mcp audit
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Checks for:
|
|
98
|
+
1. TODO/FIXME/HACK/XXX comments
|
|
99
|
+
2. Empty catch blocks
|
|
100
|
+
3. `any` type usage
|
|
101
|
+
4. console.log in production code
|
|
102
|
+
5. Files over 400 lines
|
|
103
|
+
6. Functions over 50 lines
|
|
104
|
+
7. Hardcoded secrets
|
|
105
|
+
8. Custom rules (.rebar/rules.yaml)
|
|
106
|
+
|
|
107
|
+
Returns a quality score from 0–100.
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Custom Rules
|
|
112
|
+
|
|
113
|
+
Add project-specific rules in `.rebar/rules.yaml`:
|
|
114
|
+
|
|
115
|
+
```yaml
|
|
116
|
+
rules:
|
|
117
|
+
- name: no-direct-axios
|
|
118
|
+
description: "Use the API client in src/lib/api.ts"
|
|
119
|
+
pattern: "import.*from ['\"]axios['\"]"
|
|
120
|
+
severity: HIGH
|
|
121
|
+
file_patterns: ["*.ts", "*.tsx"]
|
|
122
|
+
exclude_files: ["src/lib/api.ts"]
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## Metrics
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
npx rebar-mcp metrics --period 30d
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Tracks quality score over time with trend analysis and improvement rate.
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## Doctor
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
npx rebar-mcp doctor
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Runs 10 health checks on your Rebar setup: CLAUDE.md presence, hook installation, skill configuration, context budget, cross-platform consistency, and more.
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## License
|
|
148
|
+
|
|
149
|
+
MIT
|