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 @@
20
21
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
id: "020"
assignee: ""
labels: []
created: 2026-01-26T11:37:46.674936+09:00
updated: 2026-01-26T12:21:38.526905+09:00
---

# Update AI instructions to use gi create command instead of creating files directly

## Description

Currently, the AI instructions in `CLAUDE.md` focus on how to **find and read** existing issues, but do not instruct AI agents on how to **create** new issues. As a result, AI agents may create issue files directly by writing to the `.issues/open/` directory instead of using the proper `gi create` command.

This is problematic because:
1. The `gi create` command handles ID generation from `.counter` file
2. It generates the proper slug from the title
3. It creates the correct YAML frontmatter with timestamps
4. It ensures consistent file naming format

## Requirements

- Update `CLAUDE.md` to add instructions for creating new issues
- Update the `gi init` command output in `cmd/init.go` (`printAIAgentInstructions()` function) to include instructions for creating issues
- Instruct AI agents to use `gi create "issue title"` command
- Document available flags: `--assignee`, `--label`

## Success Criteria

- [ ] CLAUDE.md includes a "Creating Issues" section
- [ ] `gi init` output includes instructions for creating issues using `gi create`
- [ ] AI agents use `gi create` command instead of manually creating files
- [ ] Instructions cover common flags for issue creation
21 changes: 21 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,27 @@ git-issue/

This project uses its own issue tracking system (dogfooding).

### Creating Issues

When creating a new issue, always use the `gi create` command instead of manually creating files:

```bash
# Create a new issue
gi create "Your issue title here"

# Create with assignee
gi create "Fix login bug" --assignee username

# Create with labels (can use multiple --label flags)
gi create "Add dark mode" --label feature --label frontend
```

**Important:** Never create issue files directly by writing to `.issues/open/`. The `gi create` command:
- Automatically generates the next issue ID from `.counter`
- Creates the proper slug from the title
- Sets up correct YAML frontmatter with timestamps
- Ensures consistent file naming format

### Finding Issues

When a user references an issue like "#001" or "issue 001":
Expand Down
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,22 @@ If a user says "implement #001" or "fix issue 001":

Example: For "#001", look for `.issues/open/001-*.md`

### Creating Issues

Always use the `gi create` command instead of manually creating files:

```bash
gi create "Your issue title"
gi create "Fix bug" --assignee username --label bug
```

**Never** create issue files directly - the command handles ID generation and formatting.

### 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
- Use `gi close <id>` and `gi open <id>` to change issue status
- Maintain the YAML frontmatter structure when editing issues
```

Expand Down
13 changes: 12 additions & 1 deletion cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,22 @@ func printAIAgentInstructions() {
fmt.Println()
fmt.Println("Example: For \"#001\", look for `.issues/open/001-*.md`")
fmt.Println()
fmt.Println("### Creating Issues")
fmt.Println()
fmt.Println("Always use the `gi create` command instead of manually creating files:")
fmt.Println()
fmt.Println("```bash")
fmt.Println("gi create \"Your issue title\"")
fmt.Println("gi create \"Fix bug\" --assignee username --label bug")
fmt.Println("```")
fmt.Println()
fmt.Println("**Never** create issue files directly - the command handles ID generation and formatting.")
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("- Use `gi close <id>` and `gi open <id>` to change issue status")
fmt.Println("- Maintain the YAML frontmatter structure when editing issues")
fmt.Println()
fmt.Println("─────────────────────────────────────────────────────────────────────────")
Expand Down