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/jmagly/aiwg/reflection-injectionnpx skills add jmagly/aiwg --skill reflection-injectiongit clone --depth 1 https://github.com/jmagly/aiwgWrote 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/jmagly/aiwg/reflection-injection)<a href="https://agentmods.dev/skills/jmagly/aiwg/reflection-injection"><img src="https://agentmods.dev/badge/skills/jmagly/aiwg/reflection-injection.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.00023 | $0.00776 |
| Opus 5 | $0.00012 | $0.00388 |
| Sonnet 5 | $0.00005 | $0.00155 |
| Haiku 4.5 | $0.00002 | $0.00078 |
Grade A, and why
reflection-injection 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 — 94 lines — stays where its author put it; the contents beside it link to each section on GitHub.
reflection-injection
Automatically inject relevant past reflections into agent context when starting new iterations or retrying after failures.
Triggers
Alternate expressions and non-obvious activations (primary phrases are matched automatically from the skill description):
- "inject reflection" → explicit reflection injection shorthand
- "add metacognition" → metacognitive step insertion
Purpose
This skill implements the Reflexion episodic memory injection pattern. Before each iteration, it loads relevant past reflections and injects them into the agent's context, enabling learning from past mistakes without repeating them.
Behavior
When triggered, this skill:
-
Load reflection history:
- Read
.aiwg/ralph/reflections/loops/for current loop reflections - Read
.aiwg/ralph/reflections/patterns/for cross-loop patterns - Apply sliding window: k=5 most recent reflections
- Read
-
Filter for relevance:
- Match reflections by task type similarity
- Match by error type if retrying after failure
- Match by file/module if working on specific code
-
Format for injection:
- Convert reflections to natural language summary
- Use @$AIWG_ROOT/agentic/code/addons/ralph/templates/self-reflection-prompt.md template
- Prepend to agent context
-
Track usage:
- Record which reflections were injected
- Track whether injected reflections led to success
- Update pattern effectiveness scores
Activation Conditions
activation:
always_active_for:
- ralph-loop-orchestrator
- ralph-verifier
triggered_by:
- ralph_iteration_start
- agent_retry_after_failure
- explicit_user_request
skip_when:
- no_reflection_history: true
- first_iteration_of_first_loop: true
Integration
This skill uses:
project-awareness: Context for relevance filtering- Agent Loop Orchestrator: Provides iteration state
- Reflection memory at
.aiwg/ralph/reflections/
References
- @$AIWG_ROOT/agentic/code/addons/ralph/schemas/reflection-memory.json - Schema
- @$AIWG_ROOT/agentic/code/addons/ralph/docs/reflection-memory-guide.md - Guide
- @$AIWG_ROOT/agentic/code/addons/ralph/templates/self-reflection-prompt.md - Prompt template
- @.aiwg/research/findings/REF-021-reflexion.md - Research foundation
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 · 94 lines · 23 tokens per session scan A 38ea96bbb004
reflection-injection is a skill published in the GitHub repository jmagly/aiwg (209 stars, last pushed today), licensed MIT. It adds 23 tokens to every session and 776 once invoked, about $0.0001 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-30.
Other skills, from other repositories
hive-mind-advanced
Advanced Hive Mind collective intelligence system for queen-led multi-agent coordination with consensus mechanisms and persistent memory.
cortivex-context-compression
Compress agent outputs for efficient context handoff between pipeline nodes while preserving actionable information.
agent-v3-memory-specialist
Agent skill for v3-memory-specialist - invoke with $agent-v3-memory-specialist.
hive.note-taking
Maintain a free-form scratchpad of decisions, extracted values, and open questions so context pruning doesn't lose anything you still need.
moai-foundation-context
Manages context window optimization, session state persistence, and token budget allocation for multi-agent workflows. Use for token budget management, context limits, or session handoff across agents.
project-context
Use PowerContext project memory and handoff tools through MCP when continuing prior work, recalling decisions, maintaining durable memory, or transferring work across tasks, sessions, or agents.