Observed since 21 Oct, 09:52 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Generate AGENTS.md rules from agent failure logs
Generate AGENTS.md rules from AI coding agent failure logs. Closes the feedback loop in the agent quality trilogy.
Measure (coderace) → Generate (agentmd) → Guard (agentlint) → Learn (agentreflect)
Every developer using Claude Code or Codex has this problem: their agent makes a mistake, they fix it manually, update AGENTS.md, and hope it doesn't happen again. agentreflect automates the "update AGENTS.md" step.
Feed it failure logs → get targeted rule suggestions → apply them to your AGENTS.md.
In notes mode, agentreflect now prefers AGENTS-style operational rules over generic QA advice. If a note says the agent missed an exact routing target, skipped downstream verification after an irreversible action, or relied on fuzzy recall instead of exact facts already present in files, the suggestions will mirror that operating rule directly.
pip install ai-agentreflect
For LLM-enhanced mode:
pip install 'ai-agentreflect[llm]'
# Capture failures
pytest --tb=short 2>&1 | tee failures.txt
# Generate suggestions
agentreflect generate --from-pytest failures.txt
agentreflect generate --from-git
Analyzes fix:, bug:, revert: commits and agent-related mistake commits.
agentreflect generate --from-notes "agent forgot to check for None before accessing .value"
agentreflect generate --from-notes "fuzzy retrieval missed explicit facts already present in files; add an exact-match layer for handles and tool routing before semantic lookup"
agentreflect ships a GitHub Action and a CI mode flag to integrate rule generation into your pull request workflow.
# .github/workflows/agentreflect.yml
name: agentreflect
on: [pull_request]
jobs:
learn:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: mikiships/agentreflect@v0.3.0
with:
mode: ci
from-git: 'true'
threshold: '10' # fail PR if >= 10 new rules detected
# Write JSON to stdout, summary to stderr
agentreflect generate --from-pytest failures.txt --ci
# Fail with exit 1 if >= 5 rules generated (useful for PR gates)
agentreflect generate --from-git --ci --fail-on 5
CI mode JSON output:
{
"ci": true,
"rules_count": 3,
"rules_generated": 3,
"source": "git log",
"suggestions": [
{ "rule": "...", "rationale": "...", "confidence": 0.85, "category": "..." }
]
}
See .github/workflows/examples/agent-quality-pipeline.yml for a complete MEASURE → GENERATE → GUARD → LEARN pipeline running all four agent quality tools in sequence:
## agentreflect suggestions (2026-03-11)
### From: pytest failures (failures.txt)
- [ ] Always check for None before attribute access: use `if obj is not None` or `hasattr(obj, 'attr')`
- [ ] When catching AttributeError, log the object type with `type(obj).__name__`
_Source: 3 failures analyzed, 2 suggestions generated_
agentreflect generate --from-pytest failures.txt --format diff
Outputs a unified diff ready to apply to AGENTS.md.
agentreflect generate --from-notes "agent used wrong variable" --apply AGENTS.md
# Asks for confirmation
agentreflect generate --from-pytest failures.txt --apply AGENTS.md --yes
# Applies without confirmation
export ANTHROPIC_API_KEY=your_key_here
agentreflect generate --from-pytest failures.txt --llm
Uses claude-3-5-haiku-latest for contextual, specific suggestions tailored to your actual failures. Cost: ~$0.001 per analysis.
Basic pattern mode works without any API key.
| Tool | Role |
|---|---|
| coderace | Measure agent output quality |
| agentmd | Generate AGENTS.md from scratch |
| agentlint | Guard/validate AGENTS.md rules |
| agentreflect | Learn from failures → update rules |
MIT
pypistats · 49 observations shown. Missing days are unknown. Source category: overall: without mirrors.
| Date / source period | Value | Observed at |
|---|---|---|
| 2026-10-20 – 2026-10-20 | 1 | 2026-10-21T10:28:28.8028566Z |
| 2026-10-19 – 2026-10-19 | 1 | 2026-10-21T10:28:28.8028566Z |
| 2026-10-18 – 2026-10-18 | 2 | 2026-10-21T10:28:28.8028566Z |
| 2026-10-17 – 2026-10-17 | 11 | 2026-10-21T10:28:28.8028566Z |
| 2026-10-16 – 2026-10-16 | 16 | 2026-10-21T10:28:28.8028566Z |
| 2026-10-15 – 2026-10-15 | 7 | 2026-10-21T10:28:28.8028566Z |
| 2026-10-14 – 2026-10-14 | 1 | 2026-10-21T10:28:28.8028566Z |
| 2026-10-13 – 2026-10-13 | 1 | 2026-10-21T10:28:28.8028566Z |
| 2026-10-12 – 2026-10-12 | 2 | 2026-10-21T10:28:28.8028566Z |
| 2026-10-10 – 2026-10-10 | 4 | 2026-10-21T10:28:28.8028566Z |
| 2026-10-09 – 2026-10-09 | 4 | 2026-10-21T10:28:28.8028566Z |
| 2026-10-08 – 2026-10-08 | 1 | 2026-10-21T10:28:28.8028566Z |
| 2026-10-06 – 2026-10-06 | 1 | 2026-10-21T10:28:28.8028566Z |
| 2026-10-02 – 2026-10-02 | 1 | 2026-10-21T10:28:28.8028566Z |
| 2026-10-01 – 2026-10-01 | 6 | 2026-10-21T10:28:28.8028566Z |
| 2026-09-30 – 2026-09-30 | 1 | 2026-10-21T10:28:28.8028566Z |
| 2026-09-29 – 2026-09-29 | 1 | 2026-10-21T10:28:28.8028566Z |
| 2026-09-28 – 2026-09-28 | 2 | 2026-10-21T10:28:28.8028566Z |
| 2026-09-27 – 2026-09-27 | 1 | 2026-10-21T10:28:28.8028566Z |
| 2026-09-26 – 2026-09-26 | 1 | 2026-10-21T10:28:28.8028566Z |
| 2026-09-23 – 2026-09-23 | 2 | 2026-10-21T10:28:28.8028566Z |
| 2026-09-22 – 2026-09-22 | 1 | 2026-10-21T10:28:28.8028566Z |
| 2026-09-21 – 2026-09-21 | 6 | 2026-10-21T10:28:28.8028566Z |
| 2026-09-20 – 2026-09-20 | 2 | 2026-10-21T10:28:28.8028566Z |
| 2026-09-16 – 2026-09-16 | 1 | 2026-10-21T10:28:28.8028566Z |
| 2026-09-15 – 2026-09-15 | 7 | 2026-10-21T10:28:28.8028566Z |
| 2026-09-07 – 2026-09-07 | 1 | 2026-10-21T10:28:28.8028566Z |
| 2026-09-06 – 2026-09-06 | 6 | 2026-10-21T10:28:28.8028566Z |
| 2026-09-01 – 2026-09-01 | 1 | 2026-10-21T10:28:28.8028566Z |
| 2026-08-31 – 2026-08-31 | 1 | 2026-10-21T10:28:28.8028566Z |
| 2026-08-28 – 2026-08-28 | 1 | 2026-10-21T10:28:28.8028566Z |
| 2026-08-25 – 2026-08-25 | 1 | 2026-10-21T10:28:28.8028566Z |
| 2026-08-24 – 2026-08-24 | 5 | 2026-10-21T10:28:28.8028566Z |
| 2026-08-23 – 2026-08-23 | 3 | 2026-10-21T10:28:28.8028566Z |
| 2026-08-21 – 2026-08-21 | 1 | 2026-10-21T10:28:28.8028566Z |
| 2026-08-19 – 2026-08-19 | 1 | 2026-10-21T10:28:28.8028566Z |
| 2026-08-17 – 2026-08-17 | 3 | 2026-10-21T10:28:28.8028566Z |
| 2026-08-15 – 2026-08-15 | 3 | 2026-10-21T10:28:28.8028566Z |
| 2026-08-14 – 2026-08-14 | 2 | 2026-10-21T10:28:28.8028566Z |
| 2026-08-10 – 2026-08-10 | 1 | 2026-10-21T10:28:28.8028566Z |
| 2026-08-09 – 2026-08-09 | 3 | 2026-10-21T10:28:28.8028566Z |
| 2026-08-08 – 2026-08-08 | 4 | 2026-10-21T10:28:28.8028566Z |
| 2026-08-02 – 2026-08-02 | 2 | 2026-10-21T10:28:28.8028566Z |
| 2026-08-01 – 2026-08-01 | 1 | 2026-10-21T10:28:28.8028566Z |
| 2026-07-30 – 2026-07-30 | 1 | 2026-10-21T10:28:28.8028566Z |
| 2026-07-27 – 2026-07-27 | 2 | 2026-10-21T10:28:28.8028566Z |
| 2026-07-26 – 2026-07-26 | 1 | 2026-10-21T10:28:28.8028566Z |
| 2026-07-24 – 2026-07-24 | 1 | 2026-10-21T10:28:28.8028566Z |
| 2026-07-23 – 2026-07-23 | 2 | 2026-10-21T10:28:28.8028566Z |
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.3.0 | 12 Mar 2026 | 4 |
This describes our collected data; it is not a security assessment.
Observed since 21 Oct, 09:52 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:282dbb2378aba0724991077e11dfc9dc7df6e8d83839f27eecd02509e95ed44c