Skip to content
This repository was archived by the owner on Feb 15, 2026. It is now read-only.

Commit 4c12383

Browse files
groksrcclaude
andcommitted
Add optional basic-memory-hooks validation integration
Adds graceful integration with basic-memory-hooks validation API: - Updated /remember command to validate before writing - Updated knowledge-capture skill with validation section - Updated research skill with validation step - Updated spec-driven-development skill with validation note - Updated README with optional hooks setup instructions When basic-memory-hooks server is running (http://localhost:8000), the plugin will validate and auto-fix memos before saving. If the server is unavailable, memos save normally without validation. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent f853fee commit 4c12383

5 files changed

Lines changed: 64 additions & 5 deletions

File tree

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,22 @@ Skills, commands, and hooks for [Basic Memory](https://github.com/basicmachines-
4141
- [Basic Memory](https://github.com/basicmachines-co/basic-memory) MCP server must be configured
4242
- Claude Code CLI
4343

44+
## Optional: Validation with Basic Memory Hooks
45+
46+
For enhanced memo quality, install [basic-memory-hooks](https://github.com/basicmachines-co/basic-memory-hooks):
47+
48+
```bash
49+
pip install basic-memory-hooks
50+
python -m basic_memory_hooks # Start validation server
51+
```
52+
53+
When the hooks server is running, the plugin will:
54+
- Validate memos before saving
55+
- Auto-fix common formatting issues
56+
- Report any quality warnings
57+
58+
The plugin gracefully degrades if the hooks server isn't running—memos save normally without validation.
59+
4460
## License
4561

4662
MIT

commands/remember.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: Capture insights, decisions, or learnings to Basic Memory
33
argument-hint: [title] [optional: folder]
4-
allowed-tools: mcp__basic-memory__write_note, mcp__basic-memory__search_notes
4+
allowed-tools: mcp__basic-memory__write_note, mcp__basic-memory__search_notes, WebFetch
55
---
66

77
# Remember
@@ -35,9 +35,20 @@ Create a structured note capturing the key insights from our conversation.
3535
- `[learning]` - Lessons learned
3636
- Relations to link related concepts with `[[WikiLinks]]`
3737

38-
3. **Save using** `mcp__basic-memory__write_note`:
38+
3. **Validate the note** (optional, graceful degradation):
39+
- Try to POST the content to `http://localhost:8000/validate` using WebFetch
40+
- If the hooks API is available:
41+
- Use the returned `content` (which may have auto-fixes applied)
42+
- Note any `warnings` to mention to the user
43+
- If the API is unavailable (connection refused, timeout):
44+
- Continue with the original content - validation is optional
45+
- This step enhances quality but never blocks saving
46+
47+
4. **Save using** `mcp__basic-memory__write_note`:
3948
- folder: "$2" or "notes"
4049
- Include relevant tags
4150
- Project: use "main" unless user specifies otherwise
4251

43-
4. **Confirm** what was captured and where it was saved.
52+
5. **Confirm** what was captured and where it was saved.
53+
- If validation ran, mention any warnings that were found
54+
- If validation was skipped, that's fine - don't mention it

skills/knowledge-capture/SKILL.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,26 @@ mcp__basic-memory__read_note(
116116
)
117117
```
118118

119+
## Optional: Validation with Basic Memory Hooks
120+
121+
If the user has `basic-memory-hooks` running (`python -m basic_memory_hooks`), you can validate and auto-fix notes before saving:
122+
123+
1. **Before calling write_note**, try to POST to `http://localhost:8000/validate`:
124+
```json
125+
{"content": "full markdown content", "title": "Note Title"}
126+
```
127+
128+
2. **If the API responds**:
129+
- Use the returned `content` field (may have auto-fixes applied)
130+
- Check `warnings` array for any issues to mention
131+
- `success` indicates if validation passed
132+
133+
3. **If the API is unavailable** (connection refused, timeout):
134+
- Continue with the original content
135+
- Validation is optional - don't block or fail
136+
137+
This provides graceful degradation: enhanced quality when available, normal behavior otherwise.
138+
119139
## Folder Organization
120140

121141
Choose appropriate folders:

skills/research/SKILL.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,22 @@ tags:
128128
- relates-to [[Related Concepts]]
129129
```
130130

131-
### 5. Save to Basic Memory
131+
### 5. Validate (Optional)
132+
133+
If `basic-memory-hooks` is running, validate before saving:
134+
135+
1. POST to `http://localhost:8000/validate` with `{"content": "...", "title": "..."}`
136+
2. If API responds: use returned `content` (may have auto-fixes)
137+
3. If API unavailable: continue with original content
138+
139+
This is optional - validation enhances quality but never blocks saving.
140+
141+
### 6. Save to Basic Memory
132142

133143
```python
134144
mcp__basic-memory__write_note(
135145
title="Research: [Topic]",
136-
content="[Full report content]",
146+
content="[Full report content]", # or validated content if available
137147
folder="research",
138148
tags=["research", "topic-tags"],
139149
project="main"

skills/spec-driven-development/SKILL.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ tags:
139139
)
140140
```
141141

142+
**Optional Validation:** If `basic-memory-hooks` is running at `http://localhost:8000`, POST the content to `/validate` first. Use the returned `content` (auto-fixed) if available. If the API is unavailable, continue without validation.
143+
142144
### Updating Spec Progress
143145

144146
```python

0 commit comments

Comments
 (0)