@eldrforge/kodrdriv 1.2.14 → 1.2.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sources":["../src/constants.ts"],"sourcesContent":["import { MergeMethod } from './types';\nimport os from 'os';\nimport path from 'path';\n\nexport const VERSION = '__VERSION__ (__GIT_BRANCH__/__GIT_COMMIT__ __GIT_TAGS__ __GIT_COMMIT_DATE__) __SYSTEM_INFO__';\nexport const PROGRAM_NAME = 'kodrdriv';\nexport const DEFAULT_CHARACTER_ENCODING = 'utf-8';\nexport const DEFAULT_BINARY_TO_TEXT_ENCODING = 'base64';\nexport const DEFAULT_DIFF = true;\nexport const DEFAULT_LOG = false;\nexport const DEFAULT_OVERRIDES = false;\nexport const DATE_FORMAT_MONTH_DAY = 'MM-DD';\nexport const DATE_FORMAT_YEAR = 'YYYY';\nexport const DATE_FORMAT_YEAR_MONTH = 'YYYY-MM';\nexport const DATE_FORMAT_YEAR_MONTH_DAY = 'YYYY-MM-DD';\nexport const DATE_FORMAT_YEAR_MONTH_DAY_SLASH = 'YYYY/MM/DD';\nexport const DATE_FORMAT_YEAR_MONTH_DAY_HOURS_MINUTES = 'YYYY-MM-DD-HHmm';\nexport const DATE_FORMAT_YEAR_MONTH_DAY_HOURS_MINUTES_SECONDS = 'YYYY-MM-DD-HHmmss';\nexport const DATE_FORMAT_YEAR_MONTH_DAY_HOURS_MINUTES_SECONDS_MILLISECONDS = 'YYYY-MM-DD-HHmmss.SSS';\nexport const DATE_FORMAT_SHORT_TIMESTAMP = 'YYMMdd-HHmm';\nexport const DATE_FORMAT_MONTH = 'MM';\nexport const DATE_FORMAT_DAY = 'DD';\nexport const DATE_FORMAT_HOURS = 'HHmm';\nexport const DATE_FORMAT_MINUTES = 'mm';\nexport const DATE_FORMAT_SECONDS = 'ss';\nexport const DATE_FORMAT_MILLISECONDS = 'SSS';\nexport const DEFAULT_VERBOSE = false;\nexport const DEFAULT_DRY_RUN = false;\nexport const DEFAULT_DEBUG = false;\nexport const DEFAULT_MODEL = 'gpt-4o-mini';\nexport const DEFAULT_MODEL_STRONG = 'gpt-4o';\nexport const DEFAULT_OPENAI_REASONING = 'low';\nexport const DEFAULT_OPENAI_MAX_OUTPUT_TOKENS = 10000;\nexport const DEFAULT_OUTPUT_DIRECTORY = 'output/kodrdriv';\n\n// Buffer size for git commands that may produce large output (like git log)\nexport const DEFAULT_GIT_COMMAND_MAX_BUFFER = 50 * 1024 * 1024; // 50MB\n\nexport const DEFAULT_CONTEXT_DIRECTORIES: string[] = [];\n\nexport const DEFAULT_CONFIG_DIR = '.kodrdriv';\nexport const DEFAULT_PREFERENCES_DIRECTORY = path.join(os.homedir(), '.kodrdriv');\n\nexport const DEFAULT_FROM_COMMIT_ALIAS = 'main';\nexport const DEFAULT_TO_COMMIT_ALIAS = 'HEAD';\n\nexport const DEFAULT_ADD = false;\nexport const DEFAULT_CACHED = false;\nexport const DEFAULT_SENDIT_MODE = false;\nexport const DEFAULT_INTERACTIVE_MODE = false;\nexport const DEFAULT_AMEND_MODE = false;\nexport const DEFAULT_MESSAGE_LIMIT = 50;\nexport const DEFAULT_MAX_DIFF_BYTES = 20480; // 20KB limit per file\n\nexport const DEFAULT_MERGE_METHOD: MergeMethod = 'squash';\n\nexport const DEFAULT_EXCLUDED_PATTERNS = [\n 'node_modules', 'package-lock.json', 'yarn.lock', 'bun.lockb',\n 'composer.lock', 'Cargo.lock', 'Gemfile.lock',\n 'dist', 'build', 'out', '.next', '.nuxt', 'coverage',\n '.vscode', '.idea', '.DS_Store', '.git', '.gitignore',\n 'logs', 'tmp', '.cache', '*.log', '.env', '.env.*',\n '*.pem', '*.crt', '*.key', '*.sqlite', '*.db',\n '*.zip', '*.tar', '*.gz', '*.exe', '*.bin'\n];\n\nexport const COMMAND_COMMIT = 'commit';\nexport const COMMAND_AUDIO_COMMIT = 'audio-commit';\nexport const COMMAND_SELECT_AUDIO = 'select-audio';\nexport const COMMAND_RELEASE = 'release';\nexport const COMMAND_REVIEW = 'review';\nexport const COMMAND_AUDIO_REVIEW = 'audio-review';\nexport const COMMAND_PUBLISH = 'publish';\nexport const COMMAND_TREE = 'tree';\nexport const COMMAND_LINK = 'link';\nexport const COMMAND_UNLINK = 'unlink';\nexport const COMMAND_CLEAN = 'clean';\nexport const COMMAND_DEVELOPMENT = 'development';\nexport const COMMAND_VERSIONS = 'versions';\nexport const COMMAND_UPDATES = 'updates';\nexport const COMMAND_CHECK_CONFIG = 'check-config';\nexport const COMMAND_INIT_CONFIG = 'init-config';\n\nexport const ALLOWED_COMMANDS = [\n COMMAND_COMMIT,\n COMMAND_AUDIO_COMMIT,\n COMMAND_SELECT_AUDIO,\n COMMAND_RELEASE,\n COMMAND_REVIEW,\n COMMAND_AUDIO_REVIEW,\n COMMAND_PUBLISH,\n COMMAND_TREE,\n COMMAND_LINK,\n COMMAND_UNLINK,\n COMMAND_CLEAN,\n COMMAND_DEVELOPMENT,\n COMMAND_VERSIONS,\n COMMAND_UPDATES\n];\n\nexport const DEFAULT_COMMAND = COMMAND_COMMIT;\n\nexport const DEFAULT_INSTRUCTIONS_DIR = `instructions`;\n\nexport const DEFAULT_PERSONA_DIR = `personas`;\n\nexport const DEFAULT_INSTRUCTIONS_COMMIT_FILE = `${DEFAULT_INSTRUCTIONS_DIR}/commit.md`;\nexport const DEFAULT_INSTRUCTIONS_RELEASE_FILE = `${DEFAULT_INSTRUCTIONS_DIR}/release.md`;\nexport const DEFAULT_INSTRUCTIONS_REVIEW_FILE = `${DEFAULT_INSTRUCTIONS_DIR}/review.md`;\n\nexport const DEFAULT_PERSONA_RELEASER_FILE = `${DEFAULT_PERSONA_DIR}/releaser.md`;\nexport const DEFAULT_PERSONA_YOU_FILE = `${DEFAULT_PERSONA_DIR}/you.md`;\n\n// Default instructions for each persona\nexport const DEFAULT_INSTRUCTIONS_MAP = {\n [COMMAND_COMMIT]: DEFAULT_INSTRUCTIONS_COMMIT_FILE,\n [COMMAND_AUDIO_COMMIT]: DEFAULT_INSTRUCTIONS_COMMIT_FILE, // Reuse commit instructions\n [COMMAND_RELEASE]: DEFAULT_INSTRUCTIONS_RELEASE_FILE,\n [COMMAND_REVIEW]: DEFAULT_INSTRUCTIONS_REVIEW_FILE, // Reuse audio-review instructions for now\n [COMMAND_AUDIO_REVIEW]: DEFAULT_INSTRUCTIONS_REVIEW_FILE,\n};\n\n// Default personas for each command\nexport const DEFAULT_PERSONA_MAP = {\n [COMMAND_COMMIT]: DEFAULT_PERSONA_YOU_FILE,\n [COMMAND_AUDIO_COMMIT]: DEFAULT_PERSONA_YOU_FILE, // Use You persona\n [COMMAND_RELEASE]: DEFAULT_PERSONA_RELEASER_FILE,\n [COMMAND_REVIEW]: DEFAULT_PERSONA_YOU_FILE, // Use You persona\n [COMMAND_AUDIO_REVIEW]: DEFAULT_PERSONA_YOU_FILE,\n};\n\n// Used by child process to create paths\nexport const DEFAULT_PATH_SEPARATOR = '/';\n\n// Used by util/general for file filtering\nexport const DEFAULT_IGNORE_PATTERNS = [\n 'node_modules/**',\n '**/*.log',\n '.git/**',\n 'dist/**',\n 'build/**',\n 'coverage/**',\n '.DS_Store',\n '*.tmp',\n '*.cache',\n];\n\n// Used by util/storage for directory names\nexport const DEFAULT_DIRECTORY_PREFIX = '.kodrdriv';\n\n// Used by other commands but not exposed in CLI\nexport const INTERNAL_DEFAULT_OUTPUT_FILE = 'output.txt';\n\nexport const INTERNAL_DATETIME_FORMAT = 'YYYY-MM-DD_HH-mm-ss';\n\n// Define defaults in one place\nexport const KODRDRIV_DEFAULTS = {\n dryRun: DEFAULT_DRY_RUN,\n verbose: DEFAULT_VERBOSE,\n debug: DEFAULT_DEBUG,\n overrides: DEFAULT_OVERRIDES,\n model: DEFAULT_MODEL,\n openaiReasoning: DEFAULT_OPENAI_REASONING as 'low' | 'medium' | 'high',\n openaiMaxOutputTokens: DEFAULT_OPENAI_MAX_OUTPUT_TOKENS,\n contextDirectories: DEFAULT_CONTEXT_DIRECTORIES,\n commandName: DEFAULT_COMMAND,\n configDirectory: DEFAULT_CONFIG_DIR,\n outputDirectory: DEFAULT_OUTPUT_DIRECTORY,\n preferencesDirectory: DEFAULT_PREFERENCES_DIRECTORY,\n commit: {\n add: DEFAULT_ADD,\n cached: DEFAULT_CACHED,\n sendit: DEFAULT_SENDIT_MODE,\n interactive: DEFAULT_INTERACTIVE_MODE,\n amend: DEFAULT_AMEND_MODE,\n messageLimit: DEFAULT_MESSAGE_LIMIT,\n skipFileCheck: false,\n maxDiffBytes: DEFAULT_MAX_DIFF_BYTES,\n openaiReasoning: DEFAULT_OPENAI_REASONING as 'low' | 'medium' | 'high',\n openaiMaxOutputTokens: DEFAULT_OPENAI_MAX_OUTPUT_TOKENS,\n },\n release: {\n from: DEFAULT_FROM_COMMIT_ALIAS,\n to: DEFAULT_TO_COMMIT_ALIAS,\n messageLimit: DEFAULT_MESSAGE_LIMIT,\n interactive: DEFAULT_INTERACTIVE_MODE,\n maxDiffBytes: DEFAULT_MAX_DIFF_BYTES,\n noMilestones: false,\n openaiReasoning: DEFAULT_OPENAI_REASONING as 'low' | 'medium' | 'high',\n openaiMaxOutputTokens: DEFAULT_OPENAI_MAX_OUTPUT_TOKENS,\n },\n audioCommit: {\n maxRecordingTime: 300, // 5 minutes default\n audioDevice: undefined, // Auto-detect by default\n openaiReasoning: DEFAULT_OPENAI_REASONING as 'low' | 'medium' | 'high',\n openaiMaxOutputTokens: DEFAULT_OPENAI_MAX_OUTPUT_TOKENS,\n },\n review: {\n includeCommitHistory: true,\n includeRecentDiffs: true,\n includeReleaseNotes: false,\n includeGithubIssues: true,\n commitHistoryLimit: 10,\n diffHistoryLimit: 5,\n releaseNotesLimit: 3,\n githubIssuesLimit: 20,\n sendit: DEFAULT_SENDIT_MODE,\n openaiReasoning: DEFAULT_OPENAI_REASONING as 'low' | 'medium' | 'high',\n openaiMaxOutputTokens: DEFAULT_OPENAI_MAX_OUTPUT_TOKENS,\n },\n audioReview: {\n includeCommitHistory: true,\n includeRecentDiffs: true,\n includeReleaseNotes: false,\n includeGithubIssues: true,\n commitHistoryLimit: 10,\n diffHistoryLimit: 5,\n releaseNotesLimit: 3,\n githubIssuesLimit: 20,\n sendit: DEFAULT_SENDIT_MODE,\n maxRecordingTime: 300, // 5 minutes default\n audioDevice: undefined, // Auto-detect by default\n directory: undefined, // No default directory\n openaiReasoning: DEFAULT_OPENAI_REASONING as 'low' | 'medium' | 'high',\n openaiMaxOutputTokens: DEFAULT_OPENAI_MAX_OUTPUT_TOKENS,\n },\n publish: {\n mergeMethod: DEFAULT_MERGE_METHOD,\n from: DEFAULT_FROM_COMMIT_ALIAS,\n targetVersion: 'patch',\n interactive: DEFAULT_INTERACTIVE_MODE,\n requiredEnvVars: ['GITHUB_TOKEN', 'OPENAI_API_KEY'],\n linkWorkspacePackages: true,\n unlinkWorkspacePackages: true,\n sendit: DEFAULT_SENDIT_MODE,\n targetBranch: 'main',\n noMilestones: false,\n checksTimeout: 3600000, // 1 hour default for PR checks\n releaseWorkflowsTimeout: 1800000, // 30 minutes default for release workflows\n },\n link: {\n scopeRoots: {},\n dryRun: false,\n packageArgument: undefined,\n externals: [],\n },\n unlink: {\n scopeRoots: {},\n workspaceFile: undefined,\n dryRun: false,\n cleanNodeModules: false,\n packageArgument: undefined,\n externals: [],\n },\n tree: {\n directories: undefined,\n exclude: undefined,\n startFrom: undefined,\n stopAt: undefined,\n cmd: undefined,\n\n builtInCommand: undefined,\n continue: false,\n packageArgument: undefined,\n cleanNodeModules: false,\n externals: [],\n },\n development: {\n targetVersion: 'patch',\n noMilestones: false,\n },\n versions: {\n subcommand: undefined,\n directories: undefined,\n },\n updates: {\n scope: undefined,\n directories: undefined,\n },\n excludedPatterns: DEFAULT_EXCLUDED_PATTERNS,\n branches: {\n working: {\n targetBranch: 'main',\n developmentBranch: true,\n version: {\n type: 'prerelease' as const,\n increment: true,\n incrementLevel: 'patch' as const,\n tag: 'dev'\n }\n },\n main: {\n version: {\n type: 'release' as const\n }\n }\n }\n};\n"],"names":["VERSION","PROGRAM_NAME","DEFAULT_OVERRIDES","DATE_FORMAT_YEAR_MONTH_DAY_HOURS_MINUTES_SECONDS_MILLISECONDS","DEFAULT_VERBOSE","DEFAULT_DRY_RUN","DEFAULT_DEBUG","DEFAULT_MODEL","DEFAULT_OPENAI_REASONING","DEFAULT_OPENAI_MAX_OUTPUT_TOKENS","DEFAULT_OUTPUT_DIRECTORY","DEFAULT_GIT_COMMAND_MAX_BUFFER","DEFAULT_CONTEXT_DIRECTORIES","DEFAULT_CONFIG_DIR","DEFAULT_PREFERENCES_DIRECTORY","path","join","os","homedir","DEFAULT_FROM_COMMIT_ALIAS","DEFAULT_TO_COMMIT_ALIAS","DEFAULT_ADD","DEFAULT_CACHED","DEFAULT_SENDIT_MODE","DEFAULT_INTERACTIVE_MODE","DEFAULT_AMEND_MODE","DEFAULT_MESSAGE_LIMIT","DEFAULT_MAX_DIFF_BYTES","DEFAULT_MERGE_METHOD","DEFAULT_EXCLUDED_PATTERNS","COMMAND_COMMIT","COMMAND_AUDIO_COMMIT","COMMAND_SELECT_AUDIO","COMMAND_RELEASE","COMMAND_REVIEW","COMMAND_AUDIO_REVIEW","COMMAND_PUBLISH","COMMAND_TREE","COMMAND_LINK","COMMAND_UNLINK","COMMAND_CLEAN","COMMAND_DEVELOPMENT","COMMAND_VERSIONS","COMMAND_UPDATES","COMMAND_CHECK_CONFIG","COMMAND_INIT_CONFIG","ALLOWED_COMMANDS","DEFAULT_COMMAND","KODRDRIV_DEFAULTS","dryRun","verbose","debug","overrides","model","openaiReasoning","openaiMaxOutputTokens","contextDirectories","commandName","configDirectory","outputDirectory","preferencesDirectory","commit","add","cached","sendit","interactive","amend","messageLimit","skipFileCheck","maxDiffBytes","release","from","to","noMilestones","audioCommit","maxRecordingTime","audioDevice","undefined","review","includeCommitHistory","includeRecentDiffs","includeReleaseNotes","includeGithubIssues","commitHistoryLimit","diffHistoryLimit","releaseNotesLimit","githubIssuesLimit","audioReview","directory","publish","mergeMethod","targetVersion","requiredEnvVars","linkWorkspacePackages","unlinkWorkspacePackages","targetBranch","checksTimeout","releaseWorkflowsTimeout","link","scopeRoots","packageArgument","externals","unlink","workspaceFile","cleanNodeModules","tree","directories","exclude","startFrom","stopAt","cmd","builtInCommand","continue","development","versions","subcommand","updates","scope","excludedPatterns","branches","working","developmentBranch","version","type","increment","incrementLevel","tag","main"],"mappings":";;;AAIO,MAAMA,UAAU;AAChB,MAAMC,eAAe;AAKrB,MAAMC,oBAAoB;AAQ1B,MAAMC,gEAAgE;AAQtE,MAAMC,kBAAkB;AACxB,MAAMC,kBAAkB;AACxB,MAAMC,gBAAgB;AACtB,MAAMC,gBAAgB;AAEtB,MAAMC,2BAA2B;AACjC,MAAMC,mCAAmC;AACzC,MAAMC,2BAA2B;AAExC;MACaC,8BAAAA,GAAiC,EAAA,GAAK,IAAA,GAAO,KAAK;AAExD,MAAMC,2BAAAA,GAAwC;AAE9C,MAAMC,qBAAqB;AAC3B,MAAMC,gCAAgCC,aAAAA,CAAKC,IAAI,CAACC,WAAAA,CAAGC,OAAO,IAAI,WAAA;AAE9D,MAAMC,4BAA4B;AAClC,MAAMC,0BAA0B;AAEhC,MAAMC,cAAc;AACpB,MAAMC,iBAAiB;AACvB,MAAMC,sBAAsB;AAC5B,MAAMC,2BAA2B;AACjC,MAAMC,qBAAqB;AAC3B,MAAMC,wBAAwB;AAC9B,MAAMC,sBAAAA,GAAyB,MAAM;AAErC,MAAMC,uBAAoC;MAEpCC,yBAAAA,GAA4B;AACrC,IAAA,cAAA;AAAgB,IAAA,mBAAA;AAAqB,IAAA,WAAA;AAAa,IAAA,WAAA;AAClD,IAAA,eAAA;AAAiB,IAAA,YAAA;AAAc,IAAA,cAAA;AAC/B,IAAA,MAAA;AAAQ,IAAA,OAAA;AAAS,IAAA,KAAA;AAAO,IAAA,OAAA;AAAS,IAAA,OAAA;AAAS,IAAA,UAAA;AAC1C,IAAA,SAAA;AAAW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kB,KAAA;QAClBJ,eAAAA,EAAiBvB,SAAAA;AACjBwB,QAAAA,SAAAA,EAAW;AACf,KAAA;IACAI,IAAAA,EAAM;QACFC,WAAAA,EAAa7B,SAAAA;QACb8B,OAAAA,EAAS9B,SAAAA;QACT+B,SAAAA,EAAW/B,SAAAA;QACXgC,MAAAA,EAAQhC,SAAAA;QACRiC,GAAAA,EAAKjC,SAAAA;QAELkC,cAAAA,EAAgBlC,SAAAA;QAChBmC,QAAAA,EAAU,KAAA;QACVZ,eAAAA,EAAiBvB,SAAAA;QACjB2B,gBAAAA,EAAkB,KAAA;AAClBH,QAAAA,SAAAA,EAAW;AACf,KAAA;IACAY,WAAAA,EAAa;QACTtB,aAAAA,EAAe,OAAA;QACflB,YAAAA,EAAc;AAClB,KAAA;IACAyC,QAAAA,EAAU;QACNC,UAAAA,EAAYtC,SAAAA;QACZ6B,WAAAA,EAAa7B;AACjB,KAAA;IACAuC,OAAAA,EAAS;QACLC,KAAAA,EAAOxC,SAAAA;QACP6B,WAAAA,EAAa7B;AACjB,KAAA;IACAyC,gBAAAA,EAAkBzF,yBAAAA;IAClB0F,QAAAA,EAAU;QACNC,OAAAA,EAAS;YACLzB,YAAAA,EAAc,MAAA;YACd0B,iBAAAA,EAAmB,IAAA;YACnBC,OAAAA,EAAS;gBACLC,IAAAA,EAAM,YAAA;gBACNC,SAAAA,EAAW,IAAA;gBACXC,cAAAA,EAAgB,OAAA;gBAChBC,GAAAA,EAAK;AACT;AACJ,SAAA;QACAC,IAAAA,EAAM;YACFL,OAAAA,EAAS;gBACLC,IAAAA,EAAM;AACV;AACJ;AACJ;AACJ;;;;"}
1
+ {"version":3,"file":"constants.js","sources":["../src/constants.ts"],"sourcesContent":["import { MergeMethod } from './types';\nimport os from 'os';\nimport path from 'path';\n\nexport const VERSION = '__VERSION__ (__GIT_BRANCH__/__GIT_COMMIT__ __GIT_TAGS__ __GIT_COMMIT_DATE__) __SYSTEM_INFO__';\nexport const PROGRAM_NAME = 'kodrdriv';\nexport const DEFAULT_CHARACTER_ENCODING = 'utf-8';\nexport const DEFAULT_BINARY_TO_TEXT_ENCODING = 'base64';\nexport const DEFAULT_DIFF = true;\nexport const DEFAULT_LOG = false;\nexport const DEFAULT_OVERRIDES = false;\nexport const DATE_FORMAT_MONTH_DAY = 'MM-DD';\nexport const DATE_FORMAT_YEAR = 'YYYY';\nexport const DATE_FORMAT_YEAR_MONTH = 'YYYY-MM';\nexport const DATE_FORMAT_YEAR_MONTH_DAY = 'YYYY-MM-DD';\nexport const DATE_FORMAT_YEAR_MONTH_DAY_SLASH = 'YYYY/MM/DD';\nexport const DATE_FORMAT_YEAR_MONTH_DAY_HOURS_MINUTES = 'YYYY-MM-DD-HHmm';\nexport const DATE_FORMAT_YEAR_MONTH_DAY_HOURS_MINUTES_SECONDS = 'YYYY-MM-DD-HHmmss';\nexport const DATE_FORMAT_YEAR_MONTH_DAY_HOURS_MINUTES_SECONDS_MILLISECONDS = 'YYYY-MM-DD-HHmmss.SSS';\nexport const DATE_FORMAT_SHORT_TIMESTAMP = 'YYMMdd-HHmm';\nexport const DATE_FORMAT_MONTH = 'MM';\nexport const DATE_FORMAT_DAY = 'DD';\nexport const DATE_FORMAT_HOURS = 'HHmm';\nexport const DATE_FORMAT_MINUTES = 'mm';\nexport const DATE_FORMAT_SECONDS = 'ss';\nexport const DATE_FORMAT_MILLISECONDS = 'SSS';\nexport const DEFAULT_VERBOSE = false;\nexport const DEFAULT_DRY_RUN = false;\nexport const DEFAULT_DEBUG = false;\nexport const DEFAULT_MODEL = 'gpt-4o-mini';\nexport const DEFAULT_MODEL_STRONG = 'gpt-4o';\nexport const DEFAULT_OPENAI_REASONING = 'low';\nexport const DEFAULT_OPENAI_MAX_OUTPUT_TOKENS = 10000;\nexport const DEFAULT_OUTPUT_DIRECTORY = 'output/kodrdriv';\n\n// Buffer size for git commands that may produce large output (like git log)\nexport const DEFAULT_GIT_COMMAND_MAX_BUFFER = 50 * 1024 * 1024; // 50MB\n\nexport const DEFAULT_CONTEXT_DIRECTORIES: string[] = [];\n\nexport const DEFAULT_CONFIG_DIR = '.kodrdriv';\nexport const DEFAULT_PREFERENCES_DIRECTORY = path.join(os.homedir(), '.kodrdriv');\n\nexport const DEFAULT_FROM_COMMIT_ALIAS = 'main';\nexport const DEFAULT_TO_COMMIT_ALIAS = 'HEAD';\n\nexport const DEFAULT_ADD = false;\nexport const DEFAULT_CACHED = false;\nexport const DEFAULT_SENDIT_MODE = false;\nexport const DEFAULT_INTERACTIVE_MODE = false;\nexport const DEFAULT_AMEND_MODE = false;\n// CRITICAL: Keep this low (3-5) to prevent log context contamination.\n// The LLM tends to pattern-match against recent commits instead of describing\n// the actual diff when it sees too much commit history. Set to 0 to disable.\nexport const DEFAULT_MESSAGE_LIMIT = 3;\nexport const DEFAULT_MAX_DIFF_BYTES = 20480; // 20KB limit per file\n\nexport const DEFAULT_MERGE_METHOD: MergeMethod = 'squash';\n\nexport const DEFAULT_EXCLUDED_PATTERNS = [\n 'node_modules', 'package-lock.json', 'yarn.lock', 'bun.lockb',\n 'composer.lock', 'Cargo.lock', 'Gemfile.lock',\n 'dist', 'build', 'out', '.next', '.nuxt', 'coverage',\n '.vscode', '.idea', '.DS_Store', '.git', '.gitignore',\n 'logs', 'tmp', '.cache', '*.log', '.env', '.env.*',\n '*.pem', '*.crt', '*.key', '*.sqlite', '*.db',\n '*.zip', '*.tar', '*.gz', '*.exe', '*.bin'\n];\n\nexport const COMMAND_COMMIT = 'commit';\nexport const COMMAND_AUDIO_COMMIT = 'audio-commit';\nexport const COMMAND_SELECT_AUDIO = 'select-audio';\nexport const COMMAND_RELEASE = 'release';\nexport const COMMAND_REVIEW = 'review';\nexport const COMMAND_AUDIO_REVIEW = 'audio-review';\nexport const COMMAND_PUBLISH = 'publish';\nexport const COMMAND_TREE = 'tree';\nexport const COMMAND_LINK = 'link';\nexport const COMMAND_UNLINK = 'unlink';\nexport const COMMAND_CLEAN = 'clean';\nexport const COMMAND_DEVELOPMENT = 'development';\nexport const COMMAND_VERSIONS = 'versions';\nexport const COMMAND_UPDATES = 'updates';\nexport const COMMAND_CHECK_CONFIG = 'check-config';\nexport const COMMAND_INIT_CONFIG = 'init-config';\n\nexport const ALLOWED_COMMANDS = [\n COMMAND_COMMIT,\n COMMAND_AUDIO_COMMIT,\n COMMAND_SELECT_AUDIO,\n COMMAND_RELEASE,\n COMMAND_REVIEW,\n COMMAND_AUDIO_REVIEW,\n COMMAND_PUBLISH,\n COMMAND_TREE,\n COMMAND_LINK,\n COMMAND_UNLINK,\n COMMAND_CLEAN,\n COMMAND_DEVELOPMENT,\n COMMAND_VERSIONS,\n COMMAND_UPDATES\n];\n\nexport const DEFAULT_COMMAND = COMMAND_COMMIT;\n\nexport const DEFAULT_INSTRUCTIONS_DIR = `instructions`;\n\nexport const DEFAULT_PERSONA_DIR = `personas`;\n\nexport const DEFAULT_INSTRUCTIONS_COMMIT_FILE = `${DEFAULT_INSTRUCTIONS_DIR}/commit.md`;\nexport const DEFAULT_INSTRUCTIONS_RELEASE_FILE = `${DEFAULT_INSTRUCTIONS_DIR}/release.md`;\nexport const DEFAULT_INSTRUCTIONS_REVIEW_FILE = `${DEFAULT_INSTRUCTIONS_DIR}/review.md`;\n\nexport const DEFAULT_PERSONA_RELEASER_FILE = `${DEFAULT_PERSONA_DIR}/releaser.md`;\nexport const DEFAULT_PERSONA_YOU_FILE = `${DEFAULT_PERSONA_DIR}/you.md`;\n\n// Default instructions for each persona\nexport const DEFAULT_INSTRUCTIONS_MAP = {\n [COMMAND_COMMIT]: DEFAULT_INSTRUCTIONS_COMMIT_FILE,\n [COMMAND_AUDIO_COMMIT]: DEFAULT_INSTRUCTIONS_COMMIT_FILE, // Reuse commit instructions\n [COMMAND_RELEASE]: DEFAULT_INSTRUCTIONS_RELEASE_FILE,\n [COMMAND_REVIEW]: DEFAULT_INSTRUCTIONS_REVIEW_FILE, // Reuse audio-review instructions for now\n [COMMAND_AUDIO_REVIEW]: DEFAULT_INSTRUCTIONS_REVIEW_FILE,\n};\n\n// Default personas for each command\nexport const DEFAULT_PERSONA_MAP = {\n [COMMAND_COMMIT]: DEFAULT_PERSONA_YOU_FILE,\n [COMMAND_AUDIO_COMMIT]: DEFAULT_PERSONA_YOU_FILE, // Use You persona\n [COMMAND_RELEASE]: DEFAULT_PERSONA_RELEASER_FILE,\n [COMMAND_REVIEW]: DEFAULT_PERSONA_YOU_FILE, // Use You persona\n [COMMAND_AUDIO_REVIEW]: DEFAULT_PERSONA_YOU_FILE,\n};\n\n// Used by child process to create paths\nexport const DEFAULT_PATH_SEPARATOR = '/';\n\n// Used by util/general for file filtering\nexport const DEFAULT_IGNORE_PATTERNS = [\n 'node_modules/**',\n '**/*.log',\n '.git/**',\n 'dist/**',\n 'build/**',\n 'coverage/**',\n '.DS_Store',\n '*.tmp',\n '*.cache',\n];\n\n// Used by util/storage for directory names\nexport const DEFAULT_DIRECTORY_PREFIX = '.kodrdriv';\n\n// Used by other commands but not exposed in CLI\nexport const INTERNAL_DEFAULT_OUTPUT_FILE = 'output.txt';\n\nexport const INTERNAL_DATETIME_FORMAT = 'YYYY-MM-DD_HH-mm-ss';\n\n// Define defaults in one place\nexport const KODRDRIV_DEFAULTS = {\n dryRun: DEFAULT_DRY_RUN,\n verbose: DEFAULT_VERBOSE,\n debug: DEFAULT_DEBUG,\n overrides: DEFAULT_OVERRIDES,\n model: DEFAULT_MODEL,\n openaiReasoning: DEFAULT_OPENAI_REASONING as 'low' | 'medium' | 'high',\n openaiMaxOutputTokens: DEFAULT_OPENAI_MAX_OUTPUT_TOKENS,\n contextDirectories: DEFAULT_CONTEXT_DIRECTORIES,\n commandName: DEFAULT_COMMAND,\n configDirectory: DEFAULT_CONFIG_DIR,\n outputDirectory: DEFAULT_OUTPUT_DIRECTORY,\n preferencesDirectory: DEFAULT_PREFERENCES_DIRECTORY,\n commit: {\n add: DEFAULT_ADD,\n cached: DEFAULT_CACHED,\n sendit: DEFAULT_SENDIT_MODE,\n interactive: DEFAULT_INTERACTIVE_MODE,\n amend: DEFAULT_AMEND_MODE,\n messageLimit: DEFAULT_MESSAGE_LIMIT,\n skipFileCheck: false,\n maxDiffBytes: DEFAULT_MAX_DIFF_BYTES,\n openaiReasoning: DEFAULT_OPENAI_REASONING as 'low' | 'medium' | 'high',\n openaiMaxOutputTokens: DEFAULT_OPENAI_MAX_OUTPUT_TOKENS,\n },\n release: {\n from: DEFAULT_FROM_COMMIT_ALIAS,\n to: DEFAULT_TO_COMMIT_ALIAS,\n messageLimit: DEFAULT_MESSAGE_LIMIT,\n interactive: DEFAULT_INTERACTIVE_MODE,\n maxDiffBytes: DEFAULT_MAX_DIFF_BYTES,\n noMilestones: false,\n openaiReasoning: DEFAULT_OPENAI_REASONING as 'low' | 'medium' | 'high',\n openaiMaxOutputTokens: DEFAULT_OPENAI_MAX_OUTPUT_TOKENS,\n },\n audioCommit: {\n maxRecordingTime: 300, // 5 minutes default\n audioDevice: undefined, // Auto-detect by default\n openaiReasoning: DEFAULT_OPENAI_REASONING as 'low' | 'medium' | 'high',\n openaiMaxOutputTokens: DEFAULT_OPENAI_MAX_OUTPUT_TOKENS,\n },\n review: {\n includeCommitHistory: true,\n includeRecentDiffs: true,\n includeReleaseNotes: false,\n includeGithubIssues: true,\n commitHistoryLimit: 10,\n diffHistoryLimit: 5,\n releaseNotesLimit: 3,\n githubIssuesLimit: 20,\n sendit: DEFAULT_SENDIT_MODE,\n openaiReasoning: DEFAULT_OPENAI_REASONING as 'low' | 'medium' | 'high',\n openaiMaxOutputTokens: DEFAULT_OPENAI_MAX_OUTPUT_TOKENS,\n },\n audioReview: {\n includeCommitHistory: true,\n includeRecentDiffs: true,\n includeReleaseNotes: false,\n includeGithubIssues: true,\n commitHistoryLimit: 10,\n diffHistoryLimit: 5,\n releaseNotesLimit: 3,\n githubIssuesLimit: 20,\n sendit: DEFAULT_SENDIT_MODE,\n maxRecordingTime: 300, // 5 minutes default\n audioDevice: undefined, // Auto-detect by default\n directory: undefined, // No default directory\n openaiReasoning: DEFAULT_OPENAI_REASONING as 'low' | 'medium' | 'high',\n openaiMaxOutputTokens: DEFAULT_OPENAI_MAX_OUTPUT_TOKENS,\n },\n publish: {\n mergeMethod: DEFAULT_MERGE_METHOD,\n from: DEFAULT_FROM_COMMIT_ALIAS,\n targetVersion: 'patch',\n interactive: DEFAULT_INTERACTIVE_MODE,\n requiredEnvVars: ['GITHUB_TOKEN', 'OPENAI_API_KEY'],\n linkWorkspacePackages: true,\n unlinkWorkspacePackages: true,\n sendit: DEFAULT_SENDIT_MODE,\n targetBranch: 'main',\n noMilestones: false,\n checksTimeout: 3600000, // 1 hour default for PR checks\n releaseWorkflowsTimeout: 1800000, // 30 minutes default for release workflows\n },\n link: {\n scopeRoots: {},\n dryRun: false,\n packageArgument: undefined,\n externals: [],\n },\n unlink: {\n scopeRoots: {},\n workspaceFile: undefined,\n dryRun: false,\n cleanNodeModules: false,\n packageArgument: undefined,\n externals: [],\n },\n tree: {\n directories: undefined,\n exclude: undefined,\n startFrom: undefined,\n stopAt: undefined,\n cmd: undefined,\n\n builtInCommand: undefined,\n continue: false,\n packageArgument: undefined,\n cleanNodeModules: false,\n externals: [],\n },\n development: {\n targetVersion: 'patch',\n noMilestones: false,\n },\n versions: {\n subcommand: undefined,\n directories: undefined,\n },\n updates: {\n scope: undefined,\n directories: undefined,\n },\n excludedPatterns: DEFAULT_EXCLUDED_PATTERNS,\n branches: {\n working: {\n targetBranch: 'main',\n developmentBranch: true,\n version: {\n type: 'prerelease' as const,\n increment: true,\n incrementLevel: 'patch' as const,\n tag: 'dev'\n }\n },\n main: {\n version: {\n type: 'release' as const\n }\n }\n }\n};\n"],"names":["VERSION","PROGRAM_NAME","DEFAULT_OVERRIDES","DATE_FORMAT_YEAR_MONTH_DAY_HOURS_MINUTES_SECONDS_MILLISECONDS","DEFAULT_VERBOSE","DEFAULT_DRY_RUN","DEFAULT_DEBUG","DEFAULT_MODEL","DEFAULT_OPENAI_REASONING","DEFAULT_OPENAI_MAX_OUTPUT_TOKENS","DEFAULT_OUTPUT_DIRECTORY","DEFAULT_GIT_COMMAND_MAX_BUFFER","DEFAULT_CONTEXT_DIRECTORIES","DEFAULT_CONFIG_DIR","DEFAULT_PREFERENCES_DIRECTORY","path","join","os","homedir","DEFAULT_FROM_COMMIT_ALIAS","DEFAULT_TO_COMMIT_ALIAS","DEFAULT_ADD","DEFAULT_CACHED","DEFAULT_SENDIT_MODE","DEFAULT_INTERACTIVE_MODE","DEFAULT_AMEND_MODE","DEFAULT_MESSAGE_LIMIT","DEFAULT_MAX_DIFF_BYTES","DEFAULT_MERGE_METHOD","DEFAULT_EXCLUDED_PATTERNS","COMMAND_COMMIT","COMMAND_AUDIO_COMMIT","COMMAND_SELECT_AUDIO","COMMAND_RELEASE","COMMAND_REVIEW","COMMAND_AUDIO_REVIEW","COMMAND_PUBLISH","COMMAND_TREE","COMMAND_LINK","COMMAND_UNLINK","COMMAND_CLEAN","COMMAND_DEVELOPMENT","COMMAND_VERSIONS","COMMAND_UPDATES","COMMAND_CHECK_CONFIG","COMMAND_INIT_CONFIG","ALLOWED_COMMANDS","DEFAULT_COMMAND","KODRDRIV_DEFAULTS","dryRun","verbose","debug","overrides","model","openaiReasoning","openaiMaxOutputTokens","contextDirectories","commandName","configDirectory","outputDirectory","preferencesDirectory","commit","add","cached","sendit","interactive","amend","messageLimit","skipFileCheck","maxDiffBytes","release","from","to","noMilestones","audioCommit","maxRecordingTime","audioDevice","undefined","review","includeCommitHistory","includeRecentDiffs","includeReleaseNotes","includeGithubIssues","commitHistoryLimit","diffHistoryLimit","releaseNotesLimit","githubIssuesLimit","audioReview","directory","publish","mergeMethod","targetVersion","requiredEnvVars","linkWorkspacePackages","unlinkWorkspacePackages","targetBranch","checksTimeout","releaseWorkflowsTimeout","link","scopeRoots","packageArgument","externals","unlink","workspaceFile","cleanNodeModules","tree","directories","exclude","startFrom","stopAt","cmd","builtInCommand","continue","development","versions","subcommand","updates","scope","excludedPatterns","branches","working","developmentBranch","version","type","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EAAKjC,SAAAA;QAELkC,cAAAA,EAAgBlC,SAAAA;QAChBmC,QAAAA,EAAU,KAAA;QACVZ,eAAAA,EAAiBvB,SAAAA;QACjB2B,gBAAAA,EAAkB,KAAA;AAClBH,QAAAA,SAAAA,EAAW;AACf,KAAA;IACAY,WAAAA,EAAa;QACTtB,aAAAA,EAAe,OAAA;QACflB,YAAAA,EAAc;AAClB,KAAA;IACAyC,QAAAA,EAAU;QACNC,UAAAA,EAAYtC,SAAAA;QACZ6B,WAAAA,EAAa7B;AACjB,KAAA;IACAuC,OAAAA,EAAS;QACLC,KAAAA,EAAOxC,SAAAA;QACP6B,WAAAA,EAAa7B;AACjB,KAAA;IACAyC,gBAAAA,EAAkBzF,yBAAAA;IAClB0F,QAAAA,EAAU;QACNC,OAAAA,EAAS;YACLzB,YAAAA,EAAc,MAAA;YACd0B,iBAAAA,EAAmB,IAAA;YACnBC,OAAAA,EAAS;gBACLC,IAAAA,EAAM,YAAA;gBACNC,SAAAA,EAAW,IAAA;gBACXC,cAAAA,EAAgB,OAAA;gBAChBC,GAAAA,EAAK;AACT;AACJ,SAAA;QACAC,IAAAA,EAAM;YACFL,OAAAA,EAAS;gBACLC,IAAAA,EAAM;AACV;AACJ;AACJ;AACJ;;;;"}
@@ -44,6 +44,9 @@ const __dirname = path__default.dirname(__filename);
44
44
  title: 'Recent GitHub Issues'
45
45
  });
46
46
  }
47
+ // IMPORTANT: Log context provides background but can contaminate output if too large.
48
+ // LLMs tend to pattern-match against recent commits instead of describing the actual diff.
49
+ // Keep messageLimit low (3-5) to minimize contamination. See DEFAULT_MESSAGE_LIMIT in constants.ts
47
50
  if (logContext) {
48
51
  contextItems.push({
49
52
  content: logContext,
@@ -1 +1 @@
1
- {"version":3,"file":"commit.js","sources":["../../src/prompt/commit.ts"],"sourcesContent":["import { Prompt, recipe } from '@riotprompt/riotprompt';\nimport path from 'path';\nimport { fileURLToPath } from 'url';\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = path.dirname(__filename);\n\n// Types for the commit prompt\nexport type Content = {\n diffContent: string;\n userDirection?: string;\n isFileContent?: boolean; // Flag to indicate if diffContent is actually file content\n githubIssuesContext?: string; // GitHub issues related to current version/milestone\n};\n\nexport type Context = {\n logContext?: string;\n context?: string;\n directories?: string[];\n};\n\nexport type Config = {\n overridePaths?: string[];\n overrides?: boolean;\n}\n\n/**\n * Build a commit prompt using RiotPrompt Recipes.\n *\n * This prompt is configured to generate multiline commit messages by default,\n * with separate lines/bullet points for different groups of changes rather\n * than squeezing everything into single lines.\n *\n * @param runConfig The runtime configuration provided by the CLI\n * @param content Mandatory content inputs (e.g. diff)\n * @param ctx Optional contextual inputs configured by the user\n */\nexport const createPrompt = async (\n { overridePaths: _overridePaths, overrides: _overrides }: Config,\n { diffContent, userDirection, isFileContent, githubIssuesContext }: Content,\n { logContext, context, directories }: Context = {}\n): Promise<Prompt> => {\n const basePath = __dirname;\n\n // Build content items for the prompt\n const contentItems = [];\n const contextItems = [];\n\n // Developer Note: Direction is injected first as the highest-priority prompt input\n // This ensures user guidance takes precedence over other context sources like\n // GitHub issues or commit history. Direction content is sanitized via sanitizeDirection()\n // to prevent template breakage (newlines converted to spaces, whitespace normalized,\n // length limited to 2000 chars). See tests/util/validation.test.ts for sanitization behavior\n // and src/commands/commit.ts line 446 for debug logging of direction processing.\n if (userDirection) {\n contentItems.push({ content: userDirection, title: 'User Direction' });\n }\n if (diffContent) {\n const contentTitle = isFileContent ? 'Project Files' : 'Diff';\n contentItems.push({ content: diffContent, title: contentTitle });\n }\n if (githubIssuesContext) {\n contentItems.push({ content: githubIssuesContext, title: 'Recent GitHub Issues' });\n }\n\n if (logContext) {\n contextItems.push({ content: logContext, title: 'Log Context' });\n }\n if (context) {\n contextItems.push({ content: context, title: 'User Context' });\n }\n if (directories && directories.length > 0) {\n contextItems.push({ directories, title: 'Directories' });\n }\n\n return recipe(basePath)\n .persona({ path: 'personas/you.md' })\n .instructions({ path: 'instructions/commit.md' })\n .overridePaths(_overridePaths ?? [])\n .overrides(_overrides ?? true)\n .content(...contentItems)\n .context(...contextItems)\n .cook();\n};\n"],"names":["__filename","fileURLToPath","url","__dirname","path","dirname","createPrompt","overridePaths","_overridePaths","overrides","_overrides","diffContent","userDirection","isFileContent","githubIssuesContext","logContext","context","directories","basePath","contentItems","contextItems","push","content","title","contentTitle","length","recipe","persona","instructions","cook"],"mappings":";;;;AAIA,MAAMA,UAAAA,GAAaC,aAAAA,CAAc,MAAA,CAAA,IAAA,CAAYC,GAAG,CAAA;AAChD,MAAMC,SAAAA,GAAYC,aAAAA,CAAKC,OAAO,CAACL,UAAAA,CAAAA;AAqB/B;;;;;;;;;;AAUC,IACM,MAAMM,YAAAA,GAAe,OACxB,EAAEC,aAAAA,EAAeC,cAAc,EAAEC,SAAAA,EAAWC,UAAU,EAAU,EAChE,EAAEC,WAAW,EAAEC,aAAa,EAAEC,aAAa,EAAEC,mBAAmB,EAAW,EAC3E,EAAEC,UAAU,EAAEC,OAAO,EAAEC,WAAW,EAAW,GAAG,EAAE,GAAA;AAElD,IAAA,MAAMC,QAAAA,GAAWf,SAAAA;;AAGjB,IAAA,MAAMgB,eAAe,EAAE;AACvB,IAAA,MAAMC,eAAe,EAAE;;;;;;;AAQvB,IAAA,IAAIR,aAAAA,EAAe;AACfO,QAAAA,YAAAA,CAAaE,IAAI,CAAC;YAAEC,OAAAA,EAASV,aAAAA;YAAeW,KAAAA,EAAO;AAAiB,SAAA,CAAA;AACxE,IAAA;AACA,IAAA,IAAIZ,WAAAA,EAAa;QACb,MAAMa,YAAAA,GAAeX,gBAAgB,eAAA,GAAkB,MAAA;AACvDM,QAAAA,YAAAA,CAAaE,IAAI,CAAC;YAAEC,OAAAA,EAASX,WAAAA;YAAaY,KAAAA,EAAOC;AAAa,SAAA,CAAA;AAClE,IAAA;AACA,IAAA,IAAIV,mBAAAA,EAAqB;AACrBK,QAAAA,YAAAA,CAAaE,IAAI,CAAC;YAAEC,OAAAA,EAASR,mBAAAA;YAAqBS,KAAAA,EAAO;AAAuB,SAAA,CAAA;AACpF,IAAA;AAEA,IAAA,IAAIR,UAAAA,EAAY;AACZK,QAAAA,YAAAA,CAAaC,IAAI,CAAC;YAAEC,OAAAA,EAASP,UAAAA;YAAYQ,KAAAA,EAAO;AAAc,SAAA,CAAA;AAClE,IAAA;AACA,IAAA,IAAIP,OAAAA,EAAS;AACTI,QAAAA,YAAAA,CAAaC,IAAI,CAAC;YAAEC,OAAAA,EAASN,OAAAA;YAASO,KAAAA,EAAO;AAAe,SAAA,CAAA;AAChE,IAAA;AACA,IAAA,IAAIN,WAAAA,IAAeA,WAAAA,CAAYQ,MAAM,GAAG,CAAA,EAAG;AACvCL,QAAAA,YAAAA,CAAaC,IAAI,CAAC;AAAEJ,YAAAA,WAAAA;YAAaM,KAAAA,EAAO;AAAc,SAAA,CAAA;AAC1D,IAAA;IAEA,OAAOG,MAAAA,CAAOR,QAAAA,CAAAA,CACTS,OAAO,CAAC;QAAEvB,IAAAA,EAAM;AAAkB,KAAA,CAAA,CAClCwB,YAAY,CAAC;QAAExB,IAAAA,EAAM;AAAyB,KAAA,CAAA,CAC9CG,aAAa,CAACC,cAAAA,KAAAA,IAAAA,IAAAA,4BAAAA,cAAAA,GAAkB,EAAE,EAClCC,SAAS,CAACC,uBAAAA,UAAAA,KAAAA,MAAAA,GAAAA,UAAAA,GAAc,MACxBY,OAAO,CAAA,GAAIH,cACXH,OAAO,CAAA,GAAII,cACXS,IAAI,EAAA;AACb;;;;"}
1
+ {"version":3,"file":"commit.js","sources":["../../src/prompt/commit.ts"],"sourcesContent":["import { Prompt, recipe } from '@riotprompt/riotprompt';\nimport path from 'path';\nimport { fileURLToPath } from 'url';\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = path.dirname(__filename);\n\n// Types for the commit prompt\nexport type Content = {\n diffContent: string;\n userDirection?: string;\n isFileContent?: boolean; // Flag to indicate if diffContent is actually file content\n githubIssuesContext?: string; // GitHub issues related to current version/milestone\n};\n\nexport type Context = {\n logContext?: string;\n context?: string;\n directories?: string[];\n};\n\nexport type Config = {\n overridePaths?: string[];\n overrides?: boolean;\n}\n\n/**\n * Build a commit prompt using RiotPrompt Recipes.\n *\n * This prompt is configured to generate multiline commit messages by default,\n * with separate lines/bullet points for different groups of changes rather\n * than squeezing everything into single lines.\n *\n * @param runConfig The runtime configuration provided by the CLI\n * @param content Mandatory content inputs (e.g. diff)\n * @param ctx Optional contextual inputs configured by the user\n */\nexport const createPrompt = async (\n { overridePaths: _overridePaths, overrides: _overrides }: Config,\n { diffContent, userDirection, isFileContent, githubIssuesContext }: Content,\n { logContext, context, directories }: Context = {}\n): Promise<Prompt> => {\n const basePath = __dirname;\n\n // Build content items for the prompt\n const contentItems = [];\n const contextItems = [];\n\n // Developer Note: Direction is injected first as the highest-priority prompt input\n // This ensures user guidance takes precedence over other context sources like\n // GitHub issues or commit history. Direction content is sanitized via sanitizeDirection()\n // to prevent template breakage (newlines converted to spaces, whitespace normalized,\n // length limited to 2000 chars). See tests/util/validation.test.ts for sanitization behavior\n // and src/commands/commit.ts line 446 for debug logging of direction processing.\n if (userDirection) {\n contentItems.push({ content: userDirection, title: 'User Direction' });\n }\n if (diffContent) {\n const contentTitle = isFileContent ? 'Project Files' : 'Diff';\n contentItems.push({ content: diffContent, title: contentTitle });\n }\n if (githubIssuesContext) {\n contentItems.push({ content: githubIssuesContext, title: 'Recent GitHub Issues' });\n }\n\n // IMPORTANT: Log context provides background but can contaminate output if too large.\n // LLMs tend to pattern-match against recent commits instead of describing the actual diff.\n // Keep messageLimit low (3-5) to minimize contamination. See DEFAULT_MESSAGE_LIMIT in constants.ts\n if (logContext) {\n contextItems.push({ content: logContext, title: 'Log Context' });\n }\n if (context) {\n contextItems.push({ content: context, title: 'User Context' });\n }\n if (directories && directories.length > 0) {\n contextItems.push({ directories, title: 'Directories' });\n }\n\n return recipe(basePath)\n .persona({ path: 'personas/you.md' })\n .instructions({ path: 'instructions/commit.md' })\n .overridePaths(_overridePaths ?? [])\n .overrides(_overrides ?? true)\n .content(...contentItems)\n .context(...contextItems)\n .cook();\n};\n"],"names":["__filename","fileURLToPath","url","__dirname","path","dirname","createPrompt","overridePaths","_overridePaths","overrides","_overrides","diffContent","userDirection","isFileContent","githubIssuesContext","logContext","context","directories","basePath","contentItems","contextItems","push","content","title","contentTitle","length","recipe","persona","instructions","cook"],"mappings":";;;;AAIA,MAAMA,UAAAA,GAAaC,aAAAA,CAAc,MAAA,CAAA,IAAA,CAAYC,GAAG,CAAA;AAChD,MAAMC,SAAAA,GAAYC,aAAAA,CAAKC,OAAO,CAACL,UAAAA,CAAAA;AAqB/B;;;;;;;;;;AAUC,IACM,MAAMM,YAAAA,GAAe,OACxB,EAAEC,aAAAA,EAAeC,cAAc,EAAEC,SAAAA,EAAWC,UAAU,EAAU,EAChE,EAAEC,WAAW,EAAEC,aAAa,EAAEC,aAAa,EAAEC,mBAAmB,EAAW,EAC3E,EAAEC,UAAU,EAAEC,OAAO,EAAEC,WAAW,EAAW,GAAG,EAAE,GAAA;AAElD,IAAA,MAAMC,QAAAA,GAAWf,SAAAA;;AAGjB,IAAA,MAAMgB,eAAe,EAAE;AACvB,IAAA,MAAMC,eAAe,EAAE;;;;;;;AAQvB,IAAA,IAAIR,aAAAA,EAAe;AACfO,QAAAA,YAAAA,CAAaE,IAAI,CAAC;YAAEC,OAAAA,EAASV,aAAAA;YAAeW,KAAAA,EAAO;AAAiB,SAAA,CAAA;AACxE,IAAA;AACA,IAAA,IAAIZ,WAAAA,EAAa;QACb,MAAMa,YAAAA,GAAeX,gBAAgB,eAAA,GAAkB,MAAA;AACvDM,QAAAA,YAAAA,CAAaE,IAAI,CAAC;YAAEC,OAAAA,EAASX,WAAAA;YAAaY,KAAAA,EAAOC;AAAa,SAAA,CAAA;AAClE,IAAA;AACA,IAAA,IAAIV,mBAAAA,EAAqB;AACrBK,QAAAA,YAAAA,CAAaE,IAAI,CAAC;YAAEC,OAAAA,EAASR,mBAAAA;YAAqBS,KAAAA,EAAO;AAAuB,SAAA,CAAA;AACpF,IAAA;;;;AAKA,IAAA,IAAIR,UAAAA,EAAY;AACZK,QAAAA,YAAAA,CAAaC,IAAI,CAAC;YAAEC,OAAAA,EAASP,UAAAA;YAAYQ,KAAAA,EAAO;AAAc,SAAA,CAAA;AAClE,IAAA;AACA,IAAA,IAAIP,OAAAA,EAAS;AACTI,QAAAA,YAAAA,CAAaC,IAAI,CAAC;YAAEC,OAAAA,EAASN,OAAAA;YAASO,KAAAA,EAAO;AAAe,SAAA,CAAA;AAChE,IAAA;AACA,IAAA,IAAIN,WAAAA,IAAeA,WAAAA,CAAYQ,MAAM,GAAG,CAAA,EAAG;AACvCL,QAAAA,YAAAA,CAAaC,IAAI,CAAC;AAAEJ,YAAAA,WAAAA;YAAaM,KAAAA,EAAO;AAAc,SAAA,CAAA;AAC1D,IAAA;IAEA,OAAOG,MAAAA,CAAOR,QAAAA,CAAAA,CACTS,OAAO,CAAC;QAAEvB,IAAAA,EAAM;AAAkB,KAAA,CAAA,CAClCwB,YAAY,CAAC;QAAExB,IAAAA,EAAM;AAAyB,KAAA,CAAA,CAC9CG,aAAa,CAACC,cAAAA,KAAAA,IAAAA,IAAAA,4BAAAA,cAAAA,GAAkB,EAAE,EAClCC,SAAS,CAACC,uBAAAA,UAAAA,KAAAA,MAAAA,GAAAA,UAAAA,GAAc,MACxBY,OAAO,CAAA,GAAIH,cACXH,OAAO,CAAA,GAAII,cACXS,IAAI,EAAA;AACb;;;;"}
@@ -1,13 +1,27 @@
1
1
  **🔧 Task Definition**
2
2
 
3
- You are generating a Git commit message based on the content provided below. The content contains several critical sections:
3
+ You are generating a Git commit message that describes **ONLY THE CURRENT DIFF**.
4
4
 
5
- * **\[User Direction]** — When present, this is the PRIMARY guidance for your commit message focus. This describes the motivation, goals, or intent behind the change from the user's perspective. This should be the starting point and main theme of your commit message.
6
- * **\[User Context]** — When present, this provides IMPORTANT additional context about the user's situation, environment, or background that should inform your commit message understanding and approach.
7
- * **\[Diff]** A code diff representing the actual modifications. Analyze this to understand *what* was changed. **THIS IS THE CURRENT CHANGE YOU ARE DESCRIBING** — focus your commit message on explaining these specific modifications.
8
- * **\[Project Files]** — When no diff is available (e.g., in a new repository), this section contains the current project files. Analyze these to understand the project structure and generate an appropriate initial commit message that describes what was added to the repository.
9
- * **\[Recent GitHub Issues]** When present, this contains recently closed GitHub issues, with priority given to issues from milestones matching the current version. **Use this context to understand WHY changes might have been made and to identify which specific issues or features the current changes address.** This helps you provide motivation and context for the changes, especially for large commits that may address multiple issues.
10
- * **\[Log Context]** A short history of recent commit messages. **IMPORTANT: This is provided ONLY for background context and temporal continuity. DO NOT use this to drive your commit message focus or content. DO NOT describe previous commits or reference past changes. Your commit message should describe ONLY the current diff/change.**
5
+ ---
6
+
7
+ ## ⚠️ CRITICAL RULES - READ FIRST
8
+
9
+ 1. **THE DIFF IS YOUR ONLY SOURCE OF TRUTH** - Your commit message must describe ONLY what appears in the `[Diff]` section
10
+ 2. **IGNORE LOG CONTEXT** - Previous commits are shown for background only. DO NOT describe them, reference them, or let them influence your message
11
+ 3. **CITE SPECIFIC FILES** - Every change you mention must reference actual files from the diff (e.g., "Remove post-publish sync logic in src/commands/publish.ts")
12
+ 4. **NO HALLUCINATIONS** - If you mention a change, it MUST exist in the diff. Describing changes not in the diff is a critical failure
13
+ 5. **LENGTH FOLLOWS SCOPE** - Typical commits are 3-6 lines. Very large architectural changes may warrant essay-length messages, but every line must still describe actual changes from the diff
14
+
15
+ ---
16
+
17
+ ## 📋 Input Sections
18
+
19
+ * **\[User Direction]** — When present, use this to understand the user's INTENT, but your commit message must still accurately describe what's in the diff
20
+ * **\[User Context]** — Optional background about the user's environment
21
+ * **\[Diff]** — **THE ONLY SOURCE OF TRUTH** - This shows exactly what changed. Describe ONLY these changes
22
+ * **\[Project Files]** — Only present for new repositories with no diff
23
+ * **\[Recent GitHub Issues]** — Optional context for understanding motivation. Only reference issues if the diff clearly addresses them
24
+ * **\[Log Context]** — **IGNORE THIS** - Previous commit messages shown for background only. DO NOT describe previous commits or copy their language
11
25
 
12
26
  ---
13
27
 
@@ -15,100 +29,105 @@ You are generating a Git commit message based on the content provided below. The
15
29
 
16
30
  ### ✅ DO:
17
31
 
18
- * **PRIORITIZE User Direction**: If `[User Direction]` is provided, make it the central theme and starting point of your commit message. Let it guide the narrative and focus.
19
- * **CONSIDER User Context**: If `[User Context]` is provided, use it to inform your understanding and tailor your commit message appropriately to the user's situation.
20
- * **LEVERAGE GitHub Issues for Context**: If `[Recent GitHub Issues]` is provided, use it to:
21
- - Understand the **motivation** behind changes (why they were made)
22
- - Identify **specific issues** the changes address (e.g., "Fixes #123: authentication timeout")
23
- - Provide better context for **large commits** that may touch multiple areas
24
- - Connect **related changes** to their original requirements or bug reports
25
- - **For smaller commits**: Only reference issues if directly relevant; don't force connections
26
- - **For larger commits**: Use issues to explain the broader context and group related changes
27
- * **FOCUS ON THE CURRENT CHANGE**: Your commit message should describe only what is happening in the current diff or project files — not previous work or future plans. For new repositories with project files, focus on describing what has been initially added.
28
- * Start with a **clear, concise summary** of what was changed and why — grounded in the `User Direction` when present and informed by any `User Context`.
29
- * **ALWAYS GROUP CHANGES INTO SEPARATE LINES**: Break down changes into distinct logical groups, with each group on its own line. Even for simple changes, use multiple lines when there are different types of modifications.
30
- * **USE BULLET POINTS BY DEFAULT**: Format most commit messages with bullet points to clearly separate different groups of changes.
31
- * **Refer to specific changes** seen in the `Diff` or specific files/components in `Project Files`, and explain why those changes matter when it's non-obvious.
32
- * Keep the tone technical and direct — written for a fellow developer who will read this in six months.
32
+ * **Ground every statement in the diff** - Mention specific files that changed (e.g., "Add retry logic to src/api/client.ts")
33
+ * **Start with clear intent** - One line explaining the overall purpose
34
+ * **Use bullet points** - Separate distinct changes into individual bullets
35
+ * **Be specific** - "Remove 68 lines of post-publish sync code" not "Refactor publish flow"
36
+ * **Match length to scope** - Most commits are 3-6 lines. Massive architectural changes can warrant longer, detailed messages when the scope justifies it
37
+ * **Use technical language** - Direct, precise, no fluff
33
38
 
34
39
  ### ❌ DO NOT:
35
40
 
36
- * ❌ **Don't squeeze multiple unrelated changes into a single line** always separate different types of changes.
37
- * ❌ **Don't create single-line commit messages when multiple logical groups exist** use separate lines for each group.
38
- * ❌ Don't describe the project or its general purpose.
39
- * ❌ Don't begin with boilerplate like "This commit includes..." or "The following changes..."
40
- * ❌ Don't use fluffy or celebratory language ("awesome update", "great enhancement").
41
- * ❌ Don't end with vague statements like "improves experience" unless clearly supported by the change.
42
- * ❌ Don't use markdown formatting the output should be plain text only.
43
- * ❌ **Don't reference or describe previous commits from the log context** — focus only on the current change.
44
- * ❌ **Don't let the log context influence your commit message content** — it's background information only.
45
- * ❌ **Don't continue themes or patterns from previous commits** unless they're directly relevant to the current diff.
41
+ * ❌ **NEVER describe changes not in the diff** - This is the #1 failure mode
42
+ * ❌ **NEVER reference log context** - Don't describe "this continues previous work" or similar
43
+ * ❌ **NEVER use vague language** - "Improve", "refactor", "enhance" without specifics
44
+ * ❌ **NEVER write multi-paragraph essays** - Keep it concise
45
+ * ❌ **NEVER mention test changes unless they're significant** - Focus on production code
46
+ * ❌ **NEVER use markdown** - Plain text only
47
+ * ❌ **NEVER begin with "This commit..."** - Just describe what changed
46
48
 
47
49
  ---
48
50
 
49
- ## 📝 OUTPUT STRUCTURE
51
+ ## 📝 OUTPUT FORMATS & EXAMPLES
50
52
 
51
- ### ✅ DEFAULT FORMAT: Multiline with Bullet Points
53
+ ### ✅ GOOD: Concise with file citations (3-6 lines)
52
54
 
53
- **PREFERRED FORMAT** - Use this for most changes, even relatively simple ones:
55
+ > Remove post-publish branch sync and version bump automation
56
+ >
57
+ > * Delete 68 lines of merge/version-bump code from src/commands/publish.ts (lines 1039-1106)
58
+ > * Replace with simple completion message and manual next-steps guidance
59
+ > * Add verbose logging to git tag search in src/util/git.ts for debugging
54
60
 
55
- * A **summary line** describing the overall intent
56
- * **Bullet points** for each distinct group of changes
57
- * Each bullet should represent a different logical area (files, functionality, configuration, tests, etc.)
61
+ **Why this is good:** Specific files, line counts, describes what actually changed
58
62
 
59
- #### Example:
63
+ ---
60
64
 
61
- > Refactor session handling to use new getUserProfile API
62
- >
63
- > * Switch from parseUser() to getUserProfile() in session.ts
64
- > * Update session schema validation in auth.ts
65
- > * Remove legacy parsing logic from user-utils.ts
66
- > * Update related tests in session.test.ts
65
+ ### GOOD: Single atomic change (1 line)
67
66
 
68
- #### Example with GitHub Issues Context:
67
+ > Fix typo in error message for invalid credentials in src/auth/validator.ts
69
68
 
70
- > Fix authentication timeout and improve session handling (addresses #145, #167)
71
- >
72
- > * Increase session timeout from 30min to 2hrs in config.ts (fixes #145)
73
- > * Add automatic token refresh logic in auth-service.ts (fixes #167)
74
- > * Update error handling for expired sessions in middleware.ts
75
- > * Add tests for extended session scenarios in auth.test.ts
69
+ **Why this is good:** One file, one change, specific
76
70
 
77
71
  ---
78
72
 
79
- ### ✅ For Single, Atomic Changes Only
80
-
81
- **ONLY use a single line when the change is truly atomic** - affecting one function in one file with one clear purpose:
73
+ ### ✅ GOOD: Multiple related changes (4-7 lines)
82
74
 
83
- #### Example:
75
+ > Add retry logic for API timeout errors
76
+ >
77
+ > * Implement exponential backoff in src/api/client.ts
78
+ > * Add max retry configuration to src/config/api.ts
79
+ > * Update error handling in src/api/error-handler.ts to detect retryable errors
80
+ > * Add retry tests in tests/api/client.test.ts
84
81
 
85
- > Fix typo in error message for invalid user credentials
82
+ **Why this is good:** Grounded in actual files, specific changes, concise
86
83
 
87
84
  ---
88
85
 
89
- ### For Complex or Multi-Part Changes
86
+ ### BAD: Hallucinated changes (DO NOT DO THIS)
87
+
88
+ > Centralize ref-detection and streamline publish flow
89
+ >
90
+ > * Move to single ref-detection approach and stop passing from/to into Log.create()
91
+ > * Replace ad-hoc fromRef/toRef handling in src/commands/release.ts
92
+ > * Scale diff context: DEFAULT_MAX_DIFF_BYTES now 20480
93
+ > * Update tests to mock new git boundary
94
+ > * Update docs/public/commands/publish.md
90
95
 
91
- For larger changes with significant architectural implications:
96
+ **Why this is terrible:** These changes aren't in the diff! The LLM is describing previous commits from log context instead of the actual diff. This is the #1 failure mode to avoid.
92
97
 
93
- * A **summary paragraph** describing the overall intent
94
- * One or two **detail paragraphs** focusing on key aspects or trade-offs
95
- * **Bullet points** to call out specific files, tools, or changes
98
+ ---
96
99
 
97
- #### Example:
100
+ ### ❌ BAD: Verbose multi-paragraph essay (DO NOT DO THIS)
98
101
 
99
102
  > Reorganize pipeline logic to improve readability and make phase execution more testable. This is part of ongoing work to modularize transition handling.
100
103
  >
101
104
  > The main change separates phase node execution into its own module, reduces reliance on shared state, and simplifies test construction. Existing functionality remains unchanged, but internal structure is now better aligned with future transition plugin support.
102
105
  >
106
+ > This commit represents a significant cleanup of the execution flow and provides a safer foundation for future operations.
107
+ >
103
108
  > * Extract executePhaseNode() from pipeline.ts
104
109
  > * Add phase-runner.ts with dedicated error handling
105
- > * Update tests in phase.test.ts for new isolation boundaries
106
- > * Refactor shared state management in core.ts
110
+ > ...
111
+
112
+ **Why this is terrible:** Way too verbose (could be 3 lines), fluffy language, unnecessary context paragraphs
107
113
 
108
114
  ---
109
115
 
110
- ## 🧾 Final Note
116
+ ### BAD: Vague without file citations (DO NOT DO THIS)
117
+
118
+ > Improve error handling and refactor configuration logic
119
+
120
+ **Why this is terrible:** No specific files, vague verbs like "improve" and "refactor", no details
121
+
122
+ ---
123
+
124
+ ## 🎯 Length Guidelines
125
+
126
+ * **Single change:** 1 line
127
+ * **Typical commit:** 3-6 lines (summary + 2-5 bullets)
128
+ * **Large commit:** 6-15 lines
129
+ * **Major architectural change:** Essay-length if warranted (rare but valid)
111
130
 
112
- **DEFAULT TO MULTILINE**: When in doubt, use bullet points to separate different types of changes. This makes commit messages much more scannable and helps reviewers understand the scope of each change group. Only use single-line messages for truly atomic, single-purpose changes.
131
+ **There is no hard upper limit.** The constraint is not length - it's **accuracy**. Every line must describe actual changes from the diff.
113
132
 
114
- Match your output to the **scope and complexity** of the change, but favor clarity and separation over brevity. Your audience is technical and time-constrained give them clear, well-organized information they can quickly scan.
133
+ Write as much as you need to accurately describe the changes, but no more. A 50-line commit message is fine if the diff touches 30 files and restructures core systems. A 6-line commit message that describes changes not in the diff is a critical failure, regardless of its brevity.
@@ -1,12 +1,16 @@
1
- Task #1: Write release notes by reading all of the log messages from this release and writing a summary of the release.
1
+ ## ⚠️ CRITICAL RULES - READ FIRST
2
2
 
3
- Task #2: Provide a detailed list of changes involved in this release, and make sure that the release notes are directly related to the content in the log messages.
3
+ 1. **LOG MESSAGES ARE YOUR SOURCE OF TRUTH** - Every change you describe must come from actual commit messages in the `[Log Context]` section or issues in `[Resolved Issues from Milestone]`
4
+ 2. **NO HALLUCINATIONS** - Do not invent features, fixes, or changes that aren't explicitly mentioned in the log messages or milestone issues
5
+ 3. **CITE ACTUAL COMMITS** - When describing changes, refer to what's in the actual commit messages, not what you think should be there
6
+ 4. **USE RELEASE FOCUS FOR FRAMING** - The `[Release Focus]` guides how you frame and emphasize changes, but doesn't add new changes not in the logs
7
+ 5. **LENGTH FOLLOWS SCOPE** - Small releases get concise notes. Large releases deserve comprehensive documentation. Match the actual scope of changes in the log
4
8
 
5
- Task #3: Use the content in the Release Focus section as the PRIMARY GUIDE for writing the release notes and to help make connections with people, projects, issues, features, and other information. The Release Focus should heavily influence the tone, emphasis, and structure of your release notes.
9
+ ---
6
10
 
7
- Task #4: If there is a "Resolved Issues from Milestone" section, use this information to significantly enhance your release notes. These are well-documented issues that were resolved in this release. Include the important changes from these issues in your release notes, and make sure to reference the issue numbers. Milestone issues represent significant work that users care about and should be prominently featured in the release notes.
11
+ ## Your Task
8
12
 
9
- **IMPORTANT**: If you see a "Release Size Context" indicating this is a LARGE RELEASE, you should provide comprehensive, detailed release notes that thoroughly document all changes. For large releases, be extensive rather than brief - users need to understand the full scope of changes. Don't just summarize - dive deep into the details, organize changes into meaningful groups, and explain the impact of major changes.
13
+ Write release notes by reading all commit messages in `[Log Context]` and milestone issues in `[Resolved Issues from Milestone]`. Every change you mention must be traceable to an actual commit message or resolved issue.
10
14
 
11
15
  ### Output Format
12
16
 
@@ -91,19 +95,19 @@ Create release notes that:
91
95
 
92
96
  3. **Use clear, factual bullet points** under each section. Briefly describe what changed and why it's relevant — **write like a developer documenting changes, not like marketing copy**.
93
97
 
98
+ **CRITICAL**: Every bullet point must be traceable to actual commit messages in `[Log Context]` or issues in `[Resolved Issues from Milestone]`. If a change isn't in the log, don't mention it.
99
+
94
100
  **For large releases**: Provide detailed bullet points that explain:
95
- - What specifically changed
101
+ - What specifically changed (cite actual commit messages)
96
102
  - Why the change was made (if evident from commit messages or issue descriptions)
97
- - Impact on users or developers
98
- - Related files or components affected (when relevant)
103
+ - Impact on users or developers (based on commit/issue context)
104
+ - Related files or components affected (when mentioned in commits)
99
105
 
100
- Avoid vague or exaggerated terms like:
101
- * "awesome new feature"
102
- * "significant boost"
103
- * "exciting changes"
104
- * "revolutionary update"
105
- * "streamlined workflow"
106
- * "enhanced user experience"
106
+ **DO NOT**:
107
+ * Invent features not mentioned in commits
108
+ * Describe changes that "should" be there but aren't in the log
109
+ * Use vague or exaggerated marketing terms like "awesome new feature", "significant boost", "revolutionary update", "streamlined workflow", "enhanced user experience"
110
+ * Group unrelated commits under theme names that aren't in the actual commits
107
111
 
108
112
  4. **Keep your tone technical, neutral, and useful.** It's okay to include references to:
109
113
 
@@ -121,22 +125,64 @@ Create release notes that:
121
125
 
122
126
  ---
123
127
 
128
+ ## Anti-Examples: What NOT to Do
129
+
130
+ ### ❌ BAD: Hallucinated Changes
131
+
132
+ **Problem**: The release notes describe features that aren't in any commit message:
133
+
134
+ ```json
135
+ {
136
+ "title": "Major Performance Overhaul and API Redesign",
137
+ "body": "**Performance Improvements**\\n\\n* Reduced API response times by 60% through query optimization\\n* Implemented connection pooling for database efficiency\\n* Added Redis caching layer for frequently accessed data\\n\\n**API Redesign**\\n\\n* Completely redesigned REST API with versioning support\\n* Migrated all endpoints to new authentication system"
138
+ }
139
+ ```
140
+
141
+ **Why it's terrible**: None of these changes appear in the commit log. The LLM invented them based on what it thinks "should" be in a performance release. This is a critical failure even if the notes sound good.
142
+
143
+ ---
144
+
145
+ ### ❌ BAD: Vague Marketing Fluff
146
+
147
+ **Problem**: Generic marketing language instead of specific commit-based changes:
148
+
149
+ ```json
150
+ {
151
+ "title": "Enhanced User Experience and Streamlined Workflows",
152
+ "body": "This exciting release brings revolutionary improvements to the user experience! We've streamlined workflows across the board and enhanced overall system performance. Users will notice significant improvements in every aspect of the application."
153
+ }
154
+ ```
155
+
156
+ **Why it's terrible**: No specific changes, no commit references, pure marketing fluff. Completely useless to developers.
157
+
158
+ ---
159
+
124
160
  ## Output Format Examples
125
161
 
126
- ### Example for a Large Release:
162
+ ### GOOD: Grounded in Actual Commits
163
+
164
+ **Scenario**: Log contains commits about removing post-publish sync, adding verbose logging, and fixing a config bug
127
165
 
128
166
  ```json
129
167
  {
130
- "title": "Configuration System Overhaul and Developer Tooling v2.1.0",
131
- "body": "This release represents a comprehensive overhaul of the configuration system, developer tooling, and testing infrastructure. Based on the Release Focus of modernizing the development workflow and addressing long-standing technical debt, this release includes significant architectural changes, new developer features, and extensive improvements to code quality and maintainability.\\n\\n**Configuration System Overhaul**\\n\\n* Completely redesigned configuration loading system with support for environment-specific overrides\\n* Unified `vite.config.ts`, `webpack.config.js`, and `rollup.config.js` into a single environment-aware configuration module\\n* Added support for `.env.defaults`, `.env.local`, and `.env.production` files with proper precedence handling\\n* Implemented configuration validation with detailed error messages for missing or invalid settings\\n* Migrated from legacy JSON-based config to TypeScript-based configuration with full type safety\\n\\n**New Features**\\n\\n* Added comprehensive CLI argument parsing with support for nested configuration options\\n* Implemented hot-reloading development server with automatic dependency injection\\n* Added support for custom build plugins with a new plugin API\\n* Created new debugging tools including request/response logging and performance profiling\\n* Added automated code formatting and linting with pre-commit hooks\\n\\n**Developer Experience Improvements**\\n\\n* Reduced config nesting depth in `tsconfig.json` to improve readability and maintainability\\n* Updated all development scripts to use the new unified configuration system\\n* Added comprehensive error handling with stack traces and helpful troubleshooting suggestions\\n* Implemented automatic workspace package linking and unlinking for monorepo development\\n* Created new developer documentation with step-by-step setup instructions\\n\\n**Testing Infrastructure**\\n\\n* Migrated entire test suite from Jest to Vitest for better ES module support\\n* Added comprehensive integration tests for the new configuration system\\n* Implemented end-to-end testing with Playwright for critical user workflows\\n* Added test coverage reporting with detailed branch and function coverage metrics\\n* Created performance benchmarks for build times and memory usage\\n\\n**Bug Fixes**\\n\\n* Fixed critical crash in config loader when optional fields were undefined or null\\n* Resolved issue with `yarn build` failing on Windows due to missing path escaping\\n* Fixed memory leak in development server during file watching operations\\n* Corrected TypeScript compilation errors in strict mode for legacy code\\n* Fixed race condition in parallel test execution causing intermittent failures\\n\\n**Breaking Changes**\\n\\n* Removed support for legacy `.env.local.js` files - migrate to `.env.local`\\n* Changed default output directory from `dist/` to `build/` for consistency\\n* Updated minimum Node.js version requirement to 18.0.0\\n* Deprecated `--legacy-config` flag - will be removed in next major version\\n\\n**Documentation Updates**\\n\\n* Completely rewrote setup instructions in `README.md` to reflect new configuration process\\n* Added comprehensive API documentation with examples for all configuration options\\n* Created troubleshooting guide for common development environment issues\\n* Added migration guide for users upgrading from previous versions\\n* Updated all code examples to use the new configuration system"
168
+ "title": "Simplify publish flow and improve git tag debugging",
169
+ "body": "**Workflow Changes**\\n\\n* Remove automatic branch sync and version bump from publish flow - users now manually run `kodrdriv development` to continue work after publish\\n* Simplify publish completion to show next steps instead of auto-syncing\\n\\n**Debugging Improvements**\\n\\n* Add extensive logging to git tag detection in `getDefaultFromRef()` to diagnose tag search issues\\n* Add emoji indicators and structured output for tag search process\\n\\n**Bug Fixes**\\n\\n* Fix config validation error when optional field was missing"
132
170
  }
133
171
  ```
134
172
 
135
- ### Example for a Simple Release:
173
+ **Why it's good**: Every bullet point traces to an actual commit. Specific file references. No invented features.
174
+
175
+ ---
176
+
177
+ ### ✅ GOOD: Large Release with Detail
178
+
179
+ **Scenario**: 30 commits touching configuration system, tests, docs, and CLI
136
180
 
137
181
  ```json
138
182
  {
139
- "title": "Simplified Configuration and Windows Build Fixes v1.2.1",
140
- "body": "This release focuses on simplifying the configuration system and removing deprecated environment-specific files. Based on the Release Focus of improving developer onboarding and standardizing build behavior, the team prioritized changes that reduce friction for new developers and standardize build behavior across local and CI environments.\\n\\n**Improvements**\\n\\n* Unified `vite.config.ts` and `webpack.config.js` into a single environment-aware module\\n* Reduced config nesting depth in `tsconfig.json` to improve readability\\n* Updated CI scripts to use `.env.defaults` instead of `.env.local`\\n\\n**Bug Fixes**\\n\\n* Fixed crash in config loader when optional fields were undefined\\n* Resolved issue with `yarn build` failing on Windows due to missing path escape\\n\\n**Documentation Updates**\\n\\n* Rewrote setup instructions in `README.md` to reflect unified config process\\n* Removed legacy instructions for `env.local.js`"
183
+ "title": "Configuration System Overhaul and Testing Migration",
184
+ "body": "This release modernizes the configuration system and migrates the test suite based on accumulated technical debt and developer feedback.\\n\\n**Configuration System Changes**\\n\\n* Unify vite.config.ts and webpack.config.js into single environment-aware module\\n* Add support for .env.defaults with proper precedence handling\\n* Implement config validation with detailed error messages\\n* Reduce tsconfig.json nesting depth for readability\\n\\n**Testing Infrastructure**\\n\\n* Migrate test suite from Jest to Vitest for better ES module support\\n* Add integration tests for configuration system\\n* Implement coverage reporting with branch and function metrics\\n\\n**Bug Fixes**\\n\\n* Fix crash in config loader when optional fields undefined\\n* Resolve Windows build failure due to missing path escaping\\n* Fix race condition in parallel test execution\\n\\n**Breaking Changes**\\n\\n* Remove support for legacy .env.local.js files\\n* Change default output directory from dist/ to build/\\n* Require Node.js 18.0.0 or higher\\n\\n**Documentation**\\n\\n* Rewrite setup instructions in README.md for new config process\\n* Add migration guide for users upgrading from previous versions"
141
185
  }
142
186
  ```
187
+
188
+ **Why it's good**: Comprehensive coverage of a large release, but every change is grounded in actual commits. No fluff, just facts.