feat: auto-commit after task completion in task loop #192

Closed
opened 2026-03-06 09:39:06 -08:00 by hikari · 0 comments
Owner

Overview

Inspired by get-shit-done (GSD)'s atomic git commits per task, this adds an optional auto-commit feature to the Task Loop (#183) — automatically committing completed task work before advancing to the next task.

The Problem: Lost Context

Without atomic commits, a long autonomous task run produces a single large diff with no meaningful history. If something goes wrong mid-run, it's hard to identify which task introduced the issue or to roll back selectively.

Feature Details

Behaviour

When auto-commit is enabled and a task completes successfully:

  1. Claude runs git add -A in the working directory
  2. Claude commits with a generated message based on the task title
  3. The task is marked complete and the loop advances
  4. If the git commit fails (e.g. nothing to commit, git not initialised), the task is still marked complete and the loop advances — the commit failure is logged but non-blocking

Commit Message Format

Auto-generated commit messages follow conventional commit format:

feat: <task title>

Auto-committed by Hikari Task Loop
Task ID: <task-id>
Loop session: <session-timestamp>

Configuration Options

In the Task Loop panel settings:

  • Auto-commit toggle (off by default)
  • Commit message prefix — customise the conventional commit type (feat/fix/chore/etc.)
  • Include task summary — optionally append Claude's task summary to the commit body
  • Sign commits — use the configured git signing key (respects existing git config)

SUMMARY.md Generation

Before committing, optionally ask Claude to write a brief SUMMARY.md (or append to an existing one) describing:

  • What was implemented
  • Key decisions made
  • Files changed
  • Any caveats or follow-up work

This SUMMARY.md is then included in the commit and can update STATE.md in the Project Context Panel (#188).

Safety Guardrails

  • Auto-commit only triggers on task success, never on error
  • Prompts user for confirmation if there are unexpected file changes (files outside the working directory)
  • Can be paused at any time without affecting current task

Acceptance Criteria

  • Auto-commit toggle available in Task Loop settings
  • Successful tasks trigger git add -A + git commit in the working directory
  • Commit message follows conventional commit format with task metadata
  • Git failures are logged but non-blocking (loop still advances)
  • SUMMARY.md generation is optional and configurable
  • Commit message prefix is customisable
  • Only triggers on successful task completion, never on error
  • Tests written for commit message generation logic

This issue was created with help from Hikari~ 🌸

## Overview Inspired by [get-shit-done (GSD)](https://github.com/gsd-build/get-shit-done)'s **atomic git commits per task**, this adds an optional **auto-commit** feature to the Task Loop (#183) — automatically committing completed task work before advancing to the next task. ## The Problem: Lost Context Without atomic commits, a long autonomous task run produces a single large diff with no meaningful history. If something goes wrong mid-run, it's hard to identify which task introduced the issue or to roll back selectively. ## Feature Details ### Behaviour When auto-commit is enabled and a task completes successfully: 1. Claude runs `git add -A` in the working directory 2. Claude commits with a generated message based on the task title 3. The task is marked complete and the loop advances 4. If the git commit fails (e.g. nothing to commit, git not initialised), the task is still marked complete and the loop advances — the commit failure is logged but non-blocking ### Commit Message Format Auto-generated commit messages follow conventional commit format: ``` feat: <task title> Auto-committed by Hikari Task Loop Task ID: <task-id> Loop session: <session-timestamp> ``` ### Configuration Options In the Task Loop panel settings: - **Auto-commit** toggle (off by default) - **Commit message prefix** — customise the conventional commit type (feat/fix/chore/etc.) - **Include task summary** — optionally append Claude's task summary to the commit body - **Sign commits** — use the configured git signing key (respects existing git config) ### SUMMARY.md Generation Before committing, optionally ask Claude to write a brief `SUMMARY.md` (or append to an existing one) describing: - What was implemented - Key decisions made - Files changed - Any caveats or follow-up work This SUMMARY.md is then included in the commit and can update STATE.md in the Project Context Panel (#188). ### Safety Guardrails - Auto-commit only triggers on task `success`, never on `error` - Prompts user for confirmation if there are unexpected file changes (files outside the working directory) - Can be paused at any time without affecting current task ## Acceptance Criteria - [ ] Auto-commit toggle available in Task Loop settings - [ ] Successful tasks trigger `git add -A` + `git commit` in the working directory - [ ] Commit message follows conventional commit format with task metadata - [ ] Git failures are logged but non-blocking (loop still advances) - [ ] SUMMARY.md generation is optional and configurable - [ ] Commit message prefix is customisable - [ ] Only triggers on successful task completion, never on error - [ ] Tests written for commit message generation logic ✨ This issue was created with help from Hikari~ 🌸
naomi closed this issue 2026-03-07 03:08:34 -08:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: nhcarrigan/hikari-desktop#192