diff

by BytesAgain

Compare files and directories, merge changes, and generate patches. Use when comparing versions, merging changes, generating patch files.

View Chinese version with editor review

安装

claude skill add --url github.com/openclaw/skills/tree/main/skills/bytesagain3/diff

文档

Diff

A devtools logging and tracking toolkit. Record, search, and export entries across multiple development categories — check, validate, generate, format, lint, explain, convert, template, diff, preview, fix, and report. Each command stores timestamped entries locally and maintains a full activity history.

Commands

check — Record or view check entries

Log a check result or review recent check entries. Called with no arguments, shows the last 20 entries.

bash
bash scripts/script.sh check "build passed for commit abc123"
bash scripts/script.sh check "unit tests: 42 passed, 0 failed"
bash scripts/script.sh check

validate — Record or view validation entries

Log validation results (schema checks, input validation, data integrity).

bash
bash scripts/script.sh validate "JSON schema valid against draft-07"
bash scripts/script.sh validate "input validation: 3 fields missing constraints"
bash scripts/script.sh validate

generate — Record or view generation entries

Track code generation, scaffold creation, or output generation tasks.

bash
bash scripts/script.sh generate "generated TypeScript types from GraphQL schema"
bash scripts/script.sh generate "scaffolded new microservice: order-processor"

format — Record or view formatting entries

Log code formatting operations.

bash
bash scripts/script.sh format "ran gofmt on pkg/ — 8 files reformatted"
bash scripts/script.sh format

lint — Record or view lint entries

Track linting results and code quality checks.

bash
bash scripts/script.sh lint "golangci-lint: 0 errors, 2 warnings"
bash scripts/script.sh lint "shellcheck: all scripts clean"

explain — Record or view explanation entries

Save explanations of code behavior, error messages, or design decisions.

bash
bash scripts/script.sh explain "diff algorithm: Myers O(ND) used for line-level comparison"
bash scripts/script.sh explain "merge conflict in config.yaml — both branches added same key"

convert — Record or view conversion entries

Track format conversions and data transformations.

bash
bash scripts/script.sh convert "converted unified diff to side-by-side format"
bash scripts/script.sh convert "transformed XML config to YAML"

template — Record or view template entries

Log template creation or usage.

bash
bash scripts/script.sh template "created diff report template for PR reviews"
bash scripts/script.sh template "applied changelog template to release notes"

diff — Record or view diff entries

Track diff comparisons and change summaries.

bash
bash scripts/script.sh diff "config v1 vs v2: 3 keys added, 1 removed, 2 changed"
bash scripts/script.sh diff "schema migration: 5 columns added across 3 tables"

preview — Record or view preview entries

Log preview/dry-run results before applying changes.

bash
bash scripts/script.sh preview "merge preview: 12 files changed, 3 conflicts detected"
bash scripts/script.sh preview "patch dry-run: applies cleanly to target branch"

fix — Record or view fix entries

Track bug fixes and patches.

bash
bash scripts/script.sh fix "resolved merge conflict in routes.ts"
bash scripts/script.sh fix "patched off-by-one in line number calculation"

report — Record or view report entries

Log report generation or summary observations.

bash
bash scripts/script.sh report "PR diff summary: +342 -128 across 14 files"
bash scripts/script.sh report "weekly change report: 23 commits, 8 PRs merged"

stats — Summary statistics

Show entry counts per category, total entries, data size, and earliest recorded activity.

bash
bash scripts/script.sh stats

export — Export all data

Export all logged entries to JSON, CSV, or plain text format.

bash
bash scripts/script.sh export json
bash scripts/script.sh export csv
bash scripts/script.sh export txt

search — Search across all entries

Search all log files for a keyword (case-insensitive).

bash
bash scripts/script.sh search "merge"
bash scripts/script.sh search "conflict"

recent — View recent activity

Show the last 20 entries from the global activity history.

bash
bash scripts/script.sh recent

status — Health check

Display version, data directory, total entries, disk usage, and last activity timestamp.

bash
bash scripts/script.sh status

help / version

bash
bash scripts/script.sh help
bash scripts/script.sh version

Data Storage

All data is stored locally in ~/.local/share/diff/:

  • Per-command logs: check.log, validate.log, generate.log, format.log, lint.log, explain.log, convert.log, template.log, diff.log, preview.log, fix.log, report.log
  • Activity history: history.log — global log of all operations with timestamps
  • Exports: export.json, export.csv, or export.txt (generated on demand)

Each entry is stored as YYYY-MM-DD HH:MM|<value> with pipe-delimited fields.

Requirements

  • bash 4+
  • grep, wc, du, tail, head, cat, date, basename (standard coreutils)
  • No external dependencies

When to Use

  1. Code review documentation — Use check, validate, and report to log PR review findings and change summaries
  2. Change tracking — Record file and schema diffs with diff to maintain a history of what changed and when
  3. Merge conflict resolution — Log conflicts found (preview), how they were resolved (fix), and explanations (explain)
  4. Release management — Track formatting, linting, and validation before each release with a full audit trail
  5. Template-driven workflows — Use template and generate to log scaffolding and code generation across projects

Examples

bash
# Log a code review workflow
bash scripts/script.sh check "PR #301: all tests passing"
bash scripts/script.sh lint "eslint clean, no new warnings"
bash scripts/script.sh diff "PR #301: +89 -23 across 5 files"
bash scripts/script.sh report "approved PR #301 with minor suggestions"

# Track a merge conflict resolution
bash scripts/script.sh preview "merge develop→main: 2 conflicts in api/routes.ts"
bash scripts/script.sh fix "resolved conflict: kept develop version of auth middleware"
bash scripts/script.sh explain "conflict caused by parallel refactor of auth flow"

# View stats and export
bash scripts/script.sh stats
bash scripts/script.sh export json

# Search for historical entries
bash scripts/script.sh search "conflict"
bash scripts/script.sh recent

Powered by BytesAgain | bytesagain.com | hello@bytesagain.com