A Python package for building effective chat prompts from vague user ideas.
Project description
prompt-recipe-smith
prompt-recipe-smith is a small Python package for building effective chat prompts
from vague user ideas.
It is designed for people who may not know AI, software, or prompt engineering terms. The package helps turn a rough thought into a clearer prompt by applying a reusable prompt-building procedure.
PromptTemplate vs PromptRecipe
A PromptTemplate is a fixed prompt form with variables:
from prompt_recipe_smith import PromptTemplate
template = PromptTemplate("Explain {topic} for a beginner.")
print(template.render({"topic": "email security"}))
A PromptRecipe is more than a template. It can include steps, defaults,
examples, clarification ideas, and up to three simple branches. A
PromptBuilder applies the recipe to a user's rough input and returns a
PromptResult.
Installation
Install from PyPI:
uv add prompt-recipe-smith
Minimal Example
The command-line app asks three clarification questions, then prints the final prompt for the chat agent:
prompt-recipe-smith I want to plan a small workshop
One-shot Builder
from prompt_recipe_smith import PromptBuilder
from prompt_recipe_smith.output import to_json, to_plain_text
from prompt_recipe_smith.recipes import clarify_idea_recipe
recipe = clarify_idea_recipe()
result = PromptBuilder().build(recipe, "I want to write a polite follow-up email")
print(to_plain_text(result))
print(to_json(result))
Plain Text Output
Help me turn this writing idea into a clear request:
I want to write a polite follow-up email
Ask up to three plain-language clarification questions, then draft an improved prompt.
Layered Questions
Use PromptSessionRunner when you want the same three-question flow in Python:
The built-in clarification questions are written in English, but users can answer them in any language. The CLI, API, and JSON output preserve Unicode text such as Japanese, Chinese, French, and Arabic.
from prompt_recipe_smith import PromptBuilder
from prompt_recipe_smith.recipes import clarify_idea_recipe
from prompt_recipe_smith.session import PromptSessionRunner
runner = PromptSessionRunner(
recipe=clarify_idea_recipe(),
builder=PromptBuilder(),
)
session = runner.start("I want to plan a small workshop")
session = runner.answer(session, "A one-day facilitation agenda")
session = runner.answer(session, "First-time team leads")
session = runner.answer(session, "Keep it practical and under six hours")
result = runner.finish(session)
print(result.prompt)
Keyword Matching
Branch keywords are internal hints used to select a simple recipe path such as
writing, learning, or planning. The built-in keyword data is defined in
src/prompt_recipe_smith/recipes/builtin.py, and the matching logic is handled
by src/prompt_recipe_smith/models.py.
Notebook Demo
A Google Colab-friendly demo notebook is available at
examples/prompt_recipe_smith_colab_demo.ipynb. It shows installation, one-shot
prompt building, the three-question layered flow, multilingual answers, and JSON
output.
JSON Output
{
"prompt": "Help me turn this writing idea into a clear request:\nI want to write a polite follow-up email\n\nAsk up to three plain-language clarification questions, then draft an improved prompt.",
"recipe_name": "clarify-idea",
"user_input": "I want to write a polite follow-up email",
"selected_branch": "writing",
"steps": [
"Restate the user's rough idea.",
"Ask for the missing context only if it matters.",
"Produce a practical prompt the user can paste into chat."
],
"provider": "chatgpt",
"answers": {}
}
Development
uv sync
uv run pytest
uv run ruff check .
uv run mypy src
uv build
Scope
The first version supports plain text and JSON output. JSONL, Gemini, Anthropic, and Django integrations are future extension targets. The provider layer does not call external APIs.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file prompt_recipe_smith-0.2.0.tar.gz.
File metadata
- Download URL: prompt_recipe_smith-0.2.0.tar.gz
- Upload date:
- Size: 8.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cbf38219e6a875b53b62edc1dfcf3880ce34ab7127944510f7db29a724e08de0
|
|
| MD5 |
bd2eeef5039a6ce7bc4756ac4c651b1c
|
|
| BLAKE2b-256 |
e23fe4929b041a479c9d2d0f5fe980867693931c33b16f31b64f56d784aa2b76
|
Provenance
The following attestation bundles were made for prompt_recipe_smith-0.2.0.tar.gz:
Publisher:
pypi.yml on yeiichi/prompt-recipe-smith
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
prompt_recipe_smith-0.2.0.tar.gz -
Subject digest:
cbf38219e6a875b53b62edc1dfcf3880ce34ab7127944510f7db29a724e08de0 - Sigstore transparency entry: 2028688203
- Sigstore integration time:
-
Permalink:
yeiichi/prompt-recipe-smith@b5e4b99720f31f8559dc893834cfb665ea5f7963 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/yeiichi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@b5e4b99720f31f8559dc893834cfb665ea5f7963 -
Trigger Event:
push
-
Statement type:
File details
Details for the file prompt_recipe_smith-0.2.0-py3-none-any.whl.
File metadata
- Download URL: prompt_recipe_smith-0.2.0-py3-none-any.whl
- Upload date:
- Size: 12.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
45d43a29ee51d0782fe6cc8128eaccc01e9b3eafda722b7ec22ea1e226bab797
|
|
| MD5 |
34499b8fad3e07fbe69d138249ecf90f
|
|
| BLAKE2b-256 |
8bb97443478da5d8053495b9f71df5ce9c8102713601d6bdb42a2bb5751ce12c
|
Provenance
The following attestation bundles were made for prompt_recipe_smith-0.2.0-py3-none-any.whl:
Publisher:
pypi.yml on yeiichi/prompt-recipe-smith
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
prompt_recipe_smith-0.2.0-py3-none-any.whl -
Subject digest:
45d43a29ee51d0782fe6cc8128eaccc01e9b3eafda722b7ec22ea1e226bab797 - Sigstore transparency entry: 2028688288
- Sigstore integration time:
-
Permalink:
yeiichi/prompt-recipe-smith@b5e4b99720f31f8559dc893834cfb665ea5f7963 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/yeiichi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@b5e4b99720f31f8559dc893834cfb665ea5f7963 -
Trigger Event:
push
-
Statement type: