Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .issues/.counter
Original file line number Diff line number Diff line change
@@ -1 +1 @@
19
20
38 changes: 38 additions & 0 deletions .issues/closed/019-add-agent-instruction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
id: "019"
assignee: ""
labels: []
created: 2026-01-07T14:16:07.924716+09:00
updated: 2026-01-07T14:28:50.454501+09:00
---

# Add AI Agent Instruction Guide to gi init Output

## Description

Enhance the `gi init` command output to display sample AI agent instructions after successful initialization. This will guide users to set up their coding agents (Claude Code, Cursor, etc.) to work seamlessly with git-issue.

## Requirements

- After displaying the `.issues/` directory structure, add a new section that shows:
- A brief explanation about AI agent integration
- Sample instruction content that users can copy to their CLAUDE.md, AGENTS.md, or .cursorrules files
- The sample should teach AI agents how to:
- Find issues by ID pattern (`.issues/open/{id}-*.md` or `.issues/closed/{id}-*.md`)
- Understand issue file structure (YAML frontmatter + Markdown body)
- Determine status by directory location (open/ vs closed/, not a YAML field)
- Parse and work with issue references (e.g., "#001", "issue 001")
- Suggest common agent instruction file names:
- CLAUDE.md (for Claude Code)
- AGENTS.md (for general AI agents)
- .cursorrules (for Cursor IDE)
- Keep the output concise but informative
- Make it easy for users to understand the benefit of setting this up

## Success Criteria

- [ ] `gi init` command prints AI agent instruction guide after directory structure
- [ ] Sample instruction text is clear and copy-paste ready
- [ ] Output mentions multiple agent instruction file types
- [ ] Instructions cover key concepts: file naming, finding by ID, YAML frontmatter, status determination
- [ ] Users understand how to set up their AI agents to work with git-issue
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,18 +143,21 @@ See [RELEASE.md](RELEASE.md) for the full release checklist, tagging instruction
### Shell Completion

#### Zsh (macOS)

```bash
gi completion zsh > $(brew --prefix)/share/zsh/site-functions/_gi
```

#### Bash

**Linux:**

```bash
gi completion bash > /etc/bash_completion.d/gi
```

**macOS:**

```bash
gi completion bash > $(brew --prefix)/etc/bash_completion.d/gi
```
Expand Down Expand Up @@ -205,7 +208,7 @@ For optimal AI agent integration, create instruction files in your repository ro

## Issue Management

This project uses gi for managing issues as Markdown files.
This project uses [gi](https://github.com/Allra-Fintech/git-issue) for managing issues as Markdown files.

### Finding Issues

Expand Down
46 changes: 46 additions & 0 deletions cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,52 @@ func runInit(cmd *cobra.Command, args []string) error {
fmt.Println(" └── template.md # Template for new issues")
fmt.Println()
fmt.Println("You can now create issues with 'gi create <title>'")
fmt.Println()

// Display AI agent instruction guidance
printAIAgentInstructions()

return nil
}

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")
fmt.Println()
fmt.Println("## Issue Management")
fmt.Println()
fmt.Println("This project uses [gi](https://github.com/Allra-Fintech/git-issue) for managing issues as Markdown files.")
fmt.Println()
fmt.Println("### Finding Issues")
fmt.Println()
fmt.Println("- **Open issues**: Located in `.issues/open/`")
fmt.Println("- **Closed issues**: Located in `.issues/closed/`")
fmt.Println("- **Issue file naming**: `{id}-{title-slug}.md` (e.g., `001-user-auth-bug.md`)")
fmt.Println()
fmt.Println("### When a user references an issue")
fmt.Println()
fmt.Println("If a user says \"implement #001\" or \"fix issue 001\":")
fmt.Println()
fmt.Println("1. Search for the file matching the issue ID in `.issues/open/` or `.issues/closed/`")
fmt.Println("2. Read the entire issue file to understand requirements")
fmt.Println("3. Parse the YAML frontmatter for metadata (assignee, labels)")
fmt.Println("4. Note: Status is determined by directory location (open/ = open, closed/ = closed)")
fmt.Println("5. Use the issue description and details to guide your implementation")
fmt.Println()
fmt.Println("Example: For \"#001\", look for `.issues/open/001-*.md`")
fmt.Println()
fmt.Println("### Working with issues")
fmt.Println()
fmt.Println("- Always read the full issue before implementing")
fmt.Println("- Reference the issue file path in your responses")
fmt.Println("- Status is determined by directory: move files between open/ and closed/ to change status")
fmt.Println("- Maintain the YAML frontmatter structure when editing issues")
fmt.Println()
fmt.Println("─────────────────────────────────────────────────────────────────────────")
}