Agent: Harvesting Skill Reviews
Relevant source files
The following files were used as context for generating this wiki page:
Introduction
The "Harvesting Skill Reviews" agent transforms Pull Request (PR) review feedback into durable skill rules. It identifies recurring corrections or patterns mentioned by human reviewers and codifies them into the repository's skill system to prevent future agents from repeating the same mistakes. This process ensures that institutional knowledge from code reviews is preserved and automated.
This agent operates within the infrahub-skills framework, specifically targeting the improvement of shipped skills located in the skills/ directory. It acts as the first step in the skill-change pipeline, preceding analysis and implementation phases.
Sources: AGENTS.md:14, dev/README.md:27-31, .agents/skills/harvesting-skill-review/SKILL.md:1-15
Harvesting Workflow
The agent follows a structured sequence to extract and formalize feedback. It prioritizes refining existing rules over creating new artifacts to maintain a lean repository.
Workflow Phases
The following diagram illustrates the flow from PR feedback to rule proposal:
The diagram shows the decision logic used to filter speculative feedback and apply the minimum change principle.
Sources: .agents/skills/harvesting-skill-review/SKILL.md:41-80, dev/guidelines/minimum-change.md:1-12
1. Extraction and Grouping
You must read all comments in the designated PR, focusing on technical corrections. You group individual comments into "concerns." A concern is considered valid for harvesting if it represents a recurring pattern or a critical invariant. You ignore one-off anomalies or model variance.
Sources: .agents/skills/harvesting-skill-review/SKILL.md:41-50, dev/guidelines/minimum-change.md:9-16
2. The Minimum Change Ladder
Before creating new files, you must evaluate the feedback against the "Minimum Change" ladder. This prevents repository bloat by finding the smallest possible artifact to close the gap.
| Step | Action | Description |
|---|---|---|
| 1 | No Action | Guidance for a mistake no agent has actually made is speculative. |
| 2 | Link/Tighten | Use existing rules, examples.md, or infrahub-common. |
| 3 | Edit Rule | Add one sentence to an existing rule file. |
| 4 | Product Fix | Point the agent to an existing product validator (e.g., schema check). |
| 5 | SKILL.md | Add one line to the workflow step in the main entry point. |
| 6 | New Artifact | Create a new rule file only if all above steps fail. |
Sources: dev/guidelines/minimum-change.md:9-30, .agents/skills/harvesting-skill-review/SKILL.md:52-60
3. Handoff Generation
The agent does not implement changes directly. It produces a .skill-change-*.md handoff file. This file contains the proposed rule change, the reasoning based on the PR evidence, and the specific file paths to be modified.
Sources: dev/README.md:32-34, .agents/skills/harvesting-skill-review/SKILL.md:65-72
Rule Authoring Principles
When drafting the harvested rules, the agent adheres to specific authoring standards to ensure clarity for other AI models.
One Fact, One Home
You must state a claim or command in exactly one file and point to it from elsewhere. This prevents "drift," where multiple files contain conflicting versions of the same rule.
Sources: dev/guidelines/skill-authoring.md:54-60, dev/knowledges/skill-writing-guide.md:95-101
Reasoning Over Imperatives
AI models generalize better from reasoning. Rules must explain why a constraint matters (e.g., "Use full kind references because Infrahub resolves relationships by full namespace"). You should avoid using excessive capitalizations like MUST, NEVER, or ALWAYS unless accompanied by justification.
Sources: dev/guidelines/skill-authoring.md:43-47, dev/knowledges/skill-writing-guide.md:44-50
Progressive Disclosure
Rules must be modular so they can be loaded selectively. The architecture uses a three-level system:
- Metadata: Triggering via frontmatter.
- SKILL.md: Overview and workflow.
- Supporting Files: Rules, examples, and references.
The diagram represents the loading strategy used to manage context window usage.
Sources: dev/knowledges/architecture.md:47-65, dev/guidelines/skill-authoring.md:39-42
Conclusion
The "Harvesting Skill Reviews" agent is critical for the evolution of the Infrahub skill ecosystem. By formalizing human review feedback through the Minimum Change ladder and the "One Fact, One Home" principle, it creates a self-improving guidance system that reduces repetitive manual corrections.
Sources: .agents/skills/harvesting-skill-review/SKILL.md:85-95, dev/guidelines/minimum-change.md:45-52