feat(context): add context-maintainer and context-search skills#59
Open
divitkashyap wants to merge 3 commits intoMiniMax-AI:mainfrom
Open
feat(context): add context-maintainer and context-search skills#59divitkashyap wants to merge 3 commits intoMiniMax-AI:mainfrom
divitkashyap wants to merge 3 commits intoMiniMax-AI:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Submitted by: divitkashyap
What
Added
context-maintainerandcontext-search— a two-part skill + MCP tool system for persistent project context across AI agent sessions.Why this matters: Every new chat session starts with zero memory. The agent wastes time re-scanning repos, burning through context on file walks instead of actual work. Context files persist across sessions so agents jump-start instantly.
Components
Skill:
context-maintainer— instructs the agent when and how to write contextSkill:
context-search— instructs the agent when and how to read contextMCP server:
context-maintainer-mcp— file operations for context maintenance (8 tools)MCP server:
context-search-mcp— search + export for context retrieval (6 tools)File Structure Created
.context/
├── project.md # What it does, how to run
├── architecture.md # System design, data flow
├── decisions.md # Choices made and why
├── active-files.md # Files being worked on + freshness + git history
├── stale-files.md # Deprecated approaches (flagged)
├── goals.md # Long term + short term goals + session history
├── relationships.md # Key dependencies
└── recent-commits.md # Last 10 commits (cheap git log)
Key Ideas
1. Context That Survives Sessions
Context files are written to
.context/in the project root. New sessions read them — no re-scanning.2. Token-Efficient Context
Agents don't load full context files into every response. Pattern:
get_active_context→ returns previews (not full contents)search_context→ targeted lookupsgoals.md→ always read first, always kept short (YAML frontmatter, max ~50 lines)3. Freshness Scoring
active-files.mdtracks:Agents prioritize HIGH freshness files — less wasted context on stale code.
4. Stale Tracking
Deprecated approaches get flagged (not deleted) in
stale-files.md. Prevents repeating old mistakes without losing history.5. Dynamic Goals — Long-term vs Short-term
goals.mdformat:When context window is ~70% full, agent checkpoints → context clears, next session resumes instantly.
6. Git History Without Burn
active-files.mdincludes per-file git history (last commit, last modified). The agent knows what's changed without running git commands every prompt. Git history calls are <50ms — cheap.7. Trigger Strategy — Significant Changes Only
Never update after every edit. Updates fire when:
git commit(meaningful work done)8.
.context/Gitignored by DefaultPersonal context stays private. User opts in to commit with
gitignore_remove. Team sharing is a choice, not a default.9. Optional QMD Integration
On first
search_contextcall, tool checks if QMD is available:qmd embed→ enables hybrid semantic search10. Obsidian Export
export_to_vault(context_path, vault_path)— one-way sync to Obsidian vault. User gets graph view of relationships — optional, not required.MCP Tools
context-maintainer:
init_context,update_context,checkpoint_goals,flag_stale,promote_stale,gitignore_add,gitignore_remove,gitignore_statuscontext-search:
search_context,get_active_context,get_file_context,export_to_vault,prune_context,check_qmdInstallation
MCP servers (for local testing before PyPI publish):
After PyPI publish:
OpenCode config (~/.config/opencode/opencode.json):
Testing
Validated: python .claude/skills/pr-review/scripts/validate_skills.py ✅ All 14 skills pass.
Notes