gut-cli 0.1.20 → 0.1.22

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/.gut/branch.md CHANGED
@@ -9,7 +9,3 @@ Generate a clean, descriptive branch name based on the description. If a branch
9
9
  - Use kebab-case for description
10
10
  - Keep it short (under 50 chars total)
11
11
  - No special characters except hyphens and slashes
12
-
13
- ## Output
14
-
15
- Respond with ONLY the branch name, nothing else.
package/.gut/changelog.md CHANGED
@@ -16,11 +16,3 @@ Use Keep a Changelog format (https://keepachangelog.com/):
16
16
  - Breaking changes (highlight these)
17
17
  - Group related changes together
18
18
  - Write for end users, not developers (unless it's a library)
19
-
20
- ## Output
21
-
22
- Respond with a JSON object containing:
23
- - version: Version string if detected (optional)
24
- - date: Release date in YYYY-MM-DD format
25
- - sections: Array of { type, items[] }
26
- - summary: Brief summary of this release (optional)
package/.gut/checkout.md CHANGED
@@ -15,7 +15,3 @@ Analyze the git diff and generate a clean, descriptive branch name that captures
15
15
  - The main purpose of the changes
16
16
  - Whether it's a feature, fix, refactor, etc.
17
17
  - Key files or functionality being modified
18
-
19
- ## Output
20
-
21
- Respond with ONLY the branch name, nothing else.
package/.gut/commit.md CHANGED
@@ -10,7 +10,3 @@ Analyze the git diff and generate a concise, meaningful commit message.
10
10
  - Description should be lowercase, imperative mood, no period at end
11
11
  - Keep the first line under 72 characters
12
12
  - If changes are complex, add a blank line and bullet points for details
13
-
14
- ## Output
15
-
16
- Respond with ONLY the commit message, nothing else.
@@ -10,13 +10,4 @@ Analyze the file content and explain what it does, its purpose, and its role in
10
10
  - Dependencies and what it interacts with
11
11
  - Any important patterns or architecture decisions
12
12
 
13
- ## Output
14
-
15
13
  Explain in a way that helps someone quickly understand this file's purpose and how it fits into the larger codebase.
16
-
17
- Respond with a JSON object containing:
18
- - summary: One-line summary
19
- - purpose: The purpose and role of this code
20
- - changes: Array of { file, description }
21
- - impact: What impact or role this has in the project
22
- - notes: Important considerations or caveats (optional)
package/.gut/explain.md CHANGED
@@ -9,13 +9,4 @@ Analyze the changes based on the target type (commit, PR, file changes, etc.) an
9
9
  - The broader context and purpose
10
10
  - Any important implications or side effects
11
11
 
12
- ## Output
13
-
14
12
  Explain in a way that helps someone understand not just the "what" but the "why" behind these changes.
15
-
16
- Respond with a JSON object containing:
17
- - summary: One-line summary
18
- - purpose: The purpose and role of this code
19
- - changes: Array of { file, description }
20
- - impact: What impact or role this has in the project
21
- - notes: Important considerations or caveats (optional)
package/.gut/find.md CHANGED
@@ -11,9 +11,3 @@ Find the commits that best match the user's query. Consider:
11
11
 
12
12
  Return commits ordered by relevance (most relevant first).
13
13
  Only include commits that actually match the query - if none match well, return an empty array.
14
-
15
- ## Output
16
-
17
- Respond with a JSON object containing:
18
- - matches: Array of { hash, reason }
19
- - summary: Brief summary of the search results (optional)
package/.gut/gitignore.md CHANGED
@@ -14,7 +14,3 @@ Analyze the project structure and configuration files to generate an appropriate
14
14
  - Do NOT ignore files that should be tracked (source code, configs, etc.)
15
15
  - Keep the file organized with comments for each section
16
16
  - If an existing .gitignore is provided, preserve project-specific patterns from it
17
-
18
- ## Output
19
-
20
- Respond with ONLY the .gitignore content, nothing else. Include section comments for clarity.
package/.gut/merge.md CHANGED
@@ -10,10 +10,3 @@ Analyze the conflicted file content and provide a resolution.
10
10
  - Preserve all necessary functionality
11
11
  - The resolved content should be valid, working code
12
12
  - Do NOT include conflict markers (<<<<<<, =======, >>>>>>)
13
-
14
- ## Output
15
-
16
- Respond with a JSON object containing:
17
- - resolvedContent: The resolved file content
18
- - explanation: Brief explanation of how the conflict was resolved
19
- - strategy: "ours" | "theirs" | "combined" | "rewritten"
package/.gut/pr.md CHANGED
@@ -12,13 +12,3 @@ Generate a clear and informative PR title and description based on the branch in
12
12
  - ## Summary section with 2-3 bullet points
13
13
  - ## Changes section listing key modifications
14
14
  - ## Test Plan section (suggest what to test)
15
-
16
- ## Output
17
-
18
- Respond in JSON format:
19
- ```json
20
- {
21
- "title": "...",
22
- "body": "..."
23
- }
24
- ```
package/.gut/review.md CHANGED
@@ -8,11 +8,4 @@ You are an expert code reviewer. Analyze the git diff and provide a structured r
8
8
  - Code style and best practices
9
9
  - Suggestions for improvement
10
10
 
11
- ## Output
12
-
13
11
  Be constructive and specific. Include line numbers when possible.
14
-
15
- Respond with a JSON object containing:
16
- - summary: Brief overall assessment
17
- - issues: Array of { severity: "critical"|"warning"|"suggestion", file, line?, message, suggestion? }
18
- - positives: Array of good practices observed
package/.gut/stash.md CHANGED
@@ -8,7 +8,3 @@ Generate a short, descriptive stash name based on the diff.
8
8
  - Keep it under 50 characters total
9
9
  - Be specific about what the changes do
10
10
  - Use present tense
11
-
12
- ## Output
13
-
14
- Respond with ONLY the stash name, nothing else.
package/.gut/summary.md CHANGED
@@ -9,12 +9,3 @@ Generate a clear, professional work summary based on the git activity.
9
9
  - Highlight important achievements
10
10
  - Use clear, non-technical language where possible
11
11
  - Make it suitable for sharing with team or manager
12
-
13
- ## Output
14
-
15
- Respond with a JSON object containing:
16
- - title: One-line title for the summary
17
- - overview: Brief overview of what was accomplished
18
- - highlights: Array of key accomplishments
19
- - details: Array of { category, items[] }
20
- - stats: { commits, filesChanged?, additions?, deletions? } (optional)
package/dist/index.js CHANGED
@@ -334,7 +334,7 @@ function findTemplate(repoRoot, templateName) {
334
334
  }
335
335
  return null;
336
336
  }
337
- function buildPrompt(userTemplate, templateName, context, language) {
337
+ function buildPrompt(userTemplate, templateName, context, language, outputFormat) {
338
338
  let contextXml = "<context>\n";
339
339
  for (const [key, value] of Object.entries(context)) {
340
340
  if (value) {
@@ -347,7 +347,12 @@ ${value}
347
347
  contextXml += "</context>\n\n";
348
348
  const template = userTemplate || loadTemplate(templateName);
349
349
  const langInstruction = language === "ja" ? "\n\nIMPORTANT: Respond in Japanese (\u65E5\u672C\u8A9E\u3067\u56DE\u7B54\u3057\u3066\u304F\u3060\u3055\u3044)." : "";
350
- return contextXml + "<instructions>\n" + template + langInstruction + "\n</instructions>";
350
+ const outputSection = outputFormat ? `
351
+
352
+ <output-format>
353
+ ${outputFormat}
354
+ </output-format>` : "";
355
+ return contextXml + "<instructions>\n" + template + langInstruction + "\n</instructions>" + outputSection;
351
356
  }
352
357
  var DEFAULT_MODELS = {
353
358
  gemini: "gemini-2.0-flash",
@@ -397,7 +402,7 @@ async function generateCommitMessage(diff, options, template) {
397
402
  const model = await getModel(options);
398
403
  const prompt = buildPrompt(template, "commit", {
399
404
  diff: diff.slice(0, 8e3)
400
- }, options.language);
405
+ }, options.language, "Respond with ONLY the commit message, nothing else.");
401
406
  const result = await generateText({
402
407
  model,
403
408
  prompt,
@@ -412,7 +417,13 @@ async function generatePRDescription(context, options, template) {
412
417
  currentBranch: context.currentBranch,
413
418
  commits: context.commits.map((c) => `- ${c}`).join("\n"),
414
419
  diff: context.diff.slice(0, 6e3)
415
- }, options.language);
420
+ }, options.language, `Respond in JSON format:
421
+ \`\`\`json
422
+ {
423
+ "title": "...",
424
+ "body": "..."
425
+ }
426
+ \`\`\``);
416
427
  const result = await generateText({
417
428
  model,
418
429
  prompt,
@@ -599,7 +610,7 @@ async function generateBranchName(description, options, context, template) {
599
610
  description,
600
611
  type: context?.type,
601
612
  issue: context?.issue
602
- }, options.language);
613
+ }, options.language, "Respond with ONLY the branch name, nothing else.");
603
614
  const result = await generateText({
604
615
  model,
605
616
  prompt,
@@ -611,7 +622,7 @@ async function generateBranchNameFromDiff(diff, options, template) {
611
622
  const model = await getModel(options);
612
623
  const prompt = buildPrompt(template, "checkout", {
613
624
  diff: diff.slice(0, 8e3)
614
- }, options.language);
625
+ }, options.language, "Respond with ONLY the branch name, nothing else.");
615
626
  const result = await generateText({
616
627
  model,
617
628
  prompt,
@@ -623,7 +634,7 @@ async function generateStashName(diff, options, template) {
623
634
  const model = await getModel(options);
624
635
  const prompt = buildPrompt(template, "stash", {
625
636
  diff: diff.slice(0, 4e3)
626
- }, options.language);
637
+ }, options.language, "Respond with ONLY the stash name, nothing else.");
627
638
  const result = await generateText({
628
639
  model,
629
640
  prompt,
@@ -694,7 +705,7 @@ async function generateGitignore(context, options, template) {
694
705
  files: context.files,
695
706
  configFiles: context.configFiles,
696
707
  existingGitignore: context.existingGitignore
697
- }, options.language);
708
+ }, options.language, "Respond with ONLY the .gitignore content, nothing else. No explanations or markdown code blocks.");
698
709
  const result = await generateText({
699
710
  model,
700
711
  prompt,