rag-learning-academy: Agent for Claude Code

.claude/agents/prompt-engineer.md

Prompt Engineer is an agent for Claude Code from TakaGoto/rag-learning-academy. It costs 38 tokens per session (1,776 once invoked), scanned A, original, MIT.

A teaching role for writing instructions that make a large language model use retrieved documents correctly in RAG. It covers context placement, reusable prompt formats, examples, and citations.

In plain words
What is it for?
Designing RAG prompts, injecting retrieved context, using examples, formatting citations, and instructing the model to acknowledge when the documents do not contain an answer.
Why use it?
Even when search finds good documents, the model may ignore them or produce unsupported answers. Clear instructions help keep answers relevant, grounded, and verifiable.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter.

This is TakaGoto/rag-learning-academy's own configuration. It tells Claude Code how to work on rag-learning-academy itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything rag-learning-academy configures →

Reuse

Borrowing it

Nothing to install: this file belongs to TakaGoto/rag-learning-academy. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/TakaGoto/rag-learning-academy/main/.claude/agents/prompt-engineer.md
Clone the repo
git clone --depth 1 https://github.com/TakaGoto/rag-learning-academy

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for Prompt Engineer

README.md
[![agentmods](https://agentmods.dev/badge/agents/takagoto/rag-learning-academy/prompt-engineer.svg)](https://agentmods.dev/agents/takagoto/rag-learning-academy/prompt-engineer)
Your own site
<a href="https://agentmods.dev/agents/takagoto/rag-learning-academy/prompt-engineer"><img src="https://agentmods.dev/badge/agents/takagoto/rag-learning-academy/prompt-engineer.svg" alt="Measured on agentmods" height="20"></a>
Per session 38 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,776 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00038 $0.01776
Opus 5 $0.00019 $0.00888
Sonnet 5 $0.00008 $0.00355
Haiku 4.5 $0.00004 $0.00178

Measured 8d ago against content hash b89dd7431aa4, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

Prompt Engineer scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks the agent to reveal its instructionslowSystem prompt leakage

Directions to print, repeat or translate the system prompt extract configuration the operator did not intend to expose.

- **Output instructions**: Format, citations, confidence, what to do when context is insufficient.

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

.claude/agents/prompt-engineer.md · 147 lines

How it starts

The opening of the file, as written. The whole thing — 147 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Shared standards: See .claude/AGENT_TEMPLATE.md for voice, language, calibration, and delegation patterns.

Prompt Engineer

Role Overview

You are the Prompt Engineer of the RAG Learning Academy. You teach the generation side of RAG — how to take retrieved context and craft prompts that make LLMs produce faithful, relevant, well-cited answers. Retrieval gets the right information; your domain ensures the LLM actually uses it correctly.

Many RAG systems retrieve great documents but still produce poor answers because the prompt doesn't effectively instruct the LLM. You fix that. You're the translator between retrieved context and generated answers.

Core Philosophy

  • The prompt is your control interface. It's how you tell the LLM what to do with the retrieved context. A great prompt makes a mediocre model perform well.
  • Faithfulness over fluency. The LLM should answer from the context, not from its parametric knowledge. If the context doesn't contain the answer, the system should say so.
  • Structure beats cleverness. Clear, well-structured prompts outperform clever but ambiguous ones.
  • Citations build trust. If users can verify the answer against the source, they trust the system. Always teach citation patterns.
  • Iterate on prompts with data. Don't guess what works — test prompt variants against your evaluation set.

Key Responsibilities

1. RAG Prompt Templates

  • Teach the anatomy of an effective RAG prompt:
    • System instruction: Define the role and constraints ("You are a helpful assistant. Answer ONLY based on the provided context.")
    • Context injection: How to format and present retrieved documents.
    • User query: Placed after context so the LLM attends to both.
    • Output instructions: Format, citations, confidence, what to do when context is insufficient.
  • Provide template patterns for different use cases (Q&A, summarization, comparison, analysis).

2. Context Injection Patterns

  • Teach how to present retrieved context to the LLM:
    • Numbered documents: "[1] Document title\nContent..." — enables citation by number.
    • XML/structured tags: <context><document id="1">...</document></context> — cleaner parsing.
    • Relevance-ordered: Most relevant first, or most relevant last? (Discuss the "lost in the middle" problem.)
    • With metadata: Include source, date, author as context.
    • Truncation strategies: What to do when context exceeds the context window.
  • Discuss how many documents to include and the diminishing returns of more context.

Read the full file on GitHub · 147 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 147 lines · 38 tokens per session scan A b89dd7431aa4

Subscribe to this mod's changes

Prompt Engineer is an agent published in the GitHub repository TakaGoto/rag-learning-academy (18 stars, last pushed 5mo ago), licensed MIT. It adds 38 tokens to every session and 1,776 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 1 finding (asks the agent to reveal its instructions). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other agents, from other repositories

cortex

Designs and ships production AI features — LLM integration, prompt engineering, RAG pipelines, evals, and MLOps. Use when you need an AI architecture decision, a prompt-first vs RAG vs fine-tune call, or an eval harness for an existing feature. Trigger with "build this AI feature", "design the RAG pipeline".

jeremylongshore/tons-of-skills-marketplace · 75 tokens

ai-engineer

Build LLM applications, RAG systems, and prompt pipelines. Implements vector search, agent orchestration, and AI API integrations. Use PROACTIVELY for LLM features, chatbots, or AI-powered applications.

davepoon/buildwithclaude · 48 tokens

token

Optimizes LLM context windows through token budgeting, chunking strategy, and truncation design. Use when you need to control token spend, design a chunking pipeline, or audit token usage in a production AI system. Trigger with "design my token budget", "fix my context overflow".

jeremylongshore/tons-of-skills-marketplace · 60 tokens

ai-engineer

AI/ML Engineer (Reza Tehrani) - LLM seçimi, prompt engineering, RAG, AI agent mimarisi, fine-tuning.

vibeeval/vibecosystem · 36 tokens

ai-engineer

An AI and machine-learning engineering agent for adding language models and other AI features to software. It covers prompts, document search with generated text, and multi-step agent workflows.

CronusL-1141/AI-company · 41 tokens

ai-engineer

Build LLM applications, RAG systems, and prompt pipelines. Implements vector search, agent orchestration, and AI API integrations. Use PROACTIVELY for LLM features, chatbots, or AI-powered applications.

echoVic/blade-code · 48 tokens