{"repo": "aicoder2048/mini-six-ren-skill", "files": {".claude/skills/mini-six-ren/SKILL.md": {"c13d31c887892ef2dd5407f8c299f9a365e5e67f": {"t": 1785746605.9736323, "n": 10662, "h": "0fd0bd63a8af577b", "c": "---\nname: mini-six-ren\ndescription: \"小六壬占卜系统 (Mini Six Ren Divination) - 中国传统占卜和命理分析。Use when the user asks for divination, fortune telling, or prediction using mini six ren (小六壬), or mentions keywords: 占卜、算卦、小六壬、三传、运势、占一卦、divination、fortune. Supports four input modes: numbers, date/time, Chinese characters (汉字笔画), and current time. Generates three-pass (三传) predictions with rich structured analysis: auspice grading, overall pattern, five-element flow, subject-object (体用) relation, special combinations, and timing/direction guidance. LLM interpretation follows a rigorous seven-step traditional framework.\"\n---\n\n# Mini Six Ren (小六壬占卜)\n\nChinese traditional divination based on the Nine-Palace hand technique (九宫掌诀). Generates three-pass (三传) predictions with multi-layer analysis, then provides AI-powered interpretation grounded in traditional methodology.\n\n## Workflow\n\n1. Determine input mode (numbers / datetime / Chinese chars / current time).\n2. Run `scripts/xiaoliu.py --format json` to compute the prediction (now returns a rich analytical JSON — see \"JSON Schema\" below).\n3. Check if `config.yaml` exists and has a `model` field:\n - **No config** (default): Display `ℹ️ 当前使用 Claude Code 内置模型解读。如需使用第三方模型,请创建 config.yaml`. Then perform the built-in LLM analysis following the \"Seven-Step Interpretation Framework\" below.\n - **Has config + API key**: Display `ℹ️ 当前使用 解读`. Pipe the prediction JSON into `scripts/interpret.py`:\n ```bash\n uv run scripts/xiaoliu.py --now --question \"问题\" --format json | \\\n uv run scripts/interpret.py --question \"问题\"\n ```\n - **Has config, missing API key**: Display `⚠️ 请在 .env 中设置 `. Fall back to built-in LLM analysis.\n4. Format the final report using `assets/template.md`, filling all placeholders with the prediction JSON and the LLM analysis.\n\n## Quick Start\n\n```bash\n# By three numbers\nuv run scripts/xiaoliu.py --numbers 1,2,3 --question \"今日运势\" --format json\n\n# By date/time (auto-converted to lunar month / day / hour-branch)\nuv run scripts/xiaoliu.py --datetime \"2025-07-15 10:30\" --question \"面试能成功吗\" --format json\n\n# By Chinese characters (uses stroke count)\nuv run scripts/xiaoliu.py --chars \"天地人\" --question \"感情运势\" --format json\n\n# By current time\nuv run scripts/xiaoliu.py --now --question \"今天适合出行吗\" --format json\n```\n\nUse `--format json` for LLM analysis. Use `--format text` for direct human-readable display (already includes the analytical sections).\n\n## Input Mode Selection\n\n| User says | Mode | Example |\n|---|---|---|\n| gives 3 numbers | `--numbers` | `--numbers 3,5,7` |\n| mentions a date/time | `--datetime` | `--datetime \"2025-01-31 14:30\"` |\n| gives Chinese characters | `--chars` | `--chars \"天地人\"` |\n| \"用现在的时间\" / \"now\" | `--now` | `--now` |\n| no specific input | `--now` | default to current time |\n\n## JSON Schema (key analytical fields)\n\nThe script now outputs a structured JSON with these top-level fields:\n\n| Field | Purpose |\n|---|---|\n| `input` | Input mode metadata (mode, raw, lunar/hour for datetime modes, stroke_counts for chars) |\n| `input_numbers` | The three step numbers used for 三传 computation |\n| `passes` | The three passes; each has `position`, `role` (体/枢/用), `symbol` with `auspice`/`auspice_level`/`question_lens` |\n| `relations` | Pairwise five-element relations between adjacent passes, with `meaning` |\n| `subject_object` | 体用关系: subject (initial) vs object (final) — relation + interpretation |\n| `flow` | Overall five-element flow pattern (连珠相生 / 连珠相克 / 三同比和 / 始克终生 / ... ) with explanation |\n| `patterns` | `overall_pattern` (三吉/二吉一凶/...), `grade` (上上格..下下格), `trend` (渐入佳境/苦尽甘来/...), `auspice_score` |\n| `combinations` | Detected special combinations (双符 / 三符格局) with valence |\n| `timing_guidance` | Season, months, hours, directions (based on末传 element + 三传 auspice-sorted directions), favorable deities |\n| `question` | Echo of the user's question |\n\n**Key field for question-aware interpretation**: `passes[i].symbol.question_lens` provides each symbol's auspice level (-2..+2) for each of 8 question categories (财运/情感/事业/健康/学业/家庭/官非/出行). Always prefer the lens value over the base `auspice_level` when the user's question category is identifiable.\n\n## Seven-Step Interpretation Framework\n\nWhen performing the built-in LLM analysis (Claude Code's own model, no third-party config), follow this rigorous seven-step traditional framework. (`scripts/interpret.py` embeds the same framework in its system prompt for third-party models.)\n\n### Step 1: 识别问题类别 (Identify Question Category)\n\nMap the user's question to one of 8 categories — this determines which `question_lens` index to use:\n\n| 类别 | 关键词 |\n|---|---|\n| 财运 | 钱、财、生意、投资、加薪、奖金、买卖 |\n| 情感 | 恋爱、感情、婚姻、对象、复合、分手 |\n| 事业 | 工作、项目、升迁、跳槽、offer、面试 |\n| 健康 | 病、手术、康复、检查、体检 |\n| 学业 | 考试、升学、留学、论文、读书 |\n| 家庭 | 家人、父母、子女、配偶、家事 |\n| 官非 | 官司、诉讼、纠纷、法律 |\n| 出行 | 出差、旅行、搬家、远行、调动 |\n\nIf no clear question or \"综合运势\": fall back to base `auspice_level`.\n\n### Step 2: 体用定位 (Subject-Object Positioning)\n\n- **初传 = 体** (problem原因 / 问者本身)\n- **末传 = 用** (所问事 / 最终结果)\n- **中传 = 枢** (过程枢纽)\n\nUse `subject_object.interpretation` from the JSON.\n\n### Step 3: 三传时序分析 (Sequential Analysis with Question Lens)\n\nFor each pass, answer:\n1. **In this question category**, what does this symbol mean? — Use `question_lens[category]` from each pass's symbol.\n2. **Five-element relation** with the adjacent pass — Use `relations[i].meaning`.\n3. **Direction and deity** — what energy does this position channel?\n\n**Critical**: the same symbol means different things across categories. Examples:\n- 桃花 → 情感 +2 大吉, 事业 -1 小凶\n- 大安 → 健康 +2 大吉, 出行 -1 小凶 (主静不主动)\n- 速喜 → 财运 +2 大吉, 健康 -1 小凶 (突发病症)\n\n### Step 4: 五行整体流转 (Overall Five-Element Flow)\n\nUse `flow.pattern` + `flow.explanation` + `patterns.trend`:\n- 连珠相生 → 气运绵延,最吉流转\n- 连珠相克 → 层层受制,最凶流转\n- 始克终生 → 先苦后甜\n- 始生终克 → 盛极而衰\n- 三同比和 → 力量集中难突变\n- 等等\n\n### Step 5: 特殊组合识别 (Detect Combinations)\n\nUse `combinations` list:\n- **三符格局** → defines the entire cast.\n- **双符组合**: valence \"+\" 强化吉象 / \"-\" 警示凶险 / \"0\" 取决于行动\n- If empty: skip; rely on basic analysis.\n\nSee [`references/combinations_reference.md`](references/combinations_reference.md) for detailed combination meanings.\n\n### Step 6: 应期与方位 (Timing & Direction)\n\nUse `timing_guidance`:\n- **应期**: season, months, hours (based on末传 element)\n- **吉方**: `favorable_directions_from_passes`\n- **避方**: `avoid_directions_from_passes`\n- **可借神灵**: `favorable_deities`\n\n### Step 7: 综合判断与建议 (Synthesis & Advice)\n\nTie everything back to the user's specific question. Give a clear answer (能成 / 不能成 / 部分成 / 需某条件).\n\n### Built-in LLM Output Structure\n\nGenerate analysis in **this exact section order** (matches `assets/template.md` placeholders):\n\n1. **🎯 卦象总览** (`ai_overview`) — one paragraph: 整体格局 + 五行流转 + 趋势 (1-2 sentences定调)\n2. **⏳ 时间脉络** (`ai_timeline`) — 三段:初传 / 中传 / 末传, each 2-4 sentences with question lens\n3. **⚖️ 体用与五行** (`ai_subject_object_flow`) — explain \"why事态如此走向\": 体用关系 × 五行流转\n4. **🌟 关键组合** (`ai_combinations`) — 1-2 most relevant combinations, or note that none formed\n5. **🧭 应期与方位** (`ai_timing_direction`) — when / where / which deity to invoke\n6. **💡 行动建议** (`ai_advice`) — 3-5 concrete actionable bullets\n7. **🔮 结论** (`ai_conclusion`) — 1-2 sentences: direct answer to the question\n\n### Style Guidelines\n\n- 始终扣紧用户问题——never泛泛而谈。\n- 末传最重要 (final pass = primary indicator).\n- 避免极端断言——用\"宜\"\"忌\"\"可\"\"需\"等留余地。\n- Elegant, philosophical Chinese, but accessible.\n- **Total length: 700-1100 中文字** for the LLM analysis portion.\n\n## Report Output\n\nAfter generating the prediction JSON and the LLM analysis, format using [`assets/template.md`](assets/template.md). Replace all `{{placeholder}}` variables with values from the script output and the LLM analysis.\n\n### Key template variables\n\n**From `xiaoliu.py` JSON output**:\n- `{{timestamp}}`, `{{input_mode}}`, `{{input_data}}`, `{{input_numbers}}`, `{{question}}`\n- `{{overall_pattern}}`, `{{grade}}`, `{{auspice_score}}`, `{{trend}}`, `{{trend_explanation_short}}`\n- `{{flow_pattern}}`, `{{element_sequence}}`, `{{flow_explanation}}`\n- Per pass: `{{first_name}}`, `{{first_element}}`, `{{first_auspice}}`, `{{first_level}}`, `{{first_description}}`, `{{first_interpretation}}`, `{{first_direction}}`, `{{first_deity}}`, `{{first_lens_value}}` (and `second_*`, `third_*` analogously)\n- `{{relation_1_2}}`, `{{relation_2_3}}`, `{{relation_1_2_meaning}}`, `{{relation_2_3_meaning}}`\n- `{{subject_object_relation}}`, `{{subject_object_interpretation}}`, `{{subject_object_summary}}`, `{{subject_object_relation_short}}`\n- `{{primary_element}}`, `{{element_spirit}}`, `{{season}}`, `{{favorable_months}}`, `{{favorable_hours}}`, `{{element_directions}}`, `{{favorable_directions_from_passes}}`, `{{avoid_directions_from_passes}}`, `{{favorable_deities}}`, `{{favorable_colors}}`\n- `{{#combinations}}...{{/combinations}}` block: iterates over the `combinations` array, each item has `{{combo_name}}`, `{{combo_type}}`, `{{combo_symbols}}`, `{{combo_meaning}}`. If empty, replace the whole loop with the note \"本卦三传无形成传统特殊组合,回归基础卦象分析。\"\n\n**From LLM analysis** (you generate these strings):\n- `{{ai_overview}}`, `{{ai_timeline}}`, `{{ai_subject_object_flow}}`, `{{ai_combinations}}`, `{{ai_timing_direction}}`, `{{ai_advice}}`, `{{ai_conclusion}}`\n- For question-lens explanations: `{{first_lens_explanation}}`, `{{second_lens_explanation}}`, `{{third_lens_explanation}}` (brief 1-line explanation tying the lens value to the user's question)\n\n## Third-Party Model Configuration (Optional)\n\nBy default, the skill uses Claude Code's built-in LLM for interpretation. To use a third-party model:\n\n### Step 1: Create `config.yaml`\n\n```yaml\n# 格式: provider:model_name\nmodel: deepseek:deepseek-chat\n```\n\n### Step 2: Set API Key in `.env`\n\n```bash\nDEEPSEEK_API_KEY=sk-...\n```\n\n### Supported Providers\n\n| Provider prefix | API Key env var | Notes |\n|---|---|---|\n| `openai` | `OPENAI_API_KEY` | GPT series |\n| `anthropic` | `ANTHROPIC_API_KEY` | Claude series |\n| `google-gla` | `GEMINI_API_KEY` | Gemini series |\n| `deepseek` | `DEEPSEEK_API_KEY` | DeepSeek |\n| `kimi` | `MOONSHOT_API_KEY` | Moonshot Kimi |\n| `qwen` | `DASHSCOPE_API_KEY` | Alibaba Qwen |\n| `glm` | `ZHIPU_API_KEY` | Zhipu ChatGLM |\n\n`interpret.py` embeds the same seven-step framework as a system prompt, so third-party models produce comparably structured output. To switch back to the built-in LLM, delete `config.yaml`.\n\n## References\n\n- [`references/symbols_reference.md`](references/symbols_reference.md) — 九宫符号详解 (按 8 类问题分化)\n- [`references/interpretation_framework.md`](references/interpretation_framework.md) — 七步解读框架方法论\n- [`references/combinations_reference.md`](references/combinations_reference.md) — 双符 / 三符特殊组合谱\n- `examples/` — 三种输入方式示例\n"}, "6229a7a056a2e08c27927c9004ed251e791fe2ae": {"t": 1785766234.715387, "n": 4931, "h": "c39f92b14fb09c30", "c": "---\nname: mini-six-ren\ndescription: \"小六壬占卜系统 (Mini Six Ren Divination) - 中国传统占卜和命理分析。Use when the user asks for divination, fortune telling, or prediction using mini six ren (小六壬), or mentions keywords: 占卜、算卦、小六壬、三传、运势、占一卦、divination、fortune. Supports three input modes: numbers, date/time, and Chinese characters (汉字笔画). Generates three-pass (三传) predictions with five-element (五行) analysis and LLM-powered interpretation.\"\n---\n\n# Mini Six Ren (小六壬占卜)\n\nChinese traditional divination system based on the Nine-Palace hand technique. Generate three-pass (三传) predictions and provide AI-powered analysis.\n\n## Workflow\n\n1. Determine input mode (numbers / datetime / Chinese chars / current time)\n2. Run `scripts/xiaoliu.py --format json` to compute the prediction\n3. Check if `config.yaml` exists and has a `model` field:\n - **No config** (default): Display `ℹ️ 当前使用 Claude Code 内置模型解读。如需使用第三方模型,请创建 config.yaml`。Then use the built-in LLM to analyze the result following the \"LLM Analysis\" section below.\n - **Has config + API key**: Display `ℹ️ 当前使用 解读`。Run `scripts/interpret.py` with the prediction JSON piped in:\n ```bash\n uv run scripts/xiaoliu.py --now --question \"问题\" --format json | \\\n uv run scripts/interpret.py --question \"问题\"\n ```\n - **Has config, missing API key**: Display `⚠️ 请在 .env 中设置 `。Fall back to built-in LLM analysis.\n4. Format the report using `assets/template.md`\n\n## Quick Start\n\nRun the divination script (uv single-file script, no project install needed):\n\n```bash\n# By three numbers\nuv run scripts/xiaoliu.py --numbers 1,2,3 --question \"今日运势\" --format json\n\n# By date/time (converts to lunar calendar internally)\nuv run scripts/xiaoliu.py --datetime \"2025-07-15 10:30\" --question \"面试能成功吗\" --format json\n\n# By Chinese characters (uses stroke count)\nuv run scripts/xiaoliu.py --chars \"天地人\" --question \"感情运势\" --format json\n\n# By current time\nuv run scripts/xiaoliu.py --now --question \"今天适合出行吗\" --format json\n```\n\nUse `--format json` to get structured output for LLM analysis. Use `--format text` for human-readable display.\n\n## Input Mode Selection\n\n| User says | Mode | Example |\n|---|---|---|\n| gives 3 numbers | `--numbers` | `--numbers 3,5,7` |\n| mentions a date/time | `--datetime` | `--datetime \"2025-01-31 14:30\"` |\n| gives Chinese characters | `--chars` | `--chars \"天地人\"` |\n| \"用现在的时间\" / \"now\" | `--now` | `--now` |\n| no specific input | `--now` | default to current time |\n\n## LLM Analysis\n\nAfter getting the JSON prediction result, provide an analysis following this structure. Role-play as a 小六壬占卜大师 with deep traditional culture knowledge.\n\n### Analysis structure\n\n1. **卦象总览**: Summarize the three passes and their elements\n2. **时间发展脉络**:\n - 初传(前期/当前): What the first symbol means for this question\n - 中传(中期/发展): How the middle symbol drives change\n - 末传(后期/结果): What the final symbol predicts\n3. **五行生克解读**: Explain how the element relationships affect the outcome\n4. **具体建议**: Practical, actionable advice tied to the question\n5. **关键提示**: Notable directions, timing, or deity influences\n\n### Analysis guidelines\n\n- Always tie the interpretation to the specific question asked\n- Prioritize the final pass (末传) as the most important indicator\n- Explain five-element relationships in terms the user understands\n- Keep analysis under 800 characters (Chinese) for conciseness\n- Use elegant, philosophical Chinese language but remain accessible\n\n## Report Output\n\nAfter generating the prediction and LLM analysis, format using `assets/template.md`. Replace all `{{placeholder}}` variables with actual values from the script output and LLM analysis.\n\n## Third-Party Model Configuration (Optional)\n\nBy default, the skill uses Claude Code's built-in LLM for interpretation. To use a third-party model instead:\n\n### Step 1: Create `config.yaml`\n\nCreate `config.yaml` in the skill root directory (`mini-six-ren/config.yaml`):\n\n```yaml\n# 格式: provider:model_name\nmodel: deepseek:deepseek-chat\n```\n\nFormat: `provider:model_name`\n\n### Step 2: Set API Key in `.env`\n\nAdd your API key to `mini-six-ren/.env`:\n\n```bash\nDEEPSEEK_API_KEY=sk-...\n```\n\n### Supported Providers\n\n| Provider prefix | API Key env var | Notes |\n|---|---|---|\n| `openai` | `OPENAI_API_KEY` | GPT series |\n| `anthropic` | `ANTHROPIC_API_KEY` | Claude series |\n| `google-gla` | `GEMINI_API_KEY` | Gemini series |\n| `deepseek` | `DEEPSEEK_API_KEY` | DeepSeek |\n| `kimi` | `MOONSHOT_API_KEY` | Moonshot Kimi |\n| `qwen` | `DASHSCOPE_API_KEY` | Alibaba Qwen |\n| `glm` | `ZHIPU_API_KEY` | Zhipu ChatGLM |\n\n### Examples\n\n```yaml\n# DeepSeek\nmodel: deepseek:deepseek-chat\n\n# GPT-4o\n# model: openai:gpt-4o\n\n# Qwen\n# model: qwen:qwen-plus\n```\n\nTo switch back to built-in LLM, simply delete `config.yaml`.\n\n## Reference\n\nFor detailed symbol meanings and five-element relationships: see [references/symbols_reference.md](references/symbols_reference.md)\n\nFor usage examples: see the `examples/` directory\n"}, "f2e317424b4c65f9637807932c706f24178d7e3a": {"t": 1785766236.2086413, "n": 3256, "h": "25efb0d61fd4503a", "c": "---\nname: mini-six-ren\ndescription: \"小六壬占卜系统 (Mini Six Ren Divination) - 中国传统占卜和命理分析。Use when the user asks for divination, fortune telling, or prediction using mini six ren (小六壬), or mentions keywords: 占卜、算卦、小六壬、三传、运势、占一卦、divination、fortune. Supports three input modes: numbers, date/time, and Chinese characters (汉字笔画). Generates three-pass (三传) predictions with five-element (五行) analysis and LLM-powered interpretation.\"\n---\n\n# Mini Six Ren (小六壬占卜)\n\nChinese traditional divination system based on the Nine-Palace hand technique. Generate three-pass (三传) predictions and provide AI-powered analysis.\n\n## Workflow\n\n1. Determine input mode (numbers / datetime / Chinese chars / current time)\n2. Run `scripts/xiaoliu.py` to compute the prediction\n3. Use LLM to analyze the result based on the user's question\n4. Format the report using `assets/template.md`\n\n## Quick Start\n\nRun the divination script (uv single-file script, no project install needed):\n\n```bash\n# By three numbers\nuv run scripts/xiaoliu.py --numbers 1,2,3 --question \"今日运势\" --format json\n\n# By date/time (converts to lunar calendar internally)\nuv run scripts/xiaoliu.py --datetime \"2025-07-15 10:30\" --question \"面试能成功吗\" --format json\n\n# By Chinese characters (uses stroke count)\nuv run scripts/xiaoliu.py --chars \"天地人\" --question \"感情运势\" --format json\n\n# By current time\nuv run scripts/xiaoliu.py --now --question \"今天适合出行吗\" --format json\n```\n\nUse `--format json` to get structured output for LLM analysis. Use `--format text` for human-readable display.\n\n## Input Mode Selection\n\n| User says | Mode | Example |\n|---|---|---|\n| gives 3 numbers | `--numbers` | `--numbers 3,5,7` |\n| mentions a date/time | `--datetime` | `--datetime \"2025-01-31 14:30\"` |\n| gives Chinese characters | `--chars` | `--chars \"天地人\"` |\n| \"用现在的时间\" / \"now\" | `--now` | `--now` |\n| no specific input | `--now` | default to current time |\n\n## LLM Analysis\n\nAfter getting the JSON prediction result, provide an analysis following this structure. Role-play as a 小六壬占卜大师 with deep traditional culture knowledge.\n\n### Analysis structure\n\n1. **卦象总览**: Summarize the three passes and their elements\n2. **时间发展脉络**:\n - 初传(前期/当前): What the first symbol means for this question\n - 中传(中期/发展): How the middle symbol drives change\n - 末传(后期/结果): What the final symbol predicts\n3. **五行生克解读**: Explain how the element relationships affect the outcome\n4. **具体建议**: Practical, actionable advice tied to the question\n5. **关键提示**: Notable directions, timing, or deity influences\n\n### Analysis guidelines\n\n- Always tie the interpretation to the specific question asked\n- Prioritize the final pass (末传) as the most important indicator\n- Explain five-element relationships in terms the user understands\n- Keep analysis under 800 characters (Chinese) for conciseness\n- Use elegant, philosophical Chinese language but remain accessible\n\n## Report Output\n\nAfter generating the prediction and LLM analysis, format using `assets/template.md`. Replace all `{{placeholder}}` variables with actual values from the script output and LLM analysis.\n\n## Reference\n\nFor detailed symbol meanings and five-element relationships: see [references/symbols_reference.md](references/symbols_reference.md)\n\nFor usage examples: see the `examples/` directory\n"}}, "README.md": {"c13d31c887892ef2dd5407f8c299f9a365e5e67f": {"t": 1785746607.1173568, "n": 7631, "h": "ab60465c43176e54", "c": "# 小六壬占卜 — Claude Code Skill\n\n传统九宫小六壬占卜系统,作为 [Claude Code](https://docs.anthropic.com/en/docs/claude-code) 技能(Skill)运行,结合 AI 智慧解读卦象。\n\n支持数字、日期时间、汉字笔画、当前时间四种起卦方式,输出三传(初传→中传→末传)占卜结果,并由 LLM 结合五行生克进行个性化解读。\n\n---\n\n## 安装\n\n### 一键安装(推荐)\n\n使用 [skills.sh](https://skills.sh) 一键安装到当前项目:\n\n```bash\n# 使用 bunx\nbunx skills add https://github.com/aicoder2048/mini-six-ren-skill\n\n# 或使用 npx\nnpx skills add https://github.com/aicoder2048/mini-six-ren-skill\n```\n\n### 手动安装\n\n将 `.claude/skills/mini-six-ren/` 目录复制到你的任意项目的 `.claude/skills/` 下:\n\n```bash\n# 在目标项目根目录执行\nmkdir -p .claude/skills\ncp -r /XiaoLiuRenSkill/.claude/skills/mini-six-ren .claude/skills/\n```\n\n安装完成后,在该项目中使用 Claude Code 时,输入占卜相关的自然语言(如\"占一卦\"\"算算运势\"等),Claude 会自动识别并调用此技能。\n\n**运行环境要求**:\n- Python >= 3.10\n- [uv](https://docs.astral.sh/uv/) — 脚本使用 PEP 723 内联元数据,uv 会自动处理依赖安装(`lunardate>=0.2.0`)\n\n### Opencode CLI 移植建议\n\n> 以下为迁移思路,未经测试。\n\n[Opencode](https://github.com/opencode-ai/opencode) 的 Agent 体系与 Claude Code Skill 有所不同。核心算法脚本 `scripts/xiaoliu.py` 是独立可执行的,可直接复用。迁移时需要:\n\n1. 将 `SKILL.md` 中的工作流描述改写为 Opencode 的 Agent 配置格式\n2. 将 `assets/template.md` 报告模板和 `references/symbols_reference.md` 参考文档放入 Opencode 对应的上下文目录\n3. 在 Agent 配置中声明调用 `uv run scripts/xiaoliu.py` 的命令\n\n---\n\n## 小六壬算法详解\n\n### 九宫符号\n\n小六壬使用 9 个符号,每个符号对应五行、方位、神灵:\n\n| 序号 | 符号 | 五行 | 方位 | 关键词 | 神灵 |\n|:---:|:---:|:---:|:---:|---|:---:|\n| 1 | 大安 | 木 | 正东 | 长期、缓慢、稳定 | 三清 |\n| 2 | 留连 | 木 | 东南 | 停止、反复、复杂 | 文昌 |\n| 3 | 速喜 | 火 | 正南 | 惊喜、快速、突然 | 雷祖 |\n| 4 | 赤口 | 金 | 正西 | 争斗、凶恶、伤害 | 将帅 |\n| 5 | 小吉 | 水 | 正北 | 起步、不多、尚可 | 真武 |\n| 6 | 空亡 | 土 | 中间 | 失去、虚伪、空想 | 玉皇 |\n| 7 | 病符 | 土 | 西南 | 病态、异常、治疗 | 后土 |\n| 8 | 桃花 | 土 | 东北 | 欲望、牵绊、异性 | 城隍 |\n| 9 | 天德 | 金 | 西北 | 贵人、长辈、上司 | 紫薇 |\n\n#### 吉凶简判\n\n- **大吉**:大安、速喜、天德\n- **小吉**:小吉、留连(视情况)\n- **凶**:赤口(最凶)、空亡(金钱最忌)、病符\n- **中性**:桃花(恋爱吉,其余不吉)\n\n### 左手掌诀\n\n九宫符号排列在左手指节上,按顺序循环:\n\n```\n食指: [留连②]\n ↓\n中指: [大安①] → [速喜③]\n ↑\n无名指: [天德⑨] ← [赤口④]\n ↑\n [小吉⑤]\n [空亡⑥]\n [病符⑦]\n [桃花⑧]\n```\n\n顺序:大安→留连→速喜→赤口→小吉→空亡→病符→桃花→天德(循环)\n\n### 三传算法\n\n输入三个数字 `(num1, num2, num3)`,计算三传符号:\n\n1. **初传(前期)**:从第 1 位(大安)出发,走 `num1` 步\n2. **中传(中期)**:从初传的落点出发,走 `num2` 步\n3. **末传(后期)**:从中传的落点出发,走 `num3` 步\n\n每一步都在 9 个符号之间循环。算法核心:\n\n```\n初传位置 = (0 + num1 - 1) % 9\n中传位置 = (num1 - 1 + num2 - 1) % 9 # 即 (num1 + num2 - 2) % 9\n末传位置 = (num1 + num2 - 2 + num3 - 1) % 9 # 即 (num1 + num2 + num3 - 3) % 9\n```\n\n> 特殊处理:步数为 9 的倍数时映射到第 9 位(天德),而非回到第 1 位。\n\n### 五行生克关系\n\n**相生**(促进):\n\n```\n木 → 火 → 土 → 金 → 水 → 木(循环)\n```\n\n**相克**(制约):\n\n```\n木 → 土 → 水 → 火 → 金 → 木(循环)\n```\n\n系统判断 6 种关系:\n\n| 关系 | 说明 | 对事态影响 |\n|:---:|---|---|\n| 生 | 前者促进后者 | 顺利推进,有助发展 |\n| 克 | 前者制约后者 | 存在阻碍,需克服困难 |\n| 被生 | 后者反哺前者 | 有外力支持 |\n| 被克 | 后者反制前者 | 受到压制 |\n| 同 | 同属一行 | 相互扶持,力量加强 |\n| 无 | 无直接关系 | 各自独立发展 |\n\n### 解读优先级\n\n1. 先看**末传**(最终结果最重要)\n2. 再看三传之间的**五行生克关系**\n3. 最后结合各符号本身的含义和求问事项\n\n---\n\n## 输入模式\n\n### 数字模式 `--numbers`\n\n直接提供 3 个数字(逗号分隔),用作三传计算的步数。\n\n```bash\nuv run scripts/xiaoliu.py --numbers 3,5,7 --question \"事业运势\" --format json\n```\n\n### 日期时间模式 `--datetime`\n\n提供公历日期时间,系统自动转换:\n\n1. 公历 → **农历**(使用 `lunardate` 库)\n2. 取农历**月份**作为第一个数字\n3. 取农历**日期**作为第二个数字\n4. 将小时转换为**时辰序号**作为第三个数字\n\n```bash\nuv run scripts/xiaoliu.py --datetime \"2025-07-15 10:30\" --question \"面试能成功吗\" --format json\n```\n\n**时辰对照表**:\n\n| 时辰 | 时间段 | 序号 |\n|:---:|:---:|:---:|\n| 子时 | 23:00-01:00 | 1 |\n| 丑时 | 01:00-03:00 | 2 |\n| 寅时 | 03:00-05:00 | 3 |\n| 卯时 | 05:00-07:00 | 4 |\n| 辰时 | 07:00-09:00 | 5 |\n| 巳时 | 09:00-11:00 | 6 |\n| 午时 | 11:00-13:00 | 7 |\n| 未时 | 13:00-15:00 | 8 |\n| 申时 | 15:00-17:00 | 9 |\n| 酉时 | 17:00-19:00 | 10 |\n| 戌时 | 19:00-21:00 | 11 |\n| 亥时 | 21:00-23:00 | 12 |\n\n### 汉字模式 `--chars`\n\n提供 3 个汉字,系统查询笔画数作为输入数字:\n\n```bash\nuv run scripts/xiaoliu.py --chars \"天地人\" --question \"感情运势\" --format json\n```\n\n- 笔画数据基于 [Unicode Unihan 数据库](https://www.unicode.org/charts/unihan.html)(`kTotalStrokes` 字段),覆盖 102K+ CJK 字符的真实笔画\n- 数据预编译为 `scripts/strokes.json`(~960 KB),运行时懒加载,无网络依赖\n- 极罕见字(非 CJK 或 Unihan 数据缺失)回落到 Unicode 码点取模兜底,确保不报错\n\n### 当前时间模式 `--now`\n\n使用系统当前时间,自动按日期时间模式转换:\n\n```bash\nuv run scripts/xiaoliu.py --now --question \"今天适合出行吗\" --format json\n```\n\n---\n\n## 使用演示\n\n安装完成后,在 Claude Code 中直接用自然语言即可唤起占卜技能。以下为典型使用场景:\n\n### Demo 1:当前时间占卜\n\n**用户输入**:\n\n> 占一卦今日运势\n\nClaude Code 自动识别占卜意图,调用 `--now` 模式获取当前时间,转换为农历月日和时辰后计算三传,生成完整的占卜报告和 AI 解读。\n\n### Demo 2:指定日期占卜\n\n**用户输入**:\n\n> 2025年7月15日上午10点半面试,帮我占一卦\n\nClaude Code 从自然语言中提取日期时间 `2025-07-15 10:30`,调用 `--datetime` 模式:\n- 公历 2025-07-15 → 农历六月二十一\n- 10:30 → 巳时(序号 6)\n- 输入数字:`[6, 21, 6]`\n- 三传结果:空亡(土) → 桃花(土) → 赤口(金)\n- 五行关系:同 → 生\n\nAI 解读会结合面试场景,分析初期可能的不确定感(空亡)、人际交流的重要性(桃花)、以及需注意口舌争端的提醒(赤口)。\n\n### Demo 3:汉字起卦\n\n**用户输入**:\n\n> 用\"天地人\"三个字帮我算算感情运势\n\nClaude Code 提取汉字并调用 `--chars` 模式:\n- 天 = 4 画,地 = 6 画,人 = 2 画\n- 输入数字:`[4, 6, 2]`\n- 三传结果:赤口(金) → 天德(金) → 大安(木)\n- 五行关系:同 → 克\n\nAI 解读会结合感情主题,提醒注意口舌之争(赤口)、可寻求长辈指点(天德)、最终趋于安稳(大安)。\n\n### Demo 4:数字起卦\n\n**用户输入**:\n\n> 我心里想了三个数 3、5、7,占一卦事业运\n\nClaude Code 提取数字并调用 `--numbers 3,5,7`:\n- 三传结果根据数字 `[3, 5, 7]` 计算\n- AI 解读会围绕事业主题展开分析\n\n### Demo 5:生活场景\n\n**用户输入**:\n\n> 我爸爸下周三要做白内障手术,帮我占一卦\n\nClaude Code 会根据下周三的具体日期调用 `--datetime` 模式,生成完整的占卜报告。AI 解读会结合健康/手术主题,分析三传卦象的含义,给出实际的宽慰和建议。\n\n> 报告输出使用内置的 Markdown 模板,包含三传结果表格、符号详解、五行关系、以及 AI 智慧解读。\n\n---\n\n## 使用第三方 LLM 解读(可选)\n\n默认情况下,占卜解读由 Claude Code 内置模型完成,无需额外配置。如果你希望使用第三方模型(如 DeepSeek、GPT、Kimi 等),按以下两步配置:\n\n### 第 1 步:在 `config.yaml` 中激活模型\n\n编辑 `.claude/skills/mini-six-ren/config.yaml`,取消注释你想使用的模型行:\n\n```yaml\n# 取消注释下方某一行以启用第三方模型解读。\n# 不配置或全部注释 = 使用 Claude Code 内置模型解读(默认)。\n\n# --- DeepSeek ---\nmodel: deepseek:deepseek-chat\n\n# --- OpenAI ---\n# model: openai:gpt-5-mini\n# model: openai:gpt-5.2\n\n# --- Moonshot Kimi ---\n# model: kimi:kimi-k2.5\n\n# --- Anthropic ---\n# model: anthropic:claude-sonnet-4.5\n\n# --- Google Gemini ---\n# model: google:gemini-3-flash\n\n# ... 更多选项见 config.yaml 文件\n```\n\n> 同一时间只能激活一个模型,确保只有一行 `model:` 未被注释。\n\n### 第 2 步:在 `.env` 中提供 API Key\n\n参照 `.env.sample`,在 `.claude/skills/mini-six-ren/.env` 中填入对应的 API Key:\n\n```bash\n# 示例:使用 DeepSeek\nDEEPSEEK_API_KEY=sk-your-deepseek-api-key\n\n# 示例:使用 OpenAI\n# OPENAI_API_KEY=sk-your-openai-api-key\n```\n\n完整的 Provider 与 API Key 对照表:\n\n| Provider | `config.yaml` 前缀 | `.env` 变量 |\n|---|---|---|\n| DeepSeek | `deepseek:` | `DEEPSEEK_API_KEY` |\n| OpenAI | `openai:` | `OPENAI_API_KEY` |\n| Anthropic | `anthropic:` | `ANTHROPIC_API_KEY` |\n| Google Gemini | `google:` | `GEMINI_API_KEY` |\n| Moonshot Kimi | `kimi:` | `MOONSHOT_API_KEY` |\n| Alibaba Qwen | `qwen:` | `DASHSCOPE_API_KEY` |\n| Zhipu GLM | `glm:` | `ZHIPU_API_KEY` |\n\n> 切换回内置模型:将 `config.yaml` 中的 `model:` 行全部注释掉即可。\n\n---\n\n## 项目结构\n\n```\n.claude/skills/mini-six-ren/ # Claude Code 技能目录\n├── SKILL.md # 技能定义(工作流、触发关键词、分析指南)\n├── config.yaml # 第三方 LLM 模型配置(可选)\n├── .env.sample # API Key 配置示例\n├── .env # API Key(不提交到 Git)\n├── scripts/\n│ ├── xiaoliu.py # 核心算法(PEP 723 单文件脚本)\n│ └── interpret.py # 第三方 LLM 解读脚本\n├── examples/\n│ ├── example_number_input.md # 数字输入示例\n│ ├── example_datetime_input.md # 日期时间输入示例\n│ └── example_chars_input.md # 汉字输入示例\n├── assets/\n│ └── template.md # 占卜报告 Markdown 模板\n└── references/\n └── symbols_reference.md # 九宫符号详解参考表\n```\n\n---\n\n## 技术细节\n\n### 脚本运行\n\n`xiaoliu.py` 使用 [PEP 723](https://peps.python.org/pep-0723/) 内联脚本元数据,通过 `uv run` 直接执行,无需预先安装项目或创建虚拟环境:\n\n```bash\nuv run scripts/xiaoliu.py --now --format text\n```\n\n唯一外部依赖为 `lunardate>=0.2.0`(公历↔农历转换),uv 会在首次运行时自动安装。\n\n### 输出格式\n\n- `--format json`:结构化 JSON,供 LLM 分析和模板填充\n- `--format text`:人类可读的文本表格\n\n### LLM 分析结构\n\n技能调用 `--format json` 获取结构化数据后,LLM 按以下结构生成解读:\n\n1. **卦象总览** — 三传符号和五行总结\n2. **时间发展脉络** — 初传(当前状态)→ 中传(发展变化)→ 末传(最终结果)\n3. **五行生克解读** — 元素关系如何影响事态走向\n4. **具体建议** — 与求问事项相关的可操作建议\n5. **关键提示** — 方位、时机、神灵等辅助信息\n\n---\n\n## 许可证\n\nMIT\n\n## 免责声明\n\n本项目为文化传承和娱乐用途,占卜结果仅供参考。请勿将占卜结果作为重大决策的唯一依据。\n"}, "f7a42c489ecbb18f22abc632b944f7baf7629efa": {"t": 1785766237.6968517, "n": 7455, "h": "70c210d5c9e27e14", "c": "# 小六壬占卜 — Claude Code Skill\n\n传统九宫小六壬占卜系统,作为 [Claude Code](https://docs.anthropic.com/en/docs/claude-code) 技能(Skill)运行,结合 AI 智慧解读卦象。\n\n支持数字、日期时间、汉字笔画、当前时间四种起卦方式,输出三传(初传→中传→末传)占卜结果,并由 LLM 结合五行生克进行个性化解读。\n\n---\n\n## 安装\n\n### 一键安装(推荐)\n\n使用 [skills.sh](https://skills.sh) 一键安装到当前项目:\n\n```bash\n# 使用 bunx\nbunx skills add https://github.com/aicoder2048/mini-six-ren-skill\n\n# 或使用 npx\nnpx skills add https://github.com/aicoder2048/mini-six-ren-skill\n```\n\n### 手动安装\n\n将 `.claude/skills/mini-six-ren/` 目录复制到你的任意项目的 `.claude/skills/` 下:\n\n```bash\n# 在目标项目根目录执行\nmkdir -p .claude/skills\ncp -r /XiaoLiuRenSkill/.claude/skills/mini-six-ren .claude/skills/\n```\n\n安装完成后,在该项目中使用 Claude Code 时,输入占卜相关的自然语言(如\"占一卦\"\"算算运势\"等),Claude 会自动识别并调用此技能。\n\n**运行环境要求**:\n- Python >= 3.10\n- [uv](https://docs.astral.sh/uv/) — 脚本使用 PEP 723 内联元数据,uv 会自动处理依赖安装(`lunardate>=0.2.0`)\n\n### Opencode CLI 移植建议\n\n> 以下为迁移思路,未经测试。\n\n[Opencode](https://github.com/opencode-ai/opencode) 的 Agent 体系与 Claude Code Skill 有所不同。核心算法脚本 `scripts/xiaoliu.py` 是独立可执行的,可直接复用。迁移时需要:\n\n1. 将 `SKILL.md` 中的工作流描述改写为 Opencode 的 Agent 配置格式\n2. 将 `assets/template.md` 报告模板和 `references/symbols_reference.md` 参考文档放入 Opencode 对应的上下文目录\n3. 在 Agent 配置中声明调用 `uv run scripts/xiaoliu.py` 的命令\n\n---\n\n## 小六壬算法详解\n\n### 九宫符号\n\n小六壬使用 9 个符号,每个符号对应五行、方位、神灵:\n\n| 序号 | 符号 | 五行 | 方位 | 关键词 | 神灵 |\n|:---:|:---:|:---:|:---:|---|:---:|\n| 1 | 大安 | 木 | 正东 | 长期、缓慢、稳定 | 三清 |\n| 2 | 留连 | 木 | 东南 | 停止、反复、复杂 | 文昌 |\n| 3 | 速喜 | 火 | 正南 | 惊喜、快速、突然 | 雷祖 |\n| 4 | 赤口 | 金 | 正西 | 争斗、凶恶、伤害 | 将帅 |\n| 5 | 小吉 | 水 | 正北 | 起步、不多、尚可 | 真武 |\n| 6 | 空亡 | 土 | 中间 | 失去、虚伪、空想 | 玉皇 |\n| 7 | 病符 | 土 | 西南 | 病态、异常、治疗 | 后土 |\n| 8 | 桃花 | 土 | 东北 | 欲望、牵绊、异性 | 城隍 |\n| 9 | 天德 | 金 | 西北 | 贵人、长辈、上司 | 紫薇 |\n\n#### 吉凶简判\n\n- **大吉**:大安、速喜、天德\n- **小吉**:小吉、留连(视情况)\n- **凶**:赤口(最凶)、空亡(金钱最忌)、病符\n- **中性**:桃花(恋爱吉,其余不吉)\n\n### 左手掌诀\n\n九宫符号排列在左手指节上,按顺序循环:\n\n```\n食指: [留连②]\n ↓\n中指: [大安①] → [速喜③]\n ↑\n无名指: [天德⑨] ← [赤口④]\n ↑\n [小吉⑤]\n [空亡⑥]\n [病符⑦]\n [桃花⑧]\n```\n\n顺序:大安→留连→速喜→赤口→小吉→空亡→病符→桃花→天德(循环)\n\n### 三传算法\n\n输入三个数字 `(num1, num2, num3)`,计算三传符号:\n\n1. **初传(前期)**:从第 1 位(大安)出发,走 `num1` 步\n2. **中传(中期)**:从初传的落点出发,走 `num2` 步\n3. **末传(后期)**:从中传的落点出发,走 `num3` 步\n\n每一步都在 9 个符号之间循环。算法核心:\n\n```\n初传位置 = (0 + num1 - 1) % 9\n中传位置 = (num1 - 1 + num2 - 1) % 9 # 即 (num1 + num2 - 2) % 9\n末传位置 = (num1 + num2 - 2 + num3 - 1) % 9 # 即 (num1 + num2 + num3 - 3) % 9\n```\n\n> 特殊处理:步数为 9 的倍数时映射到第 9 位(天德),而非回到第 1 位。\n\n### 五行生克关系\n\n**相生**(促进):\n\n```\n木 → 火 → 土 → 金 → 水 → 木(循环)\n```\n\n**相克**(制约):\n\n```\n木 → 土 → 水 → 火 → 金 → 木(循环)\n```\n\n系统判断 6 种关系:\n\n| 关系 | 说明 | 对事态影响 |\n|:---:|---|---|\n| 生 | 前者促进后者 | 顺利推进,有助发展 |\n| 克 | 前者制约后者 | 存在阻碍,需克服困难 |\n| 被生 | 后者反哺前者 | 有外力支持 |\n| 被克 | 后者反制前者 | 受到压制 |\n| 同 | 同属一行 | 相互扶持,力量加强 |\n| 无 | 无直接关系 | 各自独立发展 |\n\n### 解读优先级\n\n1. 先看**末传**(最终结果最重要)\n2. 再看三传之间的**五行生克关系**\n3. 最后结合各符号本身的含义和求问事项\n\n---\n\n## 输入模式\n\n### 数字模式 `--numbers`\n\n直接提供 3 个数字(逗号分隔),用作三传计算的步数。\n\n```bash\nuv run scripts/xiaoliu.py --numbers 3,5,7 --question \"事业运势\" --format json\n```\n\n### 日期时间模式 `--datetime`\n\n提供公历日期时间,系统自动转换:\n\n1. 公历 → **农历**(使用 `lunardate` 库)\n2. 取农历**月份**作为第一个数字\n3. 取农历**日期**作为第二个数字\n4. 将小时转换为**时辰序号**作为第三个数字\n\n```bash\nuv run scripts/xiaoliu.py --datetime \"2025-07-15 10:30\" --question \"面试能成功吗\" --format json\n```\n\n**时辰对照表**:\n\n| 时辰 | 时间段 | 序号 |\n|:---:|:---:|:---:|\n| 子时 | 23:00-01:00 | 1 |\n| 丑时 | 01:00-03:00 | 2 |\n| 寅时 | 03:00-05:00 | 3 |\n| 卯时 | 05:00-07:00 | 4 |\n| 辰时 | 07:00-09:00 | 5 |\n| 巳时 | 09:00-11:00 | 6 |\n| 午时 | 11:00-13:00 | 7 |\n| 未时 | 13:00-15:00 | 8 |\n| 申时 | 15:00-17:00 | 9 |\n| 酉时 | 17:00-19:00 | 10 |\n| 戌时 | 19:00-21:00 | 11 |\n| 亥时 | 21:00-23:00 | 12 |\n\n### 汉字模式 `--chars`\n\n提供 3 个汉字,系统查询笔画数作为输入数字:\n\n```bash\nuv run scripts/xiaoliu.py --chars \"天地人\" --question \"感情运势\" --format json\n```\n\n- 内置约 150+ 常用汉字笔画表\n- 不在表中的字使用 Unicode 编码取模近似\n\n### 当前时间模式 `--now`\n\n使用系统当前时间,自动按日期时间模式转换:\n\n```bash\nuv run scripts/xiaoliu.py --now --question \"今天适合出行吗\" --format json\n```\n\n---\n\n## 使用演示\n\n安装完成后,在 Claude Code 中直接用自然语言即可唤起占卜技能。以下为典型使用场景:\n\n### Demo 1:当前时间占卜\n\n**用户输入**:\n\n> 占一卦今日运势\n\nClaude Code 自动识别占卜意图,调用 `--now` 模式获取当前时间,转换为农历月日和时辰后计算三传,生成完整的占卜报告和 AI 解读。\n\n### Demo 2:指定日期占卜\n\n**用户输入**:\n\n> 2025年7月15日上午10点半面试,帮我占一卦\n\nClaude Code 从自然语言中提取日期时间 `2025-07-15 10:30`,调用 `--datetime` 模式:\n- 公历 2025-07-15 → 农历六月二十一\n- 10:30 → 巳时(序号 6)\n- 输入数字:`[6, 21, 6]`\n- 三传结果:空亡(土) → 桃花(土) → 赤口(金)\n- 五行关系:同 → 生\n\nAI 解读会结合面试场景,分析初期可能的不确定感(空亡)、人际交流的重要性(桃花)、以及需注意口舌争端的提醒(赤口)。\n\n### Demo 3:汉字起卦\n\n**用户输入**:\n\n> 用\"天地人\"三个字帮我算算感情运势\n\nClaude Code 提取汉字并调用 `--chars` 模式:\n- 天 = 4 画,地 = 6 画,人 = 2 画\n- 输入数字:`[4, 6, 2]`\n- 三传结果:赤口(金) → 天德(金) → 大安(木)\n- 五行关系:同 → 克\n\nAI 解读会结合感情主题,提醒注意口舌之争(赤口)、可寻求长辈指点(天德)、最终趋于安稳(大安)。\n\n### Demo 4:数字起卦\n\n**用户输入**:\n\n> 我心里想了三个数 3、5、7,占一卦事业运\n\nClaude Code 提取数字并调用 `--numbers 3,5,7`:\n- 三传结果根据数字 `[3, 5, 7]` 计算\n- AI 解读会围绕事业主题展开分析\n\n### Demo 5:生活场景\n\n**用户输入**:\n\n> 我爸爸下周三要做白内障手术,帮我占一卦\n\nClaude Code 会根据下周三的具体日期调用 `--datetime` 模式,生成完整的占卜报告。AI 解读会结合健康/手术主题,分析三传卦象的含义,给出实际的宽慰和建议。\n\n> 报告输出使用内置的 Markdown 模板,包含三传结果表格、符号详解、五行关系、以及 AI 智慧解读。\n\n---\n\n## 使用第三方 LLM 解读(可选)\n\n默认情况下,占卜解读由 Claude Code 内置模型完成,无需额外配置。如果你希望使用第三方模型(如 DeepSeek、GPT、Kimi 等),按以下两步配置:\n\n### 第 1 步:在 `config.yaml` 中激活模型\n\n编辑 `.claude/skills/mini-six-ren/config.yaml`,取消注释你想使用的模型行:\n\n```yaml\n# 取消注释下方某一行以启用第三方模型解读。\n# 不配置或全部注释 = 使用 Claude Code 内置模型解读(默认)。\n\n# --- DeepSeek ---\nmodel: deepseek:deepseek-chat\n\n# --- OpenAI ---\n# model: openai:gpt-5-mini\n# model: openai:gpt-5.2\n\n# --- Moonshot Kimi ---\n# model: kimi:kimi-k2.5\n\n# --- Anthropic ---\n# model: anthropic:claude-sonnet-4.5\n\n# --- Google Gemini ---\n# model: google:gemini-3-flash\n\n# ... 更多选项见 config.yaml 文件\n```\n\n> 同一时间只能激活一个模型,确保只有一行 `model:` 未被注释。\n\n### 第 2 步:在 `.env` 中提供 API Key\n\n参照 `.env.sample`,在 `.claude/skills/mini-six-ren/.env` 中填入对应的 API Key:\n\n```bash\n# 示例:使用 DeepSeek\nDEEPSEEK_API_KEY=sk-your-deepseek-api-key\n\n# 示例:使用 OpenAI\n# OPENAI_API_KEY=sk-your-openai-api-key\n```\n\n完整的 Provider 与 API Key 对照表:\n\n| Provider | `config.yaml` 前缀 | `.env` 变量 |\n|---|---|---|\n| DeepSeek | `deepseek:` | `DEEPSEEK_API_KEY` |\n| OpenAI | `openai:` | `OPENAI_API_KEY` |\n| Anthropic | `anthropic:` | `ANTHROPIC_API_KEY` |\n| Google Gemini | `google:` | `GEMINI_API_KEY` |\n| Moonshot Kimi | `kimi:` | `MOONSHOT_API_KEY` |\n| Alibaba Qwen | `qwen:` | `DASHSCOPE_API_KEY` |\n| Zhipu GLM | `glm:` | `ZHIPU_API_KEY` |\n\n> 切换回内置模型:将 `config.yaml` 中的 `model:` 行全部注释掉即可。\n\n---\n\n## 项目结构\n\n```\n.claude/skills/mini-six-ren/ # Claude Code 技能目录\n├── SKILL.md # 技能定义(工作流、触发关键词、分析指南)\n├── config.yaml # 第三方 LLM 模型配置(可选)\n├── .env.sample # API Key 配置示例\n├── .env # API Key(不提交到 Git)\n├── scripts/\n│ ├── xiaoliu.py # 核心算法(PEP 723 单文件脚本)\n│ └── interpret.py # 第三方 LLM 解读脚本\n├── examples/\n│ ├── example_number_input.md # 数字输入示例\n│ ├── example_datetime_input.md # 日期时间输入示例\n│ └── example_chars_input.md # 汉字输入示例\n├── assets/\n│ └── template.md # 占卜报告 Markdown 模板\n└── references/\n └── symbols_reference.md # 九宫符号详解参考表\n```\n\n---\n\n## 技术细节\n\n### 脚本运行\n\n`xiaoliu.py` 使用 [PEP 723](https://peps.python.org/pep-0723/) 内联脚本元数据,通过 `uv run` 直接执行,无需预先安装项目或创建虚拟环境:\n\n```bash\nuv run scripts/xiaoliu.py --now --format text\n```\n\n唯一外部依赖为 `lunardate>=0.2.0`(公历↔农历转换),uv 会在首次运行时自动安装。\n\n### 输出格式\n\n- `--format json`:结构化 JSON,供 LLM 分析和模板填充\n- `--format text`:人类可读的文本表格\n\n### LLM 分析结构\n\n技能调用 `--format json` 获取结构化数据后,LLM 按以下结构生成解读:\n\n1. **卦象总览** — 三传符号和五行总结\n2. **时间发展脉络** — 初传(当前状态)→ 中传(发展变化)→ 末传(最终结果)\n3. **五行生克解读** — 元素关系如何影响事态走向\n4. **具体建议** — 与求问事项相关的可操作建议\n5. **关键提示** — 方位、时机、神灵等辅助信息\n\n---\n\n## 许可证\n\nMIT\n\n## 免责声明\n\n本项目为文化传承和娱乐用途,占卜结果仅供参考。请勿将占卜结果作为重大决策的唯一依据。\n"}, "dae94a3eb9077314cf0a3732207ff4261f99fd4b": {"t": 1785766239.2817612, "n": 5706, "h": "52937bab381cefe4", "c": "# 小六壬占卜 — Claude Code Skill\n\n传统九宫小六壬占卜系统,作为 [Claude Code](https://docs.anthropic.com/en/docs/claude-code) 技能(Skill)运行,结合 AI 智慧解读卦象。\n\n支持数字、日期时间、汉字笔画、当前时间四种起卦方式,输出三传(初传→中传→末传)占卜结果,并由 LLM 结合五行生克进行个性化解读。\n\n---\n\n## 安装\n\n### Claude Code CLI\n\n将 `.claude/skills/mini-six-ren/` 目录复制到你的任意项目的 `.claude/skills/` 下即可:\n\n```bash\n# 在目标项目根目录执行\nmkdir -p .claude/skills\ncp -r /XiaoLiuRenSkill/.claude/skills/mini-six-ren .claude/skills/\n```\n\n复制完成后,在该项目中使用 Claude Code 时,输入占卜相关的自然语言(如\"占一卦\"\"算算运势\"等),Claude 会自动识别并调用此技能。\n\n**运行环境要求**:\n- Python >= 3.10\n- [uv](https://docs.astral.sh/uv/) — 脚本使用 PEP 723 内联元数据,uv 会自动处理依赖安装(`lunardate>=0.2.0`)\n\n### Opencode CLI 移植建议\n\n> 以下为迁移思路,未经测试。\n\n[Opencode](https://github.com/opencode-ai/opencode) 的 Agent 体系与 Claude Code Skill 有所不同。核心算法脚本 `scripts/xiaoliu.py` 是独立可执行的,可直接复用。迁移时需要:\n\n1. 将 `SKILL.md` 中的工作流描述改写为 Opencode 的 Agent 配置格式\n2. 将 `assets/template.md` 报告模板和 `references/symbols_reference.md` 参考文档放入 Opencode 对应的上下文目录\n3. 在 Agent 配置中声明调用 `uv run scripts/xiaoliu.py` 的命令\n\n---\n\n## 小六壬算法详解\n\n### 九宫符号\n\n小六壬使用 9 个符号,每个符号对应五行、方位、神灵:\n\n| 序号 | 符号 | 五行 | 方位 | 关键词 | 神灵 |\n|:---:|:---:|:---:|:---:|---|:---:|\n| 1 | 大安 | 木 | 正东 | 长期、缓慢、稳定 | 三清 |\n| 2 | 留连 | 木 | 东南 | 停止、反复、复杂 | 文昌 |\n| 3 | 速喜 | 火 | 正南 | 惊喜、快速、突然 | 雷祖 |\n| 4 | 赤口 | 金 | 正西 | 争斗、凶恶、伤害 | 将帅 |\n| 5 | 小吉 | 水 | 正北 | 起步、不多、尚可 | 真武 |\n| 6 | 空亡 | 土 | 中间 | 失去、虚伪、空想 | 玉皇 |\n| 7 | 病符 | 土 | 西南 | 病态、异常、治疗 | 后土 |\n| 8 | 桃花 | 土 | 东北 | 欲望、牵绊、异性 | 城隍 |\n| 9 | 天德 | 金 | 西北 | 贵人、长辈、上司 | 紫薇 |\n\n#### 吉凶简判\n\n- **大吉**:大安、速喜、天德\n- **小吉**:小吉、留连(视情况)\n- **凶**:赤口(最凶)、空亡(金钱最忌)、病符\n- **中性**:桃花(恋爱吉,其余不吉)\n\n### 左手掌诀\n\n九宫符号排列在左手指节上,按顺序循环:\n\n```\n食指: [留连②]\n ↓\n中指: [大安①] → [速喜③]\n ↑\n无名指: [天德⑨] ← [赤口④]\n ↑\n [小吉⑤]\n [空亡⑥]\n [病符⑦]\n [桃花⑧]\n```\n\n顺序:大安→留连→速喜→赤口→小吉→空亡→病符→桃花→天德(循环)\n\n### 三传算法\n\n输入三个数字 `(num1, num2, num3)`,计算三传符号:\n\n1. **初传(前期)**:从第 1 位(大安)出发,走 `num1` 步\n2. **中传(中期)**:从初传的落点出发,走 `num2` 步\n3. **末传(后期)**:从中传的落点出发,走 `num3` 步\n\n每一步都在 9 个符号之间循环。算法核心:\n\n```\n初传位置 = (0 + num1 - 1) % 9\n中传位置 = (num1 - 1 + num2 - 1) % 9 # 即 (num1 + num2 - 2) % 9\n末传位置 = (num1 + num2 - 2 + num3 - 1) % 9 # 即 (num1 + num2 + num3 - 3) % 9\n```\n\n> 特殊处理:步数为 9 的倍数时映射到第 9 位(天德),而非回到第 1 位。\n\n### 五行生克关系\n\n**相生**(促进):\n\n```\n木 → 火 → 土 → 金 → 水 → 木(循环)\n```\n\n**相克**(制约):\n\n```\n木 → 土 → 水 → 火 → 金 → 木(循环)\n```\n\n系统判断 6 种关系:\n\n| 关系 | 说明 | 对事态影响 |\n|:---:|---|---|\n| 生 | 前者促进后者 | 顺利推进,有助发展 |\n| 克 | 前者制约后者 | 存在阻碍,需克服困难 |\n| 被生 | 后者反哺前者 | 有外力支持 |\n| 被克 | 后者反制前者 | 受到压制 |\n| 同 | 同属一行 | 相互扶持,力量加强 |\n| 无 | 无直接关系 | 各自独立发展 |\n\n### 解读优先级\n\n1. 先看**末传**(最终结果最重要)\n2. 再看三传之间的**五行生克关系**\n3. 最后结合各符号本身的含义和求问事项\n\n---\n\n## 输入模式\n\n### 数字模式 `--numbers`\n\n直接提供 3 个数字(逗号分隔),用作三传计算的步数。\n\n```bash\nuv run scripts/xiaoliu.py --numbers 3,5,7 --question \"事业运势\" --format json\n```\n\n### 日期时间模式 `--datetime`\n\n提供公历日期时间,系统自动转换:\n\n1. 公历 → **农历**(使用 `lunardate` 库)\n2. 取农历**月份**作为第一个数字\n3. 取农历**日期**作为第二个数字\n4. 将小时转换为**时辰序号**作为第三个数字\n\n```bash\nuv run scripts/xiaoliu.py --datetime \"2025-07-15 10:30\" --question \"面试能成功吗\" --format json\n```\n\n**时辰对照表**:\n\n| 时辰 | 时间段 | 序号 |\n|:---:|:---:|:---:|\n| 子时 | 23:00-01:00 | 1 |\n| 丑时 | 01:00-03:00 | 2 |\n| 寅时 | 03:00-05:00 | 3 |\n| 卯时 | 05:00-07:00 | 4 |\n| 辰时 | 07:00-09:00 | 5 |\n| 巳时 | 09:00-11:00 | 6 |\n| 午时 | 11:00-13:00 | 7 |\n| 未时 | 13:00-15:00 | 8 |\n| 申时 | 15:00-17:00 | 9 |\n| 酉时 | 17:00-19:00 | 10 |\n| 戌时 | 19:00-21:00 | 11 |\n| 亥时 | 21:00-23:00 | 12 |\n\n### 汉字模式 `--chars`\n\n提供 3 个汉字,系统查询笔画数作为输入数字:\n\n```bash\nuv run scripts/xiaoliu.py --chars \"天地人\" --question \"感情运势\" --format json\n```\n\n- 内置约 150+ 常用汉字笔画表\n- 不在表中的字使用 Unicode 编码取模近似\n\n### 当前时间模式 `--now`\n\n使用系统当前时间,自动按日期时间模式转换:\n\n```bash\nuv run scripts/xiaoliu.py --now --question \"今天适合出行吗\" --format json\n```\n\n---\n\n## 使用演示\n\n安装完成后,在 Claude Code 中直接用自然语言即可唤起占卜技能。以下为典型使用场景:\n\n### Demo 1:当前时间占卜\n\n**用户输入**:\n\n> 占一卦今日运势\n\nClaude Code 自动识别占卜意图,调用 `--now` 模式获取当前时间,转换为农历月日和时辰后计算三传,生成完整的占卜报告和 AI 解读。\n\n### Demo 2:指定日期占卜\n\n**用户输入**:\n\n> 2025年7月15日上午10点半面试,帮我占一卦\n\nClaude Code 从自然语言中提取日期时间 `2025-07-15 10:30`,调用 `--datetime` 模式:\n- 公历 2025-07-15 → 农历六月二十一\n- 10:30 → 巳时(序号 6)\n- 输入数字:`[6, 21, 6]`\n- 三传结果:空亡(土) → 桃花(土) → 赤口(金)\n- 五行关系:同 → 生\n\nAI 解读会结合面试场景,分析初期可能的不确定感(空亡)、人际交流的重要性(桃花)、以及需注意口舌争端的提醒(赤口)。\n\n### Demo 3:汉字起卦\n\n**用户输入**:\n\n> 用\"天地人\"三个字帮我算算感情运势\n\nClaude Code 提取汉字并调用 `--chars` 模式:\n- 天 = 4 画,地 = 6 画,人 = 2 画\n- 输入数字:`[4, 6, 2]`\n- 三传结果:赤口(金) → 天德(金) → 大安(木)\n- 五行关系:同 → 克\n\nAI 解读会结合感情主题,提醒注意口舌之争(赤口)、可寻求长辈指点(天德)、最终趋于安稳(大安)。\n\n### Demo 4:数字起卦\n\n**用户输入**:\n\n> 我心里想了三个数 3、5、7,占一卦事业运\n\nClaude Code 提取数字并调用 `--numbers 3,5,7`:\n- 三传结果根据数字 `[3, 5, 7]` 计算\n- AI 解读会围绕事业主题展开分析\n\n### Demo 5:生活场景\n\n**用户输入**:\n\n> 我爸爸下周三要做白内障手术,帮我占一卦\n\nClaude Code 会根据下周三的具体日期调用 `--datetime` 模式,生成完整的占卜报告。AI 解读会结合健康/手术主题,分析三传卦象的含义,给出实际的宽慰和建议。\n\n> 报告输出使用内置的 Markdown 模板,包含三传结果表格、符号详解、五行关系、以及 AI 智慧解读。\n\n---\n\n## 项目结构\n\n```\n.claude/skills/mini-six-ren/ # Claude Code 技能目录\n├── SKILL.md # 技能定义(工作流、触发关键词、分析指南)\n├── scripts/\n│ └── xiaoliu.py # 核心算法(PEP 723 单文件脚本)\n├── examples/\n│ ├── example_number_input.md # 数字输入示例\n│ ├── example_datetime_input.md # 日期时间输入示例\n│ └── example_chars_input.md # 汉字输入示例\n├── assets/\n│ └── template.md # 占卜报告 Markdown 模板\n└── references/\n └── symbols_reference.md # 九宫符号详解参考表\n```\n\n---\n\n## 技术细节\n\n### 脚本运行\n\n`xiaoliu.py` 使用 [PEP 723](https://peps.python.org/pep-0723/) 内联脚本元数据,通过 `uv run` 直接执行,无需预先安装项目或创建虚拟环境:\n\n```bash\nuv run scripts/xiaoliu.py --now --format text\n```\n\n唯一外部依赖为 `lunardate>=0.2.0`(公历↔农历转换),uv 会在首次运行时自动安装。\n\n### 输出格式\n\n- `--format json`:结构化 JSON,供 LLM 分析和模板填充\n- `--format text`:人类可读的文本表格\n\n### LLM 分析结构\n\n技能调用 `--format json` 获取结构化数据后,LLM 按以下结构生成解读:\n\n1. **卦象总览** — 三传符号和五行总结\n2. **时间发展脉络** — 初传(当前状态)→ 中传(发展变化)→ 末传(最终结果)\n3. **五行生克解读** — 元素关系如何影响事态走向\n4. **具体建议** — 与求问事项相关的可操作建议\n5. **关键提示** — 方位、时机、神灵等辅助信息\n\n---\n\n## 许可证\n\nMIT\n\n## 免责声明\n\n本项目为文化传承和娱乐用途,占卜结果仅供参考。请勿将占卜结果作为重大决策的唯一依据。\n"}}}}