Workflows

End-to-end workflows orchestrating ubFlow agents.

Last Updated: 2026-02-15

Level 0: Stakeholder Needs (WHY)

Workflow Stakeholder Needs

Stories describing the end-to-end workflows that orchestrate ubFlow agents.

Last Updated: 2026-02-06

Need: End-to-End Change Workflow NEED_WF_CHANGE
status: implemented
tags: core, workflow, agents
priority: mandatory

As a developer, I want to follow a defined workflow (Change → Implement → Verify → Memory) to evolve my specifications and code, so that every change is analyzed, implemented with traceability, verified, and captured in project memory.

Acceptance Scenarios:

  1. Given I have a change request, When I start the workflow, Then I know to invoke @change first

  2. Given @change produces an approved Change Document, When I proceed, Then I invoke @implement with the Change Document as input

  3. Given @implement completes, When I proceed, Then I invoke @verify to check completeness

  4. Given @verify passes, When I proceed, Then I invoke @memory to update project context

  5. Given any step fails, When I check the workflow, Then I know which step to revisit

  6. Given @memory completes, When I decide next steps, Then I can either start a new change workflow (@change) or proceed to release (@release)

Need: Independent Quality Checks NEED_WF_QUALITY
status: implemented
tags: core, workflow, quality
priority: high

As a developer, I want to run independent consistency checks on my specifications at any time (horizontal MECE review, vertical traceability), so that I can validate specification quality outside of a change workflow.

Acceptance Scenarios:

  1. Given I want to check one level for consistency, When I invoke @mece, Then I get a horizontal MECE report without needing a Change Document

  2. Given I want to trace one element through all levels, When I invoke @trace, Then I get a vertical coverage report

  3. Given I find issues in a quality check, When I want to fix them, Then I can start a change workflow to address the findings

Need: Release Workflow NEED_WF_RELEASE
status: implemented
tags: core, workflow, release
priority: mandatory

As a ubFlow maintainer, I want to follow a defined release workflow that bundles multiple changes into a versioned release (Version → Validate → Publish), so that I can release stable, tested versions covering multiple changes.

Acceptance Scenarios:

  1. Given multiple changes are merged, When I start a release, Then all changes are bundled into one versioned release

  2. Given I follow the release workflow, When validation passes, Then the release is ready for distribution

  3. Given a release is published, When users update, Then they get all bundled changes together

  4. Given a release is complete, When I want to continue development, Then I can start a new change workflow (@change)

Level 1: Requirements (WHAT)

Workflow Requirements

Requirements for the end-to-end workflows that orchestrate ubFlow agents.

Last Updated: 2026-02-06

Software Requirement: Change Workflow Sequence REQ_WF_CHANGE_SEQUENCE
status: implemented
tags: workflow, change, orchestration
priority: mandatory

Description: ubFlow SHALL define a change workflow with the following sequence:

  1. @change — Analyze change request, create Change Document (US → REQ → SPEC)

  2. @implement — Execute approved changes from Change Document

  3. @verify — Validate implementation against Change Document

  4. @memory — Update project memory (copilot-instructions.md)

After @memory completes, the user SHALL be offered to either start a new change workflow or proceed to a release.

Rationale: A defined sequence ensures consistent change processing. Each step produces output that the next step consumes, creating a pipeline with clear handoff points. The exit point after @memory supports iterative development (multiple changes) before bundling into a release.

Acceptance Criteria:

  • AC-1: Workflow sequence is documented and accessible to users and agents

  • AC-2: Each step’s output serves as input to the next step

  • AC-3: Change Document is the shared artifact between @change and @implement

  • AC-4: @verify references the Change Document for completeness checks

  • AC-5: @memory runs after successful verification

  • AC-6: After @memory, the workflow offers two exit paths: start a new change workflow (@change) or proceed to release (@release)

Software Requirement: Independent Quality Check Workflow REQ_WF_QUALITY_INDEPENDENT
status: implemented
tags: workflow, quality, mece, trace
priority: high
links outgoing: NEED_WF_QUALITY

Description: ubFlow SHALL support independent quality checks that can be invoked at any time without requiring a Change Document:

  • @mece — Horizontal consistency check on one specification level

  • @trace — Vertical traceability check for one element

Rationale: Quality checks should be usable both during change processing (integrated) and as standalone tools (independent). This enables proactive quality management.

Acceptance Criteria:

  • AC-1: @mece and @trace can be invoked without an active change workflow

  • AC-2: Quality check results are self-contained reports

  • AC-3: Quality findings can trigger a new change workflow

  • AC-4: Quality checks do not modify specifications (read-only)

Software Requirement: Release Workflow Sequence REQ_WF_RELEASE_SEQUENCE
status: implemented
tags: workflow, release, orchestration
priority: mandatory
links outgoing: NEED_WF_RELEASE
links incoming: SPEC_REL_WORKFLOW

Description: ubFlow SHALL define a release workflow that bundles multiple changes:

  1. Version — Determine version number, update version.json

  2. Validate — Run documentation build, agent tests, quality checks

  3. Publish — Create Git tag, GitHub Release, publish documentation

Rationale: A release aggregates multiple changes into a distributable version. Unlike the change workflow (per-change), the release workflow operates across changes.

Acceptance Criteria:

  • AC-1: Release workflow operates on a set of merged changes (not single change)

  • AC-2: Version determination follows semantic versioning

  • AC-3: Validation gates block publication on failure

  • AC-4: Release workflow is documented as a reusable template

  • AC-5: After release publication, the workflow offers to start a new change workflow (@change) for continued development

Level 2: Design (HOW)

Agent Framework Design

Shared architectural patterns across all ubFlow agents.

Document Version: 0.2 Last Updated: 2026-02-06

Agent Workflow

Software Detailed Design: Four-Agent Workflow SPEC_AGENT_WORKFLOW

Design: ubFlow implements a four-agent workflow for structured change management.

Agent Responsibilities:

  1. change agent: Analyze request + current implementation → Change Document + US/REQ/SPEC updates

  2. implement agent: Read Change Document → Code + Scripts + Tests (no spec changes)

  3. verify agent: Implementation → Verification Report

  4. memory agent: Project → Updated copilot-instructions.md

Workflow:

User Request
     │
     ▼
┌─────────────┐
│   change    │ ──→ Change Document + US/REQ/SPEC RST updates
└─────────────┘
     │
     ▼ (approved)
┌─────────────┐
│  implement  │ ──→ Code + Scripts + Tests (reads SPECs from Change Doc)
└─────────────┘
     │
     ▼
┌─────────────┐
│   verify    │ ──→ Verification Report
└─────────────┘
     │
     ▼ (passed)
┌─────────────┐
│   memory    │ ──→ Updated copilot-instructions.md
└─────────────┘
     │
     ▼
┌──────────┬──────────┐
│  change  │ release  │  (user decides)
└──────────┴──────────┘

Files:

  • .github/agents/ubFlow.change.agent.md

  • .github/agents/ubFlow.implement.agent.md

  • .github/agents/ubFlow.verify.agent.md

  • .github/agents/ubFlow.memory.agent.md

VS Code Handoffs:

Each agent file includes YAML frontmatter with handoffs: that enable VS Code to suggest the next agent in the workflow.

Main Chain:

change → implement → verify → memory
    ↑                            │
    ├────────────────────────────┘ (next change)
    │
    └── or ──→ release (bundle changes)

Analysis Agents (bidirectional):

mece ↔ trace
  │       │
  └───────┴──→ change (to fix issues)

Memory Agent:

Invoked after verify. Hands off to change (for next change) or release (to bundle changes into a versioned release).

Handoff Format:

---
description: Short agent purpose for UI display
handoffs:
  - label: Display name
    agent: ubFlow.targetagent
    prompt: Default prompt text
---

Initial Prompt Recommendations:

To show ubFlow agents as suggestions when opening a new chat, configure VS Code workspace settings:

File: .vscode/settings.json

{
  "chat.promptFilesRecommendations": {
    "ubFlow.change": true,
    "ubFlow.implement": true,
    "ubFlow.verify": true,
    "ubFlow.mece": true,
    "ubFlow.trace": true,
    "ubFlow.memory": true
  }
}

This ensures users see ubFlow workflow options immediately.

Prompt Architecture

Software Detailed Design: Prompt-Agent Separation SPEC_AGENT_PROMPT_SEPARATION
status: implemented
tags: architecture, prompts
links outgoing: REQ_CORE_SPHINX_NEEDS

Design: Strict separation between prompt files and agent files.

Prompt Files (.github/prompts/*.prompt.md):

  • Minimal frontmatter only

  • Reference the agent, nothing else

  • User-facing entry point

Format:

---
agent: ubFlow.change
---

Agent Files (.github/agents/*.agent.md):

  • Full instructions

  • Workflow descriptions

  • Examples

  • All the logic

Rationale:

  • Prompts are stable entry points

  • Agents can be updated without changing invocation

  • Separation of concerns: WHAT to invoke vs HOW to execute

  • Consistent with speckit design pattern

Agent Interaction

Software Detailed Design: Agent Interaction via Selection Menus SPEC_AGENT_INTERACTION
status: implemented
tags: architecture, agents, ux

Design: All ubFlow agents use the ask_questions tool for presenting choices to the user. This replaces free-text menus with VS Code’s native quick-pick selection UI for a consistent, efficient interaction.

When to Use ``ask_questions``:

  • Workflow transitions (level navigation, agent handoffs within session)

  • Decisions with 2–6 discrete options

  • Confirmations where alternatives exist (approve / revise / pause)

When NOT to Use:

  • Free-form questions requiring typed answers (use normal conversation)

  • Single yes/no confirmations with no meaningful alternatives

Format Reference:

ask_questions({
  questions: [{
    header: "≤12 chars",        // Quick-pick title, unique ID
    question: "Full context",    // Explains what is being decided
    options: [
      { label: "Option A", description: "Brief detail" },
      { label: "Option B", description: "Brief detail", recommended: true }
    ],
    allowFreeformInput: false    // true when custom response is expected
  }]
})

Rules:

  • recommended marks the agent’s suggested default — user sees it pre-selected

  • allowFreeformInput: true when the user’s custom input would be valuable

  • Max 4 questions per call, 2–6 options each

  • Batch related questions into a single call

Implementation via Skill File:

The interaction pattern is consolidated in a skill file instead of being duplicated across agent files:

  • Skill file: .github/skills/ubFlow.ask-questions.skill.md Contains the full pattern description, format reference, rules, and examples.

  • Activation: A single reference in .github/copilot-instructions.md:

    When presenting choices to the user during agent sessions,
    read and follow .github/skills/ubFlow.ask-questions.skill.md.
    
  • Effect: All agents (change, implement, verify, memory, mece, trace, setup) automatically pick up the skill without needing individual instructions in each agent file.

Example — Level Transition (Change Agent):

ask_questions({
  questions: [{
    header: "Continue?",
    question: "Level 1 is saved to the Change Document. Where do you want to continue?",
    options: [
      { label: "Proceed to Level 2 (Design)", description: "Analyze design specs", recommended: true },
      { label: "Revise Level 1", description: "Go back and revise requirements" },
      { label: "Pause here", description: "Save progress and continue later" }
    ]
  }]
})

Traceability

Stakeholder Needs

ID

Title

Status

Priority

NEED_WF_CHANGE

End-to-End Change Workflow

implemented

mandatory

NEED_WF_QUALITY

Independent Quality Checks

implemented

high

NEED_WF_RELEASE

Release Workflow

implemented

mandatory

Requirements

ID

Title

Status

Tags

REQ_WF_CHANGE_SEQUENCE

Change Workflow Sequence

implemented

workflow; change; orchestration

REQ_WF_QUALITY_INDEPENDENT

Independent Quality Check Workflow

implemented

workflow; quality; mece; trace

REQ_WF_RELEASE_SEQUENCE

Release Workflow Sequence

implemented

workflow; release; orchestration

Design Specifications

ID

Title

Status

Links

SPEC_AGENT_INTERACTION

Agent Interaction via Selection Menus

implemented

SPEC_AGENT_PROMPT_SEPARATION

Prompt-Agent Separation

implemented

SPEC_AGENT_WORKFLOW

Four-Agent Workflow

implemented

needflow Diagram

SPEC_AGENT_WORKFLOW