Skip to content

feat: add gitai review command for AI-powered pre-commit code review#28

Merged
artback merged 8 commits intomainfrom
claude/gitai-feature-recommendation-DnHDB
Mar 10, 2026
Merged

feat: add gitai review command for AI-powered pre-commit code review#28
artback merged 8 commits intomainfrom
claude/gitai-feature-recommendation-DnHDB

Conversation

@artback
Copy link
Copy Markdown
Owner

@artback artback commented Mar 9, 2026

Add feature proposal that extends gitai's existing diff analysis and AI
provider infrastructure to provide actionable code review feedback before
committing. Reuses ~70% of existing code (providers, diff engine, TUI,
config) for a natural workflow extension.

https://claude.ai/code/session_01UnxEijRJMKmRmR4BJ9QqCQ

…eview

Add feature proposal that extends gitai's existing diff analysis and AI
provider infrastructure to provide actionable code review feedback before
committing. Reuses ~70% of existing code (providers, diff engine, TUI,
config) for a natural workflow extension.

https://claude.ai/code/session_01UnxEijRJMKmRmR4BJ9QqCQ
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 9, 2026

claude added 7 commits March 9, 2026 20:37
Implement a new `review` command that analyzes diffs using AI and returns
structured code review findings (critical/warning/info) with line references
and concrete fix suggestions.

New files:
- internal/ai/review.go: ReviewService, Finding, ReviewResult types
- internal/ai/review_prompt.md: system prompt for code review
- internal/tui/review/review_flow.go: TUI flow with spinner + results viewer
- cmd/review.go: Cobra command with --format, --hint flags
- Tests for parsing, formatting, and grouping logic

Supports interactive TUI mode (default) and JSON output (--format json).

https://claude.ai/code/session_01UnxEijRJMKmRmR4BJ9QqCQ
Use t.Skip instead of t.Fatal when tiktoken can't download encoding
data, since this test has a network dependency.

https://claude.ai/code/session_01UnxEijRJMKmRmR4BJ9QqCQ
Adds a `claudecli` provider that wraps the `claude` CLI binary,
allowing users with a Claude Code Max subscription to use gitai
without a separate API key.

Usage: gitai suggest --provider=claude

https://claude.ai/code/session_01UnxEijRJMKmRmR4BJ9QqCQ
- Change DefaultModel from "gemini-3-flash" to "gemini-3-flash-preview"
- Wrap exec.LookPath errors with ErrCommandFailed so tests pass
- Fix test expectation typo ("gemini-3-flash-preview-preview")

https://claude.ai/code/session_01UnxEijRJMKmRmR4BJ9QqCQ
- Replace fmt.Errorf with errors.New for constant error strings (SA1006)
- Use stdout.String() instead of string(stdout.Bytes()) (S1030)
- Remove nil checks before pointer use to fix SA5011
- Wrap json.MarshalIndent error in review_flow.go (wrapcheck)
- Suppress unparam for resolveRelativePaths error return

https://claude.ai/code/session_01UnxEijRJMKmRmR4BJ9QqCQ
Document the new AI-powered code review command, including usage
examples for targeted files, hints, and output format options.

https://claude.ai/code/session_01UnxEijRJMKmRmR4BJ9QqCQ
@artback artback changed the title docs: propose gitai review command for AI-powered pre-commit code review feat: add gitai review command for AI-powered pre-commit code review Mar 10, 2026
@artback artback merged commit 3822775 into main Mar 10, 2026
2 checks passed
@artback artback deleted the claude/gitai-feature-recommendation-DnHDB branch March 10, 2026 05:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants