@skarmy/legal-agent
v0.3.0
Published
Skarmy's Legal Lead — drafts and revises founder/commercial/web/formation/fundraising documents, prepares e-sign requests, and answers legal questions with web grounding. Prompt-runtime agent.
Readme
@skarmy/legal-agent
Skarmy's Legal Lead — handles formation, contracts, IP, licensing, and early compliance risk. Joins the team when the team-selection judge matches its inclusion criterion: "The idea raises legal, regulatory, licensing, compliance, IP, or liability questions — e.g. sensitive data, a regulated field, permits, or contracts."
A prompt-runtime agent (no sandbox): the hub's prompt engine runs the definition in-process. Three flows, routed by composer mode:
- Ask — web-search-grounded legal Q&A with citations (via
ctx.search, metered per turn). - Draft — document assembly from a 12-template library (founder,
commercial, web, and formation packs): the model resolves the template and
fills fields it can source from the venture brief/conversation, missing
fields are asked for (never invented), a deterministic
{{fill}}plus a guarded tailoring pass produce the document, and an immutable not-legal-advice disclaimer is appended in code. The doc is written to/legal/<slug>.mdand staged on the document stage. - Review — issue-spotting over a venture doc or pasted contract text.
E-sign: when the founder names signers, the agent prepares a signature
request (ctx.esign.prepare) — sending is always the founder's explicit click
on the document stage ("the agent prepares, the user pulls the trigger"). The
hub's SignWell integration handles envelopes, embedded signing, and webhooks.
UPL posture (structural, not just prompted): Skarmy is not a law firm; drafting is self-help document assembly from the founder's selections; the disclaimer block is appended after any model pass so the model can never rewrite it; escalation-to-a-real-attorney triggers are baked into the system prompt and template guidance. No "AI lawyer" claims anywhere (FTC v. DoNotPay).
What this package owns
legalManifest(AgentManifest) — identity, model,stage: ["document"],tools: ["files", "web_search", "esign"], per-turn limits, composer modes,defaultInputs. Key/name stay in lockstep with the hub's canonical roster (src/lib/discovery/team.ts).legalDefinition(AgentDefinition) — the ask/draft/review flows. Engine contracts honored:blockedthrows (→ ERROR event);unconfigureddegrades deterministically (raw filled skeleton / fixed reply), so dev and CI run green with no provider keys.src/templates/— the template library:LegalTemplateshape, registry, menu renderer, deterministic fill, immutable disclaimers.
Develop
Prereqs: Node 22+. Until @skarmy/[email protected] is published, the SDK dep
points at a sibling checkout (file:../skarmyv0/packages/agent-sdk) — clone
skarmyv0 next to this repo.
npm install
npm run typecheck
npm test # SDK contract test + template-integrity + flow testsPublish & pin
- Publish
@skarmy/[email protected]from the hub repo; flip this repo's dep to"^0.3.0". - Drop
"private": trueandnpm publish(scope@skarmy, public —distbuilt byprepack). - The hub flips its
@skarmy/legal-agentdep fromfile:to the published version (already registered insrc/lib/agents/registry.tsandPROMPT_DEFINITIONS).
License
MIT
