Skip to content

Bug: LLM Template Commit Message Generation Issue #20

@jwalsh

Description

@jwalsh

Bug: LLM Template System for Generating Conventional Commits

Context

We're building a structured learning system for engineering tools using LLM templates for documentation and knowledge management. Key components:

  • Sequential guides (60-74 series) for tool progression
  • Standardized documentation and commit messages via templates
  • Documentation structure in .guides/

Current templates:

llm templates list
conventional-commit  # Standard format
git-commit          # Simplified version
commit              # Legacy version

Issue

LLM templates fail to generate conventional commit messages from git diffs:

  1. Templates return placeholder text instead of processing diff content
  2. Input piping fails across all template variants (conventional-commit, git-commit, commit)

Expected Behavior

Template should parse git diff and generate semantic commit messages following conventional commit format:

  • Parse added/modified files
  • Determine scope from changed components
  • Generate descriptive message based on changes

Minimal Reproduction Repository

mkdir llm-lab-issue-commit-template && cd llm-lab-issue-commit-template
git init

# Setup baseline
echo "# LLM Template Testing" > README.md
git add README.md && git commit -m "Initial commit"

# Add test files
cat << 'EOF' > .gitignore
# Python
__pycache__/
*.py[cod]
*.so
.Python
.venv/
.uv/
build/
dist/
*.egg-info/

# Environment
.env
.direnv/
config/

# Keep docs
!*.org
!docs/*.md
EOF

cat << 'EOF' > create-guides.sh
#!/usr/bin/env bash
declare -A guides=(
    [60]="llm"
    [61]="kubectl"
    [62]="uv"
)
mkdir -p .guides
for num in "${!guides[@]}"; do
    name="${guides[$num]}"
    dirname=".guides/${num}-${name}"
    mkdir -p "$dirname"
    llm --template org-template -p tool="$name" --log > "${dirname}/README.org"
done
EOF
chmod +x create-guides.sh

Issue

Template generation not producing expected commit message format:

# Create template
llm template --system "Generate a Conventional Commit message from git diff input. Format: type(scope): description" --save git-commit -x

# Test commit message generation
git add .
git diff --cached > diff.txt && llm -t git-commit < diff.txt

Current output: type(scope): description
Expected output: feat(tools): add gitignore and guide generator script

/cc @jwalsh

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds-reviewRequires review from maintainers

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions