When this skill is invoked, the AI agent MUST follow these steps:
1. Context Analysis Phase
Review the conversation to determine issue type and extract details:
For [plan] issues:
- Check if a plan was already created using the
plan-guideline skill - If yes, use that plan directly as the "Proposed Solution"
- If no, inform the user to run
make-a-plan first before creating a [plan] issue
For other issues (bug reports, feature requests, improvements):
- Identify the problem/request being discussed
- Extract key details: what, why, affected modules
- Determine the specific issue type
Context signals for issue type:
- Bug report signals: "doesn't work", "error", "crash", "unexpected", "broken"
- Feature request signals: "add", "new", "would be nice", "enhancement", "support for"
- Improvement signals: "refactor", "optimize", "clean up", "better way"
2. Tag Selection Phase
- Read
docs/git-msg-tags.md to understand available tags - Analyze the issue type and scope
- Apply the tag prefix logic described above
- If multiple tags could apply, choose the most specific one
- If the tag is ambiguous, ask the user to choose from 2-3 most relevant options
3. Issue Draft Construction
Build the issue following the format specification:
Title:
- Format:
[prefix][tag]: Brief Summary - Keep summary concise (max 80 characters for the summary portion)
- Ensure the summary clearly describes the issue
Description section:
- Provide detailed context about the issue
- Mention related modules or components affected
- Explain the problem statement clearly
Steps to Reproduce section (only for bug reports):
- Provide a minimized sequence of steps to reproduce the bug
- Be specific and actionable
Proposed Solution section (mandatory for [plan] issues):
For [plan] issues: Use the complete plan output from the plan-guideline skill:
- Copy the entire plan structure: Goal, Codebase Analysis, Interface Design, Test Strategy, and Implementation Steps
- The plan from
plan-guideline already includes all necessary details:
- Specific files to modify/create/delete with line ranges
- Implementation steps in Design-first TDD order (Docs β Tests β Implementation)
- LOC estimates and complexity assessment
- Milestone strategy for large features
- DO NOT modify or rewrite the plan - use it as-is from
plan-guideline
For other issue types without a formal plan:
- Provide a brief description of the proposed approach (if applicable)
- Keep it high-level for feature requests and improvements
- Not required for simple bug reports
Related PR section (when Proposed Solution exists):
- Add placeholder text: "TBD - will be updated when PR is created"
- Or reference existing PR if available
4. User Confirmation Phase
CRITICAL: The AI agent MUST display the complete issue draft to the user
and wait for explicit confirmation before creating the issue.
Present the draft in a clear format:
```
I've prepared this GitHub issue:
---
[Full issue content here]
---
Should I create this issue?
```
- Wait for explicit "yes", "confirm", "create it", or similar affirmative response
- If the user requests modifications, update the draft and present again
- If the user declines, abort issue creation gracefully
5. GitHub Issue Creation
Once confirmed, create the issue using the GitHub CLI:
```bash
gh issue create --title "TITLE_HERE" --body "$(cat <<'EOF'
BODY_CONTENT_HERE
EOF
)"
```
Important:
- Use heredoc (
<<'EOF' ... EOF) to preserve markdown formatting - The body should include all sections from Description onwards (not the title)
- After successful creation, display the issue URL to the user
- Confirm: "GitHub issue created successfully: [URL]"
6. Error Handling
Handle common error scenarios gracefully:
Missing git-msg-tags.md:
```
Cannot create issue: docs/git-msg-tags.md not found.
Please create this file with your project's tag definitions.
```
GitHub CLI not authenticated:
```
GitHub CLI is not authenticated. Please run:
gh auth login
```
No conversation context:
```
I don't have enough context to create an issue. Could you please provide:
- What is the issue about?
- Is this a bug, feature request, or improvement?
- Any additional details or proposed solutions?
```
Issue creation failed:
```
Failed to create GitHub issue: [error message]
Please check your GitHub CLI configuration and try again.
```