Created
January 17, 2026 19:50
-
-
Save rohjay/0f62d7c71206747acabe83cde9631be8 to your computer and use it in GitHub Desktop.
Agents.md Dropper
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -e | |
| AGENTS_DIR="$HOME/agents" | |
| TARGET_FILE="agents.md" | |
| if [[ -z "$1" ]]; then | |
| echo "❌ Usage: agents <template-name>" | |
| echo " Example: agents wordpress" | |
| exit 1 | |
| fi | |
| TEMPLATE="$1" | |
| SOURCE_FILE="$AGENTS_DIR/$TEMPLATE.md" | |
| if [[ ! -d "$AGENTS_DIR" ]]; then | |
| echo "❌ Agents directory not found: $AGENTS_DIR" | |
| exit 1 | |
| fi | |
| if [[ ! -f "$SOURCE_FILE" ]]; then | |
| echo "❌ Template not found: $SOURCE_FILE" | |
| echo "Available templates:" | |
| ls "$AGENTS_DIR" | sed 's/\.md$//' | sed 's/^/ - /' | |
| exit 1 | |
| fi | |
| if [[ -f "$TARGET_FILE" ]]; then | |
| echo "⚠️ $TARGET_FILE already exists in this directory." | |
| echo "Aborting to avoid clobbering it." | |
| exit 1 | |
| fi | |
| cp "$SOURCE_FILE" "$TARGET_FILE" | |
| echo "✅ Created $TARGET_FILE from '$TEMPLATE' template" | |
| echo "📁 Location: $(pwd)/$TARGET_FILE" |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This allows you to create a list of different
agents.mdfiles (for different projects: a WordPress project, Laravel, Javascript, etc) and drops a copy of your agents.md into your current folder.Drop your project specific agents.md files in a folder inside
~/agents/specific to your project type. For instance, if I'm working on a WordPress site, I'll have a file called~/agents/wordpress.md. Now when I'm in my project folder, I can typeagents wordpressand it'll drop mywordpress.mdinto my current folder asagents.mdYou can also add autocomplete support to your bash profile like this:
Adjust to taste 😉