The Atlas AnyLegal OSS — documentation bound to its code
20 documents

How agent behaviour is assembled: skills & tools

The system prompt is deliberately thin on procedure — it defers to skills and a tool registry. Trace how a SKILL.md becomes a loaded procedure and how the tool pool is built and scoped.

Process

  1. Identify which document to review — Check the "Active document" in your context. If the active document is a contract/agreement in the workspace documents list, review it. If the active document is an instructions file, playbook, template, or other non-contract file (or if no document is active), ask the user which document they want reviewed. List the available workspace documents and let them pick.
  2. Read the document via read_document — always read the full document first
  3. Read the relevant playbook(s) — check the "Available Playbooks" manifest in your context, then call read_document("Playbook/<filename>") to load the one(s) relevant to this contract type, jurisdiction, or client
  4. Research jurisdiction-specific requirements — identify the governing law from the contract, then:
    • Use web_search with the jurisdiction set to find relevant statutes and regulations for the contract type
    • Use web_fetch to retrieve full statutory text from authoritative sources (government domains, official gazettes)
    • Cross-reference: for any cited statute, run a follow-up search to verify it is current and not superseded
    • Use web_search for case law, regulatory guidance, and market standards (recent enforcement trends, standard market positions for the industry)
  5. Analyze each key clause:
    • Identify clause type (indemnification, limitation of liability, termination, etc.)
    • Assess position: favorable, balanced, or unfavorable for the represented party
    • Determine risk level: low, medium, high, or critical
    • Check alignment with playbook positions
    • Flag any clauses that conflict with mandatory statutory requirements — cite the exact source URL retrieved via web_fetch
    • Use web_search to check market standards if the clause deviates from typical positions
    • Consider market standards and jurisdiction-specific requirements
  6. Present findings in structured format with specific recommendations
  7. If user asks to apply changes ("redline", "implement", "apply", "do it"):
    • Invoke Skill(skill="docx-editing") for the full edit-pattern library, then call edit_document for each change. Edit the document in place — do not clone to a _v2 copy.
    • Copy the EXACT text span from the document — do not paraphrase or reconstruct from memory. Use the shortest unique snippet for old_text.
    • edit_document emits <w:ins> / <w:del> tracked-change markup automatically. Author defaults to "Anylegal.ai" — pass an explicit author only if the user supplies a different name.
    • Do NOT just describe changes — actually call edit_document for each one.
    • Do NOT use run_code for text edits.