mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-09 07:09:11 +02:00
148 lines
6.6 KiB
YAML
148 lines
6.6 KiB
YAML
# Respond to /marvin mentions in issue comments (elastic mention-in-issue style)
|
|
# Calls run-claude directly
|
|
|
|
name: Comment on Issue
|
|
|
|
on:
|
|
issue_comment:
|
|
types: [created]
|
|
|
|
permissions:
|
|
actions: read
|
|
contents: write
|
|
issues: write
|
|
pull-requests: write
|
|
id-token: write
|
|
|
|
jobs:
|
|
comment:
|
|
if: |
|
|
!github.event.issue.pull_request &&
|
|
contains(github.event.comment.body, '/marvin') &&
|
|
contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association)
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 60
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v7
|
|
|
|
- name: Install UV
|
|
uses: astral-sh/setup-uv@v7
|
|
with:
|
|
enable-cache: true
|
|
cache-dependency-glob: "uv.lock"
|
|
|
|
- name: Install dependencies
|
|
run: uv sync --python 3.12
|
|
|
|
- name: Generate Marvin App token
|
|
id: marvin-token
|
|
uses: actions/create-github-app-token@v3
|
|
with:
|
|
app-id: ${{ secrets.MARVIN_APP_ID }}
|
|
private-key: ${{ secrets.MARVIN_APP_PRIVATE_KEY }}
|
|
|
|
- name: React to comment with eyes
|
|
env:
|
|
GH_TOKEN: ${{ steps.marvin-token.outputs.token }}
|
|
run: |
|
|
gh api "repos/${{ github.repository }}/issues/comments/${{ github.event.comment.id }}/reactions" -f content=eyes 2>/dev/null || true
|
|
|
|
- name: Run Claude for Issue Comment
|
|
uses: ./.github/actions/run-claude
|
|
env:
|
|
COMMENT_BODY: ${{ github.event.comment.body }}
|
|
ISSUE_TITLE: ${{ github.event.issue.title }}
|
|
with:
|
|
claude-oauth-token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
|
github-token: ${{ steps.marvin-token.outputs.token }}
|
|
trigger-phrase: "/marvin"
|
|
allowed-bots: "*"
|
|
allowed-tools: "Edit,MultiEdit,Glob,Grep,LS,Read,Write,WebSearch,WebFetch,mcp__github_comment__update_claude_comment,mcp__github_ci__get_ci_status,mcp__github_ci__get_workflow_run_details,mcp__github_ci__download_job_log,Bash(*),mcp__agents-md-generator__generate_agents_md,mcp__public-code-search__search_code"
|
|
prompt: |
|
|
<context>
|
|
Repository: ${{ github.repository }}
|
|
Issue Number: #${{ github.event.issue.number }}
|
|
Issue Title: ${{ env.ISSUE_TITLE }}
|
|
Issue Author: ${{ github.event.issue.user.login }}
|
|
Comment Author: ${{ github.event.comment.user.login }}
|
|
</context>
|
|
|
|
<user_request>
|
|
${{ env.COMMENT_BODY }}
|
|
</user_request>
|
|
|
|
<task>
|
|
You have been mentioned in a GitHub issue comment. Understand the request, gather context, complete the task, and respond with results.
|
|
</task>
|
|
|
|
<constraints>
|
|
You CAN: Read/analyze code, modify files, write code, run tests, execute commands, commit code, push changes, create branches, create pull requests
|
|
</constraints>
|
|
|
|
<allowed_tools>
|
|
You have access to the following tools (comma-separated list):
|
|
|
|
Edit,MultiEdit,Glob,Grep,LS,Read,Write,WebSearch,WebFetch,mcp__github_comment__update_claude_comment,mcp__github_ci__get_ci_status,mcp__github_ci__get_workflow_run_details,mcp__github_ci__download_job_log,Bash(*),mcp__agents-md-generator__generate_agents_md,mcp__public-code-search__search_code
|
|
|
|
You can only use tools that are explicitly listed above. For Bash commands, the pattern `Bash(command:*)` means you can run that command with any arguments. If a command is not listed, it is not available.
|
|
</allowed_tools>
|
|
|
|
<getting_started>
|
|
Use `mcp__agents-md-generator__generate_agents_md` to get repository context before responding.
|
|
</getting_started>
|
|
|
|
<investigation_approach>
|
|
Be thorough in your investigations:
|
|
- Understand the full context of the repository
|
|
- Review related code, issues, and PRs
|
|
- Consider edge cases and implications
|
|
- Gather all relevant information before responding
|
|
|
|
Available tools:
|
|
- `mcp__public-code-search__search_code`: Search code in OTHER repositories (use `Grep`/`Read` for this repo)
|
|
- `WebSearch`: Search the web for documentation, best practices, or solutions
|
|
- `WebFetch`: Fetch and read content from URLs
|
|
</investigation_approach>
|
|
|
|
<common_tasks>
|
|
- Answer questions about the codebase
|
|
- Help debug reported problems
|
|
- Suggest solutions or workarounds
|
|
- Provide code examples
|
|
- Help clarify requirements
|
|
- Link to relevant documentation or code
|
|
- Create branches, commit changes, and open PRs when asked
|
|
</common_tasks>
|
|
|
|
<response_guidelines>
|
|
- Lead with a tl;dr — the bottom line in 1-3 sentences, always visible. The reader should be able to act without expanding anything.
|
|
- Push supporting detail (code analysis, verification output, related items) into collapsible `<details>` blocks. These are appendices, not the main message.
|
|
- Short responses (a few sentences) don't need collapsible sections at all.
|
|
- Be concise and actionable.
|
|
- If the request is unclear, ask clarifying questions.
|
|
- Report findings and recommendations — not your process. Do not include task checklists or "steps I took" narration.
|
|
- Every claim needs evidence: cite file paths, line numbers, or command output. Never say "the code does X" without pointing to where.
|
|
- If you're uncertain, say so. "I couldn't confirm this" is better than a speculative answer.
|
|
</response_guidelines>
|
|
|
|
<github_safety>
|
|
- Do not write `fixes #N`, `closes #N`, or `resolves #N` in comments — these can accidentally close issues.
|
|
- When referencing issues, use plain `#N` or link syntax without action keywords.
|
|
</github_safety>
|
|
|
|
<response_footer>
|
|
Always end your comment with a new line, three dashes, and the footer message:
|
|
<exact_content>
|
|
|
|
---
|
|
Marvin Context Protocol | Type `/marvin` to interact further
|
|
|
|
Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.
|
|
</exact_content>
|
|
</response_footer>
|
|
|
|
<github_formatting>
|
|
When writing GitHub comments, wrap branch names, tags, or other @-references in backticks (e.g., `@main`, `@v1.0`) to avoid accidentally pinging users. Do not add backticks around terms that are already inside backticks or code blocks.
|
|
</github_formatting>
|