Skip to content

Conversation

@thdk
Copy link
Owner

@thdk thdk commented Nov 24, 2025

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new @thdk/gittai package for GitLab AI-powered code review automation. The package provides:

  • AI-powered code review using Anthropic's Claude via direct API calls (TypeScript version) or MCP integration (JavaScript version)
  • Automated posting of review comments to GitLab merge requests
  • TypeScript schemas for type-safe validation using Zod
  • CLI tools for both reviewing code and posting comments

Key changes:

  • New package with complete TypeScript configuration and Jest setup
  • Schema definitions for review results with Zod validation
  • GitLab client wrapper with authentication support
  • Two CLI scripts: gittai-review for AI code review and gittai for posting comments

Reviewed changes

Copilot reviewed 40 out of 43 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tsconfig.json Root TypeScript configuration with package reference
tsconfig.base.json Base TypeScript compiler options for all packages
packages/gittai/package.json Package configuration with dependencies and bin entries
packages/gittai/tsconfig.*.json Package-specific TypeScript configurations
packages/gittai/src/lib/schemas/review-result.schema.ts Zod schemas for review result validation
packages/gittai/src/lib/review-agent.ts AI code review implementation using Anthropic SDK
packages/gittai/src/lib/review-agent.js Alternative MCP-based review implementation
packages/gittai/src/lib/gitlab-client.ts GitLab client factory with auth support
packages/gittai/src/lib/gitlab-reviewer.ts Comment posting logic for GitLab MRs
packages/gittai/src/scripts/review-code.ts CLI script for AI code review
packages/gittai/src/scripts/review-code.js Alternative JavaScript CLI with MCP config
packages/gittai/src/scripts/post-review-comments.ts CLI script for posting comments
packages/gittai/src/index.ts Main package exports
packages/gittai/README.md Package documentation
Configuration files Jest, ESLint, example files

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 77 to 80
case '-h':
printUsage();
exit(0);
default:
Copy link

Copilot AI Nov 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing break statement after exit(0) on line 91. Although exit(0) will terminate the process, a break statement should be added for code clarity and to prevent fallthrough if the exit call is ever removed or modified. Add break; after line 91.

Copilot uses AI. Check for mistakes.
headSha: mrInfo.headSha,
positionType: 'text',
newPath: comment.position.filePath,
newLine: String(comment.position.startLine),
Copy link

Copilot AI Nov 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The newLine field is converted to a string using String(), but GitLab API documentation and the @gitbeaker/rest types may expect a number. Verify the correct type with the GitLab API specification. If a number is expected, remove the String() conversion to pass comment.position.startLine directly.

Copilot uses AI. Check for mistakes.
Comment on lines 59 to 60
exit(0);
default:
Copy link

Copilot AI Nov 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing break statement after exit(0) on line 59. Although exit(0) terminates the process, a break statement should be added for consistency and code clarity. Add break; after line 59.

Copilot uses AI. Check for mistakes.
Comment on lines 88 to 92
case '--help':
case '-h':
printUsage();
(0, process_1.exit)(0);
default:
Copy link

Copilot AI Nov 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing break statement after exit(0) on line 91. Add break; after line 91 for code consistency and to prevent potential fallthrough issues.

Copilot uses AI. Check for mistakes.
--repo-path <path> Path to git repository (default: current directory)
--skip-patterns <patterns> Comma-separated patterns to skip (e.g., '*.lock,dist/*')
--api-key <key> Anthropic API key (default: ANTHROPIC_API_KEY env)
--model <name> Model to use (default: claude-3-5-sonnet-20241022)
Copy link

Copilot AI Nov 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The TypeScript and JavaScript versions of this file use different implementations (direct Anthropic SDK vs MCP-based) and different default models ('claude-3-5-sonnet-20241022' in TS vs 'claude-sonnet-4-20250514' in JS). This inconsistency could confuse users and maintainers. Consider consolidating to a single implementation or clearly documenting why two versions exist.

Copilot uses AI. Check for mistakes.
Github Action and others added 4 commits November 25, 2025 05:34
- project: @thdk/gittai 0.1.0-pr-8b84100.0
- project: @thdk/gittai 0.1.0
Github Action and others added 7 commits November 25, 2025 08:35
- project: @thdk/gittai 0.2.0-pr-c04b3d0.0
- project: @thdk/gittai 0.2.0-pr-1ad020c.0
- project: @thdk/gittai 0.2.0-pr-79002fe.0
Github Action and others added 3 commits November 25, 2025 13:00
- project: @thdk/gittai 0.2.0-pr-5e707c1.0
- project: @thdk/gittai 0.2.0-pr-71d225e.0
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