/** * Generator utilities for Living Docs Sync * Generates markdown files for features, READMEs, and user stories * * IMPORTANT: All generators are PROJECT-AGNOSTIC * They work for ANY user project, not just SpecWeave itself. * * @module core/living-docs/sync-helpers/generators */ import type { ParsedSpec, UserStoryData } from '../types.js'; /** * Convert a title to a URL-safe slug for filenames. * Strips leading/trailing dashes that occur when titles contain * special characters at the edges (e.g., "[Story Title] (P1)" → "story-title-p1"). */ /** * Convert a title to a URL-safe slug for filenames. * Strips leading/trailing dashes that occur when titles contain * special characters at the edges (e.g., "[Story Title] (P1)" → "story-title-p1"). */ export declare function slugifyTitle(title: string): string; /** * Extract the first sentence from text, respecting backtick-quoted content. * Avoids splitting on periods inside backticks (e.g., `.specweave/` or `file.ts`). * Falls back to the full text if no sentence boundary is found. */ export declare function extractFirstSentence(text: string): string; /** * Generator context - provides project-specific information * for template generation without hardcoding paths. */ export interface GeneratorContext { /** Project ID (e.g., "my-app", "backend-service") */ projectId: string; /** Project name for display (e.g., "My Application") */ projectName?: string; /** Relative path from feature folder to increments folder */ incrementsRelativePath?: string; /** Whether to use relative links (default: true) */ useRelativeLinks?: boolean; } /** * Generate FEATURE.md content * * @param featureId - Feature ID (e.g., "FS-001") * @param parsed - Parsed spec content * @param incrementId - Increment ID (e.g., "0001-feature-name") * @param context - Optional generator context for project-specific paths */ export declare function generateFeatureFile(featureId: string, parsed: ParsedSpec, incrementId: string, context?: Partial, existingFrontmatter?: Record): string; /** * Generate README.md content * * @param featureId - Feature ID (e.g., "FS-001") * @param parsed - Parsed spec content * @param _incrementId - Increment ID (unused but kept for signature compatibility) * @param context - Optional generator context for project-specific content */ export declare function generateReadmeFile(featureId: string, parsed: ParsedSpec, _incrementId: string, context?: Partial): string; /** * Options for user story file generation */ export interface UserStoryFileOptions { /** All projects in cross-project increment (for related_projects frontmatter) */ allProjects?: string[]; /** Generator context for project-specific paths */ context?: Partial; /** Existing external tool links to preserve (from previously-written US file) */ existingExternal?: Record; } /** * Generate user story file content * * @param story - User story data * @param featureId - Feature ID (e.g., "FS-001") * @param incrementId - Increment ID (e.g., "0001-feature-name") * @param parsed - Parsed spec content * @param options - Generation options including context */ export declare function generateUserStoryFile(story: UserStoryData, featureId: string, incrementId: string, parsed: ParsedSpec, options?: UserStoryFileOptions): string; //# sourceMappingURL=generators.d.ts.map