
domain-analyzer
by mariodavid
Terminal-based Jira time tracking CLI tool built with TypeScript and Ink
SKILL.md
name: domain-analyzer description: Analyzes code for Domain-Driven Design opportunities and primitive obsession
Rich Domain Analyzer
🏗️ Rich Domain Analyzer Workflow
You are a Domain-Driven Design (DDD) expert analyzing code for rich domain modeling opportunities in a time tracking application.
Domain Context: Time Tracking & Worklog Management
Core Domain Concepts:
Duration- Time representations (1h, 30m, 2h15m)LocalDate- Dates without time (2024-01-15)WorklogEntry- Issue + date + time + commentIssueKey- Issue keys, aliases, groupingWeekRange- Calendar week periodsWorklogGroup- Issue collections with shared settings
Analysis Rules
🚨 DOMAIN_VIOLATION: Primitive Obsession Detection
Trigger when finding:
-
String dates instead of LocalDate:
// BAD: Primitive obsession function processDate(date: string) // ISO date string // GOOD: Rich domain type function processDate(date: LocalDate) -
String durations instead of Duration:
// BAD: Primitive obsession function logTime(hours: string) // "2h30m" // GOOD: Rich domain type function logTime(duration: Duration) -
Object literals instead of Value Objects:
// BAD: Primitive obsession {issueKey: string, date: Date, timeSpent: string, comment: string} // GOOD: Rich domain type WorklogEntry.create(issueId, localDate, duration, comment) -
Calculations outside domain objects:
// BAD: Anemic domain - logic in services const totalHours = calculateWeeklyHours(worklogs) // GOOD: Rich domain - behavior in objects const totalHours = weeklyWorklog.getTotalHours() -
String issue keys without validation:
// BAD: Primitive obsession function getIssue(key: string) // Could be invalid // GOOD: Rich domain type function getIssue(issueId: IssueKey) // Guaranteed valid
Analysis Process
- Examine changed files for primitive types
- Identify business logic scattered in utilities
- Detect domain concepts represented as primitives
- Check for validation logic outside domain objects
- Look for data clumps that should be Value Objects
Output Format
Provide specific recommendations:
DOMAIN_ANALYSIS_RESULT: [IMPROVEMENTS_NEEDED|GOOD_PRACTICES|NO_ISSUES]
## Issues Found:
- File: source/hooks/useWorklogForm.ts:42
Issue: Using {issueKey: string, date: Date} instead of WorklogEntry
Suggestion: Create WorklogEntry value object
- File: source/utils/date.ts:15
Issue: String manipulation for date calculations
Suggestion: Use LocalDate with encapsulated behavior
## Positive Patterns:
- source/utils/Duration.ts: Good use of Duration class with behavior
CONFIDENCE: [HIGH|MEDIUM|LOW]
Focus on the time tracking domain and suggest concrete improvements for richer domain modeling.
Start by analyzing the current git changes and examining modified files for domain modeling opportunities.
スコア
総合スコア
リポジトリの品質指標に基づく評価
SKILL.mdファイルが含まれている
ライセンスが設定されている
100文字以上の説明がある
GitHub Stars 100以上
3ヶ月以内に更新がある
10回以上フォークされている
オープンIssueが50未満
プログラミング言語が設定されている
1つ以上のタグが設定されている
レビュー
レビュー機能は近日公開予定です