Initial commit

This commit is contained in:
Zhongwei Li
2025-11-29 18:47:43 +08:00
commit 3478f1b4e3
25 changed files with 2166 additions and 0 deletions

View File

@@ -0,0 +1,61 @@
---
name: create-comment
description: Add comment to issue in tracking system
argument-hint: [issue-key] "[comment-text]" [state-management-file-path]
model: claude-haiku-4-5
allowed-tools: Read, Bash(echo:*)
---
# Create Issue Comment Command
## Purpose
Add a comment to an issue in the configured issue tracking system.
This command is called by other orchestrating commands, and is one of the steps in a larger workflow.
You MUST follow all workflow steps below, not skipping any step and doing all steps in order.
## Arguments
- `$1`: Issue key (required)
- `$2`: Comment text (required)
- `$3`: Path to state management file (required)
## Workflow Steps
1. **Read Settings from State Management File**:
- Read the Settings section from the state management file ($3)
- Extract `issueTrackingProvider` and `silentMode` values
- If Settings section is missing, fail with error: "Settings not found in state management file. Run /read-settings first."
2. **Validate Provider Configuration**:
- If issueTrackingProvider is "linear":
- Check that Linear MCP tools are available
- If NOT available: **FAIL with error**: "Provider is 'linear' but Linear MCP tools are not configured. Please configure Linear MCP or update settings with /read-settings --provider=prompt"
- If issueTrackingProvider is "jira":
- Check that Jira MCP tools are available
- If NOT available: **FAIL with error**: "Provider is 'jira' but Jira MCP tools are not configured. Please configure Jira MCP or update settings with /read-settings --provider=prompt"
3. **Check Silent Mode or Prompt Issue Provider**:
- If silentMode is true OR issueTrackingProvider is "prompt":
- Log the comment operation locally: "Silent mode: Would have added comment to $1: $2"
- Skip the actual API call (step 4)
- Continue to step 5
4. **Execute Create Comment Operation** (only if silentMode is false and issueTrackingProvider is not "prompt"):
### For Linear Provider (`"linear"`)
- Use `linear:create_comment` with $1 (issue ID) and $2 (comment text)
- Add the comment to the specified issue
### For Jira Provider (`"jira"`)
- Use `jira:add_comment_to_issue` with $1 (issue key) and $2 (comment text)
- Add the comment to the specified issue
5. **Output Results**: Display confirmation of the comment creation:
- **Issue**: $1
- **Comment Added**: $2
- **Result**: Success/Failure (or "Skipped - Silent Mode" if applicable)
6. **Error Handling**: If the issue operation fails, log the error but continue gracefully

View File

@@ -0,0 +1,60 @@
---
name: get-issue
description: Retrieve issue details from tracking system
argument-hint: [issue-key] [state-management-file-path]
model: claude-haiku-4-5
allowed-tools: Read, Bash(echo:*)
---
# Get Issue Command
## Purpose
Retrieve issue details from the configured issue tracking system for a given issue key.
This command is called by other orchestrating commands, and is one of the steps in a larger workflow.
You MUST follow all workflow steps below, not skipping any step and doing all steps in order.
## Arguments
- `$1`: Issue key (required)
- `$2`: Path to state management file (required)
## Workflow Steps
1. **Read Settings from State Management File**:
- Read the Settings section from the state management file ($2)
- Extract `issueTrackingProvider` value
- If Settings section is missing or issueTrackingProvider is not set, fail with error: "Settings not found in state management file. Run /read-settings first."
2. **Validate Provider Configuration**:
- If issueTrackingProvider is "linear":
- Check that Linear MCP tools are available
- If NOT available: **FAIL with error**: "Provider is 'linear' but Linear MCP tools are not configured. Please configure Linear MCP or update settings with /read-settings --provider=prompt"
- If issueTrackingProvider is "jira":
- Check that Jira MCP tools are available
- If NOT available: **FAIL with error**: "Provider is 'jira' but Jira MCP tools are not configured. Please configure Jira MCP or update settings with /read-settings --provider=prompt"
- If issueTrackingProvider is "prompt":
- Log error: "get-issue should not be called for prompt provider"
- Skip to step 4
3. **Execute Get Issue Operation**:
Based on the `issueTrackingProvider` value from the state management file:
### For Linear Provider (`"linear"`)
- Use `linear:get_issue` with $1 (issue key)
- Retrieve issue key, ID, title, and description
### For Jira Provider (`"jira"`)
- Use `jira:get_issue` with $1 (issue key)
- Retrieve issue key, ID, title, and description
4. **Output Results**: Display the issue information in this format:
- **Key**: $1
- **ID**: Issue ID
- **Title**: Issue title
- **Description**: Issue description
5. **Error Handling**: If the issue operation fails, log the error but continue gracefully

View File

@@ -0,0 +1,28 @@
---
name: read-issue
description: Fetch issue details from tracking system
argument-hint: [issue-key] [state-management-file-path]
model: claude-haiku-4-5
---
# Read Issue Command
## Purpose
Read issue from the configured issue tracking system and add the information to the state management file.
These instructions are read and followed as part of a larger workflow.
You MUST follow all workflow steps below, not skipping any step and doing all steps in order.
## Workflow Steps
1. Get issue details:
- Use the SlashCommand tool to execute `/get-issue $1 $2`
2. Note findings in the state management file ($2)
Create a new section called `## Issue Information`, with information on this format:
- **Key**: $1
- **ID**: Issue ID (from get-issue response)
- **Title**: Issue title (from get-issue response)
- **Description**: Issue description (from get-issue response)

View File

@@ -0,0 +1,68 @@
---
name: update-issue
description: Update issue status in tracking system
argument-hint: [issue-key] [status] [state-management-file-path]
model: claude-haiku-4-5
allowed-tools: Read, Bash(echo:*)
---
# Update Issue Command
## Purpose
Update the status of an issue in the configured issue tracking system.
This command is called by other orchestrating commands, and is one of the steps in a larger workflow.
You MUST follow all workflow steps below, not skipping any step and doing all steps in order.
Expected status values: "In Progress", "Code Review"
## Arguments
- `$1`: Issue key (required)
- `$2`: Status to set (required)
- `$3`: Path to state management file (required)
## Workflow Steps
1. **Read Settings from State Management File**:
- Read the Settings section from the state management file ($3)
- Extract `issueTrackingProvider` and `silentMode` values
- If Settings section is missing, fail with error: "Settings not found in state management file. Run /read-settings first."
2. **Validate Provider Configuration**:
- If issueTrackingProvider is "linear":
- Check that Linear MCP tools are available
- If NOT available: **FAIL with error**: "Provider is 'linear' but Linear MCP tools are not configured. Please configure Linear MCP or update settings with /read-settings --provider=prompt"
- If issueTrackingProvider is "jira":
- Check that Jira MCP tools are available
- If NOT available: **FAIL with error**: "Provider is 'jira' but Jira MCP tools are not configured. Please configure Jira MCP or update settings with /read-settings --provider=prompt"
3. **Check Silent Mode or Prompt Issue Provider**:
- If silentMode is true OR issueTrackingProvider is "prompt":
- Log the status update operation locally: "Silent mode: Would have updated $1 status to '$2'"
- Skip the actual API calls (step 4)
- Continue to step 5
4. **Execute Update Status Operation** (only if silentMode is false and issueTrackingProvider is not "prompt"):
### For Linear Provider (`"linear"`)
- First, use `linear:list_issue_statuses` to get all available statuses for $1
- Find the best match for $2 (handles typos/variations)
- Use `linear:update_issue` with $1 to set the issue to the matched status
- If no exact match is found, use the closest matching status name
### For Jira Provider (`"jira"`)
- First, use `jira:get_transitions_for_issue` with $1 to get all available columns
- Find the best match for $2 (handles typos/variations)
- Use `jira:transition_issue` with $1 to move the issue to the matched transition
- If no exact match is found, use the closest matching status name
5. **Output Results**: Display confirmation of the status update:
- **Issue**: $1
- **Previous Status**: [if available]
- **New Status**: $2
- **Result**: Success/Failure (or "Skipped - Silent Mode" if applicable)
6. **Error Handling**: If the issue operation fails, log the error but continue gracefully