refero_design_md
Render a Refero style into an agent-friendly DESIGN.md with frontmatter, color table, fonts, dos/donts, and tags. Optionally save to a project vault.
Instructions
Render a Refero style as an agent-friendly DESIGN.md (frontmatter, north star, color table, fonts, dos/donts, tags). When save_to_project is set, writes the file to /05-Projects//DESIGN.md.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| identifier | Yes | uuid, hostname/URL, or site name to render. | |
| save_to_project | No | Vault project folder name (e.g. "PARZVL"). Sanitized; must be [A-Za-z0-9_.-]. |
Implementation Reference
- src/tools/design-md.ts:40-70 (handler)Main handler for refero_design_md. Resolves an identifier via resolveAndFetch, renders the style as markdown via renderDesignMd, and optionally writes to vault/05-Projects/<name>/DESIGN.md.
export async function handleDesignMd(args: DesignMdArgs): Promise<DesignMdResult> { const identifier = asIdentifier(args.identifier); const projectName = asProjectName(args.save_to_project); const full = await resolveAndFetch(identifier); const markdown = renderDesignMd(full); if (!projectName) { return { identifier, siteName: full.siteName, styleId: full.id, markdown, }; } // resolveProjectDir throws PathSafetyError on bad input — let it propagate // so the MCP error envelope surfaces a useful message to the caller. const targetDir = resolveProjectDir(projectName); await mkdir(targetDir, { recursive: true }); const targetPath = join(targetDir, "DESIGN.md"); await writeFile(targetPath, markdown, "utf8"); return { identifier, siteName: full.siteName, styleId: full.id, markdown, savedTo: targetPath, }; } - src/tools/design-md.ts:13-24 (schema)Input types (DesignMdArgs: identifier, save_to_project) and output shape (DesignMdResult) for the tool.
export interface DesignMdArgs { identifier?: unknown; save_to_project?: unknown; } export interface DesignMdResult { identifier: string; siteName: string; styleId: string; markdown: string; savedTo?: string; }