diff-evidence-agent

$npx mdskill add Agile-V/agile_v_skills/diff-evidence-agent

Generate evidence explaining actual implementation changes and their impact

  • Identifies differences between expected and actual code changes.
  • Uses impact assessment data to correlate changes with predicted outcomes.
  • Decides on the relevance of each change based on risk assessment and requirements documentation.
  • Delivers a summary report detailing the changes and their effects for review.

SKILL.md

.github/skills/diff-evidence-agentView on GitHub ↗
---
name: diff-evidence-agent
description: Create evidence explaining the actual implementation diff and its relationship to the predicted impact, closing the loop between pre-change prediction and post-change reality.
license: CC-BY-SA-4.0
compatibility: opencode
metadata:
  version: "1.0"
  standard: "Agile V"
  author: agile-v.org
---

# Skill: diff-evidence-agent

## Purpose

Create evidence explaining the actual implementation diff and its relationship to the predicted
impact. This skill closes the loop between the pre-change impact prediction and the post-change
reality, and is a key input for the Red Team's evidence quality check.

---

## Trigger conditions

Use this skill after implementation and before final validation. Specifically:

- After the Build Agent has made changes.
- After tests have been run.
- Before Red Team evidence verification.
- When generating the final evidence bundle.
- When a reviewer asks "what actually changed vs what was predicted?"

---

## Inputs

```text
- implementation diff (git diff HEAD~1 or patch file)      required
- .agile-v/impact/impact_map.md                            required
- .agile-v/impact/change_risk_assessment.md                required
- .agile-v/requirements/requirements.md                    required
- .agile-v/traceability/graph_traceability_matrix.md       required
- test results (JSON or JUnit XML)                         required
- .understand-anything/diff-overlay.json                   optional
```

---

## Outputs

All outputs are written to `.agile-v/traceability/` (alongside the traceability matrix).

```text
diff_impact_report.md
risk_delta.md
release_impact_summary.md
changed_node_list.json
```

---

## Required behavior

### Step 1: Parse the diff

1. List all files changed, added, and deleted in the implementation diff.
2. For each changed file, extract the key symbols modified (function names, class names).
3. Map each changed file to graph nodes using the normalized graph (if available).

### Step 2: Compare predicted vs actual impact

For each node in `impact_map.md`:
1. Check whether it was actually changed.
2. Record: Predicted=Yes, Changed=Yes/No.

For each changed file:
1. Check whether it was in the impact map.
2. If not, record as an unexpected change.

### Step 3: Explain unexpected changes

For each unexpected change (file changed but not in impact map):
1. Identify why it was changed.
2. Classify: acceptable (module wiring, formatting, etc.) or concerning (scope creep, unintended).
3. Record in `diff_impact_report.md`.

### Step 4: Update risk status

For each risk in `change_risk_assessment.md`:
1. Check whether the risk was realized (test failed, unexpected behavior found).
2. Update risk status: mitigated / realized / residual.
3. Record in `risk_delta.md`.

### Step 5: Record decision

Decide:
- **Accept** — all unexpected changes are justified, risks are mitigated, tests pass.
- **Rework required** — unexpected changes are not justified, tests failed, risks unmitigated.

---

## Output template: diff_impact_report.md

```markdown
# Diff Impact Report

## Summary

<What changed and why.>

## Predicted vs Actual Impact

| Component | Predicted | Changed | Explanation |
|---|---|---|---|
| src/auth/auth.controller.ts | Yes | Yes | Expected implementation change |
| src/auth/auth.module.ts | Yes | Yes | Required for module wiring |
| src/auth/auth.service.ts | Low confidence | No | Not required; guard runs before service |

## Unexpected Changes

| File | Reason | Risk |
|---|---|---|
| ... | ... | Acceptable / Scope creep |

## Regression Evidence

| Risk | Test Evidence | Result |
|---|---|---|
| ... | ... | Pass/Fail |

## Decision

- Accept / Rework required
- Reason: ...
```

---

## Output schema: changed_node_list.json

```json
[
  {
    "path": "src/auth/auth.controller.ts",
    "component_id": "node-042",
    "change_type": "modified",
    "predicted": true,
    "symbols_changed": ["AuthController.login"],
    "unexpected": false,
    "justification": null
  }
]
```

---

## Anti-patterns to avoid

- Do not mark all unexpected changes as acceptable without a specific justification.
- Do not skip the risk delta document.
- Do not accept the diff if any critical risk is unrealized (test failed for a high-severity risk).
- Do not include raw source code diffs in the evidence report (use line counts and symbol names).

---

## Compatible tools

Claude Code, Cursor, Copilot, Codex, Gemini CLI, OpenCode, Cline.

More from Agile-V/agile_v_skills

SkillDescription
agile-v-behavioralAnti-pattern prevention guidelines for Agile V agents. Prevents common LLM coding mistakes while maintaining Agile V traceability. Use when implementing requirements to avoid overcomplication, silent assumptions, scope creep, and verification failures.
agile-v-complianceRisk management, CAPA protocol, human gate approval records, AI agent security controls, and periodic revalidation. Load when running gates, handling CAPAs, or auditing compliance and security posture.
agile-v-control-matrixDefines and checks the Agile-V control matrix for agentic tasks, skills, model use, tools, logs, rights, Human Gates, tests, costs, rollback, and owners. Load when creating, reviewing, or enforcing `.agile-v/CONTROL_MATRIX.yaml` or runtime governance for agentic execution.
agile-v-coreFoundational values, directives, and context engineering rules for all Agile V agents. Load first in every Agile V session.
agile-v-lifecycleMulti-cycle iteration management, document versioning, change requests, re-entry points, archival, and impact analysis. Load when starting a new cycle (C2+), processing change requests, or managing cross-cycle traceability.
agile-v-pipelineOrchestration pipeline, wave execution, handoff protocols, and checkpoint types for the Agile V 5-stage workflow. Load when orchestrating multi-agent pipelines or managing stage transitions.
agile-v-product-ownerREQ-aware Product Owner for backlog and sprint management with full traceability. Use for sprint planning, backlog prioritization, or converting REQs to INVEST stories.
agile-v-quality-gatesQuality validation gates for Agile V agents. Adds interface validation, test quality checks, data type awareness, and time allocation guidance to prevent common failure patterns identified in comprehensive testing.
build-agentGenerates code, firmware, HDL, or other technical artifacts strictly derived from approved requirements. Language-agnostic. Use when synthesizing artifacts from Logic Gatekeeper-approved requirements.
build-agent-dartDart/Flutter build agent for mobile apps, Flutter widgets, and Dart packages. Extends build-agent with Dart-specific conventions. Use when building Flutter apps, Dart packages, or mobile (iOS/Android) features.