opencode-extract-diffs

Convert raw OpenCode diff artifacts into patch-ready files with git apply validation.

6|Updated Mar 11, 2026
One-click install
npx skills add https://github.com/open-hax/opencode-skills --skill opencode-extract-diffs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: opencode-extract-diffs
Source: https://github.com/open-hax/opencode-skills/tree/main/.opencode/skills/opencode-extract-diffs
Command: npx skills add https://github.com/open-hax/opencode-skills --skill opencode-extract-diffs

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

OpenCode session artifacts often contain raw or inconsistent diff dumps. This skill cleans and structures them into usable patch files for review and application.

Core Features & Use Cases

  • Extracts diff snapshots from OpenCode artifacts and normalizes paths to be repo-relative.
  • Splits large diffs into per-file patches and validates patches with git apply --check.
  • Groups patches by feature or session for review and application.

Quick Start

Run a session that contains diff dumps and specify the target repository root to produce clean patch files.

Frequently Asked Questions about opencode-extract-diffs

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I extract clean patches from raw OpenCode diff artifacts?

To extract clean patches from OpenCode diff artifacts, the skill identifies raw diff dumps, normalizes paths to be repo-relative, splits them into per-file patches, and validates them with git apply --check.

What is the best way to normalize file paths in a large diff dump?

Normalizing file paths in a large diff dump is handled by enforcing repo-relative path normalization, splitting large diffs into per-file patches, and grouping them by feature for structured review.

Can I validate extracted diff files with git apply before committing them?

Yes, you can validate extracted diff files because the skill automatically runs git apply --check on the normalized patches to ensure they are clean, compatible, and ready for application.

How do I split a multi-file diff artifact into individual patch files?

Splitting a multi-file diff artifact into individual patch files is achieved by processing OpenCode session outputs, separating each file's diff, and validating them independently with git apply --check.

Do I need to specify a target repository root to normalize diff paths?

Yes, specifying the target repository root is required to normalize diff paths correctly, allowing the extracted patches to be grouped by feature and validated as repo-relative files.