Jeremiah Lowin commited on
Commit
10b8a90
·
unverified ·
1 Parent(s): c30074f

Add Claude issue triage (#1510)

Browse files
.github/workflows/{claude-dedupe-issues.yml → marvin-dedupe-issues.yml} RENAMED
File without changes
.github/workflows/marvin-label-triage.yml ADDED
@@ -0,0 +1,144 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Marvin Label Triage
2
+ description: Automatically triage GitHub issues and PRs using Marvin
3
+ on:
4
+ issues:
5
+ types: [opened]
6
+ pull_request:
7
+ types: [opened]
8
+ workflow_dispatch:
9
+ inputs:
10
+ issue_number:
11
+ description: "Issue or PR number to triage"
12
+ required: true
13
+ type: string
14
+
15
+ jobs:
16
+ triage-issue:
17
+ runs-on: ubuntu-latest
18
+ timeout-minutes: 10
19
+ permissions:
20
+ contents: read
21
+ issues: write
22
+ pull-requests: write
23
+
24
+ steps:
25
+ - name: Checkout repository
26
+ uses: actions/checkout@v4
27
+
28
+ - name: Generate Marvin App token
29
+ id: marvin-token
30
+ uses: actions/create-github-app-token@v2
31
+ with:
32
+ app-id: ${{ secrets.MARVIN_APP_ID }}
33
+ private-key: ${{ secrets.MARVIN_APP_PRIVATE_KEY }}
34
+
35
+ - name: Create triage prompt
36
+ run: |
37
+ mkdir -p /tmp/claude-prompts
38
+ cat > /tmp/claude-prompts/triage-prompt.txt << 'EOF'
39
+ You're an issue triage assistant for FastMCP, a Python framework for building Model Context Protocol servers and clients. Your task is to analyze issues/PRs and apply appropriate labels.
40
+
41
+ IMPORTANT: Your ONLY action should be to apply labels using mcp__github__update_issue. DO NOT post any comments.
42
+
43
+ Issue/PR Information:
44
+ - REPO: ${{ github.repository }}
45
+ - NUMBER: ${{ github.event.issue.number || github.event.pull_request.number || inputs.issue_number }}
46
+ - TYPE: ${{ github.event.issue && 'issue' || github.event.pull_request && 'pull_request' || 'unknown' }}
47
+
48
+ TRIAGE PROCESS:
49
+
50
+ 1. Get available labels:
51
+ Run: `gh label list`
52
+
53
+ 2. Retrieve issue/PR details using GitHub tools:
54
+ - mcp__github__get_issue: Get the issue/PR details
55
+ - mcp__github__get_issue_comments: Read any discussion
56
+ - If the issue/PR mentions other issues (e.g., "fixes #123", "related to #456"), use mcp__github__get_issue to read those linked issues for additional context
57
+
58
+ 3. Analyze and apply labels based on these guidelines:
59
+
60
+ CORE CATEGORIES (apply EXACTLY ONE - these are mutually exclusive):
61
+ - bug: Reports of broken functionality OR PRs that fix bugs
62
+ - enhancement: New functions/endpoints, improvements to existing features, internal tooling, workflow improvements, minor new capabilities
63
+ - feature: ONLY for major headline functionality worthy of a blog post announcement (2-4 per release, never for issues)
64
+ - documentation: Primary change is to docs, examples, or guides
65
+
66
+ FEATURE vs ENHANCEMENT guidance:
67
+ - feature: Major systems like new auth systems, MCP composition, proxying MCP servers, major CLI commands that transform workflows
68
+ - enhancement: New functions/endpoints, internal workflows, CI improvements, developer tooling, refactoring, utilities, typical new CLI commands
69
+ - If unsure between feature/enhancement, choose enhancement
70
+
71
+ Note: If a PR fixes a bug, label it "bug" not "enhancement"
72
+
73
+ SPECIAL CATEGORY (can be combined with above):
74
+ - breaking change: Changes that break backward compatibility (in addition to core category)
75
+
76
+ PRIORITY (apply if clearly evident):
77
+ - high-priority: Critical bugs affecting many users, security issues, or blocking core functionality
78
+ - low-priority: Edge cases, nice-to-have improvements, or cosmetic issues
79
+ - Default to no priority label if unclear
80
+
81
+ STATUS (apply if applicable):
82
+ - needs more info: Issue lacks reproduction steps, error messages, or clear description
83
+ - good first issue: ONLY if it's clearly scoped, has obvious solution, and touches limited files
84
+ - invalid: Spam, completely off-topic, or nonsensical (often LLM-generated)
85
+
86
+ AREA LABELS (apply ONLY when thematically central to the issue):
87
+ - cli: Issues primarily about FastMCP CLI commands (run, dev, install)
88
+ - client: Issues primarily about the Client SDK or client-side functionality
89
+ - server: Issues primarily about FastMCP server implementation
90
+ - auth: Authentication is the main concern (Bearer, JWT, OAuth, WorkOS)
91
+ - openapi: OpenAPI integration/parsing is the primary topic
92
+ - http: HTTP transport or networking is the main issue
93
+ - contrib: Specifically about community contributions in src/contrib/
94
+
95
+ IMPORTANT LABELING RULES:
96
+ - Be selective - only apply labels that are clearly relevant
97
+ - Don't apply area labels just because a file in that area is mentioned
98
+ - The issue must be PRIMARILY about that area to get the label
99
+ - When in doubt, don't apply the label
100
+ - Apply 2-5 labels total typically (category + maybe priority + maybe 1-2 areas)
101
+
102
+ META LABELS (rarely needed for issues):
103
+ - dependencies: Only for dependabot PRs or issues specifically about package updates
104
+ - DON'T MERGE: Only if PR author explicitly states it's not ready
105
+
106
+ 4. Apply selected labels:
107
+ Use mcp__github__update_issue to apply your selected labels
108
+ DO NOT post any comments
109
+ EOF
110
+
111
+ - name: Setup GitHub MCP Server
112
+ run: |
113
+ mkdir -p /tmp/mcp-config
114
+ cat > /tmp/mcp-config/mcp-servers.json << 'EOF'
115
+ {
116
+ "mcpServers": {
117
+ "github": {
118
+ "command": "docker",
119
+ "args": [
120
+ "run",
121
+ "-i",
122
+ "--rm",
123
+ "-e",
124
+ "GITHUB_PERSONAL_ACCESS_TOKEN",
125
+ "ghcr.io/github/github-mcp-server:sha-7aced2b"
126
+ ],
127
+ "env": {
128
+ "GITHUB_PERSONAL_ACCESS_TOKEN": "${{ steps.marvin-token.outputs.token }}"
129
+ }
130
+ }
131
+ }
132
+ }
133
+ EOF
134
+
135
+ - name: Run Marvin for Issue Triage
136
+ uses: anthropics/claude-code-base-action@beta
137
+ with:
138
+ prompt_file: /tmp/claude-prompts/triage-prompt.txt
139
+ allowed_tools: "Bash(gh label list),mcp__github__get_issue,mcp__github__get_issue_comments,mcp__github__update_issue"
140
+ timeout_minutes: "5"
141
+ anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
142
+ mcp_config: /tmp/mcp-config/mcp-servers.json
143
+ claude_env: |
144
+ GH_TOKEN: ${{ steps.marvin-token.outputs.token }}