prompt markdown
This commit is contained in:
+6
-10
@@ -11,11 +11,11 @@ The application combines a FastMCP server with a pre-built Zensical documentatio
|
||||
The runtime has four content paths:
|
||||
|
||||
1. `SkillsDirectoryProvider` publishes native `skill://` resources from packaged skill directories.
|
||||
2. `FileSystemProvider` discovers typed `@prompt` functions from packaged Python modules.
|
||||
2. A custom prompt provider loads declarative prompt definitions from packaged Markdown.
|
||||
3. The general docs registry publishes non-skill Markdown through `resource://docs/{path*}`.
|
||||
4. FastAPI serves the pre-built `site/` directory.
|
||||
|
||||
There is no custom skill catalog, prompt catalog, or prompt registry model.
|
||||
There is no custom skill catalog, prompt catalog, or per-prompt Python module.
|
||||
|
||||
## Source Ownership
|
||||
|
||||
@@ -36,12 +36,9 @@ The provider parses standard skill frontmatter and generates the manifest. The g
|
||||
|
||||
### Prompts
|
||||
|
||||
Each prompt has two coordinated sources:
|
||||
Each prompt has one source: `docs/prompts/<prompt-id>/PROMPT.md`. Its nested `prompt` frontmatter owns runtime metadata and argument declarations, while its body owns canonical prose.
|
||||
|
||||
1. `src/personal_mcp/prompts/components/<module>.py` owns the typed signature and runtime metadata.
|
||||
2. `docs/prompts/<prompt-id>/PROMPT.md` owns the canonical prompt prose.
|
||||
|
||||
The component loads Markdown with `importlib.resources`. The renderer strips documentation frontmatter, requires exact placeholder-to-argument equality, and substitutes typed values. `FileSystemProvider(reload=False)` discovers the components during server construction.
|
||||
The custom provider reads packaged Markdown with `importlib.resources`, validates metadata and exact placeholder-to-argument equality, and creates native FastMCP prompt objects. It rescans on each list and get request, so an editable deployment observes file additions, edits, and deletions without a restart.
|
||||
|
||||
FastMCP exposes prompts through native `prompts/list` and `prompts/get` operations.
|
||||
|
||||
@@ -54,8 +51,7 @@ The docs registry indexes packaged Markdown for `resource://docs/{path*}`. It re
|
||||
```mermaid
|
||||
flowchart TD
|
||||
A[Packaged Skill Directories] --> B[SkillsDirectoryProvider]
|
||||
C[Typed Prompt Components] --> D[FileSystemProvider]
|
||||
E[Packaged Prompt Markdown] --> C
|
||||
C[Packaged Prompt Markdown] --> D[Markdown Prompt Provider]
|
||||
F[General Markdown] --> G[Docs Registry]
|
||||
B --> H[FastMCP Server]
|
||||
D --> H
|
||||
@@ -65,7 +61,7 @@ flowchart TD
|
||||
K --> M
|
||||
```
|
||||
|
||||
Server construction is lazy with respect to package import. Each application process creates its providers and docs snapshot when the server factory runs. Production providers use `reload=False`; content changes require a process restart.
|
||||
Server construction is lazy with respect to package import. Each application process creates its providers and docs snapshot when the server factory runs. Skills use startup discovery, while prompts are reloaded when a client lists or gets prompts.
|
||||
|
||||
## Packaging
|
||||
|
||||
|
||||
Reference in New Issue
Block a user