From f35a321d6c42d3b3c34f315970f4008529545e01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=98=81=EC=B0=BD=28piknow=29?= Date: Sun, 12 Oct 2025 17:09:57 +0900 Subject: [PATCH 1/3] agent: add make-task-issue command for streamlined issue creation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Requirement: Create a custom Claude Code slash command that simplifies GitHub issue creation by utilizing existing templates, automatically setting issue type to "Task", and assigning issues to the repository's linked GitHub Project. Implementation: - Created .claude/commands/make-task-issue.md with comprehensive workflow - Supports all 9 issue templates (feat, fix, doc, config, refactor, agent, bug, test, perf) - Flexible usage: with arguments or interactive mode - Automatic issue type setting to "Task" via GitHub API - Automatic GitHub Project assignment using gh project item-add - Template-based label application (e.g., feat template applies "feat" label) - Auto-assignment to creator via existing auto-assign workflow - Comprehensive error handling for invalid templates, missing CLI, and failed operations - Graceful degradation when issue types or projects are not available 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .claude/commands/make-task-issue.md | 103 ++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 .claude/commands/make-task-issue.md diff --git a/.claude/commands/make-task-issue.md b/.claude/commands/make-task-issue.md new file mode 100644 index 0000000..2ff2054 --- /dev/null +++ b/.claude/commands/make-task-issue.md @@ -0,0 +1,103 @@ +--- +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 issue_type='task'` + - This categorizes the issue as a "Task" type in GitHub's issue tracking system + - Note: 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 + - First, get the project linked to the repository: + * Use: `gh project list --owner {owner}` to find projects + * Or query linked projects: `gh api repos/{owner}/{repo}/projects` + - Then add the issue to the project: + * Use: `gh project item-add {project-number} --owner {owner} --url {issue-url}` + * Or use GraphQL API for more control + - If no project is linked or command fails, show informative message but don't fail issue creation + +## 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: + * 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) From 351df6c16192faec49fb1482e649611ac5518bec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=98=81=EC=B0=BD=28piknow=29?= Date: Sun, 19 Oct 2025 17:53:58 +0900 Subject: [PATCH 2/3] agent: add agent type to custom commands MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Requirement: Support 'agent' commit type across all custom commands to properly categorize agent-related changes such as rules, commands, and automation updates. Implementation: - Added 'agent' type to make-branch type prefix list - Added 'agent' type to make-commit type prefix list - Added 'agent' type to make-pr type prefix list 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .claude/commands/make-branch.md | 1 + .claude/commands/make-commit.md | 1 + .claude/commands/make-pr.md | 1 + 3 files changed, 3 insertions(+) diff --git a/.claude/commands/make-branch.md b/.claude/commands/make-branch.md index f84aa3c..b3cc6df 100644 --- a/.claude/commands/make-branch.md +++ b/.claude/commands/make-branch.md @@ -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 diff --git a/.claude/commands/make-commit.md b/.claude/commands/make-commit.md index 94aa30c..04c1b1f 100644 --- a/.claude/commands/make-commit.md +++ b/.claude/commands/make-commit.md @@ -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 diff --git a/.claude/commands/make-pr.md b/.claude/commands/make-pr.md index a642734..af366c9 100644 --- a/.claude/commands/make-pr.md +++ b/.claude/commands/make-pr.md @@ -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 From af2ba1aadb649ce8bea02d32efee6ca68bef62f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=98=81=EC=B0=BD=28piknow=29?= Date: Sun, 19 Oct 2025 17:54:08 +0900 Subject: [PATCH 3/3] agent: improve make-task-issue with efficient GraphQL and correct API usage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Requirement: Improve make-task-issue command to use efficient project lookup and correct GitHub API field names for issue type assignment. Implementation: - Updated to use GraphQL repository.projectsV2 query for efficient project lookup - Changed from listing all org projects to querying only repository-linked projects - Fixed issue type API field from 'issue_type' to 'type' with capitalized values - Added GraphQL query example and implementation notes 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .claude/commands/make-task-issue.md | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/.claude/commands/make-task-issue.md b/.claude/commands/make-task-issue.md index 2ff2054..4e2ae68 100644 --- a/.claude/commands/make-task-issue.md +++ b/.claude/commands/make-task-issue.md @@ -52,19 +52,33 @@ The following issue templates are available in `.github/ISSUE_TEMPLATE/`: 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 issue_type='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: Issue types are an organization-level feature and may not be available in all repositories + - 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 - - First, get the project linked to the repository: - * Use: `gh project list --owner {owner}` to find projects - * Or query linked projects: `gh api repos/{owner}/{repo}/projects` - - Then add the issue to the 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}` - * Or use GraphQL API for more control - 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 @@ -88,6 +102,7 @@ Prompts for template selection and title - 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