brainstorming
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).
monday-apiIntegrates with monday.com API using GraphQL queries to manage boards, items, groups, columns, updates, workspaces, and webhooks via monday-api-python-sdk.
Independent GitHub snapshot · Automated classification · Original documentation governs
name: monday-api description: Integrates with monday.com API using GraphQL queries to manage boards, items, groups, columns, updates, workspaces, and webhooks via monday-api-python-sdk. license: MIT compatibility: opencode metadata: version: "1.0.0" domain: coding triggers: monday api, monday.com, monday boards, monday items, monday graphql, monday python, monday automation archetypes:
Integrates with the monday.com API to programmatically manage boards, items, groups, columns, updates, workspaces, tags, and webhooks using the official monday-api-python-sdk library with GraphQL queries.
MondayClient(token=...) from monday_sdk — monday.com uses GraphQL internallyclient.boards, client.items, client.groups, client.columns, client.workspacescomplexity in responsesAPI-Version header (e.g., "2026-01") for quarterly API versioningMondayApiException for structured error recoveryUse this skill when:
Get an API Token — Navigate to https://{subdomain}.monday.com/apps → "Developer" → "API" → "API Tokens" and generate a personal token. Checkpoint: Verify the token works with client.boards.query(limit=1).
Initialize the Client — client = MondayClient(token=os.environ["MONDAY_TOKEN"]). Optionally set debug_mode=True during development to see raw GraphQL queries. Checkpoint: Call client.workspaces.query() to confirm connectivity.
Query Boards and Items — Use client.boards.query() with board_ids or filters. Fetch items with client.items.query(). Always specify the fields parameter to limit the returned data. Checkpoint: Verify the response contains the expected field values.
Mutate Data — Create items with client.items.create_item(), update column values with client.items.change_column_values(), move items with client.items.move_to_board(). Checkpoint: Re-query the item to confirm the mutation persisted.
Monitor Complexity — Each response includes a complexity field. Keep per-query complexity below your tier's limit. If you hit ComplexityLimitExceeded, wait and retry with smaller queries. Checkpoint: Log query_complexity after each operation.
Handle Errors — Wrap in try/except MondayApiException for API errors, ComplexityLimitExceeded for complexity limits. Checkpoint: Log the status_code and response_body for debugging.
import os
from monday_sdk import MondayClient
client = MondayClient(token=os.environ["MONDAY_TOKEN"])
def get_board_items(board_id: int, limit: int = 50) -> list[dict]:
"""Fetch items from a monday.com board with specified fields."""
response = client.boards.query(
board_ids=board_id,
items_page_limit=limit,
fields="id name state items { id name column_values { id text value } }",
)
boards = response.get("data", {}).get("boards", [])
if not boards:
return []
return boards[0].get("items", [])
items = get_board_items(987654321)
for item in items:
print(f"Item: {item['name']} (ID: {item['id']})")
from datetime import datetime
def create_tracking_item(
board_id: int,
group_id: str,
item_name: str,
status: str = "In Progress",
) -> dict:
"""Create an item on a monday.com board with initial column values."""
response = client.items.create_item(
board_id=board_id,
group_id=group_id,
item_name=item_name,
column_values={
"status": {"label": status},
"date": {"date": datetime.now().strftime("%Y-%m-%d")},
"text": "Created via API automation",
},
)
return response.get("data", {})
result = create_tracking_item(
board_id=987654321,
group_id="group_abc123",
item_name="Deploy v2.5.0",
status="Working on it",
)
print(f"Created item: {result}")
def complete_item(item_id: int, completion_note: str) -> dict:
"""Mark an item as done and add a completion note."""
response = client.items.change_multiple_column_values(
item_id=item_id,
column_values={
"status": {"label": "Done"},
"text": completion_note,
},
)
return response
complete_item(123456789, "Deployment completed successfully on 2026-05-23.")
# ❌ BAD — no complexity monitoring, may exceed budget silently
response = client.boards.query(board_ids=123, items_page_limit=500)
items = response["data"]["boards"][0]["items"]
# ✅ GOOD — monitors complexity and limits query scope
def safe_query_boards(board_id: int, complexity_limit: int = 10_000_000) -> list[dict]:
"""Query a board with explicit complexity budget tracking."""
response = client.boards.query(
board_ids=board_id,
items_page_limit=25, # smaller page = lower complexity
fields="id name items (limit 25) { id name }",
)
complexity = response.get("complexity", {})
query_complexity = complexity.get("after", 0)
if query_complexity > complexity_limit:
print(f"Warning: query complexity {query_complexity} exceeds limit {complexity_limit}")
if "errors" in response:
for err in response["errors"]:
if "ComplexityLimitExceeded" in str(err):
print("Complexity limit hit — reduce page size or query scope")
return []
return response.get("data", {}).get("boards", [])
# ❌ BAD — catches all exceptions, loses error context
try:
client.items.create_item(board_id=0, group_id="x", item_name="test")
except Exception as e:
print("Failed:", e)
# ✅ GOOD — typed exception handling
from monday_sdk import MondayApiException
def create_item_safe(board_id: int, group_id: str, item_name: str) -> dict | None:
"""Create an item with typed error handling."""
try:
response = client.items.create_item(
board_id=board_id, group_id=group_id, item_name=item_name
)
if "errors" in response:
print(f"API errors: {response['errors']}")
return None
return response
except MondayApiException as e:
print(f"monday.com API error (status {e.status_code}): {e}")
return None
complexity in every response — stay below your plan's complexity budgetitems_page_limit to 25-50 for regular queries to keep complexity lowfields parameter — wildcard fields (items { * }) waste complexityAPI-Version header to target a specific quarterly API versionEvery integration function should expose:
MondayClient(token=...) with token from envclient.boards.*, client.items.*, client.groups.*try/except MondayApiException with complexity monitoring| Skill | Purpose | |