rag-code-gen
/rag-code-gen
RAG-grounded code generation with source citations. Triggers on: grounded code, ground this, cite sources, show me with sources, how do I with attune, reference attune docs, grounded against attune docs.
- Author
- smart-ai-memory ↗
- Repository
- attune-ai ↗
- Licence
- Apache-2.0
- Last repository change
- 24.10.2026
Assessment and security
- Files in this package
- 1
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 1
No signals detected. Repository changed on 24.10.2026, without references to retired models or APIs.
Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.
What it does and when to use it
RAG-grounded code generation with source citations. Triggers on: grounded code, ground this, cite sources, show me with sources, how do I with attune, reference attune docs, grounded against attune docs.
Original author description
RAG-grounded code generation with source citations. Triggers on: grounded code, ground this, cite sources, show me with sources, how do I with attune, reference attune docs, grounded against attune docs.
How it works
- Scoping
- Running
- Output shape
- When RAG doesn't help
- Alternative: MCP tool only (no LLM call)
- If the extra isn't installed
- See also
SKILL.md preview
---
name: rag-code-gen
description: "RAG-grounded code generation with source citations. Triggers on: grounded code, ground this, cite sources, show me with sources, how do I with attune, reference attune docs, grounded against attune docs."
---
# 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:
1. **What are you trying to produce?** Code, config,
explanation, or a mix?
2. **Any specific attune surface?** e.g. "the
security-audit workflow", "MCP tool pattern", "BaseWorkflow
subclass". Helps retrieval hit the right concept file.
3. **Depth?** Default is `standard`. `quick` saves time
and budget for simple asks; `deep` is 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` / `deep`
- `feedback` — pass `good` or `bad` AFTER inspecting the
output to record a verdict against every cited template
- `model` — override the generator model if you need to
## Output shape
`WorkflowResult.final_output` is a string with two parts:
1. The generated code / explanation
2. A `## Sources` section listing each cited
`attune-help` template 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.
## If the extra isn't installed
The workflow returns a structured error pointing at
`pip install attune-rag` (a core dep — missing means a broken
install). No exception propagates.
## See also
- [docs/rag/index.md](../../docs/rag/index.md) — full
walkthrough including the standalone attune-rag usage
- [attune-rag on PyPI](https://pypi.org/project/attune-rag/)
- [Embeddings decision record](../../docs/rag/embeddings-decision-2026-04-17.md)
Versions
The database has no other skills named rag-code-gen.
Identical content appears in 1 other GitHub folders. We show one copy with the highest score.
Database snapshot: 13.11.2026 · package version 57ddef972a19 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100attune-hub
Developer workflow hub — routes to the right skill based on what you need. Triggers on: attune, what can attune do, what can you do, capabilities, where do I start, get started. - 95catalog
Enumerate everything attune offers — every workflow, wizard, and tool, read live from the registries. Triggers on: catalog, list capabilities, browse, show all, what can attune do, list workflows, list wizards, what tools are there. - 100gen-docs
文档生成器。自动分析模块结构,生成 README.md 和 DESIGN.md 骨架。当用户提到生成文档、创建README、创建DESIGN、文档骨架、文档模板时使用。在新建模块开始时自动触发。