कॉन्टेक्स्ट प्रोफ़ाइल आपको विभिन्न परिदृश्यों के लिए lean-ctx द्वारा सामग्री प्रोसेसिंग को कॉन्फ़िगर करने देती हैं: एक्सप्लोरेशन, डीबगिंग, हॉटफ़िक्स, CI, कोड रिव्यू आदि। इसे "Context as Code" समझें - संस्करण-नियंत्रित रणनीतियाँ जो आपकी टीम साझा कर सकती है।
प्रोफ़ाइल क्या हैं?
प्रोफ़ाइल एक TOML फ़ाइल है जो रीड मोड, कम्प्रेशन सेटिंग्स, टोकन बजट, पाइपलाइन लेयर और ऑटोनॉमी व्यवहार को नियंत्रित करती है। प्रोफ़ाइल अन्य प्रोफ़ाइल से इनहेरिट कर सकती हैं और विशिष्ट फ़ील्ड ओवरराइड कर सकती हैं।
अंतर्निहित प्रोफ़ाइल
lean-ctx सामान्य वर्कफ़्लो के लिए अनुकूलित 5 अंतर्निहित प्रोफ़ाइल के साथ आता है:
exploration
कोडबेस समझने के लिए व्यापक संदर्भ। मैप मोड, 200K टोकन बजट, कैश प्राथमिक।
bugfix
ऑटो मोड में केंद्रित डीबगिंग। संक्षिप्त आउटपुट, 100K टोकन बजट, हर 10 कॉल पर चेकपॉइंट।
hotfix
तत्काल सुधारों के लिए न्यूनतम संदर्भ। सिग्नेचर मोड, अल्ट्रा-कॉम्पैक्ट आउटपुट, 30K टोकन, $1 लागत सीमा।
ci-debug
200 शेल इनवोकेशन के साथ CI/CD डीबगिंग। संक्षिप्त आउटपुट, 150K टोकन बजट।
review
व्यापक रीड-ओनली संदर्भ के साथ कोड रिव्यू। मैप मोड, कॉम्पैक्ट CRP, 150K टोकन बजट।
प्रोफ़ाइल सक्रिय करें
LEAN_CTX_PROFILE एनवायरनमेंट वेरिएबल सेट करें:
export LEAN_CTX_PROFILE=hotfix या CLI के माध्यम से:
lean-ctx profile set hotfix या MCP के माध्यम से रनटाइम पर स्विच करें:
ctx_session action=profile value=hotfix कस्टम प्रोफ़ाइल बनाएं
.lean-ctx/profiles/ (प्रोजेक्ट-लोकल) या ~/.lean-ctx/profiles/ (ग्लोबल) में प्रोफ़ाइल TOML फ़ाइल बनाएं:
# .lean-ctx/profiles/my-team.toml
[profile]
name = "my-team"
inherits = "exploration"
description = "Team defaults with lower budget"
[read]
default_mode = "map"
max_tokens_per_file = 40000
[budget]
max_context_tokens = 120000
max_cost_usd = 2.0 या CLI से प्रोफ़ाइल बनाएं:
lean-ctx profile create my-team --from exploration प्रोफ़ाइल इनहेरिटेंस
प्रोफ़ाइल inherits फ़ील्ड का उपयोग करके किसी अन्य प्रोफ़ाइल से इनहेरिट कर सकती हैं। चाइल्ड वैल्यू पैरेंट वैल्यू को ओवरराइड करती हैं; अनसेट फ़ील्ड पैरेंट से इनहेरिट होते हैं।
# .lean-ctx/profiles/strict-review.toml
[profile]
name = "strict-review"
inherits = "review"
[budget]
max_context_tokens = 80000
max_cost_usd = 1.0 प्रोफ़ाइल स्कीमा
एक पूर्ण प्रोफ़ाइल में ये अनुभाग होते हैं:
- [profile] - name, inherits, description
- [read] - default_mode, max_tokens_per_file, prefer_cache
- [compression] - crp_mode, output_density, entropy_threshold
- [budget] - max_context_tokens, max_shell_invocations, max_cost_usd
- [pipeline] - intent, relevance, compression, translation (बूलियन टॉगल)
- [autonomy] - auto_dedup, checkpoint_interval
CLI संदर्भ
lean-ctx profile list- सभी उपलब्ध प्रोफ़ाइल दिखाएंlean-ctx profile show <name>- प्रोफ़ाइल विवरण दिखाएंlean-ctx profile diff <a> <b>- दो प्रोफ़ाइल की तुलना करेंlean-ctx profile create <name>- नई प्रोफ़ाइल बनाएंlean-ctx profile set <name>- सक्रियण निर्देश दिखाएं
रिज़ॉल्यूशन क्रम
प्रोफ़ाइल इस क्रम में रिज़ॉल्व होती हैं:
LEAN_CTX_PROFILEएनवायरनमेंट वेरिएबल- प्रोजेक्ट-लोकल
.lean-ctx/profiles/<name>.toml - ग्लोबल
~/.lean-ctx/profiles/<name>.toml - अंतर्निहित डिफ़ॉल्ट