Skip to content

Add agent instruction after installation#15

Merged
JonghunYu merged 3 commits intodevelopfrom
add-agent-instruction
Jan 7, 2026
Merged

Add agent instruction after installation#15
JonghunYu merged 3 commits intodevelopfrom
add-agent-instruction

Conversation

@JonghunYu
Copy link
Member

@JonghunYu JonghunYu commented Jan 7, 2026

Summary by CodeRabbit

  • New Features

    • AI Agent Instructions guide now displays after project initialization to provide guidance for integrating AI agents with your workflow.
  • Documentation

    • README updated with improved formatting and a direct link to the git-issue tool for managing issues.
    • New comprehensive AI Agent Instruction Guide outlining patterns and best practices for agent integration and file organization.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 7, 2026

📝 Walkthrough

Walkthrough

This pull request introduces AI Agent Integration guidance for the git-issue project. A new documentation file was created to provide instructions on how AI agents should interact with git-issue, covering issue discovery patterns, YAML frontmatter interpretation, status directory conventions, and file naming recommendations. The README was updated with improved formatting and a linked reference to the git-issue tool. The init command was modified to output these AI agent instructions upon initialization. The issue tracking counter was incremented to reflect the new issue entry.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 With whiskers raised, I pen this note,
AI agents now have a guide to quote!
Instructions written, clear and bright,
Git-issues flow with fresh delight! ✨
Counter ticks to twenty strong,
Agent wisdom helps along! 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: adding agent instruction content that displays after git-issue installation.

✏️ Tip: You can configure your own custom Pre-merge Checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
cmd/init.go (1)

55-95: Consider refactoring for improved maintainability.

The function correctly outputs the AI agent instructions, but the 41 consecutive fmt.Println calls make maintenance and future updates more difficult. Consider these improvements:

  1. Use a multi-line string literal for better readability and easier maintenance
  2. Consider the color library mentioned in coding guidelines (github.com/fatih/color) to enhance the terminal output with visual emphasis
  3. Note content duplication: The instructions here closely mirror the README.md content, which creates a maintenance burden if either needs updating
🔎 Example refactor using a multi-line string
 func printAIAgentInstructions() {
-	fmt.Println("💡 AI Agent Integration")
-	fmt.Println()
-	fmt.Println("To help AI coding agents (Claude Code, Cursor, etc.) work with your issues,")
-	fmt.Println("add the following instructions to your CLAUDE.md, AGENTS.md, or .cursorrules file:")
-	fmt.Println()
-	fmt.Println("─────────────────────────────────────────────────────────────────────────")
-	fmt.Println()
-	fmt.Println("# AI Agent Instructions")
-	// ... remaining println calls
-	fmt.Println("─────────────────────────────────────────────────────────────────────────")
+	instructions := `💡 AI Agent Integration
+
+To help AI coding agents (Claude Code, Cursor, etc.) work with your issues,
+add the following instructions to your CLAUDE.md, AGENTS.md, or .cursorrules file:
+
+─────────────────────────────────────────────────────────────────────────
+
+# AI Agent Instructions
+
+## Issue Management
+
+This project uses [gi](https://github.com/Allra-Fintech/git-issue) for managing issues as Markdown files.
+
+### Finding Issues
+
+- **Open issues**: Located in ` + "`" + `.issues/open/` + "`" + `
+- **Closed issues**: Located in ` + "`" + `.issues/closed/` + "`" + `
+- **Issue file naming**: ` + "`" + `{id}-{title-slug}.md` + "`" + ` (e.g., ` + "`" + `001-user-auth-bug.md` + "`" + `)
+
+### When a user references an issue
+
+If a user says "implement #001" or "fix issue 001":
+
+1. Search for the file matching the issue ID in ` + "`" + `.issues/open/` + "`" + ` or ` + "`" + `.issues/closed/` + "`" + `
+2. Read the entire issue file to understand requirements
+3. Parse the YAML frontmatter for metadata (assignee, labels)
+4. Note: Status is determined by directory location (open/ = open, closed/ = closed)
+5. Use the issue description and details to guide your implementation
+
+Example: For "#001", look for ` + "`" + `.issues/open/001-*.md` + "`" + `
+
+### Working with issues
+
+- Always read the full issue before implementing
+- Reference the issue file path in your responses
+- Status is determined by directory: move files between open/ and closed/ to change status
+- Maintain the YAML frontmatter structure when editing issues
+
+─────────────────────────────────────────────────────────────────────────`
+	fmt.Println(instructions)
 }

Based on coding guidelines.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2f2fc58 and 2d30ad1.

📒 Files selected for processing (4)
  • .issues/.counter
  • .issues/closed/019-add-agent-instruction.md
  • README.md
  • cmd/init.go
🧰 Additional context used
📓 Path-based instructions (4)
cmd/**/*.go

📄 CodeRabbit inference engine (CLAUDE.md)

Use Cobra framework for implementing CLI commands in Go

Files:

  • cmd/init.go
**/*.go

📄 CodeRabbit inference engine (CLAUDE.md)

Use filepath package for file path separators to ensure cross-platform compatibility

Use filepath package for file path separators to ensure cross-platform compatibility

Files:

  • cmd/init.go
cmd/*.go

📄 CodeRabbit inference engine (AGENTS.md)

cmd/*.go: Use Cobra CLI framework for command implementation
Use github.com/fatih/color for terminal color output

Files:

  • cmd/init.go
.issues/**/*.md

📄 CodeRabbit inference engine (CLAUDE.md)

Normalize line endings to LF in issue files

.issues/**/*.md: File naming pattern for issues: {id}-{slug}.md where ID is zero-padded 3 digits and slug is URL-safe (lowercase, hyphens, no special chars)
YAML frontmatter must be delimited by --- and status field is NOT included (status determined by directory location: .issues/open/ = open, .issues/closed/ = closed)
Normalize line endings to LF in all issue files

Files:

  • .issues/closed/019-add-agent-instruction.md
🔇 Additional comments (6)
.issues/.counter (1)

1-1: LGTM! Counter increment is correct.

The counter has been properly incremented to 20, aligning with the new issue 019-add-agent-instruction.md.

README.md (2)

146-163: LGTM! Formatting improvements enhance readability.

The additional blank lines around the shell completion code blocks improve visual separation and make the documentation easier to scan.


211-211: LGTM! Link addition provides useful reference.

Adding a hyperlink to the gi project makes it easier for users to access the tool's documentation and repository.

cmd/init.go (1)

47-50: LGTM! Clean integration of AI agent instructions.

The call to printAIAgentInstructions() is well-placed after the initialization success message, providing helpful guidance to users without disrupting the command flow.

.issues/closed/019-add-agent-instruction.md (2)

1-7: LGTM! YAML frontmatter follows guidelines correctly.

The frontmatter is properly structured:

  • Delimited with ---
  • Status field correctly omitted (determined by directory location)
  • ID matches the filename
  • All expected fields are present

Based on coding guidelines.


1-38: LGTM! File fully complies with all coding guidelines.

The issue file meets all requirements:

  • Filename pattern: 019-add-agent-instruction.md (zero-padded 3-digit ID + URL-safe slug)
  • Line endings: LF ✓
  • YAML frontmatter properly delimited without status field
  • Located in .issues/closed/ (status determined by directory)
  • Content is well-structured and clear

@JonghunYu JonghunYu merged commit 19bcfb7 into develop Jan 7, 2026
4 checks passed
@JonghunYu JonghunYu deleted the add-agent-instruction branch January 7, 2026 05:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant