diff --git a/README.md b/README.md index ad4ba7a..ce60d28 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,22 @@ Skills, commands, and hooks for [Basic Memory](https://github.com/basicmachines- - [Basic Memory](https://github.com/basicmachines-co/basic-memory) MCP server must be configured - Claude Code CLI +## Optional: Validation with Basic Memory Hooks + +For enhanced memo quality, install [basic-memory-hooks](https://github.com/basicmachines-co/basic-memory-hooks): + +```bash +pip install basic-memory-hooks +python -m basic_memory_hooks # Start validation server +``` + +When the hooks server is running, the plugin will: +- Validate memos before saving +- Auto-fix common formatting issues +- Report any quality warnings + +The plugin gracefully degrades if the hooks server isn't running—memos save normally without validation. + ## License MIT diff --git a/commands/remember.md b/commands/remember.md index 1e6d42e..bdbbefa 100644 --- a/commands/remember.md +++ b/commands/remember.md @@ -1,7 +1,7 @@ --- description: Capture insights, decisions, or learnings to Basic Memory argument-hint: [title] [optional: folder] -allowed-tools: mcp__basic-memory__write_note, mcp__basic-memory__search_notes +allowed-tools: mcp__basic-memory__write_note, mcp__basic-memory__search_notes, WebFetch --- # Remember @@ -35,9 +35,20 @@ Create a structured note capturing the key insights from our conversation. - `[learning]` - Lessons learned - Relations to link related concepts with `[[WikiLinks]]` -3. **Save using** `mcp__basic-memory__write_note`: +3. **Validate the note** (optional, graceful degradation): + - Try to POST the content to `http://localhost:8000/validate` using WebFetch + - If the hooks API is available: + - Use the returned `content` (which may have auto-fixes applied) + - Note any `warnings` to mention to the user + - If the API is unavailable (connection refused, timeout): + - Continue with the original content - validation is optional + - This step enhances quality but never blocks saving + +4. **Save using** `mcp__basic-memory__write_note`: - folder: "$2" or "notes" - Include relevant tags - Project: use "main" unless user specifies otherwise -4. **Confirm** what was captured and where it was saved. +5. **Confirm** what was captured and where it was saved. + - If validation ran, mention any warnings that were found + - If validation was skipped, that's fine - don't mention it diff --git a/skills/knowledge-capture/SKILL.md b/skills/knowledge-capture/SKILL.md index 791582d..0ed9cde 100644 --- a/skills/knowledge-capture/SKILL.md +++ b/skills/knowledge-capture/SKILL.md @@ -116,6 +116,26 @@ mcp__basic-memory__read_note( ) ``` +## Optional: Validation with Basic Memory Hooks + +If the user has `basic-memory-hooks` running (`python -m basic_memory_hooks`), you can validate and auto-fix notes before saving: + +1. **Before calling write_note**, try to POST to `http://localhost:8000/validate`: + ```json + {"content": "full markdown content", "title": "Note Title"} + ``` + +2. **If the API responds**: + - Use the returned `content` field (may have auto-fixes applied) + - Check `warnings` array for any issues to mention + - `success` indicates if validation passed + +3. **If the API is unavailable** (connection refused, timeout): + - Continue with the original content + - Validation is optional - don't block or fail + +This provides graceful degradation: enhanced quality when available, normal behavior otherwise. + ## Folder Organization Choose appropriate folders: diff --git a/skills/research/SKILL.md b/skills/research/SKILL.md index df47d64..086401e 100644 --- a/skills/research/SKILL.md +++ b/skills/research/SKILL.md @@ -128,12 +128,22 @@ tags: - relates-to [[Related Concepts]] ``` -### 5. Save to Basic Memory +### 5. Validate (Optional) + +If `basic-memory-hooks` is running, validate before saving: + +1. POST to `http://localhost:8000/validate` with `{"content": "...", "title": "..."}` +2. If API responds: use returned `content` (may have auto-fixes) +3. If API unavailable: continue with original content + +This is optional - validation enhances quality but never blocks saving. + +### 6. Save to Basic Memory ```python mcp__basic-memory__write_note( title="Research: [Topic]", - content="[Full report content]", + content="[Full report content]", # or validated content if available folder="research", tags=["research", "topic-tags"], project="main" diff --git a/skills/spec-driven-development/SKILL.md b/skills/spec-driven-development/SKILL.md index e54002b..2dc7e53 100644 --- a/skills/spec-driven-development/SKILL.md +++ b/skills/spec-driven-development/SKILL.md @@ -139,6 +139,8 @@ tags: ) ``` +**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. + ### Updating Spec Progress ```python