Skip to content
Skills Library
Programming · Building & coding

offline-divination-app

/offline-divination-app

从零搭建完全离线的占卜类应用(塔罗抽牌、牌阵解读、八字五行合参),并打包为可上架的 iOS/Android 原生 App。当用户说「做一个占卜 App」「开发塔罗占卜工具」「合作运势测算工具」「要能离线在手机上用」或需要在不联网环境下运行命理、占卜、合盘类应用时使用。

Licence
MIT
Last repository change
04.11.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
15
Scripts
6
HTML comments
0
URLs in SKILL.md
1
Deprecation

No signals detected. Repository changed on 04.11.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What to check before installing
  • 6 scripts in this package. Review them before installing, as Claude may execute them.

Scripts: assets/scaffold/assets/js/app.js, assets/scaffold/assets/js/data/spreads.js, assets/scaffold/assets/js/data/tarot.js, assets/scaffold/assets/js/engine/divination.js, scripts/check_offline.py, scripts/scaffold.py

What it does and when to use it

从零搭建完全离线的占卜类应用(塔罗抽牌、牌阵解读、八字五行合参),并打包为可上架的 iOS/Android 原生 App。当用户说「做一个占卜 App」「开发塔罗占卜工具」「合作运势测算工具」「要能离线在手机上用」或需要在不联网环境下运行命理、占卜、合盘类应用时使用。

Original author description

从零搭建完全离线的占卜类应用(塔罗抽牌、牌阵解读、八字五行合参),并打包为可上架的 iOS/Android 原生 App。当用户说「做一个占卜 App」「开发塔罗占卜工具」「合作运势测算工具」「要能离线在手机上用」或需要在不联网环境下运行命理、占卜、合盘类应用时使用。

How it works

  1. 何时用这个 skill
  2. 五步工作流
  3. 三条不可妥协的红线
  4. 常见翻车点
  5. 参考文件
  6. 脚本
Original SKILL.md headings · 110 lines, 315 words
SKILL.md preview
---
name: offline-divination-app
description: 从零搭建完全离线的占卜类应用(塔罗抽牌、牌阵解读、八字五行合参),并打包为可上架的 iOS/Android 原生 App。当用户说「做一个占卜 App」「开发塔罗占卜工具」「合作运势测算工具」「要能离线在手机上用」或需要在不联网环境下运行命理、占卜、合盘类应用时使用。
agent_created: true
---

# 离线占卜 App 构建

做一个**断网可用、数据不出手机、可商用闭源**的占卜类 App。核心不是"调用某个占卜 API",而是把占卜拆成两层:**可离线计算的确定性层**(抽牌、排盘、历法)与**可离线运行的解读层**(静态文案库 + 规则引擎)。云端 AI 只做可选的锦上添花,绝不能成为主链路依赖。

## 何时用这个 skill

触发场景:

- 「做一个塔罗占卜 App」「开发一个占卜工具」「合作/感情合盘工具」
- 「能不能离线运行」「飞行模式也要能用」「数据不要上传」
- 「帮我打包成手机上能装的 App」,且内容属占卜、命理、运势、合盘类

**不适用**:需要实时行情/联网数据的应用;纯占卜文案创作(不涉及工程实现);已有 App 只改一处 UI。

## 五步工作流

按顺序走,每一步都有明确的产出物。跳步会在后面付出更大代价。

### 第 1 步:先定形态与解读层,别急着写代码

必须与用户确认两件事,缺一不可:

| 决策 | 选项 | 建议默认 |
|---|---|---|
| 载体形态 | HTML5 单文件/浏览器 → PWA → 原生 App | **Capacitor 包装**:先纯 Web 跑通,再套壳上架,一套代码两端可用 |
| 解读方式 | 离线规则 / 离线为主+联网增强 / 端侧小模型 | **离线规则为主**,联网仅可选;端侧模型体积大、中文命理质量不可控 |

把这两条写进对话确认后再动手。用户若说"要真正的 AI 智能解读",要如实说明:**离线与"通用大模型级智能"不可兼得**,只能规则兜底 + 联网增强。

### 第 2 步:查依赖许可证(这一步能救整个产品)

在 `npm install` 之前,逐个核查:

```bash
npm view <包名> version license dependencies
```

**凡是 AGPL / GPL,一律不引入闭源分发的 App。** 详见 `references/licensing.md`(含真实踩坑案例与 MIT 白名单)。

### 第 3 步:搭四层结构

```
assets/
├── js/vendor/     第三方库本地化(复制进仓库,不用 CDN)
├── js/data/       静态数据层:牌库、牌阵、五行表
├── js/engine/     纯函数引擎:抽牌、解读、评分、动效
└── js/ai/         可选增强层(未配置时必须静默降级)
```

铁律:**vendor 里的库必须是本地文件**。任何 `https://cdn...` 引用都会让"离线"变成假离线。细节见 `references/architecture.md`。

### 第 4 步:写数据层与规则引擎

占卜的"智能"来自**数据颗粒度**,不是算法复杂度。牌库字段设计、牌阵定义、评分规则、文案组合逻辑,见:

- `references/tarot-engine.md` —— 78 张牌数据结构、正逆位、牌阵与评分规则
- `references/bazi-wuxing.md` —— 用 `lunar-javascript` 本地算日主五行与生克

关键设计原则:**每张牌的合作/关系场景含义单独一个字段**。只写通用牌义,解读会像百度百科;写了场景含义,才会像"懂这段关系"。

### 第 5 步:离线体检 + 打包

先用脚本体检,再打包:

```bash
python scripts/check_offline.py <项目目录>          # 离线合规体检,必须全绿
python scripts/scaffold.py <目标目录> --title 我的占卜  # 需要骨架时才用
```

体检会拦:外部 URL / CDN 引用、`node_modules` 混入产物、AGPL 依赖、缺失的本地 vendor、隐私风险写法。

打包 Capacitor 流程、构建脚本坑位,见 `references/packaging.md`。

## 三条不可妥协的红线

1. **许可证**:AGPL 不进闭源 App。宁可自己写算法,也不引入传染性许可证。
2. **零外链**:产物目录里不允许出现任何远程 URL。构建脚本应主动扫描并拦截。
3. **离线优先降级**:联网模块未配置、断网、接口报错时,必须静默走本地规则,**绝不阻塞主流程、绝不弹错误**。

## 常见翻车点

| 症状 | 原因 | 处理 |
|---|---|---|
| 打包后白屏 | 资源用了绝对路径或 CDN | 全改相对路径,`check_offline.py` 会报 |
| 页面上填生日就崩 | DOM id 两端不同步 | 改 id 时同步 `index.html` 与 `app.js` 的绑定表 |
| 构建脚本静默失败 | 复制 API 在部分环境不可用 | 改手动递归复制,别用 `cpSync` 之类 |
| 用户投诉"解读太泛" | 牌义只有通用含义 | 补场景字段(合作/感情/事业各一份) |
| App 被指侵权 | 引了 AGPL 库 | 换 MIT 库或自研 |

## 参考文件

| 文件 | 内容 |
|---|---|
| `references/licensing.md` | 许可证核查法与避坑案例 |
| `references/architecture.md` | 四层结构与离线约束 |
| `references/tarot-engine.md` | 牌库结构、牌阵、评分规则 |
| `references/bazi-wuxing.md` | 本地历法与五行合参 |
| `references/packaging.md` | Capacitor 打包与构建坑位 |
| `references/ui-motion.md` | 克制、可中断的移动端动效 |

## 脚本

| 脚本 | 用途 | 是否改动文件 |
|---|---|---|
| `scripts/check_offline.py` | 离线合规体检,输出问题清单 | 只读 |
| `scripts/scaffold.py` | 生成最小可运行骨架 | 新建目录,不覆盖已有文件 |

两个脚本都支持 `--help`,纯标准库,无需安装依赖。
Files in this package (15)
  • SKILL.md 6 KB
  • assets/scaffold/index.html 2 KB
  • assets/scaffold/assets/css/style.css 6 KB
  • assets/scaffold/assets/js/app.js 4 KB
  • assets/scaffold/assets/js/data/spreads.js 2 KB
  • assets/scaffold/assets/js/data/tarot.js 6 KB
  • assets/scaffold/assets/js/engine/divination.js 3 KB
  • references/architecture.md 5 KB
  • references/bazi-wuxing.md 4 KB
  • references/licensing.md 3 KB
  • references/packaging.md 3 KB
  • references/tarot-engine.md 7 KB
  • references/ui-motion.md 4 KB
  • scripts/check_offline.py 10 KB
  • scripts/scaffold.py 3 KB

Versions

The database has no other skills named offline-divination-app.

Database snapshot: 13.11.2026 · package version 7f3e1681e27a (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100uniapp-native-app
    A comprehensive skill for uni-app native app offline packaging. Use this skill to package uni-app as native Android/iOS apps, configure native app settings, handle signing, and follow official offline packaging documentation.
  • 100capacitor
    Capacitor is a runtime that packages a web app as a native iOS and Android app and exposes native device APIs to JavaScript. Use when someone asks to "convert my website to a mobile app", "Capacitor", "web to native app", "access camera from JavaScript", "deploy web app to App…
  • 85mobile-engineering
    Build cross-platform and native mobile apps (Flutter, React Native, iOS, Android): architecture, offline, performance, security, store release. Use for mobile app design, implementation or review.
  • 100hk-mobile-app-ui-validation
    Drive a native iOS or Android app on a device or simulator through the mobile MCP, screenshot every screen, measure touch targets, and write up mis-taps, clipped text and screens that trap the user as one HTML page with a score out of 10. Triggers on: 'mobile UI audit', 'touch…
  • 100mobile-app-design
    Design a native iOS (SwiftUI) and Android (Jetpack Compose) app as a whole: product brief, information architecture and navigation, a visual identity of its own, a token and component system in DESIGN.md, every screen with its hierarchy and all of its states, interaction and…
  • 100mobile-development
    Build, test, sign, and ship mobile apps across iOS, Android, Flutter, and React Native — project scaffolding, builds and code signing, device and emulator testing, store submission (App Store and Play Store), app lifecycle and backgrounding, offline and sync, and mobile-specific…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.