SCM (Smart Context Manager)
SCM is a context management tool that helps LLMs maintain relevant context across conversations. It’s used throughout angzarr to provide AI assistants with project-specific knowledge.
What SCM Does
Section titled “What SCM Does”- Context fragments — Reusable pieces of context (patterns, conventions, architecture)
- Profiles — Named collections of fragments for different tasks
- Dynamic assembly — Combine fragments based on tags or explicit selection
- CLAUDE.md integration — Automatically injects context into project instructions
Directory Structure
Section titled “Directory Structure”.scm/├── context.md # Main assembled context (auto-generated)├── fragments/ # Reusable context pieces│ ├── rust-dev.md│ ├── git-practices.md│ ├── testing.md│ └── ...└── profiles/ # Named fragment collections ├── default.yaml └── review.yamlCLAUDE.md Integration
Section titled “CLAUDE.md Integration”The project’s CLAUDE.md includes an SCM marker:
{/* SCM:BEGIN */}@.scm/context.md{/* SCM:END */}SCM replaces this section with assembled context. The @ syntax includes the referenced file’s contents.
Fragments
Section titled “Fragments”Fragments are markdown files containing focused context:
## Tooling- Version: Cargo.toml- Tests: `#[cfg(test)]`, cucumber-rs (Gherkin)- Quality: clippy, rustfmt, cargo-audit
## Error Handling- Use `Result<T, E>` + `?` operator- NO `unwrap()`/`expect()` in library codeFragment Tags
Section titled “Fragment Tags”Fragments can be tagged for selective inclusion:
---tags: [rust, development, testing]---
# Rust Development...Profiles
Section titled “Profiles”Profiles define which fragments to include:
fragments: - rust-dev - git-practices - testing - architecture
# profiles/review.yamlfragments: - code-review - testing - securityAssemble Context
Section titled “Assemble Context”# Assemble default profilescm assemble
# Assemble specific profilescm assemble --profile review
# Assemble by tagsscm assemble --tags rust,testingList Fragments
Section titled “List Fragments”scm list-fragmentsscm list-fragments --tags securityList Profiles
Section titled “List Profiles”scm list-profilesMCP Integration
Section titled “MCP Integration”SCM provides an MCP server for AI tool access:
{ "mcpServers": { "scm": { "command": "scm", "args": ["mcp"] } }}This exposes tools like:
list_fragments— Browse available fragmentsget_fragment— Read a specific fragmentassemble_context— Build context from profile/tags
Best Practices
Section titled “Best Practices”- Keep fragments focused — One topic per fragment
- Use tags consistently — Enable flexible assembly
- Update regularly — Context should reflect current practices
- Profile for tasks — Different tasks need different context
Next Steps
Section titled “Next Steps”- Claude Code — AI assistant integration
- Getting Started — Project setup