スキル一覧に戻る
mariodavid

domain-analyzer

by mariodavid

Terminal-based Jira time tracking CLI tool built with TypeScript and Ink

0🍴 0📅 2026年1月12日
GitHubで見るManusで実行

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 + comment
  • IssueKey - Issue keys, aliases, grouping
  • WeekRange - Calendar week periods
  • WorklogGroup - Issue collections with shared settings

Analysis Rules

🚨 DOMAIN_VIOLATION: Primitive Obsession Detection

Trigger when finding:

  1. String dates instead of LocalDate:

    // BAD: Primitive obsession
    function processDate(date: string) // ISO date string
    
    // GOOD: Rich domain type
    function processDate(date: LocalDate)
    
  2. String durations instead of Duration:

    // BAD: Primitive obsession
    function logTime(hours: string) // "2h30m"
    
    // GOOD: Rich domain type
    function logTime(duration: Duration)
    
  3. 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)
    
  4. Calculations outside domain objects:

    // BAD: Anemic domain - logic in services
    const totalHours = calculateWeeklyHours(worklogs)
    
    // GOOD: Rich domain - behavior in objects
    const totalHours = weeklyWorklog.getTotalHours()
    
  5. 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

  1. Examine changed files for primitive types
  2. Identify business logic scattered in utilities
  3. Detect domain concepts represented as primitives
  4. Check for validation logic outside domain objects
  5. 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.

スコア

総合スコア

50/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です