rebar-mcp 2.2.0 → 2.4.1
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/settings.json +49 -19
- package/.claude/skills/bmmov0lh5xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/SKILL.md +21 -0
- package/.claude/skills/bmmovah7zxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/SKILL.md +21 -0
- package/.claude/skills/bmmovop8dxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/SKILL.md +21 -0
- package/.claude/skills/bnd-mmov0lh8/SKILL.md +21 -0
- package/.claude/skills/bnd-mmovah83/SKILL.md +21 -0
- package/.claude/skills/bnd-mmovop8h/SKILL.md +21 -0
- package/.claude/skills/nl-mmov0lhi/SKILL.md +25 -0
- package/.claude/skills/nl-mmovah8b/SKILL.md +25 -0
- package/.claude/skills/nl-mmovop8r/SKILL.md +25 -0
- package/.rebar/prereview.json +9 -0
- package/CLAUDE.md +17 -67
- package/README.md +187 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +190 -5
- package/dist/cli.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/schemas/scaffolding.d.ts +1 -1
- package/dist/services/context-builder.d.ts +41 -0
- package/dist/services/context-builder.d.ts.map +1 -0
- package/dist/services/context-builder.js +248 -0
- package/dist/services/context-builder.js.map +1 -0
- package/dist/services/license.d.ts +52 -0
- package/dist/services/license.d.ts.map +1 -0
- package/dist/services/license.js +194 -0
- package/dist/services/license.js.map +1 -0
- package/dist/services/prereview-analytics.d.ts +63 -0
- package/dist/services/prereview-analytics.d.ts.map +1 -0
- package/dist/services/prereview-analytics.js +323 -0
- package/dist/services/prereview-analytics.js.map +1 -0
- package/dist/services/prereview-llm.d.ts +15 -0
- package/dist/services/prereview-llm.d.ts.map +1 -0
- package/dist/services/prereview-llm.js +266 -0
- package/dist/services/prereview-llm.js.map +1 -0
- package/dist/services/prereview-memory.d.ts +101 -0
- package/dist/services/prereview-memory.d.ts.map +1 -0
- package/dist/services/prereview-memory.js +301 -0
- package/dist/services/prereview-memory.js.map +1 -0
- package/package.json +1 -1
- package/src/cli.ts +235 -5
- package/src/index.ts +1 -1
- package/src/services/context-builder.ts +325 -0
- package/src/services/license.ts +252 -0
- package/src/services/prereview-analytics.ts +439 -0
- package/src/services/prereview-llm.ts +365 -0
- package/src/services/prereview-memory.ts +439 -0
package/.claude/settings.json
CHANGED
|
@@ -1,24 +1,54 @@
|
|
|
1
1
|
{
|
|
2
|
-
"permissions": {
|
|
3
|
-
"allow": [
|
|
4
|
-
"Bash(npm run build)",
|
|
5
|
-
"Bash(npm run lint)",
|
|
6
|
-
"Bash(npm run test *)",
|
|
7
|
-
"Bash(npm run dev)",
|
|
8
|
-
"Bash(npx tsc --noEmit)",
|
|
9
|
-
"Bash(git status)",
|
|
10
|
-
"Bash(git diff *)",
|
|
11
|
-
"Bash(git log *)",
|
|
12
|
-
"Bash(git add *)",
|
|
13
|
-
"Bash(git commit *)"
|
|
14
|
-
],
|
|
15
|
-
"deny": [
|
|
16
|
-
"Bash(rm -rf *)",
|
|
17
|
-
"Read(./.env)",
|
|
18
|
-
"Read(./.env.*)"
|
|
19
|
-
]
|
|
20
|
-
},
|
|
21
2
|
"hooks": {
|
|
3
|
+
"PostToolCall": [
|
|
4
|
+
{
|
|
5
|
+
"matcher": "Write(*.ts)|Write(*.tsx)|Write(*.js)|Write(*.jsx)",
|
|
6
|
+
"hooks": [
|
|
7
|
+
{
|
|
8
|
+
"type": "command",
|
|
9
|
+
"command": "npm run format \"$CLAUDE_FILE_PATH\" 2>/dev/null || true"
|
|
10
|
+
}
|
|
11
|
+
]
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"matcher": "Write(*.ts)|Write(*.tsx)|Write(*.js)|Write(*.jsx)",
|
|
15
|
+
"hooks": [
|
|
16
|
+
{
|
|
17
|
+
"type": "command",
|
|
18
|
+
"command": "RESULT=$(npm run lint \"$CLAUDE_FILE_PATH\" 2>&1); EXITCODE=$?; if [ $EXITCODE -ne 0 ]; then echo \"$RESULT\" | head -20; echo '\\n❌ LINT ERRORS — Fix these before continuing.' >&2; exit 2; fi; exit 0"
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"matcher": "Write(*.ts)|Write(*.tsx)|Write(*.js)|Write(*.jsx)|Edit(*.ts)|Edit(*.tsx)|Edit(*.js)|Edit(*.jsx)",
|
|
24
|
+
"hooks": [
|
|
25
|
+
{
|
|
26
|
+
"type": "command",
|
|
27
|
+
"command": "node --test dist/**/*.test.js 2>&1 | tail -10; EXIT_CODE=${PIPESTATUS[0]}; if [ $EXIT_CODE -ne 0 ]; then echo '\\n❌ TESTS FAILED — Fix failing tests before continuing. Do not move to the next task.' >&2; exit 2; fi; exit 0"
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"PreToolCall": [
|
|
33
|
+
{
|
|
34
|
+
"matcher": "Bash",
|
|
35
|
+
"hooks": [
|
|
36
|
+
{
|
|
37
|
+
"type": "command",
|
|
38
|
+
"command": "BLOCKED='rm -rf|rm -fr|git push --force|git push -f|DROP TABLE|DROP DATABASE|TRUNCATE TABLE|chmod -R 777'; if echo \"$CLAUDE_BASH_COMMAND\" | grep -qiE \"$BLOCKED\"; then echo 'BLOCKED: Destructive command detected. Ask the developer for explicit approval.' >&2; exit 2; fi; exit 0"
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"matcher": "Bash(git commit*)|Bash(git add*)",
|
|
44
|
+
"hooks": [
|
|
45
|
+
{
|
|
46
|
+
"type": "command",
|
|
47
|
+
"command": "STAGED=$(git diff --cached --name-only 2>/dev/null); if [ -z \"$STAGED\" ]; then exit 0; fi; SECRETS=$(git diff --cached | grep -inE '(api[_-]?key|secret|password|token|private[_-]?key|aws_access|AKIA[A-Z0-9]{16})\\s*[:=]\\s*[\"\\x27]?[A-Za-z0-9+/=_-]{8,}' | head -5); if [ -n \"$SECRETS\" ]; then echo \"BLOCKED: Potential secrets in staged files:\" >&2; echo \"$SECRETS\" >&2; exit 2; fi; exit 0"
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
],
|
|
22
52
|
"InvalidEvent": [
|
|
23
53
|
{
|
|
24
54
|
"description": "A test hook",
|
package/.claude/skills/bmmov0lh5xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/SKILL.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bmmov0lh5xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
3
|
+
description: A test skill
|
|
4
|
+
invocation: undefined
|
|
5
|
+
context: undefined
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# bmmov0lh5xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
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
|
+
|
package/.claude/skills/bmmovah7zxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/SKILL.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bmmovah7zxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
3
|
+
description: A test skill
|
|
4
|
+
invocation: undefined
|
|
5
|
+
context: undefined
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# bmmovah7zxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
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
|
+
|
package/.claude/skills/bmmovop8dxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/SKILL.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bmmovop8dxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
3
|
+
description: A test skill
|
|
4
|
+
invocation: undefined
|
|
5
|
+
context: undefined
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# bmmovop8dxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
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
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bnd-mmov0lh8
|
|
3
|
+
description: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
|
4
|
+
invocation: undefined
|
|
5
|
+
context: undefined
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# bnd-mmov0lh8
|
|
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,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bnd-mmovah83
|
|
3
|
+
description: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
|
4
|
+
invocation: undefined
|
|
5
|
+
context: undefined
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# bnd-mmovah83
|
|
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,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bnd-mmovop8h
|
|
3
|
+
description: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
|
4
|
+
invocation: undefined
|
|
5
|
+
context: undefined
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# bnd-mmovop8h
|
|
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-mmov0lhi
|
|
3
|
+
description: Line one
|
|
4
|
+
Line two
|
|
5
|
+
Line three
|
|
6
|
+
invocation: undefined
|
|
7
|
+
context: undefined
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# nl-mmov0lhi
|
|
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
|
+
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: nl-mmovah8b
|
|
3
|
+
description: Line one
|
|
4
|
+
Line two
|
|
5
|
+
Line three
|
|
6
|
+
invocation: undefined
|
|
7
|
+
context: undefined
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# nl-mmovah8b
|
|
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
|
+
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: nl-mmovop8r
|
|
3
|
+
description: Line one
|
|
4
|
+
Line two
|
|
5
|
+
Line three
|
|
6
|
+
invocation: undefined
|
|
7
|
+
context: undefined
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# nl-mmovop8r
|
|
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
|
+
|
package/CLAUDE.md
CHANGED
|
@@ -1,76 +1,26 @@
|
|
|
1
1
|
# rebar-mcp
|
|
2
2
|
|
|
3
|
-
|
|
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.
|
|
3
|
+
Reinforcement for AI-generated code. Enforcement hooks, quality audits, and opinionated templates that prevent AI coding tools from shipping broken code.
|
|
5
4
|
|
|
6
5
|
## Tech Stack
|
|
7
|
-
- TypeScript (strict mode)
|
|
8
|
-
- Node.js 18+ runtime
|
|
9
|
-
- @modelcontextprotocol/sdk for MCP server
|
|
10
|
-
- Zod for input validation
|
|
11
|
-
- stdio transport (primary), streamable HTTP (secondary)
|
|
6
|
+
- TypeScript (strict mode)
|
|
12
7
|
|
|
13
8
|
## Architecture Rules
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
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
|
|
9
|
+
- No use of `any` type — use `unknown` with type narrowing or proper generics
|
|
10
|
+
- Prefer `interface` for object shapes, `type` for unions and intersections
|
|
11
|
+
- Never store secrets in code, config files, or version control
|
|
12
|
+
- All external data (user input, API responses, env vars) must be validated before use
|
|
39
13
|
|
|
40
14
|
## Build & Test
|
|
41
|
-
- Build: `npm run build` (
|
|
42
|
-
-
|
|
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)
|
|
15
|
+
- Build: `npm run build` (runs: `tsc`)
|
|
16
|
+
- Test: `npm run test` (runs: `node --test dist/**/*.test.js`)
|
|
53
17
|
|
|
54
|
-
##
|
|
55
|
-
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
-
|
|
59
|
-
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
-
|
|
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)
|
|
18
|
+
## File Structure
|
|
19
|
+
- `src/` — Source code
|
|
20
|
+
|
|
21
|
+
## Code Conventions
|
|
22
|
+
- TypeScript strict mode with no `any` types
|
|
23
|
+
- Prefer named exports over default exports
|
|
24
|
+
- Interface names: `PascalCase` (no `I` prefix)
|
|
25
|
+
- Constants: `UPPER_SNAKE_CASE`
|
|
26
|
+
- Zod schemas for runtime validation of external data
|
package/README.md
CHANGED
|
@@ -271,6 +271,193 @@ npx rebar-mcp prereview-rules --add "pattern=TODO" --severity warning
|
|
|
271
271
|
|
|
272
272
|
---
|
|
273
273
|
|
|
274
|
+
## LLM-Powered Semantic Analysis (Pro/Team)
|
|
275
|
+
|
|
276
|
+
Local regex patterns catch obvious issues. LLM review catches the hard stuff:
|
|
277
|
+
|
|
278
|
+
| Issue Type | Local (Free) | LLM (Paid) |
|
|
279
|
+
|------------|--------------|------------|
|
|
280
|
+
| Hardcoded secrets | ✓ | ✓ |
|
|
281
|
+
| Dangerous commands | ✓ | ✓ |
|
|
282
|
+
| N+1 query patterns | ✗ | ✓ |
|
|
283
|
+
| Race conditions | ✗ | ✓ |
|
|
284
|
+
| Business logic violations | ✗ | ✓ |
|
|
285
|
+
| Architecture drift | ✗ | ✓ |
|
|
286
|
+
| Context-aware review | ✗ | ✓ |
|
|
287
|
+
|
|
288
|
+
### Setup
|
|
289
|
+
|
|
290
|
+
```bash
|
|
291
|
+
# Set your Anthropic API key
|
|
292
|
+
export REBAR_API_KEY=sk-ant-...
|
|
293
|
+
|
|
294
|
+
# Choose your tier
|
|
295
|
+
export REBAR_TIER=pro # 1,000 LLM reviews/month
|
|
296
|
+
# or
|
|
297
|
+
export REBAR_TIER=team # 5,000 LLM reviews/month
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
### How It Works
|
|
301
|
+
|
|
302
|
+
1. **Context Building** — Extracts CLAUDE.md rules, recent blocks, and project conventions
|
|
303
|
+
2. **Hybrid Review** — Runs local patterns first, then LLM for deeper analysis
|
|
304
|
+
3. **Learning** — Records blocked patterns for future reference
|
|
305
|
+
4. **Fallback** — Gracefully falls back to local if LLM unavailable
|
|
306
|
+
|
|
307
|
+
```bash
|
|
308
|
+
# Check license status
|
|
309
|
+
npx rebar-mcp license
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
---
|
|
313
|
+
|
|
314
|
+
## Cross-Session Memory
|
|
315
|
+
|
|
316
|
+
Rebar learns from your project's decision history and applies that knowledge to future reviews.
|
|
317
|
+
|
|
318
|
+
### What Gets Learned
|
|
319
|
+
|
|
320
|
+
- **Pattern Frequency** — Patterns blocked 5+ times escalate from warning to critical
|
|
321
|
+
- **Project Insights** — Common issues in specific directories
|
|
322
|
+
- **Review Statistics** — Block rates, latency metrics
|
|
323
|
+
|
|
324
|
+
### Commands
|
|
325
|
+
|
|
326
|
+
```bash
|
|
327
|
+
# View current memory
|
|
328
|
+
npx rebar-mcp memory show
|
|
329
|
+
|
|
330
|
+
# Learn from decision history
|
|
331
|
+
npx rebar-mcp memory learn
|
|
332
|
+
|
|
333
|
+
# Clear memory (start fresh)
|
|
334
|
+
npx rebar-mcp memory clear
|
|
335
|
+
|
|
336
|
+
# Export memory as JSON
|
|
337
|
+
npx rebar-mcp memory export
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
### Memory Storage
|
|
341
|
+
|
|
342
|
+
Memory is persisted to `.rebar/memory.json`:
|
|
343
|
+
|
|
344
|
+
```json
|
|
345
|
+
{
|
|
346
|
+
"version": 1,
|
|
347
|
+
"learnedPatterns": [
|
|
348
|
+
{
|
|
349
|
+
"id": "aws-key",
|
|
350
|
+
"name": "AWS Access Key",
|
|
351
|
+
"blockCount": 12,
|
|
352
|
+
"severity": "critical",
|
|
353
|
+
"lastSeen": "2024-01-15T14:30:00Z"
|
|
354
|
+
}
|
|
355
|
+
],
|
|
356
|
+
"projectInsights": [
|
|
357
|
+
{
|
|
358
|
+
"id": "api-dir-issues",
|
|
359
|
+
"description": "src/api/ frequently has SQL injection patterns",
|
|
360
|
+
"affectedFiles": ["src/api/users.ts", "src/api/orders.ts"],
|
|
361
|
+
"confidence": 0.85
|
|
362
|
+
}
|
|
363
|
+
]
|
|
364
|
+
}
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
---
|
|
368
|
+
|
|
369
|
+
## Analytics Dashboard
|
|
370
|
+
|
|
371
|
+
Analyze trends and generate insights from your pre-review history.
|
|
372
|
+
|
|
373
|
+
```bash
|
|
374
|
+
# Last 30 days (default)
|
|
375
|
+
npx rebar-mcp analytics
|
|
376
|
+
|
|
377
|
+
# Last 7 days
|
|
378
|
+
npx rebar-mcp analytics 7
|
|
379
|
+
|
|
380
|
+
# JSON export for dashboards
|
|
381
|
+
npx rebar-mcp analytics --format json
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
### Sample Output
|
|
385
|
+
|
|
386
|
+
```
|
|
387
|
+
Pre-Review Analytics Report
|
|
388
|
+
===========================
|
|
389
|
+
|
|
390
|
+
Period: 2024-01-01 to 2024-01-31 (30 days)
|
|
391
|
+
|
|
392
|
+
Summary
|
|
393
|
+
-------
|
|
394
|
+
Total reviews: 247
|
|
395
|
+
Blocked: 23 (9.3%)
|
|
396
|
+
Warned: 41 (16.6%)
|
|
397
|
+
Approved: 183
|
|
398
|
+
|
|
399
|
+
Performance
|
|
400
|
+
-----------
|
|
401
|
+
Avg latency: 45ms
|
|
402
|
+
P50 latency: 32ms
|
|
403
|
+
P95 latency: 156ms
|
|
404
|
+
|
|
405
|
+
Top Patterns
|
|
406
|
+
------------
|
|
407
|
+
↑ AWS Access Key: 12x (0.4/day)
|
|
408
|
+
→ Empty Catch Block: 8x (0.3/day)
|
|
409
|
+
↓ any Type Usage: 5x (0.2/day)
|
|
410
|
+
|
|
411
|
+
Recent Activity (last 7 days)
|
|
412
|
+
-----------------------------
|
|
413
|
+
2024-01-25: ████ 4 (1B/0W)
|
|
414
|
+
2024-01-26: ██████████ 10 (2B/3W)
|
|
415
|
+
2024-01-27: ████████ 8 (1B/2W)
|
|
416
|
+
|
|
417
|
+
Insights
|
|
418
|
+
--------
|
|
419
|
+
• Low block rate (9.3%) - code quality is good!
|
|
420
|
+
• "AWS Access Key" is trending upward - review recent code
|
|
421
|
+
• Excellent review speed: 45ms average
|
|
422
|
+
```
|
|
423
|
+
|
|
424
|
+
---
|
|
425
|
+
|
|
426
|
+
## Pricing Tiers
|
|
427
|
+
|
|
428
|
+
| Feature | Free | Pro ($19/mo) | Team ($49/user/mo) |
|
|
429
|
+
|---------|------|--------------|-------------------|
|
|
430
|
+
| Regex patterns | Unlimited | Unlimited | Unlimited |
|
|
431
|
+
| LLM reviews | 0 | 1,000/month | 5,000/month |
|
|
432
|
+
| Cross-session memory | ✗ | ✓ | ✓ |
|
|
433
|
+
| Analytics | Basic | Full | Full |
|
|
434
|
+
| Audit retention | 7 days | 90 days | 1 year |
|
|
435
|
+
| Support | Community | Email | Priority |
|
|
436
|
+
|
|
437
|
+
---
|
|
438
|
+
|
|
439
|
+
## CLI Reference
|
|
440
|
+
|
|
441
|
+
```bash
|
|
442
|
+
rebar init [options] # Initialize Rebar enforcement
|
|
443
|
+
rebar audit [options] # Run quality audit
|
|
444
|
+
rebar doctor [options] # Check setup health
|
|
445
|
+
rebar set-strictness <level> # Change enforcement level
|
|
446
|
+
rebar metrics [options] # View quality score history
|
|
447
|
+
rebar badge [options] # Generate quality badge SVG
|
|
448
|
+
|
|
449
|
+
# Pre-Review
|
|
450
|
+
rebar prereview [options] # Run pre-review (invoked by hooks)
|
|
451
|
+
rebar prereview-stats # View decision statistics
|
|
452
|
+
|
|
453
|
+
# LLM & Memory
|
|
454
|
+
rebar license # View license and usage
|
|
455
|
+
rebar memory [action] # Manage cross-session memory
|
|
456
|
+
rebar analytics [days] # View trends and insights
|
|
457
|
+
```
|
|
458
|
+
|
|
459
|
+
---
|
|
460
|
+
|
|
274
461
|
## License
|
|
275
462
|
|
|
276
463
|
MIT
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAijCA,wBAAsB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAwI5D"}
|