# AILoadout manifest — thai-legal-research
# Upload this file to your AI, then say: Use this Loadout and start at workflow step 1.
schema_version: "1.0"
kind: "Loadout"
id: "thai-legal-research"
title: "Thai Legal Research"
version: "1.0.0"
category: "Legal"
purpose: "A guided Thai-law research kit for people and businesses — identify relevant law, verify official sources, and know when to consult a lawyer."
disclaimer: "Research assistance only, not legal advice. Verify every result with official sources and consult a qualified lawyer before important decisions."
expected_outcome:
  - "Identify the laws and sections relevant to your situation"
  - "Use official sources instead of unverified AI recall"
  - "Check whether a law is current, amended, or repealed"
  - "Get a plain-language memo and know when legal counsel is needed"
supported_platforms:
  - "claude"
  - "chatgpt"
  - "gemini"
  - "perplexity"
  - "claude-code"
  - "cursor"
  - "deepseek"
  - "grok"
  - "kimi"
prerequisites:
  - "A Tavily account and TAVILY_API_KEY (free tier available)"
  - "Node.js for npx, plus Python and uv for uvx"
  - "Any contract or document you want the AI to inspect (optional)"
resources:
  prompt:
    - id: "prompt-issue"
      name: "Frame the legal issues"
      description: "Turn a real situation or business problem into researchable legal issues and search terms."
      source:
        kind: "inline"
      content: |-
        You are a Thai legal research assistant. When I describe a situation/problem:
        1. Summarize the key facts as bullet points
        2. Turn them into "legal issues" to resolve (1-3 issues)
        3. Suggest Thai search keywords for laws/cases
        4. Do not conclude yet — wait for me to confirm the issues first
    - id: "prompt-memo"
      name: "Summarize answers + cite"
      description: "Have the AI turn research results into plain language with official citations and limitations."
      source:
        kind: "inline"
      content: |-
        Summarize the research in plain language:
        - Each issue -> a short answer
        - Cite the section/act + official link (never guess; no link = unverified)
        - Relevant Supreme Court precedents (include only case numbers confirmed in the court system)
        - Limitations / what is still unclear
        - Close with: this is research assistance; consult a lawyer before acting
  rule:
    - id: "rule-guardrails"
      name: "No fabrication + cite sources"
      description: "Rules the AI must follow — never invent sections or case numbers, always cite official sources, and say so when nothing is found."
      source:
        kind: "inline"
      content: |-
        - Answer only from citable official Thai legal sources (law.go.th, krisdika.go.th, the Royal Gazette, the Supreme Court).
        - Never invent section numbers, act names, or Supreme Court case numbers. If unsure or not found, say "not found / unverified" — do not guess.
        - Every time you cite a section or case, attach the official link/source and use the format "Supreme Court Decision No. [number]/[B.E. year]".
        - Warn the user to check whether the law is still in force (it may be amended or repealed).
        - Always state that this is research assistance, not legal advice, and recommend consulting a lawyer for important matters.
  skill:
    - id: "skill-doc"
      name: "Read PDF / documents"
      description: "Read contracts, decisions, or laws that are PDF or Word files."
      source:
        kind: "github"
        ref: "anthropics/skills"
        url: "https://github.com/anthropics/skills"
      note: "ℹ️ Shortcut: just upload the file into Claude/ChatGPT — no setup needed"
  mcp:
    - id: "mcp-tavily"
      name: "Tavily Search"
      description: "Let the AI search the web and pull legal page content (pointed at official sites) instead of relying on memory."
      source:
        kind: "registry"
        ref: "tavily-ai/tavily-mcp"
        url: "https://github.com/tavily-ai/tavily-mcp"
      install: "npx -y tavily-mcp@latest"
      note: "ℹ️ Requires TAVILY_API_KEY (free tier available) · Alternatives: Brave/Firecrawl MCP"
    - id: "mcp-fetch"
      name: "Fetch"
      description: "Let the AI open and read official legal web pages directly (e.g. the statutory text on law.go.th)."
      source:
        kind: "registry"
        ref: "modelcontextprotocol/servers · src/fetch"
        url: "https://github.com/modelcontextprotocol/servers/tree/main/src/fetch"
      install: "uvx mcp-server-fetch"
      note: "ℹ️ Python-based, no API key needed"
    - id: "mcp-filesystem"
      name: "Filesystem"
      description: "Let the AI read your contract/document files locally."
      source:
        kind: "registry"
        ref: "@modelcontextprotocol/server-filesystem"
        url: "https://github.com/modelcontextprotocol/servers/tree/main/src/filesystem"
      install: "npx -y @modelcontextprotocol/server-filesystem <โฟลเดอร์>"
      note: "ℹ️ Only accesses folders you allow"
  knowledge:
    - id: "kb-lawgo"
      name: "law.go.th — central legal system"
      description: "Current Thai statutory text (official central portal) — use as the primary reference."
      source:
        kind: "url"
        ref: "law.go.th"
        url: "https://www.law.go.th/"
    - id: "kb-krisdika"
      name: "Krisdika (krisdika.go.th)"
      description: "Consolidated codes/acts with amendments, by the Office of the Council of State."
      source:
        kind: "url"
        ref: "krisdika.go.th"
        url: "https://www.krisdika.go.th/"
    - id: "kb-ratchakitcha"
      name: "Royal Gazette"
      description: "Official source for enacted laws — use to check when a law took effect or was amended."
      source:
        kind: "url"
        ref: "ratchakitcha.soc.go.th"
        url: "https://ratchakitcha.soc.go.th/"
    - id: "kb-deka"
      name: "Supreme Court decisions (deka)"
      description: "Official Supreme Court decision search — use to confirm case numbers before citing."
      source:
        kind: "url"
        ref: "deka.supremecourt.or.th"
        url: "http://deka.supremecourt.or.th/"
      note: "ℹ️ Viewing full texts may require registration"
  template:
    - id: "template-memo"
      name: "Legal research memo (template)"
      description: "A memo template for research results, with citation and limitation fields."
      source:
        kind: "inline"
      content: |-
        # Legal research memo: <topic>
        ## Facts
        ...
        ## Legal issues
        ...
        ## Relevant law
        - <Act ... Section ...>  (source: <official link>)
        ## Precedents
        - Supreme Court Decision No. .../....  — <summary>  (confirmed via deka.supremecourt.or.th)
        ## Summary / recommendation
        ...
        ## Limitations
        Preliminary research assistance, not legal advice
workflow:
  - step: "Frame the issues"
    order: 1
    estimated_time: "~5 min"
    ai_actions:
      - "Read your description and summarize the key facts"
      - "Turn them into 1–3 legal issues"
      - "Ask about anything unclear"
    user_action: "Describe the situation, attach any contract/document, then confirm the issues with the AI"
    uses:
      - "prompt-issue"
      - "rule-guardrails"
      - "skill-doc"
    done_when: "Clear legal issues + the search terms to use"
    tip: "The fuller the facts, the sharper the issues — don't rush to an answer yet"
  - step: "Search official sources"
    order: 2
    estimated_time: "~10 min"
    ai_actions:
      - "Use Tavily/Fetch pointed at law.go.th and krisdika"
      - "Identify the relevant acts + sections with links"
      - "Pull the actual statutory text"
    user_action: "Open an official link and read the text yourself at least once"
    uses:
      - "mcp-tavily"
      - "mcp-fetch"
      - "kb-lawgo"
      - "kb-krisdika"
      - "rule-guardrails"
    done_when: "A list of acts/sections with official links"
    tip: "Tell the AI to 'always attach a link' — no link = unverified"
  - step: "Find precedents"
    order: 3
    estimated_time: "~10 min"
    ai_actions:
      - "Search relevant Supreme Court cases by keyword"
      - "Summarize the principle the court set"
      - "Note case numbers as 'to verify'"
    user_action: "Check whether the point matches your situation"
    uses:
      - "mcp-tavily"
      - "kb-deka"
    done_when: "A list of possibly relevant cases (not yet verified)"
    tip: "Don't trust the case numbers the AI gives yet — verify in the next step"
  - step: "Verify (self-check)"
    order: 4
    estimated_time: "~10 min"
    critical: true
    ai_actions:
      - "Compare every section against law.go.th / krisdika word for word"
      - "Check amendments/repeals in the Royal Gazette"
      - "Confirm case numbers on deka — flag any that can't be confirmed as 'unverified' per the no-fabrication rule"
    user_action: "Randomly open and check at least one item yourself"
    uses:
      - "kb-lawgo"
      - "kb-ratchakitcha"
      - "kb-deka"
      - "mcp-fetch"
      - "rule-guardrails"
    done_when: "Every section/case you'll rely on is confirmed from official sources"
    tip: "Never skip this — AIs like to invent real-looking but nonexistent sections/cases"
  - step: "Analyze"
    order: 5
    estimated_time: "~10 min"
    ai_actions:
      - "Connect the facts to the confirmed sections/cases"
      - "Point out what does and doesn't apply"
      - "Note what's still unclear or needs more info"
    user_action: "If the stakes are high (litigation / signing / criminal penalty), stop and consult a lawyer"
    uses:
      - "prompt-issue"
      - "rule-guardrails"
    done_when: "An analysis that clearly links facts ↔ law"
    tip: "The AI can get you started, but real decisions should be confirmed by a lawyer"
  - step: "Summarize + cite"
    order: 6
    estimated_time: "~5 min"
    ai_actions:
      - "Fill in the research memo from the confirmed results"
      - "Add every official reference link"
      - "Add limitations + the reminder to consult a lawyer"
    user_action: "Read it over and keep the memo to discuss with a lawyer"
    uses:
      - "template-memo"
      - "prompt-memo"
    done_when: "A ready memo, fully cited, with limitations stated"
    tip: "Use the memo as a starting point with a lawyer — saves time and consultation fees"
creator:
  name: "AILoadout"
  handle: "@ailoadout"
metadata:
  version: "1.0.0"
  updated_at: "2026-07-22"
  license: "CC-BY"
