PlainDoc turns everyday professional documents into plain-language risk notes and signing checklists.
The first version focuses on rental, employment, renovation, loan, and insurance documents. It is local-first, open-source, and runnable without API keys. An optional AI-enhanced mode can call an OpenAI-compatible model service that the user configures.
签字前,先看懂哪里可能伤到你。
Paste a contract, click upload or drag in a selectable-text PDF / .txt / .md file, or load one of the bundled fictional scenarios. PlainDoc produces:
- A one-sentence summary.
- Visible report metadata with source, text scale, risk counts, and generation time.
- A review-perspective selector so users can read from their own side, such as tenant, landlord, employee, borrower, lender, or policyholder.
- Safe demo deep links and an in-app copy button for bundled examples, without putting private document text in the URL.
- Input-completeness warnings when pasted or uploaded text looks like a fragment instead of a full document.
- A pre-signing readiness gate that summarizes whether the user should pause, keep negotiating, or continue checking.
- A visible coverage boundary that says which risk areas PlainDoc checked and which limits still need human review.
- An evidence-coverage summary showing how many risk findings can be located back to source text.
- A report-level AI deep-review guide that explains when model analysis can add value, can copy an external AI review prompt, and opens the model setup flow.
- Mobile-friendly single-column layout for reviewing reports on narrow screens.
- Key facts such as money, percentages, dates, obligations, penalties, and acceptance terms.
- Local document-type detection for pasted or uploaded text.
- A live document-text counter that helps confirm whether pasted or uploaded content was read.
- Red/yellow/green risk cards with evidence snippets.
- One-click evidence locating back to the original text in the editor, with paragraph fallback when the snippet was lightly edited.
- A priority brief that surfaces the first issues to negotiate.
- Suggested clause edits for flagged risks.
- A copyable clause-edit pack for sending all proposed changes together.
- A signing checklist you can copy before talking to the other party.
- Copyable pre-signing clarification questions that turn risks into questions for the counterparty.
- A next-step action plan and a message draft that includes concrete clarification questions and suggested wording for the other party.
- A send-before-review reminder on counterparty message drafts so copied text is checked before sharing.
- Plain-language explanations for non-experts.
- Deduplicated local report history that marks reports with ready-to-send counterparty drafts.
- Automatic local draft restore for pasted or uploaded document text after refresh.
- One-click current-workspace clearing after reviewing sensitive documents.
- One-click local data reset for clearing the current text, recent report history, model settings, and AI send confirmation.
- One-click copy for the full Markdown report.
- Markdown export with document-type and timestamped filenames for saving or sharing the report.
- Markdown reports include a PlainDoc source link so copied or exported reports remain traceable.
- Print-friendly report view for saving as PDF or bringing to an offline discussion.
- Installable web app metadata and application-shell caching so the app can reopen offline after a successful visit.
- Canonical URL, robots.txt, and sitemap.xml for the GitHub Pages demo.
- Optional AI-enhanced analysis with local-rule fallback.
- A copyable external AI prompt pack for taking PlainDoc's local report into ChatGPT, Claude, Gemini, or another model without configuring an API key.
- Local sensitive-data preflight warning and one-click redacted copy before AI model sending.
- Explicit per-session confirmation before sending document text to a configured model service.
PlainDoc is not a legal-advice product. It is a document-reading assistant that helps ordinary people spot questions worth asking.
Most "chat with PDF" tools ask users to know what to ask. PlainDoc starts from the opposite assumption: ordinary people often do not know which clauses matter.
The goal is to package professional reading patterns into a tool that gives users a concrete next step before they sign.
npm install
npm run devOpen the local Vite URL and try one of the bundled examples.
Try the public demo examples:
Run checks:
npm run checkRuns the full local verification gate: tests first, then the production build.
You can still run the steps separately while debugging:
npm test
npm run buildDependabot checks npm packages and GitHub Actions weekly so maintainers can review dependency updates through normal pull requests.
PlainDoc works without a model by default. The browser runs local heuristic rules first, then optionally asks your configured model service to improve the summary, risk cards, checklist, pre-signing clarification questions, and plain-language explanation. AI-enhanced findings are conservatively merged with the local baseline so evidence snippets from local rules stay attached to the relevant risk cards.
If you do not want to configure a model endpoint, use 复制外部 AI 深度审阅提示词 in the report. It copies a structured prompt built from PlainDoc's local report, evidence snippets, checklist, and review perspective so you can paste it into ChatGPT, Claude, Gemini, or another model. This prompt pack does not send data by itself; review it before pasting into any external service.
To use it:
- Enable AI 增强分析 in the left panel.
- Choose a model-service preset or enter an OpenAI-compatible endpoint and model name. 本机 Ollama 可不填 API key;远程模型仍需要 API key.
- Use 测试模型连接 if you want to check the endpoint, model name, API key, and network before sending any document text.
- Confirm 本次允许发送正文给模型服务.
- Click 生成 AI 增强清单.
Privacy boundary:
- When AI mode is off, PlainDoc does not send document text anywhere.
- PDF text extraction runs in your browser before analysis.
- Offline support stores PlainDoc application files in browser Cache Storage. It does not cache original document text, evidence snippets, API keys, or report history.
- The current editor draft is stored in browser localStorage so a refresh does not lose pasted or uploaded text. Loading a bundled example, clearing the current workspace, or using local data reset removes that stored draft.
- Recent report history is stored in your browser, deduplicates repeated analyses, and stores report conclusions and suggestions only. It does not store the original document text or evidence snippets. Restoring a history report clears the editor so stale text is not shown beside the restored report.
- The current-workspace clear button removes the visible document text, stored editor draft, and current report without deleting report history or model settings.
- The local data reset button clears the visible document text, stored editor draft, current report, recent report history, stored model settings, remembered API key opt-in state, and current AI send confirmation. It does not remove the application-shell cache used for offline reopening.
- When AI mode is on, PlainDoc still uses local analysis unless you explicitly confirm 本次允许发送正文给模型服务. Without that confirmation, the report is generated locally.
- Blank or whitespace-only document text cannot be confirmed for model sending and does not show a sendable-text preview; paste, upload, or choose an example first.
- 测试模型连接 sends only a minimal probe prompt to the configured model service. It does not send the visible document text, does not require AI send confirmation, and expects the model to return a JSON confirmation such as
{"ok":true}. - Remote model endpoints must use HTTPS before PlainDoc will send document text or API keys. PlainDoc allows HTTP only for local model endpoints such as
http://localhostorhttp://127.0.0.1. - 本机 Ollama 可不填 API key;远程模型仍需要 API key. If your local model server requires authentication, you can still enter a key manually.
- Before AI sending, PlainDoc locally checks whether the visible text appears to contain common sensitive data categories such as phone numbers, email addresses, ID numbers, or bank card numbers. It only shows category labels and does not store or display the matched values. You can generate a local redacted copy that replaces those values with placeholders before confirming model sending.
- Changing the document text, loading an example, uploading a file, restoring a history report, clearing the workspace, or changing the model endpoint/model/API key cancels the send confirmation.
- After confirmation, PlainDoc sends up to 12,000 characters from the beginning and ending portions of the document text from your browser to the endpoint you configured. The full document is still analyzed locally, and long AI-enhanced reports include a notice when the model received only those portions.
- Before confirmation, PlainDoc shows a read-only preview of the exact text that will be sent to the configured model service.
- PlainDoc labels the sent text as untrusted document content in the model request and instructs the model not to follow instructions embedded inside the document, reveal prompts, or change the required JSON report shape.
- The local baseline sent to the model omits evidence snippets, so extracted raw evidence from outside the sent text range is not included in the model request.
- If the document or model settings change while an AI request is still in flight, the stale model result is ignored instead of replacing the current report.
- You can cancel an in-flight AI analysis. PlainDoc asks the browser to abort the model request, keeps the current report on the local-rule result, and still ignores any canceled model result if it returns later.
- AI model requests automatically time out instead of leaving the page stuck in analysis; timeout failures fall back to the local-rule report.
- The API key is session-only by default. It is written to browser localStorage only when you explicitly enable 记住 API key, and can be cleared from the UI.
- If the model call fails, PlainDoc falls back to the local report and shows the failure reason.
- When AI mode improves a local risk card, PlainDoc keeps the local evidence snippet instead of replacing it with unsupported model text.
Currently supported:
- Paste text.
- Pasted or edited text immediately refreshes the local-rule report so the visible report stays aligned with the editor.
- Pasted or uploaded text is automatically saved as a local browser draft and restored after refresh.
- Click 点击上传或拖入 PDF / .txt / .md / 图片文件 to upload selectable-text PDF,
.txt, and.mdfiles, or select a photo to receive the OCR-before-upload guidance. - Drag PDF,
.txt,.md, or image files onto the upload strip, with a visible 松开即可读取文件 drop hint. - 一次只分析一个文件;如果拖入多个文件,PlainDoc 只读取第一个,并提示其余文件未处理。
- The editor header 实时显示已输入字符数,方便确认粘贴或上传是否完整。
- Successful uploads immediately refresh the local-rule report so the visible report matches the uploaded text.
- Visible report metadata including risk counts, source, text scale, and generation time.
- Review-perspective selection in the editor, visible report metadata, Markdown export, counterparty messages, and AI model requests.
- Visible input-completeness warnings in on-screen and Markdown reports when the text appears too short or lacks document-boundary signals.
- Visible pre-signing readiness status in on-screen and Markdown reports, combining input completeness, red risks, and evidence coverage.
- Visible coverage scope and limitation notes in the on-screen and Markdown reports.
- Visible evidence-coverage summaries in on-screen and Markdown reports, including a warning when model-supplemented findings lack source-location evidence.
- Mobile-friendly layout that keeps the input and report panels inside narrow viewports without horizontal scrolling.
- Load ten fictional rental, employment, renovation, loan, and insurance examples.
- Switching bundled examples immediately refreshes the local-rule report so the demo text and report stay aligned.
- Changing the document type immediately regenerates the local-rule report with that rule pack.
- Automatically detect the closest supported document type for uploaded or uncertain text.
- Analyze common loan and borrowing clauses.
- Analyze common insurance waiting-period, exclusion, renewal, and claim-notice clauses.
- Local heuristic analysis with no API key.
- Copyable external AI deep-review prompt pack, generated from the local report without sending data automatically.
- Optional OpenAI-compatible model enhancement.
- Report-level AI deep-review entry point for turning a local report into model-assisted review after setup and consent.
- Model connection test that checks endpoint/model/API key/network and validates a
{"ok":true}probe response before sending document text. - Local sensitive-data category warning and redacted-copy helper before AI model sending.
- Per-session model-send confirmation that resets when the document or model destination changes.
- Blank or whitespace-only document text cannot be confirmed for model sending and does not show a sendable-text preview.
- HTTPS-required remote model endpoints, with HTTP allowed only for local model endpoints.
- Local model endpoints such as Ollama can be used without an API key; remote model endpoints still require an API key.
- Transparent long-document AI scope notice when only beginning and ending portions are sent to the configured model service.
- Read-only preview of the exact text that will be sent before AI model confirmation.
- Model prompts isolate uploaded or pasted text as untrusted document content before AI-enhanced analysis.
- Automatic AI request timeout with local-rule fallback.
- Cancelable in-flight AI analysis with request abort and stale-result protection.
- Session-only API key handling by default, with explicit opt-in persistence.
- Conservative model/local merge that preserves evidence snippets on AI-enhanced risk cards.
- One-click original-text locating for risk evidence snippets, with paragraph-level fallback when exact snippet text no longer matches.
- Suggested clause edits for common risk patterns.
- Copyable clause-edit pack.
- Copyable pre-signing clarification questions that turn findings into questions for counterparties.
- Copyable next-step message draft for counterparties, populated with concrete pre-signing questions and suggested clause wording.
- Counterparty message-draft review reminder before users send copied text outside PlainDoc.
- Deduplicated local report history that omits original text and evidence snippets, marks ready-to-send counterparty drafts, clears the editor on restore, and supports one-click clear.
- Local browser draft restore for current document text.
- One-click current-workspace clearing for sensitive document text, stored draft, and the current report.
- One-click local data reset for current text, stored draft, report history, model settings, and AI send confirmation.
- Markdown report export with readable timestamped filenames.
- Markdown 报告会标明 PlainDoc 来源链接:https://ppxu.github.io/plaindoc/
- Print-friendly report output for browser printing or saving as PDF.
- GitHub Pages-ready metadata, PNG social preview image, and web app manifest.
- GitHub Pages-scoped service worker with offline application-shell caching.
- Canonical, robots.txt, and sitemap.xml metadata for search indexing.
- Executable local-rule benchmark cases for key false-positive and false-negative boundaries.
Not yet supported:
- OCR for scanned PDFs or photos.
- Server-side model proxy or account-based key storage.
- Multi-language document packs.
- Account sync or cloud storage.
- A renter wants to know whether deposit and early-exit clauses are risky.
- An employee wants to understand non-compete, penalty, and resignation notice clauses.
- A homeowner wants to check renovation payment milestones, change orders, and acceptance rules.
- A borrower wants to understand real borrowing cost, prepayment fees, overdue charges, and acceleration clauses.
- An insurance buyer wants to understand waiting periods, existing-condition exclusions, renewal stability, and claim notice deadlines.
PlainDoc provides document-reading assistance and risk prompts. It does not provide legal, medical, financial, or other professional advice. Important decisions should be reviewed with qualified professionals.
For vulnerability reporting and the current local/AI data boundary, see SECURITY.md. For user-facing data handling and clearing behavior, see PRIVACY.md.
For bug reports, rule ideas, safe fictional examples, security reports, and public-support boundaries, see SUPPORT.md.
For public demo links, positioning, screenshot assets, privacy talking points, and short launch copy, see docs/launch-kit.md.
Community participation is governed by CODE_OF_CONDUCT.md.
See docs/roadmap.md.
See CHANGELOG.md.
Contributions are welcome. The easiest useful contributions are:
- Add more fictional example documents.
- Improve local rule packs.
- Add tests for a new document pattern.
- Add benchmark cases for false positives or false negatives.
- Review the rule coverage matrix before changing a supported document category.
- Review example suggestions with the example review checklist.
- Improve suggested clause-edit templates.
- Improve plain-language explanations.
- Improve action-plan and counterparty-message templates.
- Help implement OCR adapters and document ingestion edge cases.
Use the GitHub issue forms for bug reports, risk-rule proposals, and fictional example suggestions. Review new scenarios with the example review checklist. Do not paste real contracts or personal data into issues.
See CONTRIBUTING.md.
documents, contracts, plain-language, risk-checklist, local-first, loans, insurance, react, vite, open-source
MIT
