Skip to content

Commit 0fdf07c

Browse files
authored
feat(git-ai): add Git AI plugin to marketplace (#153)
Add Git AI plugin with three skills (ask, git-ai-search, prompt-analysis) installed via skills.sh. Update marketplace.json, README, and release-please-config with the new plugin entry.
1 parent 862d4fb commit 0fdf07c

8 files changed

Lines changed: 1168 additions & 0 deletions

File tree

.claude-plugin/marketplace.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,14 @@
576576
"keywords": ["pdf", "extraction", "parsing", "markdown", "rag"],
577577
"tags": ["skill", "document"],
578578
"source": "./plugins/edgeparse"
579+
},
580+
{
581+
"name": "git-ai",
582+
"description": "A Git extension for tracking the AI-generated code in your repos",
583+
"category": "development",
584+
"keywords": ["git-ai", "git", "ai", "code-tracking"],
585+
"tags": ["tooling", "git"],
586+
"source": "./plugins/git-ai"
579587
}
580588
]
581589
}

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,11 @@ Extract structured content from any PDF — headings, tables, paragraphs, lists,
287287

288288
**Install:** `/plugin install edgeparse@pleaseai` | **Source:** [plugins/edgeparse](https://github.com/pleaseai/claude-code-plugins/tree/main/plugins/edgeparse)
289289

290+
#### Git AI
291+
A Git extension for tracking the AI-generated code in your repos.
292+
293+
**Install:** `/plugin install git-ai@pleaseai` | **Source:** [plugins/git-ai](https://github.com/pleaseai/claude-code-plugins/tree/main/plugins/git-ai)
294+
290295
## Quick Start
291296

292297
The fastest way to get started — install the marketplace and let the plugin recommender auto-detect what you need:
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
---
2+
name: ask
3+
description: "Use this when you are exploring the codebase. It lets you ask the AI who wrote code questions about how things work and why they chose to build things the way they did. Think of it as asking the engineer who wrote the code for help understanding it."
4+
argument-hint: "[a question to the AI who authored the code you're looking at]"
5+
allowed-tools: ["Bash(git-ai:*)", "Read", "Glob", "Grep", "Task"]
6+
---
7+
8+
# Ask Skill
9+
10+
Answer questions about AI-written code by finding the original prompts and conversations that produced it, then **embodying the author agent's perspective** to answer.
11+
12+
## Main Agent's Job (you)
13+
14+
You do the prep work, then hand off to a **fast, tightly scoped subagent**:
15+
16+
1. **Resolve the file path and line range** — check these sources in order:
17+
18+
**a) Editor selection context (most common).** When the user has lines selected in their editor, a `<system-reminder>` is injected into the conversation like:
19+
```
20+
The user selected the lines 2 to 4 from /path/to/file.rs:
21+
_flush_logs(args: &[String]) {
22+
flush::handle_flush_logs(args);
23+
}
24+
```
25+
Extract the file path and line range directly from this. This is the primary way users will invoke `/ask` — they select code, then type something like "/ask why is this like that" without naming the file or lines.
26+
27+
**b) Explicit file/line references** — "on line 42", "lines 10-50 of src/main.rs" → use directly.
28+
29+
**c) Named symbol** — mentions a variable/function/class → Read the file, find where it's defined, extract line numbers.
30+
31+
**d) File without line specifics** → whole file (omit `--lines`).
32+
33+
**e) No file, no lines, no selection context, no identifiable code reference** → Do NOT attempt to guess or search. Just reply:
34+
> Select some code or mention a specific file/symbol, then `/ask` your question.
35+
36+
Stop here. Do not spawn a subagent.
37+
38+
2. **Spawn one subagent** with the template below. Use `max_turns: 4`.
39+
40+
3. **Relay the answer** to the user. That's it.
41+
42+
## Subagent Configuration
43+
44+
```
45+
Task tool settings:
46+
subagent_type: "general-purpose"
47+
max_turns: 4
48+
```
49+
50+
The subagent gets **only** `Bash` and `Read`. It does NOT get Glob, Grep, or Task. It runs at most 4 turns — this is a fast lookup, not a research project.
51+
52+
## Choosing Between `blame --show-prompt` and `search`
53+
54+
**If you want to read an entire file or range of lines AND the corresponding prompts behind them, use `git-ai blame --show-prompt`.** This is better than `search` for this use case — it gives you every line's authorship plus the full prompt JSON in one call.
55+
56+
```
57+
# Get blame + prompts for a line range (pipe to get prompt dump appended):
58+
git-ai blame src/commands/blame.rs -L 23,54 --show-prompt | cat
59+
60+
# Interactive (TTY) mode shows prompt hashes inline:
61+
# 7a4471d (cursor [abc123e] 2026-02-06 14:20:05 -0800 23) code_here
62+
63+
# Piped mode appends raw prompt messages after a --- separator:
64+
# ---
65+
# Prompt [abc123e]
66+
# [{"type":"user","text":"Write a function..."},{"type":"assistant","text":"Here is..."}]
67+
```
68+
69+
Use `git-ai search` when you need to find prompts by **commit**, **keyword**, or when you don't have a specific file/line range in mind.
70+
71+
## Subagent Prompt Template
72+
73+
Fill in `{question}`, `{file_path}`, and `{start}-{end}` (omit LINES if not applicable):
74+
75+
```
76+
You are answering a question about code by finding the original AI conversation
77+
that produced it. You will embody the author agent's perspective — first person,
78+
as the agent that wrote the code.
79+
80+
QUESTION: {question}
81+
FILE: {file_path}
82+
LINES: {start}-{end}
83+
84+
You have exactly 3 steps. Do them in order, then stop.
85+
86+
STEP 1 — Search (one command):
87+
Run: git-ai search --file {file_path} --lines {start}-{end} --verbose
88+
If no results, try ONE fallback: git-ai search --file {file_path} --verbose
89+
That's it. Do not run more than 2 git-ai commands total.
90+
91+
STEP 2 — Read the code (one Read call):
92+
Read {file_path} (focus on lines {start}-{end})
93+
94+
STEP 3 — Answer:
95+
Using the transcript from Step 1 and the code from Step 2, answer the
96+
question AS THE AUTHOR in first person:
97+
- "I wrote this because..."
98+
- "The problem I was solving was..."
99+
- "I chose X over Y because..."
100+
101+
Format:
102+
- **Answer**: Direct answer in the author's voice
103+
- **Original context**: What the human asked for and why
104+
- **Date(s)**: Dates, Human Author where this feature was worked on.
105+
106+
If no transcript was found, say so clearly: "I couldn't find AI conversation
107+
history for this code — it may be human-written or predate git-ai setup."
108+
In that case, analyze the code objectively (not first person).
109+
110+
HARD CONSTRAINTS:
111+
- Do NOT use Glob, Grep, or Task tools. You only have Bash and Read.
112+
- Do NOT run more than 2 git-ai commands.
113+
- Do NOT read .claude/, .cursor/, .agents/, or any agent log directories.
114+
- Do NOT search JSONL transcripts or session logs directly.
115+
- All conversation data comes from `git-ai search` only.
116+
```
117+
118+
When the user's question doesn't reference specific lines, omit `--lines` from Step 1 and the `LINES:` field.
119+
120+
## Fallback Behavior
121+
122+
When no prompt data is found:
123+
- The code might be human-written or predate git-ai
124+
- Answer from the code alone, clearly stating no AI history was found
125+
- Do NOT use first-person author voice in fallback — analyze objectively
126+
127+
## Example Invocations
128+
129+
**User selects lines 10-25 in editor, types: `/ask why is this like that`**
130+
Selection context is in system-reminder → extract file + lines 10-25, spawn subagent. This is the most common usage pattern.
131+
132+
**`/ask why does this function use recursion instead of iteration?`**
133+
Main agent finds the function definition, extracts file/lines, spawns subagent.
134+
135+
**`/ask what problem was being solved on lines 100-150 of src/main.rs?`**
136+
File and lines explicit — spawn subagent directly.
137+
138+
**`/ask why was this approach chosen over using a HashMap?`**
139+
Main agent identifies relevant code from context, spawns subagent.
140+

0 commit comments

Comments
 (0)