Best for
- Activation Triggers
- When NOT to Use
- Review what an AI (or anyone) changed in a locally edited document.
MichelKerkmeester/opencode--skilled-agent-loops-with-spec-kit-memory/.opencode/skills/sk-doc/sk-create-diff/SKILL.md
Local, Git-free before/after review of an edited document (text, Markdown, HTML, DOCX, text PDF) as a self-contained HTML report.
Decision brief
create-diff is the sk-doc workflow packet for reviewing what changed in a locally edited document — outside Git and without a hosted service. It captures a baseline before an edit, then compares the before and after versions and renders a single self-contained, accessible HTML r…
Compatibility matrix
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/MichelKerkmeester/opencode--skilled-agent-loops-with-spec-kit-memory --skill ".opencode/skills/sk-doc/sk-create-diff"Inspect the Agent Skill "sk-create-diff" from https://github.com/MichelKerkmeester/opencode--skilled-agent-loops-with-spec-kit-memory/blob/3d386ee21366523774d89c0aff3ebbbc8fa7ff10/.opencode/skills/sk-doc/sk-create-diff/SKILL.md at commit 3d386ee21366523774d89c0aff3ebbbc8fa7ff10. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
INTENTMODEL = { "autocapturecompare": {"weight": 4, "keywords": ["review edits", "before/after", "before after review", "document change report", "what changed"]}, "explicitpair": {"weight": 4, "keywords": ["compare two files", "old and new", "before and after files", "explicit…
The report is a single self-contained HTML file (inlined CSS, no scripts, no network). Views: --view unified (default) or --view side-by-side.
1. Confirm the source file is byte-for-byte unchanged (compare should never write to it). 2. Run python3 scripts/validatereport.py → expect PASS (asserts doctype, lang, a Content-Security-Policy meta tag, zero , no inline event handlers, no remote resource references). 3. Report…
Use this packet when the request asks to:
Use this packet when the request asks to:
Permission review
The documentation asks the agent to run terminal commands or scripts.
python3 scripts/create_diff.py capabilitiesThe documentation asks the agent to create, modify, or delete local files.
# 1. BEFORE the edit — capture a baseline (copies the file into a local .sk-create-diff/ store;The documentation asks the agent to run terminal commands or scripts.
python3 scripts/create_diff.py snapshot path/to/doc.mdThe documentation asks the agent to create, modify, or delete local files.
# 3. AFTER the edit — compare the current file against its latest baseline and render the reportThe documentation asks the agent to read local files, directories, or repositories.
Read a file before editing it; never modify the source document during comparison.The documentation includes sending, uploading, or posting data to a remote service.
Never send document content off-machine or fetch a remote resource into the report.The documentation includes network, browsing, or remote request actions.
Never send document content off-machine or fetch a remote resource into the report.Evidence record
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 91/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 34 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
create-diff is the sk-doc workflow packet for reviewing what changed in a locally edited document — outside Git and without a hosted service. It captures a baseline before an edit, then compares the before and after versions and renders a single self-contained, accessible HTML report. The comparison engine ships with this packet as scripts/create_diff.py; everything runs on the machine with no network, no upload, and no telemetry, and source files are never modified.
Supported formats and fidelity tiers: plain text and Markdown (full text fidelity), HTML and DOCX (visible/structural text), and text-layer PDF (conditional on a local extractor). Each report states its fidelity tier so a comparison is never trusted beyond what the extractor can actually see.
This packet owns diff authoring and its two scripts. It uses shared sk-doc standards from ../shared/ for surrounding-document quality. It must not add packet-local advisor metadata such as graph-metadata.json or description.json.
Use this packet when the request asks to:
Keyword triggers: create diff report, document before/after review, before/after document diff, document change report, review document edits, docx diff, pdf diff.
Route elsewhere when:
git/sk-git for source diffs.create-quality-control.create-* packet.If the target document or output path is unknown and acting would be a guess, ask before writing.
This packet ships a flat references/ route-map and worked-example fixtures under assets/; there are no references/<key>/ or assets/<key>/ subdirectories to infer. Routing is intent-based:
UNKNOWN_FALLBACK: confirm the document, whether a baseline exists, and the report path before acting.references/README.md and report the gap.from pathlib import Path
SKILL_ROOT = Path(__file__).resolve().parent
RESOURCE_BASES = (SKILL_ROOT / "references", SKILL_ROOT / "assets")
DEFAULT_RESOURCE = "references/README.md"
# Two workflow shapes for one intent: automatic (snapshot-backed) or explicit pair.
INTENT_MODEL = {
"auto_capture_compare": {"weight": 4, "keywords": ["review edits", "before/after", "before after review", "document change report", "what changed"]},
"explicit_pair": {"weight": 4, "keywords": ["compare two files", "old and new", "before and after files", "explicit pair"]},
}
UNKNOWN_FALLBACK_CHECKLIST = [
"Confirm the target document (and its format)",
"Confirm whether a baseline snapshot already exists",
"Confirm the output report path",
]
def discover_markdown_resources() -> set[str]:
docs = []
for base in RESOURCE_BASES:
if base.exists():
docs.extend(path for path in base.rglob("*.md") if path.is_file())
return {doc.relative_to(SKILL_ROOT).as_posix() for doc in docs}
def _guard_in_skill(relative_path: str) -> str:
resolved = (SKILL_ROOT / relative_path).resolve()
resolved.relative_to(SKILL_ROOT)
if resolved.suffix.lower() != ".md":
raise ValueError(f"Only markdown resources are routable: {relative_path}")
return resolved.relative_to(SKILL_ROOT).as_posix()
def load_if_available(relative_path, inventory, loaded, seen) -> None:
guarded = _guard_in_skill(relative_path)
if guarded in inventory and guarded not in seen:
load(guarded)
loaded.append(guarded)
seen.add(guarded)
def score_intents(request) -> dict:
text = request.text.lower()
scores = {intent: 0 for intent in INTENT_MODEL}
for intent, cfg in INTENT_MODEL.items():
for kw in cfg["keywords"]:
if kw in text:
scores[intent] += cfg["weight"]
return scores
def route_diff_request(request):
inventory = discover_markdown_resources()
loaded, seen = [], set()
scores = score_intents(request)
if max(scores.values() or [0]) < 4: # Tier 1: target/baseline/output unclear
load_if_available(DEFAULT_RESOURCE, inventory, loaded, seen)
return {
"load_level": "UNKNOWN_FALLBACK",
"needs_disambiguation": True,
"disambiguation_checklist": UNKNOWN_FALLBACK_CHECKLIST,
"resources": loaded,
}
shape = max(scores, key=scores.get) # Tier 2: workflow shape resolved
for path in sorted(inventory):
load_if_available(path, inventory, loaded, seen)
return {"shape": shape, "resources": loaded}
All comparison, extraction, snapshotting, and rendering are done by scripts/create_diff.py. Run it from this packet directory (or give an absolute path to it). The invariant is: capture the baseline before the edit — a diff needs a real before-state.
# 0. (optional) confirm what is supported and at what fidelity
python3 scripts/create_diff.py capabilities
# 1. BEFORE the edit — capture a baseline (copies the file into a local .sk-create-diff/ store;
# never touches the source)
python3 scripts/create_diff.py snapshot path/to/doc.md
# 2. ... let the edit happen (AI or human) ...
# 3. AFTER the edit — compare the current file against its latest baseline and render the report
python3 scripts/create_diff.py compare path/to/doc.md --report review.html
Use this when there is no baseline, when comparing two arbitrary versions, or when the automatic store is unavailable:
python3 scripts/create_diff.py compare-pair --before old.md --after new.md --report review.html
compare-pair can also review a pre-composed pair containing two or more files.
Wrap every file in both inputs with the same ordered, unique markers:
===== BEGIN FILE: docs/first.md =====
[file content]
===== END FILE: docs/first.md =====
===== BEGIN FILE: docs/second.md =====
[file content]
===== END FILE: docs/second.md =====
When both inputs contain a balanced matching envelope, the report renders every
start and end as an explicit full-width boundary band. Boundaries stay visible
through collapsed context, later files receive a 32px canvas gap before their
start band, and transitions reset Markdown section labels between files. This
does not add native directory comparison or repeated multi-file CLI arguments;
callers compose the two aggregate documents before invoking compare-pair.
--view unified (default) or --view side-by-side.START FILE and END FILE bands in both views; malformed envelopes remain ordinary document text.--report, the source stem is semantically normalized to lowercase kebab-case and emitted as <source-slug>.diff.html. An explicit report basename must already use lowercase kebab-case and the engine refuses to overwrite an existing report.python3 scripts/validate_report.py review.html
python3 scripts/create_diff.py status [path/to/doc.md] # list stored baselines
python3 scripts/create_diff.py cleanup --older-than 14 # prune old baselines (add --dry-run to preview)
Add --json to compare, compare-pair, capabilities, or status for a structured summary. Exit codes: 0 success · 2 usage error · 3 unsupported/limited format with no fallback · 4 missing baseline snapshot · 5 I/O or extraction failure. Map these to actionable messages rather than swallowing them.
State the tier to the user; never present a low-fidelity comparison as complete.
| Format | Tier | What is compared | Not compared |
|---|---|---|---|
| text | full | exact text | — |
| markdown | full | exact text + heading/section awareness | rendered-HTML differences |
| html | text | visible text | CSS, attributes, inline styles, scripts, layout |
| docx | text | paragraph and table text | formatting, styles, images, comments, tracked changes |
| text* | text layer only | layout, images; scanned/image-only PDFs (no OCR) |
text* (PDF) requires a local extractor — poppler's pdftotext or the pypdf/pdfplumber package. Run capabilities to see what is available; when none is, the engine says so and offers the explicit-pair fallback with pre-extracted text. Full detail: references/capabilities-and-fidelity.md.
scripts/validate_report.py on a generated report before handing it off, and report the result.text/text*-tier comparison as if it captured formatting, layout, or tracked changes.graph-metadata.json or description.json.Before delivery:
python3 scripts/validate_report.py <report> → expect PASS (asserts doctype, lang, a Content-Security-Policy meta tag, zero <script>, no inline event handlers, no remote resource references).+added −removed ~changed, possible moves, fidelity tier) and the report path.If the validator fails, fix the renderer or report the failure explicitly — do not claim a clean, self-contained report.
The task is successful when:
validate_report.py.../mode-registry.json and ../hub-router.json; the single advisor identity and workflow registry live at the hub root, not here.../shared/ provides sk-doc quality standards and the document validator for surrounding markdown when that is in scope.parent-skill-check.cjs, sk-create-skill/scripts/package_skill.py --check, and scripts/check-frontmatter-versions.sh validate this packet's registration and shape./create:diff command — the mode is invocable as /create:diff (:auto/:confirm) via a full sibling-pattern router plus presentation and auto/confirm YAML assets under .opencode/commands/create/, alongside advisor-alias routing and direct script invocation.sk-git (code/Git diffs) and create-quality-control (single-document audit).references/README.md — reference route-map (capabilities/fidelity, workflow, CLI reference, accessibility contract, worked example).feature-catalog/feature-catalog.md — canonical inventory of this mode's capabilities.manual-testing-playbook/manual-testing-playbook.md — operator-facing manual validation scenarios.assets/fixtures/ — a runnable before/after worked example.../shared/ — shared sk-doc quality standards and document validator..opencode/specs/sk-doc/016-create-diff-mode/ (parent spec, phase 006-opencode-skill-and-accessibility, research synthesis in 001-research-and-requirements/research/research.md).scripts/create_diff.py — the comparison engine (extraction, diff, snapshots, report).scripts/validate_report.py — report safety/self-containment validator.references/cli-reference.md — full command, flag, and exit-code reference.references/capabilities-and-fidelity.md — format support matrix and fidelity tiers.references/workflow.md — baseline-capture, explicit-pair, and snapshot lifecycle.references/accessibility-contract.md — the report's accessibility guarantees.references/worked-example.md — an end-to-end walkthrough using the shipped fixtures.Frequently asked questions
create-diff is the sk-doc workflow packet for reviewing what changed in a locally edited document — outside Git and without a hosted service. It captures a baseline before an edit, then compares the before and after versions and renders a single self-contained, accessible HTML r…
The source record exposes this install command: npx skills add https://github.com/MichelKerkmeester/opencode--skilled-agent-loops-with-spec-kit-memory --skill ".opencode/skills/sk-doc/sk-create-diff". Inspect the command and pinned source before running it.
Static rules flagged exec-script, write-files, read-files, send-data, network in the source; the page lists the matching lines and excerpts.
Alternatives
alirezarezvani/claude-skills
App Store Optimization (ASO) toolkit for researching keywords, analyzing competitor rankings, generating metadata suggestions, and improving app visibility on Apple App Store and Google Play Store. Use when the user asks about ASO, app store rankings, app metadata, app titles and descriptions, app store listings, app visibility, or mobile app marketing on iOS or Android. Supports keyword research and scoring, competitor keyword analysis, metadata optimization, A/B test planning, launch checklist
wanshuiyin/Auto-claude-code-research-in-sleep
Use it for operations and research tasks; the detail page covers purpose, installation, and practical steps.
prowler-cloud/prowler
PostgreSQL indexing best practices for Prowler: index design, partial indexes, partitioned table indexing, EXPLAIN ANALYZE validation, concurrent operations, monitoring, and maintenance. Trigger: When creating or modifying PostgreSQL indexes, analyzing query performance with EXPLAIN, debugging slow queries, reviewing index usage statistics, reindexing, dropping indexes, or working with partitioned table indexes. Also trigger when discussing index strategies, partial indexes, or index maintenance
brucesongs/kali-claw
Insecure Design (OWASP A06:2025) focuses on security flaws in system architecture and design phases, rather than code implementation-level bugs.