Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/smart-ai-memory/attune-ai/rag-code-gennpx skills add Smart-AI-Memory/attune-ai --skill rag-code-gengit clone --depth 1 https://github.com/Smart-AI-Memory/attune-aiWrote 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.
[](https://agentmods.dev/skills/smart-ai-memory/attune-ai/rag-code-gen)<a href="https://agentmods.dev/skills/smart-ai-memory/attune-ai/rag-code-gen"><img src="https://agentmods.dev/badge/skills/smart-ai-memory/attune-ai/rag-code-gen.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00050 | $0.00715 |
| Opus 5 | $0.00025 | $0.00358 |
| Sonnet 5 | $0.00010 | $0.00143 |
| Haiku 4.5 | $0.00005 | $0.00072 |
Grade A, and why
rag-code-gen scanned grade A with 0 findings 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 5d 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.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 84 lines — stays where its author put it; the contents beside it link to each section on GitHub.
RAG-grounded code generation
attune-rag ships with attune-ai core (pip install attune-ai).
Grounds code generation in the attune-help template corpus
so outputs cite real APIs, workflow names, and patterns
instead of hallucinating them. Every output ends with a
## Sources block of clickable citations.
Scoping
Before running, ask:
- What are you trying to produce? Code, config, explanation, or a mix?
- Any specific attune surface? e.g. "the security-audit workflow", "MCP tool pattern", "BaseWorkflow subclass". Helps retrieval hit the right concept file.
- Depth? Default is
standard.quicksaves time and budget for simple asks;deepis for complex multi-file or architectural questions.
Running
attune workflow run rag-code-gen \
--input '{"query": "<the request>"}'
Optional inputs:
k— max grounding docs to retrieve (default 3)depth—quick/standard/deepfeedback— passgoodorbadAFTER inspecting the output to record a verdict against every cited templatemodel— override the generator model if you need to
Output shape
WorkflowResult.final_output is a string with two parts:
- The generated code / explanation
- A
## Sourcessection listing each citedattune-helptemplate with its category, retrieval score, and a clickable link to the source on GitHub
WorkflowResult.metadata carries the full citation dict
(query, retriever_name, retrieved_at, hits[]) plus
fallback_used and confidence so callers can make
routing decisions.
When RAG doesn't help
If the retriever can't find relevant templates, the
workflow still runs — it falls back to an unaugmented
prompt that explicitly tells the model there is NO
grounding context so it should say "I don't know about
attune X" rather than invent. metadata.fallback_used is
True in that case.
Alternative: MCP tool only (no LLM call)
If you want just retrieval without generation, use the
rag_knowledge_query MCP tool directly. It returns hits +
an augmented prompt string without calling an LLM itself —
handy for routing decisions, agent planning, or feeding
another model.
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.
- 5d ago First seen · 84 lines · 50 tokens per session scan A 4f24c3292354
rag-code-gen is a skill published in the GitHub repository Smart-AI-Memory/attune-ai (10 stars, last pushed yesterday), licensed Apache-2.0. It adds 50 tokens to every session and 715 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
RAG Reasoning
Visible reasoning contract for retrieval, evidence selection, and grounded synthesis.
pandic-office
Convert Markdown to PDF (or DOCX/EPUB/HTML) using the pandoc CLI. Use when asked to produce a PDF report, brief, summary, or any document where the input is Markdown and the output should be a polished, paginated file.
tmux
Manage long-running shell sessions with tmux — start a detached session, run a long task, reattach later, capture output. Use when a task takes longer than a single tool call (build, test, log tail).
lynkr
Universal LLM gateway with intelligent routing, Graphify code intelligence, Distill compression, routing telemetry, Code Mode, and 12+ provider support. 60-80% cost reduction for Claude Code, Cursor, and Codex.
web-research
Use this skill for requests related to web research; it provides a structured approach to conducting comprehensive web research.
prompt-optimize
Expert prompt engineering skill that transforms Claude into "Alpha-Prompt" - a master prompt engineer who collaboratively crafts high-quality prompts through flexible dialogue. Activates when user asks to "optimize prompt", "improve system instruction", "enhance AI instruction", or mentions prompt engineering tasks.