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
34 changes: 34 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ on:
push:
branches: [main]
pull_request:
types: [opened, ready_for_review]
issue_comment:
types: [created]

permissions:
contents: read
pull-requests: write
checks: write
id-token: write
actions: read

jobs:
pre-commit:
Expand All @@ -20,3 +30,27 @@ jobs:

- name: Run pre-commit
uses: pre-commit/action@v3.0.1

code-review-auto:
name: Code Review (Auto)
needs: [pre-commit]
if: |
github.event_name == 'pull_request' &&
github.event.pull_request.draft == false
uses: ./.github/workflows/code-review.yml
with:
trigger_type: auto
secrets:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}

code-review-manual:
name: Code Review (Manual)
if: |
github.event_name == 'issue_comment' &&
github.event.issue.pull_request &&
contains(github.event.comment.body, '/review')
uses: ./.github/workflows/code-review.yml
with:
trigger_type: comment
secrets:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
121 changes: 121 additions & 0 deletions .github/workflows/issue-followup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
name: Issue Follow-up

on:
workflow_call:
inputs:
allowed_tools:
description: 'Comma-separated list of allowed tools for Claude'
type: string
required: false
default:
'Read,Write,Edit,Grep,Glob,LS,Bash(git:*),Bash(gh
pr:*),Bash(npm:*),Bash(bun:*),mcp__linear__*'
prompt:
description:
'Custom prompt to override the default follow-up behavior (leave empty
for default)'
type: string
required: false
default: ''
secrets:
claude_code_oauth_token:
description: 'Claude Code OAuth token'
required: true
linear_api_token:
description: 'Linear API token'
required: true

repository_dispatch:
types: [linear-followup]

permissions:
contents: write
pull-requests: write
issues: write
id-token: write

jobs:
followup:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Process Follow-up
uses: anthropics/claude-code-action@v1
env:
LINEAR_API_TOKEN:
${{ secrets.linear_api_token || secrets.LINEAR_API_TOKEN }}
with:
claude_code_oauth_token:
${{ secrets.claude_code_oauth_token ||
secrets.CLAUDE_CODE_OAUTH_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
track_progress: true
settings: |
{
"mcpServers": {
"linear": {
"command": "npx",
"args": ["-y", "@tacticlaunch/mcp-linear"]
}
}
}
claude_args:
--allowedTools "${{ inputs.allowed_tools ||
github.event.client_payload.allowed_tools ||
'Read,Write,Edit,Grep,Glob,LS,Bash(git:*),Bash(gh
pr:*),Bash(npm:*),Bash(bun:*),mcp__linear__*' }}"
prompt: |
${{ inputs.prompt || github.event.client_payload.prompt || format('**Linear Issue Follow-up**

Issue: {0}
Issue ID: {1}
Title: {2}

The user has sent you a follow-up message:

---
{3}
---

## Instructions

### 1. Understand the Context
- Use Linear MCP to fetch the full issue details for {1}
- Review the issue description, previous comments, and any existing work
- Check if there are any open PRs related to this issue

### 2. Process the Request
Based on what the user is asking, take the appropriate action:

**If they are asking a question:**
- Research the codebase to find the answer
- Provide a clear, helpful response

**If they want code changes:**
- Make the requested changes
- If there is an existing PR, update it
- If not, create a new branch and PR

**If they want to update an existing PR:**
- Find the existing PR for this issue
- Make the requested changes on that branch
- Push the updates

**If they are providing feedback:**
- Acknowledge the feedback
- Make any necessary adjustments

### 3. Respond via Linear
- Add a comment to the Linear ticket with your response
- Include any relevant details (code changes made, PR links, answers to questions)
- Be concise but thorough

Be helpful and responsive. Focus on what the user is asking.',
github.event.client_payload.issue_url,
github.event.client_payload.issue_id,
github.event.client_payload.issue_title,
github.event.client_payload.user_prompt) }}
111 changes: 111 additions & 0 deletions .github/workflows/issue-implement.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
name: Issue Implementation

on:
workflow_call:
inputs:
allowed_tools:
description: 'Comma-separated list of allowed tools for Claude'
type: string
required: false
default:
'Read,Write,Edit,Grep,Glob,LS,Bash(git:*),Bash(gh
pr:*),Bash(npm:*),Bash(bun:*),mcp__linear__*'
prompt:
description:
'Custom prompt to override the default implementation behavior (leave
empty for default)'
type: string
required: false
default: ''
secrets:
claude_code_oauth_token:
description: 'Claude Code OAuth token'
required: true
linear_api_token:
description: 'Linear API token'
required: true

repository_dispatch:
types: [linear-implement]

permissions:
contents: write
pull-requests: write
issues: write
id-token: write

jobs:
implement:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Implement Issue
uses: anthropics/claude-code-action@v1
env:
LINEAR_API_TOKEN:
${{ secrets.linear_api_token || secrets.LINEAR_API_TOKEN }}
with:
claude_code_oauth_token:
${{ secrets.claude_code_oauth_token ||
secrets.CLAUDE_CODE_OAUTH_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
track_progress: true
settings: |
{
"mcpServers": {
"linear": {
"command": "npx",
"args": ["-y", "@tacticlaunch/mcp-linear"]
}
}
}
claude_args:
--allowedTools "${{ inputs.allowed_tools ||
github.event.client_payload.allowed_tools ||
'Read,Write,Edit,Grep,Glob,LS,Bash(git:*),Bash(gh
pr:*),Bash(npm:*),Bash(bun:*),mcp__linear__*' }}"
prompt: |
${{ inputs.prompt || github.event.client_payload.prompt || format('**Linear Issue Implementation Task**

A Linear issue needs implementation: {0}
Issue ID: {1}
Title: {2}

## Your Tasks

### 1. Fetch Issue Details
- Use Linear MCP to fetch the full issue details for {1}
- Review the issue description, acceptance criteria, and any comments

### 2. Understand the Codebase
- Search for related code, components, or existing implementations
- Identify the files that need to be modified or created
- Understand the existing patterns and conventions

### 3. Implement the Feature/Fix
- Create a new branch for this work (use git)
- Implement the changes following existing code patterns
- Write clean, well-structured code
- Add or update tests as appropriate
- Ensure the code compiles and tests pass

### 4. Create Pull Request
- Commit your changes with a clear commit message
- Push the branch and create a pull request using gh cli
- Include a description of the changes and link to the Linear issue

### 5. Update Linear Ticket
- Add a comment to the Linear ticket with:
- Link to the pull request
- Summary of changes made
- Any notes for reviewers
- Update the ticket status to "In Review"

Be thorough but efficient. Follow existing code conventions.',
github.event.client_payload.url,
github.event.client_payload.issue_id,
github.event.client_payload.title) }}
74 changes: 31 additions & 43 deletions .github/workflows/issue-triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@ name: Issue Triage
on:
workflow_call:
inputs:
linear_team_prefix:
description:
'Linear team prefix for ticket references (e.g., "PROJ" for PROJ-123)'
type: string
required: false
default: ''
allowed_tools:
description: 'Comma-separated list of allowed tools for Claude'
type: string
Expand All @@ -30,6 +24,9 @@ on:
description: 'Linear API token'
required: true

repository_dispatch:
types: [linear-triage]

permissions:
contents: read
pull-requests: read
Expand All @@ -48,9 +45,12 @@ jobs:
- name: Triage Issue
uses: anthropics/claude-code-action@v1
env:
LINEAR_API_TOKEN: ${{ secrets.linear_api_token }}
LINEAR_API_TOKEN:
${{ secrets.linear_api_token || secrets.LINEAR_API_TOKEN }}
with:
claude_code_oauth_token: ${{ secrets.claude_code_oauth_token }}
claude_code_oauth_token:
${{ secrets.claude_code_oauth_token ||
secrets.CLAUDE_CODE_OAUTH_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
track_progress: true
settings: |
Expand All @@ -62,53 +62,41 @@ jobs:
}
}
}
claude_args: --allowedTools "${{ inputs.allowed_tools }}"
claude_args:
--allowedTools "${{ inputs.allowed_tools ||
github.event.client_payload.allowed_tools ||
'Read,Grep,Glob,LS,Bash(gh issue:*),Bash(gh label:*),mcp__linear__*'
}}"
prompt: |
${{ inputs.prompt || format('**Issue Triage Task**
${{ inputs.prompt || github.event.client_payload.prompt || format('**Linear Issue Triage Task**

A new GitHub issue has been created. Linear is the source of truth for all tickets.
A Linear issue needs triage: {0}
Issue ID: {1}
Title: {2}

## Your Tasks

### 1. Understand the Request
- Read the issue title and description
- Identify type: bug, feature, enhancement, or question
- Determine scope and complexity
### 1. Fetch Issue Details
- Use Linear MCP to fetch the full issue details for {1}
- Review the issue description, labels, and current status

### 2. Research the Codebase
- Search for related code, components, or existing implementations
- Identify files that would likely need changes
- Check for similar functionality

### 3. Ask Clarifying Questions (if needed)
- If vague or missing key info, ask specific questions
- For bugs: request reproduction steps, expected vs actual behavior
- For features: clarify acceptance criteria

### 4. Apply Labels
Use `gh label list` to see available labels, then apply appropriate ones:
```bash
gh issue edit $ISSUE_NUMBER --add-label "bug" --add-label "priority:high"
```

### 5. Linear Integration
Check if this issue is already linked to a Linear ticket (look for {0}-XXX in the issue body or comments).

**If NO Linear ticket exists:**
- Use the Linear MCP tools to create a new ticket
- Link it back to this GitHub issue
- Add a comment with the Linear ticket ID (e.g., "Created Linear ticket: {0}-123")

**If a Linear ticket already exists:**
- Fetch the ticket details using Linear MCP
- Update the GitHub issue with any additional context from Linear

### 6. Provide Analysis Summary
Comment with:
- Your understanding of the request
### 3. Update Linear Ticket
Update the Linear ticket with your analysis:
- Files/components likely involved
- Complexity estimate (small/medium/large)
- Any dependencies or blockers
- Linear ticket reference
- Implementation suggestions or approach

### 4. Update Ticket Status
- Move the ticket from Triage to the appropriate next status
- Add any relevant labels if needed

Be concise and actionable.', inputs.linear_team_prefix) }}
Be concise and actionable.',
github.event.client_payload.url,
github.event.client_payload.issue_id,
github.event.client_payload.title) }}
Loading