context-injection

Solid

Place trusted contextual information into prompts or agent state using explicit boundaries, provenance, and templates. Use when relevant context has already been selected and must be inserted safely; use context-retrieval to find it or context-optimization to choose and order it.

AI & Automation 161 stars 32 forks Updated 1 weeks ago MIT

Install

View on GitHub

Quality Score: 87/100

Stars 20%
74
Recency 20%
90
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Context Injection Context injection is the practice of dynamically inserting relevant information — documents, data, examples, or tool outputs — into an AI prompt so the model has the knowledge it needs to produce accurate, grounded responses. Effective injection is about more than pasting text; it requires deliberate placement, formatting, and token budget allocation to maximize the model's ability to use the injected material. ## Workflow 1. **Identify the Context Need**: Analyze the task to determine what types of external information the model requires. A code review needs the source file; a support question needs product documentation; a personalized reply needs the user's profile. Clearly categorize each need as document grounding, few-shot examples, tool output, or metadata. 2. **Gather the Context**: Retrieve the necessary information from its source — a database, file system, API response, vector store, or prior conversation. Apply any necessary compression or truncation before injection so the material fits within the allocated token budget. 3. **Select an Injection Strategy**: Choose the appropriate injection method based on the context type and the model's attention patterns: - *System prompt injection* — persistent context like role definitions, rules, and user preferences go in the system message. - *Document grounding* — retrieved documents or files are inserted in the user message, typically before the question. - *Few-shot examples* — input/ou...

Details

Author
seb1n
Repository
seb1n/awesome-ai-agent-skills
Created
6 months ago
Last Updated
1 weeks ago
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Listed

context-injector

Persistent context management skill that ends the 'let me explain again' tax. Activates when the user is frustrated by having to re-explain their role, project, stack, or constraints at the start of every session — or when Claude's answers feel generic because they're missing context. Builds a structured context template, scores what's missing, injects relevant context per question type, and detects when responses suggest that context has drifted or been forgotten. Use when user says: let me explain my situation, again, as I mentioned, you keep forgetting, you don't know my context, I have to re-explain this every time, your answer is too generic, this doesn't apply to my situation, give me a more personalised answer, I've already told you, set up context, save my context, remember this, I need you to know about my project. Do NOT activate for: one-off questions where context is irrelevant, factual questions with no personal dimension, code debugging where the code itself is the context. First response: "Cont

3 Updated 2 weeks ago
Sandeeprdy1729
AI & Automation Listed

context-engineering

Use when the agent needs better context — assembling the right files, definitions, and prior decisions before implementing, or explaining existing code to a user. Triggers on "agent lacks context", "what files matter", "解释这段代码", "这个模块怎么工作", "带我过一遍代码库".

3 Updated 2 days ago
int2t05
AI & Automation Featured

context-fundamentals

This skill should be used when the user asks to "understand context", "explain context windows", "design agent architecture", "debug context issues", "optimize context usage", or discusses context components, attention mechanics, progressive disclosure, or context budgeting. Provides foundational understanding of context engineering for AI agent systems.

2,936 Updated 1 weeks ago
foryourhealth111-pixel