Add attribution templates and CLI --co-author flag support#242
Open
aviadshiber wants to merge 2 commits intomainfrom
Open
Add attribution templates and CLI --co-author flag support#242aviadshiber wants to merge 2 commits intomainfrom
aviadshiber wants to merge 2 commits intomainfrom
Conversation
…LI flag
Kapsis used to append its own attribution block to every commit regardless
of what Claude Code already added via its native `attribution.commit`
setting — causing duplicated or inconsistent attribution depending on
whether Claude or Kapsis made the commit.
Now Kapsis injects `attribution.commit` and `attribution.pr` into
`~/.claude/settings.local.json` so Claude writes the attribution itself,
and the host-side commit detects the signature and skips duplicates. For
non-Claude agents (codex, gemini, aider), Kapsis continues to append the
same template via `KAPSIS_ATTRIBUTION_COMMIT` env var.
Default attribution is now a markdown-linked `[Generated by Kapsis](...)`
that renders as a clickable link on GitHub. Supports `{version}`,
`{agent_id}`, `{branch}`, `{worktree}` placeholders. Empty string disables
attribution entirely.
Also adds a `--co-author "Name <email>"` CLI flag (repeatable) that merges
with co-authors from config. Existing dedup in `build_coauthor_trailers`
handles duplicates across config/CLI/git user/commit message.
https://claude.ai/code/session_018mdcbzthMYwuwE3fC66y2R
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds support for customizable git attribution templates and a new
--co-authorCLI flag to Kapsis. Attribution templates allow agents to customize how they sign commits and PR descriptions, with placeholder substitution for version, agent ID, branch, and worktree. The CLI flag enables users to add co-authors directly from the command line, which merge with config-defined co-authors.Type of Change
Changes Made
Core Features
Attribution Templates: Added
git.attribution.commitandgit.attribution.prconfig options with support for placeholders ({version},{agent_id},{branch},{worktree})~/.claude/settings.local.jsonas native Claude settingsCLI --co-author Flag: New repeatable
--co-author "Name <email>"flag inlaunch-agent.sh<email>with@symbol)build_coauthor_trailers()Implementation Details
launch-agent.sh:
CLI_CO_AUTHORSarray to track CLI-provided co-authors--co-authorarguments inparse_args()parse_config(){version},{agent_id},{branch}) earlypost-container-git.sh:
commit_changes()to useKAPSIS_ATTRIBUTION_COMMITfrom environment{worktree}placeholder at commit timeentrypoint.sh:
post_exit_git()to use templated attribution from environmentinject-status-hooks.sh:
attribution.commitandattribution.prDocumentation
CONFIG-REFERENCE.mdwith attribution template documentation and examplesGIT-WORKFLOW.mdwith new commit message format and attribution behaviorclaude.yamlexample config with attribution templatesTesting
Checklist
Additional Notes
attributionkey use sensible defaultsparse_config()except for{worktree}which ishttps://claude.ai/code/session_018mdcbzthMYwuwE3fC66y2R