Skip to content

Commit aef178e

Browse files
committed
feat: Add attribution replacement example alongside bun replacement
This commit expands the Terraphim-Claude integration with a second use case: replacing Claude Code attribution with Terraphim AI attribution. Changes: - Fixed docs/src/kg/knowledge-graph-system.md to prevent documentation synonym examples from being parsed as actual KG entries (caused every character to be replaced with "knowledge-graph-system") - Added new KG files for attribution replacement: - terraphim_ai.md - Maps "Claude Code" → terraphim_ai - https___terraphim_ai.md - Maps Claude URLs → Terraphim URLs - generated_with_terraphim.md - Maps generation attribution text - noreply_terraphim.md - Maps email addresses - Updated TERRAPHIM_CLAUDE_INTEGRATION.md with both examples - Documented filename-based replacement limitation (spaces → underscores) Both use cases now work: 1. Package manager: "npm install" → "bun_install" 2. Attribution: "[Claude Code]..." → "[terraphim_ai]..." The replacements use filename stems as replacement text, so spaces become underscores and special characters are converted. This is a fundamental design where filenames serve as normalized terms.
1 parent 7333b29 commit aef178e

8 files changed

Lines changed: 62 additions & 2 deletions
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Generated with Terraphim AI
2+
3+
Attribution text for Terraphim AI generated content.
4+
5+
synonyms:: Generated with Claude Code, Generated with Claude
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# https://terraphim.ai
2+
3+
Terraphim AI website URL.
4+
5+
synonyms:: https://claude.com/claude-code, https://anthropic.com, https://claude.com

docs/src/kg/knowledge-graph-system.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Markdown files use the `synonyms::` syntax to define concept relationships:
4141

4242
Terraphim Graph (scorer) is using unique graph embeddings.
4343

44-
synonyms:: graph embeddings, graph, knowledge graph based embeddings
44+
[example] synonyms:: graph embeddings, graph, knowledge graph based embeddings
4545

4646
Now we will have a concept "Terraphim Graph Scorer" with synonyms.
4747
```
@@ -257,7 +257,7 @@ let new_kg_content = r#"
257257
258258
Graph Analysis provides deep insights into data relationships.
259259
260-
synonyms:: data analysis, network analysis, graph processing,
260+
[example] synonyms:: data analysis, network analysis, graph processing,
261261
relationship mapping, connectivity analysis,
262262
terraphim-graph, graph embeddings
263263

docs/src/kg/noreply_terraphim.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# noreply@terraphim.ai
2+
3+
Terraphim AI no-reply email address.
4+
5+
synonyms:: noreply@anthropic.com

docs/src/kg/terraphim_ai.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Terraphim AI
2+
3+
Terraphim AI platform for knowledge graph-based search.
4+
5+
synonyms:: Claude Code, Claude
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Terraphim AI
2+
3+
Link text for Terraphim AI.
4+
5+
synonyms:: Claude Code, Claude
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# https://terraphim.ai
2+
3+
URL for Terraphim AI website.
4+
5+
synonyms:: https://claude.com/claude-code, https://anthropic.com

examples/TERRAPHIM_CLAUDE_INTEGRATION.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,36 @@ Only logs what would be replaced, doesn't modify input.
134134

135135
**Documentation**: See `examples/claude-code-hooks/README.md`
136136

137+
### Real-World Examples
138+
139+
**1. Package Manager Replacement (bun)**
140+
141+
Knowledge Graph Files:
142+
- `docs/src/kg/bun.md` - Maps npm/yarn/pnpm → bun
143+
- `docs/src/kg/bun_install.md` - Maps installation commands → bun_install
144+
145+
Example Replacements:
146+
```bash
147+
$ terraphim-tui replace "npm install && yarn test"
148+
bun_install && bun test
149+
```
150+
151+
**2. Attribution Replacement (Claude → Terraphim)**
152+
153+
Knowledge Graph Files:
154+
- `docs/src/kg/terraphim_ai.md` - Maps "Claude Code" → terraphim_ai
155+
- `docs/src/kg/https___terraphim_ai.md` - Maps Claude URLs → Terraphim URLs
156+
- `docs/src/kg/generated_with_terraphim.md` - Maps attribution text
157+
- `docs/src/kg/noreply_terraphim.md` - Maps email addresses
158+
159+
Example Replacements:
160+
```bash
161+
$ terraphim-tui replace "🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>"
162+
🤖 Generated with [terraphim_ai](https___terraphim_ai) Co-Authored-By: terraphim_ai <noreply_terraphim>
163+
```
164+
165+
**Note on Output Format**: Replacement text uses filename stems, so spaces become underscores and special characters are converted (e.g., "https://terraphim.ai" → "https___terraphim_ai"). This is a fundamental design of the system where filenames serve as normalized replacement terms.
166+
137167
## Claude Skills
138168

139169
### What Are Skills?

0 commit comments

Comments
 (0)