/kargnas-skills:git-lorefrom kargnas-skills
Captures, queries, and configures decision context in native Git trailers. Routes commit writing and history queries through one skill for non-trivial commits, decisions, rejected alternatives, and PR summaries.
Ships in kargnas-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Preserve decision context beside code by using Git's native commit trailers. Route commit writing and history queries through one skill.
The commit message is the only record. Never write Lore data to git notes, extra refs or branches, or tracked files, and never link a commit to an outside conversation record.
| Request | Mode |
|---|---|
| Write or perform a non-trivial commit | Commit mode |
| Find decisions, constraints, rejected options, directives, follow-ups, verification gaps, or other Lore data in history | Query mode |
| Check earlier decisions before changing existing code | Query mode |
| Summarize a branch's decisions for a pull request description | Query mode |
| Configure Lore rules in project or global agent instructions | Setup mode |
Repository instructions remain authoritative. Lore supplements existing commit-message rules; it does not replace Conventional Commits, language rules, or repository-specific formats.
Everyone who can read the repository can read a commit message, and a pushed message cannot be taken back. Write every part of it in your own words, from the outcome of the work:
Tested: names the check and its result, not its output.git commit with the completed message and report the commit hash. If the user requested only a message draft, return the draft without running Git.Skip the body Shape and the Lore trailers for typo-only, formatting-only, or other trivial commits with no decision context.
Shape shows the change from outside, for a reviewer who has not read the diff yet. Pick the one or two forms that say the most, never two that tell the same thing. Start every Shape line with - so Git never parses it as a trailer.
| Form | Use it for | Line format |
|---|---|---|
| Before/after | A fix, a new default, or a rule that now says yes or no | - <case>: <before> → <after>, at most 8 lines |
| Interface | A changed command, flag, exported function, config key, or stored field reached from outside the module | - <item>: <before> → <after>, — for nothing |
| Example | One concrete case with real values; a new or changed command or flag always gets one | - <input> → <result> |
| Steps | Logic that stays inside one module | - 1. <step>, naming the functions and files |
Skip Shape for a change nobody would notice from outside (a refactor or a rename), for release or version bumps, lockfiles, and CHANGELOG updates, and for changes of fewer than 5 lines.
Decision: names who decided. user: the user chose it. agreed: the user explicitly approved a proposal; a proposal the user did not answer is not a decision. agent: a technical choice made within the task. Add it only for a choice that a future modifier could reverse.Rejected: lists only options that the user or the agent actually considered before the decision: named in the discussion, tried, or measured. Never infer an alternative from the decision, never list the current state as one, and never add durations, sizes, or reasons that the work does not support. A postponed option is not rejected; record it as Follow-up: when it stays open.| Trailer | Content |
|---|---|
Decision: | Choice, reason, and who decided, as choice | reason | user, agreed, or agent |
Constraint: | External limit that shaped the decision |
Rejected: | Rejected alternative and reason as alternative | reason |
Confidence: | high, medium, or low |
Scope-risk: | narrow, moderate, or broad |
Reversibility: | clean, moderate, or difficult |
Directive: | Warning or prerequisite for future modifiers |
Tested: | Verification that ran |
Not-tested: | Known verification gap |
Follow-up: | Work that came up and stays open; end it with (needs user) when its next step needs the user's decision or action |
Related: | Related commit hash or decision chain |
Trailers are optional and repeatable. Add a custom trailer only when the repository has a recurring query need for it.
<repository-compliant summary>
<Intent: the goal and why this approach>
<optional Shape lines, each starting with "- ">
Decision: <choice> | <reason> | <user | agreed | agent>
Constraint: <external limit>
Rejected: <alternative> | <reason>
Confidence: <high | medium | low>
Scope-risk: <narrow | moderate | broad>
Reversibility: <clean | moderate | difficult>
Directive: <future warning>
Tested: <verification>
Not-tested: <known gap>
Follow-up: <open work> (needs user)
Related: <commit>
Example:
Rotate refresh tokens on use
A leaked refresh token kept working until it expired. Each refresh now
issues a new token pair and revokes the used token.
- refresh token reused: accepted → whole token family revoked
- second refresh from another tab within 30 s: accepted → accepted
Decision: Keep a used token valid for 30 seconds | two tabs refresh at the same time | agreed
Rejected: Shorten the token lifetime | signs people out too often
Tested: Auth refresh unit tests (12/12 pass)
Follow-up: Add a revocation count to the auth dashboard (needs user)
Configure agent instructions so future sessions write Lore trailers without requiring this skill to be invoked for each commit.
| Agent CLI | Project | Global |
|---|---|---|
| Claude Code | CLAUDE.md or AGENTS.md | ~/.claude/CLAUDE.md |
| Codex CLI | AGENTS.md | ~/.codex/AGENTS.md |
| Kimi Code | AGENTS.md | ~/.agents/AGENTS.md |
| Qwen Code | QWEN.md | ~/.qwen/QWEN.md |
| Universal fallback | AGENTS.md | ~/.agents/AGENTS.md |
Ask which agent the user uses only when it cannot be detected. Read the target first. If it already has a Lore section, do not add a duplicate; when that section differs from the block below, show the difference and ask before replacing it.
Append this block:
## Commit Messages: Lore Format
For non-trivial changes, write a repository-compliant summary that names the
resulting change. Use an imperative phrase. Add a body with the goal and why
this approach. When a reviewer would notice the change from outside, add a few
lines that start with "- " and show it (before → after, a changed interface,
or one example). Then append only useful Git trailers:
- Decision: choice, reason, and who decided (user, agreed, or agent), separated by vertical bars
- Constraint: external limit that shaped the decision
- Rejected: alternative actually considered before the decision, and reason, separated by a vertical bar
- Confidence: high, medium, or low
- Scope-risk: narrow, moderate, or broad
- Reversibility: clean, moderate, or difficult
- Directive: warning or prerequisite for future modifiers
- Tested: verification that ran
- Not-tested: known verification gap
- Follow-up: work that stays open, ending with "(needs user)" when its next step needs the user
- Related: linked commit or decision chain
Trailers are optional and repeatable. Skip them for typo-only, formatting-only, and other trivial commits.
Write every part in your own words. Never put conversation text, prompts,
session IDs, chat links, secrets, personal data, file contents, or raw command
output in a commit message.
Before a non-trivial change to existing code, read the Directive, Constraint,
and Decision trailers on the paths you will change. Change a user or agreed
decision only with the user's approval.
After writing, report the target path. For project scope, remind the user that the instruction file should be committed.
Treat this mode as read-only. Never amend, rebase, or otherwise rewrite history. Read only commit messages.
| User phrase | Trailer |
|---|---|
| 결정, decision | Decision |
| 제약조건, constraints | Constraint |
| 리젝, rejected | Rejected |
| 디렉티브, directive | Directive |
| 후속, 남은 일, follow-up | Follow-up |
| 미테스트, not-tested | Not-tested |
| 테스트, tested | Tested |
| 신뢰도, confidence | Confidence |
| 범위위험, scope-risk | Scope-risk |
| 가역성, reversibility | Reversibility |
| 관련, related | Related |
Treat an unrecognized name as a custom trailer. Preserve it exactly except for one trailing colon. Use it only when it matches [A-Za-z][A-Za-z0-9-]*; otherwise ask for the trailer name, because the name becomes part of a --grep pattern.
For one trailer, run:
git log -n 20 --all --grep="^TRAILER:" --format="%h %s%n%b" -- [PATH]
Replace TRAILER with the mapped name. Omit -- [PATH] when no path was requested. Pass the path as a quoted argument; do not build or execute a shell string from user input. Repeat --grep to match any of several trailers.
For example, query rejected alternatives under src/auth/ with:
git log -n 20 --all --grep="^Rejected:" --format="%h %s%n%b" -- "src/auth/"
For a summary, run:
git log -n 20 --all --format="%h %s%n%b" -- [PATH]
Keep commits containing known Lore trailers. Default to 20 commits unless the user specifies another limit.
Before a non-trivial change to existing code, query the paths you will change:
git log -n 20 --grep="^Directive:" --grep="^Constraint:" --grep="^Decision:" --format="%h %s%n%b" -- [PATH]...
This reads only the current branch's history, because a decision on an unmerged branch does not bind this code. Follow the directives and constraints you find. Change a user or agreed decision only with the user's approval, and say which commit recorded it.
Use the pull request's base branch as BASE; without one, use the remote's default branch. Run:
git log --reverse --format="%h %s%n%b" "BASE..HEAD"
Write the description from those messages only:
## Goal
<one or two sentences merged from the commits' Intent>
## Decisions
- <choice>: <reason> (<who decided>) `<hash>`
- Rejected: <alternative>: <reason>
## Open
- <Follow-up or Not-tested> `<hash>`
Omit a section that has no entries. List commits without Lore trailers under ## Commits without recorded decisions only when they change more than formatting or versions.
Group by commit and show the short hash, summary, and matching trailer lines:
a1b2c3d Prevent silent session drops
Constraint: Auth service does not support token introspection
Directive: Verify upstream behavior before narrowing 4xx handling
State clearly when no matching trailers exist.
This skill adapts the commit, query, and setup workflows from tmdgusya/lora at revision eed689c27adbf9dab3f13c07ad3d95b217ed1454. The upstream README declares MIT.
The Intent, Shape, decision owner, rejected-option, follow-up, and pull request summary rules adapt ideas from erensrtky/cogit at revision 151b25e209555f6e288c7217c02b7fb969df14c2 (MIT). cogit keeps its record outside the branch history; this skill keeps the same information in the commit message. See THIRD_PARTY_NOTICES.md.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
npx claudepluginhub kargnas/skills --plugin kargnas-skills13 skills in this plugin
/ai-readyUse only when the user asks to make the repo AI-ready or AI-optimized (AGENTS.md migration, debugging/testing setup, docs). Do not run on your own./humanizer-kill-gptRuns a cross-language cleanup for writing tells shared by large frontier LLMs, not only GPT: English source constructs that survive other language translation and language-surface translationese. Use only when the user asks to remove AI/GPT tells from text (de-GPT, GPT 티, AI 티, 번역체 GPT, 자폐 말투 — colloquial shorthand for rigid or over-complete model prose, not a claim about autism)./minimal-frontendA default fallback design system for app UI and standalone HTML report pages, covering theme tokens, type and density scale, status colors, container-first responsive rules, anti-slop, and accessibility./minimal-patch-with-subagentsMinimal patching workflow that debates fix options across parallel independent subagents and applies the smallest safe diff. Use only when you want risk-free code, and to code real minimal that only needs to fix the issue./oss-finderFinds battle-tested open-source repos, libraries, frameworks, CLI tools, or code on GitHub, ranked by README polish-days instead of stars. Also the shared GitHub code-search backend toolkit — rotating PAT pool, grep.app, Blackbird web index, BigQuery/GHArchive, and the code-search fallback chain. Use for 'find a library/framework/tool for X', 'battle-tested repo', GitHub-wide code search, or when `gh search code` rate-limits. Finding installable SKILL.md agent-skill packages goes to the skill-finder skill (it delegates its GitHub sweep here)./report-long-workReports work that an agent finished (a migration, a cutover, a cleanup, a long autonomous task) to a reader who was not there, as an HTML page with node graphs of what changed and in which order, a to-do list for the reader, verification results, and an image of every destructive action. Covers saving the records while the work runs, checking the page, sharing it in a chat channel as paste-ready text with images, and a single-file HTML export. Use when a report is due at the end of agent-run work, or on 이 작업 끝나고 정리해줘.