Skip to main content
Glama

create-steering-doc

Generate steering documents (product.md, tech.md, or structure.md) by specifying project path, document type, and content. Facilitates structured development workflows using markdown-based templates for clear project guidance.

Instructions

Create a specific steering document (product.md, tech.md, or structure.md) with the provided content. Use ONLY when user explicitly requests steering document creation. NOT automatically required.

Input Schema

NameRequiredDescriptionDefault
contentYesThe complete markdown content for the steering document
documentYesWhich steering document to create: product, tech, or structure
projectPathYesAbsolute path to the project root

Input Schema (JSON Schema)

{ "properties": { "content": { "description": "The complete markdown content for the steering document", "type": "string" }, "document": { "description": "Which steering document to create: product, tech, or structure", "enum": [ "product", "tech", "structure" ], "type": "string" }, "projectPath": { "description": "Absolute path to the project root", "type": "string" } }, "required": [ "projectPath", "document", "content" ], "type": "object" }

Implementation Reference

  • The handler function for the 'create-steering-doc' prompt/tool. Validates input arguments (docType required, scope optional), constructs a detailed user message instructing the LLM to create a specific type of steering document (.md file) based on templates, and returns it as PromptMessage array.
    async function handler(args: Record<string, any>, context: ToolContext): Promise<PromptMessage[]> { const { docType, scope } = args; if (!docType) { throw new Error('docType is a required argument'); } const validDocTypes = ['product', 'tech', 'structure']; if (!validDocTypes.includes(docType)) { throw new Error(`docType must be one of: ${validDocTypes.join(', ')}`); } const messages: PromptMessage[] = [ { role: 'user', content: { type: 'text', text: `Create a ${docType} steering document for the project. **Context:** - Project: ${context.projectPath} - Steering document type: ${docType} ${scope ? `- Scope: ${scope}` : ''} ${context.dashboardUrl ? `- Dashboard: ${context.dashboardUrl}` : ''} **Instructions:** 1. First, read the template at: .spec-workflow/templates/${docType}-template.md 2. Check if steering docs exist at: .spec-workflow/steering/ 3. Create comprehensive content following the template structure 4. Create the document at: .spec-workflow/steering/${docType}.md 5. After creating, use approvals tool with action:'request' to get user approval **File Paths:** - Template location: .spec-workflow/templates/${docType}-template.md - Document destination: .spec-workflow/steering/${docType}.md **Steering Document Types:** - **product**: Defines project vision, goals, and user outcomes - **tech**: Documents technology decisions and architecture patterns - **structure**: Maps codebase organization and conventions **Key Principles:** - Be specific and actionable - Include examples where helpful - Consider both technical and business requirements - Provide clear guidance for future development - Templates are automatically updated on server start Please read the ${docType} template and create a comprehensive steering document at the specified path.` } } ]; return messages; }
  • The schema definition for the 'create-steering-doc' prompt/tool, including name, title, description, and arguments schema with docType (required) and scope (optional).
    const prompt: Prompt = { name: 'create-steering-doc', title: 'Create Steering Document', description: 'Guide for creating project steering documents (product, tech, structure) directly in the file system. These provide high-level project guidance.', arguments: [ { name: 'docType', description: 'Type of steering document: product, tech, or structure', required: true }, { name: 'scope', description: 'Scope of the steering document (e.g., frontend, backend, full-stack)', required: false } ] };
  • Registration of the createSteeringDocPrompt in the prompts registry array, imported from './create-steering-doc.js', and exposed via registerPrompts() function which returns all prompts including this one.
    // Import individual prompt definitions import { createSpecPrompt } from './create-spec.js'; import { createSteeringDocPrompt } from './create-steering-doc.js'; import { implementTaskPrompt } from './implement-task.js'; import { specStatusPrompt } from './spec-status.js'; import { injectSpecWorkflowGuidePrompt } from './inject-spec-workflow-guide.js'; import { injectSteeringGuidePrompt } from './inject-steering-guide.js'; import { refreshTasksPrompt } from './refresh-tasks.js'; // Registry of all prompts const promptDefinitions: PromptDefinition[] = [ createSpecPrompt, createSteeringDocPrompt, implementTaskPrompt, specStatusPrompt, injectSpecWorkflowGuidePrompt, injectSteeringGuidePrompt, refreshTasksPrompt ]; /** * Get all registered prompts */ export function registerPrompts(): Prompt[] { return promptDefinitions.map(def => def.prompt); }
  • src/server.ts:144-163 (registration)
    MCP server request handlers for prompts/list and prompts/get, which use handlePromptList() and handlePromptGet() from prompts/index.ts, enabling the 'create-steering-doc' prompt to be listed and called via MCP protocol.
    // Prompt handlers this.server.setRequestHandler(ListPromptsRequestSchema, async () => { try { return await handlePromptList(); } catch (error: any) { throw new McpError(ErrorCode.InternalError, error.message); } }); this.server.setRequestHandler(GetPromptRequestSchema, async (request) => { try { return await handlePromptGet( request.params.name, request.params.arguments || {}, context ); } catch (error: any) { throw new McpError(ErrorCode.InternalError, error.message); } });
  • src/server.ts:43-52 (registration)
    MCP server capabilities declaration enabling prompts support (listChanged: true), which includes the 'create-steering-doc' prompt.
    this.server = new Server({ name: 'spec-workflow-mcp', version: packageJson.version }, { capabilities: { tools: toolsCapability, prompts: { listChanged: true } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Pimzino/spec-workflow-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server