# Compare

> Compare two document versions and produce analysis or a Word redline. Use when the user has two versions of a document and wants to understand what changed.

- **Type:** Skill
- **Install:** `agentstack add skill-anylegal-ai-anylegal-oss-compare`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [anylegal-ai](https://agentstack.voostack.com/s/anylegal-ai)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [anylegal-ai](https://github.com/anylegal-ai)
- **Source:** https://github.com/anylegal-ai/anylegal-oss/tree/main/backend/anylegal_oss/workspace/skills/compare

## Install

```sh
agentstack add skill-anylegal-ai-anylegal-oss-compare
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Document Comparison

## When to Use

Use this skill when:
- The user uploads two versions of the same document
- The user says /compare
- The user asks "what changed", "what's different", or "show me the differences"
- The user asks for a redline or tracked-changes document
- The user received a counterparty markup and wants to understand the changes

## Process

1. **Identify the two documents** — ask the user which is the original and which is the revised version if not clear
2. **Read both documents** via `read_document`
3. **Run `compare`** with both document paths or texts — this returns a structured diff, similarity percentage, and visual output
4. **Analyze the differences:**
   - What was added, removed, or modified?
   - Which changes are substantive vs. editorial?
   - Are any changes risky or favorable?
   - Do changes align with playbook positions (if available in context)?
5. **Present findings** with a summary of key changes
6. **If user wants a Word redline** — call `run_code` (default Python) to generate a DOCX with tracked changes. Open the original with python-docx, compute a diff against the revised text, and insert `w:ins`/`w:del` tracked-change markup via lxml. See `/docx-editing` skill for OOXML tracked change patterns. Verify the output with structural checks.

## Output Format

- **Summary**: Overall similarity %, number of changes, nature of changes (substantive vs. editorial)
- **Key Changes**: List of the most significant changes with assessment:
  - What changed
  - Why it matters (risk/benefit)
  - Recommendation (accept / reject / negotiate)
- **Full Change List**: All detected changes in order
- **Action Items**: What to do next (accept, push back, request clarification)

## Guidelines

- Always present the original vs. revised framing clearly
- Distinguish substantive changes (liability caps, notice periods, governing law) from editorial changes (formatting, numbering, defined terms)
- Prioritize substantive changes in the summary
- If playbook is available, flag changes that deviate from firm positions
- When producing a DOCX redline, confirm which direction the user wants (their changes tracked, or counterparty changes tracked)

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [anylegal-ai](https://github.com/anylegal-ai)
- **Source:** [anylegal-ai/anylegal-oss](https://github.com/anylegal-ai/anylegal-oss)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-anylegal-ai-anylegal-oss-compare
- Seller: https://agentstack.voostack.com/s/anylegal-ai
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
