|
| 1 | +# 🚀 Announcing Terraphim's Claude Code Integration |
| 2 | + |
| 3 | +**Three powerful ways to integrate Terraphim's knowledge graph capabilities with Claude Code** |
| 4 | + |
| 5 | +--- |
| 6 | + |
| 7 | +## What's New? |
| 8 | + |
| 9 | +We're excited to announce a comprehensive integration between Terraphim and Claude Code, providing three complementary capabilities for AI-assisted development: |
| 10 | + |
| 11 | +### 1. 🪝 Claude Code Hooks |
| 12 | +**Automatic, transparent text replacement** |
| 13 | + |
| 14 | +Intercept user prompts before Claude sees them to enforce standards and preferences: |
| 15 | + |
| 16 | +```bash |
| 17 | +# Example: Automatically enforce bun over npm/yarn/pnpm |
| 18 | +echo "npm install && yarn test" | terraphim-tui replace |
| 19 | +# Output: bun_install && bun test |
| 20 | +``` |
| 21 | + |
| 22 | +**Use Cases:** |
| 23 | +- Package manager enforcement |
| 24 | +- Coding standard compliance |
| 25 | +- Attribution replacement |
| 26 | +- Domain-specific terminology |
| 27 | + |
| 28 | +### 2. 🎯 Claude Skills |
| 29 | +**Context-aware, conversational assistance** |
| 30 | + |
| 31 | +Progressive disclosure of Terraphim capabilities across all Claude platforms: |
| 32 | + |
| 33 | +- Works on web, mobile, and desktop |
| 34 | +- Provides explanations and reasoning |
| 35 | +- Learns when to apply replacements |
| 36 | +- Fully conversational interface |
| 37 | + |
| 38 | +### 3. 📊 Codebase Quality Evaluation |
| 39 | +**Objective assessment of AI-generated changes** |
| 40 | + |
| 41 | +Deterministic framework for evaluating whether AI agents improve or deteriorate your codebase: |
| 42 | + |
| 43 | +```bash |
| 44 | +./scripts/evaluate-ai-agent.sh /path/to/codebase |
| 45 | + |
| 46 | +# Generates verdict: |
| 47 | +# ✅ IMPROVEMENT: The AI agent improved the codebase quality. |
| 48 | +# - Improved metrics: 4 |
| 49 | +# - Deteriorated metrics: 0 |
| 50 | +``` |
| 51 | + |
| 52 | +**Key Features:** |
| 53 | +- ✅ Deterministic (Aho-Corasick automata) |
| 54 | +- ✅ Privacy-first (runs locally) |
| 55 | +- ✅ Multi-dimensional (security, performance, quality) |
| 56 | +- ✅ CI/CD ready (exit codes for automation) |
| 57 | + |
| 58 | +--- |
| 59 | + |
| 60 | +## Why This Matters |
| 61 | + |
| 62 | +As AI coding assistants become more prevalent, we need **objective quality gates** to ensure they help rather than hurt our codebases. |
| 63 | + |
| 64 | +**Traditional Approach:** |
| 65 | +``` |
| 66 | +AI changes → Manual review → Hope → Ship |
| 67 | +``` |
| 68 | + |
| 69 | +**Terraphim Approach:** |
| 70 | +``` |
| 71 | +AI changes → Automatic evaluation → Objective verdict → Block if worse → Ship confidently |
| 72 | +``` |
| 73 | + |
| 74 | +--- |
| 75 | + |
| 76 | +## Quick Start |
| 77 | + |
| 78 | +### Installation |
| 79 | + |
| 80 | +```bash |
| 81 | +# Docker (easiest) |
| 82 | +curl -fsSL https://raw.githubusercontent.com/terraphim/terraphim-ai/main/release/v0.2.3/docker-run.sh | bash |
| 83 | + |
| 84 | +# Or binary installation |
| 85 | +curl -fsSL https://raw.githubusercontent.com/terraphim/terraphim-ai/main/release/v0.2.3/install.sh | bash |
| 86 | +``` |
| 87 | + |
| 88 | +### Try Evaluation |
| 89 | + |
| 90 | +```bash |
| 91 | +git clone https://github.com/terraphim/terraphim-ai.git |
| 92 | +cd terraphim-ai/examples/codebase-evaluation |
| 93 | +./scripts/evaluate-ai-agent.sh /path/to/your/codebase |
| 94 | +``` |
| 95 | + |
| 96 | +### Set Up Hooks |
| 97 | + |
| 98 | +```bash |
| 99 | +# Copy hook script |
| 100 | +cp examples/claude-code-hooks/terraphim-package-manager-hook.sh ~/.claude/hooks/ |
| 101 | + |
| 102 | +# Configure Claude Code settings |
| 103 | +# See: examples/claude-code-hooks/README.md |
| 104 | +``` |
| 105 | + |
| 106 | +### Set Up Skills |
| 107 | + |
| 108 | +```bash |
| 109 | +# Copy skill |
| 110 | +cp -r examples/claude-skills/terraphim-package-manager ~/.claude/skills/ |
| 111 | + |
| 112 | +# Restart Claude |
| 113 | +``` |
| 114 | + |
| 115 | +--- |
| 116 | + |
| 117 | +## Example: CI/CD Quality Gate |
| 118 | + |
| 119 | +```yaml |
| 120 | +name: AI Quality Check |
| 121 | + |
| 122 | +on: pull_request |
| 123 | + |
| 124 | +jobs: |
| 125 | + evaluate: |
| 126 | + runs-on: ubuntu-latest |
| 127 | + steps: |
| 128 | + - uses: actions/checkout@v3 |
| 129 | + - name: Install Terraphim |
| 130 | + run: curl -fsSL https://[...]/install.sh | bash |
| 131 | + - name: Baseline evaluation |
| 132 | + run: ./scripts/baseline-evaluation.sh . |
| 133 | + - name: Post-change evaluation |
| 134 | + run: ./scripts/post-evaluation.sh . |
| 135 | + - name: Generate verdict (fails on deterioration) |
| 136 | + run: ./scripts/compare-evaluations.sh |
| 137 | +``` |
| 138 | +
|
| 139 | +--- |
| 140 | +
|
| 141 | +## Documentation |
| 142 | +
|
| 143 | +**Complete Guides:** |
| 144 | +- [Integration Guide](https://github.com/terraphim/terraphim-ai/blob/main/examples/TERRAPHIM_CLAUDE_INTEGRATION.md) |
| 145 | +- [Evaluation Design](https://github.com/terraphim/terraphim-ai/blob/main/examples/CODEBASE_EVALUATION_DESIGN.md) |
| 146 | +- [Quick Start](https://github.com/terraphim/terraphim-ai/blob/main/examples/codebase-evaluation/README.md) |
| 147 | +
|
| 148 | +**Examples:** |
| 149 | +- [Hooks](https://github.com/terraphim/terraphim-ai/tree/main/examples/claude-code-hooks) |
| 150 | +- [Skills](https://github.com/terraphim/terraphim-ai/tree/main/examples/claude-skills) |
| 151 | +- [Evaluation Scripts](https://github.com/terraphim/terraphim-ai/tree/main/examples/codebase-evaluation/scripts) |
| 152 | +
|
| 153 | +--- |
| 154 | +
|
| 155 | +## Use Cases |
| 156 | +
|
| 157 | +### 1. Package Manager Enforcement |
| 158 | +Automatically replace npm/yarn/pnpm with bun in all prompts and code. |
| 159 | +
|
| 160 | +### 2. PR Quality Gates |
| 161 | +Block PRs from AI agents if they deteriorate code quality. |
| 162 | +
|
| 163 | +### 3. Security Auditing |
| 164 | +Evaluate AI changes for security vulnerabilities before merge. |
| 165 | +
|
| 166 | +### 4. Performance Analysis |
| 167 | +Assess whether AI optimizations actually improve performance. |
| 168 | +
|
| 169 | +### 5. Trend Monitoring |
| 170 | +Track codebase quality evolution over time across AI changes. |
| 171 | +
|
| 172 | +--- |
| 173 | +
|
| 174 | +## Key Benefits |
| 175 | +
|
| 176 | +**Objectivity** - Quantifiable metrics over subjective opinions |
| 177 | +**Speed** - Evaluations in seconds, not hours |
| 178 | +**Privacy** - Everything runs locally, no external APIs |
| 179 | +**Determinism** - Same input → same output |
| 180 | +**Transparency** - See exactly why quality changed |
| 181 | +
|
| 182 | +--- |
| 183 | +
|
| 184 | +## Technical Highlights |
| 185 | +
|
| 186 | +**Aho-Corasick Automata** |
| 187 | +- O(n + m) complexity for pattern matching |
| 188 | +- Search thousands of patterns simultaneously |
| 189 | +- Deterministic and fast |
| 190 | +
|
| 191 | +**Knowledge Graphs** |
| 192 | +- Define semantic relationships in markdown |
| 193 | +- Build thesauri for concept mapping |
| 194 | +- Extensible for any domain |
| 195 | +
|
| 196 | +**Role-Based Evaluation** |
| 197 | +- Security Auditor: Vulnerabilities and attack vectors |
| 198 | +- Performance Analyst: Bottlenecks and efficiency |
| 199 | +- Code Reviewer: Quality and maintainability |
| 200 | +- Documentation Quality: Completeness and clarity |
| 201 | +
|
| 202 | +--- |
| 203 | +
|
| 204 | +## Community |
| 205 | +
|
| 206 | +**Connect:** |
| 207 | +- GitHub: [terraphim/terraphim-ai](https://github.com/terraphim/terraphim-ai) |
| 208 | +- Discord: https://discord.gg/VPJXB6BGuY |
| 209 | +- Discourse: https://terraphim.discourse.group |
| 210 | +
|
| 211 | +**Contribute:** |
| 212 | +- Share knowledge graph templates |
| 213 | +- Report useful evaluation patterns |
| 214 | +- Submit PRs with improvements |
| 215 | +- Write about your experiences |
| 216 | +
|
| 217 | +--- |
| 218 | +
|
| 219 | +## What's Next |
| 220 | +
|
| 221 | +**Short Term:** |
| 222 | +- Visual dashboard for evaluation trends |
| 223 | +- More built-in evaluation roles |
| 224 | +- Language-specific KG templates |
| 225 | +
|
| 226 | +**Medium Term:** |
| 227 | +- ML-enhanced pattern detection |
| 228 | +- Automatic KG expansion |
| 229 | +- Real-time evaluation |
| 230 | +
|
| 231 | +**Long Term:** |
| 232 | +- Distributed team evaluation |
| 233 | +- Knowledge graph marketplace |
| 234 | +- Advanced analytics |
| 235 | +
|
| 236 | +--- |
| 237 | +
|
| 238 | +## Try It Today |
| 239 | +
|
| 240 | +All code is Apache 2.0 licensed. Privacy-first. Runs locally. No external dependencies. |
| 241 | +
|
| 242 | +**Get Started:** https://github.com/terraphim/terraphim-ai |
| 243 | +
|
| 244 | +--- |
| 245 | +
|
| 246 | +*Terraphim: Privacy-first AI assistant for trusted AI-assisted development* |
0 commit comments