ace-reflection

ace-reflection is a cursor rule for Cursor from vlad-ryzhkov/ai-context-engineering-for-qa. It costs 350 tokens per session, scanned A, original, Unlicense.

A rule for analyzing a failed coding-agent skill run. It identifies the specific technical cause and records one new lesson, or points to an existing rule when the lesson is already covered.

In plain words
What is it for?
Use it after a skill reports a partial result or loop guard, or when someone asks what went wrong.
Why use it?
It turns failures into concise, reusable guidance instead of leaving only a vague error report. The duplicate check prevents the same rule from being recorded repeatedly.

Cursor rule for Cursor

Install

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.

agentmods
npx agentmods add rules/vlad-ryzhkov/ai-context-engineering-for-qa/ace-reflection
Clone the repo
git clone --depth 1 https://github.com/vlad-ryzhkov/ai-context-engineering-for-qa

Made for: Cursor.

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 ace-reflection

README.md
[![agentmods](https://agentmods.dev/badge/rules/vlad-ryzhkov/ai-context-engineering-for-qa/ace-reflection.svg)](https://agentmods.dev/rules/vlad-ryzhkov/ai-context-engineering-for-qa/ace-reflection)
Your own site
<a href="https://agentmods.dev/rules/vlad-ryzhkov/ai-context-engineering-for-qa/ace-reflection"><img src="https://agentmods.dev/badge/rules/vlad-ryzhkov/ai-context-engineering-for-qa/ace-reflection.svg" alt="Measured on agentmods" height="20"></a>
Per session 350 This file is loaded in full into every session.
When invoked 350 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
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 $0.00350 $0.00350
Opus 5 $0.00175 $0.00175
Sonnet 5 $0.00070 $0.00070
Haiku 4.5 $0.00035 $0.00035

Measured 4d ago against content hash 6dfef16867ae, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

ace-reflection 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 4d 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.

.cursor/rules/ace-reflection.mdc · 41 lines

What it actually says

Reflection Protocol — Structured Failure Analysis

Trigger

Activates when:

  • Skill ends with SKILL PARTIAL or LOOP_GUARD_TRIGGERED
  • User explicitly says "reflect" / "what went wrong"

Algorithm

  1. Identify root cause (not symptom) of the failure
  2. Formulate exactly 1 rule:
    - RULE: [prohibition/requirement]. Reason: [why]. Source: [skill, date]
    
  3. Dedup check: Grep CLAUDE.md, qa-antipatterns/, relevant SKILL.md for keyword overlap
  4. If rule is genuinely new → append to .ai-lessons/pending.md (Delta Update: append only)
  5. If duplicate → output "Existing rule covers this: [ref]"

Output Format (mandatory)

REFLECTION
|- Root cause: [specific technical reason]
|- New rule: [yes/no — if yes, appended to .ai-lessons/pending.md]
|- Ref: [existing rule path if duplicate]

Rules

  • One reflection per failure — do not batch multiple root causes
  • Root cause must be specific and technical, not "something went wrong"
  • Formulate rules as prohibitions or requirements, never wishes
  • FORBIDDEN: rewriting .ai-lessons/pending.md — append only (Delta Update Protocol)
  • If the failure is caused by external factors (network, missing dependency) — note it but do not create a rule
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. 4d ago First seen · 41 lines · 350 tokens per session scan A 6dfef16867ae

Subscribe to this mod's changes

ace-reflection is a cursor rule published in the GitHub repository vlad-ryzhkov/ai-context-engineering-for-qa (6 stars, last pushed 28d ago), licensed Unlicense. It adds 350 tokens to every session, about $0.0018 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.