Files
gh-reqvire-org-reqvire-reqv…/commands/analyze-impact.md
2025-11-30 08:51:32 +08:00

2.7 KiB

allowed-tools, argument-hint, description, model
allowed-tools argument-hint description model
Read, Bash(reqvire:*), Bash(git:*)
commit-hash
Analyze change impact for modified requirements using git commit history claude-sonnet-4-5-20250929

Analyze Change Impact

Analyze how changes to requirements propagate through the model.

Comparison Target

${1:+Comparing against: $1} ${1:-Comparing against: HEAD~1 (previous commit)}

Steps

  1. Get base commit:

    ${1:+Using provided commit: $1} ${1:-Ask user for commit hash or use default:}

    # Compare against HEAD~1 (previous commit)
    BASE_COMMIT="${1:-HEAD~1}"
    
    # Or compare against specific commit
    BASE_COMMIT="<commit-hash>"
    
    # Or compare against base branch
    BASE_COMMIT=$(git merge-base main HEAD)
    
  2. Run change impact analysis:

    reqvire change-impact --git-commit=${1:-HEAD~1}
    reqvire change-impact --git-commit=${1:-HEAD~1} --json > /tmp/impact.json
    
  3. Analyze the results:

    Extract from JSON:

    • added_elements[] - New requirements/verifications
    • modified_elements[] - Changed requirements/verifications
    • affected_elements[] - Elements impacted by changes
  4. For each modified requirement:

    reqvire search --filter-id="<requirement-id>"
    reqvire traces --filter-id="<requirement-id>"
    

    Identify:

    • What changed in the requirement
    • Which verifications verify this requirement
    • Which implementations satisfy this requirement
    • Which children derive from this requirement
  5. Present impact findings:

    Added Elements:

    Modified Elements:

    Affected Elements (propagation):

    • Verifications needing review: X
    • Implementations needing update: Y
    • Child requirements affected: Z
  6. Provide recommendations:

    • Review and update affected verifications
    • Update test criteria if requirements changed
    • Review implementations marked with satisfiedBy
    • Run tests for affected verifications
    • Update child requirements if parent semantics changed

Change Propagation Rules

  • Parent → Child: Parent changes propagate to all derived children
  • Requirement → Verification: Requirement changes invalidate verifications
  • Requirement → Implementation: May need implementation updates
  • Verification changes: Generally don't propagate upward

Notes

  • Use for understanding impact before making changes
  • Run after making changes to identify affected elements
  • Focus on verifications - they need review when requirements change
  • Use /generate-tasks to create implementation tasks from impact