Thanks to visit codestin.com
Credit goes to github.com

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 .github/copilot-instructions.md
1 change: 1 addition & 0 deletions .goosehints
22 changes: 22 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# CLAUDE.md for

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

WARNING: read this closely as it gets a bit meta.

This is a repo for a copier project intended to allow people to set up their github repo with AI github actions.

- template files are in `template/`
- all other files are for this repo itself

So for example

- template/.github/workflows/claude.yml - A template that is copied into a users target repo to set up claude gh actions
- .github/workflows/claude.yml - The actual github actions for this repo itself.

This repo eats its own dogfood! We will occasionally run

`copier copy template .`



22 changes: 0 additions & 22 deletions CLAUDE.md

This file was deleted.

1 change: 1 addition & 0 deletions CLAUDE.md
40 changes: 32 additions & 8 deletions 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_OATH_TOKEN --body "$CLAUDE_CODE_OATH_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"