Skip to content

Commit 07e2442

Browse files
authored
Merge pull request #9 from ai4curation/issue-8
Switch to AGENTS.md as standard in copier template
2 parents 770f383 + 8c33c61 commit 07e2442

File tree

5 files changed

+44
-9
lines changed

5 files changed

+44
-9
lines changed

justfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ test target:
66
rm -rf tmp/{{target}} || echo fresh
77
cp -pr test/{{target}} tmp
88
copier copy template tmp/{{target}}
9+
cd tmp/{{target}} && just -f ai.just setup-ai-instructions

template/.github/workflows/claude.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Claude Code GitHub action
2+
# ---
3+
# This github action is from the copier template in https://github.com/ai4curation/github-ai-integrations, donated by the Monarch Initiative
4+
# For more documentation, see https://ai4curation.github.io/aidocs/how-tos/set-up-github-actions/
5+
# Author: Chris Mungall (@cmungall)
16
name: Claude Code
27

38
on:

template/.github/workflows/dragon-ai.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# DRAGON-AI GitHub action
2+
# ---
3+
# This github action is from the copier template in https://github.com/ai4curation/github-ai-integrations, donated by the Monarch Initiative
4+
# For more documentation, see https://ai4curation.github.io/aidocs/how-tos/set-up-github-actions/
5+
# Author: Chris Mungall (@cmungall)
16
name: Dragon AI Agent GitHub Mentions
27

38
env:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# CLAUDE.md for {{project_name}}
1+
# AGENTS.md for {{project_name}}
22

33
{{ project_description }}
44

template/ai.just

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,46 @@
1+
claude:
2+
[ -f CLAUDE.md ] || ln -s AGENTS.md CLAUDE.md
3+
14
goosehints:
2-
[ -f .goosehints ] || ln -s CLAUDE.md .goosehints
5+
[ -f .goosehints ] || ln -s AGENTS.md .goosehints
36

47
copilot-instructions:
5-
[ -f .github/copilot-instructions.md ] || cd .github && ln -s ../CLAUDE.md copilot-instructions.md
8+
[ -f .github/copilot-instructions.md ] || cd .github && ln -s ../AGENTS.md copilot-instructions.md
69

710
setup-ai: setup-ai-instructions setup-gh
811

9-
setup-ai-instructions: goosehints copilot-instructions
12+
setup-ai-instructions: claude goosehints copilot-instructions
1013

1114
setup-gh: gh-add-topics gh-add-secrets
1215

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

1619
gh-add-secrets:
17-
gh secret set PAT_FOR_PR --body "$PAT_FOR_PR"
18-
gh secret set ANTHROPIC_API_KEY --body "$ANTHROPIC_API_KEY"
19-
gh secret set OPENAI_API_KEY --body "$OPENAI_API_KEY"
20-
gh secret set CBORG_API_KEY --body "$CBORG_API_KEY"
21-
gh secret set CLAUDE_CODE_OAUTH_TOKEN --body "$CLAUDE_CODE_OAUTH_TOKEN"
20+
#!/usr/bin/env bash
21+
set -euo pipefail
22+
23+
# Function to set secret if env var exists
24+
set_secret_if_exists() {
25+
local secret_name="$1"
26+
local gh_var="GH_$secret_name"
27+
local plain_var="$secret_name"
28+
29+
if [ -n "${!gh_var:-}" ]; then
30+
echo "Setting $secret_name from $gh_var"
31+
gh secret set "$secret_name" --body "${!gh_var}"
32+
elif [ -n "${!plain_var:-}" ]; then
33+
echo "Setting $secret_name from $plain_var"
34+
gh secret set "$secret_name" --body "${!plain_var}"
35+
else
36+
echo "Skipping $secret_name (neither $gh_var nor $plain_var is set)"
37+
fi
38+
}
39+
40+
# Set each secret if the corresponding env var exists
41+
set_secret_if_exists "PAT_FOR_PR"
42+
set_secret_if_exists "ANTHROPIC_API_KEY"
43+
set_secret_if_exists "OPENAI_API_KEY"
44+
set_secret_if_exists "CBORG_API_KEY"
45+
set_secret_if_exists "CLAUDE_CODE_OAUTH_TOKEN"
2246

0 commit comments

Comments
 (0)