-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add gittai package #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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-reviewfor AI code review andgittaifor 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.
| case '-h': | ||
| printUsage(); | ||
| exit(0); | ||
| default: |
Copilot
AI
Nov 24, 2025
There was a problem hiding this comment.
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.
| headSha: mrInfo.headSha, | ||
| positionType: 'text', | ||
| newPath: comment.position.filePath, | ||
| newLine: String(comment.position.startLine), |
Copilot
AI
Nov 24, 2025
There was a problem hiding this comment.
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.
| exit(0); | ||
| default: |
Copilot
AI
Nov 24, 2025
There was a problem hiding this comment.
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.
| case '--help': | ||
| case '-h': | ||
| printUsage(); | ||
| (0, process_1.exit)(0); | ||
| default: |
Copilot
AI
Nov 24, 2025
There was a problem hiding this comment.
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.
| --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) |
Copilot
AI
Nov 24, 2025
There was a problem hiding this comment.
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.
- project: @thdk/gittai 0.1.0-pr-8b84100.0
- project: @thdk/gittai 0.1.0
- project: @thdk/gittai 0.2.0-pr-c04b3d0.0
- project: @thdk/gittai 0.2.0-pr-1ad020c.0
This reverts commit c04b3d0.
- project: @thdk/gittai 0.2.0-pr-79002fe.0
- project: @thdk/gittai 0.2.0-pr-5e707c1.0
- project: @thdk/gittai 0.2.0-pr-71d225e.0
No description provided.