Install
$ agentstack add skill-mr-kelly-skills-kelly-legal-contracts ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ● Environment & secrets Used
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
Kelly Legal Contracts
Overview
Use this skill as a local legal-contract review desk. The agent can ingest contract facts or extracted clauses, map issues against a company playbook, draft fallback language, and prepare issue-list exports. The human legal reviewer inspects every issue in a local App UI, edits recommendations, approves safe exports, requests changes, or blocks high-risk items.
Default interaction mode: App UI. Unless the user explicitly asks for chat-only handling, check onboarding/config, refresh or ingest the contract review snapshot, start/reuse the local app with app/start.sh, and give the actual local URL. Use chat-only mode only when the user says "纯聊天", "chat only", "不要打开 UI", or similar; in that mode present numbered issues (Issue #1) and take verdicts in conversation.
App UI Screenshots
OverviewLegal command desk with contract × workstream status, risk pass rate, review queue preview, and recent activity. Review queueApproval-gated legal issue queue with approve / request changes / block decisions and audit notes.
Risk checksPer-rule pass/warn/fail results across clause issues, including hard-stop terms and playbook violations. Clause issuesEditable issue detail with fallback language, memo fields, reviewer rationale, and risk-check evidence.
Boundary
- This skill assists legal operations and contract review; it does not provide final legal advice and does not replace licensed counsel or an authorized legal reviewer.
- The skill may read user-supplied contract text, summaries, playbooks, and clause positions; draft issue summaries and fallback language; run deterministic risk checks; and write local handoff files.
- The app reads and writes local files only. It never sends redlines, emails counterparties, signs contracts, accepts terms, deletes files, or performs external side effects.
- Every outbound legal position, redline, counterparty message, approval, signature, filing, or waiver is approval-required and happens outside the app only after explicit human approval.
- Treat contracts and playbooks as sensitive. Do not commit
config.local.json, env files,app/.data/, exports, contract text, counterparties, or privileged notes.
First Run And Onboarding
On invocation, check app/.data/onboarding.json and private config readiness. If onboarding is absent/incomplete, guide setup before doing real work.
Private config priority:
KELLY_LEGAL_CONTRACTS_CONFIG=/absolute/path/to/config.jsonskills/kelly-legal-contracts/config.local.json~/.config/kelly-legal-contracts/config.jsonskills/kelly-legal-contracts/config.example.jsonas template only
Env priority:
- Existing environment variables
KELLY_LEGAL_CONTRACTS_ENV_FILE=/absolute/path/to/.env- Repository root
.env skills/kelly-legal-contracts/.env.local~/.config/kelly-legal-contracts/.env
Onboarding asks, turn by turn: legal profile (company/entity, reviewer role, preferred risk scale), enabled workstreams (nda, msa, dpa, sow), jurisdictions, clause playbook sources, hard-stop terms, escalation policy, export preferences, and which external skill handles approved sends/redlines if any. Ask for non-secret details only; secrets belong only in local env files. When setup is complete and the user confirms, write:
{
"completed": true,
"completed_at": "ISO timestamp",
"config_version": "1"
}
Local App
Start the desk with:
skills/kelly-legal-contracts/app/start.sh
The app uses local HTTP on 127.0.0.1, preferring ports 3000 through 4000, or KELLY_LEGAL_CONTRACTS_UI_PORT when set. /api/state reports app: "kelly-legal-contracts".
Required app views:
#/overview: legal command desk with contract × workstream status, risk pass rate, review queue preview, and recent activity.#/productsand#/products/: contract library. The internal schema keeps the genericproducts[]key, but the UI presents them as contracts with counterparty, matter type, facts, key obligations, watch terms, required document checklist, and linked issues.#/draftsand#/drafts/: clause issue workbench. Internaldrafts[]are agent-prepared contract issues with editable fallback language, negotiation notes, memo summary, and linked risk checks.#/checks: deterministic risk checks across issues, including required fields, title limits, hard-stop terms, restricted positions, document checklist, and clause-playbook violations.#/claims: clause playbook. Internalclaims[]are approved fallback clauses or rejected positions;rules[]are hard-stop/restricted terms.#/review: approval queue with workflow states (needs_review/changes_requested/approved/done/blocked), risk summary, reviewer rationale, decision buttons,Review note, and stable refs (Issue #1).donemeans exported or handed off in the execution report.#/settings: sanitized legal profile, enabled workstreams/rules, jurisdictions, hard-stop term counts, export prefs, data provider, and onboarding state. Never expose secret values or raw private playbooks.
Demo mode:
?demo=overview,?demo=products,?demo=drafts,?demo=checks,?demo=claims,?demo=review, and?demo=detailopen deterministic mock scenes for documentation and screenshots.lang=enorlang=zhforces UI chrome language. Demo legal metadata is localized; contract/legal terms may stay in English when that is realistic.- Deep links such as
/?demo=detail&lang=zh#/drafts/d-msa-liability-usmust work. - Demo API responses never read or write files under
app/.data/.
File Contract
Read references/contracts-schema.md before editing the app, scripts, or any generated JSON.
app/.data/contract_snapshot.json: contracts, issues, risk rules, checks, review items, metrics, activity log.app/.data/claims.json: clause playbook — approved fallback clauses, rejected positions, and hard-stop/restricted terms.app/.data/decisions.json: reviewer verdicts keyed by review id.app/.data/agent_tasks.json: queuedrevise_contract_issuework for the agent.app/.data/execution_report.json: export, handoff, and revision operations.app/.data/onboarding.json: onboarding completion marker.app/.data/agent.lock: temporary lock while the skill writes; write endpoints reject with HTTP 423 while it exists.
Validate with scripts/validate_ui_schema.ts before relying on a snapshot.
Review Workflow
- Collect inputs: contract type, counterparty, our entity, governing law, deal owner, target date, business ask, extracted clause text, and company playbook positions.
- Create or update contract records and issue records with
scripts/ingest_contracts.ts payload.json. The current schema keeps generic keys (products,drafts,platform) for compatibility; map them as contract, issue, and workstream (nda,msa,dpa,sow). - Run
scripts/run_checks.tsto refresh deterministic risk checks and scores. The checks catch missing fields, hard-stop terms, restricted positions, all-caps/noisy terms, overlong notes, incomplete document checklists, and clause-playbook violations. - Send the reviewer to
#/review. Verdicts persist throughPOST /api/decisionintodecisions.json. Field edits saved in the workbench arrive asrevisedecisions carrying edited issue fields. - Poll
app/.data/agent_tasks.jsonforrevise_contract_issuetasks created byrequest_changes. Redraft the issue per the comment and return it toneeds_review. - Before executing anything, re-read decisions and run
node scripts/execute_decisions.ts(dry-run). With--applyit recordsexport_issue_list,handoff_redline, andrequest_revisionoperations inexecution_report.json— no external side effects.
Export Workflow
node scripts/export_issues.ts --out writes approved issues as Markdown issue memos plus issues.csv. It records export_issue_list entries and marks those issues done.
Actual sending, redline generation, counterparty communications, CLM updates, signature, or filing happen only outside the app after explicit approval, through the user or a separate approved connector/skill.
Safety Defaults
- Never fabricate legal approval, waiver, signature authority, regulatory conclusion, or attorney review.
- Treat legal, privacy, money, IP, employment, and dispute-related terms as approval-required.
- Do not send issue lists, redlines, fallback clauses, or counterparty messages without an explicit
approvedecision. - If a hard-stop term is present (
uncapped liability,perpetual data retention, broad indemnity, missing DPA terms), block or request changes rather than weakening the rule. - Preserve privilege and confidentiality: keep local data minimal, avoid copying full contracts when summaries/evidence snippets suffice, and never expose raw secrets or private playbooks through
/api/state, logs, reports, screenshots, or exported demo data.
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: mr-kelly
- Source: mr-kelly/skills
- License: MIT
- Homepage: https://mr-kelly.github.io/skills/
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.