From 31d9cca45a37aa1d6c800c1226498a861603b183 Mon Sep 17 00:00:00 2001 From: JonghunYu Date: Mon, 24 Nov 2025 11:38:56 +0900 Subject: [PATCH 1/5] feat: added #015 --- .issues/.counter | 2 +- .issues/open/015-make-template-work.md | 46 ++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 .issues/open/015-make-template-work.md diff --git a/.issues/.counter b/.issues/.counter index 60d3b2f..b6a7d89 100644 --- a/.issues/.counter +++ b/.issues/.counter @@ -1 +1 @@ -15 +16 diff --git a/.issues/open/015-make-template-work.md b/.issues/open/015-make-template-work.md new file mode 100644 index 0000000..c8b2d95 --- /dev/null +++ b/.issues/open/015-make-template-work.md @@ -0,0 +1,46 @@ +--- +id: "015" +assignee: "" +labels: [] +created: 2025-11-24T11:30:27.643813+09:00 +updated: 2025-11-24T11:30:27.643813+09:00 +--- + +# Make template work + +## Description + +The `gi create` command is not using the `.issues/template.md` file when creating new issues. New issues are created with minimal content instead of the structured template that includes Description, Requirements, and Success Criteria sections. + +## Current Behavior + +When running `gi create`, new issues are created with only: +- YAML frontmatter (id, assignee, labels, created, updated) +- A simple title heading +- Empty content + +## Expected Behavior + +New issues should be created based on `.issues/template.md`, which includes: +- YAML frontmatter (with appropriate fields populated) +- Title heading +- Description section with placeholder text +- Requirements section with example bullet points +- Success Criteria section with checkboxes + +## Steps to Reproduce + +1. Run `gi create` and enter an issue title +2. Open the newly created issue file +3. Observe that the file does not contain the template sections + +## Impact + +Users must manually add common sections (Description, Requirements, Success Criteria) to each new issue, reducing productivity and consistency across issues. + +## Success Criteria + +- [ ] `gi create` command reads `.issues/template.md` when creating new issues +- [ ] Template sections (Description, Requirements, Success Criteria) appear in new issues +- [ ] YAML frontmatter fields are properly populated (id, timestamps, etc.) +- [ ] Title from user input replaces "Issue Title" placeholder in template From cbeff5554ffde181ab55256927c7df28ce0a0950 Mon Sep 17 00:00:00 2001 From: JonghunYu Date: Mon, 24 Nov 2025 11:40:41 +0900 Subject: [PATCH 2/5] Close issue #016 --- .issues/.counter | 2 +- .../closed/016-test-template-functionality.md | 23 +++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 .issues/closed/016-test-template-functionality.md diff --git a/.issues/.counter b/.issues/.counter index b6a7d89..98d9bcb 100644 --- a/.issues/.counter +++ b/.issues/.counter @@ -1 +1 @@ -16 +17 diff --git a/.issues/closed/016-test-template-functionality.md b/.issues/closed/016-test-template-functionality.md new file mode 100644 index 0000000..74bf8b5 --- /dev/null +++ b/.issues/closed/016-test-template-functionality.md @@ -0,0 +1,23 @@ +--- +id: "016" +assignee: "" +labels: [] +created: 2025-11-24T11:40:26.980336+09:00 +updated: 2025-11-24T11:40:41.888813+09:00 +--- + +# Test template functionality + +## Description + +Describe the issue here... + +## Requirements + +- Requirement 1 +- Requirement 2 + +## Success Criteria + +- [ ] Criterion 1 +- [ ] Criterion 2 From cfcd97a0fd003a56126db9f54f84e22ff1184f1e Mon Sep 17 00:00:00 2001 From: JonghunYu Date: Mon, 24 Nov 2025 12:14:29 +0900 Subject: [PATCH 3/5] Close issue #015 --- .issues/{open => closed}/015-make-template-work.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .issues/{open => closed}/015-make-template-work.md (97%) diff --git a/.issues/open/015-make-template-work.md b/.issues/closed/015-make-template-work.md similarity index 97% rename from .issues/open/015-make-template-work.md rename to .issues/closed/015-make-template-work.md index c8b2d95..221348a 100644 --- a/.issues/open/015-make-template-work.md +++ b/.issues/closed/015-make-template-work.md @@ -3,7 +3,7 @@ id: "015" assignee: "" labels: [] created: 2025-11-24T11:30:27.643813+09:00 -updated: 2025-11-24T11:30:27.643813+09:00 +updated: 2025-11-24T12:14:28.9905+09:00 --- # Make template work From 2cc6b49e1e16ccb2a9cc33651abdca24e1170807 Mon Sep 17 00:00:00 2001 From: JonghunYu Date: Mon, 24 Nov 2025 12:14:51 +0900 Subject: [PATCH 4/5] Close issue #017 --- .issues/.counter | 2 +- .../017-sample-issue-to-show-template.md | 24 +++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 .issues/closed/017-sample-issue-to-show-template.md diff --git a/.issues/.counter b/.issues/.counter index 98d9bcb..3c03207 100644 --- a/.issues/.counter +++ b/.issues/.counter @@ -1 +1 @@ -17 +18 diff --git a/.issues/closed/017-sample-issue-to-show-template.md b/.issues/closed/017-sample-issue-to-show-template.md new file mode 100644 index 0000000..1be9516 --- /dev/null +++ b/.issues/closed/017-sample-issue-to-show-template.md @@ -0,0 +1,24 @@ +--- +id: "017" +assignee: user1 +labels: + - feature +created: 2025-11-24T12:14:42.020428+09:00 +updated: 2025-11-24T12:14:51.635438+09:00 +--- + +# Sample issue to show template + +## Description + +Describe the issue here... + +## Requirements + +- Requirement 1 +- Requirement 2 + +## Success Criteria + +- [ ] Criterion 1 +- [ ] Criterion 2 From edf97bfbe00e62670a22f56c6abc9fb2ad924c66 Mon Sep 17 00:00:00 2001 From: JonghunYu Date: Mon, 24 Nov 2025 12:15:27 +0900 Subject: [PATCH 5/5] Fix: Use template when creating new issues MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Modified NewIssue function to read and use the template body from .issues/template.md when creating new issues. The template sections (Description, Requirements, Success Criteria) are now included in all newly created issues. Fixes #015 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- pkg/storage.go | 45 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/pkg/storage.go b/pkg/storage.go index 2fdcde7..b881a3c 100644 --- a/pkg/storage.go +++ b/pkg/storage.go @@ -326,9 +326,52 @@ func GetClosedPath() string { return filepath.Join(IssuesDir, ClosedDir) } +// LoadTemplateBody reads the template file and extracts the body content (after title heading) +func LoadTemplateBody() string { + templatePath := filepath.Join(IssuesDir, TemplateFile) + + // Read template file + data, err := os.ReadFile(templatePath) + if err != nil { + // If template doesn't exist, return empty body + return "" + } + + // Parse the template to extract body + content := string(data) + parts := strings.SplitN(content, "---", 3) + if len(parts) < 3 { + // Invalid template format, return empty + return "" + } + + // Get everything after frontmatter + body := strings.TrimSpace(parts[2]) + + // Skip the title line (first # heading) and get everything after + lines := strings.Split(body, "\n") + for i, line := range lines { + line = strings.TrimSpace(line) + if strings.HasPrefix(line, "# ") { + // Return everything after the title line + if i+1 < len(lines) { + return strings.TrimSpace(strings.Join(lines[i+1:], "\n")) + } + return "" + } + } + + // If no title found, return the whole body + return body +} + // NewIssue creates a new Issue with default values func NewIssue(id int, title, assignee string, labels []string) *Issue { now := time.Now() + + // Load template body + templateBody := LoadTemplateBody() + return &Issue{ ID: FormatID(id), Assignee: assignee, @@ -336,6 +379,6 @@ func NewIssue(id int, title, assignee string, labels []string) *Issue { Created: now, Updated: now, Title: title, - Body: "", + Body: templateBody, } }