Skip to content

Rework: expand --focus to handle issue refs instead of separate --issue flag #211

@akashgit

Description

@akashgit

PR #210 review and user feedback identified a fundamental design problem: adding --issue as a separate flag creates unnecessary complexity. Instead, --focus should be expanded to detect issue references automatically.

Problem

  • --issue duplicates --focus semantics — both mean "build exactly this one thing"
  • Adding --issue required 5+ mutual exclusion checks duplicated across cmd_ceo and cmd_run
  • The duplication already caused a bug: missing --mode research mutual exclusion in cmd_run
  • Two flags that serve the same purpose confuse users

Solution

Expand --focus to detect issue refs (bare numbers, URLs, owner/repo#N) using parse_issue_ref from factory/issue.py. When detected, fetch the issue and use it as the focus spec.

factory ceo /path --focus 42
factory ceo /path --focus "https://github.com/owner/repo/issues/42"
factory ceo /path --focus "owner/repo#42"
factory ceo /path --focus "dashboard UI"  # existing behavior unchanged

Changes needed

  1. Remove --issue flag from ceo and run subparsers
  2. In --focus resolution: try parse_issue_ref first; if it matches, fetch issue and format as spec; otherwise treat as backlog item name
  3. Remove all --issue-specific mutual exclusion checks (they collapse into existing --focus exclusions)
  4. Update _build_ceo_task to accept issue metadata from focus resolution
  5. Update tests
  6. Update CEO prompt to document --focus accepting issue refs

Subsumes

  • Bug: missing --mode research + --issue mutual exclusion in cmd_run
  • Quality: duplicated issue-handling code between cmd_ceo and cmd_run
  • Style: kwargs formatting (the kwargs go away)

Refs: PR #210, issue #202

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions