retro-to-framework
Convert an observation about agent behavior — from a retrospective or from a single incident — into a framework-level change (hook, rule, skill, skill update). Use after a retrospective identifies problems that are not project-specific, after an incident where an agent misapplied a component it had read, when CLAUDE.md band-aids accumulate (more than 3 per-project rules that could be generic), or when the same problem recurs across multiple projects.
- License 许可
- MIT
- 所属仓库
- muratovv/ai-hats
- 最近更新
- 2026-11-05
- Stars
- ★ 3
- Forks
- 1
01 前言 Front Matter
- name
- retro-to-framework
- ai_hats
- { "type": "skill", "schema_version": 1 }
- license
- MIT
- description
- Convert an observation about agent behavior — from a retrospective or from a single incident — into a framework-level change (hook, rule, skill, skill update). Use after a retrospective identifies problems that are not project-specific, after an incident where an agent misapplied a component it had read, when CLAUDE.md band-aids accumulate (more than 3 per-project rules that could be generic), or when the same problem recurs across multiple projects.
03 SKILL.md 正文
Retro-to-Framework
Convert project-level retrospective findings into framework-level improvements.
When to Use
Two entry points, one procedure:
- Downstream of a retro — self-retrospective produces the findings, this skill promotes the generic ones.
- Downstream of an incident — one session where an agent observably did the wrong thing. No retro needed; the evidence is the session itself. Bring what the agent did, what the component told it to do, and the proof it read that component (otherwise the finding is "the agent never saw it", a different fix).
Two boundaries — the finding must be cross-project generic (a project-local fix stays in that project's CLAUDE.md), and trimming or dedup of components that already exist is skill-optimization, not this.
Procedure
-
Classify findings: For each retrospective finding, ask: "Would this same problem occur in a different project using the same role?"
- YES → framework candidate (rule, skill, or skill update)
- NO → project-specific (stays in project CLAUDE.md)
-
Map to component type — mechanism first:
Finding type Framework component Invariant a machine can decide ("never write X to Y") Hook / gate / CLI check — not prose Behavioral constraint ("always do X") Rule Multi-step process ("when X, do Y then Z") Skill Missing check in existing process Skill update Knowledge gap Reference doc or injection update The first row is first on purpose: prose costs tokens every turn and asks the agent to comply, a hook costs nothing and does not ask. Rank the options with the mechanism ladder in trait
skill-engineerbefore picking a row.If prose for this finding was already tried and did not hold, the first row is the only honest answer. A component the agent demonstrably read and did not apply will not be fixed by rewording it in the same place — that is the evidence that the mechanism, not the wording, is wrong. Record what was tried and how it was measured, so the next reader does not re-run the experiment.
-
Draft the improvement: Follow skill-template for new skills, rule naming convention for rules.
-
Wire into composition: Determine which trait should include the new component. Update trait config.yaml. Run composer validation for all affected roles.
-
Propagate to projects: Roles are composed fresh at every session launch, so a library edit needs no per-project command — it is live for the next session. A project pinned to a published
ai-hats-libraryneedsai-hats self updateto pull the new version;self initdoes not fetch one. Remove corresponding band-aids from the project's own CLAUDE.md. Verify withai-hats config status(composition tree) orai-hats --dry-run(the exact artifacts a launch would deliver). -
Close the loop: Update the original retrospective with a link to the framework change. File a backlog card if the change is non-trivial.
Completion
- Findings classified as framework vs project-specific
- Framework improvements implemented and validated (composer 0 errors, tests green)
- All projects using affected roles bumped
- Per-project band-aids removed
- Original retrospective updated with provenance
Anti-Patterns
- Leaving band-aids in project CLAUDE.md after framework fixes exist — remove them
- Making everything a framework change — some things are truly project-specific
- Skipping composer validation — always verify after wiring changes
04 同仓库更多 Skills
tool-evaluation-protocol
Time-bounded protocol for evaluating new tools, libraries, or methodologies before adoption. Use when evaluating a candidate dependency for the project, researching a methodology (e.g. ML/LLM frameworks, testing approaches), or following up on a hype-driven recommendation.
systematic-debugging
4-phase bug-fix protocol (evidence, pattern, hypothesis, verify). Use when investigating any error, failure, or unexpected behavior, handling bug reports from users or monitoring, or diagnosing test failures with non-obvious causes.
skill-template
Canonical template and validation guide for ai-hats skills. Use when creating a new skill, reviewing an existing one for structural compliance, or deciding which pattern fits a new behavior.
skill-optimization
Audit and refactor library components to eliminate redundancy and staleness. Use during periodic library maintenance, after adding multiple new skills or rules, when a role's token budget is too high, or after retrospectives identify component issues.
silent-fallback-gate
PreToolUse hook — refuses an Edit or Write that adds an inert broad except. Use when a Python edit was blocked for a silent fallback.
py-security-lint
PostToolUse hook — reports the project's own ruff security (`S`) findings on every `.py` you Edit/Write, non-blockingly; fail-open, no manual invocation.