prompt markdown
This commit is contained in:
@@ -29,20 +29,28 @@ The provider uses the directory name as the URI identity and the frontmatter `de
|
||||
|
||||
## Prompt Documentation Frontmatter
|
||||
|
||||
Prompt runtime metadata is defined by typed Python components, not Markdown frontmatter. A prompt document may retain only fields consumed by the static documentation site:
|
||||
Each prompt stores runtime metadata in a nested `prompt` mapping beside fields consumed by the static documentation site. The runtime mapping uses this shape:
|
||||
|
||||
```yaml
|
||||
---
|
||||
icon: lucide/messages-square
|
||||
prompt:
|
||||
version: "1.0.0"
|
||||
description: Describe when to use the prompt.
|
||||
tags: [example, prompts]
|
||||
arguments: {topic: {description: "Topic to process.", required: true, choices: [first, second]}, notes: {description: "Optional constraints.", required: false}}
|
||||
---
|
||||
```
|
||||
|
||||
Prompt rules:
|
||||
|
||||
1. Do not duplicate prompt names, descriptions, versions, tags, or arguments in Markdown YAML.
|
||||
2. Argument names must be valid Python identifiers in the component signature.
|
||||
3. Literal value constraints belong in Python type annotations.
|
||||
4. Markdown placeholders must exactly match the component argument names.
|
||||
1. `version`, `description`, `tags`, and `arguments` are required; unknown fields inside `prompt` or an argument are rejected.
|
||||
2. The directory name supplies the prompt id. Do not add a duplicate `name` field.
|
||||
3. Argument names must be valid identifiers and preserve their authored mapping order.
|
||||
4. Every argument requires a non-empty `description` and explicit `required` boolean.
|
||||
5. Optional `choices` must be a non-empty list of unique, non-empty strings.
|
||||
6. Markdown placeholders must exactly match the declared argument names.
|
||||
7. Top-level fields such as `icon` remain owned by the documentation site and are not runtime prompt metadata.
|
||||
|
||||
See the MCP [prompts concept documentation](https://modelcontextprotocol.io/docs/learn/server-concepts#prompts) and [schema reference](https://modelcontextprotocol.io/specification/latest/schema) for the protocol-level prompt shape.
|
||||
|
||||
@@ -54,11 +62,11 @@ Skill validation is file- and provider-oriented:
|
||||
2. FastMCP parses the description and scans all files when the provider is created.
|
||||
3. Repository tests enforce the stricter standard-only frontmatter and directory/name rules.
|
||||
|
||||
Prompt validation is provider- and renderer-oriented. Provider discovery validates decorated functions, while focused tests render every prompt and reject placeholder drift.
|
||||
Prompt validation is provider- and renderer-oriented. Every list or get request reloads and validates the authored files. A malformed definition fails the request instead of publishing a partial prompt set.
|
||||
|
||||
## Invariants
|
||||
|
||||
1. Skills remain directly portable to tools that understand standard Agent Skills directories.
|
||||
2. Native skill discovery has no parallel catalog metadata source.
|
||||
3. Prompts use FastMCP's native component metadata and protocol surface without a parallel catalog.
|
||||
3. Prompts use FastMCP's native component metadata and protocol surface without a parallel catalog or Python component file.
|
||||
4. All authored content remains under `docs/`.
|
||||
|
||||
Reference in New Issue
Block a user