Task summary
The README documents {{message}} as a template variable available for custom prompt templates, but it's marked as "(reserved)" and never actually implemented. Wire it through the template substitution system so users can reference the previous commit message context in their custom prompts.
Why this is a good first issue
Self-contained feature that touches the existing template substitution pipeline. Teaches how TemplateVars, prompt resolution, and config flow work. The variable is already documented, so this closes a gap between docs and implementation.
Suggested files or areas
src/types.ts — Add message field to TemplateVars interface
src/llm/prompt.ts — Add {{message}} to getAvailableTemplateVars(), handle substitution
src/llm/client.ts — In generateSuggestions(), resolve the previous commit message and pass it through vars
src/git/diff.ts — Add a helper to get the latest commit message (e.g., git log -1 --format=%s)
Acceptance criteria
Extra context
TemplateVars is defined in src/llm/prompt.ts with fields: diff, profile, branch
substituteTemplateVars() already handles {{diff}}, {{profile}}, {{branch}} — follow the same pattern
resolveSystemPrompt() and resolveUserPrompt() accept TemplateVars
- See
src/git/diff.ts for existing git helpers — getBranchName() is a good reference for adding getLastCommitMessage()
Task summary
The README documents
{{message}}as a template variable available for custom prompt templates, but it's marked as "(reserved)" and never actually implemented. Wire it through the template substitution system so users can reference the previous commit message context in their custom prompts.Why this is a good first issue
Self-contained feature that touches the existing template substitution pipeline. Teaches how
TemplateVars, prompt resolution, and config flow work. The variable is already documented, so this closes a gap between docs and implementation.Suggested files or areas
src/types.ts— Addmessagefield toTemplateVarsinterfacesrc/llm/prompt.ts— Add{{message}}togetAvailableTemplateVars(), handle substitutionsrc/llm/client.ts— IngenerateSuggestions(), resolve the previous commit message and pass it throughvarssrc/git/diff.ts— Add a helper to get the latest commit message (e.g.,git log -1 --format=%s)Acceptance criteria
{{message}}is listed ingetAvailableTemplateVars()output (shown in--help)systemPromptTemplateoruserPromptTemplatecontains{{message}}, it is replaced with the previous commit's subject line{{message}}resolves to an empty stringnpm run buildpasses with no errorsExtra context
TemplateVarsis defined insrc/llm/prompt.tswith fields:diff,profile,branchsubstituteTemplateVars()already handles{{diff}},{{profile}},{{branch}}— follow the same patternresolveSystemPrompt()andresolveUserPrompt()acceptTemplateVarssrc/git/diff.tsfor existing git helpers —getBranchName()is a good reference for addinggetLastCommitMessage()