@eldrforge/ai-service 0.1.15 → 0.1.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1627,36 +1627,59 @@ async function runAgenticCommit(config) {
1627
1627
  };
1628
1628
  }
1629
1629
  function buildSystemPrompt$2(toolGuidance) {
1630
- return `You are an expert software engineer tasked with generating meaningful commit messages.
1630
+ return `You are a professional software engineer writing commit messages for your team.
1631
1631
 
1632
1632
  ${toolGuidance}
1633
1633
 
1634
- ## Investigation Strategy
1634
+ ## Your Task
1635
1635
 
1636
- For simple changes (1-3 files, obvious purpose):
1637
- - Use 1-2 tools: get_recent_commits to avoid duplicates, get_related_tests if logic changed
1636
+ Write a commit message that clearly explains what changed and why. Your message should help teammates understand the changes without needing to read the diff.
1638
1637
 
1639
- For moderate changes (4-10 files, clear theme):
1640
- - Use 2-4 tools: group_files_by_concern, get_file_content for key files, get_recent_commits, get_related_tests
1638
+ Think about:
1639
+ - What problem does this solve?
1640
+ - How do the changes work together?
1641
+ - What should reviewers focus on?
1642
+ - Are there any important implications?
1641
1643
 
1642
- For complex changes (10+ files, or unclear purpose):
1643
- - Use 4-6 tools: group_files_by_concern, get_file_history, get_file_content for key files, get_file_dependencies, get_related_tests, search_codebase
1644
+ Use the available tools to investigate the changes. The more you understand, the better your message will be.
1644
1645
 
1645
- Always use tools to understand context - don't rely only on the diff.
1646
+ **Important**: If additional context is provided (from context files or other sources), use your judgment:
1647
+ - If the context is relevant to these specific changes, incorporate it
1648
+ - If the context describes unrelated changes or other packages, ignore it
1649
+ - Don't force connections between unrelated information
1650
+ - Focus on accurately describing what actually changed in this commit
1646
1651
 
1647
- ## Guidelines
1648
- - Follow conventional commit format when appropriate (feat:, fix:, refactor:, docs:, test:, chore:)
1649
- - Consider suggesting split commits for unrelated changes
1650
- - Output only the commit message and/or splits - no conversational remarks
1651
- - NEVER include phrases like "If you want" or "Let me know" or offer follow-up actions
1652
+ ## Investigation Approach
1652
1653
 
1653
- Output format:
1654
- When you're ready to provide the final commit message, format it as:
1654
+ Use tools based on what you need to know:
1655
+ - group_files_by_concern - understand how files relate
1656
+ - get_file_content - see full context when diffs are unclear
1657
+ - get_file_history - understand how code evolved
1658
+ - get_file_dependencies - assess impact of changes
1659
+ - get_recent_commits - avoid duplicate messages
1660
+ - get_related_tests - understand behavior changes
1661
+ - search_codebase - find usage patterns
1662
+
1663
+ ## Writing Style
1664
+
1665
+ Write naturally and directly:
1666
+ - Use plain language, not corporate speak
1667
+ - Be specific and concrete
1668
+ - Avoid buzzwords and jargon
1669
+ - No emojis or excessive punctuation
1670
+ - No phrases like "this commit" or "this PR"
1671
+ - No meta-commentary about the commit itself
1672
+
1673
+ Follow conventional commit format when appropriate (feat:, fix:, refactor:, docs:, test:, chore:), but prioritize clarity over formality.
1674
+
1675
+ ## Output Format
1676
+
1677
+ When ready, format your response as:
1655
1678
 
1656
1679
  COMMIT_MESSAGE:
1657
- [Your generated commit message here]
1680
+ [Your commit message here]
1658
1681
 
1659
- If you recommend splitting into multiple commits, also include:
1682
+ If changes should be split into multiple commits:
1660
1683
 
1661
1684
  SUGGESTED_SPLITS:
1662
1685
  Split 1:
@@ -1667,7 +1690,7 @@ Message: [commit message for this split]
1667
1690
  Split 2:
1668
1691
  ...
1669
1692
 
1670
- If changes should remain as one commit, do not include SUGGESTED_SPLITS section.`;
1693
+ Output only the commit message and splits. No conversational remarks or follow-up offers.`;
1671
1694
  }
1672
1695
  function buildUserMessage$1(changedFiles, diffContent, userDirection, logContext) {
1673
1696
  let message = `I have staged changes that need a commit message.
@@ -1690,9 +1713,16 @@ ${logContext}`;
1690
1713
  }
1691
1714
  message += `
1692
1715
 
1693
- Please investigate these changes and generate an appropriate commit message.
1694
- Use the available tools to gather additional context as needed.
1695
- If these changes should be split into multiple commits, suggest the groupings.`;
1716
+ Analyze these changes and write a clear commit message. Consider:
1717
+ - What problem does this solve?
1718
+ - How do the changes work together?
1719
+ - Should this be one commit or multiple?
1720
+
1721
+ If context information is provided, use it only if relevant to these specific changes.
1722
+ Don't force connections that don't exist - if context doesn't apply to this package,
1723
+ simply ignore it and focus on the actual changes.
1724
+
1725
+ Investigate as needed to write an accurate, helpful message.`;
1696
1726
  return message;
1697
1727
  }
1698
1728
  function parseAgenticResult$1(finalMessage) {
@@ -2455,56 +2485,79 @@ async function runAgenticRelease(config) {
2455
2485
  };
2456
2486
  }
2457
2487
  function buildSystemPrompt$1(toolGuidance) {
2458
- return `You are an expert software engineer and technical writer tasked with generating comprehensive, thoughtful release notes.
2488
+ return `You are a professional software engineer writing release notes for your team and users.
2459
2489
 
2460
2490
  ${toolGuidance}
2461
- - get_tag_history: Use early to understand release cadence. Good for: establishing context about project versioning patterns
2462
2491
 
2463
- **Analyzing Current Changes:**
2464
- - get_file_content: Use when diff alone isn't enough. Good for: understanding APIs, seeing full class/function context, checking imports
2465
- - analyze_diff_section: Use to expand context around cryptic changes. Good for: seeing surrounding code, understanding integration points
2466
- - get_file_dependencies: Use for refactors/moves. Good for: assessing impact scope, identifying what depends on changed code
2467
- - search_codebase: Use to find usage patterns. Good for: checking if APIs are widely used, finding similar patterns elsewhere
2492
+ ## Your Task
2493
+
2494
+ Write release notes that clearly explain what's in this release and why it matters. Your notes should help users and developers understand what changed without needing to read every commit.
2495
+
2496
+ Focus on:
2497
+ - What problems does this release solve?
2498
+ - What new capabilities does it add?
2499
+ - What's the impact on users and developers?
2500
+ - Are there breaking changes or important considerations?
2468
2501
 
2469
- **Pattern Recognition:**
2470
- - group_files_by_concern: Use when many files changed. Good for: organizing changes into logical themes, identifying what actually happened
2471
- - analyze_commit_patterns: Use for many commits. Good for: detecting themes across commits, identifying if work is focused or scattered
2472
- - get_release_stats: Use to quantify scope. Good for: getting concrete metrics on scale of changes
2502
+ Use the available tools to investigate the changes. The more you understand, the better your notes will be.
2473
2503
 
2474
- **Risk Assessment:**
2475
- - get_breaking_changes: Always use. Good for: identifying API changes, finding removals/signature changes that could break users
2476
- - get_related_tests: Use for significant logic changes. Good for: understanding what behavior changed, verifying test coverage exists
2504
+ **Important**: If additional context is provided (from context files or other sources), use your judgment:
2505
+ - If the context is relevant to this specific package/release, incorporate it appropriately
2506
+ - If the context describes changes in other packages or unrelated work, ignore it
2507
+ - Don't fabricate connections between this package and unrelated context
2508
+ - Be honest about what changed - only mention what actually happened in this release
2509
+ - Context is supplemental information, not a requirement to include
2477
2510
 
2478
- ## Your Investigation Strategy
2511
+ ## Investigation Approach
2479
2512
 
2480
- 1. **Start broad** (2-3 tools): get_tag_history, get_release_stats, analyze_commit_patterns
2481
- 2. **Identify themes** (1-2 tools): group_files_by_concern if many files, compare_previous_release for context
2482
- 3. **Deep dive** (3-5 tools): get_file_content for key changes, get_file_dependencies for refactors, analyze_diff_section for unclear changes
2483
- 4. **Verify understanding** (2-3 tools): get_related_tests for logic changes, search_codebase for impact
2484
- 5. **Check risks** (1 tool): get_breaking_changes always
2513
+ Use tools based on what you need to know:
2485
2514
 
2486
- Use at least 6-8 tools per release to ensure comprehensive analysis. Each tool provides a different lens on the changes.
2515
+ **Context:**
2516
+ - get_tag_history - understand release patterns
2517
+ - get_release_stats - quantify scope
2518
+ - compare_previous_release - see how this compares
2487
2519
 
2488
- Output format:
2489
- When you're ready to provide the final release notes, format them as JSON:
2520
+ **Understanding:**
2521
+ - group_files_by_concern - identify themes
2522
+ - analyze_commit_patterns - detect patterns
2523
+ - get_file_content - see full context
2524
+ - analyze_diff_section - expand unclear changes
2525
+ - get_file_history - understand evolution
2526
+
2527
+ **Impact:**
2528
+ - get_file_dependencies - assess reach
2529
+ - search_codebase - find usage patterns
2530
+ - get_related_tests - understand behavior changes
2531
+ - get_breaking_changes - identify breaking changes (always use)
2532
+
2533
+ ## Writing Style
2534
+
2535
+ Write naturally and directly:
2536
+ - Use plain language that users can understand
2537
+ - Be specific about what changed and why
2538
+ - Avoid marketing speak and buzzwords
2539
+ - No emojis or excessive punctuation
2540
+ - No phrases like "we're excited to announce"
2541
+ - No meta-commentary about the release itself
2542
+ - Focus on facts and implications, not enthusiasm
2543
+
2544
+ Structure your notes logically:
2545
+ - Start with the most important changes
2546
+ - Group related changes together
2547
+ - Explain breaking changes clearly
2548
+ - Include practical examples when helpful
2549
+
2550
+ ## Output Format
2551
+
2552
+ When ready, format your response as JSON:
2490
2553
 
2491
2554
  RELEASE_NOTES:
2492
2555
  {
2493
- "title": "A concise, single-line title capturing the most significant changes",
2494
- "body": "The detailed release notes in Markdown format, following best practices for structure, depth, and analysis"
2495
- }
2496
-
2497
- The release notes should:
2498
- - Demonstrate genuine understanding of the changes
2499
- - Provide context and explain implications
2500
- - Connect related changes to reveal patterns
2501
- - Be substantial and analytical, not formulaic
2502
- - Sound like they were written by a human who studied the changes
2503
- - Be grounded in actual commits and issues (no hallucinations)
2504
- - Be standalone documentation that can be published as-is
2505
- - NEVER include conversational elements like "If you want, I can also..." or "Let me know if..."
2506
- - NEVER offer follow-up actions, questions, or suggestions for additional work
2507
- - End with substantive content, not conversational closing remarks`;
2556
+ "title": "Clear, factual title describing the main changes",
2557
+ "body": "Detailed release notes in Markdown format"
2558
+ }
2559
+
2560
+ Output only the JSON. No conversational remarks or follow-up offers.`;
2508
2561
  }
2509
2562
  function buildUserMessage(params) {
2510
2563
  const { fromRef, toRef, logContent, diffContent, milestoneIssues, releaseFocus, userContext } = params;
@@ -2537,15 +2590,17 @@ ${userContext}`;
2537
2590
  }
2538
2591
  message += `
2539
2592
 
2540
- Please investigate these changes thoroughly and generate comprehensive release notes that:
2541
- 1. Demonstrate deep understanding of what changed and why
2542
- 2. Provide context about how changes relate to each other
2543
- 3. Explain implications for users and developers
2544
- 4. Connect this release to previous releases and project evolution
2545
- 5. Identify any breaking changes or significant architectural shifts
2546
- 6. Follow best practices for technical writing and release notes
2593
+ Analyze these changes and write clear release notes. Consider:
2594
+ - What's the main story of this release?
2595
+ - What problems does it solve?
2596
+ - What's the impact on users and developers?
2597
+ - Are there breaking changes?
2598
+
2599
+ If context information is provided, use it only if relevant to this specific package.
2600
+ Don't force connections that don't exist - if context describes changes in other packages
2601
+ or unrelated features, simply ignore it and focus on what actually changed in this release.
2547
2602
 
2548
- Use the available tools to gather additional context as needed. Take your time to understand the changes deeply before writing the release notes.`;
2603
+ Investigate as needed to write accurate, helpful release notes.`;
2549
2604
  return message;
2550
2605
  }
2551
2606
  function parseAgenticResult(finalMessage) {