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
1 change: 1 addition & 0 deletions .claude/commands/make-branch.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ i{issue-index}-{type}/{action-description_with_underscores}
- `doc` - Documentation changes
- `config` - Configuration updates
- `refactor` - Code refactoring
- `agent` - Add or update agent rules, commands, or automation
- `format` - Code formatting changes (whitespace, indentation, semicolons, etc.)
- `test` - Test additions or improvements
- `perf` - Performance improvements
Expand Down
1 change: 1 addition & 0 deletions .claude/commands/make-commit.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Analyze git changes (staged and unstaged) and create well-structured commits.
* `doc`: Documentation changes
* `config`: prettier, eslint, ci/cd, dependency installs/bumps, docker, vscode settings
* `refactor`: Lint fixes, prettier fixes, output-unchanged code improvements
* `agent`: Add or update agent rules, commands, or automation
* `format`: Code formatting changes (whitespace, indentation, semicolons, etc.)
* `test`: Test additions or improvements, storybook, .test file additions
* `perf`: Performance improvements
Expand Down
1 change: 1 addition & 0 deletions .claude/commands/make-pr.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Generate titles based on branch analysis using these prefixes:
- **doc**: Documentation changes
- **config**: prettier, eslint, ci/cd, dependency installs/bumps, docker, vscode settings
- **refactor**: Lint fixes, prettier fixes, output-unchanged code improvements
- **agent**: Add or update agent rules, commands, or automation
- **test**: Test additions or improvements, storybook, .test file additions
- **perf**: Performance improvements

Expand Down
118 changes: 118 additions & 0 deletions .claude/commands/make-task-issue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
---
description: "Create GitHub issues using templates with automatic project assignment"
argument-hint: "[template-type] [issue-title]"
allowed-tools:
- Bash
---

# Make Task Issue

Create a new GitHub issue using one of the available templates and automatically assign it to the repository's GitHub Project.

## Usage

```
/make-task-issue [template-type] [issue-title]
```

Or simply:
```
/make-task-issue
```

## Available Templates

The following issue templates are available in `.github/ISSUE_TEMPLATE/`:

- `feat` - Add a new feature or enhancement
- `fix` - Fix a bug or issue
- `doc` - Add or update project documentation
- `config` - Add or update project configuration, dependencies, or tooling
- `refactor` - Refactor existing code for better maintainability or performance
- `agent` - Add or update agent rules, commands, or automation
- `bug` - Create a bug report to help us improve
- `test` - Add or improve tests
- `perf` - Improve performance

## Workflow

1. **Determine template type**:
- If `$1` (first argument) is provided and matches a template type, use it
- Otherwise, ask the user to select from available templates

2. **Get issue title**:
- If `$2` (remaining arguments) is provided, use it as the title
- Otherwise, ask the user for the title
- Format title as: `{type}: {user-provided-title}`

3. **Create the issue**:
- Use GitHub CLI: `gh issue create --template {template}.md --title "{formatted-title}"`
- The template will pre-fill the issue body structure
- User can edit the issue body in their editor before submission

4. **Set issue type as "Task"**:
- After issue creation, set the GitHub issue type to "Task"
- Use GitHub API via gh CLI: `gh api repos/{owner}/{repo}/issues/{issue-number} -X PATCH -f type='Task'`
- This categorizes the issue as a "Task" type in GitHub's issue tracking system
- Note: The field name is `type` (not `issue_type`) and the value should be capitalized (e.g., 'Task', 'Bug', 'Feature')
- Issue types are an organization-level feature and may not be available in all repositories

5. **Add to GitHub Project**:
- After issue creation, add the issue to the repository's linked GitHub Project
- Get the project linked to the repository using GraphQL (most efficient):
```bash
gh api graphql -f query='
{
repository(owner: "{owner}", name: "{repo}") {
projectsV2(first: 1) {
nodes {
id
number
title
}
}
}
}'
```
- Extract the project number from the response
- Add the issue to the project:
* Use: `gh project item-add {project-number} --owner {owner} --url {issue-url}`
- If no project is linked or command fails, show informative message but don't fail issue creation
- Note: This approach is more efficient than listing all organization projects as it queries only repository-linked projects

## Examples

### With arguments:
```
/make-task-issue feat implement dark mode
```
Creates a feature issue with title "feat: implement dark mode"

### Interactive mode:
```
/make-task-issue
```
Prompts for template selection and title

## Implementation Notes

- Use `gh issue create` with `--template` flag to utilize existing templates
- Templates automatically apply correct labels (e.g., feat template applies "feat" label)
- Issue will be assigned to creator automatically via auto-assign workflow
- All issues created via this command are set to "Task" type
- Issues are automatically added to the repository's linked GitHub Project
- GitHub Project integration:
* Uses GraphQL to efficiently query only repository-linked projects
* Supports both organization and user projects
* Uses `gh project item-add` to add issues to projects
* Gracefully handles cases where no project is linked
- Issue type feature requires organization-level setup (default types: Task, Bug, Feature)

## Error Handling

- If template type is invalid, show available templates and ask again
- If `gh` CLI is not available, guide user to install it
- If issue type setting fails (e.g., feature not available), show warning but continue
- If no GitHub Project is linked to repository, show informative message
- If project assignment fails, show warning but don't fail issue creation
- Provide clear feedback on each step of the process (issue created, type set, project assigned)