Claude Skills Guide

Claude Code for Trello Automation Workflow Guide

Trello is a powerful project management tool, but managing boards, lists, and cards manually can become time-consuming. By combining Claude Code CLI with Trello’s API, you can automate repetitive tasks, create custom workflows, and integrate Trello smoothly into your development pipeline.

This guide walks you through setting up Claude Code for Trello automation, with practical examples you can start using today.

Setting Up Your Trello API Integration

Before automating Trello with Claude Code, you’ll need to generate an API key and token from the Trello Developer Portal.

Step 1: Obtain Your API Credentials

  1. Visit https://trello.com/app-key and log in to your Trello account
  2. Copy your API key
  3. Click the link to generate a token (or use the authorization URL)

Step 2: Configure Environment Variables

Store your credentials securely using environment variables:

export TRELLO_API_KEY="your_api_key_here"
export TRELLO_TOKEN="your_token_here"

For persistent configuration, add these to your shell profile (~/.zshrc or ~/.bashrc).

Basic Board Operations with Claude Code

Claude Code can interact with Trello using curl commands or a Python script. Here’s a practical example of creating a board management skill.

Creating a Trello Management Script

#!/usr/bin/env python3
import os
import requests

API_KEY = os.environ.get("TRELLO_API_KEY")
TOKEN = os.environ.get("TRELLO_TOKEN")
BASE_URL = "https://api.trello.com/1"

def get_boards():
    """Fetch all your Trello boards"""
    url = f"{BASE_URL}/members/me/boards"
    params = {"key": API_KEY, "token": TOKEN}
    response = requests.get(url, params=params)
    return response.json()

def create_card(list_id, card_name, card_desc=""):
    """Create a new card in a specified list"""
    url = f"{BASE_URL}/cards"
    params = {
        "key": API_KEY,
        "token": TOKEN,
        "idList": list_id,
        "name": card_name,
        "desc": card_desc
    }
    response = requests.post(url, params=params)
    return response.json()

def move_card(card_id, new_list_id):
    """Move a card to a different list"""
    url = f"{BASE_URL}/cards/{card_id}"
    params = {
        "key": API_KEY,
        "token": TOKEN,
        "idList": new_list_id
    }
    response = requests.put(url, params=params)
    return response.json()

if __name__ == "__main__":
    boards = get_boards()
    for board in boards:
        print(f"- {board['name']} (ID: {board['id']})")

Using the Script with Claude Code

Once saved as trello_manager.py, you can call it from Claude Code:

python3 trello_manager.py

This outputs all your boards, making it easy to copy board IDs for further automation.

Automating Recurring Workflows

One of the most powerful use cases is automating recurring tasks. Here are practical automation patterns:

Daily Standup Card Creator

Automatically create daily standup cards at the start of each day:

#!/bin/bash
# daily-standup.sh

BOARD_ID="your_board_id"
TODO_LIST_ID="your_todo_list_id"
DATE=$(date +%Y-%m-%d)

python3 trello_manager.py create_card "$TODO_LIST_ID" "Standup - $DATE" "Daily standup notes"

Add this to your crontab for automatic execution:

0 9 * * 1-5 /path/to/daily-standup.sh

Card Archival Automation

Keep your boards clean by automatically archiving completed cards:

def archive_completed_cards(list_id):
    """Archive all cards in a completed state"""
    url = f"{BASE_URL}/lists/{list_id}/cards"
    params = {"key": API_KEY, "token": TOKEN}
    cards = requests.get(url, params=params).json()
    
    for card in cards:
        if card.get("idChecklists"):
            # Check if all checklists are complete
            archive_url = f"{BASE_URL}/cards/{card['id']}/closed"
            requests.put(archive_url, params={
                "key": API_KEY, 
                "token": TOKEN, 
                "value": "true"
            })
            print(f"Archived: {card['name']}")

Integrating with Claude Skills

You can create a custom Claude Skill for Trello management. This enables natural language interactions:

# trello_skill.py - A Claude Skill for Trello
"""
# Trello Management Skill

This skill provides commands for managing Trello boards, lists, and cards.

## Commands

- `list boards` - Show all your Trello boards
- `create card <list_name> <card_title>` - Create a new card
- `move <card_title> to <list_name>` - Move a card between lists
- `archive <card_title>` - Archive a card

## Setup

Requires TRELLO_API_KEY and TRELLO_TOKEN environment variables.
"""

import subprocess
import os

def execute_command(command):
    if "list boards" in command:
        result = subprocess.run(
            ["python3", "trello_manager.py"],
            capture_output=True, text=True
        )
        return result.stdout
    # Additional command handlers...

Advanced: Webhook-Based Automation

For real-time automation, set up Trello webhooks that trigger Claude Code actions:

from flask import Flask, request

app = Flask(__name__)

@app.route("/webhook", methods=["POST"])
def trello_webhook():
    data = request.json
    
    # Check if a card was moved to "Done"
    if data["action"]["type"] == "updateCard":
        card = data["action"]["data"]["card"]
        list_after = data["action"]["data"]["listAfter"]
        
        if list_after["name"] == "Done":
            # Trigger follow-up action
            print(f"Card completed: {card['name']}")
            # Add your automation logic here
    
    return "OK"

Best Practices and Security Tips

When automating Trello with Claude Code, keep these recommendations in mind:

Security First

Error Handling

Rate Limiting

Conclusion

Claude Code combined with Trello’s API opens up endless automation possibilities. Start with simple board listing scripts, then progressively build more complex workflows that save time and reduce manual work.

Remember to check Trello’s API documentation for the latest endpoints and capabilities. With proper setup and security measures, you’ll have a powerful automation system that integrates smoothly with your development workflow.

Built by theluckystrike — More at zovo.one