Skip to content

Instantly share code, notes, and snippets.

@boranbar
Created February 12, 2026 20:35
Show Gist options
  • Select an option

  • Save boranbar/10abba63997bc8a416b7e1620ea0875e to your computer and use it in GitHub Desktop.

Select an option

Save boranbar/10abba63997bc8a416b7e1620ea0875e to your computer and use it in GitHub Desktop.
Custom AI guidelines fetcher for TurkHosting projects
my-custom-guidelines() {
if ! command -v gh &> /dev/null; then
echo "Error: GitHub CLI (gh) is not installed."
echo "Install it with: brew install gh"
return 1
fi
if ! gh auth status &> /dev/null; then
echo "Error: GitHub CLI is not authenticated."
echo "Run: gh auth login"
return 1
fi
mkdir -p .ai/guidelines
gh api repos/TurkHosting/my-custom-guidelines-for-ai-agents/contents/.ai/guidelines/my-custom-guidelines.md --jq '.content' | base64 -d > .ai/guidelines/my-custom-guidelines.md
echo "Custom guidelines added to .ai/guidelines/"
}
@boranbar
Copy link
Author

Setup Instructions

1. Add the function to ~/.zshrc

Copy the function from the file above and paste it into your ~/.zshrc, then run:

source ~/.zshrc

2. Create a Claude Code skill

Tell your Claude Code agent:

Create a custom skill called my-custom-guidelines at ~/.claude/skills/my-custom-guidelines/SKILL.md with the following content:

---
name: my-custom-guidelines
description: Fetch and apply custom AI guidelines from the TurkHosting repo to the current project
disable-model-invocation: true
allowed-tools: Bash(mkdir *), Bash(gh *)
---

Fetch the custom guidelines file from the TurkHosting/my-custom-guidelines-for-ai-agents repo and save it to the current project directory.

Run the following steps:
1. Create the `.ai/guidelines/` directory if it does not exist: `mkdir -p .ai/guidelines`
2. Download the guidelines: `gh api repos/TurkHosting/my-custom-guidelines-for-ai-agents/contents/.ai/guidelines/my-custom-guidelines.md --jq '.content' | base64 -d > .ai/guidelines/my-custom-guidelines.md`
3. Confirm to the user that the file was saved to `.ai/guidelines/my-custom-guidelines.md`

If `gh` is not installed or not authenticated, inform the user to run `brew install gh` and `gh auth login`.

After that, you can use /my-custom-guidelines inside Claude Code to fetch the latest guidelines into any project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment