App Legal Pages
Generate a complete legal mini-site for an app:
- -
index.html (legal home) - INLINECODE1 (Privacy Policy)
- INLINECODE2 (Terms of Service)
- INLINECODE3 (shared styles)
Workflow
- 1. Collect required legal/product inputs.
- Generate draft legal pages from feature documentation.
- Run strict consistency checker.
- Present generated pages for user review/approval.
- Check Cloudflare deployment auth readiness.
- Ask user to complete auth if missing.
- Auto-deploy to Cloudflare Pages after explicit confirmation.
- Return final public URLs.
1) Collect Inputs
Collect or confirm:
- - App name
- Company/entity name (or individual publisher name)
- Contact email
- Governing law jurisdiction (country/region, optional; only if explicitly provided)
- Effective date
- App feature document (markdown/text)
- Data behavior details:
- Analytics events
- Crash/error logs
- Identifiers (device/user IDs)
- Third-party SDKs/services
- Permissions used (camera/location/photos/mic/contacts/tracking/notifications)
If facts are unknown, pause and ask for missing inputs before generation. Do not output placeholder markers (no TODO/TEMP strings in final pages).
Never assume jurisdiction, region, analytics/tracking, sharing, or permission usage unless explicitly stated in the input document or user prompt.
Generate policy clauses from explicit product claims first (e.g., offline-only, no cloud, no tracking, no analytics), and avoid introducing contradictory generic legal boilerplate.
2) Generate Draft Site
Run:
CODEBLOCK0
Email rule:
- - Prefer plus-address derivation from GitHub/base email + app tag.
- Example:
chentuan7963@gmail.com + quillnest => chentuan7963+quillnest@gmail.com. - Use
--email only when you explicitly want a fixed address.
Language rule:
- - Generate English-only legal pages by default.
- Exclude non-English feature bullets from Feature Context to keep language consistent.
The script auto-detects likely data categories/permissions from the feature text. Manually review and adjust output if app behavior is more specific than heuristic detection.
3) Run Strict Consistency Checker
Run before publishing:
CODEBLOCK1
The checker fails on:
- - Placeholder tokens (TODO/TEMP/FIXME)
- Contradictions against explicit product claims (offline/no-cloud/no-tracking/no-analytics)
- EXIF mention in feature doc without corresponding privacy disclosure
- Governing-law section in Terms when jurisdiction is not explicitly provided
4) Validate Draft Quality
Check before publishing:
- -
privacy.html and terms.html both exist. - App/company/email/effective date are consistent across pages.
- Privacy disclosures match only explicitly stated permissions and data behavior (no inferred tracking/region claims).
- User rights and contact/deletion request path are present.
- No unverifiable legal claims.
- Final pages contain no placeholder markers (forbidden: TODO/TEMP/FIXME).
If the app uses sensitive permissions or SDKs, verify these are explicitly disclosed in Privacy Policy.
5) Review Gate (Mandatory)
Before deployment, share generated files with the user and ask for explicit approval to deploy.
Do not deploy automatically without user confirmation.
6) Check Deployment Auth
Run auth readiness check:
CODEBLOCK2
Auth is valid when either:
- -
CLOUDFLARE_API_TOKEN + CLOUDFLARE_ACCOUNT_ID are set, or - INLINECODE12 succeeds.
If auth is missing, ask the user to authenticate:
CODEBLOCK3
7) Auto-Deploy to Cloudflare Pages
After explicit approval + auth ready:
CODEBLOCK4
Or use one-shot pipeline:
CODEBLOCK5
8) Returnables
Return:
- - Cloudflare Pages site URL
- Privacy Policy URL (
<site>/privacy.html) - Terms of Service URL (
<site>/terms.html) - Auth mode used (
api-token or wrangler-login)
Guardrails
- - Do not claim legal compliance guarantees.
- Keep wording plain and readable.
- Keep deterministic page structure for easy future edits.
- Recommend human legal review before production app-store submission.
应用法律页面
为应用生成完整的法律迷你站点:
- - index.html(法律首页)
- privacy.html(隐私政策)
- terms.html(服务条款)
- styles.css(共享样式)
工作流程
- 1. 收集所需的法律/产品输入信息。
- 根据功能文档生成法律页面草稿。
- 运行严格一致性检查器。
- 呈现生成的页面供用户审阅/批准。
- 检查Cloudflare部署认证就绪状态。
- 如果缺少认证,要求用户完成认证。
- 在明确确认后自动部署到Cloudflare Pages。
- 返回最终的公开URL。
1) 收集输入信息
收集或确认:
- - 应用名称
- 公司/实体名称(或个人发布者名称)
- 联系邮箱
- 管辖法律司法管辖区(国家/地区,可选;仅在明确提供时)
- 生效日期
- 应用功能文档(markdown/文本)
- 数据行为详情:
- 分析事件
- 崩溃/错误日志
- 标识符(设备/用户ID)
- 第三方SDK/服务
- 使用的权限(相机/位置/照片/麦克风/通讯录/跟踪/通知)
如果事实未知,在生成前暂停并询问缺失的输入。不要在最终页面中输出占位符标记(无TODO/TEMP字符串)。
除非输入文档或用户提示中明确说明,否则不要假设司法管辖区、地区、分析/跟踪、共享或权限使用。
首先根据明确的产品声明生成政策条款(例如,仅离线、无云、无跟踪、无分析),并避免引入矛盾的通用法律模板。
2) 生成草稿站点
运行:
bash
python3 scripts/generatelegalsite.py \
--input /path/to/app-feature.md \
--out ./out/legal-site \
--app-name Your App \
--company Your Company \
--base-email chentuan7963@gmail.com \
--email-tag quillnest \
--effective-date 2026-03-03 \
--jurisdiction California, United States
邮箱规则:
- - 优先使用GitHub/基础邮箱加应用标签的加号地址派生。
- 示例:chentuan7963@gmail.com + quillnest => chentuan7963+quillnest@gmail.com。
- 仅在明确需要固定地址时使用--email。
语言规则:
- - 默认生成仅英文的法律页面。
- 从功能上下文中排除非英文功能要点,以保持语言一致性。
脚本会自动从功能文本中检测可能的数据类别/权限。如果应用行为比启发式检测更具体,请手动审阅并调整输出。
3) 运行严格一致性检查器
在发布前运行:
bash
python3 scripts/check_consistency.py \
--feature /path/to/app-feature.md \
--privacy ./out/legal-site/privacy.html \
--terms ./out/legal-site/terms.html
检查器在以下情况下失败:
- - 占位符标记(TODO/TEMP/FIXME)
- 与明确产品声明矛盾(离线/无云/无跟踪/无分析)
- 功能文档中提及EXIF但无相应隐私披露
- 未明确提供司法管辖区时,服务条款中出现管辖法律章节
4) 验证草稿质量
在发布前检查:
- - privacy.html和terms.html均存在。
- 应用/公司/邮箱/生效日期在各页面间一致。
- 隐私披露仅匹配明确声明的权限和数据行为(无推断的跟踪/地区声明)。
- 用户权利和联系/删除请求路径存在。
- 无无法验证的法律声明。
- 最终页面不含占位符标记(禁止:TODO/TEMP/FIXME)。
如果应用使用敏感权限或SDK,请验证这些已在隐私政策中明确披露。
5) 审阅关卡(强制)
在部署前,与用户共享生成的文件并要求明确批准部署。
未经用户确认不得自动部署。
6) 检查部署认证
运行认证就绪检查:
bash
python3 scripts/deploycloudflarepages.py --check-auth --site-dir ./out/legal-site --project-name your-project-name --production-branch main
认证在以下任一情况下有效:
- - 已设置CLOUDFLAREAPITOKEN + CLOUDFLAREACCOUNTID,或
- wrangler whoami成功执行。
如果缺少认证,要求用户进行认证:
bash
wrangler login
7) 自动部署到Cloudflare Pages
在明确批准 + 认证就绪后:
bash
python3 scripts/deploycloudflarepages.py \
--site-dir ./out/legal-site \
--project-name your-project-name \
--production-branch main
或使用一次性管道:
bash
python3 scripts/run_pipeline.py \
--feature /path/to/app-feature.md \
--out ./out/legal-site \
--app-name Your App \
--company Your Company \
--base-email you@gmail.com \
--email-tag yourapp \
--effective-date 2026-03-05 \
--project-name your-project-name \
--production-branch main \
--confirm-deploy
8) 返回内容
返回:
- - Cloudflare Pages站点URL
- 隐私政策URL(/privacy.html)
- 服务条款URL(/terms.html)
- 使用的认证模式(api-token或wrangler-login)
防护措施
- - 不声称法律合规保证。
- 保持措辞简洁易读。
- 保持确定的页面结构以便未来编辑。
- 建议在正式提交应用商店前进行人工法律审阅。