Injects contextual information into prompts using structured templates to improve AI model accuracy, grounding, and task performance.
npx skills add https://github.com/seb1n/awesome-ai-agent-skills --skill 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.
<retrieved_document>, <user_profile>, <code_file>).Use this skill whenever an AI model needs external information to complete a task accurately. Provide the raw context, the task description, and optionally a prompt template. The skill assembles a well-structured prompt with the context injected in the optimal position.
Prompt Template:
<system>
You are a senior software engineer performing a code review. Identify bugs,
security issues, and style violations. Be specific and cite line numbers.
</system>
<code_file path="src/api/users.py">
import sqlite3
from flask import Flask, request, jsonify
app = Flask(__name__)
def get_db():
return sqlite3.connect("users.db")
@app.route("/users", methods=["GET"])
def list_users():
db = get_db()
query = f"SELECT * FROM users WHERE role = '{request.args.get('role')}'"
results = db.execute(query).fetchall()
return jsonify(results)
@app.route("/users/<int:user_id>", methods=["DELETE"])
def delete_user(user_id):
db = get_db()
db.execute(f"DELETE FROM users WHERE id = {user_id}")
db.commit()
return "", 204
</code_file>
Review the above code file. List all issues found.
Model Output:
> 1. SQL Injection (critical) — Lines 12–13: User input from request.args.get('role') is interpolated directly into the SQL query. Use parameterized queries: db.execute("SELECT * FROM users WHERE role = ?", (role,)).
> 2. SQL Injection — Line 19: user_id is interpolated into the DELETE query. Use a parameterized query.
> 3. No connection cleanup — get_db() opens a connection but it is never closed. Use a context manager or Flask's teardown_appcontext.
> 4. No authentication/authorization — The DELETE endpoint has no access control. Any caller can delete any user.
Prompt Template:
<system>
You are a helpful fitness assistant. Use the user's profile to personalize
your recommendations. Be encouraging and specific.
</system>
<user_profile>
Name: Sarah
Age: 34
Fitness level: Intermediate
Goals: Lose 10 lbs, improve 5K time
Injuries: Mild left knee tendinitis
Preferred activities: Running, yoga, swimming
Available equipment: Dumbbells (5-30 lbs), resistance bands, yoga mat
Schedule: Can train 4 days/week, 45 min per session
</user_profile>
Sarah asks: "Can you suggest a weekly workout plan for me?"
Model Output:
> Here's a 4-day plan tailored to you, Sarah — it protects your left knee while building toward your 5K and weight-loss goals:
>
> Monday — Easy Run + Mobility (45 min): 25-min easy run at conversational pace, followed by 20 min of yoga focusing on hip flexors and quad stretches to support your knee.
>
> Wednesday — Strength + Swimming (45 min): 20-min dumbbell circuit (goblet squats with light weight, lunges, rows, overhead press) + 25-min low-impact swim for cardio without knee stress.
>
> Friday — Interval Run (45 min): 10-min warmup, 6×2-min intervals at 5K goal pace with 90-sec walk recovery, 10-min cooldown. If knee flares, switch to swimming.
>
> Sunday — Active Recovery Yoga (45 min): Full yoga flow emphasizing hamstring flexibility and core stability.
Integration with protocols.io API for managing scientific protocols. This skill should be used when working with protocols.io to search, create, update, or publish protocols; manage protocol steps and materials; handle discussions and comments; organize workspaces; upload and manage files; or integrate protocols.io functionality into workflows. Applicable for protocol discovery, collaborative protocol development, experiment tracking, lab protocol management, and scientific documentation.
Analyzes job descriptions and generates tailored resumes that highlight relevant experience, skills, and achievements to maximize interview chances
Generate Excalidraw diagrams from natural language descriptions. Use when asked to "create a diagram", "make a flowchart", "visualize a process", "draw a system architecture", "create a mind map", or "generate an Excalidraw file". Supports flowcharts, relationship diagrams, mind maps, and system architecture diagrams. Outputs .excalidraw JSON files that can be opened directly in Excalidraw.
Build and distribute Expo development clients locally or via TestFlight
Use when you have a written implementation plan to execute in a separate session with review checkpoints
Data structure for annotated matrices in single-cell analysis. Use when working with .h5ad files or integrating with the scverse ecosystem. This is the data format skill—for analysis workflows use scanpy; for probabilistic models use scvi-tools; for population-scale queries use cellxgene-census.
Benchling R&D platform integration. Access registry (DNA, proteins), inventory, ELN entries, workflows via API, build Benchling Apps, query Data Warehouse, for lab data management automation.
Comprehensive molecular biology toolkit. Use for sequence manipulation, file parsing (FASTA/GenBank/PDB), phylogenetics, and programmatic NCBI/PubMed access (Bio.Entrez). Best for batch processing, custom bioinformatics pipelines, BLAST automation. For quick lookups use gget; for multi-service integration use bioservices.
Take seb1n/context-injection from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.