/** * Increment Template Creator * * Creates TEMPLATE files for new increments. The sw-increment skill then * fills spec.md (and plan.md when --with-plan is used) in place. * * This is the sanctioned way to create increment files, so ids, metadata * and the ledger stay consistent. * * @module template-creator * @since 1.0.162 */ /** * Template markers that indicate a file is still a template * and hasn't been filled in by sw-increment yet. */ export declare const TEMPLATE_MARKERS: { /** Marker for unfilled user story titles */ STORY_TITLE: string; /** Marker for unfilled user type */ USER_TYPE: string; /** Marker for unfilled goal */ GOAL: string; /** Marker for unfilled benefit */ BENEFIT: string; /** Marker for unfilled criteria */ CRITERION: string; /** 2.0 spec.md: unfilled Problem section */ PROBLEM: string; /** 2.0 spec.md: unfilled Scope section */ SCOPE_IN: string; /** spec.md: unfilled Approach section */ APPROACH_FILES: string; /** Marker for unfilled component */ COMPONENT: string; /** Marker for unfilled description */ DESCRIPTION: string; /** Marker for placeholder project */ PROJECT_PLACEHOLDER: string; /** Generic placeholder pattern */ PLACEHOLDER_PATTERN: RegExp; /** Bracket placeholder pattern (excludes markdown links, feature IDs, user story IDs, and known non-placeholder patterns) */ BRACKET_PLACEHOLDER: RegExp; }; /** * Options for creating increment templates. */ /** * External source metadata for imported issues. * @since 1.0.272 */ export interface ExternalSourceInfo { /** Source platform */ platform: 'github' | 'jira' | 'ado'; /** Platform-specific external ID (e.g., "github#owner/repo#123") */ externalId: string; /** URL to the external issue */ externalUrl: string; /** Original issue title */ title: string; /** Original issue description/body */ description: string; /** Extracted acceptance criteria */ acceptanceCriteria?: string[]; /** External labels/tags */ labels?: string[]; /** External priority */ priority?: string; /** External status */ status?: string; } export interface CreateTemplateOptions { /** Increment ID (e.g., "0001-stripe-dashboard-mvp") */ incrementId: string; /** Feature title */ title: string; /** Feature description (brief overview) */ description: string; /** Project ID from context API */ projectId: string; /** Board ID for 2-level structures (optional) */ boardId?: string; /** Increment type (feature, hotfix, bug, etc.) */ type?: string; /** Priority (P1, P2, P3) */ priority?: string; /** Project root directory */ projectRoot?: string; /** External source metadata for imported issues (v1.0.272) */ externalSource?: ExternalSourceInfo; /** Auto-generate increment ID atomically */ autoId?: boolean; /** Increment name suffix (used with autoId) */ name?: string; /** * Scaffold the optional `plan.md` overflow document (2.0 `--with-plan`). * Off by default: spec.md carries the Approach, and readers stay tolerant of * a plan.md that already exists (legacy increments). */ withPlan?: boolean; /** * Create the increment in the `planned` state instead of `active` * (`create-increment --planned`) — for backlog / not-started-yet work. * `specweave start ` (or the first `task claim`) moves it to `active`. */ planned?: boolean; } /** * Result of template creation. */ export interface TemplateCreationResult { /** Whether creation was successful */ success: boolean; /** Path to created increment directory */ incrementPath: string; /** List of created files */ createdFiles: string[]; /** Error message if failed */ error?: string; /** Guidance for next steps */ nextSteps: string[]; } /** * Creates increment template files programmatically. * * Creates TEMPLATE files with placeholders. sw-increment fills spec.md * (and plan.md when --with-plan is used); this function never writes * full content itself. * * @param options - Template creation options * @returns Result of template creation * * @example * ```typescript * const result = await createIncrementTemplates({ * incrementId: '0001-stripe-dashboard', * title: 'Stripe Dashboard MVP', * description: 'React dashboard with Stripe checkout', * projectId: 'stripe-dashboard', * projectRoot: '/path/to/project' * }); * * if (result.success) { * console.log('Templates created:', result.createdFiles); * console.log('Next steps:', result.nextSteps); * } * ``` */ export declare function createIncrementTemplates(options: CreateTemplateOptions): Promise; /** * Detect project from current working directory using workspace config. * * Always attempts to match CWD against workspace.repos[].path. * No boolean flag gate — the repos array IS the config. * * @param config - Config object with optional workspace section * @param cwd - Current working directory * @param projectRoot - Project root path * @returns Matching repo ID, workspace.name as default, or undefined */ export declare function detectProjectFromCwd(config: { workspace?: { name?: string; repos?: Array<{ id: string; path: string; }>; }; } | undefined, cwd: string, projectRoot: string): string | undefined; /** * Checks if a spec.md file is still a template (not yet completed). * * A file is considered a template if it contains: * - Template markers like [Story Title], [user type], etc. * - Placeholders like {{PROJECT_ID}} * - Less than 3 actual user stories defined * * @param specPath - Path to spec.md file * @returns True if file is still a template */ export declare function isTemplateFile(specPath: string): boolean; /** * Validates that a spec.md file has been properly completed. * * @param specPath - Path to spec.md file * @returns Validation result with details */ export declare function validateSpecCompletion(specPath: string): { isComplete: boolean; issues: string[]; }; declare const _default: { createIncrementTemplates: typeof createIncrementTemplates; isTemplateFile: typeof isTemplateFile; validateSpecCompletion: typeof validateSpecCompletion; TEMPLATE_MARKERS: { /** Marker for unfilled user story titles */ STORY_TITLE: string; /** Marker for unfilled user type */ USER_TYPE: string; /** Marker for unfilled goal */ GOAL: string; /** Marker for unfilled benefit */ BENEFIT: string; /** Marker for unfilled criteria */ CRITERION: string; /** 2.0 spec.md: unfilled Problem section */ PROBLEM: string; /** 2.0 spec.md: unfilled Scope section */ SCOPE_IN: string; /** spec.md: unfilled Approach section */ APPROACH_FILES: string; /** Marker for unfilled component */ COMPONENT: string; /** Marker for unfilled description */ DESCRIPTION: string; /** Marker for placeholder project */ PROJECT_PLACEHOLDER: string; /** Generic placeholder pattern */ PLACEHOLDER_PATTERN: RegExp; /** Bracket placeholder pattern (excludes markdown links, feature IDs, user story IDs, and known non-placeholder patterns) */ BRACKET_PLACEHOLDER: RegExp; }; }; export default _default; //# sourceMappingURL=template-creator.d.ts.map