Skip to main content

FORGE Resolve-Next-Ticket Workflow

What This Workflow Does

The resolve-next-ticket workflow closes the gap between issue creation (the FORGE Factory, Phases P1-P5) and issue execution. After the factory populates a project board with an Epic/Taskset/Task hierarchy, this workflow determines what to work on next by scanning the board, resolving dependencies, and producing a fully populated implementation prompt. It is the execution-side counterpart to the FORGE Factory Pipeline.

The 6 Phases

PhaseNameInputOutput
1Board ScanProject board URL / org + project numberRaw inventory of all items with statuses
2Hierarchy ReconstructionRaw inventoryStructured tree: Epic → Tasksets → Tasks with blocking edges
3Dependency ResolutionStructured treeSorted candidate list: unblocked tickets ranked by priority + critical path
4Codebase AuditNext ticket + repoCurrent state of affected files, CI config, existing patterns
5Prompt AssemblyResolved ticket + audit results + templateSelf-contained implementation prompt
6Artifact PersistenceWorkflow doc + promptSecret gists with ctx:proto: naming convention

Phase Details

Phase 1: Board Scan

Query the project board using gh project item-list to capture all items with their current column status (Todo / In Progress / Done).
gh project item-list 1 --owner sparki-tools --format json \
  --jq '.items[] | {title, status: .["Status"], number: .content.number}'
Output: Raw list of all items with title, issue number, and board status.

Phase 2: Hierarchy Reconstruction

For each item, fetch the issue body and extract:
  • Tier from labels: epic, taskset, task
  • Parent references from body text: Parent Epic: #N, Parent Taskset: #N
  • Blocking edges from body text: Blocked By: #N, Blocks: #N
  • Priority from labels: priority:p0, priority:p1, priority:p2
Reconstruct the full tree with edges. This reverses the FORGE Factory’s P4 emission — going from flat issues back to a structured DAG.

Phase 3: Dependency Resolution

Walk the DAG and classify each taskset:
ClassificationCriteriaAction
ReadyAll blockers Done, status is TodoCandidate for execution
BlockedAt least one blocker not DoneSkip — list what blocks it
In ProgressAlready being worked onSkip — report current state
DoneCompletedSkip
Among ready candidates, rank by:
  1. Critical path position — prefer tickets that unblock the most downstream work
  2. Priority label — p0 > p1 > p2
  3. Issue number — lower number = created first = natural ordering
Output: The single next ticket to execute, with rationale.

Phase 4: Codebase Audit

For the selected ticket, audit the current repo state:
  • Read every file that will be created or modified
  • Read adjacent configuration files (CI workflows, package.json, tsconfig, etc.)
  • Identify existing patterns to follow (naming conventions, test structure, linter config)
  • Check for any work already started
This prevents the implementation prompt from conflicting with current repo state.

Phase 5: Prompt Assembly

Using the taskset-template-engine XML template, produce a fully self-contained implementation prompt that includes:
  • Pre-filled task issue references with acceptance criteria
  • Exact file paths, content, and verification commands
  • Branch naming convention and commit strategy
  • All context the executing agent needs — zero follow-up questions required

Phase 6: Artifact Persistence

Persist both the reusable workflow and the populated prompt as secret gists:
  • ctx:proto:forge-resolve-next-ticket-workflow.md — the generic workflow (reusable across any board)
  • ctx:proto:<project>-<block>-<description>.md — the populated implementation prompt (specific to this ticket)

Full FORGE Lifecycle

The resolve-next-ticket workflow completes the FORGE lifecycle. The factory creates issues; this workflow selects and prepares them for execution. The dotted edge from “Issue Closed” back to “Project Board” represents the loop: once a ticket is done, the workflow can run again to select the next one. Combined with the Autonomous Execution model, this loop can run unattended overnight.

Companion Artifacts

ArtifactTypeID
Resolve-next-ticket workflow gistctx:protoa30390ef7bcb74c866fae53b88cdc07a
Block 2 implementation prompt gistctx:protoa520575c07afe9efc753ba1c0afb076f
FORGE Factory Agent GuidanceGist995a4a3ae71952975eee3c4f2b2394b0
FORGE A2A Diagram ArchiveGist6a92c1f3858aa86130775034cff995fc
FORGE A2A HandbookGistdc28f6be50d1212ea686004f546efa97
FORGE Deep ResearchGist79ec7d730e0ad707489f19d77eff91f4
Taskset Template EngineGistc30ea47a53d3d26f3f5d23d18be2c2d4