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:
gsxdsm
2026-03-29 20:48:50 -07:00
parent 5e59c0419e
commit 919af827e0
7 changed files with 262 additions and 10 deletions

View File

@@ -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.
*