ワンクリックで
arckit-trello
// Export product backlog to Trello - create board, lists, cards with labels and checklists from backlog JSON
// Export product backlog to Trello - create board, lists, cards with labels and checklists from backlog JSON
| name | arckit-trello |
| description | Export product backlog to Trello - create board, lists, cards with labels and checklists from backlog JSON |
You are exporting an ArcKit product backlog to Trello by creating a board with sprint lists, labelled cards, and acceptance criteria checklists via the Trello REST API.
$ARGUMENTS
BOARD_NAME (optional): Override the board name
{Project Name} - Sprint BacklogWORKSPACE_ID (optional): Trello workspace/organization ID to create board in
Reads the JSON backlog produced by $arckit-backlog FORMAT=json and pushes it to Trello:
No template needed - this command exports to an external service, it does not generate a document.
Find the project directory:
projects/ for subdirectoriesLocate the backlog JSON file:
ARC-*-BKLG-*.json in projects/{project-dir}/$arckit-backlog FORMAT=jsonIf no JSON file found:
No backlog JSON file found in projects/{project-dir}/
Please generate one first:
$arckit-backlog FORMAT=json
Then re-run $arckit-trello
Check that Trello API credentials are available as environment variables using Bash:
python3 -c "import os; print('TRELLO_API_KEY=' + ('SET' if os.environ.get('TRELLO_API_KEY') else 'NOT SET')); print('TRELLO_TOKEN=' + ('SET' if os.environ.get('TRELLO_TOKEN') else 'NOT SET'))"
If either is missing:
Trello API credentials not found. Set these environment variables:
# macOS/Linux:
export TRELLO_API_KEY="your-api-key"
export TRELLO_TOKEN="your-token"
# Windows PowerShell:
$env:TRELLO_API_KEY="your-api-key"
$env:TRELLO_TOKEN="your-token"
To get credentials:
1. API Key: https://trello.com/power-ups/admin (select a Power-Up or create one, then get the API key)
2. Token: Visit https://trello.com/1/authorize?expiration=30days&scope=read,write&response_type=token&key=YOUR_API_KEY
Then re-run $arckit-trello
Read the ARC-*-BKLG-*.json file. Extract:
project - project nameepics[] - epic definitionsstories[] - all stories with sprint assignments, priorities, acceptance criteriasprints[] - sprint definitions with themesUse Bash with curl to create the board:
curl -s -X POST "https://api.trello.com/1/boards/" \
--data-urlencode "name={BOARD_NAME or '{Project Name} - Sprint Backlog'}" \
-d "defaultLists=false" \
-d "key=$TRELLO_API_KEY" \
-d "token=$TRELLO_TOKEN" \
${WORKSPACE_ID:+-d "idOrganization=$WORKSPACE_ID"}
Extract the id and url from the response JSON.
If the API returns an error, show the error message and stop.
Create 6 labels on the board:
Priority labels:
Must Have - color: redShould Have - color: orangeCould Have - color: yellowType labels:
Epic - color: purpleStory - color: blueTask - color: greenFor each label:
curl -s -X POST "https://api.trello.com/1/boards/{boardId}/labels" \
--data-urlencode "name={label_name}" \
-d "color={color}" \
-d "key=$TRELLO_API_KEY" \
-d "token=$TRELLO_TOKEN"
Store each label's id for later card assignment.
Create lists in reverse order (Trello prepends new lists to the left, so create in reverse to get correct left-to-right order):
For each list:
curl -s -X POST "https://api.trello.com/1/lists" \
--data-urlencode "name={list_name}" \
-d "idBoard={boardId}" \
-d "key=$TRELLO_API_KEY" \
-d "token=$TRELLO_TOKEN"
Store each list's id for card placement. Map sprint numbers to list IDs.
For each story and task in the backlog JSON, create a card on the appropriate list.
Determine the target list:
sprint number, place on the corresponding sprint listCard name format:
{id}: {title} [{story_points}pts]
Example: STORY-001: Create user account [8pts]
Card description format:
**As a** {as_a}
**I want** {i_want}
**So that** {so_that}
**Story Points**: {story_points}
**Priority**: {priority}
**Component**: {component}
**Requirements**: {requirements joined by ', '}
**Epic**: {epic id} - {epic title}
**Dependencies**: {dependencies joined by ', ' or 'None'}
For tasks (items without as_a/i_want/so_that), use the description field directly instead of the user story format.
Card labels:
curl -s -X POST "https://api.trello.com/1/cards" \
--data-urlencode "name={card_name}" \
--data-urlencode "desc={card_description}" \
-d "idList={list_id}" \
-d "idLabels={label_id1},{label_id2}" \
-d "key=$TRELLO_API_KEY" \
-d "token=$TRELLO_TOKEN"
Store each card's id for checklist creation.
Rate limiting: Trello allows 100 requests per 10-second window per token. For large backlogs (80+ stories), add sleep 0.15 between card creation calls to stay within limits.
For each card that has acceptance_criteria in the JSON:
Create checklist:
curl -s -X POST "https://api.trello.com/1/cards/{cardId}/checklists" \
--data-urlencode "name=Acceptance Criteria" \
-d "key=$TRELLO_API_KEY" \
-d "token=$TRELLO_TOKEN"
Add each criterion as a check item:
curl -s -X POST "https://api.trello.com/1/checklists/{checklistId}/checkItems" \
--data-urlencode "name={criterion_text}" \
-d "key=$TRELLO_API_KEY" \
-d "token=$TRELLO_TOKEN"
After all API calls complete, display:
Backlog exported to Trello successfully!
Board: {board_name}
URL: {board_url}
Lists created:
- Product Backlog
- Sprint 1: {theme} ({N} cards)
- Sprint 2: {theme} ({N} cards)
- ...
- In Progress
- Done
Labels: Must Have (red), Should Have (orange), Could Have (yellow), Epic (purple), Story (blue), Task (green)
Cards created: {total_cards}
- Stories: {N}
- Tasks: {N}
- With acceptance criteria checklists: {N}
Total API calls: {N}
Next steps:
1. Open the board: {board_url}
2. Invite team members to the board
3. Review card assignments and adjust sprint boundaries
4. Begin sprint planning with Sprint 1
No backlog JSON:
No ARC-*-BKLG-*.json file found in projects/{project-dir}/
Please generate one first:
$arckit-backlog FORMAT=json
Then re-run $arckit-trello
Missing credentials:
Trello API credentials not set.
Required environment variables:
TRELLO_API_KEY - Your Trello API key
TRELLO_TOKEN - Your Trello auth token
See: https://developer.atlassian.com/cloud/trello/guides/rest-api/api-introduction/
API error (e.g., invalid key, rate limit):
Trello API error: {error_message}
Check:
- API key and token are valid and not expired
- Workspace ID exists (if specified)
- You have not exceeded rate limits (100 req/10s)
Partial failure (some cards failed): Continue creating remaining cards. At the end, report:
Warning: {N} cards failed to create. Errors:
- STORY-005: {error}
- TASK-012: {error}
Successfully created {M} of {total} cards.
Board URL: {board_url}
$arckit-backlog FORMAT=json - Backlog JSON file (MANDATORY)Trello enforces 100 requests per 10-second window per API token. For a typical backlog:
sleep 0.15 between card/checklist calls to stay within limitsTrello tokens can be created with different expiration periods (1 day, 30 days, or never). If the token has expired, the user will see an "unauthorized" error and needs to generate a new token.
If you need to re-export, either:
This command always creates a new board - it does not update an existing one.
< or > (e.g., < 3 seconds, > 99.9% uptime) to prevent markdown renderers from interpreting them as HTML tags or emoji