Execution-ready activity pages for the DSIT AI Code Lab Legacy Modernisation engagement. Each page is a self-contained instruction set that a team can run inside a timeboxed pilot to evidence where AI accelerates legacy remediation.
index.md Full index with links to every activity
Pilot-Planning-Guide.md How to compose activities across legacy types
L1-Software-Out-of-Support/ 5 activities
L2-Expired-Vendor-Contracts/ 5 activities
L3-Not-Enough-Knowledge-or-Skills-Available/ 7 activities
L4-Cannot-Meet-Current-or-Future-Business-Needs/ 6 activities
L5-Unsuitable-Hardware-or-Physical-Environment/ 6 activities
L6-Known-Security-Vulnerabilities/ 6 activities
L7-Recent-Failures-or-Downtime/ 6 activities
docs/architecture/ Standard location for generated architecture artefacts
- Obtain LITRAF scores for the target system (or assess informally using the likelihood criteria in
context/LITRAF_GOVUK_Guidance.md). - Open the Pilot Planning Guide to identify which legacy types apply, find the matching cluster, and estimate total effort.
- Select activities from the relevant type folders. Not every activity needs to be run; choose based on pilot hypotheses.
- Follow the 5-week pilot structure: Prepare, Assess (Week 1), Execute (Weeks 2-4), Evaluate (Week 5).
This repository includes reusable custom agents under:
- reusable-agents/architecture/architecture-docs-governance.agent.md
- reusable-agents/architecture/architecture-review-security.agent.md
- reusable-agents/architecture/adr-steward.agent.md
- reusable-agents/architecture/architecture-drift-monitor.agent.md
Use the Architecture Docs and Governance Orchestrator as the single user entrypoint for architecture work. It will automatically invoke the supporting architecture subagents when the workflow requires security review, ADR governance, drift validation, or consistency checks.
All architecture artefacts should be stored under docs/architecture/<system-name>/.
Do not start the specialist agents directly in normal use. They exist to support the orchestrator's gated workflow.
The orchestrator now persists workflow gate state, human overrides, approved deviations, and architectural preferences in docs/architecture/<system-name>/workflow-state.yaml.
- In the pilot repository, create the target folder:
.github/agents/. - Copy reusable-agents/architecture/architecture-docs-governance.agent.md into the pilot repo as
.github/agents/architecture-docs-governance.agent.md. - Copy reusable-agents/architecture/architecture-review-security.agent.md into the pilot repo as
.github/agents/architecture-review-security.agent.md. - Copy reusable-agents/architecture/adr-steward.agent.md into the pilot repo as
.github/agents/adr-steward.agent.md. - Copy reusable-agents/architecture/architecture-drift-monitor.agent.md into the pilot repo as
.github/agents/architecture-drift-monitor.agent.md. - Commit the agent files so the whole team can use the same architecture workflow.
The specialist agents are copied because the orchestrator delegates to them. Users should still start with the orchestrator.
Use the Architecture Docs and Governance Orchestrator whenever you want to create, update, review, or validate system architecture.
Basic usage pattern:
- Switch to the
Architecture Docs and Governance Orchestratoragent in Copilot Chat. - Provide the system name, mode, and any evidence sources you already have.
- State the outcome you want: initial baseline, update after a change, legacy inference, greenfield design, or architecture validation.
- Let the orchestrator run the workflow. It will decide when to ask for clarification, when to invoke security review, when ADRs are needed, and when drift or consistency validation should block closure.
Recommended prompt shapes:
- Initial legacy baseline: "Create an initial living architecture pack for in docs/architecture/. Use mode=legacy, strict evidence policy, and produce the architecture outputs needed to start the workflow."
- Greenfield design: "Design the architecture for in docs/architecture/. Use mode=greenfield, document assumptions clearly, create ADRs for major decisions, and run the full workflow to closure."
- Update after change: "Update the living architecture for after the recent change. Apply the workflow, update impacted docs and DSL only, and close any required review or governance gates."
- Legacy validation pass: "Review and reconcile the current implementation of against docs/architecture/. Use mode=hybrid and close the workflow only if consistency and review gates pass."
- In Copilot Chat, switch to the
Architecture Docs and Governance Orchestratoragent. - Provide
mode(greenfield,legacy, orhybrid), system scope, and known evidence sources (repo paths, config files, infra manifests, APIs, ops docs, contracts, SME notes). - Ask for a first-pass architecture pack with strict evidence tagging and confidence levels.
Example prompt:
"Create an initial living architecture pack for in docs/architecture/. Use mode=legacy, strict evidence policy, produce C4 Context and Container DSL, and capture unknowns/questions for validation."
Expected outputs:
docs/architecture/<system-name>/document set.- C4 DSL files for context and container views.
- Confidence summary and an explicit unknowns/assumptions list.
The orchestrator may automatically invoke internal architecture subagents as part of the workflow. Users should not normally invoke these directly.
Automatic security workflow includes:
- OWASP risk categories for architecture and API exposure.
- STRIDE threat modelling across trust boundaries and data flows.
- Vulnerability exposure patterns in authentication, authorization, interfaces, dependencies, and secrets handling.
- Cloud Well-Architected security principles (least privilege, defense in depth, traceability, incident readiness).
Automatic governance workflow includes:
- ADR creation or updates when design intent changes.
- ADR quality gating before closure when ADRs were touched.
- Drift validation after major refactors or high-impact updates.
- Final consistency checking across C4 DSL, docs, ADRs, and workflow state.
The orchestrator keeps the workflow blocked until the required gates pass.
docs/architecture/<system-name>/architecture documents and C4 DSL.docs/architecture/<system-name>/adr/ADR records when design decisions changed.docs/architecture/<system-name>/reviews/review artefacts when review phases ran.docs/architecture/<system-name>/workflow-state.yamlgate and workflow state.
The architecture workflow now includes a lightweight ADR quality gate enforced before closure when ADRs have changed.
The gate checks:
- minimum ADR fields are present
- reciprocal links exist between ADRs and impacted architecture docs
- ADR index entries resolve and statuses match the ADR file contents
Gate output contract:
Gate Status: PASSallows workflow closureGate Status: FAILblocks closure and must include a short remediation checklist
Before workflow closure, the orchestrator must verify that:
- C4 DSL matches architecture docs
- ADR decisions and assumptions match architecture docs
- workflow state reflects the actual gate outcomes and blockers
If contradictions remain, the workflow stays blocked.
- Provide the change context (new integration, dependency upgrade, deployment/runtime change, incident fix, contract change).
- Ask the agent to update only impacted sections and append a dated entry in
CHANGELOG.md. - Re-generate only affected C4 DSL views and keep diagram identifiers stable.
Example prompt:
"Update the living architecture for after the recent change. Identify impacted docs/diagrams, apply minimal updates, append changelog entries, and list follow-up validation questions."
- Always include evidence locations in your prompt to reduce ambiguity.
- Ask for confidence tags (
High,Medium,Low) on all major claims. - Request unresolved questions as a checklist for SME walkthroughs.
- Use short, repeatable update prompts after each material system change to keep docs truly living.
- Use the orchestrator as the only manual entrypoint; it will decide whether review, ADR, drift, and consistency phases are required.
- NFR Scenario Agent: curates and stress-tests quality-attribute scenarios used by the review process.
- Threat Modelling Agent: runs STRIDE-style threat passes and links security concerns into the architecture risk register.
| Activity | Recommended architecture entrypoint | What the orchestrator will handle |
|---|---|---|
| L3-Architecture-Summary | Architecture Docs and Governance Orchestrator | Baseline generation plus any required internal review and governance gates |
| L3-Generate-System-Documentation | Architecture Docs and Governance Orchestrator | Documentation generation plus automatic review and consistency checks when required |
| L3-Documentation-Gap-Analysis | Architecture Docs and Governance Orchestrator (for architecture-related gaps) | Gap remediation, review, ADR, and consistency workflow when architecture work is needed |
| L4-Change-Impact-Mapping | Architecture Docs and Governance Orchestrator | Architecture updates, review, and any required governance or drift validation |
| L6-Architecture-Risk-Scan | Architecture Docs and Governance Orchestrator | Architecture baseline plus automatic internal security review workflow |
Rule of thumb:
- Use Architecture Docs and Governance Orchestrator for all user-driven architecture work.
- Let the orchestrator invoke the supporting architecture agents internally.
The Pilot Orchestrator agent manages the entire lifecycle of a pilot: initialization, activity sequencing, artefact validation, state tracking, and final reporting. Activities themselves are executed offline by the pilot team; the orchestrator records outcomes, validates evidence, and coordinates cross-system dependencies.
-
For a new pilot: Open Copilot Chat, select Pilot Orchestrator, and provide:
- Pilot identifier (e.g.
hmrc-hr-platform-2026q2) - Target system name(s)
- Completed LITRAF report content or file path (if available)
- Pilot identifier (e.g.
-
For an existing pilot: Open Copilot Chat, select Pilot Orchestrator, and provide the pilot identifier. It will load your progress and resume from the last waiting or ready activity.
The orchestrator:
- Initializes pilots from LITRAF reports or discovery inputs
- Selects in-scope activities based on LITRAF scores and existing clusters
- Tracks pilot state in machine-readable (
state.yaml) and human-readable (tracker.md) formats - Sequences activities according to dependencies and phase gates
- Validates offline-completed artefacts before marking activities
done - Coordinates shared outputs across multiple legacy types
- Handles resumability: you can pause and return without losing context
- Delegates report generation when the pilot is ready to close
The orchestrator does not execute individual activities; those are completed offline by the pilot team using the activity pages in this repository.
Every pilot follows a five-phase structure. The orchestrator enforces phase gates to ensure quality.
Prepare (before kickoff)
- Input: LITRAF report or discovery interview
- Output: Selected activity list, dependency map, initialized tracker and state
- Gate: LITRAF artefacts or discovery summary must be stored; tracker rows must be valid
Assess (Week 1)
- Output: Baseline metrics, hypotheses, execute plan, access/governance notes
- Gate: All Assess outputs must exist before moving to Execute
Execute (Weeks 2-4)
- Process: Team completes activities offline; you provide artefacts to orchestrator for validation
- Output: Completed activity artefacts, handoff notes, updated tracker
- Gate: Only validated artefacts unblock downstream activities
Evaluate (Week 5)
- Output: End-state metrics, cross-type observations, evidence completeness checklist
- Gate: Evaluation evidence must be complete before Report phase
Report (post-pilot)
- Output: Private pilot report
- Process: Orchestrator delegates to Pilot Report Synthesiser; you review and approve outputs
Session 1: Initialize
- Select Pilot Orchestrator in Copilot Chat
- Say: "Start a new pilot. Pilot ID:
{your-id}. Target system:{system-name}. Here is the LITRAF report:[paste content or file reference]." - The orchestrator will:
- Create
.github/pilots/{pilot-id}/directory structure - Store LITRAF report as artefact
- Analyze LITRAF scores and identify legacy types
- Map to activity clusters from the Pilot Planning Guide
- Generate
.github/pilots/{pilot-id}/state.yamlwith activity list and dependencies - Generate
.github/pilots/{pilot-id}/tracker.mdwith human-readable status and next actions
- Create
- The orchestrator will display:
- Selected legacy types and cluster
- In-scope activities (prioritized, with dependencies)
- Estimated effort and critical path
- Next action for Assess phase
Session 2+: Assess Phase
- Say: "Continue pilot
{pilot-id}. We have completed Assess phase with these outputs: [attach or describe baseline metrics, hypotheses, execute plan, access notes]." - The orchestrator will:
- Verify Assess gate requirements
- Generate activity cards for Execute phase
- Update tracker to
readyfor first executable activities - Display high-priority execution order
During execution (Weeks 2-4):
-
Team executes offline: Pick an activity from the tracker's
readylist. Follow the activity page instructions. Save all outputs (artefacts, code, reports, metrics). -
Provide outcomes to orchestrator:
- Say: "I have completed
Activity-ID-Nameforsystem-name. Here are the required artefacts: [attach files or descriptions]." - The orchestrator will validate using the Pilot Artefact Gatekeeper.
- If valid, the activity is marked
doneand downstream activities may becomeready. - If incomplete, it moves to
waiting-on-humanwith specific missing evidence listed.
- Say: "I have completed
-
Repeat until all Execute-phase activities in the critical path are complete.
When returning to an in-progress pilot:
- Say: "Resume pilot
{pilot-id}." - The orchestrator will:
- Load current state and tracker
- Display current phase and next required actions
- List
readyactivities you can start - List
waiting-on-humanactivities where evidence is needed - List
blockedactivities and their dependencies
- You can resume from any activity in
readyorwaiting-on-humanstate.
Evaluate phase:
- Say: "We have completed Evaluate. Here is the end-state metrics summary, cross-type observations, and evidence completeness checklist: [provide outputs]."
- The orchestrator verifies all gate requirements and moves to Report phase.
Report phase:
- The orchestrator delegates to Pilot Report Synthesiser.
- Say: "Generate the final private report for DSIT."
- The synthesiser builds:
.github/pilots/{pilot-id}/report/final-report-private.md(private, includes client-specific details and continuation recommendations)
- Review report and request edits if needed.
For pilots spanning multiple target systems with separate LITRAF reports:
- Provide LITRAF report per system during initialization.
- The orchestrator creates per-system sections in tracker and state.
- The orchestrator tracks shared outputs and cross-system handoffs explicitly.
- When an activity completes on System A and its output is needed by System B, the orchestrator marks System B activities as
ready. - Final report includes per-system sections and explicit cross-system findings.
| Term | Meaning |
|---|---|
| Pilot ID | Unique identifier for the pilot (e.g. hmrc-hr-2026q2). Used in file paths and tracker. |
| LITRAF report | Completed assessment document showing scores for each legacy criterion (L1-L7). Required for scoping. |
| Activity | A discrete task from this repository (e.g. "L1 Extract SBOM"). Executed offline by the team. |
| Artefact | Output evidence from a completed activity (code, report, metrics, etc.). Required before marking activity done. |
| Hub activity | An activity whose output is shared across multiple legacy types (e.g. Architecture Summary). Executed once. |
| Cluster | A common combination of legacy types (e.g. L1+L6 "Unpatched and exposed"). See Pilot Planning Guide. |
| Phase gate | Requirement that must be satisfied before advancing to the next phase (e.g. "Assess outputs must be complete"). |
| Blocker | A dependency or resource issue that prevents an activity from progressing. Recorded in tracker. |
| State file | .github/pilots/{pilot-id}/state.yaml — machine-readable source of truth for pilot phase, activities, and dependencies. |
| Tracker | .github/pilots/{pilot-id}/tracker.md — human-readable dashboard of current status and next actions. |
The Pilot Orchestrator orchestrates; the activity pages provide execution instructions. When in Execute phase:
- Open the orchestrator's tracker and pick a
readyactivity. - Open the corresponding activity page from this repository (e.g. L1 Extract SBOM).
- Follow the activity's 12 sections: purpose, scope, AI use, preconditions, tooling, timebox, inputs, outputs, metrics, risks, definition of done, playbook contribution.
- Save all required outputs (artefacts).
- Return to the orchestrator and provide outputs for validation and state update.
Before marking any activity done, the orchestrator invokes the Pilot Artefact Gatekeeper, which checks:
- Completeness: Does the artefact match the activity's "Required Outputs" section?
- Quality: Does the artefact meet the activity's "Definition of Done" criteria?
- Traceability: Can the artefact be traced back to its source (repository, module, incident)?
If validation fails, the activity returns to waiting-on-human with specific feedback on what is missing.
Activities may be blocked or waiting on human decision for these reasons:
- Blocked: Cannot proceed until an upstream activity completes or a dependency is resolved. Orchestrator shows the dependency.
- Waiting-on-human: Requires information from you (artefact, clarification, decision). Orchestrator displays the specific request.
- Ready: All dependencies met, no human input needed. You can start this activity immediately.
When you see waiting-on-human:
- Read the orchestrator's request carefully.
- Provide the missing information, artefact, or decision.
- The orchestrator will validate and update state.
Pilots are designed to be pauseable across sessions:
- All state is stored in files (
.github/pilots/{pilot-id}/state.yamland tracker.md), not in chat memory. - You can leave mid-activity and return within minutes or days.
- When you resume, say "Resume pilot
{pilot-id}" and the orchestrator loads current state. - You continue from the last waiting or ready activity without re-planning.
- Keep LITRAF scores clear. Before starting a pilot, ensure LITRAF scores are finalized. This drives activity selection.
- Select clusters intentionally. Use the Pilot Planning Guide to identify common type combinations and plan cross-system handoffs upfront.
- Complete hub activities first. Architecture Summary, SBOM, and Log Clustering feed multiple downstream activities. Prioritize these early.
- Validate as you go. Don't wait until the end of Execute phase to provide artefacts. Submit after each activity for quick feedback.
- Use tracker as your roadmap. Check the tracker frequently to see what's
ready, what'sblocked, and what's next. - Record cross-system handoffs. When one system's output becomes another system's input (e.g. shared Architecture Summary), the orchestrator tracks this explicitly.
- Ask for clarification. If you don't understand a gate requirement or a gatekeeper feedback, ask the orchestrator to explain.
Each activity follows a 12-section template:
- Why this activity matters
- Scope and steps (numbered sub-tasks)
- How AI is used
- Preconditions
- Tooling (categories with examples)
- Timebox (hours/half-days with confidence tag)
- Inputs
- Outputs
- Metrics (baseline vs observed)
- Risks and mitigations
- Definition of Done
- Playbook contribution (patterns and anti-patterns)
Real systems rarely score on just one LITRAF criterion. The Pilot Planning Guide covers:
- Common type clusters (e.g. L1+L6 "Unpatched and exposed", L4+L3+L7 "Can't change, keeps breaking")
- Hub activities whose outputs are shared across types (Architecture Summary, SBOM, Log Clustering, Triage SAST/SCA)
- Effort savings from running types together rather than in isolation
- Week-by-week schedule template mapping activities to pilot phases
- Dependency diagrams (Mermaid) showing cross-type data flows
| Band | Person-days |
|---|---|
| XS | 1-2 |
| S | 3-5 |
| M | 6-10 |
| L | 11-16 |
| XL | 17-25 |
Keep ROMs in person-days for cross-pilot comparability. Convert to calendar time only in narrative if needed.
Activities are measured using a consistent published set so DSIT can roll up findings across departments.
See Metrics and Measurement Guidance for the canonical definitions, measurement principles, and evidence expectations for P1 to P8.