Add agent instruction after installation#15
Conversation
📝 WalkthroughWalkthroughThis 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
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom Pre-merge Checks in the settings. ✨ Finishing touches
Comment |
There was a problem hiding this comment.
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.Printlncalls make maintenance and future updates more difficult. Consider these improvements:
- Use a multi-line string literal for better readability and easier maintenance
- Consider the color library mentioned in coding guidelines (
github.com/fatih/color) to enhance the terminal output with visual emphasis- 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
📒 Files selected for processing (4)
.issues/.counter.issues/closed/019-add-agent-instruction.mdREADME.mdcmd/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
filepathpackage for file path separators to ensure cross-platform compatibilityUse 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
Summary by CodeRabbit
New Features
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.