Files
2025-11-29 18:26:08 +08:00

78 lines
1.5 KiB
Markdown

# file.compare
Compare two files and generate detailed diff reports showing line-by-line differences
## Overview
**Purpose:** Compare two files and generate detailed diff reports showing line-by-line differences
**Command:** `/file/compare`
## Usage
### Basic Usage
```bash
python3 skills/file/compare/file_compare.py
```
### With Arguments
```bash
python3 skills/file/compare/file_compare.py \
--file_path_1 "value" \
--file_path_2 "value" \
--output_format_(optional) "value" \
--output-format json
```
## Inputs
- **file_path_1**
- **file_path_2**
- **output_format (optional)**
## Outputs
- **diff_report.json**
## Artifact Metadata
### Produces
- `diff-report`
## Permissions
- `filesystem:read`
## Implementation Notes
Use Python's difflib to compare files line by line. Support multiple output formats: - unified: Standard unified diff format - context: Context diff format - html: HTML diff with color coding - json: Structured JSON with line-by-line changes Include statistics: - Total lines added - Total lines removed - Total lines modified - Percentage similarity Handle binary files by detecting and reporting as non-text.
## Integration
This skill can be used in agents by including it in `skills_available`:
```yaml
name: my.agent
skills_available:
- file.compare
```
## Testing
Run tests with:
```bash
pytest skills/file/compare/test_file_compare.py -v
```
## Created By
This skill was generated by **meta.skill**, the skill creator meta-agent.
---
*Part of the Betty Framework*