Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

promptex-py(alpha 原型)

promptex 的 Python SDK 最小原型。目前的能力只有一項:宣告 skill,建置成 Claude Code 的 SKILL.md 產物。

這不是什麼

本套件是早期 alpha,不是完整的 promptex。正式版的單一套件內含 SDK、核心的 預編譯二進位綁定與完整命令列工具三者;本原型只有 SDK 的最窄一條路徑,命令列 工具只有 build 一個動詞,沒有原生綁定、沒有多平台投影、沒有引用與關係圖、 沒有安裝與所有權登記。

介面與產物格式在正式版之前都會變,不保證任何相容性。正式版發布時本原型會被 整份取代。

安裝

pip install --pre promptex-py

需要 Python 3.10 以上。--pre 是必要的:預發布版號不會被 pip 預設選中。

用法

把宣告寫在 prompts/ 下:

# prompts/skill.py
from promptex import config, define_skill

commit_helper = define_skill(
    "commit-helper",
    "Commit 訊息協助",
    config=config(when_to_use="當使用者要求撰寫 commit 訊息時使用"),
    content=[
        "依 Conventional Commits 撰寫:type(scope): subject。",
        "subject 用繁體中文、50 字內,不以句號結尾;body 說明變更動機而非變更內容。",
    ],
)

建置:

promptex build

產出 ./.claude/skills/commit-helper/SKILL.md

---
name: commit-helper
description: 當使用者要求撰寫 commit 訊息時使用
---

依 Conventional Commits 撰寫:type(scope): subject。

subject 用繁體中文、50 字內,不以句號結尾;body 說明變更動機而非變更內容。

命令列選項

promptex build [--src <目錄>] [--out <目錄>]

  --src <目錄>   宣告檔所在目錄,預設 prompts
  --out <目錄>   產物輸出目錄,預設當前目錄

程式化呼叫

from promptex import build, config, define_skill

define_skill("commit-helper", "Commit 訊息協助", config=config(when_to_use="..."), content="...")
written = build(".")

授權

MIT OR Apache-2.0,見 LICENSE-MITLICENSE-APACHE

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

promptex_py-0.0.1a1.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

promptex_py-0.0.1a1-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file promptex_py-0.0.1a1.tar.gz.

File metadata

  • Download URL: promptex_py-0.0.1a1.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.7

File hashes

Hashes for promptex_py-0.0.1a1.tar.gz
Algorithm Hash digest
SHA256 bca797b4874fc4982f3066be74d15829736d68c42a015efa353c2d66676db8fa
MD5 0b330bbdf61d0700238a7fa9c5b343fb
BLAKE2b-256 ab75f1dbedc58b9c4666e6b5bde7bfed4b81f587b07c6ca9cf2563df1b50e530

See more details on using hashes here.

File details

Details for the file promptex_py-0.0.1a1-py3-none-any.whl.

File metadata

  • Download URL: promptex_py-0.0.1a1-py3-none-any.whl
  • Upload date:
  • Size: 11.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.7

File hashes

Hashes for promptex_py-0.0.1a1-py3-none-any.whl
Algorithm Hash digest
SHA256 1427946b57380a290f193a33dea476e8949ce793ae981b3937d3730489dccd20
MD5 d363be784e6d113ac19368937f2e4555
BLAKE2b-256 0594582a74dbcc763abdf2c77639a67c97eb610114c96bf78a7a9eb9632d7010

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.0.1a1 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page