Horosa Skill Core
horosa-skill 是这个仓库真正可运行的核心子项目。它把星阙 / Horosa 的本地算法、AI 导出协议、离线 runtime、MCP 暴露层和本地数据管理统一进一个 Python 包里。
如果根目录 README 讲的是“这个项目是什么”,这里讲的是“这个包具体能做什么”。
License / 许可证
这个子项目现在采用 GNU AGPL-3.0-only 许可证发布。完整文本见 LICENSE。
This subproject is distributed under GNU AGPL-3.0-only. See LICENSE for the full text.
新增工程能力
- ken 后端统一(v0.6.0):奇门 / 太乙 / 金口诀(及三式合一的奇门 + 太乙)由星阙
ken引擎(kinqimen/kintaiyi/kinjinkou)独占计算,headless JS 仅把 ken 结果重排成aiExport.jssection - headless 引擎对齐(v0.6.2):统摄法(
tongshefa.js)与十年大运(engine/decennials.py)已与星阙逐值对齐(京房八宫五行、Math.round/Math.ceil一致),对照星阙decennials.test.js金标 - tracing:本地 JSONL trace、
trace_id、group_id - benchmark:
HorosaBench本地评测集 - provenance:知识库与导出协议都带来源字段
- release metadata:
server.json、SBOM、GitHub release workflow
四条命令(v0.38.x)
uv run horosa-skill setup --client <claude-code|claude-desktop|cursor|vscode|codex|gemini|windsurf|cline|zed>(windsurf= Devin Desktop,原 Windsurf,key 保留兼容) —— 探网 → 装离线 runtime → 写该客户端配置 → doctor → 回读 → 真起一次 stdiouv run horosa-skill client config --format <client>—— 只生成(不落盘)该客户端的配置块 / 注册命令uv run horosa-skill client check—— 体检本机各客户端实际写着什么(占位符、超时、路径、版本漂移)uv run horosa-skill doctor --explain—— 机器可读体检 + 6–10 行人话;selfcheck起一张盘 → 存 → 读回
零安装(无 checkout)把 uv run horosa-skill 换成 uvx --from "<发布页 wheel URL>" horosa-skill(见根 README「快速开始」)。
其它常用命令
uv run horosa-skill benchmark runuv run horosa-skill benchmark run --skip-runtimeuv run horosa-skill trace latestuv run horosa-skill client openclaw-config --format mcporteruv run horosa-skill client openclaw-check --workspace ~/.openclaw/workspace
这个子项目包含什么
- 离线 runtime 安装与诊断
installdoctorservestop
- MCP 服务层
- Streamable HTTP
- stdio
- JSON-first CLI
tool runtool list,包含每个工具的input_contractdispatchaskexport registryexport parseknowledge registryknowledge read
- 本地数据管理
- SQLite
- JSON artifacts
- run manifest
- AI answer write-back
- 结构化报告导出
- report template
- JSON / DOCX / PDF artifacts
style=chart完整排盘报告(不经 AI,全部盘面段落 + 盘图 + 目录 / 书签 / 页码)
- 自备知识库
knowledge mine / add / remove / trash / restore(删除与覆盖先进回收站;读不了的文件在problems里写明原因)- 计算时
knowledge=[条目名 / #标签 / auto]→data.knowledge_context - report artifact 回写本地 manifest
- 星阙 AI 导出协议机器建模
- export registry
- export snapshot parsing
- per-tool
export_snapshot - per-tool
export_format
运行层示例(非全表,全表见根 README)
完整双语能力矩阵请看根目录 README.md 和 README_EN.md。这里保留运行层视角,强调“你在这个子项目里具体能调什么”。
核心星盘与派生盘
chart:标准星盘chart13:13 宫扩展盘hellen_chart:希腊星盘guolao_chart:七政四余盘india_chart:印度盘relative:合盘 / 关系盘germany:量化盘 / 中点盘
推运与时运
solarreturn:太阳返照lunarreturn:月返solararc:太阳弧推运givenyear:指定年推运profection:小限pd:主限 / 本初方向pdchart:主限盘zr:黄道释放firdaria:法达星限decennials:十年大运 / 十年星限
推运工具必须带目标输入,不允许只用本命资料直接调用:
solarreturn/lunarreturn:本命资料 +datetime+dirZone+dirLat+dirLon,输出本命盘和返照盘。givenyear:本命资料 + 指定年/目标时间datetime+dir*,输出本命盘和流年盘。solararc/profection:本命资料 +datetime+dirZone,输出本命盘和推运盘。pd:本命资料 +pdtype+pdMethod+pdTimeKey+pdaspects,输出真实主限表格。pdchart:本命资料 +datetime+dirZone+ 主限方法字段,输出主限法盘星体表格和相位。zr/firdaria/decennials:本命资料 + 用户是否接受星阙默认时间轴设置,输出对应时间轴。
完整说明见根目录 docs/INPUT_CONTRACTS.md。审计推运类输出时不要只看短预览,因为正文通常先写本命盘,返照盘、推运盘、流年盘或主限表格在后续 section;按 export_format.sections 或 docs/EXPORT_AUDIT_GUIDE.md 检查完整内容。Agent 应先用 uv run horosa-skill agent guidance --tool <tool> 或 MCP horosa_agent_guidance 检查必问项,再调用真实工具。
中文术数与扩展技法
ziwei_birth:紫微斗数命盘ziwei_rules:紫微规则库bazi_birth:八字命盘bazi_direct:八字直断liureng_gods:大六壬起课liureng_runyear:大六壬行年qimen:奇门遁甲(由星阙ken后端kinqimen计算)taiyi:太乙神数(由星阙ken后端kintaiyi计算)jinkou:金口诀(由星阙ken后端kinjinkou计算)tongshefa:统摄法sanshiunited:三式合一(聚合 ken 的奇门 + 太乙与大六壬)suzhan:宿占 / 宿盘sixyao:六爻 / 易卦otherbu:西洋游戏 / 占星骰子geomancy:天文地占(4 母卦 → 16 图形,十二宫图形入宫 + 判官/见证,以起卦时刻确定性起卦)tarot:塔罗(韦特 78 牌,确定性抽牌 + 牌阵直断 / 细论 / 综合建议)jieqi_year:全年节气盘nongli_time:农历换算gua_desc:卦义说明gua_meiyi:梅易卦义
导出与调度
export_registry:星阙 AI 导出协议注册表export_parse:星阙 AI 导出正文解析器horosa_dispatch:自然语言总调度器
星阙悬浮知识库
knowledge_registry:悬浮知识目录knowledge_read:悬浮知识读取器
已接入 31 个域 = 3 个悬浮域(星盘 planet/sign/house/lot/aspect、大六壬 shen/house、奇门 stem/door/star/god)
- 27 个技法方法论手册域(上游 HelpDoc 收割,逐条带出处)+ 八字口诀库
bazi_pithy(21 类 173 条);knowledge_read {"query": …}跨域检索。
明确排除:
fengshui
快速开始
cd horosa-skill
uv sync
uv run horosa-skill setup --client cursor # 换成你的客户端;一条命令装 runtime + 写配置 + 体检 + 真起一次
uv run horosa-skill selfcheck # 活体:起一张盘 → 存 → 读回
uv run horosa-skill client check # 之后任何时候:看各客户端实际写着什么
只想手动分步:install → doctor → serve(HTTP)或 client config --format <client>(stdio)。
最短工作流
1. 安装 runtime
uv run horosa-skill install
uv run horosa-skill doctor
如果你主要是接 OpenClaw / mcporter,也可以直接生成当前路径版配置并做一次最小联通检查:
uv run horosa-skill client openclaw-config --format mcporter
uv run horosa-skill client openclaw-check --workspace ~/.openclaw/workspace
2. 直接让调度器选技法
echo '{
"agent_confirmed_settings": true,
"clarification_notes": "用户确认:1990-01-01 12:00 上海出生;此刻 2026-11-12 16:40 在上海;按星阙默认。",
"query": "请用奇门和六壬看看我现在的状况",
"birth": {"date": "1990-01-01", "time": "12:00", "place": "上海"},
"context": {"date": "2026-11-12", "time": "16:40", "place": "上海"}
}' | uv run horosa-skill ask --stdin
奇门、六壬这类起课技法按 context 里的「此刻」起盘(出生数据代替不了),缺了会被拦下并说明缺什么;结果的 time_basis 写明每个技法用了哪个时刻。agent_confirmed_settings 只在用户真的确认过设置之后才带。
3. 查看某一次完整记录
uv run horosa-skill memory show <run_id>
4. 回写 AI 最终回答
echo '{
"run_id":"<run_id>",
"user_question":"我接下来事业走势如何?",
"ai_answer_text":"先稳后升,宜先整理资源再扩张。",
"ai_answer_structured":{"trend":"up_later"}
}' | uv run horosa-skill memory answer --stdin
5. 生成结构化报告
AI 客户端推荐先读取模板,再把自己的分析写回,最后让 Horosa Skill 本地渲染文件:
uv run horosa-skill report template --run-id <run_id> --tool chart
uv run horosa-skill report render --run-id <run_id> --tool chart --format docx
uv run horosa-skill report render --run-id <run_id> --tool chart --format pdf
也可以一次性调用某个技法并直接生成报告:
echo '{"date":"2028-04-06","time":"09:33","place":"上海","question":"这次签约顺不顺","agent_confirmed_settings":true,"clarification_notes":"用户确认:此刻与地点、所问之事;奇门设置按星阙默认。"}' \
| uv run horosa-skill report from-tool qimen --stdin --format pdf --style chart
--style chart 出不含 AI 解读的完整排盘报告;要解读报告就用 --ai-answer-file / --ai-report-file 把写好的解读一起传进来。
常用命令
列出工具
uv run horosa-skill tool list
直接运行单个方法
echo '{"date":"1990-01-01","time":"12:00","zone":"8","lat":"31n14","lon":"121e28","defaults_accepted":true,"clarification_notes":"用户接受星阙默认(Alcabitus 宫制、回归黄道)。"}' \
| uv run horosa-skill tool run chart --stdin
没带确认、又有会改结果的设置没回答时,命令以退出码 2 结束,stderr 的 JSON 是 agent_guidance.required 与可直接转给用户的追问。
运行本地 Phase 2 技法
echo '{"taiyin":"巽","taiyang":"坤","shaoyang":"震","shaoyin":"震"}' \
| uv run horosa-skill tool run tongshefa --stdin
导出 registry
uv run horosa-skill export registry --technique qimen
解析星阙 AI 导出正文
echo '{
"technique":"qimen",
"content":"[起盘信息]\n参数\n\n[八宫]\n八宫内容\n\n[演卦]\n演卦内容"
}' | uv run horosa-skill export parse --stdin
读取星阙悬浮知识
echo '{"domain":"astro","category":"planet","key":"Sun"}' \
| uv run horosa-skill knowledge read --stdin
本地记录系统会保存什么
每次 run 会持久化:
- run 元信息
- tool call 记录
- entity 索引
- JSON artifact
- run manifest
- query_text
- user_question
- ai_answer_text
- ai_answer_structured
- report_json / report_docx / report_pdf artifact
- artifact
exists/file_size/sha256元信息,方便确认文件仍可用 - 每条 run 的
artifact_summary会汇总报告数量、类型计数和最新报告路径,AI 客户端不用自己遍历文件列表 report render/report from-tool入参里的 AI 分析会自动写回ai_answer_text/ai_answer_structured,后续可按关键词检索
对应管理命令:
uv run horosa-skill memory queryuv run horosa-skill memory query --text "事业走势" --artifact-kind report_pdfuv run horosa-skill memory show <run_id>uv run horosa-skill memory answer --stdin(再写一次不会盖掉上一次,旧答案留在answer_history)uv run horosa-skill memory delete --entity 妈妈(也可--run-id/--before;默认只列出,--yes才删,已交付的报告文件只列不删)uv run horosa-skill memory export --entity 妈妈 --out <空文件夹>(导出成人能直接读的文件夹)uv run horosa-skill memory rebuild(照runs/里的产物重建检索库,只增不删)uv run horosa-skill report template --run-id <run_id>uv run horosa-skill report render --run-id <run_id> --format pdf
环境变量
可以复制 .env.example 再按需覆盖:
cp .env.example .env
全部变量(含档位与说明)见 docs/ENV_VARS.md(由注册表生成)。常见项:
HOROSA_SERVER_ROOTHOROSA_CHART_SERVER_ROOTHOROSA_SKILL_DATA_DIRHOROSA_SKILL_DB_PATHHOROSA_SKILL_OUTPUT_DIRHOROSA_RUNTIME_ROOTHOROSA_RUNTIME_MANIFEST_URLHOROSA_RUNTIME_RELEASE_REPOHOROSA_RUNTIME_PLATFORMHOROSA_RUNTIME_START_TIMEOUT_SECONDSHOROSA_SKILL_HOSTHOROSA_SKILL_PORTHOROSA_MCP_COMPACT(=1 精简面 14 个工具)/HOROSA_TOOLSETS(按域裁剪全量面)HOROSA_MCP_RESULT_VIEW(MCP 结果缺省视图,缺省reading阅读视图;full= 完整信封)/HOROSA_MCP_RESULT_MAX_CHARS/HOROSA_MCP_RESULT_MAX_TOKENS(单次结果预算)HOROSA_MCP_TOKEN/HOROSA_MCP_ALLOWED_HOSTS(streamable-http 的 Bearer 与 Host 白名单)HOROSA_REPORT_OUTPUT_ROOTS(报告output_path允许写入的目录白名单)HOROSA_RUNTIME_MIRROR(离线 runtime 下载镜像)HOROSA_CLARIFY(澄清闸档位)/HOROSA_JEV*(可选云端决策层,缺省关;密钥永不回显)
相关文档
Metadata
Release files for horosa-skill 0.53.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| horosa_skill-0.53.1.tar.gz | 15.8 MB | With provenance | Details for horosa_skill-0.53.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| horosa_skill-0.53.1-py3-none-any.whl | Python 3 | none | any | Details for horosa_skill-0.53.1-py3-none-any.whl |
Total release size: 20.9 MB
Release files / horosa_skill-0.53.1.tar.gz
| Download URL | horosa_skill-0.53.1.tar.gz |
|---|---|
| Size | 15.8 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7ad4a05ac2112aabdb46ff82ec158a2601e8e337f10b49bd86c5478b2e185bb7
|
|
BLAKE2b-256 checksum How to use checksums |
06454ec21a801803265adfd53207b60e8ca561513ccfe50c74902e73664e3e0c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 2, 2026.
Transparency logRelease files / horosa_skill-0.53.1-py3-none-any.whl
| Download URL | horosa_skill-0.53.1-py3-none-any.whl |
|---|---|
| Size | 5.2 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5919dc61a5bac3d646c2f231381d59b749146f720fd45459cd4119b7086743f4
|
|
BLAKE2b-256 checksum How to use checksums |
33e728367c719327f4e8006b838094c40565b74dc0eaad1af4c0f3538f16a1c2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 2, 2026.
Transparency logSecurity for horosa-skill 0.53.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for horosa_skill-0.53.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 2, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.