pasal

作者 ilhamfp已验证

Pasal.id - The first open, AI-native Indonesian legal platform. MCP server + REST API + web app giving AI grounded access Indonesian laws.

270
Stars
47
Forks
TypeScript
语言
2026/8/23
添加时间

⚠️ 第三方软件声明

本 Skill 为第三方开源软件,独立托管于 GitHub。SkillTip 仅为信息目录,不控制或维护底层仓库。所显示的安全检查为自动化且范围有限,安装前请自行审查源码。

阅读服务条款

安装

添加到你的 Claude Code skills 目录:

# Add to your Claude Code skills
git clone https://github.com/ilhamfp/pasal

快速入门

使用 pasal 等 Skills 的指南。

安全报告

已验证

上次扫描:—

{
  "status": "PASSED",
  "issues": []
}

README.md

Pasal.id

The First Open, AI-Native Platform for Indonesian Law

Demo Video · Website · Connect to Claude · REST API · AGPL-3.0 License

Legal Data by Pasal.id MCP Server Built with Opus 4.6 Next.js Supabase License: AGPL-3.0


The Problem

280 million Indonesians have no practical way to read their own laws. The official legal database (peraturan.go.id) offers only PDF downloads: no search, no structure, no API. When you ask AI about Indonesian law, you get hallucinated articles and wrong citations because no grounded data source exists.

Try It Now

Connect Claude to real Indonesian legal data in one command:

claude mcp add --transport http pasal-id https://pasal-mcp-server-production.up.railway.app/mcp

Then ask:

"Apa saja hak pekerja kontrak menurut UU Ketenagakerjaan?" (What are contract worker rights under the Labor Law?) "Jelaskan pasal tentang perlindungan data pribadi" (Explain articles on personal data protection) "Apakah UU Perkawinan 1974 masih berlaku?" (Is the 1974 Marriage Law still in force?)

Claude searches 40,000+ regulations and 937,000+ structured articles, cites specific Pasal (articles), and gives grounded answers. No hallucination.

Or browse the web app at pasal.id.

What We Built

FeatureDescription
SearchFull-Text Legal SearchIndonesian stemmer + 3-tier fallback across 937,000+ articles
ReadStructured ReaderThree-column law reader with TOC, amendment timeline, and verification badges
AIMCP Server4 grounded tools giving Claude access to actual legislation with exact citations
APIREST APIPublic JSON endpoints for search, browsing, and article retrieval
CorrectCrowd-Sourced CorrectionsAnyone can submit corrections; AI verifies before applying
VerifyAI Verification AgentOpus 4.6 vision compares parsed text against original PDF images
TrackAmendment ChainsFull relationship tracking: amendments, revocations, cross-references
GlobeBilingual UIIndonesian + English interface via next-intl (legal content stays Indonesian)

How Opus 4.6 Powers the Platform

The entire codebase, from the Next.js frontend to the MCP server to the data pipeline, was built with Claude Opus 4.6 via Claude Code during the hackathon period. But Opus 4.6 isn't just the development tool. It's embedded in the product itself, running a self-improving correction flywheel that makes the platform more accurate over time:

                    ┌───────────────────────────────┐
                    │     Users submit corrections   │
                    │     via pasal.id web app       │
                    └──────────────┬────────────────┘
                                   ▼
                    ┌───────────────────────────────┐
                    │  Opus 4.6 Verification Agent   │
                    │  Uses VISION to compare text   │
                    │  against original PDF images   │
                    │  → accept / reject / correct   │
                    └──────┬───────────────┬────────┘
                           │               │
              ≥85% conf    │               │    parser_feedback
              auto-apply   │               │    from each review
                           ▼               ▼
                    ┌──────────┐   ┌───────────────────────┐
                    │ Database │   │  Opus 4.6 reads the   │
                    │ updated  │   │  parser source code   │
                    │ via safe │   │  + aggregated feedback │
                    │ revision │   │  → creates GitHub     │
                    │ function │   │    issues with fixes   │
                    └──────────┘   └───────────────────────┘

1. MCP Server: Grounded Legal Access

Claude gets 4 tools to search real legislation, retrieve specific articles, check amendment status, and browse regulations. All returning real data with exact citations, not generated text.

2. Multimodal Verification Agent

When users submit corrections, Opus 4.6 uses vision to compare the parsed text against the original PDF page image. It reads the actual PDF, character by character, and makes accept/reject/correct decisions with confidence scores. (scripts/agent/opus_verify.py)

3. Self-Improving Feedback Loop

Every verification produces parser_feedback: notes on why the parser got it wrong. Opus 4.6 aggregates this feedback, fetches the parser source code from GitHub, analyzes systematic bugs, and creates GitHub issues with specific code fixes. The AI improves the pipeline that feeds it. (scripts/agent/parser_improver.py)

4. Human-in-the-Loop Safety

High-confidence corrections (≥85%) are auto-applied through a transaction-safe revision function. Below that threshold, corrections are queued for admin review. Every mutation is logged in an append-only audit trail. Nothing is silently overwritten.

5. Claude Code as Development Tool

The entire platform was built with Claude Code guided by 489 lines of CLAUDE.md specifications across 4 directories (root, web app, MCP server, and data pipeline), encoding architecture decisions, coding conventions, database invariants, and domain knowledge.

Architecture

                ┌──────────────────────────────────────┐
                │          Supabase (PostgreSQL)        │
                │   40,143 regulations · 937,155 Pasal  │
                │   49 migrations · FTS · RLS            │
                └─────────┬──────────────┬─────────────┘
                          │              │
         ┌────────────────┘              └────────────────┐
         ▼                                                ▼
┌─────────────────────┐                     ┌───────────────────────┐
│   MCP Server (Py)   │                     │   Next.js 16 Web App  │
│   FastMCP · Railway │                     │   Vercel · pasal.id   │
│                     │                     │                       │
│  · search_laws      │                     │  · /search            │
│  · get_pasal        │                     │  · /jelajahi          │
│  · get_law_status   │                     │  · /peraturan/[type]  │
│  · list_laws        │                     │  · /connect · /api    │
└─────────┬───────────┘                     └───────────────────────┘
          │
          ▼                                 ┌───────────────────────┐
┌─────────────────────┐                     │  Opus 4.6 Correction  │
│   Claude / AI       │                     │  Agent · Railway      │
│   Grounded answers  │                     │                       │
│   with citations    │                     │  Verify · Auto-apply  │
└─────────────────────┘                     │  Parser improvement   │
                                            └───────────────────────┘

Built to Last: Technical Depth

This isn't a weekend hack. Key engineering decisions:

  • 49 SQL migrations with iterative schema evolution, not a single dump
  • 3-layer search with identity fast-path: regex-detected regulation IDs (score 1000) → works FTS (score 1-15) → content FTS with 3-tier fallback (websearch_to_tsqueryplainto_tsqueryILIKE), capped candidate CTEs to prevent O(N) snippet generation
  • Append-only revision audit trail: content is never directly UPDATE'd; all mutations go through apply_revision() SQL function in a single transaction (revision insert + node update + suggestion update)
  • Transaction-safe content mutations: if any step fails, everything rolls back
  • Row-Level Security on all tables with public read policies for legal data
  • Input sanitization: [^a-zA-Z0-9 ] stripped before tsquery to prevent injection
  • ISR with on-demand revalidation for static generation + instant updates when content changes
  • Atomic job claiming: FOR UPDATE SKIP LOCKED prevents duplicate processing in the scraper pipeline
  • 11 regulation types covering laws from 1945 to 2026, from official government sources

MCP Tools

ToolDescription
search_lawsFull-text keyword search across all legal provisions with Indonesian stemming
get_pasalGet the exact text of a specific article (Pasal) by law and number
get_law_statusCheck if a law is in force, amended, or revoked with full amendment chain
list_lawsBrowse available regulations with type, year, and status filters

Tech Stack

LayerTechnology
FrontendNext.js 16 (App Router), React 19, TypeScript, Tailwind v4, shadcn/ui
DatabaseSupabase (PostgreSQL FTS with indonesian stemmer + pg_trgm)
MCP ServerPython + FastMCP, deployed on Railway
Correction AgentClaude Opus 4.6 (vision + code analysis), deployed on Railway
Data PipelinePython, httpx, PyMuPDF, BeautifulSoup
Search3-layer: identity fast-path → works FTS → content FTS with ILIKE fallback
i18nnext-intl with Indonesian (default) + English

Legal Coverage

Currently covers 40,143 regulations across 11 types including:

  • UU (Undang-Undang) · Primary laws from parliament
  • PP (Peraturan Pemerintah) · Government regulations
  • Perpres (Peraturan Presiden) · Presidential regulations
  • UUD · The 1945 Constitution
  • Permen, Perda, and more from official government sources

Development

# Frontend
cd apps/web && npm install && npm run dev

# MCP Server
cd apps/mcp-server && pip install -r requirements.txt && python server.py

# Correction Agent
cd scripts && pip install -r requirements.txt
python -m scripts.agent.run_correction_agent

Built with Claude Opus 4.6 for the Claude Code Hackathon
AGPL-3.0

常见问题

What is pasal?

pasal is an open-source mcp servers skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by ilhamfp. Pasal.id - The first open, AI-native Indonesian legal platform. MCP server + REST API + web app giving AI grounded access Indonesian laws. It has 270 GitHub stars.

Is pasal safe to use?

Yes. pasal passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.

How do I install pasal?

Clone the repository with "git clone https://github.com/ilhamfp/pasal" and add it to your Claude Code skills directory (see the Installation section above).

What programming language is pasal written in?

pasal is primarily written in TypeScript. It is open-source under ilhamfp on GitHub, so you can review or fork the full source.

Are there alternatives to pasal?

Yes. SkillsLLM lists many other MCP Servers skills you can browse and compare side by side. Open the MCP Servers category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh pasal against similar tools.

评论 (0)

暂无评论,成为第一个分享想法的人!

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP 服务器apisai-tools
查看详情

Scrapling

by D4Vinci

🕷️ An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl!

75,9137,581Python
MCP 服务器
查看详情

TrendRadar

by sansan0

⭐AI-driven public opinion & trend monitor with multi-platform aggregation, RSS, and smart alerts.🎯 告别信息过载,你的 AI 舆情监控助手与热点筛选工具!聚合多平台热点 + RSS 订阅,支持关键词精准筛选。AI 智能筛选新闻 + AI 翻译 + AI 分析简报直推手机,也支持接入 MCP 架构,赋能 AI 自然语言对话分析、情感洞察与趋势预测等。支持 Docker ,数据本地/云端自持。集成微信/飞书/钉钉/Telegram/邮件/ntfy/bark/slack 等渠道智能推送。

61,65224,883Python
MCP 服务器
查看详情

context7

by upstash

Context7 Platform -- Up-to-date code documentation for LLMs and AI code editors

61,0602,938TypeScript
MCP 服务器
查看详情

High-performance code intelligence MCP server. Indexes codebases into a persistent knowledge graph — average repo in milliseconds. 158 languages, sub-ms queries, 99% fewer tokens. Single static binary, zero dependencies.

39,9393,219C
MCP 服务器
查看详情

开发者还喜欢

基于喜欢此 Skill 的开发者投票和收藏

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI 智能体ai-agentsbrainstorming
查看详情

hermes-agent

by NousResearch

10

The agent that grows with you

234,43747,175Python
AI 智能体ai-agentsagent-orchestration
查看详情

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP 服务器apisai-tools
查看详情

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI 智能体claude-codeai-tools
查看详情