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 1d2706351b
commit 6f43bdcdf4
7 changed files with 262 additions and 10 deletions

View File

@@ -201,6 +201,13 @@ export interface Settings {
* of being deleted. New tasks acquire a warm worktree from the pool,
* preserving build caches (node_modules, target/, dist/). Default: false. */
recycleWorktrees?: boolean;
/** Controls how worktree directory names are generated when creating fresh worktrees.
* Only applies when recycleWorktrees is NOT enabled (pooled worktrees retain their existing names).
* - "random": Human-friendly adjective-noun names (e.g., swift-falcon) — default
* - "task-id": Use the task ID (e.g., kb-042)
* - "task-title": Use a slugified version of the task title (e.g., fix-login-bug)
* Default: "random". */
worktreeNaming?: "random" | "task-id" | "task-title";
/** Prefix for generated task IDs (e.g. `"KB"` produces `KB-001`).
* Defaults to `"KB"`. Only affects new tasks — existing tasks retain
* their original IDs. */
@@ -261,6 +268,7 @@ export const DEFAULT_SETTINGS: Settings = {
autoMerge: true,
worktreeInitCommand: undefined,
recycleWorktrees: false,
worktreeNaming: "random",
taskPrefix: undefined,
includeTaskIdInCommit: true,
defaultProvider: undefined,