Compare commits

...

9 Commits

Author SHA1 Message Date
phernandez 4bfec8a88e feat: Add research skill and /research command
New capability to research topics and save structured reports:

/research command:
- /research <topic> [folder]
- Investigates using web search, codebase search, and existing notes
- Produces structured report with findings and analysis
- Saves to research/ folder by default

research skill (model-invoked):
- Triggers on "research", "investigate", "look into", "explore"
- Gathers information from multiple sources
- Synthesizes findings into actionable reports
- Links to sources and related notes

Report structure:
- Summary and research question
- Key findings with evidence
- Analysis and recommendations
- Open questions and sources
- Observations and relations for knowledge graph

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: phernandez <paul@basicmachines.co>
2025-11-28 14:31:02 -06:00
phernandez 9c3d2eb335 refactor: Move plugin into claude-code-plugin subdirectory
Reorganize plugin files into a dedicated subdirectory to keep
them separate from the main Basic Memory Python package:

- Move all plugin files to claude-code-plugin/
- Add README.md with quick start guide
- Update installation paths to use subdirectory

New structure:
```
claude-code-plugin/
├── .claude-plugin/
│   ├── plugin.json
│   └── marketplace.json
├── commands/
├── skills/
├── hooks/
├── README.md
└── PLUGIN.md
```

Installation:
/plugin marketplace add basicmachines-co/basic-memory/claude-code-plugin
/plugin install basic-memory@basicmachines

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: phernandez <paul@basicmachines.co>
2025-11-28 14:08:29 -06:00
phernandez 5fcbae3fdb feat: Add /organize slash command for knowledge graph maintenance
User-invoked command to complement the knowledge-organize skill.

Actions:
- /organize health - Quick overview of KB status (default)
- /organize orphans - Find notes with no relations
- /organize duplicates - Find similar/overlapping notes
- /organize relations [note] - Suggest connections for a note
- /organize tags - Review and normalize tag consistency

Always confirms before modifying notes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: phernandez <paul@basicmachines.co>
2025-11-28 13:58:19 -06:00
phernandez 68ee310a55 refactor: Rename knowledge-organizer to knowledge-organize
Use verb form for skill name to be consistent with action-oriented
naming (like knowledge-capture, not knowledge-capturer).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: phernandez <paul@basicmachines.co>
2025-11-28 13:56:18 -06:00
phernandez 3a7fca8a9e feat: Add knowledge-organizer skill for maintaining knowledge graph
New skill to help users organize and maintain their knowledge base:

Capabilities:
- Find orphan notes (no relations to other notes)
- Suggest relations based on content similarity
- Identify duplicate or overlapping notes
- Review and suggest folder organization
- Normalize inconsistent tags
- Create index/hub notes for topic navigation
- Enrich sparse notes with observations and structure

Includes workflows for:
- Quick health check (overview of KB status)
- Deep organization session (thorough review)
- Topic-focused organization (organize around a subject)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: phernandez <paul@basicmachines.co>
2025-11-28 13:48:43 -06:00
phernandez 4f2b1b2fd3 feat: Add edit-note skills for interactive note editing
Add two new skills for editing Basic Memory notes:

edit-note (MCP-based):
- Works with both cloud and local installations
- Conversational editing workflow via MCP tools
- Uses edit_note operations: append, prepend, find_replace, replace_section
- Shows before/after state for user verification

edit-note-local (file-based):
- For local installations with file system access
- Edits markdown files directly using Claude Code's Read/Edit/Write
- Changes sync automatically via `basic-memory sync --watch`
- Full file access including frontmatter editing

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: phernandez <paul@basicmachines.co>
2025-11-28 13:33:52 -06:00
phernandez a70b355838 feat: Complete plugin with marketplace, commands, and hooks
Add full plugin infrastructure for distribution:

Marketplace:
- Add marketplace.json for self-hosting at basicmachines-co/basic-memory
- Users can add via: /plugin marketplace add basicmachines-co/basic-memory

Slash Commands:
- /remember [title] - Capture insights to Basic Memory
- /continue [topic] - Resume previous work with context
- /context <url> - Build context from memory:// URLs
- /recent [timeframe] - Show recent activity

Hooks:
- PostToolUse: Confirm when notes are saved
- Stop: Suggest /remember for valuable conversations

Updated PLUGIN.md with comprehensive documentation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: phernandez <paul@basicmachines.co>
2025-11-28 13:11:11 -06:00
phernandez 32acbfe982 refactor: Package skills as Claude Code plugin
Convert the Basic Memory skills into a proper Claude Code plugin format:

- Add .claude-plugin/plugin.json manifest with metadata
- Move skills from .claude/skills/ to root skills/ directory
- Add PLUGIN.md with installation and usage documentation

Plugin structure:
```
.claude-plugin/
  plugin.json        # Plugin manifest
skills/
  knowledge-capture/
  continue-conversation/
  spec-driven-development/
PLUGIN.md            # Plugin documentation
```

Users can install via: /plugin install basic-memory@basicmachines

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: phernandez <paul@basicmachines.co>
2025-11-28 13:01:22 -06:00
phernandez 1831397861 feat: Add Claude Code skills for Basic Memory MCP integration
Add three model-invoked skills that help Claude automatically use
Basic Memory's MCP tools in the right contexts:

- knowledge-capture: Capture insights, decisions, and learnings into
  structured notes with observations and relations
- continue-conversation: Resume previous work by building context from
  the knowledge graph using memory:// URLs and recent activity
- spec-driven-development: Guide implementation based on specs stored
  in Basic Memory, following the SPEC-1 process

Unlike slash commands (user-invoked), skills are automatically
discovered and applied by Claude based on conversation context.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: phernandez <paul@basicmachines.co>
2025-11-28 12:52:47 -06:00
18 changed files with 2546 additions and 0 deletions
@@ -0,0 +1,23 @@
{
"name": "basicmachines",
"owner": {
"name": "Basic Machines",
"email": "hello@basicmachines.co"
},
"metadata": {
"description": "Official plugins from Basic Machines for knowledge management and AI-assisted development",
"version": "0.1.0"
},
"plugins": [
{
"name": "basic-memory",
"source": ".",
"description": "Skills, commands, and hooks for Basic Memory MCP - capture knowledge, continue conversations, and follow spec-driven development",
"version": "0.1.0",
"author": {
"name": "Basic Machines"
},
"keywords": ["memory", "knowledge", "mcp", "specs", "context"]
}
]
}
@@ -0,0 +1,9 @@
{
"name": "basic-memory",
"description": "Claude Code skills for Basic Memory - capture knowledge, continue conversations, and follow spec-driven development using the Basic Memory MCP server",
"version": "0.1.0",
"author": {
"name": "Basic Machines"
},
"repository": "https://github.com/basicmachines-co/basic-memory"
}
+313
View File
@@ -0,0 +1,313 @@
# Basic Memory Plugin for Claude Code
This plugin provides skills, commands, and hooks for working with [Basic Memory](https://basicmemory.io) - a local-first knowledge management system built on the Model Context Protocol (MCP).
## Prerequisites
You need the Basic Memory MCP server running. Install it via:
```bash
# Install basic-memory
pip install basic-memory
# Or with pipx
pipx install basic-memory
```
Then add it to your Claude Code MCP configuration.
## Installation
### Add the Marketplace
```
/plugin marketplace add basicmachines-co/basic-memory/claude-code-plugin
```
### Install the Plugin
```
/plugin install basic-memory@basicmachines
```
### Or via Repository Settings
Add to your `.claude/settings.json`:
```json
{
"plugins": {
"extraKnownMarketplaces": {
"basicmachines": {
"source": {
"source": "github",
"repo": "basicmachines-co/basic-memory",
"path": "claude-code-plugin"
}
}
},
"installed": ["basic-memory@basicmachines"]
}
}
```
---
## Slash Commands
User-invoked commands for explicit interaction with Basic Memory.
### `/remember [title] [folder]`
Capture insights, decisions, or learnings from the current conversation.
```
/remember "FastAPI Async Pattern"
/remember "Auth Decision" decisions
```
Creates a structured note with:
- Context from the conversation
- Observations with `[decision]`, `[insight]`, `[pattern]` categories
- Relations linking to related concepts
### `/continue [topic]`
Resume previous work by building context from Basic Memory.
```
/continue postgres migration
/continue SPEC-24
/continue
```
If no topic is provided, shows recent activity and asks what to dive into.
### `/context <memory://url> [depth] [timeframe]`
Build context from a specific memory:// URL.
```
/context memory://SPEC-24
/context memory://architecture/* 3 2weeks
```
### `/recent [timeframe] [project]`
Show recent activity in Basic Memory.
```
/recent
/recent 1week
/recent today specs
```
### `/organize [action] [project]`
Organize and maintain your knowledge graph.
```
/organize # Quick health check
/organize orphans # Find unlinked notes
/organize duplicates # Find similar notes
/organize relations "Note" # Suggest links for a note
/organize tags # Review tag consistency
```
Actions:
- `health` - Overview of knowledge base status (default)
- `orphans` - Find notes with no relations
- `duplicates` - Find overlapping notes
- `relations` - Suggest connections
- `tags` - Review tag consistency
### `/research <topic> [folder]`
Research a topic and save a structured report to Basic Memory.
```
/research MCP protocol
/research "database migrations"
/research "auth options" decisions
```
Produces a report with:
- Summary and key findings
- Analysis and recommendations
- Sources and related notes
- Saved to `research/` folder by default
---
## Skills
Model-invoked capabilities that Claude uses automatically based on context.
### knowledge-capture
Automatically captures insights, decisions, and learnings into structured notes.
**Triggers when:**
- Important decisions are made
- Technical insights are discovered
- Problems are solved
- Design trade-offs are discussed
### continue-conversation
Resumes previous work by building context from the knowledge graph.
**Triggers when:**
- Starting a new session
- User mentions previous work ("continue with...", "back to...")
- Need context about ongoing projects
### spec-driven-development
Guides implementation based on specifications stored in Basic Memory.
**Triggers when:**
- Implementing a feature defined by a spec
- Creating new specifications
- Reviewing implementation against criteria
### edit-note
Interactively edit notes using MCP tools in a conversational workflow.
**Triggers when:**
- User wants to edit, update, or modify a note
- User asks to change specific content in a note
- User wants to add observations or relations
**How it works:**
1. Fetches the note via MCP
2. Shows current content
3. Applies edits using `edit_note` operations (append, prepend, find_replace, replace_section)
4. Shows the updated result
**Best for:** Cloud users or when you want conversational editing.
### edit-note-local
Edit notes directly as local markdown files with automatic sync.
**Triggers when:**
- User has local Basic Memory installation
- User wants to make substantial file edits
- User prefers working with full file content
**How it works:**
1. Finds the note's file path via MCP
2. Uses Claude Code's Read/Edit/Write tools on the actual file
3. Basic Memory's `sync --watch` picks up changes automatically
**Best for:** Local users who want full file access and git integration.
### knowledge-organize
Help organize, link, and maintain the knowledge graph.
**Triggers when:**
- User wants to organize their notes
- User asks about orphan or unlinked notes
- User wants to find connections between notes
- User mentions duplicates or similar notes
- User asks for help with folder organization
**Capabilities:**
- **Find orphan notes** - Identify notes with no relations
- **Suggest relations** - Propose meaningful links between notes
- **Identify duplicates** - Find notes covering similar topics
- **Folder organization** - Review and suggest folder structure
- **Tag consistency** - Normalize and improve tagging
- **Create index notes** - Generate hub notes linking related topics
- **Enrich sparse notes** - Suggest observations and structure
**Best for:** Periodic knowledge base maintenance and improving discoverability.
### research
Research topics thoroughly and produce structured reports saved to Basic Memory.
**Triggers when:**
- User asks to research or investigate something
- User wants to understand a concept or technology
- User needs context before making a decision
- Phrases like "research", "look into", "explore", "investigate"
**What it produces:**
- Structured report with summary, findings, and analysis
- Recommendations when applicable
- Links to sources and related notes
- Saved to `research/` folder
**Best for:** Building knowledge base through investigation and documentation.
---
## Hooks
Automated behaviors that enhance the Basic Memory workflow.
### PostToolUse: write_note
Confirms when notes are saved to Basic Memory.
### Stop
After significant conversations, suggests using `/remember` to capture valuable insights (only when genuinely useful).
---
## MCP Tools Used
This plugin leverages Basic Memory's MCP tools:
| Tool | Purpose |
|------|---------|
| `write_note` | Create/update markdown notes |
| `read_note` | Read notes by title or permalink |
| `search_notes` | Full-text search across content |
| `build_context` | Navigate knowledge graph via memory:// URLs |
| `recent_activity` | Get recently updated information |
| `edit_note` | Incrementally update notes |
---
## Plugin Structure
```
claude-code-plugin/
├── .claude-plugin/
│ ├── plugin.json # Plugin manifest
│ └── marketplace.json # Self-hosted marketplace
├── commands/
│ ├── remember.md # /remember command
│ ├── continue.md # /continue command
│ ├── context.md # /context command
│ ├── recent.md # /recent command
│ ├── organize.md # /organize command
│ └── research.md # /research command
├── skills/
│ ├── knowledge-capture/
│ ├── continue-conversation/
│ ├── spec-driven-development/
│ ├── edit-note/
│ ├── edit-note-local/
│ ├── knowledge-organize/
│ └── research/
├── hooks/
│ └── hooks.json # Hook definitions
├── README.md # Quick start guide
└── PLUGIN.md # Full documentation
```
---
## Related
- [Basic Memory Documentation](https://docs.basicmemory.io)
- [Basic Memory GitHub](https://github.com/basicmachines-co/basic-memory)
- [Model Context Protocol](https://modelcontextprotocol.io)
- [Claude Code Plugins](https://code.claude.com/docs/en/plugins)
+100
View File
@@ -0,0 +1,100 @@
# Basic Memory Plugin for Claude Code
A Claude Code plugin that integrates [Basic Memory](https://basicmemory.io) - a local-first knowledge management system built on the Model Context Protocol (MCP).
## What This Plugin Does
This plugin helps Claude Code work seamlessly with your Basic Memory knowledge base:
- **Capture knowledge** from conversations automatically
- **Resume previous work** by building context from your knowledge graph
- **Edit notes** interactively through conversation
- **Organize your knowledge** by finding orphans, suggesting links, and maintaining structure
## Installation
### 1. Install Basic Memory
```bash
pip install basic-memory
# or
pipx install basic-memory
```
### 2. Add the Marketplace
```
/plugin marketplace add basicmachines-co/basic-memory/claude-code-plugin
```
### 3. Install the Plugin
```
/plugin install basic-memory@basicmachines
```
## Commands
| Command | Description |
|---------|-------------|
| `/remember [title]` | Capture insights from the current conversation |
| `/continue [topic]` | Resume previous work with context |
| `/context <memory://url>` | Build context from a specific note |
| `/recent [timeframe]` | Show recent activity |
| `/organize [action]` | Maintain your knowledge graph |
| `/research <topic>` | Research a topic and save a report |
### Examples
```bash
# Capture what we just discussed
/remember "Database Design Decision"
# Pick up where we left off
/continue postgres migration
# Check recent changes
/recent 1week
# Find orphan notes and suggest links
/organize orphans
# Research a topic and save findings
/research "MCP protocol"
```
## Skills
Skills are model-invoked - Claude uses them automatically when the context fits.
| Skill | What It Does |
|-------|--------------|
| `knowledge-capture` | Auto-captures decisions and insights into structured notes |
| `continue-conversation` | Builds context when resuming previous work |
| `spec-driven-development` | Guides implementation based on specs in Basic Memory |
| `edit-note` | Edits notes via MCP tools (cloud-compatible) |
| `edit-note-local` | Edits notes as files (local installations) |
| `knowledge-organize` | Helps organize and link notes |
| `research` | Researches topics and produces saved reports |
## Hooks
| Event | Behavior |
|-------|----------|
| `PostToolUse: write_note` | Confirms when notes are saved |
| `Stop` | Suggests capturing valuable insights after conversations |
## Requirements
- [Claude Code](https://claude.com/claude-code)
- [Basic Memory](https://basicmemory.io) with MCP server configured
## Documentation
- [Full Plugin Documentation](./PLUGIN.md)
- [Basic Memory Docs](https://docs.basicmemory.io)
- [Claude Code Plugins](https://code.claude.com/docs/en/plugins)
## License
MIT - See the [Basic Memory repository](https://github.com/basicmachines-co/basic-memory) for details.
+39
View File
@@ -0,0 +1,39 @@
---
description: Build context from a Basic Memory URL
argument-hint: <memory://url> [depth] [timeframe]
allowed-tools: mcp__basic-memory__build_context, mcp__basic-memory__read_note
---
# Context
Build context from a Basic Memory memory:// URL.
## Arguments
- `$1` - Memory URL (e.g., `memory://topic`, `memory://folder/*`, `memory://SPEC-24`)
- `$2` - Depth of relation traversal (optional, default: 2)
- `$3` - Timeframe for recent changes (optional, default: "7d")
## Your Task
Navigate the knowledge graph and build comprehensive context.
1. **Build context** using `mcp__basic-memory__build_context`:
- url: "$1"
- depth: $2 or 2
- timeframe: "$3" or "7d"
2. **Present the context**:
- Main note content
- Related notes found via relations
- Recent changes within timeframe
- Key observations and decisions
3. **Read additional notes** if needed for more detail.
## Memory URL Formats
- `memory://note-title` - Single note by title
- `memory://folder/*` - All notes in a folder
- `memory://SPEC-*` - Pattern matching
- `memory://specs/SPEC-24` - Note in specific project folder
+46
View File
@@ -0,0 +1,46 @@
---
description: Resume previous work from Basic Memory context
argument-hint: [topic]
allowed-tools: mcp__basic-memory__build_context, mcp__basic-memory__recent_activity, mcp__basic-memory__search_notes, mcp__basic-memory__read_note
---
# Continue
Resume previous work by building context from Basic Memory.
## Arguments
- `$ARGUMENTS` - Topic, note title, or search terms to find previous context
## Your Task
Build context to continue previous work seamlessly.
1. **Find relevant context**:
If a specific topic is provided ("$ARGUMENTS"):
- Search for matching notes: `mcp__basic-memory__search_notes`
- Build context from matches: `mcp__basic-memory__build_context`
- Read key notes for details: `mcp__basic-memory__read_note`
If no topic provided:
- Get recent activity: `mcp__basic-memory__recent_activity` with timeframe "3d"
- Present what's been happening
- Ask which topic to dive into
2. **Present context**:
- Summarize current state of the work
- Highlight recent changes or progress
- List open items or next steps
- Show related context from the knowledge graph
3. **Be ready to continue**:
- Understand what was done before
- Know what needs to happen next
- Have relevant context loaded
## Tips
- Use `memory://topic` URL format with `build_context`
- Check multiple projects if needed (main, specs)
- Follow relations to find connected knowledge
+87
View File
@@ -0,0 +1,87 @@
---
description: Organize and maintain your Basic Memory knowledge graph
argument-hint: [health|orphans|duplicates|relations|tags] [project]
allowed-tools: mcp__basic-memory__search_notes, mcp__basic-memory__read_note, mcp__basic-memory__list_directory, mcp__basic-memory__edit_note, mcp__basic-memory__write_note
---
# Organize
Help organize, link, and maintain your Basic Memory knowledge graph.
## Arguments
- `$1` - Action (optional): `health`, `orphans`, `duplicates`, `relations`, `tags` (default: `health`)
- `$2` - Project (optional): defaults to "main"
## Actions
### `/organize` or `/organize health`
Run a quick health check:
1. Count total notes
2. Identify orphan notes (no relations)
3. Check for potential duplicates
4. Show folder distribution
5. Report any issues found
### `/organize orphans`
Find and address orphan notes:
1. Search for notes with empty Relations sections
2. List orphans found
3. For each orphan, suggest potential relations based on content
4. Offer to add relations or create index notes
### `/organize duplicates`
Find potentially duplicate notes:
1. Search for notes with similar titles
2. Compare content for overlap
3. Suggest: merge, differentiate, or link with `supersedes`
### `/organize relations [note-title]`
Suggest relations for a specific note (or recent notes if not specified):
1. Read the target note
2. Search for related content
3. Suggest relation types:
- `relates-to` - General connection
- `extends` - Builds upon
- `implements` - Realizes concept
- `depends-on` - Requires understanding of
4. Offer to add selected relations
### `/organize tags`
Review tag consistency:
1. Gather all tags across notes
2. Find similar/duplicate tags (e.g., `arch` vs `architecture`)
3. Identify over-used or under-used tags
4. Suggest normalization
## Your Task
Execute: `/organize $ARGUMENTS`
Based on the action requested:
1. **Gather data** using search and list tools
2. **Analyze** for the specific issue (orphans, duplicates, etc.)
3. **Present findings** clearly with counts and examples
4. **Offer solutions** - ask before making changes
5. **Apply fixes** using edit_note or write_note when user approves
Always confirm before modifying notes. Show what will change and get approval.
## Examples
```
/organize # Quick health check
/organize health # Same as above
/organize orphans # Find unlinked notes
/organize duplicates # Find similar notes
/organize relations # Suggest links for recent notes
/organize relations "My Note" # Suggest links for specific note
/organize tags # Review tag consistency
/organize health specs # Health check on specs project
```
+40
View File
@@ -0,0 +1,40 @@
---
description: Show recent activity in Basic Memory
argument-hint: [timeframe] [project]
allowed-tools: mcp__basic-memory__recent_activity, mcp__basic-memory__read_note
---
# Recent
Show recent activity in Basic Memory.
## Arguments
- `$1` - Timeframe (optional): "today", "1d", "3d", "1 week", "2 weeks" (default: "3d")
- `$2` - Project (optional): "main", "specs", etc.
## Your Task
Show what's been happening in Basic Memory recently.
1. **Get recent activity** using `mcp__basic-memory__recent_activity`:
- timeframe: "$1" or "3d"
- project: "$2" or check all projects
2. **Present activity**:
- List recently modified notes
- Group by type or folder if helpful
- Highlight key changes
- Show dates of modifications
3. **Offer to dive deeper**:
- Ask if user wants to read any specific notes
- Suggest continuing work on active items
## Timeframe Examples
- `today` - Just today
- `1d` or `yesterday` - Last 24 hours
- `3d` - Last 3 days
- `1 week` - Last week
- `2 weeks` - Last 2 weeks
+43
View File
@@ -0,0 +1,43 @@
---
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
---
# Remember
Capture what we just discussed into a Basic Memory note.
## Arguments
- `$1` - Title for the note (required)
- `$2` - Folder to save in (optional, defaults to "notes")
## Your Task
Create a structured note capturing the key insights from our conversation.
1. **Analyze the conversation** for:
- Decisions made
- Insights discovered
- Problems solved
- Patterns identified
- Trade-offs discussed
2. **Structure the note** with:
- Clear title: "$1" (or generate one if not provided)
- Context section explaining the situation
- Main content with key points
- Observations using `[category]` format:
- `[decision]` - Choices made
- `[insight]` - Understanding gained
- `[pattern]` - Reusable approaches
- `[learning]` - Lessons learned
- Relations to link related concepts with `[[WikiLinks]]`
3. **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.
+140
View File
@@ -0,0 +1,140 @@
---
description: Research a topic and save a structured report to Basic Memory
argument-hint: <topic> [folder]
allowed-tools: mcp__basic-memory__write_note, mcp__basic-memory__search_notes, mcp__basic-memory__read_note, mcp__basic-memory__build_context, WebSearch, WebFetch, Grep, Glob, Read
---
# Research
Research a topic thoroughly and produce a structured report saved to Basic Memory.
## Arguments
- `$1` - Topic to research (required)
- `$2` - Folder to save report (optional, default: "research")
## Your Task
Conduct thorough research on: **$ARGUMENTS**
### 1. Check Existing Knowledge
First, see what we already know:
```python
mcp__basic-memory__search_notes(query="$1", project="main")
```
Read any relevant existing notes to avoid duplicating research.
### 2. Gather Information
Depending on the topic, use appropriate tools:
**For codebase topics:**
- Search code with Grep/Glob
- Read relevant files
- Check tests for examples
**For external topics:**
- Use WebSearch for current information
- Fetch documentation with WebFetch
- Look for official sources
**For Basic Memory context:**
- Build context from related notes
- Check for prior decisions or research
### 3. Analyze Findings
Synthesize what you learned:
- Identify key concepts
- Note patterns and trade-offs
- Form recommendations if applicable
- Flag uncertainties
### 4. Produce Report
Create a structured report with this format:
```markdown
---
title: "Research: [Topic]"
type: research
tags:
- research
- [relevant-tags]
---
# Research: [Topic]
## Summary
[2-3 sentence executive summary]
## Research Question
[What we investigated and why]
## Key Findings
### [Finding 1]
[Details and evidence]
### [Finding 2]
[Details and evidence]
### [Finding 3]
[Details and evidence]
## Analysis
[Synthesis, patterns, trade-offs, recommendations]
## Open Questions
- [Areas needing more investigation]
## Sources
- [Links to sources]
- [[Related Notes]] from Basic Memory
## Observations
- [finding] Key insight #research
- [recommendation] Suggested approach based on research
## Relations
- researches [[Topic]]
- relates-to [[Related Concepts]]
```
### 5. Save Report
```python
mcp__basic-memory__write_note(
title="Research: $1",
content="[report content]",
folder="$2" or "research",
tags=["research", ...],
project="main"
)
```
### 6. Present Summary
After saving, present:
- Key findings summary
- Main recommendation (if applicable)
- Where the report was saved
- Offer to dive deeper into any aspect
## Examples
```
/research MCP protocol
/research "database migration patterns"
/research "authentication options" decisions
/research "React vs Vue" architecture
```
+26
View File
@@ -0,0 +1,26 @@
{
"hooks": {
"PostToolUse": [
{
"matcher": "mcp__basic-memory__write_note",
"hooks": [
{
"type": "command",
"command": "echo '✓ Note saved to Basic Memory'"
}
]
}
],
"Stop": [
{
"matcher": "*",
"hooks": [
{
"type": "prompt",
"prompt": "If this conversation contained valuable insights, decisions, or learnings that should be preserved, suggest using `/remember [title]` to capture them in Basic Memory. Only suggest this if there's genuinely valuable content worth preserving - don't suggest for trivial interactions."
}
]
}
]
}
}
@@ -0,0 +1,211 @@
---
name: continue-conversation
description: Resume previous work by building context from Basic Memory knowledge graph using memory URLs and recent activity
---
# Continue Conversation
This skill helps you resume previous work by building context from the Basic Memory knowledge graph, enabling seamless continuation across sessions.
## When to Use
Use this skill when:
- Starting a new session and need to pick up where you left off
- User mentions previous work ("continue with...", "back to...", "where were we with...")
- Need context about ongoing projects or specs
- User asks about something discussed in a previous conversation
- Working on a multi-session task
## Building Context
### 1. Identify What to Continue
Ask if unclear:
- What topic or project to resume?
- What timeframe to look at?
- Any specific aspect to focus on?
### 2. Gather Context with MCP Tools
**Option A: Known Topic - Use build_context**
```python
# Navigate knowledge graph from a known starting point
mcp__basic-memory__build_context(
url="memory://topic-or-note-name",
depth=2, # How many relation hops to follow
timeframe="7d", # Recent changes
project="main" # or "specs" for specifications
)
```
Memory URL formats:
- `memory://note-title` - Single note
- `memory://folder/*` - All notes in folder
- `memory://specs/SPEC-24*` - Pattern matching
**Option B: Recent Activity - What's been happening?**
```python
# See what's changed recently
mcp__basic-memory__recent_activity(
timeframe="3d", # "1d", "1 week", "2 weeks"
depth=1,
project="main"
)
```
**Option C: Search for Context**
```python
# Find relevant notes
mcp__basic-memory__search_notes(
query="search terms",
page_size=10,
project="main"
)
```
### 3. Read Key Notes
Once you identify relevant notes:
```python
mcp__basic-memory__read_note(
identifier="note-title-or-permalink",
project="main"
)
```
### 4. Present Context to User
Summarize what you found:
- Current state of the work
- Recent changes or progress
- Open items or next steps
- Related context that might be helpful
## Context Strategies by Scenario
### Resuming a Spec Implementation
```python
# 1. Read the spec
mcp__basic-memory__read_note(
identifier="SPEC-24: Postgres Database Migration",
project="specs"
)
# 2. Check recent activity on related topics
mcp__basic-memory__build_context(
url="memory://SPEC-24*",
timeframe="7d",
project="specs"
)
# 3. Look at what's been done in the codebase
# (Use regular file tools for this)
```
### Continuing General Work
```python
# 1. Check recent activity across projects
mcp__basic-memory__recent_activity(
timeframe="3d",
project="main"
)
# 2. Read any notes from recent sessions
mcp__basic-memory__read_note(
identifier="relevant-note",
project="main"
)
```
### Following Up on a Topic
```python
# 1. Search for the topic
mcp__basic-memory__search_notes(
query="topic keywords",
project="main"
)
# 2. Build context from best match
mcp__basic-memory__build_context(
url="memory://found-note-permalink",
depth=2,
project="main"
)
```
## Timeframe Reference
Natural language timeframes:
- `"today"` - Current day
- `"yesterday"` - Previous day
- `"3d"` or `"3 days"` - Last 3 days
- `"1 week"` or `"7d"` - Last week
- `"2 weeks"` - Last 2 weeks
- `"1 month"` - Last month
## Project Reference
Common projects:
- `main` - Primary knowledge base
- `specs` - Specifications and design docs
- `basic-memory-llc` - Business/company notes
- `getting-started` - Tutorial content
List available projects:
```python
mcp__basic-memory__list_memory_projects()
```
## Example Conversations
### User: "Let's continue with the Postgres migration"
```
1. Read SPEC-24 from specs project
2. Check for related notes about implementation progress
3. Summarize:
- Spec overview and goals
- What's been completed (checkmarks)
- What's pending (checkboxes)
- Any blockers or decisions needed
```
### User: "What was I working on yesterday?"
```
1. Get recent activity for last 2 days
2. List modified notes with brief descriptions
3. Ask which topic to dive into
```
### User: "Back to the async client pattern"
```
1. Search for "async client pattern"
2. Build context from matching note
3. Include related notes via relations
4. Present the full picture
```
## Best Practices
1. **Start broad, then narrow** - Get overview first, then specific details
2. **Follow relations** - Knowledge graph connections are valuable
3. **Check multiple projects** - Specs might be separate from implementation notes
4. **Present incrementally** - Share what you find as you go
5. **Confirm understanding** - Verify the context is what user needs
6. **Update as you go** - Capture new progress in notes during the session
## Combining with Other Skills
After building context, you might:
- Use **knowledge-capture** to document new progress
- Use **spec-driven-development** if continuing a spec implementation
- Create new notes linking to the context you gathered
@@ -0,0 +1,261 @@
---
name: edit-note-local
description: Edit Basic Memory notes directly as local files - enables full file editing with automatic sync (local installations only)
---
# Edit Note Local
This skill enables direct file-based editing of Basic Memory notes. It works by editing the actual markdown files in the knowledge base, which Basic Memory's sync service automatically picks up. This provides a more seamless editing experience for local installations.
## When to Use
Use this skill when:
- User has a local Basic Memory installation (not cloud-only)
- User wants to make substantial edits to a note
- User prefers working with the full file content
- User wants changes to sync automatically via `basic-memory sync --watch`
**Note:** This skill requires local file access. For cloud-only users, use the `edit-note` skill instead.
## Editing Workflow
### 1. Find the Note's File Path
First, get the note metadata to find its file location:
```python
# Search for the note
mcp__basic-memory__search_notes(
query="note title or keywords",
project="main"
)
# Read the note to get file_path from metadata
mcp__basic-memory__read_note(
identifier="note-title",
project="main"
)
```
The response includes `file_path` which gives the relative path within the knowledge base.
### 2. Determine Full File Path
Basic Memory projects have a root directory. Common locations:
- Default: `~/basic-memory/`
- Custom: Check project configuration
Construct the full path:
```
{project_root}/{file_path}
```
For example:
- Project root: `/Users/username/basic-memory`
- File path from note: `notes/My Note.md`
- Full path: `/Users/username/basic-memory/notes/My Note.md`
### 3. Read the File
Use Claude Code's Read tool to get the full file content:
```python
Read(file_path="/Users/username/basic-memory/notes/My Note.md")
```
Display the content to the user, explaining the structure:
- Frontmatter (YAML between `---` markers)
- Main content
- Observations section
- Relations section
### 4. Edit the File
Use Claude Code's Edit tool for precise changes:
```python
Edit(
file_path="/Users/username/basic-memory/notes/My Note.md",
old_string="text to replace",
new_string="new text"
)
```
Or use Write for complete rewrites:
```python
Write(
file_path="/Users/username/basic-memory/notes/My Note.md",
content="Complete new file content..."
)
```
### 5. Sync Happens Automatically
If the user has `basic-memory sync --watch` running, changes are picked up automatically. Otherwise, they can run:
```bash
basic-memory sync
```
## File Structure Reference
Basic Memory notes follow this markdown structure:
```markdown
---
title: Note Title
type: note
permalink: note-title
tags:
- tag1
- tag2
---
# Note Title
## Context
Background and situation explanation.
## Main Content
The primary content of the note...
## Observations
- [category] Observation text #optional-tag
- [decision] A decision that was made #tag
- [insight] An insight discovered
## Relations
- relates-to [[Other Note]]
- implements [[Parent Concept]]
- learned-from [[Source Note]]
```
## Editing Patterns
### Edit Frontmatter Tags
```python
Edit(
file_path="/path/to/note.md",
old_string="tags:\n- old-tag",
new_string="tags:\n- old-tag\n- new-tag"
)
```
### Add New Section
```python
Edit(
file_path="/path/to/note.md",
old_string="## Observations",
new_string="## New Section\n\nNew content here.\n\n## Observations"
)
```
### Modify Observation
```python
Edit(
file_path="/path/to/note.md",
old_string="- [decision] Old decision",
new_string="- [decision] Updated decision with new info #updated"
)
```
### Add Relation
```python
Edit(
file_path="/path/to/note.md",
old_string="## Relations\n",
new_string="## Relations\n\n- relates-to [[New Related Note]]\n"
)
```
### Complete Rewrite
For major changes, read the file, construct new content preserving the frontmatter structure, and write:
```python
Write(
file_path="/path/to/note.md",
content="""---
title: Note Title
type: note
permalink: note-title
tags:
- updated
---
# Note Title
Completely rewritten content...
## Observations
- [rewrite] Complete rewrite of this note #major-update
## Relations
- updates [[Previous Version]]
"""
)
```
## Finding the Project Root
To find where Basic Memory stores files, you can:
1. **Check common locations:**
- `~/basic-memory/`
- `~/Documents/basic-memory/`
- Current working directory
2. **Use the list_directory tool:**
```python
mcp__basic-memory__list_directory(
dir_name="/",
project="main"
)
```
3. **Ask the user:** "Where is your Basic Memory knowledge base located?"
## Advantages of Local Editing
1. **Full file access** - Edit any part of the file including frontmatter
2. **Multi-line edits** - Make complex structural changes easily
3. **Batch operations** - Edit multiple files in sequence
4. **Version control** - Changes tracked by git if the folder is a repo
5. **Instant preview** - Use any markdown editor alongside
6. **Auto-sync** - `sync --watch` picks up changes automatically
## Best Practices
1. **Preserve frontmatter** - Don't break the YAML structure
2. **Keep valid markdown** - Maintain proper formatting
3. **Preserve permalinks** - Changing them can break links
4. **Show diffs** - Tell the user what changed
5. **Suggest sync** - Remind about `basic-memory sync` if not watching
6. **Handle missing files** - Check if file exists before editing
## Example Conversation
**User:** "I want to completely rewrite my architecture decision note"
**Claude:**
1. Searches for the note via MCP
2. Gets the file path
3. Reads the current file content
4. Asks: "Here's the current note. What would you like the new version to say?"
**User:** Provides new content
**Claude:**
1. Preserves the frontmatter (title, permalink, type)
2. Writes the new content using Write tool
3. Confirms: "Updated the file at `/path/to/note.md`. If you have sync --watch running, it's already indexed. Otherwise run `basic-memory sync`."
@@ -0,0 +1,209 @@
---
name: edit-note
description: Interactively edit Basic Memory notes using MCP tools - view, modify, and update notes in a conversational workflow (works with cloud and local)
---
# Edit Note
This skill enables interactive editing of Basic Memory notes using MCP tools. It works with both Basic Memory Cloud and local installations since it operates through the MCP interface rather than direct file access.
## When to Use
Use this skill when:
- User wants to edit an existing note
- User asks to update, change, or modify note content
- User wants to refine observations or relations in a note
- User says things like "edit my note about...", "update the...", "change X to Y in..."
## Editing Workflow
### 1. Fetch the Current Note
First, retrieve the note to show the user what exists:
```python
mcp__basic-memory__read_note(
identifier="Note Title or permalink",
project="main" # or specified project
)
```
Present the note content clearly, highlighting:
- Current title and metadata
- Main content sections
- Observations (with categories)
- Relations (with link targets)
### 2. Understand the Edit Request
Ask clarifying questions if needed:
- Which section to modify?
- What specifically to change?
- Add new content or replace existing?
### 3. Apply the Edit
Use the appropriate `edit_note` operation:
**Append** - Add content to the end:
```python
mcp__basic-memory__edit_note(
identifier="note-title",
operation="append",
content="\n\n## New Section\n\nNew content here...",
project="main"
)
```
**Prepend** - Add content to the beginning:
```python
mcp__basic-memory__edit_note(
identifier="note-title",
operation="prepend",
content="# Updated Header\n\n",
project="main"
)
```
**Find and Replace** - Replace specific text:
```python
mcp__basic-memory__edit_note(
identifier="note-title",
operation="find_replace",
find_text="old text to find",
content="new replacement text",
project="main"
)
```
**Replace Section** - Replace an entire section by heading:
```python
mcp__basic-memory__edit_note(
identifier="note-title",
operation="replace_section",
section="## Section Heading",
content="## Section Heading\n\nCompletely new section content...",
project="main"
)
```
### 4. Show the Result
After editing, fetch and display the updated note:
```python
mcp__basic-memory__read_note(
identifier="note-title",
project="main"
)
```
Highlight what changed so the user can verify.
## Edit Operations Reference
| Operation | Use Case | Required Parameters |
|-----------|----------|---------------------|
| `append` | Add to end | `content` |
| `prepend` | Add to beginning | `content` |
| `find_replace` | Change specific text | `find_text`, `content` |
| `replace_section` | Rewrite a section | `section`, `content` |
## Common Edit Patterns
### Adding a New Observation
```python
mcp__basic-memory__edit_note(
identifier="note-title",
operation="find_replace",
find_text="## Observations",
content="## Observations\n\n- [new-category] New observation here #tag",
project="main"
)
```
Or append to observations section:
```python
mcp__basic-memory__edit_note(
identifier="note-title",
operation="append",
content="\n- [insight] Additional insight discovered #tag",
project="main"
)
```
### Adding a New Relation
```python
mcp__basic-memory__edit_note(
identifier="note-title",
operation="find_replace",
find_text="## Relations",
content="## Relations\n\n- relates-to [[New Related Note]]",
project="main"
)
```
### Updating a Specific Observation
```python
mcp__basic-memory__edit_note(
identifier="note-title",
operation="find_replace",
find_text="- [decision] Old decision text",
content="- [decision] Updated decision with new context #updated",
project="main"
)
```
### Rewriting the Context Section
```python
mcp__basic-memory__edit_note(
identifier="note-title",
operation="replace_section",
section="## Context",
content="## Context\n\nCompletely rewritten context explaining the new situation...",
project="main"
)
```
## Multi-Step Editing Session
For complex edits, work iteratively:
1. **Show current state** → Read and display the note
2. **First edit** → Apply one change
3. **Show result** → Display updated note
4. **Next edit** → Apply another change if needed
5. **Confirm complete** → Final display and confirmation
This keeps the user informed and allows course correction.
## Best Practices
1. **Always show before and after** - User should see what changed
2. **One edit at a time** - For complex changes, do multiple operations
3. **Preserve structure** - Maintain the note's markdown format
4. **Be careful with find_replace** - Ensure the find_text is unique
5. **Confirm destructive changes** - Ask before replacing large sections
6. **Keep observations formatted** - Maintain `[category]` prefix format
7. **Keep relations formatted** - Maintain `- relation-type [[Target]]` format
## Example Conversation
**User:** "Edit my note about the async client pattern - add an observation about testing"
**Claude:**
1. Fetches "Async Client Pattern" note
2. Displays current content
3. Asks: "What observation about testing would you like to add?"
**User:** "That the context manager pattern makes mocking easier in tests"
**Claude:**
1. Uses `edit_note` with `append` to add:
`- [testing] Context manager pattern simplifies mocking in unit tests #testability`
2. Fetches and displays updated note
3. Confirms: "Added the testing observation. Here's the updated note..."
@@ -0,0 +1,211 @@
---
name: knowledge-capture
description: Capture insights, decisions, and learnings from conversations into structured Basic Memory notes with observations and relations
---
# Knowledge Capture
This skill helps you capture valuable information from conversations into Basic Memory's knowledge graph using structured notes with observations and relations.
## When to Use
Use this skill when:
- Important decisions are made during a conversation
- Technical insights or patterns are discovered
- Problems are solved and the solution should be preserved
- Design trade-offs are discussed
- Architecture or implementation approaches are chosen
- Learnings from debugging or investigation emerge
## Capture Process
### 1. Identify Valuable Information
Look for:
- **Decisions**: Choices made and their rationale
- **Insights**: New understanding or "aha" moments
- **Patterns**: Reusable approaches or solutions
- **Trade-offs**: Options considered and why one was chosen
- **Learnings**: What worked, what didn't, and why
- **Context**: Background that would help future understanding
### 2. Structure the Note
Use Basic Memory's knowledge format:
```markdown
---
title: Descriptive Title
type: note
tags:
- relevant
- tags
---
# Title
## Context
Brief background explaining the situation.
## Content
Main content organized logically.
## Observations
- [decision] What was decided and why #tag
- [insight] Key understanding gained #tag
- [pattern] Reusable approach identified #tag
- [learning] What we learned from this #tag
- [tradeoff] Option A chosen over B because... #tag
## Relations
- relates-to [[Related Concept]]
- implements [[Parent Spec or Design]]
- learned-from [[Source of Learning]]
```
### 3. Choose Appropriate Categories
Common observation categories:
- `[decision]` - Choices made
- `[insight]` - Understanding gained
- `[pattern]` - Reusable approaches
- `[learning]` - Lessons learned
- `[tradeoff]` - Options weighed
- `[problem]` - Issues identified
- `[solution]` - Fixes applied
- `[architecture]` - Structural decisions
- `[implementation]` - Code-level choices
- `[constraint]` - Limitations discovered
- `[requirement]` - Needs identified
### 4. Create Meaningful Relations
Link to related knowledge:
- `relates-to` - General association
- `implements` - Realizes a spec or design
- `extends` - Builds upon existing concept
- `learned-from` - Source of insight
- `enables` - Makes something possible
- `depends-on` - Requires another concept
- `solves` - Addresses a problem
## MCP Tools to Use
```python
# Write a new note
mcp__basic-memory__write_note(
title="Your Note Title",
content="Full markdown content...",
folder="appropriate/folder",
tags=["tag1", "tag2"],
project="main" # or appropriate project
)
# Search for related notes to link
mcp__basic-memory__search_notes(
query="relevant terms",
project="main"
)
# Read existing notes for context
mcp__basic-memory__read_note(
identifier="note-title-or-permalink",
project="main"
)
```
## Folder Organization
Choose appropriate folders:
- `decisions/` - Architecture and design decisions
- `learnings/` - Insights and lessons learned
- `patterns/` - Reusable approaches
- `debug-logs/` - Problem investigations
- `conversations/` - Imported conversation summaries
## Examples
### Capturing a Technical Decision
```markdown
---
title: FastAPI Async Client Pattern
type: note
tags:
- architecture
- fastapi
- async
---
# FastAPI Async Client Pattern
## Context
During implementation of MCP tools, we needed to decide how to handle HTTP client lifecycle.
## Decision
Use context manager pattern for HTTP clients instead of module-level singletons.
## Rationale
- Proper resource management
- Supports three deployment modes (local ASGI, CLI cloud, cloud app)
- Auth happens at client creation, not per-request
- Enables dependency injection for testing
## Observations
- [decision] Context manager pattern for HTTP clients enables proper resource cleanup #architecture
- [pattern] Factory pattern allows different client configurations per deployment mode #flexibility
- [tradeoff] Slightly more verbose than singleton but much more flexible #engineering
## Relations
- implements [[SPEC-16 MCP Cloud Service Consolidation]]
- enables [[Cloud App Integration]]
```
### Capturing a Debugging Insight
```markdown
---
title: SQLite WAL Mode Performance Fix
type: note
tags:
- debugging
- sqlite
- performance
---
# SQLite WAL Mode Performance Fix
## Problem
Sync operations were slow with multiple concurrent writes.
## Investigation
Found that default SQLite journaling was causing lock contention.
## Solution
Enabled WAL (Write-Ahead Logging) mode for the database connection.
## Observations
- [problem] Default SQLite journaling causes lock contention under concurrent writes #performance
- [solution] WAL mode significantly improves concurrent write performance #sqlite
- [learning] Always consider WAL mode for SQLite in applications with concurrent access #database
## Relations
- solves [[Sync Performance Issues]]
- relates-to [[SPEC-19 Sync Performance]]
```
## Best Practices
1. **Capture immediately** - Write notes while context is fresh
2. **Be specific** - Include concrete details, not vague summaries
3. **Link liberally** - More relations = better knowledge graph
4. **Use tags** - Enable discovery via search
5. **Include context** - Future you won't remember the situation
6. **Prefer facts over opinions** - Observations should be verifiable
7. **Keep notes atomic** - One concept per note when possible
@@ -0,0 +1,283 @@
---
name: knowledge-organize
description: Help organize, link, and maintain the Basic Memory knowledge graph - find orphan notes, suggest relations, identify duplicates, and improve overall knowledge structure
---
# Knowledge Organize
This skill helps users maintain a healthy, well-connected knowledge graph. As notes accumulate, it becomes valuable to periodically organize, link, and curate the knowledge base.
## When to Use
Use this skill when:
- User asks to organize their notes
- User wants to find connections between notes
- User mentions orphan or unlinked notes
- User wants to clean up or improve their knowledge base
- User asks about duplicate or similar notes
- User wants help with folder organization
- User asks to review or audit their notes
- Phrases like "help me organize", "find related notes", "what's not linked", "clean up my notes"
## Organization Capabilities
### 1. Find Orphan Notes
Identify notes that have no relations to other notes - they're isolated in the knowledge graph.
```python
# Get all notes
mcp__basic-memory__search_notes(
query="*",
page_size=50,
project="main"
)
# For each note, check if it has relations
# Orphans have empty Relations sections
```
**What to do with orphans:**
- Suggest potential relations based on content similarity
- Ask if they should be linked to existing topics
- Propose creating hub notes to connect related orphans
### 2. Suggest Relations
Analyze note content and suggest meaningful connections.
```python
# Read a note
mcp__basic-memory__read_note(
identifier="note-to-analyze",
project="main"
)
# Search for potentially related notes
mcp__basic-memory__search_notes(
query="key terms from the note",
project="main"
)
# Suggest relations based on:
# - Shared topics or concepts
# - Complementary content (problem/solution, question/answer)
# - Sequential relationship (part 1, part 2)
# - Hierarchical (parent concept, child detail)
```
**Relation types to suggest:**
- `relates-to` - General topical connection
- `extends` - Builds upon or expands
- `implements` - Realizes a concept
- `depends-on` - Requires understanding of
- `contradicts` - Presents alternative view
- `learned-from` - Source of insight
- `enables` - Makes something possible
### 3. Identify Similar/Duplicate Notes
Find notes that may cover the same topic.
```python
# Search for notes with similar titles or content
mcp__basic-memory__search_notes(
query="topic keywords",
project="main"
)
# Compare results for overlap
# Look for:
# - Similar titles
# - Overlapping observations
# - Same tags
# - Related timestamps (created around same time)
```
**Actions for duplicates:**
- Merge into a single comprehensive note
- Link them with `supersedes` or `updates` relations
- Differentiate by adding context about their distinct focus
### 4. Folder Organization Review
Analyze folder structure and suggest improvements.
```python
# List directory structure
mcp__basic-memory__list_directory(
dir_name="/",
depth=3,
project="main"
)
# Identify:
# - Overcrowded folders
# - Single-note folders
# - Inconsistent naming
# - Notes that might belong elsewhere
```
**Organization suggestions:**
- Group related notes into topic folders
- Create subfolders for large categories
- Suggest consistent naming conventions
- Move misplaced notes
### 5. Tag Consistency
Review and normalize tags across notes.
```python
# Search notes to analyze tag patterns
mcp__basic-memory__search_notes(
query="*",
page_size=100,
project="main"
)
# Look for:
# - Similar tags (architecture vs arch)
# - Unused tags
# - Over-used generic tags
# - Missing tags on relevant notes
```
**Tag improvements:**
- Suggest tag standardization (pick one variant)
- Propose new tags for common themes
- Identify notes missing obvious tags
### 6. Create Index/Hub Notes
Generate notes that serve as navigation hubs for related topics.
```python
# After identifying a cluster of related notes
mcp__basic-memory__write_note(
title="Architecture Decisions Index",
content="""---
title: Architecture Decisions Index
type: index
tags:
- architecture
- index
---
# Architecture Decisions Index
A hub linking all architecture-related decisions and patterns.
## Decisions
- [[Database Selection Decision]]
- [[API Design Patterns]]
- [[Authentication Architecture]]
## Patterns
- [[Repository Pattern]]
- [[Async Client Pattern]]
## Observations
- [index] Central hub for architecture knowledge #navigation
## Relations
- indexes [[Architecture]]
""",
folder="indexes",
project="main"
)
```
### 7. Enrich Sparse Notes
Find notes lacking observations or structure and suggest improvements.
```python
# Read a sparse note
mcp__basic-memory__read_note(
identifier="sparse-note",
project="main"
)
# If missing:
# - Observations section → suggest categories
# - Relations section → suggest links
# - Tags → suggest relevant tags
# - Context → suggest adding background
```
## Organization Workflows
### Quick Health Check
A fast overview of knowledge base status:
1. Count total notes
2. Identify orphan count
3. List recently modified
4. Check for obvious duplicates
5. Report folder distribution
### Deep Organization Session
Thorough review and improvement:
1. **Audit phase** - Catalog all notes, identify issues
2. **Orphan phase** - Address unlinked notes
3. **Relation phase** - Suggest new connections
4. **Duplicate phase** - Merge or differentiate similar notes
5. **Structure phase** - Reorganize folders if needed
6. **Index phase** - Create hub notes for major topics
### Topic-Focused Organization
Organize around a specific subject:
1. Find all notes related to topic
2. Map existing relations
3. Identify gaps in the topic graph
4. Suggest new notes to fill gaps
5. Create topic index note
## Best Practices
1. **Work incrementally** - Don't reorganize everything at once
2. **Confirm before changing** - Always ask before moving/editing notes
3. **Preserve permalinks** - Moving is okay, changing permalinks breaks links
4. **Show the graph** - Help user visualize connections
5. **Explain suggestions** - Say why a relation makes sense
6. **Respect user's system** - Enhance their organization, don't impose a new one
## Example Conversations
**User:** "Help me organize my notes"
**Claude:**
1. Runs health check on the knowledge base
2. Reports: "You have 47 notes. I found 12 orphan notes and 3 potential duplicates."
3. Asks: "Would you like to start by connecting the orphan notes, or review the duplicates first?"
**User:** "Find notes that should be linked to my API design note"
**Claude:**
1. Reads the API design note
2. Searches for related content
3. Suggests: "I found 5 notes that could relate:
- 'REST Best Practices' → relates-to
- 'Authentication Flow' → implements
- 'Rate Limiting Decision' → extends
Would you like me to add any of these relations?"
**User:** "Are there any notes about similar topics?"
**Claude:**
1. Analyzes note titles and content
2. Identifies clusters of similar notes
3. Reports: "I found these potential overlaps:
- 'Auth Flow' and 'Authentication Design' cover similar ground
- 'DB Schema v1' and 'DB Schema v2' might need a 'supersedes' relation
Would you like to review any of these?"
+213
View File
@@ -0,0 +1,213 @@
---
name: research
description: Research a topic thoroughly and produce a structured report saved to Basic Memory - investigate concepts, gather context, and document findings
---
# Research
This skill helps conduct thorough research on a topic and produces a structured report that gets saved to Basic Memory for future reference.
## When to Use
Use this skill when:
- User asks to research or investigate something
- User wants to understand a concept, technology, or approach
- User needs context gathered before making a decision
- User asks "what is...", "how does... work", "explore...", "investigate..."
- User wants findings documented for later
- Phrases like "research this", "look into", "find out about", "explore options for"
## Research Process
### 1. Understand the Research Question
Clarify what specifically to investigate:
- What is the core question or topic?
- What scope - broad overview or deep dive?
- Any specific aspects to focus on?
- What will the research inform (a decision, implementation, understanding)?
### 2. Gather Information
Use available tools to collect information:
**For codebase research:**
- Search the codebase for relevant code
- Read documentation and comments
- Trace how things connect
- Look at tests for usage examples
**For concept research:**
- Use web search for current information
- Fetch documentation from official sources
- Look for examples and best practices
- Compare alternatives if relevant
**For Basic Memory context:**
```python
# Check what we already know
mcp__basic-memory__search_notes(
query="topic keywords",
project="main"
)
# Build context from related notes
mcp__basic-memory__build_context(
url="memory://related-topic",
depth=2,
project="main"
)
```
### 3. Analyze and Synthesize
Organize findings into coherent insights:
- Identify key concepts and how they relate
- Note patterns, trade-offs, and considerations
- Highlight what's most relevant to the user's needs
- Flag uncertainties or areas needing more investigation
### 4. Produce the Report
Create a structured research report:
```markdown
---
title: "Research: [Topic]"
type: research
tags:
- research
- [topic-tags]
---
# Research: [Topic]
## Summary
[2-3 sentence executive summary of findings]
## Research Question
[What we set out to understand]
## Key Findings
### [Finding 1]
[Details, evidence, implications]
### [Finding 2]
[Details, evidence, implications]
### [Finding 3]
[Details, evidence, implications]
## Analysis
[Synthesis of findings - patterns, trade-offs, recommendations]
## Open Questions
- [Things that need more investigation]
- [Uncertainties or assumptions]
## Sources
- [Where information came from]
- [[Related Note]] - relevant prior knowledge
## Observations
- [finding] Key insight discovered #research
- [pattern] Pattern identified during research
- [recommendation] Suggested approach based on findings
## Relations
- researches [[Topic]]
- informs [[Decision or Implementation]]
- relates-to [[Related Concepts]]
```
### 5. Save to Basic Memory
```python
mcp__basic-memory__write_note(
title="Research: [Topic]",
content="[Full report content]",
folder="research",
tags=["research", "topic-tags"],
project="main"
)
```
## Report Styles
Adjust based on the research type:
### Quick Investigation
- Focused summary
- 2-3 key findings
- Direct recommendation
- Saved to `research/` folder
### Deep Dive
- Comprehensive analysis
- Multiple sections
- Detailed evidence
- Comparison of options
- Saved to `research/` folder
### Decision Support
- Options evaluated
- Pros/cons for each
- Clear recommendation with rationale
- Saved to `decisions/` or `research/` folder
### Technical Exploration
- How it works
- Architecture/design
- Code examples
- Integration considerations
- Saved to `research/` folder
## Best Practices
1. **Start with what we know** - Check Basic Memory for existing context
2. **Be thorough but focused** - Cover the topic well without tangents
3. **Cite sources** - Link to where information came from
4. **Be honest about uncertainty** - Flag what's unclear or needs verification
5. **Make it actionable** - Include recommendations when appropriate
6. **Link to related knowledge** - Connect to existing notes
7. **Save for future reference** - Always save the report to Basic Memory
## Example Conversations
**User:** "Research how other projects handle database migrations"
**Claude:**
1. Searches codebase for migration patterns
2. Checks Basic Memory for related decisions
3. Looks up best practices online
4. Produces report comparing approaches
5. Saves to `research/Database Migration Approaches.md`
6. Presents summary with recommendation
**User:** "Investigate the MCP protocol"
**Claude:**
1. Fetches MCP documentation
2. Searches for examples in codebase
3. Checks Basic Memory for prior context
4. Produces comprehensive report on MCP
5. Saves to `research/MCP Protocol Overview.md`
6. Presents key concepts and how to use them
**User:** "Look into authentication options for the API"
**Claude:**
1. Researches common auth patterns (JWT, OAuth, API keys)
2. Checks existing codebase auth implementation
3. Evaluates trade-offs for the use case
4. Produces decision-support report
5. Saves to `research/API Authentication Options.md`
6. Recommends approach with rationale
@@ -0,0 +1,292 @@
---
name: spec-driven-development
description: Guide implementation based on specs stored in Basic Memory, following the SPEC-1 specification-driven development process
---
# Spec-Driven Development
This skill guides implementation work based on specifications stored in the Basic Memory "specs" project, following the process defined in SPEC-1.
## When to Use
Use this skill when:
- Implementing a feature defined by a spec
- Creating a new specification before implementation
- Reviewing implementation against spec criteria
- Need to understand what a spec requires
- Updating spec progress as work completes
## The Spec-Driven Process
From SPEC-1, the workflow is:
1. **Create** - Write spec as complete thought in Basic Memory "specs" project
2. **Discuss** - Iterate and refine the specification
3. **Implement** - Execute implementation directly
4. **Validate** - Review implementation against spec criteria
5. **Document** - Update spec with learnings and decisions
## Spec Structure
Every spec contains:
- **Why** - The reasoning and problem being solved
- **What** - What is affected or changed
- **How** - High-level approach to implementation
- **How to Evaluate** - Testing/validation procedure
### Progress Tracking Format
Specs use living documentation with checklists:
```markdown
### Feature Area
- ✅ Basic functionality implemented
- ✅ Props and events defined
- [ ] Add sorting controls
- [ ] Improve accessibility
- [x] Currently implementing responsive design
```
- `✅` - Completed items
- `[ ]` - Pending items
- `[x]` - In-progress items
## Working with Specs
### Reading a Spec
```python
# Get the full spec
mcp__basic-memory__read_note(
identifier="SPEC-24: Postgres Database Migration",
project="specs"
)
# Or search for it
mcp__basic-memory__search_notes(
query="postgres migration",
project="specs"
)
```
### Creating a New Spec
```python
# 1. First, find the next spec number
mcp__basic-memory__search_notes(
query="SPEC-",
project="specs"
)
# 2. Create the spec with proper structure
mcp__basic-memory__write_note(
title="SPEC-30: Your Feature Name",
content="""---
title: 'SPEC-30: Your Feature Name'
type: spec
tags:
- feature-area
- component
---
# SPEC-30: Your Feature Name
## Why
[Problem statement and motivation]
## What
[What is affected or changed]
- Affected areas
- Components involved
- Scope boundaries
## How (High Level)
[Implementation approach]
### Phase 1: Foundation
- [ ] Task 1
- [ ] Task 2
### Phase 2: Core Features
- [ ] Task 3
- [ ] Task 4
## How to Evaluate
### Success Criteria
- [ ] Criterion 1
- [ ] Criterion 2
### Testing Procedure
1. Step 1
2. Step 2
## Observations
- [goal] Primary objective #tag
- [constraint] Known limitation #tag
## Relations
- relates-to [[Related Spec]]
- depends-on [[Dependency]]
""",
folder="", # Root of specs project
project="specs"
)
```
### Updating Spec Progress
```python
# Mark items complete as you implement
mcp__basic-memory__edit_note(
identifier="SPEC-24: Postgres Database Migration",
operation="find_replace",
find_text="- [ ] Create migration scripts",
content="- ✅ Create migration scripts",
project="specs"
)
# Or add new observations
mcp__basic-memory__edit_note(
identifier="SPEC-24: Postgres Database Migration",
operation="append",
content="\n- [learning] Alembic autogenerate works well for model changes #migration",
project="specs"
)
```
### Reviewing Implementation
When reviewing against a spec:
1. **Read the spec's "How to Evaluate" section**
2. **Check each success criterion:**
- Functional completeness
- Test coverage (count test files, check categories)
- Code quality (TypeScript, linting, performance)
- Architecture compliance
- Documentation completeness
3. **Be honest** - Don't overstate completeness
4. **Document findings** - Update spec with review results
5. **Identify gaps** - Clearly note what still needs work
## Implementation Workflow
### Starting Implementation
1. **Read the spec thoroughly**
```python
mcp__basic-memory__read_note(
identifier="SPEC-XX: Feature Name",
project="specs"
)
```
2. **Understand dependencies**
- Check Relations section for dependencies
- Read related specs if needed
3. **Plan your approach**
- Break "How" section into concrete tasks
- Identify what to implement first
4. **Mark first item in-progress**
```python
mcp__basic-memory__edit_note(
identifier="SPEC-XX",
operation="find_replace",
find_text="- [ ] First task",
content="- [x] First task",
project="specs"
)
```
### During Implementation
1. **Update progress as you complete items**
2. **Add observations for decisions made**
3. **Note any deviations from the spec**
4. **Capture learnings that might help future specs**
### After Implementation
1. **Run full evaluation against criteria**
2. **Mark all completed items with ✅**
3. **Add final observations**
4. **Document any follow-up work needed**
## Spec Naming Convention
Format: `SPEC-X: Descriptive Title`
Examples:
- `SPEC-24: Postgres Database Migration`
- `SPEC-25: Cloud Index Service`
- `SPEC-26: Multi-User Security and Permissions`
## Common Spec Patterns
### Feature Spec
```markdown
## Why
User need or problem
## What
- New UI components
- API endpoints
- Database changes
## How
Implementation phases with checkboxes
```
### Architecture Spec
```markdown
## Why
Technical debt or scalability need
## What
- System components affected
- Data flow changes
- Integration points
## How
Migration strategy with rollback plan
```
### Process Spec
```markdown
## Why
Workflow improvement need
## What
- Process steps changed
- Tools involved
- Team impact
## How
Rollout plan and adoption strategy
```
## Best Practices
1. **Spec first, code second** - Write spec before implementation
2. **Keep specs living** - Update as understanding evolves
3. **Be specific in criteria** - Vague criteria = vague completion
4. **Link related specs** - Build the knowledge graph
5. **Capture decisions** - Future you will thank you
6. **Review honestly** - Incomplete is okay, dishonest isn't
7. **Close the loop** - Mark items done as you complete them
## Using with Slash Commands
The `/spec` command provides quick access:
- `/spec create [name]` - Create new specification
- `/spec status` - Show all spec statuses
- `/spec show [name]` - Read a specific spec
- `/spec review [name]` - Validate implementation