Skip to content

A repository of master context templates in Markdown, designed to be transformed into specific rule formats for various LLMs like Cursor and Claude.

License

Notifications You must be signed in to change notification settings

practical-stack/context-hub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Context Hub

A standardized schema and repository for storing contextual knowledge across multiple topic domains, with intelligent selection patterns.

Purpose

Context Hub proposes and demonstrates a universal approach to organizing contextual knowledge in a structured, topic-agnostic format. The goal is to establish consistent metadata schemas and intelligent selection patterns that can be applied across any domain - from prompt engineering to React development to data analysis.

Core Concept

Schema-First Approach

  • Universal Metadata: Consistent frontmatter structure that works for any topic
  • Rich Semantic Context: Detailed descriptions enabling intelligent context discovery
  • Relationship Mapping: Explicit connections between related concepts
  • Intelligent Selection: Logical patterns for choosing and combining contexts

Topic-Agnostic Structure

context-hub/
├── docs/standards/                     # Universal schema and standards
│   ├── context-metadata-schema.md     # Core metadata structure
│   └── file-naming-conventions.md     # Naming standards
├── contexts/
│   ├── prompt-engineering/            # Domain 1: LLM techniques ✅
│   │   ├── 00-context-selector.md     # Intelligent selection logic
│   │   ├── 00-context-selector-patterns.md  # Common selection patterns
│   │   ├── 00-context-selector-troubleshooting.md  # Issue resolution
│   │   └── [context-modules].md       # Individual technique contexts
│   ├── react/                         # Domain 2: React development (planned)
│   ├── data-analysis/                 # Domain 3: Data analysis (planned)
│   └── [any-topic]/                   # Domain N: Any topic area

Universal Schema Design

Standardized Metadata Structure

---
id: "unique-identifier"
title: "Human-Readable Name"
description: "Brief explanation"
category: "domain-specific-category"
tags: ["searchable", "keywords"]

contextual_header: |
  Rich semantic description explaining what this context provides,
  in which domain it applies, what problems it addresses, when it's
  most effective, what it works well with, and what outcomes it produces.

embedding_metadata:
  domain: "topic-area"
  technique_type: "categorization-within-domain"
  complexity_level: "beginner|intermediate|advanced"
  primary_use_cases: ["specific-scenarios"]
  solves_problems: ["specific-issues"]
  works_well_with: ["related-context-ids"]
  requires_techniques: ["prerequisite-context-ids"]
  conflicts_with: ["incompatible-context-ids"]
---

Intelligent Selection Patterns

The schema enables logical context selection through:

Relationship-Based Selection:

# Automatic dependency resolution
chain-of-thought:
  requires_techniques: ["prompt-engineering-best-practices"]
  works_well_with: ["xml-tags-structure", "multishot-examples"]

# Conflict prevention
rapid-response-optimization:
  conflicts_with: ["chain-of-thought", "extended-thinking"]

Problem-Solution Matching:

# Direct problem targeting
User Problem: "AI responses are inconsistent"
→ Search: solves_problems containing "inconsistent"
→ Found: output-consistency, template-based-prompting
→ Recommend: [output-consistency, prefilling-responses, template-based-prompting]

Pattern-Based Selection:

# Common selection patterns
Speed-First: [prompt-engineering-best-practices, clear-direct-prompting]
Accuracy-First: [reduce-hallucinations, chain-of-thought, multishot-examples]
Production-First: [template-based-prompting, output-consistency, prefilling-responses]
Creative-First: [system-prompts-roles, clear-direct-prompting, character-consistency]

Demonstrated Implementation

Domain 1: Prompt Engineering ✅ Complete

Schema Applied to 15+ Contexts:

  • prompt-engineering-best-practices (foundational)
  • chain-of-thought (reasoning)
  • xml-tags-structure (structured)
  • output-consistency (consistency)
  • system-prompts-roles (creative)
  • [and more...]

Intelligent Selection System:

  • Core Selector: Diagnostic questions and selection matrices
  • Pattern Library: Common combinations for typical scenarios
  • Troubleshooting Guide: Logical approaches for resolving issues

Relationship Mapping:

  • Dependencies: chain-of-thought requires prompt-engineering-best-practices
  • Synergies: xml-tags-structure + chain-of-thought + multishot-examples
  • Conflicts: Creative techniques vs. rigid consistency controls

Domain 2: React (Planned)

Potential contexts following the same schema:

  • react-component-basics (foundational)
  • state-management-hooks (state)
  • performance-optimization (optimization)
  • component-composition (structured)

Domain 3: Data Analysis (Planned)

Following the same organizational principles:

  • data-cleaning-fundamentals (foundational)
  • statistical-analysis-methods (analysis)
  • visualization-best-practices (presentation)
  • exploratory-data-analysis (discovery)

Selection Intelligence Examples

Scenario-Based Selection

Customer Support Bot:

Requirements: Consistent, helpful, brand-appropriate responses
Selection Logic:
1. Base: prompt-engineering-best-practices (always required)
2. Persona: system-prompts-roles (customer service character)
3. Structure: template-based-prompting (consistent responses)
4. Consistency: character-consistency (maintain brand voice)

Research Analysis Tool:

Requirements: Accurate, step-by-step analysis with transparency
Selection Logic:
1. Base: prompt-engineering-best-practices
2. Reasoning: chain-of-thought (transparent thinking)
3. Accuracy: reduce-hallucinations (minimize errors)
4. Structure: xml-tags-structure (organized output)

API Data Extraction:

Requirements: Reliable JSON output for automated processing
Selection Logic:
1. Base: prompt-engineering-best-practices
2. Format: prefilling-responses (guaranteed JSON)
3. Reliability: output-consistency (stable formatting)
4. Clarity: multishot-examples (format examples)

Troubleshooting Patterns

Issue: Inconsistent outputs

Diagnosis: Consistency problem
Solution Path:
1. Add: output-consistency (format control)
2. Consider: template-based-prompting (structure)
3. Check: prefilling-responses (format enforcement)

Issue: Poor reasoning quality

Diagnosis: Reasoning problem
Solution Path:
1. Add: chain-of-thought (step-by-step thinking)
2. Support: xml-tags-structure (organize reasoning)
3. Enhance: multishot-examples (show good reasoning)

Schema Benefits

Cross-Domain Consistency

  • Same metadata structure works for prompt engineering, React, data analysis
  • Predictable organization patterns regardless of topic
  • Universal relationship mapping approach

Intelligent Discovery

  • Rich contextual headers enable natural language search
  • Problem-solution mapping connects needs to solutions
  • Relationship awareness suggests complementary combinations

Logical Selection

  • Diagnostic questions guide context choice
  • Pattern libraries provide proven combinations
  • Troubleshooting approaches resolve common issues

Scalable Architecture

  • Easy addition of new topic domains
  • Consistent relationship patterns across domains
  • Maintains simplicity while enabling intelligence

Current Status

✅ Completed

  • Universal Schema Established: Works across any topic domain
  • First Domain Complete: 15+ prompt engineering contexts with full metadata
  • Intelligent Selection System: Logic-based selection with pattern recognition
  • Relationship Mapping: Dependencies, synergies, and conflicts defined
  • Repository Architecture: Scalable structure for multi-domain expansion
  • Clean, Focused Scope: No complex scoring, simple maintainable approach

✅ Selection Intelligence Features

  • Diagnostic Questions: Guide users to appropriate contexts
  • Pattern Recognition: Common selection patterns for typical scenarios
  • Problem-Solution Matching: Direct mapping from issues to relevant contexts
  • Dependency Resolution: Automatic inclusion of prerequisite contexts
  • Conflict Prevention: Avoid incompatible technique combinations
  • Troubleshooting Logic: Systematic approaches to resolve issues

🔄 Ready for Expansion

  • Next Domains: Schema proven and ready for React, data analysis, etc.
  • Cross-Domain Validation: Schema universality demonstrated
  • Pattern Templates: Selection logic can be adapted to new domains

Scope & Focus

What Context Hub Provides

  • Universal Schema Definition: Metadata structure that works for any domain
  • Intelligent Selection Patterns: Logical approaches to context combination
  • Reference Implementation: Working examples in prompt engineering
  • Relationship Framework: Systematic approach to context connections
  • Cross-Domain Standards: Consistent organization principles

What This Repository Does NOT Include

  • Complex performance metrics or scoring systems
  • Automated validation tools or management utilities
  • Token cost analysis or optimization algorithms
  • Search interfaces or discovery applications

Focus: Schema definition, intelligent selection logic, and cross-domain demonstration

Getting Started

For Schema Users

  1. Study the Schema: Review docs/standards/context-metadata-schema.md
  2. Examine Examples: Browse contexts/prompt-engineering/ to see schema in action
  3. Understand Selection: Review 00-context-selector.md for intelligent selection logic
  4. Explore Patterns: Check 00-context-selector-patterns.md for common combinations

For New Domain Contributors

  1. Apply Schema: Use the universal metadata structure
  2. Create Contexts: Individual modules following the schema
  3. Map Relationships: Define dependencies, synergies, conflicts
  4. Develop Selection Logic: Adapt diagnostic questions and patterns for your domain

Selection Logic Examples

# Problem-driven selection
"Need accurate analysis" → [reduce-hallucinations, chain-of-thought, multishot-examples]
"Want consistent output" → [template-based-prompting, output-consistency, prefilling-responses]
"Handle complex tasks" → [prompt-chaining, xml-tags-structure, chain-of-thought]

# Pattern-based selection
Speed-First: Minimal contexts for quick results
Accuracy-First: Maximum reliability for critical applications
Production-First: Consistency and scalability for systems
Creative-First: Originality with brand consistency

Future Vision

Context Hub aims to establish a universal standard for contextual knowledge storage and intelligent selection that:

  1. Scales Across Any Domain: Same schema and selection logic for technical, creative, analytical topics
  2. Enables Intelligent Discovery: Rich metadata supports natural language search and logical selection
  3. Supports Systematic Organization: Predictable structure and relationship patterns
  4. Facilitates Knowledge Reuse: Standardized format enables broader application
  5. Maintains Simplicity: Human-maintainable approach without complex automation

The schema-first approach with intelligent selection logic ensures that knowledge can be organized consistently and discovered intelligently, whether it's about React components, data analysis techniques, or any other topic area.

Contributing

Schema Standards

  • Follow the universal metadata structure in docs/standards/context-metadata-schema.md
  • Include rich contextual headers with semantic descriptions
  • Map relationships to related contexts (dependencies, synergies, conflicts)
  • Use consistent file naming conventions

Selection Logic

  • Develop diagnostic questions for your domain
  • Create common selection patterns
  • Document troubleshooting approaches
  • Test context combinations for effectiveness

This repository demonstrates that a well-designed schema combined with intelligent selection logic can provide both structure and discoverability for contextual knowledge across any domain.

About

A repository of master context templates in Markdown, designed to be transformed into specific rule formats for various LLMs like Cursor and Claude.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published