@metaharness/legal 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 rUv
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,73 @@
1
+ # MetaHarness: legal vertical
2
+
3
+ A ready-made Claude Code harness for drafting contract redlines, sanity-checking citations, and producing first-pass risk ratings. Scaffolds a multi-agent setup wired for legal review workflows: an intake agent that reads the document, a redline drafter, a citation/authority checker, and a risk rater that classifies clauses by severity. Aimed at legal-ops teams, in-house counsel, and lawtech builders who want a working starting point instead of a blank repo. This is a drafting aid — it does not give legal advice, does not replace attorney review, and every output is meant to be checked by a qualified human before it leaves your office.
4
+
5
+ ## Quickstart
6
+
7
+ ```bash
8
+ npx @metaharness/legal@latest my-bot
9
+ cd my-bot && npm install && harness doctor
10
+ ```
11
+
12
+ `harness doctor` verifies your Claude Code install, MCP server wiring, and agent tier routing. Once it reports green, point Claude Code at the folder and start dropping contracts into `inputs/`.
13
+
14
+ ## What you get
15
+
16
+ - `agents/intake.md` — document parser and clause extractor (haiku tier)
17
+ - `agents/redliner.md` — produces tracked-change style edits with rationale (sonnet tier)
18
+ - `agents/citation-checker.md` — verifies cited statutes, cases, and cross-references (sonnet tier)
19
+ - `agents/risk-rater.md` — classifies clauses as low / medium / high / blocker with reasoning (opus tier)
20
+ - `agents/reviewer.md` — synthesizes the three streams into a single review packet (opus tier)
21
+ - `.claude/settings.json` preconfigured with tier routing, redaction hooks, and an `inputs/` + `outputs/` workspace
22
+ - MCP servers wired for filesystem access to the contract folder and a memory store scoped to the matter
23
+ - `CLAUDE.md` with the drafting-only guardrails, citation-format rules, and the "always flag, never decide" review protocol
24
+
25
+ ## Advanced
26
+
27
+ Run the built-in health check:
28
+
29
+ ```bash
30
+ $ harness doctor
31
+ [ok] claude-code >= 1.0
32
+ [ok] agents/ (5 files)
33
+ [ok] MCP: filesystem (inputs/, outputs/)
34
+ [ok] MCP: memory (matter-scoped)
35
+ [ok] tier routing: haiku=1 sonnet=2 opus=2
36
+ ```
37
+
38
+ Validate the agent and settings files before committing changes:
39
+
40
+ ```bash
41
+ $ harness validate
42
+ [ok] .claude/settings.json schema
43
+ [ok] 5 agents parsed
44
+ [ok] CLAUDE.md guardrails present
45
+ ```
46
+
47
+ Run headlessly against a single contract for batch review:
48
+
49
+ ```bash
50
+ claude -p --plugin-dir my-bot \
51
+ "Review inputs/msa-acme.pdf. Produce redline + risk packet in outputs/."
52
+ ```
53
+
54
+ You can also pin the model floor per agent by editing the `model` field in each `agents/*.md` frontmatter — useful if you want the redliner on opus for a high-stakes deal.
55
+
56
+ ## FAQ
57
+
58
+ **Is this legal advice?**
59
+ No. It produces drafts. Every output must be reviewed by a qualified attorney before it is acted on or sent to a counterparty. The CLAUDE.md guardrails enforce this framing in every agent prompt.
60
+
61
+ **Where does my contract text go?**
62
+ Drop files into the local `inputs/` folder. The filesystem MCP server is scoped to that folder and `outputs/` — nothing leaves your machine except the model calls themselves. Use a redaction pass first if your matter requires it.
63
+
64
+ **Can I swap models or add an agent?**
65
+ Yes. Each agent is a standalone markdown file in `agents/`. Edit the `model:` frontmatter to change tier, or copy an existing file to add a new role (e.g. a `precedent-finder` agent). Re-run `harness validate` after.
66
+
67
+ ## License
68
+
69
+ MIT. Built on metaharness (https://www.npmjs.com/package/metaharness).
70
+
71
+ ## Deep-dive
72
+
73
+ Full explainer gist: https://gist.github.com/ruvnet/72e46e135dbf10df91d819072802578d
@@ -0,0 +1,31 @@
1
+ #!/usr/bin/env node
2
+ import { execSync } from 'node:child_process';
3
+ import process from 'node:process';
4
+
5
+ const name = process.argv[2] || 'my-bot';
6
+ const extra = process.argv.slice(3);
7
+
8
+ const args = [
9
+ '--yes',
10
+ 'metaharness@latest',
11
+ name,
12
+ '--template',
13
+ 'vertical:legal',
14
+ '--host',
15
+ 'claude-code',
16
+ '--force',
17
+ ...extra,
18
+ ];
19
+
20
+ try {
21
+ execSync(`npx ${args.map((a) => (a.includes(' ') ? JSON.stringify(a) : a)).join(' ')}`, {
22
+ stdio: 'inherit',
23
+ });
24
+ } catch (err) {
25
+ process.exit(typeof err?.status === 'number' ? err.status : 1);
26
+ }
27
+
28
+ console.log('');
29
+ console.log(`Next steps:`);
30
+ console.log(` cd ${name} && npm install`);
31
+ console.log(` harness doctor # verify Claude Code + MCP wiring, then drop contracts into inputs/`);
package/package.json ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "@metaharness/legal",
3
+ "version": "0.1.0",
4
+ "description": "MetaHarness example — contract redline, citation check, and risk rating drafts for Claude Code (npx @metaharness/legal my-bot)",
5
+ "homepage": "https://github.com/ruvnet/agent-harness-generator/tree/main/examples-packages/legal",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/ruvnet/agent-harness-generator.git",
9
+ "directory": "examples-packages/legal"
10
+ },
11
+ "license": "MIT",
12
+ "author": "rUv <ruv@ruv.net>",
13
+ "type": "module",
14
+ "bin": "./bin/scaffold.mjs",
15
+ "files": [
16
+ "bin/**",
17
+ "README.md",
18
+ "LICENSE"
19
+ ],
20
+ "scripts": {
21
+ "smoke": "node --check bin/scaffold.mjs"
22
+ },
23
+ "keywords": [
24
+ "metaharness",
25
+ "agent-harness",
26
+ "agent-harness-generator",
27
+ "legal",
28
+ "vertical",
29
+ "claude-code",
30
+ "ai-agent",
31
+ "mcp",
32
+ "npx",
33
+ "scaffold"
34
+ ],
35
+ "publishConfig": {
36
+ "access": "public"
37
+ },
38
+ "engines": {
39
+ "node": ">=20.0.0"
40
+ }
41
+ }