Skip to content

Commit b447097

Browse files
tobixenclaude
andcommitted
ci: set up ai-prompt-auto-commit pre-commit hooks
Adds the pycalendar/ai-prompt-auto-commit hooks so that Claude Code prompts are automatically appended to commit messages. - unstage-ai-prompts: keeps .prompts/ out of the index - append-ai-prompts (prepare-commit-msg): injects prompts into message - archive-ai-prompts (post-commit): moves .prompts/ to committed/ - prepare-ai-repository (manual): one-time setup already run Also installs prepare-commit-msg and post-commit git hooks locally. prompt: ~/.claude/skills/python-project-modernization.md is now updated with the https://github.com/pycalendar/ai-prompt-auto-commit tool. Please fix set this up for the caldav repo. AI-generated: This is considered to be CI-infrastructure, one of the areas identified to be particularly suitable for AI assistance. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 13daaa2 commit b447097

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

.claude/settings.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"hooks": {
3+
"UserPromptSubmit": [
4+
{
5+
"hooks": [
6+
{
7+
"id": "ai-prompt-auto-commit",
8+
"type": "command",
9+
"command": "input=$(cat); ts=$(date +%Y-%m-%dT%H-%M-%S); model=$(printf '%s' \"$input\" | jq -r '.model // \"claude-sonnet-4-6\"'); printf '%s' \"$input\" | jq -r '.prompt' > \".prompts/${ts}_${model}.md\""
10+
}
11+
]
12+
}
13+
]
14+
}
15+
}

.pre-commit-config.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,17 @@ repos:
1414
- id: trailing-whitespace
1515
- id: end-of-file-fixer
1616

17+
- repo: https://github.com/pycalendar/ai-prompt-auto-commit
18+
rev: v0.0.5
19+
hooks:
20+
- id: unstage-ai-prompts
21+
- id: append-ai-prompts
22+
stages: [prepare-commit-msg]
23+
- id: archive-ai-prompts
24+
stages: [post-commit]
25+
- id: prepare-ai-repository
26+
stages: [manual]
27+
1728
- repo: https://github.com/compilerla/conventional-pre-commit
1829
rev: v3.4.0
1930
hooks:

0 commit comments

Comments
 (0)