Shared Context Collections

Share coding standards, best practices, and prompt templates across your team. Ensure consistent LLM responses that follow your organization's guidelines.

Team+ Feature

Shared Context Collections are available on Team and Enterprise plans.

What Are Shared Context Collections?

Shared Context Collections are reusable documentation packages that can be linked to multiple projects. When your LLM queries Snipara, it automatically receives your team's coding standards alongside project-specific documentation.

┌─────────────────────────────────────────────────────────────┐
│  HOW SHARED CONTEXT WORKS                                   │
│                                                             │
│  Query: "How should I handle errors?"                       │
│                    ↓                                        │
│  1. Load Shared Context (30% of token budget)               │
│     → MANDATORY rules from team standards                   │
│     → BEST_PRACTICES patterns                               │
│     → GUIDELINES suggestions                                │
│                    ↓                                        │
│  2. Query Project Docs (remaining 70% of budget)            │
│     → Project-specific documentation                        │
│     → Search by query relevance                             │
│                    ↓                                        │
│  3. Return Combined Context                                 │
│     → Shared context FIRST, then project docs               │
│     → LLM follows team standards automatically              │
└─────────────────────────────────────────────────────────────┘

Collection Scopes

Collections can be scoped to different visibility levels:

🌍

GLOBAL

Public templates anyone can use or fork. Great for sharing open-source best practices.

👥

TEAM

Shared within your team. Perfect for organization-wide coding standards and guidelines.

👤

USER

Personal collections across your projects. Your own coding preferences and patterns.

Document Categories

Documents within a collection are categorized by importance. The category determines token budget allocation and priority:

CategoryBudget %PriorityDescription
MANDATORY40%HighestRules that MUST be followed. Always included first.
BEST_PRACTICES30%HighRecommended patterns and conventions.
GUIDELINES20%MediumNice-to-have suggestions and tips.
REFERENCE10%LowBackground info, examples, and supplementary material.
MANDATORY content is always included, even if it exceeds its allocated budget. Other categories are trimmed if needed to stay within the total token limit.

Token Budget Allocation

When querying with shared context, tokens are allocated by category priority:

Example: 4,000 token budget with shared context

Shared Context Budget (30% = 1,200 tokens):
├── MANDATORY:       480 tokens (40% of shared)
├── BEST_PRACTICES:  360 tokens (30% of shared)
├── GUIDELINES:      240 tokens (20% of shared)
└── REFERENCE:       120 tokens (10% of shared)

Project Docs Budget (70% = 2,800 tokens):
└── Ranked by relevance to query

Priority Order:
1. Collection priority (lower number = higher priority)
2. Category priority (MANDATORY > BEST_PRACTICES > ...)
3. Document priority within category

MCP Tools

Five MCP tools are available for working with shared context:

Team+

rlm_shared_context

Get merged context from all linked shared collections. Automatically respects category priorities and token budgets.

rlm_shared_context({
  query: "How should I handle errors?",
  max_tokens: 4000,
  categories: ["MANDATORY", "BEST_PRACTICES"]
})
Team+

rlm_list_templates

List available prompt templates from your linked collections. Filter by category to find the right template.

rlm_list_templates({
  category: "refactoring"
})
→ [{ slug: "extract-method", name: "Extract Method" }, ...]
Team+

rlm_get_template

Get a specific prompt template by slug. Templates can include variables that you fill in when using them.

rlm_get_template({
  template_slug: "security-review"
})
→ { prompt: "Review {{file_path}} for security issues...", variables: ["file_path"] }
Free+

rlm_list_collections

List all shared context collections accessible to you. Use this to discover collection IDs for uploading documents.

rlm_list_collections()
→ { collections: [{ id: "col_abc123", name: "Team Standards", access_type: "team_member" }], count: 1 }
Team+

rlm_upload_shared_document

Upload or update a document in a shared collection. Perfect for maintaining best practices programmatically through your AI workflows.

rlm_upload_shared_document({
  collection_id: "col_abc123",
  title: "Error Handling Standards",
  content: "# Error Handling\n\nAll errors must...",
  category: "BEST_PRACTICES"
})
→ { success: true, action: "created" }

Creating Collections

You can create and manage collections from the Snipara dashboard:

  1. Navigate to your team settings and select Shared Context
  2. Click Create Collection and choose a scope (GLOBAL, TEAM, or USER)
  3. Add documents with appropriate categories (MANDATORY, BEST_PRACTICES, etc.)
  4. Optionally add prompt templates for common tasks
  5. Link the collection to projects that should use it

Linking Collections to Projects

When linking a collection to a project, you can customize:

  • Priority: Order in the inheritance chain (lower = higher priority)
  • Token Budget %: Override default allocation percentage
  • Enabled Categories: Filter to specific categories only
  • Enabled/Disabled: Toggle collections on or off
Project: my-api
├── Collection: team-coding-standards (priority: 1)
│   ├── MANDATORY: Error handling rules
│   └── BEST_PRACTICES: API design patterns
├── Collection: security-guidelines (priority: 2)
│   ├── MANDATORY: Security requirements
│   └── GUIDELINES: Security tips
└── Project-specific docs (remaining budget)

Best Practices Discovery

Snipara can automatically discover common patterns across projects linked to a collection:

Pattern Detection

Scans linked projects to identify common file patterns, structures, and conventions. Calculates adoption rate across projects.

AI Suggestions

Claude AI generates documentation for discovered patterns, filling gaps in your team's best practices.

Discovered patterns appear in your collection where you can accept, reject, or modify them before they become official documentation.

Plan Availability

FeatureFreePro ($19/mo)Team ($49/mo)Enterprise
Number of Collections15UnlimitedUnlimited
Projects per Collection25UnlimitedUnlimited
Discovery Runs/Month1520Unlimited
rlm_shared_context--
rlm_list_templates--
rlm_get_template--
rlm_list_collections
rlm_upload_shared_document--

Example: Team Coding Standards

Here's an example of setting up a team-wide coding standards collection:

# Create the collection
Collection: team-coding-standards
Scope: TEAM
# Add MANDATORY documents
- error-handling.md (MANDATORY)
  "All errors must be logged with context..."
# Add BEST_PRACTICES documents
- api-design.md (BEST_PRACTICES)
  "Use RESTful conventions..."
# Link to projects
Project: api-service → team-coding-standards (priority: 1)
Project: web-app → team-coding-standards (priority: 1)
# Now all queries include team standards automatically!

Next Steps