feat(KB-036): add worktreeNaming setting for configurable worktree directory names
- Add worktreeNaming setting type with 'random' | 'task-id' | 'task-title' options - Update executor to generate worktree names based on setting value - Create worktree-names.ts utility module with generateWorktreeName function - Add comprehensive executor tests for all naming strategies - Update AGENTS.md documentation with setting description and usage - Include changeset for patch release
This commit is contained in:
@@ -28,6 +28,23 @@ export const NOUNS = [
|
||||
"thorn", "tiger", "trail", "trout", "wren",
|
||||
];
|
||||
|
||||
/**
|
||||
* Convert a string to a URL-friendly slug.
|
||||
*
|
||||
* - Lowercase
|
||||
* - Replace spaces, underscores, and special chars with hyphens
|
||||
* - Collapse multiple hyphens
|
||||
* - Trim leading/trailing hyphens
|
||||
*/
|
||||
export function slugify(str: string): string {
|
||||
return str
|
||||
.toLowerCase()
|
||||
.replace(/[^a-z0-9\s-]/g, "") // Remove special characters except spaces and hyphens
|
||||
.replace(/\s+/g, "-") // Replace spaces with hyphens
|
||||
.replace(/-+/g, "-") // Collapse multiple hyphens
|
||||
.replace(/^-|-$/g, ""); // Trim leading/trailing hyphens
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a random, human-friendly worktree directory name.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user