Skip to content

Commit 89b2609

Browse files
author
linkmluser
committed
initial commit
0 parents  commit 89b2609

32 files changed

+7369
-0
lines changed

.copier-answers.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Changes here will be overwritten by Copier
2+
_commit: 08e42af
3+
_src_path: /Users/cjm/repos/monarch-project-copier
4+
copyright_year: '2025'
5+
email: my-name@my-org.org
6+
full_name: My Name
7+
gh_action_docs_preview: false
8+
github_handle: linkmluser
9+
github_org: linkml
10+
license: Apache-2.0
11+
project_description: Generic data browser static site builder
12+
project_name: linkml-browser
13+
project_slug: linkml_browser
14+
Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
name: "Claude Code Action"
2+
description: "Run Claude Code in GitHub Actions workflows"
3+
4+
inputs:
5+
github_token:
6+
description: "GitHub token with repo and issues permissions"
7+
required: true
8+
anthropic_api_key:
9+
description: "Anthropic API key"
10+
required: true
11+
cborg_api_key:
12+
description: "CBORG API key"
13+
required: true
14+
prompt:
15+
description: "The prompt to send to Claude Code"
16+
required: false
17+
default: ""
18+
prompt_file:
19+
description: "Path to a file containing the prompt to send to Claude Code"
20+
required: false
21+
default: ""
22+
allowed_tools:
23+
description: "Comma-separated list of allowed tools for Claude Code to use"
24+
required: false
25+
default: ""
26+
output_file:
27+
description: "File to save Claude Code output to (optional)"
28+
required: false
29+
default: ""
30+
timeout_minutes:
31+
description: "Timeout in minutes for Claude Code execution"
32+
required: false
33+
default: "10"
34+
install_github_mcp:
35+
description: "Whether to install the GitHub MCP server"
36+
required: false
37+
default: "false"
38+
install_artl_mcp:
39+
description: "Whether to install the ARTL MCP server"
40+
required: false
41+
default: "false"
42+
43+
44+
runs:
45+
using: "composite"
46+
steps:
47+
- name: Install uvx
48+
shell: bash
49+
run: |
50+
curl -LsSf https://astral.sh/uv/install.sh | sh
51+
source $HOME/.cargo/env
52+
which uvx || echo "uvx not found in PATH, installing via pip"
53+
pip install uv || true
54+
55+
- name: Install Claude Code
56+
shell: bash
57+
run: npm install -g @anthropic-ai/claude-code
58+
59+
- name: Install GitHub MCP Server
60+
if: inputs.install_github_mcp == 'true'
61+
shell: bash
62+
run: |
63+
claude mcp add-json github '{
64+
"command": "docker",
65+
"args": [
66+
"run",
67+
"-i",
68+
"--rm",
69+
"-e",
70+
"GITHUB_PERSONAL_ACCESS_TOKEN",
71+
"ghcr.io/github/github-mcp-server:sha-ff3036d"
72+
],
73+
"env": {
74+
"GITHUB_PERSONAL_ACCESS_TOKEN": "${{ inputs.GITHUB_TOKEN }}"
75+
}
76+
}'
77+
78+
- name: Install ARTL MCP Server
79+
if: inputs.install_artl_mcp == 'true'
80+
shell: bash
81+
run: |
82+
claude mcp add-json artl '{
83+
"command": "uvx",
84+
"args": [
85+
"artl-mcp"
86+
]
87+
}'
88+
89+
- name: Prepare Prompt File
90+
shell: bash
91+
id: prepare_prompt
92+
run: |
93+
# Check if either prompt or prompt_file is provided
94+
if [ -z "${{ inputs.prompt }}" ] && [ -z "${{ inputs.prompt_file }}" ]; then
95+
echo "::error::Neither 'prompt' nor 'prompt_file' was provided. At least one is required."
96+
exit 1
97+
fi
98+
99+
# Determine which prompt source to use
100+
if [ ! -z "${{ inputs.prompt_file }}" ]; then
101+
# Check if the prompt file exists
102+
if [ ! -f "${{ inputs.prompt_file }}" ]; then
103+
echo "::error::Prompt file '${{ inputs.prompt_file }}' does not exist."
104+
exit 1
105+
fi
106+
107+
# Use the provided prompt file
108+
PROMPT_PATH="${{ inputs.prompt_file }}"
109+
else
110+
mkdir -p /tmp/claude-action
111+
PROMPT_PATH="/tmp/claude-action/prompt.txt"
112+
echo "${{ inputs.prompt }}" > "$PROMPT_PATH"
113+
fi
114+
115+
# Verify the prompt file is not empty
116+
if [ ! -s "$PROMPT_PATH" ]; then
117+
echo "::error::Prompt is empty. Please provide a non-empty prompt."
118+
exit 1
119+
fi
120+
121+
# Save the prompt path for the next step
122+
echo "PROMPT_PATH=$PROMPT_PATH" >> $GITHUB_ENV
123+
124+
- name: Run Claude Code
125+
shell: bash
126+
id: run_claude
127+
run: |
128+
ALLOWED_TOOLS_ARG=""
129+
if [ ! -z "${{ inputs.allowed_tools }}" ]; then
130+
ALLOWED_TOOLS_ARG="--allowedTools ${{ inputs.allowed_tools }}"
131+
fi
132+
133+
# Set a timeout to ensure the command doesn't run indefinitely
134+
timeout_seconds=$((${{ inputs.timeout_minutes }} * 60))
135+
136+
if [ -z "${{ inputs.output_file }}" ]; then
137+
# Run Claude Code and output to console
138+
timeout $timeout_seconds claude \
139+
-p \
140+
--verbose \
141+
--output-format stream-json \
142+
"$(cat ${{ env.PROMPT_PATH }})" \
143+
${{ inputs.allowed_tools != '' && format('--allowedTools "{0}"', inputs.allowed_tools) || '' }}
144+
else
145+
# Run Claude Code and tee output to console and file
146+
timeout $timeout_seconds claude \
147+
-p \
148+
--verbose \
149+
--output-format stream-json \
150+
"$(cat ${{ env.PROMPT_PATH }})" \
151+
${{ inputs.allowed_tools != '' && format('--allowedTools "{0}"', inputs.allowed_tools) || '' }} | tee output.txt
152+
153+
# Process output.txt into JSON in a separate step
154+
jq -s '.' output.txt > output.json
155+
156+
# Extract the result from the last item in the array (system message)
157+
jq -r '.[-1].result' output.json > "${{ inputs.output_file }}"
158+
159+
echo "Complete output saved to output.json, final response saved to ${{ inputs.output_file }}"
160+
fi
161+
162+
env:
163+
ANTHROPIC_API_KEY: "."
164+
ANTHROPIC_AUTH_TOKEN: ${{ inputs.cborg_api_key }}
165+
GITHUB_TOKEN: ${{ inputs.github_token }}
166+
ANTHROPIC_BASE_URL: "https://api.cborg.lbl.gov"
167+
DISABLE_NON_ESSENTIAL_MODEL_CALLS: "1"
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: "Claude Issue summarize Action"
2+
description: "Automatically Summarize GitHub issues using Claude Code"
3+
4+
inputs:
5+
timeout_minutes:
6+
description: "Timeout in minutes for execution"
7+
required: false
8+
default: "5"
9+
anthropic_api_key:
10+
description: "Anthropic API key"
11+
required: true
12+
cborg_api_key:
13+
description: "CBORG API key"
14+
required: true
15+
github_token:
16+
description: "GitHub token with repo and issues permissions"
17+
required: true
18+
19+
runs:
20+
using: "composite"
21+
steps:
22+
- name: Checkout repository code
23+
uses: actions/checkout@v4
24+
with:
25+
fetch-depth: 0
26+
27+
- name: Create prompt file
28+
shell: bash
29+
run: |
30+
mkdir -p /tmp/claude-prompts
31+
cat > /tmp/claude-prompts/claude-issue-summarize-prompt.txt << 'EOF'
32+
You're an Summarization assistant for GitHub issues. Your task is to analyze the issue, look up related issues, and summarize the issue.
33+
34+
Remember that this repo is primarily a note-taking and memory device for Chris Mungall, so anything you can do to enhance and enrich that would be helpful.
35+
36+
IMPORTANT: Don't make any PRs. You should ONLY post a response, IN THE SAME ISSUE.
37+
38+
Issue Information:
39+
- REPO: ${{ github.repository }}
40+
- ISSUE_NUMBER: ${{ github.event.issue.number }}
41+
42+
TASK OVERVIEW:
43+
44+
1. First, use your judgement to determine the course of action.
45+
- If the issue is an epic or has links to other issues, read those issues, and summarize them. Summarize their status etc. Given an overall summary.
46+
- If the issue is an idea or a vague high level description, run with the idea, do deep research, give heloful suggestions with links to relevant papers etc.
47+
- If there are links in the issue to websites, database entities, etc, then look these up.
48+
- If there are links or references to papers, then looks these up and summarize (don't guess content - if you can't access the paper, then say "I can't access the paper")
49+
- Try using artl-mcp to get paper fulltext.
50+
- If you want a more powerful AI agent to take on this one and make a PR, use this magic phrase: `@dragon-ai-agent please <INSTRUCTIONS>`
51+
52+
2. Next, use the GitHub tools to get context about the issue:
53+
- You have access to these github tools:
54+
- mcp__github__get_issue: Use this to retrieve the current issue's details including title, description, and existing labels
55+
- mcp__github__get_issue_comments: Use this to read any discussion or additional context provided in the comments
56+
- mcp__github__update_issue: Use this to apply labels to the issue (do not use this for commenting)
57+
- mcp__github__search_issues: Use this to find similar issues that might provide context for proper categorization and to identify potential duplicate issues
58+
- mcp__github__list_issues: Use this to understand patterns in how other issues are labeled
59+
- You can also use web searching and fetching.
60+
61+
- It's okay to not add any information if the issue is not clear.
62+
EOF
63+
64+
- name: Run Claude Code
65+
uses: ./.github/actions/claude-code-action
66+
with:
67+
prompt_file: /tmp/claude-prompts/claude-issue-summarize-prompt.txt
68+
allowed_tools: "Bash(gh label list),WebFetch,Fetch,LS,mcp__github__get_issue,mcp__github__get_issue_comments,mcp__github__update_issue,mcp__github__add_issue_comment,mcp__github__search_issues,mcp__github__list_issues"
69+
install_github_mcp: "true"
70+
install_artl_mcp: "true"
71+
timeout_minutes: ${{ inputs.timeout_minutes }}
72+
anthropic_api_key: ${{ inputs.anthropic_api_key }}
73+
cborg_api_key: ${{ inputs.cborg_api_key }}
74+
github_token: ${{ inputs.github_token }}
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: "Claude Issue Triage Action"
2+
description: "Automatically triage GitHub issues using Claude Code"
3+
4+
inputs:
5+
timeout_minutes:
6+
description: "Timeout in minutes for execution"
7+
required: false
8+
default: "5"
9+
anthropic_api_key:
10+
description: "Anthropic API key"
11+
required: true
12+
cborg_api_key:
13+
description: "CBORG API key"
14+
required: true
15+
github_token:
16+
description: "GitHub token with repo and issues permissions"
17+
required: true
18+
19+
runs:
20+
using: "composite"
21+
steps:
22+
- name: Checkout repository code
23+
uses: actions/checkout@v4
24+
with:
25+
fetch-depth: 0
26+
27+
- name: Create prompt file
28+
shell: bash
29+
run: |
30+
mkdir -p /tmp/claude-prompts
31+
cat > /tmp/claude-prompts/claude-issue-triage-prompt.txt << 'EOF'
32+
You're an issue triage assistant for GitHub issues. Your task is to analyze the issue and select appropriate labels from the provided list.
33+
34+
IMPORTANT: Don't post any comments or messages to the issue. Your only action should be to apply labels.
35+
36+
Issue Information:
37+
- REPO: ${{ github.repository }}
38+
- ISSUE_NUMBER: ${{ github.event.issue.number }}
39+
40+
TASK OVERVIEW:
41+
42+
1. First, fetch the list of labels available in this repository by running: `gh label list`. Run exactly this command with nothing else.
43+
44+
2. Next, use the GitHub tools to get context about the issue:
45+
- You have access to these tools:
46+
- mcp__github__get_issue: Use this to retrieve the current issue's details including title, description, and existing labels
47+
- mcp__github__get_issue_comments: Use this to read any discussion or additional context provided in the comments
48+
- mcp__github__update_issue: Use this to apply labels to the issue (do not use this for commenting)
49+
- mcp__github__search_issues: Use this to find similar issues that might provide context for proper categorization and to identify potential duplicate issues
50+
- mcp__github__list_issues: Use this to understand patterns in how other issues are labeled
51+
- Start by using mcp__github__get_issue to get the issue details
52+
53+
3. Analyze the issue content, considering:
54+
- The issue title and description
55+
- The type of issue (bug report, feature request, question, etc.)
56+
- Technical areas mentioned
57+
- Severity or priority indicators
58+
- User impact
59+
- Components affected
60+
61+
4. Select appropriate labels from the available labels list provided above:
62+
- Choose labels that accurately reflect the issue's nature
63+
- Be specific but comprehensive
64+
- Select priority labels if you can determine urgency (high-priority, med-priority, or low-priority)
65+
- Consider platform labels (android, ios) if applicable
66+
- If you find similar issues using mcp__github__search_issues, consider using a "duplicate" label if appropriate. Only do so if the issue is a duplicate of another OPEN issue.
67+
68+
5. Apply the selected labels:
69+
- Use mcp__github__update_issue to apply your selected labels
70+
- DO NOT post any comments explaining your decision
71+
- DO NOT communicate directly with users
72+
- If no labels are clearly applicable, do not apply any labels
73+
74+
IMPORTANT GUIDELINES:
75+
- Be thorough in your analysis
76+
- Only select labels from the provided list above
77+
- DO NOT post any comments to the issue
78+
- Your ONLY action should be to apply labels using mcp__github__update_issue
79+
- It's okay to not add any labels if none are clearly applicable
80+
EOF
81+
82+
- name: Run Claude Code
83+
uses: ./.github/actions/claude-code-action
84+
with:
85+
prompt_file: /tmp/claude-prompts/claude-issue-triage-prompt.txt
86+
allowed_tools: "Bash(gh label list),mcp__github__get_issue,mcp__github__get_issue_comments,mcp__github__update_issue,mcp__github__search_issues,mcp__github__list_issues"
87+
install_github_mcp: "true"
88+
timeout_minutes: ${{ inputs.timeout_minutes }}
89+
anthropic_api_key: ${{ inputs.anthropic_api_key }}
90+
cborg_api_key: ${{ inputs.cborg_api_key }}
91+
github_token: ${{ inputs.github_token }}

.github/ai-controllers.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
["linkmluser"]

.github/copilot-instructions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../CLAUDE.md

.github/copilot-setup-steps.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: "Copilot Setup Steps"
2+
3+
4+
# Automatically run the setup steps when they are changed to allow for easy validation, and
5+
# allow manual testing through the repository's "Actions" tab
6+
on:
7+
workflow_dispatch:
8+
push:
9+
paths:
10+
- .github/workflows/copilot-setup-steps.yml
11+
pull_request:
12+
paths:
13+
- .github/workflows/copilot-setup-steps.yml
14+
15+
jobs:
16+
# The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
17+
copilot-setup-steps:
18+
runs-on: ubuntu-latest
19+
20+
# Set the permissions to the lowest permissions possible needed for your steps.
21+
# Copilot will be given its own token for its operations.
22+
permissions:
23+
# If you want to clone the repository as part of your setup steps, for example to install dependencies, you'll need the `contents: read` permission. If you don't clone the repository in your setup steps, Copilot will do this for you automatically after the steps complete.
24+
contents: read
25+
26+
# You can define any steps you want, and they will run before the agent starts.
27+
# If you do not check out your code, Copilot will do this for you.
28+
steps:
29+
- name: Checkout code
30+
uses: actions/checkout@v4
31+
32+
- name: Install uv
33+
uses: astral-sh/setup-uv@v5
34+
35+
- name: Install Python tools
36+
run: |
37+
uv sync
38+
source .venv/bin/activate
39+
shell: bash
40+

0 commit comments

Comments
 (0)