Install
$ agentstack add skill-mr-kelly-skills-kelly-legal-precedent-desk ✓ 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.
About
Legal Precedent Desk
Overview
Use this skill as a local App-in-Skill desk. It finds and packages internal precedents for a new legal question: similar facts, local court tendencies, decisive evidence, holdings, citations, and a reviewer-approved research memo.
Default interaction mode: App UI. Unless the user explicitly asks for chat-only handling, check onboarding/config, refresh or generate the local snapshot, start or 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 stable refs such as Pack #1 and record verdicts in local decision files.
Business Role
Use this as the research gate between the approved internal casebase and matter work. It turns a focused legal question into reviewed similar-case packs with match rationale, local court pattern notes, citations, and use limits. Do not use it to ingest raw documents, decide case strategy by itself, or publish external citations without lawyer approval.
App UI Screenshots
OverviewPrecedent command desk with packs awaiting review, high-match cases, approved packs, and recent activity. Review queueSimilar-case packs with local court-pattern notes, citations, evidence, and approval controls.
ChecksQuality checks for citation traceability, similarity rationale, jurisdiction fit, and confidentiality limits. WorkbenchDetail view for precedent reasoning, decisive facts, internal citations, draft memo, and review note.
Boundary
- The skill reads user-authorized legal materials or metadata, reasons over them, drafts structured outputs, and writes local handoff files.
- The app reads and writes local files only. It never files documents, sends client advice, contacts counterparties, changes a case system, publishes brand claims, or performs external side effects.
- Every legal position, client-facing output, management report, external citation, filing step, or outbound message is approval-required and happens outside the app only after explicit human approval.
- Treat legal work product, casebase data, client facts, personal data, trade secrets, and internal strategy as sensitive. Do not commit
config.local.json, env files,app/.data/, exports, source documents, or privileged notes.
First Run And Onboarding
On invocation, check app/.data/onboarding.json and private config readiness. If onboarding is absent or incomplete, guide setup before doing real work.
Private config priority:
KELLY_LEGAL_PRECEDENT_DESK_CONFIG=/absolute/path/to/config.jsonskills/kelly-legal-precedent-desk/config.local.json~/.config/kelly-legal-precedent-desk/config.jsonskills/kelly-legal-precedent-desk/config.example.jsonas template only
Env priority:
- Existing environment variables
KELLY_LEGAL_PRECEDENT_DESK_ENV_FILE=/absolute/path/to/.env- Repository root
.env skills/kelly-legal-precedent-desk/.env.local~/.config/kelly-legal-precedent-desk/.env
Onboarding asks, turn by turn:
- casebase data-provider or export path
- enabled jurisdictions and practice areas
- similarity fields and citation policy
- research-pack export preferences
Never ask the user to paste secret values into chat. 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-precedent-desk/app/start.sh
The app uses local HTTP on 127.0.0.1, preferring ports 3000 through 4000, or KELLY_LEGAL_PRECEDENT_DESK_UI_PORT when set. /api/state reports app: "kelly-legal-precedent-desk".
Required app views:
#/overview: precedent research desk with open questions, match quality, and local court-pattern summaries.#/review: approval queue for precedent packs with citations, quote snippets, and reviewer notes.#/items: research-pack workbench with question, answer outline, similar cases, and recommended use.#/checks: citation and confidentiality checks for source coverage, quote limits, and internal-use labels.#/entities: similar-case library grouped by issue, court, outcome, and lawyer.#/settings: sanitized casebase/provider configuration and onboarding state.
Demo mode:
?demo=1or?demo=overviewopens deterministic mock legal data for documentation and testing.?demo=review,?demo=items,?demo=checks,?demo=entities, and?demo=detailselect named mock scenes.lang=enorlang=zhforces UI chrome language.- Demo API responses never read or write files under
app/.data/.
File Contract
Read references/precedent-schema.md before editing the app, scripts, or generated JSON.
app/.data/precedent_snapshot.json: canonical snapshot with precedent packs, review items, checks, metrics, and activity log.app/.data/decisions.json: reviewer verdicts keyed by review item id.app/.data/agent_tasks.json: queued agent revision work fromrequest_changesdecisions.app/.data/execution_report.json: dry-run/apply operations from approved decisions.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.
Inputs
- new matter facts or a focused legal question
- internal casebase records approved by the ingest skill
- jurisdiction, court level, cause of action, and desired output format
- citation policy and confidentiality limits
Workflow
- Clarify the new matter facts, legal question, target jurisdiction, and whether the output is for internal research, client advice, or drafting support.
- Search the approved internal casebase and prepare a precedent pack with similarity rationale, court-pattern notes, citations, and use limits.
- Write or merge packs through scripts/createresearchbatch.ts, then validate with scripts/validateuischema.ts.
- Send the lawyer to #/review to approve, revise, request more cases, or block unsafe findings.
- Run scripts/executedecisions.ts and export approved packs with scripts/exportresearch_pack.ts. Do not cite or send unapproved findings externally.
Review Gates
- Block or request changes when similar-case support is too thin, citation traceability is missing, jurisdiction or court level does not fit, confidentiality labels are absent, or the pack overstates an outcome.
- Approve only when each finding has a similarity rationale, source-backed citations, local court-pattern caveats, and a clear internal-use or external-use limit.
- Export only approved or done packs. Matter strategy may consume approved packs; client advice, filings, and public citations require separate lawyer approval outside this app.
Scripts
scripts/generate_demo_snapshot.ts: write deterministic demo data intoapp/.data/precedent_snapshot.json.scripts/create_research_batch.ts: merge agent-prepared or imported domain payloads into the snapshot.scripts/validate_ui_schema.ts: validate the local snapshot file contract.scripts/execute_decisions.ts [--apply]: dry-run or apply approved reviewer decisions with no external side effects.scripts/export_research_pack.ts --out: export approved/done items as Markdown, JSON, and CSV handoff files.
Safety Defaults
- Do not present internal precedent findings as final legal advice or guaranteed outcomes.
- Keep client names and privileged strategy out of exported packs unless expressly approved.
- Every quoted snippet must trace to an approved case record and respect the configured quote policy.
- If the internal casebase does not contain enough similar cases, say so and route to external legal research instead of inventing support.
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.