Use Case: Feature Lifecycle Pipeline

Complexity: Advanced
Trigger: Manual dispatch or Jira issue reaching "Approved for Build"
Deliverables: Architecture doc, requirements spec, implementation PR, governance review report


Goal

Orchestrate an entire feature — from initial brainstorming to a merged pull request with a governance sign-off — inside a single, auditable workflow. Every phase produces a versioned artifact. Human gates ensure the right people approve before work progresses.

This is the flagship Xema use case: a fully integrated software delivery pipeline that replaces ad-hoc Slack threads and manual hand-offs with a deterministic, repeatable process.


Trigger

Manual dispatch (via the Xema UI or API) or automatically when a Jira issue transitions to "Approved for Build". The workflow can run for days or weeks — durable execution keeps it alive across restarts.


Phases

text
1Brainstorming
2    │  ✅ idea-brief artifact
3    ▼
4Architecture Design
5    │  ✅ architecture doc artifact
6    │  🔒 architecture approval gate (tech leads)
7    ▼
8Requirements & Spec
9    │  ✅ deliverable spec artifact
10    │  🔒 spec approval gate (PM + engineering lead)
11    ▼
12Engineering Session
13    │  ✅ implementation branch + PR
14    │  (Interactive session — agent + human collaboration)
15    ▼
16Automated Review
17    │  ✅ code-review artifact
18    ▼
19Governance Review
20    │  🔒 governance gate (security + compliance)
21    ▼
22Merge & Close
23    │  ✅ Jira transition to "Done"
24    └─ Slack notification

Steps

StepTypeDescription
brainstormAgent actionExplores the feature idea; produces a concise idea-brief
arch-designAgent actionDrafts architecture doc — system context, component design, data flow, risks
arch-gateHuman approvalTech leads review and approve or request changes
requirementsAgent actionGenerates full requirements spec from architecture doc
spec-gateHuman approvalPM and engineering lead approve the spec
engineering-sessionInteractive sessionAgent + human pair to implement the feature; emits a PR
automated-reviewAgent actionReviews the PR diff against the spec; flags deviations
governance-reviewAgent actionRuns security, compliance, and policy checks
governance-gateHuman approvalSecurity lead approves or blocks merge
merge-and-closeAgent actionMerges the PR; transitions Jira issue to "Done"; notifies team

Workflow YAML

yaml
1apiVersion: workflow/v1alpha1
2kind: Workflow
3metadata:
4  name: feature-lifecycle-pipeline
5  version: "1.0.0"
6
7on:
8  manual:
9    inputs:
10      - name: featureTitle
11        type: string
12        required: true
13      - name: issueKey
14        type: string
15        required: false
16      - name: repoFullName
17        type: string
18        required: true
19  webhook:
20    provider: jira
21    event: issue.transitioned
22    filters:
23      toStatus: "Approved for Build"
24
25inputs:
26  featureTitle:
27    type: string
28    source: "{{ trigger.inputs.featureTitle | default: event.issue.fields.summary }}"
29  issueKey:
30    type: string
31    source: "{{ trigger.inputs.issueKey | default: event.issue.key }}"
32  repoFullName:
33    type: string
34    source: "{{ trigger.inputs.repoFullName | default: event.issue.fields.customfield_repo }}"
35  techLeads:
36    type: array
37    default: ["{{ env.TECH_LEADS_EMAIL }}"]
38  pmEmail:
39    type: string
40    default: "{{ env.PM_EMAIL }}"
41  securityLeadEmail:
42    type: string
43    default: "{{ env.SECURITY_LEAD_EMAIL }}"
44
45jobs:
46  brainstorm:
47    action: [email protected]
48    input:
49      task: |
50        Explore the following feature idea and produce a concise idea brief.
51        Include: problem statement, proposed solution, key assumptions,
52        risks, and success metrics.
53      context:
54        featureTitle: "{{ inputs.featureTitle }}"
55        issueKey: "{{ inputs.issueKey }}"
56      deliverableSpec: idea-brief-v1
57    output:
58      artifactKey: idea-brief
59
60  arch-design:
61    needs: [brainstorm]
62    action: [email protected]
63    input:
64      task: |
65        Design the architecture for the feature described in the idea brief below.
66        Produce: system context diagram (mermaid), component breakdown,
67        data flow, API contracts (draft), risks and mitigations.
68      context:
69        ideaBrief: "{{ jobs.brainstorm.outputs.artifact.content }}"
70      deliverableSpec: architecture-doc-v1
71    output:
72      artifactKey: architecture-doc
73
74  arch-gate:
75    needs: [arch-design]
76    gate:
77      humanApproval:
78        assignees: "{{ inputs.techLeads }}"
79        timeoutHours: 72
80        timeoutAction: escalate
81        message: |
82          Architecture document ready for review — {{ inputs.featureTitle }}.
83          Doc: {{ jobs.arch-design.outputs.artifact.url }}
84
85  requirements:
86    needs: [arch-gate]
87    action: [email protected]
88    input:
89      task: |
90        Produce a full requirements specification based on the approved architecture document.
91        Include: user stories, functional requirements, non-functional requirements,
92        acceptance criteria, out-of-scope items, and open questions.
93      context:
94        architectureDoc: "{{ jobs.arch-design.outputs.artifact.content }}"
95      deliverableSpec: deliverable-spec-v1
96    output:
97      artifactKey: requirements-spec
98
99  spec-gate:
100    needs: [requirements]
101    gate:
102      humanApproval:
103        assignees:
104          - "{{ inputs.pmEmail }}"
105          - "{{ inputs.techLeads[0] }}"
106        timeoutHours: 48
107        timeoutAction: notify
108        message: |
109          Requirements spec ready for approval — {{ inputs.featureTitle }}.
110          Spec: {{ jobs.requirements.outputs.artifact.url }}
111
112  engineering-session:
113    needs: [spec-gate]
114    action: platform.agent-[email protected]
115    input:
116      task: |
117        Implement the feature described in the spec below in repository {{ inputs.repoFullName }}.
118        Create a feature branch, implement the changes, and open a pull request when done.
119      context:
120        spec: "{{ jobs.requirements.outputs.artifact.content }}"
121        architectureDoc: "{{ jobs.arch-design.outputs.artifact.content }}"
122      repo: "{{ inputs.repoFullName }}"
123    output:
124      prUrl: "{{ outputs.prUrl }}"
125      branchName: "{{ outputs.branchName }}"
126
127  automated-review:
128    needs: [engineering-session]
129    action: [email protected]
130    input:
131      task: |
132        Review the pull request diff against the requirements spec.
133        Flag any deviations, missing acceptance criteria, or quality issues.
134        Produce a code-review document.
135      context:
136        prUrl: "{{ jobs.engineering-session.outputs.prUrl }}"
137        spec: "{{ jobs.requirements.outputs.artifact.content }}"
138      deliverableSpec: code-review-v1
139    output:
140      artifactKey: code-review
141
142  governance-review:
143    needs: [automated-review]
144    action: [email protected]
145    input:
146      task: |
147        Run a governance review for the pull request.
148        Check: security (OWASP Top 10), dependency policy, data handling,
149        compliance with org policies.
150        Produce a governance report with a pass/fail recommendation.
151      context:
152        prUrl: "{{ jobs.engineering-session.outputs.prUrl }}"
153        codeReview: "{{ jobs.automated-review.outputs.artifact.content }}"
154      deliverableSpec: governance-review-v1
155    output:
156      artifactKey: governance-report
157
158  governance-gate:
159    needs: [governance-review]
160    gate:
161      humanApproval:
162        assignees:
163          - "{{ inputs.securityLeadEmail }}"
164        timeoutHours: 24
165        timeoutAction: fail
166        message: |
167          Governance review requires sign-off — {{ inputs.featureTitle }}.
168          Report: {{ jobs.governance-review.outputs.artifact.url }}
169          PR: {{ jobs.engineering-session.outputs.prUrl }}
170
171  merge-and-close:
172    needs: [governance-gate]
173    action: [email protected]
174    input:
175      task: |
176        Merge the approved pull request {{ jobs.engineering-session.outputs.prUrl }}.
177        Transition Jira issue {{ inputs.issueKey }} to "Done".
178        Post a Slack message to the team channel announcing the feature is merged.
179      context:
180        prUrl: "{{ jobs.engineering-session.outputs.prUrl }}"
181        issueKey: "{{ inputs.issueKey }}"
182        featureTitle: "{{ inputs.featureTitle }}"
183        artifactUrls:
184          ideaBrief: "{{ jobs.brainstorm.outputs.artifact.url }}"
185          architectureDoc: "{{ jobs.arch-design.outputs.artifact.url }}"
186          requirementsSpec: "{{ jobs.requirements.outputs.artifact.url }}"
187          codeReview: "{{ jobs.automated-review.outputs.artifact.url }}"
188          governanceReport: "{{ jobs.governance-review.outputs.artifact.url }}"

Extending It

  • Phase gating with quality scores — Use agent outputs (e.g. codeQualityScore > 80) as conditional gates to skip or add steps dynamically.
  • Custom deliverable specs — Replace architecture-doc-v1 and deliverable-spec-v1 with team-specific specs using overlays.
  • Parallel sub-pipelines — Split the engineering phase into parallel frontend and backend sessions that merge before governance review.
  • Multi-repo features — Use a matrix strategy over [org/frontend, org/backend-api] for features that span repositories.
  • Rollback workflow — Chain a rollback workflow that fires if post-merge monitoring detects regressions.

Previous: ← Spec Generation from Backlog
Next: Multi-Repo Audit with Custom Overlays →