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
1 change: 1 addition & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ test target:
rm -rf tmp/{{target}} || echo fresh
cp -pr test/{{target}} tmp
copier copy template tmp/{{target}}
cd tmp/{{target}} && just -f ai.just setup-ai-instructions
5 changes: 5 additions & 0 deletions template/.github/workflows/claude.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Claude Code GitHub action
# ---
# This github action is from the copier template in https://github.com/ai4curation/github-ai-integrations, donated by the Monarch Initiative
# For more documentation, see https://ai4curation.github.io/aidocs/how-tos/set-up-github-actions/
# Author: Chris Mungall (@cmungall)
name: Claude Code

on:
Expand Down
5 changes: 5 additions & 0 deletions template/.github/workflows/dragon-ai.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# DRAGON-AI GitHub action
# ---
# This github action is from the copier template in https://github.com/ai4curation/github-ai-integrations, donated by the Monarch Initiative
# For more documentation, see https://ai4curation.github.io/aidocs/how-tos/set-up-github-actions/
# Author: Chris Mungall (@cmungall)
name: Dragon AI Agent GitHub Mentions

env:
Expand Down
2 changes: 1 addition & 1 deletion template/CLAUDE.md.jinja → template/AGENTS.md.jinja
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# CLAUDE.md for {{project_name}}
# AGENTS.md for {{project_name}}

{{ project_description }}

Expand Down
40 changes: 32 additions & 8 deletions template/ai.just
Original file line number Diff line number Diff line change
@@ -1,22 +1,46 @@
claude:
[ -f CLAUDE.md ] || ln -s AGENTS.md CLAUDE.md

goosehints:
[ -f .goosehints ] || ln -s CLAUDE.md .goosehints
[ -f .goosehints ] || ln -s AGENTS.md .goosehints

copilot-instructions:
[ -f .github/copilot-instructions.md ] || cd .github && ln -s ../CLAUDE.md copilot-instructions.md
[ -f .github/copilot-instructions.md ] || cd .github && ln -s ../AGENTS.md copilot-instructions.md

setup-ai: setup-ai-instructions setup-gh

setup-ai-instructions: goosehints copilot-instructions
setup-ai-instructions: claude goosehints copilot-instructions

setup-gh: gh-add-topics gh-add-secrets

gh-add-topics:
gh repo edit --add-topic "monarchinitiative,ai4curation"

gh-add-secrets:
gh secret set PAT_FOR_PR --body "$PAT_FOR_PR"
gh secret set ANTHROPIC_API_KEY --body "$ANTHROPIC_API_KEY"
gh secret set OPENAI_API_KEY --body "$OPENAI_API_KEY"
gh secret set CBORG_API_KEY --body "$CBORG_API_KEY"
gh secret set CLAUDE_CODE_OAUTH_TOKEN --body "$CLAUDE_CODE_OAUTH_TOKEN"
#!/usr/bin/env bash
set -euo pipefail

# Function to set secret if env var exists
set_secret_if_exists() {
local secret_name="$1"
local gh_var="GH_$secret_name"
local plain_var="$secret_name"

if [ -n "${!gh_var:-}" ]; then
echo "Setting $secret_name from $gh_var"
gh secret set "$secret_name" --body "${!gh_var}"
elif [ -n "${!plain_var:-}" ]; then
echo "Setting $secret_name from $plain_var"
gh secret set "$secret_name" --body "${!plain_var}"
else
echo "Skipping $secret_name (neither $gh_var nor $plain_var is set)"
fi
}

# Set each secret if the corresponding env var exists
set_secret_if_exists "PAT_FOR_PR"
set_secret_if_exists "ANTHROPIC_API_KEY"
set_secret_if_exists "OPENAI_API_KEY"
set_secret_if_exists "CBORG_API_KEY"
set_secret_if_exists "CLAUDE_CODE_OAUTH_TOKEN"