Skip to content

feat: add OpenAI Platform and production release packaging - #4

Merged
bwayne98 merged 2 commits into
mainfrom
feat/publish-chatgpt
Aug 21, 2026
Merged

feat: add OpenAI Platform and production release packaging#4
bwayne98 merged 2 commits into
mainfrom
feat/publish-chatgpt

Conversation

@bwayne98

Copy link
Copy Markdown
Contributor

摘要

新增 lihi 的 OpenAI Platform With MCP 發布打包流程、production marketplace bundle,以及 SemVer tag release workflow。

OpenAI Platform 發布物改為四個獨立 skill ZIP;每個 ZIP 只有一個同名頂層 skill 目錄,不包含完整 plugin manifest、marketplace、MCP config、app config 或 app ID。Codex 與 Claude Code 的 production marketplace 另外由獨立 script 打包,既有 develop bundle 則繼續維持 lihi-dev identity 與 develop endpoint 隔離。

OpenAI Platform skill bundles

新增 scripts/package_openai_platform_bundle.py,使用 Python 3.8 與純標準函式庫,從 Codex production skill 目錄直接讀取核准檔案並建立四個 ZIP:

lihi-shorten-<version>.zip
lihi-account-<version>.zip
lihi-switch-group-<version>.zip
lihi-switch-domain-<version>.zip

封裝行為:

  • 從 Codex 與 Claude manifests 的共同 major.minor.patch 衍生發布版本;
  • 每個 ZIP 僅包含一個同名頂層 skill 目錄;
  • 保留 agents/openai.yaml 的 production MCP dependency:
    • MCP identity:lihi
    • endpoint:https://app.lihi.io/mcp/v1/tools
  • 以明確、逐檔且逐片段的 rewrite 建立 ChatGPT/Codex 共用的 host-neutral skill;
  • 移除 codex mcp login、Claude /mcp 與其他 host-specific OAuth 操作;
  • 移除訂閱方案與專屬網域的導購句,不插入替代促銷文案;
  • 不接受 app ID;
  • 不輸出完整 plugin ZIP、Developer marketplace、.mcp.json.app.json
  • production source files 全程不被修改。

Archive safety and reproducibility

OpenAI skill packager 會在發布前驗證:

  • 精確檔案 allowlist 與 skill 結構;
  • UTF-8、frontmatter、skill identity 與 production MCP dependency;
  • detector 與 production source byte-for-byte 相同且保留 executable bit;
  • 無 symlink、特殊檔案、cache、develop identity 或 develop endpoint;
  • 無 absolute path、path traversal、backslash、duplicate entry、Unicode/case normalization collision 或 path type conflict;
  • ZIP 大小、entry 數量、單一檔案大小與解壓後總容量限制;
  • ZIP entry 使用固定時間戳、排序與一致權限,讓相同輸入產生相同 SHA-256。

四個 ZIP 會先全部在暫存區建立及驗證,再以同一組發布交易替換正式產物。驗證失敗不會改動既有 ZIP;發布途中失敗則會回復整組舊產物。

Production marketplace bundle

新增 scripts/package_production_bundle.py

python3 scripts/package_production_bundle.py \
  --output-dir dist/production

輸出:

dist/production/lihi-agent-<version>/

Production bundle:

  • 包含 .agents.claude-plugin marketplace manifests;
  • 包含 Codex 與 Claude Code 的 production plugin roots;
  • 保留 lihi@lihi selector、四個 production skill names 與 production MCP endpoint;
  • 包含英文與繁體中文 production 安裝指南;
  • 排除 cache、develop identity 與 develop endpoint;
  • 拒絕 symlink、特殊檔案及已存在的同版本輸出目錄;
  • 不修改 checked-in production source。

既有 scripts/package_develop_bundle.py 保持獨立:

  • develop artifact 仍使用 lihi-dev@lihi-dev
  • MCP endpoint 仍為 https://app.lihidev.com/mcp/v1/tools
  • develop 版安裝指南仍改寫成從解壓縮 artifact root 安裝;
  • OpenAI Platform submission 文件不會被複製進 develop artifact。

Tag release workflow

新增 .github/workflows/package-openai-platform.yml,在 push tag 時執行:

  1. 使用 Python 3.8 執行完整 unit tests;
  2. 執行 Python syntax、host parity 與 whitespace checks;
  3. 建立四個 OpenAI Platform skill ZIP;
  4. 建立 production marketplace bundle;
  5. 驗證 tag 必須是 v<major.minor.patch><major.minor.patch>
  6. 驗證 tag version 必須與兩個 production manifests 的共同 SemVer core 相同;
  7. 驗證 OpenAI output 恰好包含四個 ZIP;
  8. 上傳兩個保留 90 天的 GitHub Actions artifacts:
    • lihi-openai-skills-<tag>
    • lihi-agent-production-<tag>

Workflow 不會建立或修改 GitHub Release。

Brand assets and portal submission

加入 production listing assets:

packaging/openai-platform/assets/logo.png
packaging/openai-platform/assets/composer-icon.png

這兩張圖片保留供 OpenAI submission portal 人工上傳,不是 skill packager 的輸入,也不會阻擋四個 skill ZIP 的建立。

docs/openai-platform-packaging.md 記錄:

  • 四個 skill ZIP 與 production bundle 的本機命令;
  • tag workflow 與 artifact 名稱;
  • With MCP production endpoint;
  • portal 仍需人工完成的 listing metadata、domain verification、tool annotations、OAuth reviewer credentials、positive/negative test cases、release notes 與 demo recording;
  • 成功建立靜態 artifact 不代表 live MCP 或 OpenAI review 已通過。

測試覆蓋

OpenAI Platform packager

  • 僅產生四個 individual skill ZIP;
  • 每個 archive 只有單一同名 skill root 與精確 allowlist;
  • host-neutral OAuth 與 production MCP dependency;
  • 促銷連結句完整移除;
  • source tree hash 保持不變;
  • listing assets 缺少時仍可建立 skill ZIP;
  • --app-id 已移除且會被 CLI 拒絕;
  • invalid UTF-8 detector、缺檔、版本不一致與 malformed metadata fail-closed;
  • unsafe archive paths 與 normalization collision 被拒絕;
  • 重複 build 產生相同 ZIP bytes;
  • validation failure 保留舊產物;
  • publish failure 回復完整舊 artifact set。

Production marketplace packager

  • Codex/Claude marketplaces 與 manifests 保持 production identity;
  • 兩個 host 都包含四個 skills 與單一 production MCP registration;
  • Codex metadata 保留 production dependencies;
  • 不包含 develop identity、develop endpoint 或 app ID;
  • detector bytes 與 executable mode 保持不變;
  • 英文與繁體中文指南使用 authoritative repository URL;
  • version mismatch、existing output 與 symlink fail-closed;
  • source files 不被修改。

測試與驗證

  • python3 -m unittest discover -s tests -v(71 tests passed)
  • python3 -m compileall 通過
  • 本機成功建立四個 OpenAI Platform skill ZIP
  • 本機成功建立 lihi-agent-0.3.1 production marketplace bundle
  • 本機成功建立 lihi-agent-0.3.1-develop.1 develop marketplace bundle
  • Production marketplace 與 Claude plugin manifest validation 通過
  • Codex/Claude detector scripts byte-for-byte 相同
  • Codex/Claude shortening workflow byte-for-byte 相同
  • Codex/Claude group/domain switch error-recovery references byte-for-byte 相同
  • Release workflow YAML syntax validation 通過
  • git diff --check

Reviewer 重點

  • 確認 OpenAI 發布流程只輸出四個 standalone skill ZIP,不再輸出完整 plugin 或 app-ID Developer bundle;
  • 確認 ZIP 內保留 production MCP dependency,但不包含 .mcp.json.app.json 或 marketplace;
  • 確認 host-neutral rewrite 僅發生在 staging,production skills 不被修改;
  • 確認促銷連結句只從 OpenAI submission skills 移除,不改變 production host bundles;
  • 確認 production 與 develop marketplace identities、skill names 和 endpoints 仍完全隔離;
  • 確認 tag 版本必須與 manifests 的共同 SemVer core 相符;
  • 確認相同輸入可重現相同 ZIP,且四個 artifact 的失敗回滾不會留下混合版本;
  • 確認 GitHub Actions artifacts 包含 hidden marketplace/plugin manifests,且不會自動建立 GitHub Release。

wayne added 2 commits August 12, 2026 15:29
新增 OpenAI Platform public plugin 與四個 standalone skill ZIP 的確定性封裝流程,包含固定檔案白名單、安全 archive path、品牌 PNG 驗證、原子發布與失敗回滾。

加入 host-neutral skill rewrite、促銷連結移除與 Developer mode app ID marketplace bundle;production source 保持不變,app ID 僅存在生成的本機 artifact。

補齊 OpenAI Platform 建置與提交文件、production logo/composer icon、develop bundle 排除規則,以及 public/developer packaging 的完整回歸測試。

Validated with:

- python3 -m unittest discover -s tests -v (66 tests)
- Codex/Claude detector and shortening workflow parity checks
- OpenAI Platform bundle plus four standalone skill ZIP builds
- git diff --cached --check
- build four deterministic host-neutral OpenAI skill archives
- add a separate production marketplace bundle for Codex and Claude Code
- package release artifacts from SemVer tags with GitHub Actions
- keep develop packaging isolated while sharing the corrected production guides
- validate detector UTF-8, repository identity, archive safety, and reproducibility
- document the With MCP submission and local packaging workflows
@bwayne98
bwayne98 merged commit 11cd56c into main Aug 21, 2026
2 checks passed
@bwayne98
bwayne98 deleted the feat/publish-chatgpt branch August 31, 2026 03:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant