# πŸ“‹ GreenLight Linear Integration **Extension to GreenLight for Linear Project Management** --- ## πŸ“‹ Linear Issue States Map Linear statuses directly to GreenLight workflow: | Linear Status | Linear Type | GreenLight Step | Emoji | GreenLight State | Trinary | |---------------|-------------|-----------------|-------|------------------|---------| | Backlog | backlog | 1 - Impulse | βš‘πŸ“‹ | void | 0 | | Todo | unstarted | 3 - Capture | πŸ“₯πŸ“ | inbox | 0 | | In Progress | started | 13 - Execute | βš™οΈπŸ”„ | wip | +1 | | In Review | started | 15 - Checkpoint | βœ”οΈπŸ‘€ | wip | +1 | | Done | completed | 19 - Complete | πŸŽ‰βœ… | done | +1 | | Canceled | canceled | 27 - Archive | πŸ“¦βŒ | void | -1 | | Duplicate | canceled | 27 - Archive | πŸ“¦πŸ” | void | 0 | --- ## 🏷️ Linear Labels as GreenLight Tags | Label | Color | GreenLight Emoji | Domain | Description | |-------|-------|------------------|--------|-------------| | Feature | #BB87FC | ✨ | FEATURE | New functionality | | Bug | #EB5757 | πŸ› | BUG | Something broken | | Improvement | #4EA7FC | πŸ”§ | IMPROVEMENT | Enhancement | | Documentation | #8B8B8B | πŸ“š | DOCS | Documentation | | Infrastructure | #F5A623 | πŸ—οΈ | INFRA | DevOps/CI/CD | | Security | #FF6B6B | πŸ”’ | SECURITY | Security issues | | Performance | #00D084 | ⚑ | PERFORMANCE | Optimization | | Design | #E91E63 | 🎨 | DESIGN | UI/UX | | Research | #9C27B0 | πŸ”¬ | RESEARCH | R&D | | Tech Debt | #607D8B | 🧹 | TECH_DEBT | Cleanup | | Blocked | #F44336 | πŸ”’ | BLOCKED | Dependency wait | | GreenLight | #10B981 | 🚦 | GREENLIGHT | GreenLight system | --- ## 🎯 Linear Priorities Map to GreenLight priority tags: | Linear | Value | GreenLight | Emoji | Use Case | |--------|-------|------------|-------|----------| | Urgent | 1 | FIRE | πŸ”₯ | Critical bugs, security | | High | 2 | HIGH | ⭐ | Important features, blockers | | Normal | 3 | MEDIUM | πŸ“Œ | Standard work | | Low | 4 | LOW | πŸ’€ | Nice to have | | No priority | 0 | NONE | βšͺ | Unprioritized | --- ## πŸ“ Linear Projects Recommended projects for BlackRoad OS: | Project | Emoji | GreenLight Domain | Description | |---------|-------|-------------------|-------------| | Lucidia | 🧠 | AI (πŸŒ€) | Core Lucidia AI system | | BlackRoad Platform | πŸ›£οΈ | Platform (πŸ›£οΈ) | Main platform development | | Agent Ecosystem | πŸ€– | AI (πŸŒ€) | 1000 agents project | | GreenLight | 🚦 | Platform (πŸ›£οΈ) | Workflow & state system | | Infrastructure | πŸ—οΈ | Infrastructure (πŸ”§) | DevOps, Cloudflare | | Documentation | πŸ“š | Documentation (πŸ“š) | Docs, guides | | Research | πŸ”¬ | Research (πŸ”¬) | R&D, experiments | --- ## 🎨 Composite Patterns for Linear ### Issue Creation ``` βš‘πŸ“‹πŸ‘‰πŸ“Œ = New issue in backlog, micro scale βœ¨πŸ“‹πŸŽ’β­ = Feature request, macro scale, high priority πŸ›πŸ“‹πŸ‘‰πŸ”₯ = Bug report, micro scale, urgent ``` ### Issue Workflow ``` πŸ“₯πŸ“πŸ‘‰πŸ“Œ = Todo, micro scale, medium priority βš™οΈπŸ”„πŸŽ’β­ = In Progress, macro scale, high priority βœ”οΈπŸ‘€πŸ‘‰πŸ“Œ = In Review, micro scale πŸŽ‰βœ…πŸŽ’πŸŒ = Completed, macro impact ``` ### Labels + Priorities ``` βœ¨πŸŽ’β­πŸ“£ = Feature, macro, high priority πŸ›πŸ‘‰πŸ”₯🚨 = Bug, micro, urgent πŸ”’πŸŽ’πŸ”₯⚠️ = Security issue, macro, urgent βš‘πŸ‘‰β­πŸ“Š = Performance, micro, high priority ``` ### Full Issue Lifecycle ``` [βš‘πŸ“‹] [πŸ“₯πŸ“] [βš™οΈπŸ”„] [βœ”οΈπŸ‘€] [πŸŽ‰βœ…] = Backlog β†’ Todo β†’ In Progress β†’ Review β†’ Done [πŸ›πŸ”₯] [βš™οΈπŸ”„] [πŸŽ‰βœ…] = Bug urgent β†’ Fix β†’ Done [✨⭐] [πŸ“₯πŸ“] [βš™οΈπŸ”„] [πŸŽ‰βœ…] = Feature high β†’ Planned β†’ Building β†’ Shipped ``` --- ## πŸ“ NATS Subject Patterns (Linear) ### Issue Events ``` greenlight.issue.created.micro.platform.{identifier} greenlight.issue.updated.micro.platform.{identifier} greenlight.issue.completed.macro.platform.{identifier} greenlight.issue.canceled.micro.platform.{identifier} ``` ### State Changes ``` greenlight.issue.todo.micro.platform.{identifier} greenlight.issue.in_progress.micro.platform.{identifier} greenlight.issue.in_review.micro.platform.{identifier} greenlight.issue.done.macro.platform.{identifier} ``` ### Label-Specific ``` greenlight.bug.reported.micro.platform.{identifier} greenlight.feature.requested.macro.platform.{identifier} greenlight.security.critical.macro.platform.{identifier} greenlight.blocked.waiting.micro.platform.{identifier} ``` ### Project Events ``` greenlight.project.created.macro.platform.{project_name} greenlight.project.completed.macro.platform.{project_name} ``` ### Comment Events ``` greenlight.comment.added.micro.platform.{identifier} greenlight.command.greenlight.micro.platform.{identifier} ``` --- ## πŸ”¨ Linear Memory Templates ### Issue Operations ```bash # Issue created gl_issue_created() { local identifier="$1" # BLA-123 local title="$2" local label="${3:-feature}" local label_emoji="" case "$label" in feature) label_emoji="✨" ;; bug) label_emoji="πŸ›" ;; improvement) label_emoji="πŸ”§" ;; security) label_emoji="πŸ”’" ;; performance) label_emoji="⚑" ;; *) label_emoji="πŸ“‹" ;; esac gl_log "⚑${label_emoji}πŸ‘‰πŸ“Œ" \ "issue_created" \ "$identifier" \ "$title" } # Issue state changed gl_issue_state_changed() { local identifier="$1" local old_state="$2" local new_state="$3" local state_emoji="" case "$new_state" in "Todo") state_emoji="πŸ“₯πŸ“" ;; "In Progress") state_emoji="βš™οΈπŸ”„" ;; "In Review") state_emoji="βœ”οΈπŸ‘€" ;; "Done") state_emoji="πŸŽ‰βœ…" ;; "Canceled") state_emoji="πŸ“¦βŒ" ;; *) state_emoji="πŸ“‹" ;; esac gl_log "${state_emoji}πŸ‘‰πŸ“Œ" \ "state_changed" \ "$identifier" \ "$old_state β†’ $new_state" } # Issue completed gl_issue_completed() { local identifier="$1" local title="$2" local duration="${3:-unknown}" gl_log "πŸŽ‰βœ…πŸŽ’πŸŒ" \ "issue_completed" \ "$identifier" \ "$title (completed in $duration)" } # Issue blocked gl_issue_blocked() { local identifier="$1" local reason="$2" gl_log "πŸ”’βš οΈπŸ‘‰πŸ”₯" \ "issue_blocked" \ "$identifier" \ "Blocked: $reason" } # Issue assigned gl_issue_assigned() { local identifier="$1" local assignee="$2" gl_log "πŸ‘€πŸ“‹πŸ‘‰πŸ“Œ" \ "issue_assigned" \ "$identifier" \ "Assigned to: $assignee" } # Issue prioritized gl_issue_prioritized() { local identifier="$1" local priority="$2" local priority_emoji="" case "$priority" in 1) priority_emoji="πŸ”₯" ;; 2) priority_emoji="⭐" ;; 3) priority_emoji="πŸ“Œ" ;; 4) priority_emoji="πŸ’€" ;; *) priority_emoji="βšͺ" ;; esac gl_log "${priority_emoji}πŸ“‹πŸ‘‰πŸ“Œ" \ "issue_prioritized" \ "$identifier" \ "Priority: $priority" } ``` ### Project Operations ```bash # Project created gl_project_created() { local project_name="$1" local description="$2" gl_log "πŸ“πŸš€πŸŽ’βœ…" \ "project_created" \ "$project_name" \ "$description" } # Project completed gl_project_completed() { local project_name="$1" local issues_count="$2" gl_log "πŸ“πŸŽ‰πŸŽ’πŸŒ" \ "project_completed" \ "$project_name" \ "$issues_count issues completed" } ``` ### Comment Operations ```bash # Comment added gl_comment_added() { local identifier="$1" local user="$2" local preview="${3:0:50}" gl_log "πŸ’¬πŸ“‹πŸ‘‰πŸ“Œ" \ "comment_added" \ "$identifier" \ "$user: $preview..." } # GreenLight command detected gl_command_detected() { local identifier="$1" local command="$2" gl_log "πŸš¦πŸ“‹πŸ‘‰β­" \ "command_detected" \ "$identifier" \ "GreenLight command: $command" } ``` ### GitHub Integration ```bash # PR linked to issue gl_pr_linked() { local identifier="$1" local pr_url="$2" gl_log "πŸ”—πŸ“‹πŸŽ’πŸ“Œ" \ "pr_linked" \ "$identifier" \ "PR: $pr_url" } # PR merged, issue closed gl_pr_merged() { local identifier="$1" local pr_number="$2" gl_log "βœ…πŸ”—πŸŽ’πŸŽ‰" \ "pr_merged" \ "$identifier" \ "PR #$pr_number merged, issue completed" } # Branch created from issue gl_branch_created() { local identifier="$1" local branch_name="$2" gl_log "πŸŒΏπŸ“‹πŸ‘‰πŸ“Œ" \ "branch_created" \ "$identifier" \ "Branch: $branch_name" } ``` ### Cycle (Sprint) Operations ```bash # Cycle started gl_cycle_started() { local cycle_name="$1" local duration="$2" gl_log "πŸ”„πŸš€πŸŽ’β­" \ "cycle_started" \ "$cycle_name" \ "Sprint started: $duration" } # Cycle completed gl_cycle_completed() { local cycle_name="$1" local completed_count="$2" local total_count="$3" gl_log "πŸ”„πŸŽ‰πŸŽ’πŸŒ" \ "cycle_completed" \ "$cycle_name" \ "Sprint complete: $completed_count/$total_count issues" } ``` --- ## 🎯 Example Integration: Complete Issue Lifecycle ### Scenario: Bug report and fix ```bash # 1. Bug reported gl_issue_created "BLA-42" "Login fails with OAuth" "bug" # [βš‘πŸ›πŸ‘‰πŸ“Œ] issue_created: BLA-42 β€” Login fails with OAuth # 2. Prioritized as urgent gl_issue_prioritized "BLA-42" "1" # [πŸ”₯πŸ“‹πŸ‘‰πŸ“Œ] issue_prioritized: BLA-42 β€” Priority: 1 # 3. Assigned gl_issue_assigned "BLA-42" "alexa" # [πŸ‘€πŸ“‹πŸ‘‰πŸ“Œ] issue_assigned: BLA-42 β€” Assigned to: alexa # 4. Moved to In Progress gl_issue_state_changed "BLA-42" "Todo" "In Progress" # [βš™οΈπŸ”„πŸ‘‰πŸ“Œ] state_changed: BLA-42 β€” Todo β†’ In Progress # 5. Branch created gl_branch_created "BLA-42" "bla-42-fix-oauth-login" # [πŸŒΏπŸ“‹πŸ‘‰πŸ“Œ] branch_created: BLA-42 β€” Branch: bla-42-fix-oauth-login # 6. PR opened gl_pr_linked "BLA-42" "https://github.com/blackroad/api/pull/123" # [πŸ”—πŸ“‹πŸŽ’πŸ“Œ] pr_linked: BLA-42 β€” PR: https://github.com/blackroad/api/pull/123 # 7. Moved to In Review gl_issue_state_changed "BLA-42" "In Progress" "In Review" # [βœ”οΈπŸ‘€πŸ‘‰πŸ“Œ] state_changed: BLA-42 β€” In Progress β†’ In Review # 8. PR merged gl_pr_merged "BLA-42" "123" # [βœ…πŸ”—πŸŽ’πŸŽ‰] pr_merged: BLA-42 β€” PR #123 merged, issue completed # 9. Issue completed gl_issue_completed "BLA-42" "Login fails with OAuth" "3h 24m" # [πŸŽ‰βœ…πŸŽ’πŸŒ] issue_completed: BLA-42 β€” Login fails with OAuth (completed in 3h 24m) ``` ### Scenario: Feature request lifecycle ```bash # 1. Feature requested gl_issue_created "BLA-100" "Add dark mode toggle" "feature" # [βš‘βœ¨πŸ‘‰πŸ“Œ] issue_created: BLA-100 β€” Add dark mode toggle # 2. High priority gl_issue_prioritized "BLA-100" "2" # [β­πŸ“‹πŸ‘‰πŸ“Œ] issue_prioritized: BLA-100 β€” Priority: 2 # 3. Added to project gl_log "πŸ“βœ…πŸ‘‰πŸ“Œ" "project_added" "BLA-100" "Added to BlackRoad Platform project" # 4. Start work gl_issue_state_changed "BLA-100" "Backlog" "In Progress" # [βš™οΈπŸ”„πŸ‘‰πŸ“Œ] state_changed: BLA-100 β€” Backlog β†’ In Progress # 5. Comment added gl_comment_added "BLA-100" "designer" "Figma designs ready for implementation" # [πŸ’¬πŸ“‹πŸ‘‰πŸ“Œ] comment_added: BLA-100 β€” designer: Figma designs ready for implementation... # 6. Complete gl_issue_completed "BLA-100" "Add dark mode toggle" "2 days" # [πŸŽ‰βœ…πŸŽ’πŸŒ] issue_completed: BLA-100 β€” Add dark mode toggle (completed in 2 days) ``` ### Scenario: Blocked issue ```bash # 1. Start work gl_issue_state_changed "BLA-87" "Todo" "In Progress" # [βš™οΈπŸ”„πŸ‘‰πŸ“Œ] state_changed: BLA-87 β€” Todo β†’ In Progress # 2. Hit blocker gl_issue_blocked "BLA-87" "Waiting for API authentication endpoint (BLA-88)" # [πŸ”’βš οΈπŸ‘‰πŸ”₯] issue_blocked: BLA-87 β€” Blocked: Waiting for API authentication endpoint (BLA-88) # 3. Blocker resolved gl_log "πŸ”“βœ…πŸ‘‰β­" "blocker_resolved" "BLA-87" "BLA-88 completed, can proceed" # 4. Resume work gl_issue_state_changed "BLA-87" "Blocked" "In Progress" # [βš™οΈπŸ”„πŸ‘‰πŸ“Œ] state_changed: BLA-87 β€” Blocked β†’ In Progress ``` --- ## πŸ“Š Linear Workspace Details **Workspace:** Blackboxprogramming **URL:** https://linear.app/blackboxprogramming **Team ID:** c33efc9b-38b7-43f3-bccf-eb93ad2e3f93 **Issue Prefix:** BLA- **API:** https://api.linear.app/graphql ### Current Setup: - **Team:** 1 (Blackboxprogramming) - **Projects:** 1 (Lucidia) + 7 recommended - **States:** 7 (Backlog, Todo, In Progress, In Review, Done, Canceled, Duplicate) - **Labels:** 3 (Feature, Bug, Improvement) + 9 recommended - **Priorities:** 5 (0-4, urgent to no priority) --- ## πŸ“š Integration Checklist - [x] Mapped Linear states to GreenLight 27-step workflow - [x] Created label-to-emoji mappings - [x] Mapped priorities to GreenLight tags - [x] Extended NATS subjects for issue/project events - [x] Built 15+ Linear-specific templates - [x] Integrated with GitHub (PR linking, branch creation) - [x] Added mobile integration patterns - [x] Created D1 schema for sync - [x] Webhook handler with GreenLight logging --- **Created:** December 23, 2025 **For:** Linear Project Management Integration **Version:** 2.0.0-linear **Status:** πŸ”¨ IMPLEMENTATION