2.3 KiB
2.3 KiB
icon
| icon |
|---|
| lucide/messages-square |
Prompt Contract
This page defines the canonical contract for prompts in the docs-first MCP architecture.
Canonical Prompt Shape
Each prompt is one directory under docs/prompts/:
---
config:
treeView:
rowIndent: 20
lineThickness: 2
themeVariables:
treeView:
labelColor: '#FFFFFF'
lineColor: '#FFFFFF'
---
treeView-beta
"docs/"
"... (other docs)"
"prompts/"
"<prompt-id>/"
"PROMPT.md"
"references/"
"... (one or more markdown files, optional nested folders)"
Rules:
PROMPT.mdis required for every prompt.references/is the only place for prompt-specific supporting docs.- Nested folders inside
references/are allowed so a prompt can reorganize internals without changing global architecture. - Prompt directories are independent ownership boundaries; no cross-prompt file writes.
Metadata Location Constraint
- Prompt metadata is embedded in YAML frontmatter in
PROMPT.md. - No
metadata.yamlsidecar exists in the end state. - Reference lookup metadata is documented and explicit: top-level
references/*.mdare auto-discovered from filenames, whilePROMPT.mdfrontmatter declares overrides and nested mappings when needed.
Prompt Id Contract
prompt-id is the public identifier and should satisfy all rules below:
- Format: lowercase kebab-case only.
- Character set:
a-z,0-9, and-. - Must start with a letter.
- No underscores, spaces, dots, or uppercase characters.
- Directory name should equal
prompt-idin each committed revision. - Frontmatter
idshould equal directory name in each committed revision. - Treat
prompt-idas immutable after release; any rename is a breaking replacement and clients must move to the new id.
Valid examples:
fill-pytest-scaffoldreview-pr-commentsscaffold-fastapi-service
Invalid examples:
fill_pytest_scaffoldPrompt-Templatedocs.prompt
Direct Documentation Inclusion
- For direct API documentation, use mkdocstrings directives rather than pasting large code blocks.
- Keep manually-authored code examples short and task-focused; large implementation excerpts are out of scope for this contract.