eduard/cobra-boards

Cobra Boards, team task boards you can run from Claude or ChatGPT. FastAPI + DataK3 + appid + Dodil Models + MCP.

A remix template · 1 remixes · Remix eduard/cobra-boards

app/boards/application/sample.py

"""A sample board for someone's first visit, so a new person (or a judge) sees the whole product at
once: overdue cards, a chain of blockers, a half-done checklist, labels and a history. It is
built through the normal use cases, so it obeys every rule, and it is private to that person."""
from datetime import date, timedelta

from boards.domain.model import Person

TITLE = "Welcome to Cobra 🐍"


def build_welcome_board(s, person: Person, today: date, board_id: str = None) -> str:
    d = lambda n: (today + timedelta(days=n)).isoformat()
    bid = s.create_board(person, TITLE, board_id=board_id)["id"]
    s.add_list(person, bid, "Review")
    s.update_list(person, bid, "Review", position=2.5)
    me = person.email
    cards = {}
    plan = [
        ("Launch the new website", "Doing", d(5), ["launch"],
         "The goal of this board. Open it and press “What is blocking this?”."),
        ("QA pass on checkout", "Review", d(1), ["qa"], "Full regression on the payment flow."),
        ("Fix the mobile login bug", "Doing", d(-2), ["bug", "mobile"],
         "Overdue on purpose: see how it's flagged in red."),
        ("Security review", "To do", d(-1), ["security"], ""),
        ("Write the launch announcement", "To do", d(3), ["marketing"], ""),
        ("Send invoice to Acme", "To do", d(2), ["finance"], "Q4 retainer, net 30."),
        ("Chase the unpaid bill", "To do", d(7), ["finance"],
         "Try “Find similar cards” on the invoice card: it finds this one by meaning."),
        ("Try Cobra from ChatGPT or Claude", "To do", None, ["start here"],
         "Connect https://<this app>/mcp as a custom connector, then ask “what's on my plate "
         "this week?”. The agent sees exactly the boards you see."),
        ("Design the logo", "Done", d(-5), ["design"], ""),
    ]
    for title, lst, due, labels, desc in plan:
        cards[title] = s.add_card(person, bid, title, lst, desc, me, due, labels)
    launch, qa = cards["Launch the new website"]["id"], cards["QA pass on checkout"]["id"]
    s.add_blocker(person, launch, qa)
    s.add_blocker(person, qa, cards["Fix the mobile login bug"]["id"])
    s.add_blocker(person, launch, cards["Security review"]["id"])
    out = s.add_checklist_items(person, qa, ["Card payment", "Apple Pay", "Refund flow",
                                             "Receipt email"])
    for item in out["checklist"][:2]:
        s.set_checklist_item(person, qa, item["id"], done=True)
    s.add_comment(person, qa, "Card payment and Apple Pay pass on iOS and Android. Refunds next, "
                              "then the receipt email. Invite a teammate and @mention them here.")
    s.move_card(person, cards["Write the launch announcement"]["id"], "Doing")
    return bid