A complete example OpenClaw skill that demonstrates aimemo integration for persistent memory across sessions.
Reviews GitHub Pull Requests and learns your code style preferences over time:
- 🧠 Remembers your naming conventions, formatting rules, and patterns
- 📝 Stores new discoveries from each review session
- 🔄 Improves with every PR reviewed
- 🎯 Applies learned preferences consistently
-
aimemo installed (v0.4.0+):
# Linux/macOS curl -sSL https://raw.githubusercontent.com/MyAgentHubs/aimemo/main/install.sh | bash # Or macOS Homebrew brew install MyAgentHubs/tap/aimemo
-
aimemo MCP server registered with OpenClaw:
claude mcp add-json aimemo-memory '{"command":"aimemo","args":["serve"]}' -
Workspace memory initialized:
cd ~/.openclaw/workspace aimemo init
-
GitHub token (for API access):
export GITHUB_TOKEN="ghp_your_token_here"
# Copy this skill to your OpenClaw workspace
cp -r examples/openclaw-github-pr-reviewer \
~/.openclaw/workspace/skills/# Symlink for easier updates
ln -s $(pwd)/examples/openclaw-github-pr-reviewer \
~/.openclaw/workspace/skills/github-pr-reviewer-aimemoclaude skill install github-pr-reviewer-aimemoYou: "Review PR #123 from my project"
Skill:
- Asks about your basic preferences:
- "Do you prefer snake_case or camelCase?"
- "How do you handle errors?"
- "What's your indentation style?"
- Reviews the PR
- Stores your answers for future reviews
You: "Review PR #456"
Skill:
- Automatically loads learned preferences
- Reviews PR using your established rules
- Flags issues based on your standards
- Stores any new patterns discovered
You: "Actually, I'm fine with trailing commas in arrays"
Skill:
- Updates preference in memory
- Acknowledges: "Got it, I'll remember that"
- Applies corrected rule in future reviews
You: Review https://github.com/myorg/myproject/pull/789
Skill: [Loads memory: "User prefers snake_case, explicit error types, 4-space indent"]
Skill: I've reviewed PR #789. Here's my feedback:
## Summary
Request changes - found 3 style issues
## Key Issues
1. Function `getUserData` should be `get_user_data` (snake_case preference)
2. Error on line 45 should have explicit type (AppError expected)
3. Indentation inconsistent (mix of 2 and 4 spaces)
## Suggestions
- Consider adding tests for the new validation logic
- The error message on line 67 could be more descriptive
## Positive Notes
- Good use of early returns
- Clear variable names
- Well-documented function
[Stores: "User wants consistent 4-space indent", "Validation logic needs tests"]
You: Great! Also, for future reviews, I want you to always check if the changelog was updated.
Skill: Understood! I've added "Verify CHANGELOG.md updated" to my review checklist. I'll check this in all future PR reviews.
[Stores: "Must verify CHANGELOG.md updated" in review-checklist]
- Naming conventions (snake_case, camelCase, PascalCase)
- Indentation (spaces/tabs, 2/4 spaces)
- Formatting (trailing commas, semicolons, line breaks)
- Error handling approaches
- File organization patterns
- Testing standards
- Documentation requirements
- Specific issues user wants avoided
- Project-specific no-nos
- Security concerns
- When you correct the skill's feedback
- Clarifications on preferences
- Exception cases
- Tech stack info
- Team conventions
- Domain-specific rules
All data is stored in:
~/.openclaw/workspace/.aimemo/memory-github-pr-reviewer-aimemo.db
Entities:
code-style-preferences: Naming, formatting ruleserror-handling-patterns: How to handle errorscommon-mistakes: Things to always flaguser-corrections: Feedback from userproject-context: Project-specific inforeview-checklist: Things to always check
Journal entries: Session summaries showing learning progress
aimemo list --context github-pr-reviewer-aimemoaimemo search "error handling" --context github-pr-reviewer-aimemoaimemo get code-style-preferences --context github-pr-reviewer-aimemoaimemo export --context github-pr-reviewer-aimemo --format json > memory.jsonaimemo search --journal --since 7d --context github-pr-reviewer-aimemoEdit the instructions to:
- Add language-specific rules (Python, Go, TypeScript, etc.)
- Include framework-specific checks (React, Django, etc.)
- Add CI/CD integration checks
- Customize review format
In SKILL.md instructions:
Store security-specific rules:
memory_store({
context: "github-pr-reviewer-aimemo",
entities: [{
name: "security-rules",
entityType: "security", // Custom type
observations: ["Never commit .env files"],
tags: ["security", "critical"]
}]
})Check if database exists:
ls -lh ~/.openclaw/workspace/.aimemo/memory-github-pr-reviewer-aimemo.dbVerify context parameter in SKILL.md (must be exact):
{context: "github-pr-reviewer-aimemo"}Ensure memory_store is called:
- Check OpenClaw logs for successful store operations
- Verify database is writable:
touch ~/.openclaw/workspace/.aimemo/test && rm ~/.openclaw/workspace/.aimemo/test
Update incorrect preference:
# Via CLI
aimemo observe code-style-preferences "CORRECTION: Use camelCase not snake_case" \
--context github-pr-reviewer-aimemo
# Or let skill overwrite in next sessionRecover (rare):
cd ~/.openclaw/workspace/.aimemo
sqlite3 memory-github-pr-reviewer-aimemo.db ".recover" | \
sqlite3 memory-recovered.db
mv memory-github-pr-reviewer-aimemo.db memory-backup.db
mv memory-recovered.db memory-github-pr-reviewer-aimemo.dbStart fresh:
rm ~/.openclaw/workspace/.aimemo/memory-github-pr-reviewer-aimemo.db
# Skill will auto-create on next useUse different skill instances per project:
# Install multiple times with different names
cp SKILL.md ~/.openclaw/workspace/skills/pr-reviewer-project-a/SKILL.md
cp SKILL.md ~/.openclaw/workspace/skills/pr-reviewer-project-b/SKILL.md
# Each gets isolated memory:
# memory-pr-reviewer-project-a.db
# memory-pr-reviewer-project-b.dbExport and share baseline preferences:
# Export your preferences
aimemo export --context github-pr-reviewer-aimemo --format json > team-standards.json
# Team member imports
aimemo import team-standards.json --context github-pr-reviewer-aimemoCheck what skill has learned:
# Weekly review
aimemo list --context github-pr-reviewer-aimemo | less
# See recent changes
aimemo search --journal --since 7d --context github-pr-reviewer-aimemocode-style-preferences:
- Prefer snake_case for variables
- 4-space indentation
code-style-preferences:
- Prefer snake_case for variables
- 4-space indentation
- No trailing commas in objects
- PascalCase for classes
error-handling-patterns:
- Always use explicit error types (AppError)
- Wrap third-party errors with context
code-style-preferences: 12 observations
error-handling-patterns: 8 observations
common-mistakes: 15 observations
review-checklist: 7 items
project-context: 10 observations
Journal entries: 20 sessions documented
The skill becomes increasingly valuable as its knowledge base grows.
Found an improvement? Submit a PR to: https://github.com/MyAgentHubs/aimemo
Ideas for enhancements:
- Language-specific templates
- Integration with linters (ESLint, Pylint, etc.)
- Auto-formatting suggestions
- Security scanning integration
- Performance analysis
MIT - See LICENSE