crucible-mcp 0.4.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. crucible_mcp-0.4.0/PKG-INFO +160 -0
  2. crucible_mcp-0.4.0/README.md +143 -0
  3. crucible_mcp-0.4.0/pyproject.toml +52 -0
  4. crucible_mcp-0.4.0/setup.cfg +4 -0
  5. crucible_mcp-0.4.0/src/crucible/__init__.py +3 -0
  6. crucible_mcp-0.4.0/src/crucible/cli.py +1822 -0
  7. crucible_mcp-0.4.0/src/crucible/domain/__init__.py +5 -0
  8. crucible_mcp-0.4.0/src/crucible/domain/detection.py +67 -0
  9. crucible_mcp-0.4.0/src/crucible/enforcement/__init__.py +40 -0
  10. crucible_mcp-0.4.0/src/crucible/enforcement/assertions.py +276 -0
  11. crucible_mcp-0.4.0/src/crucible/enforcement/models.py +107 -0
  12. crucible_mcp-0.4.0/src/crucible/enforcement/patterns.py +337 -0
  13. crucible_mcp-0.4.0/src/crucible/errors.py +50 -0
  14. crucible_mcp-0.4.0/src/crucible/hooks/__init__.py +15 -0
  15. crucible_mcp-0.4.0/src/crucible/hooks/precommit.py +660 -0
  16. crucible_mcp-0.4.0/src/crucible/knowledge/__init__.py +1 -0
  17. crucible_mcp-0.4.0/src/crucible/knowledge/loader.py +210 -0
  18. crucible_mcp-0.4.0/src/crucible/models.py +76 -0
  19. crucible_mcp-0.4.0/src/crucible/review/__init__.py +23 -0
  20. crucible_mcp-0.4.0/src/crucible/review/core.py +383 -0
  21. crucible_mcp-0.4.0/src/crucible/server.py +1206 -0
  22. crucible_mcp-0.4.0/src/crucible/skills/__init__.py +23 -0
  23. crucible_mcp-0.4.0/src/crucible/skills/loader.py +281 -0
  24. crucible_mcp-0.4.0/src/crucible/synthesis/__init__.py +1 -0
  25. crucible_mcp-0.4.0/src/crucible/tools/__init__.py +21 -0
  26. crucible_mcp-0.4.0/src/crucible/tools/delegation.py +412 -0
  27. crucible_mcp-0.4.0/src/crucible/tools/git.py +317 -0
  28. crucible_mcp-0.4.0/src/crucible_mcp.egg-info/PKG-INFO +160 -0
  29. crucible_mcp-0.4.0/src/crucible_mcp.egg-info/SOURCES.txt +44 -0
  30. crucible_mcp-0.4.0/src/crucible_mcp.egg-info/dependency_links.txt +1 -0
  31. crucible_mcp-0.4.0/src/crucible_mcp.egg-info/entry_points.txt +3 -0
  32. crucible_mcp-0.4.0/src/crucible_mcp.egg-info/requires.txt +8 -0
  33. crucible_mcp-0.4.0/src/crucible_mcp.egg-info/top_level.txt +1 -0
  34. crucible_mcp-0.4.0/tests/test_cli.py +833 -0
  35. crucible_mcp-0.4.0/tests/test_detection.py +83 -0
  36. crucible_mcp-0.4.0/tests/test_enforcement.py +613 -0
  37. crucible_mcp-0.4.0/tests/test_full_review.py +484 -0
  38. crucible_mcp-0.4.0/tests/test_git.py +389 -0
  39. crucible_mcp-0.4.0/tests/test_hooks_cli.py +234 -0
  40. crucible_mcp-0.4.0/tests/test_integration.py +220 -0
  41. crucible_mcp-0.4.0/tests/test_knowledge.py +311 -0
  42. crucible_mcp-0.4.0/tests/test_precommit.py +579 -0
  43. crucible_mcp-0.4.0/tests/test_server.py +209 -0
  44. crucible_mcp-0.4.0/tests/test_skills.py +197 -0
  45. crucible_mcp-0.4.0/tests/test_skills_loader.py +425 -0
  46. crucible_mcp-0.4.0/tests/test_tools.py +136 -0
@@ -0,0 +1,160 @@
1
+ Metadata-Version: 2.4
2
+ Name: crucible-mcp
3
+ Version: 0.4.0
4
+ Summary: Code review MCP server for Claude. Not affiliated with Atlassian.
5
+ Author: be.nvy
6
+ License-Expression: MIT
7
+ Keywords: mcp,code-review,static-analysis,claude
8
+ Requires-Python: >=3.11
9
+ Description-Content-Type: text/markdown
10
+ Requires-Dist: mcp>=1.0.0
11
+ Requires-Dist: pyyaml>=6.0
12
+ Provides-Extra: dev
13
+ Requires-Dist: pytest>=8.0; extra == "dev"
14
+ Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
15
+ Requires-Dist: mypy>=1.8; extra == "dev"
16
+ Requires-Dist: ruff>=0.3; extra == "dev"
17
+
18
+ # Crucible
19
+
20
+ **Your team's standards, applied by Claude, every time.**
21
+
22
+ Claude without context applies generic best practices. Crucible loads *your* patterns—so Claude reviews code the way your team would, not the way the internet would.
23
+
24
+ ```
25
+ ├── Personas: Domain-specific thinking (how to approach problems)
26
+ ├── Knowledge: Coding patterns and principles (what to apply)
27
+ ├── Cascade: Project → User → Bundled (customizable at every level)
28
+ └── Context-aware: Loads relevant skills based on what you're working on
29
+ ```
30
+
31
+ **Why Crucible?**
32
+ - **Consistency** — Same checklist every time, for every engineer, every session
33
+ - **Automation** — Runs in CI and pre-commit, not just interactively
34
+ - **Institutional knowledge** — Your senior engineer's mental checklist, in the repo
35
+ - **Your context** — Security fundamentals plus *your* auth patterns, *your* conventions, *your* definition of "done"
36
+ - **Cost efficiency** — Filter with free tools first, LLM only on what needs judgment
37
+
38
+ > Not affiliated with Atlassian's Crucible.
39
+
40
+ ## Install
41
+
42
+ ```bash
43
+ pip install crucible-mcp
44
+ ```
45
+
46
+ Add to Claude Code (`.mcp.json`):
47
+
48
+ ```json
49
+ {
50
+ "mcpServers": {
51
+ "crucible": {
52
+ "command": "crucible-mcp"
53
+ }
54
+ }
55
+ }
56
+ ```
57
+
58
+ With hot reload (recommended for customization):
59
+
60
+ ```json
61
+ {
62
+ "mcpServers": {
63
+ "crucible": {
64
+ "command": "mcpmon",
65
+ "args": ["--watch", "~/.crucible/", "--", "crucible-mcp"]
66
+ }
67
+ }
68
+ }
69
+ ```
70
+
71
+ ## How It Works
72
+
73
+ ```
74
+ Code → Detect Domain → Load Personas + Knowledge → Claude with YOUR patterns
75
+
76
+ .sol file → web3 domain → security-engineer + SMART_CONTRACT.md → Knows your security rules
77
+ ```
78
+
79
+ ## MCP Tools
80
+
81
+ | Tool | Purpose |
82
+ |------|---------|
83
+ | `review(path)` | Full review: analysis + skills + knowledge |
84
+ | `review(mode='staged')` | Review git changes with skills + knowledge |
85
+ | `load_knowledge(files)` | Load specific knowledge files |
86
+ | `get_principles(topic)` | Load engineering knowledge by topic |
87
+ | `delegate_*` | Direct tool access (semgrep, ruff, slither, bandit) |
88
+ | `check_tools()` | Show installed analysis tools |
89
+
90
+ The unified `review` tool supports:
91
+ - **Path-based**: `review(path="src/")` - analyze files/directories
92
+ - **Git-aware**: `review(mode="staged")` - analyze changes (staged, unstaged, branch, commits)
93
+ - **Quick mode**: `review(path, include_skills=false)` - analysis only, no skills/knowledge
94
+
95
+ ## CLI
96
+
97
+ ```bash
98
+ crucible init # Initialize .crucible/ for your project
99
+ crucible review # Review staged changes
100
+ crucible review --mode branch # Review current branch vs main
101
+ crucible ci generate # Generate GitHub Actions workflow
102
+
103
+ crucible skills list # List all skills
104
+ crucible skills init <skill> # Copy to .crucible/ for customization
105
+
106
+ crucible knowledge list # List all knowledge files
107
+ crucible knowledge init <file> # Copy for customization
108
+
109
+ crucible hooks install # Install pre-commit hook
110
+ ```
111
+
112
+ See [ARCHITECTURE.md](docs/ARCHITECTURE.md) for the full flow.
113
+
114
+ ## Customization
115
+
116
+ Override skills and knowledge for your project or personal preferences:
117
+
118
+ ```bash
119
+ # Customize a skill for your project
120
+ crucible skills init security-engineer
121
+ # Creates .crucible/skills/security-engineer/SKILL.md
122
+
123
+ # Add project-specific concerns, team conventions, etc.
124
+ ```
125
+
126
+ Resolution order (first found wins):
127
+ 1. `.crucible/` — Project overrides
128
+ 2. `~/.claude/crucible/` — User preferences
129
+ 3. Bundled — Package defaults
130
+
131
+ See [CUSTOMIZATION.md](docs/CUSTOMIZATION.md) for the full guide.
132
+
133
+ ## What's Included
134
+
135
+ **18 Personas** — Domain-specific thinking: security, performance, accessibility, web3, backend, and more.
136
+
137
+ See [SKILLS.md](docs/SKILLS.md) for the full list.
138
+
139
+ **12 Knowledge Files** — Coding patterns and principles for security, testing, APIs, databases, smart contracts, etc.
140
+
141
+ See [KNOWLEDGE.md](docs/KNOWLEDGE.md) for topics covered.
142
+
143
+ ## Documentation
144
+
145
+ | Doc | What's In It |
146
+ |-----|--------------|
147
+ | [FEATURES.md](docs/FEATURES.md) | Complete feature reference |
148
+ | [ARCHITECTURE.md](docs/ARCHITECTURE.md) | How MCP, tools, skills, and knowledge fit together |
149
+ | [CUSTOMIZATION.md](docs/CUSTOMIZATION.md) | Override skills and knowledge for your project |
150
+ | [SKILLS.md](docs/SKILLS.md) | All 18 personas with triggers and focus areas |
151
+ | [KNOWLEDGE.md](docs/KNOWLEDGE.md) | All 12 knowledge files with topics covered |
152
+ | [CONTRIBUTING.md](docs/CONTRIBUTING.md) | Adding tools, skills, and knowledge |
153
+
154
+ ## Development
155
+
156
+ ```bash
157
+ pip install -e ".[dev]"
158
+ pytest # Run tests (509 tests)
159
+ ruff check src/ --fix # Lint
160
+ ```
@@ -0,0 +1,143 @@
1
+ # Crucible
2
+
3
+ **Your team's standards, applied by Claude, every time.**
4
+
5
+ Claude without context applies generic best practices. Crucible loads *your* patterns—so Claude reviews code the way your team would, not the way the internet would.
6
+
7
+ ```
8
+ ├── Personas: Domain-specific thinking (how to approach problems)
9
+ ├── Knowledge: Coding patterns and principles (what to apply)
10
+ ├── Cascade: Project → User → Bundled (customizable at every level)
11
+ └── Context-aware: Loads relevant skills based on what you're working on
12
+ ```
13
+
14
+ **Why Crucible?**
15
+ - **Consistency** — Same checklist every time, for every engineer, every session
16
+ - **Automation** — Runs in CI and pre-commit, not just interactively
17
+ - **Institutional knowledge** — Your senior engineer's mental checklist, in the repo
18
+ - **Your context** — Security fundamentals plus *your* auth patterns, *your* conventions, *your* definition of "done"
19
+ - **Cost efficiency** — Filter with free tools first, LLM only on what needs judgment
20
+
21
+ > Not affiliated with Atlassian's Crucible.
22
+
23
+ ## Install
24
+
25
+ ```bash
26
+ pip install crucible-mcp
27
+ ```
28
+
29
+ Add to Claude Code (`.mcp.json`):
30
+
31
+ ```json
32
+ {
33
+ "mcpServers": {
34
+ "crucible": {
35
+ "command": "crucible-mcp"
36
+ }
37
+ }
38
+ }
39
+ ```
40
+
41
+ With hot reload (recommended for customization):
42
+
43
+ ```json
44
+ {
45
+ "mcpServers": {
46
+ "crucible": {
47
+ "command": "mcpmon",
48
+ "args": ["--watch", "~/.crucible/", "--", "crucible-mcp"]
49
+ }
50
+ }
51
+ }
52
+ ```
53
+
54
+ ## How It Works
55
+
56
+ ```
57
+ Code → Detect Domain → Load Personas + Knowledge → Claude with YOUR patterns
58
+
59
+ .sol file → web3 domain → security-engineer + SMART_CONTRACT.md → Knows your security rules
60
+ ```
61
+
62
+ ## MCP Tools
63
+
64
+ | Tool | Purpose |
65
+ |------|---------|
66
+ | `review(path)` | Full review: analysis + skills + knowledge |
67
+ | `review(mode='staged')` | Review git changes with skills + knowledge |
68
+ | `load_knowledge(files)` | Load specific knowledge files |
69
+ | `get_principles(topic)` | Load engineering knowledge by topic |
70
+ | `delegate_*` | Direct tool access (semgrep, ruff, slither, bandit) |
71
+ | `check_tools()` | Show installed analysis tools |
72
+
73
+ The unified `review` tool supports:
74
+ - **Path-based**: `review(path="src/")` - analyze files/directories
75
+ - **Git-aware**: `review(mode="staged")` - analyze changes (staged, unstaged, branch, commits)
76
+ - **Quick mode**: `review(path, include_skills=false)` - analysis only, no skills/knowledge
77
+
78
+ ## CLI
79
+
80
+ ```bash
81
+ crucible init # Initialize .crucible/ for your project
82
+ crucible review # Review staged changes
83
+ crucible review --mode branch # Review current branch vs main
84
+ crucible ci generate # Generate GitHub Actions workflow
85
+
86
+ crucible skills list # List all skills
87
+ crucible skills init <skill> # Copy to .crucible/ for customization
88
+
89
+ crucible knowledge list # List all knowledge files
90
+ crucible knowledge init <file> # Copy for customization
91
+
92
+ crucible hooks install # Install pre-commit hook
93
+ ```
94
+
95
+ See [ARCHITECTURE.md](docs/ARCHITECTURE.md) for the full flow.
96
+
97
+ ## Customization
98
+
99
+ Override skills and knowledge for your project or personal preferences:
100
+
101
+ ```bash
102
+ # Customize a skill for your project
103
+ crucible skills init security-engineer
104
+ # Creates .crucible/skills/security-engineer/SKILL.md
105
+
106
+ # Add project-specific concerns, team conventions, etc.
107
+ ```
108
+
109
+ Resolution order (first found wins):
110
+ 1. `.crucible/` — Project overrides
111
+ 2. `~/.claude/crucible/` — User preferences
112
+ 3. Bundled — Package defaults
113
+
114
+ See [CUSTOMIZATION.md](docs/CUSTOMIZATION.md) for the full guide.
115
+
116
+ ## What's Included
117
+
118
+ **18 Personas** — Domain-specific thinking: security, performance, accessibility, web3, backend, and more.
119
+
120
+ See [SKILLS.md](docs/SKILLS.md) for the full list.
121
+
122
+ **12 Knowledge Files** — Coding patterns and principles for security, testing, APIs, databases, smart contracts, etc.
123
+
124
+ See [KNOWLEDGE.md](docs/KNOWLEDGE.md) for topics covered.
125
+
126
+ ## Documentation
127
+
128
+ | Doc | What's In It |
129
+ |-----|--------------|
130
+ | [FEATURES.md](docs/FEATURES.md) | Complete feature reference |
131
+ | [ARCHITECTURE.md](docs/ARCHITECTURE.md) | How MCP, tools, skills, and knowledge fit together |
132
+ | [CUSTOMIZATION.md](docs/CUSTOMIZATION.md) | Override skills and knowledge for your project |
133
+ | [SKILLS.md](docs/SKILLS.md) | All 18 personas with triggers and focus areas |
134
+ | [KNOWLEDGE.md](docs/KNOWLEDGE.md) | All 12 knowledge files with topics covered |
135
+ | [CONTRIBUTING.md](docs/CONTRIBUTING.md) | Adding tools, skills, and knowledge |
136
+
137
+ ## Development
138
+
139
+ ```bash
140
+ pip install -e ".[dev]"
141
+ pytest # Run tests (509 tests)
142
+ ruff check src/ --fix # Lint
143
+ ```
@@ -0,0 +1,52 @@
1
+ [project]
2
+ name = "crucible-mcp"
3
+ version = "0.4.0"
4
+ description = "Code review MCP server for Claude. Not affiliated with Atlassian."
5
+ readme = "README.md"
6
+ requires-python = ">=3.11"
7
+ license = "MIT"
8
+ authors = [{ name = "be.nvy" }]
9
+ keywords = ["mcp", "code-review", "static-analysis", "claude"]
10
+
11
+ dependencies = [
12
+ "mcp>=1.0.0",
13
+ "pyyaml>=6.0",
14
+ ]
15
+
16
+ [project.optional-dependencies]
17
+ dev = [
18
+ "pytest>=8.0",
19
+ "pytest-asyncio>=0.23",
20
+ "mypy>=1.8",
21
+ "ruff>=0.3",
22
+ ]
23
+
24
+ [project.scripts]
25
+ crucible = "crucible.cli:main"
26
+ crucible-mcp = "crucible.server:main"
27
+
28
+ [build-system]
29
+ requires = ["setuptools>=61.0"]
30
+ build-backend = "setuptools.build_meta"
31
+
32
+ [tool.setuptools.packages.find]
33
+ where = ["src"]
34
+
35
+ [tool.ruff]
36
+ line-length = 100
37
+ target-version = "py311"
38
+
39
+ [tool.ruff.lint]
40
+ select = ["E", "F", "I", "N", "W", "UP", "B", "C4", "SIM"]
41
+ ignore = ["E501"]
42
+
43
+ [tool.mypy]
44
+ python_version = "3.11"
45
+ strict = true
46
+ warn_return_any = true
47
+ warn_unused_ignores = true
48
+
49
+ [tool.pytest.ini_options]
50
+ asyncio_mode = "auto"
51
+ testpaths = ["tests"]
52
+ markers = ["integration: marks tests as integration tests (deselect with '-m \"not integration\"')"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,3 @@
1
+ """crucible: Code review orchestration MCP server."""
2
+
3
+ __version__ = "0.4.0"