Prompt Utilities¶
Bundled prompt guide files for AI coding assistants are stored in
asset/prompt/*.md and asset/prompt/*.yaml. These utilities let you list, read, and copy
them into your project. Use them together with the
MCP Server for the richest AI
integration, or stand-alone for manual context injection.
Example¶
import dartwork_mpl as dm
# List available guides
available = dm.list_prompts()
# ['00-index', '01-policy', '02-anti-patterns', '03-recipes']
# Read guide content
content = dm.get_prompt("02-anti-patterns")
# Copy to IDE folder
dm.copy_prompt("01-policy", ".cursor/rules/")
# Get the file path directly
print(dm.prompt_path("00-index"))
API¶
- dartwork_mpl.prompt_path(name: str) Path[source]¶
Get the absolute path to a prompt guide file.
- Parameters:
name (str) – Name of the prompt guide to retrieve (e.g.,
'00-index','01-policy','02-anti-patterns','03-recipes').- Returns:
Path to the prompt guide file.
- Return type:
Path
- Raises:
ValueError – If the specified guide cannot be found in the library.
- dartwork_mpl.get_prompt(name: str) str[source]¶
Read a prompt guide file and return its full content as a string.
- Parameters:
name (str) – Name of the prompt guide to read.
- Returns:
The content of the prompt guide.
- Return type:
str
- dartwork_mpl.list_prompts() list[str][source]¶
List the bundled prompt guide files.
The canonical corpus is exactly four entries —
00-index,01-policy,02-anti-patterns(YAML),03-recipes— plus the05-templates/subdirectory listed separately. If extra supported prompt files appear (stale leftovers, an in-progress addition, etc.), this function still returns them but emits aUserWarningso drift surfaces immediately.- Returns:
Sorted list of available prompt guide names.
- Return type:
list[str]
- dartwork_mpl.copy_prompt(name: str, destination: str | Path) Path[source]¶
Copy a bundled prompt guide file to the specified destination.
- Parameters:
name (str) – Name of the prompt guide to copy.
destination (str | Path) – Destination path. If a directory, the file is copied with its original name and real extension. If a file path, that name is used.
- Returns:
Absolute path of the newly copied file.
- Return type:
Path
- Raises:
ValueError – If the source prompt guide cannot be found.