@jxtools/visualgit 1.3.0 → 1.4.0

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.html CHANGED
@@ -8,8 +8,8 @@
8
8
  <link rel="preconnect" href="https://fonts.googleapis.com" />
9
9
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
10
10
  <link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap" rel="stylesheet" />
11
- <script type="module" crossorigin src="/assets/index-BT2Q0q7j.js"></script>
12
- <link rel="stylesheet" crossorigin href="/assets/index-DA2rIHWo.css">
11
+ <script type="module" crossorigin src="/assets/index-XUf8QbsZ.js"></script>
12
+ <link rel="stylesheet" crossorigin href="/assets/index-DFSlJzsh.css">
13
13
  </head>
14
14
  <body>
15
15
  <div id="root"></div>
@@ -2,14 +2,19 @@ import { spawn } from 'child_process';
2
2
  export class AiService {
3
3
  hasConversation = false;
4
4
  buildPrompt(mode, content, filePath) {
5
- const markdownInstruction = 'Format your response using Markdown (headings, bold, bullet points, code blocks).';
5
+ const systemRules = [
6
+ 'Format your response using Markdown (headings, bold, bullet points, inline code).',
7
+ 'NEVER ask questions, suggest next steps, or offer to do anything. This is a read-only report.',
8
+ 'NEVER repeat the source code in your response.',
9
+ 'Be concise. Use bullet points, not paragraphs.',
10
+ ].join(' ');
6
11
  if (mode === 'selection') {
7
- return `Analyze this selected code snippet${filePath ? ` from ${filePath}` : ''}. Explain what it does, any issues, and potential improvements. Be concise with bullet points. ${markdownInstruction}\n\n\`\`\`\n${content}\n\`\`\``;
12
+ return `Analyze this code snippet${filePath ? ` from ${filePath}` : ''}. Follow this exact structure:\n\n## What It Does\n(Brief explanation)\n\n## Issues\n(Bugs, risks, or anti-patterns found or "None found")\n\n## Improvements\n(Concrete suggestions — or "Looks good")\n\n${systemRules}\n\n\`\`\`\n${content}\n\`\`\``;
8
13
  }
9
14
  if (mode === 'file') {
10
- return `Analyze the changes in ${filePath || 'this file'}. Explain what changed and why it matters, key improvements, and any risks. Be concise with bullet points. ${markdownInstruction}\n\n\`\`\`diff\n${content}\n\`\`\``;
15
+ return `Analyze the changes in ${filePath || 'this file'}. Follow this exact structure:\n\n## Summary\n(What changed in 1-2 sentences)\n\n## Changes\n(Bullet list of each meaningful change)\n\n## Risks\n(Potential issues or "None identified")\n\n## Verdict\n(One-line assessment: safe to merge, needs review, or has issues)\n\n${systemRules}\n\n\`\`\`diff\n${content}\n\`\`\``;
11
16
  }
12
- return `You are a senior software engineer. Analyze this complete git diff and provide:\n\n1. Executive summary of all changes\n2. Key improvements or patterns introduced\n3. Any potential risks or concerns\n4. How the changes relate to each other\n\nBe concise with bullet points. Do not repeat the code. ${markdownInstruction}\n\n\`\`\`diff\n${content}\n\`\`\``;
17
+ return `You are a senior software engineer reviewing a git diff. Follow this exact structure:\n\n## Summary\n(Executive summary in 2-3 sentences)\n\n## Changes by File\n(Group changes by file, bullet points per file)\n\n## Patterns\n(Key improvements or patterns introduced or "No notable patterns")\n\n## Risks\n(Potential issues or concerns or "None identified")\n\n## Verdict\n(One-line overall assessment)\n\n${systemRules}\n\n\`\`\`diff\n${content}\n\`\`\``;
13
18
  }
14
19
  getCommand(provider, model = 'sonnet') {
15
20
  if (provider === 'claude') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jxtools/visualgit",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "Terminal-style git diff viewer with AI-powered explanations",
5
5
  "type": "module",
6
6
  "bin": {