create_document
Generate structured documents from templates with automatic placeholder replacement for tasks, blueprints, requirements, and custom document types.
Instructions
Create new document from template with placeholder replacement.
Creates a new document by loading the appropriate template (Task/Blueprint/Requirement),
auto-filling common placeholders, and saving as .new.md with complete structure.
Auto-filled placeholders (from parameters):
- [project-id]: From project_id parameter
- [feature-id]: From feature_id parameter
- [feature-name]: From feature_id parameter
- [YYYY-MM-DD]: Current date (auto-generated)
Custom placeholders (need to be in replacements):
- [task-name]: Task name (for Task type)
- [任務標題]/[需求標題]/[藍圖標題]: Document titles
- Any other template-specific placeholders
Args:
project_id: Project identifier (auto-fills [project-id])
doc_type: Document type - "Task", "Blueprint", "Requirement" for RBT documents,
or custom types like "General", "Architecture", "Guide", "API" for general documents.
doc_type serves as classification for better document organization and retrieval.
replacements: Dictionary of custom placeholder -> value mappings
feature_id: Feature identifier (auto-fills [feature-id] and [feature-name])
file_path: File path within docs/ (for general documents)
Returns:
Success message with created file path
Example (Task document):
create_document(
project_id="knowledge-smith",
doc_type="Task",
feature_id="rbt-mcp-tool",
replacements={
"task-name": "PathResolver",
"任務標題": "實作 PathResolver 路徑解析與驗證"
}
)
# project-id, feature-id, feature-name, date 會自動填入
Example (Blueprint document):
create_document(
project_id="knowledge-smith",
doc_type="Blueprint",
feature_id="rbt-mcp-tool",
replacements={
"藍圖標題": "RBT 文件編輯 MCP Tool"
}
)
@REQ: REQ-rbt-mcp-tool
@BP: BP-rbt-mcp-tool
@TASK: TASK-014-CreateDocumentTool
Input Schema
Name | Required | Description | Default |
---|---|---|---|
doc_type | Yes | ||
feature_id | No | ||
file_path | No | ||
project_id | Yes | ||
replacements | Yes |
Input Schema (JSON Schema)
{
"properties": {
"doc_type": {
"title": "Doc Type",
"type": "string"
},
"feature_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Feature Id"
},
"file_path": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "File Path"
},
"project_id": {
"title": "Project Id",
"type": "string"
},
"replacements": {
"additionalProperties": true,
"title": "Replacements",
"type": "object"
}
},
"required": [
"project_id",
"doc_type",
"replacements"
],
"type": "object"
}